/* ORBIT v4.9 — compact mobile/tablet/touch system.
   Keeps the approved space visual language while reducing header/hero footprint
   and turning long side rails into optional touch drawers on small screens. */
:root{--orbit-touch:48px;--orbit-mobile-nav:68px}
html{scroll-padding-top:72px}
body.core-native .site{padding-top:12px}
body.core-native .topbar{position:sticky;top:0;z-index:80;margin:0 0 14px;padding:7px 0;min-height:52px;background:linear-gradient(180deg,rgba(6,21,43,.97),rgba(6,21,43,.88) 72%,rgba(6,21,43,0));backdrop-filter:blur(14px);transition:transform .2s ease,opacity .2s ease}
body.core-native .topbar .brand{gap:9px;font-size:1.08rem;letter-spacing:.18em;min-height:44px}
body.core-native .topbar .brand-mark{width:34px;height:34px;border-width:1.5px;flex:0 0 auto}
body.core-native .topbar .brand-mark::before{inset:7px -5px;border-width:1.5px}
body.core-native .topbar .brand-mark::after{width:8px;height:8px}
body.core-native .top-actions{gap:7px;min-width:0}
body.core-native .topbar .pill{min-height:42px;padding:8px 12px;font-size:.86rem}
body.core-native .topbar .searchbar{min-width:0;width:min(300px,32vw);min-height:42px;padding:9px 12px;border-radius:14px}
body.core-native .core-main{gap:14px}

/* Compact editorial headings. Large values/visualizations remain large; navigation copy does not. */
body.core-native .page-head{margin:6px 0 16px;gap:14px}
body.core-native .page-head h1{font-size:clamp(2rem,4.5vw,3.6rem);line-height:1;margin:0 0 8px;letter-spacing:-.035em}
body.core-native .page-head p{font-size:1rem;line-height:1.5}
body.core-native .core-hero{min-height:0;padding:14px 6px 12px}
body.core-native .core-hero h1{font-size:clamp(2.1rem,4.8vw,3.8rem);line-height:1;margin-bottom:7px;letter-spacing:-.04em}
body.core-native .core-hero p{font-size:1rem;line-height:1.45}
body.core-native .section-title{margin:20px 0 10px}

/* Touch fundamentals */
body.core-native button,
body.core-native .button,
body.core-native .pill,
body.core-native .chip,
body.core-native .tab,
body.core-native .nav-link,
body.core-native .core-btn,
body.core-native select,
body.core-native input:not([type="range"]){min-height:44px}
body.core-native input[type="range"]{min-height:42px;touch-action:pan-x}
body.core-native button,body.core-native a,body.core-native select{touch-action:manipulation}
.instrument-canvas,.scale-stage canvas,.gravity-stage canvas,.pattern-stage canvas,.living-stage canvas{touch-action:none}
.sequencer-scroll{overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch}
.course-ribbon,.backend-nav,.core-space-cards,.core-time-regimes{overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch}

/* Learning pages: keep orientation visible without spending a screen on a title. */
.learning-hero{padding:3px 0 13px;gap:14px}
.learning-hero h1{font-size:clamp(2.15rem,4.7vw,3.8rem);line-height:.98;letter-spacing:-.04em;margin:5px 0 9px}
.learning-hero p{font-size:.98rem;line-height:1.5;max-width:900px}
.learning-meta{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px}
.learning-meta span{padding:7px 10px;font-size:.76rem}
.course-ribbon{padding:4px 0 10px;gap:7px}
.course-ribbon button{min-height:44px;padding:8px 13px}
.course-stage{min-height:0;padding:19px;border-radius:26px}
.course-head{padding-bottom:14px}
.course-head h2{font-size:clamp(1.7rem,3.4vw,2.8rem);margin:3px 0}
.course-glyph{font-size:3rem}
.lesson-path{gap:12px;padding-top:20px}
.lesson-node a{padding:13px 15px;border-radius:17px}
.learn-card,.backend-card{border-radius:20px;padding:15px}

/* Lesson reading view */
.lesson-top{padding:4px 0 13px;gap:12px}
.lesson-top h1{font-size:clamp(2rem,4.4vw,3.5rem);line-height:1;letter-spacing:-.04em;margin:5px 0 7px}
.lesson-top-meta{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px}
.lesson-top-meta span{padding:6px 9px;font-size:.76rem}
.lesson-reader{border-radius:25px}
.representation-stage{padding:17px}
.representation-box{min-height:140px;padding:17px;border-radius:20px}
.representation-box .big-symbol{font-size:clamp(2rem,5vw,4rem)}
.representation-box .plain-big{font-size:1.08rem;line-height:1.48}
.lesson-section{padding:20px 22px}
.lesson-section h2{font-size:1.42rem}
.lesson-section p{font-size:1rem}
.practice-block{padding:18px 22px}
.field-note-call{margin:16px 22px;padding:15px 17px}
.reader-dock{top:64px;border-radius:22px;padding:14px;gap:10px}

/* LMS */
.educator-grid{gap:12px}
.backend-nav{border-radius:18px}
.backend-nav button{min-height:44px}
.progress-orbit canvas{height:300px}

/* Instruments: workspace first, title second. */
.instrument-shell{gap:10px}
.instrument-head{gap:12px;padding:1px 2px 9px;align-items:center}
.instrument-head h1,.instrument-hero h1{font-size:clamp(2rem,4.4vw,3.65rem);line-height:1;letter-spacing:-.04em;margin:4px 0 7px}
.instrument-head p,.instrument-hero p{font-size:.96rem;line-height:1.45;max-width:900px}
.instrument-badge{padding:7px 10px;font-size:.75rem}
.instrument-work{gap:12px}
.scale-stage,.gravity-stage,.pattern-stage,.sonic-stage,.living-stage,.instrument-canvas-wrap{min-height:520px;border-radius:25px}
.instrument-canvas{height:520px}
.instrument-console{border-radius:22px;padding:14px;gap:11px}
.instrument-console button,.instrument-console select,.instrument-console input{min-height:46px}
.instrument-console button{padding:9px 11px}
.instrument-readout{padding:10px;border-radius:14px}
.instrument-object-list{max-height:220px}
.scale-zoom{left:11px;right:11px;bottom:10px;padding:6px;border-radius:14px}
.sonic-stage canvas{height:310px}

/* Dock launcher: compact title on desktop too. */
.instrument-dock{min-height:620px;border-radius:28px}
.dock-detail{left:24px;top:20px;max-width:560px}
.dock-detail h1{font-size:clamp(2.15rem,4.4vw,3.65rem);line-height:1;letter-spacing:-.04em;margin:4px 0 8px}
.dock-detail p{font-size:.96rem;line-height:1.45}
.instrument-dock .dock-node{min-height:105px;padding:14px;border-radius:22px}

/* Mobile control drawer injected by mobile-shell.js. */
.mobile-panel-toggle{display:none;width:100%;min-height:48px;border:1px solid #3a5c79;border-radius:16px;background:linear-gradient(135deg,#12324d,#192c4d);color:#fff;font-weight:750;text-align:left;padding:10px 14px;margin:0;cursor:pointer}
.mobile-panel-toggle .toggle-state{float:right;color:#8de9df;font-size:.82rem}
.mobile-panel-collapsed{display:none!important}

@media (max-width:1100px){
  body.core-native .site{padding:10px 18px calc(var(--orbit-mobile-nav) + env(safe-area-inset-bottom) + 24px)}
  body.core-native .bottom-nav{position:fixed;left:50%;bottom:max(8px,env(safe-area-inset-bottom));transform:translateX(-50%);width:min(96vw,880px);margin:0;padding:6px;z-index:75;grid-template-columns:repeat(var(--orbit-nav-count,6),minmax(0,1fr));backdrop-filter:blur(18px);background:rgba(7,22,44,.94);border-radius:20px;box-shadow:0 14px 40px rgba(0,0,0,.34)}
  body.core-native .bottom-nav .nav-link{min-height:52px;padding:6px 5px;border-radius:14px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:1.02rem;line-height:1}
  body.core-native .bottom-nav .label{font-size:.68rem;line-height:1.05;letter-spacing:0}
  body.core-native.orbit-header-hidden .topbar{transform:translateY(calc(-100% - 10px));opacity:.15;pointer-events:none}
  .learning-grid,.lesson-grid{gap:12px}
}

@media (min-width:820px) and (max-width:1100px) and (orientation:landscape){
  .instrument-work{grid-template-columns:minmax(0,1.55fr) minmax(285px,.72fr);align-items:stretch}
  .instrument-console{grid-template-columns:1fr;max-height:560px;overflow:auto;overscroll-behavior:contain}
  .scale-stage,.gravity-stage,.pattern-stage,.sonic-stage,.living-stage,.instrument-canvas-wrap{min-height:520px}
  .instrument-canvas{height:520px}
  .learning-grid{grid-template-columns:minmax(0,1fr) 285px}
  .learner-sidebar{grid-template-columns:1fr}
  .lesson-grid{grid-template-columns:minmax(0,1fr) 285px}
  .reader-dock{position:sticky;top:62px;grid-template-columns:1fr}
  .educator-grid{grid-template-columns:180px minmax(0,1fr)}
  .backend-nav{display:grid;overflow:visible}
}

@media (max-width:760px){
  html{scroll-padding-top:58px}
  body.core-native .site{padding:6px 10px calc(var(--orbit-mobile-nav) + env(safe-area-inset-bottom) + 22px)}
  body.core-native .topbar{min-height:48px;margin-bottom:8px;padding:4px 0}
  body.core-native .topbar .brand{font-size:.95rem;letter-spacing:.14em;gap:7px}
  body.core-native .topbar .brand-mark{width:30px;height:30px}
  body.core-native .top-actions{margin-left:auto}
  body.core-native .top-actions .pill{display:none}
  body.core-native .top-actions .pill:first-of-type{display:grid;width:42px;height:42px;padding:0;place-items:center;font-size:1rem}
  body.core-native .top-actions .pill:first-of-type .label{display:none}
  body.core-native .topbar .searchbar{width:min(42vw,170px);height:42px;padding:8px 10px;font-size:16px}
  body.core-native .page-head{display:block;margin:2px 0 11px}
  body.core-native .page-head h1{font-size:2rem;margin-bottom:5px}
  body.core-native .page-head p{font-size:.94rem;line-height:1.42}
  body.core-native .core-hero{padding:7px 2px 9px}
  body.core-native .core-hero h1{font-size:2.05rem;margin-bottom:5px}
  body.core-native .core-hero p{font-size:.94rem}
  body.core-native .core-orbit-art{opacity:.18;transform:scale(.82);transform-origin:right center}
  body.core-native .section-title{margin:15px 0 8px;display:block}
  body.core-native .section-title h2{font-size:1.35rem}

  .learning-hero,.lesson-top{display:block;padding:0 0 10px}
  .learning-hero h1,.lesson-top h1{font-size:2rem!important;letter-spacing:-.035em;margin:3px 0 6px}
  .learning-hero p,.lesson-top p{font-size:.93rem;line-height:1.42;margin:0}
  .learning-meta,.lesson-top-meta{display:flex;overflow-x:auto;flex-wrap:nowrap;justify-content:flex-start;margin-top:9px;padding-bottom:2px;scrollbar-width:none}
  .learning-meta::-webkit-scrollbar,.lesson-top-meta::-webkit-scrollbar{display:none}
  .learning-meta span,.lesson-top-meta span{flex:0 0 auto;white-space:nowrap}
  .course-ribbon{position:sticky;top:50px;z-index:45;margin:0 -10px;padding:6px 10px 8px;background:rgba(7,22,44,.95);backdrop-filter:blur(12px);scrollbar-width:none}
  .course-ribbon::-webkit-scrollbar{display:none}
  .course-ribbon button{min-height:42px;padding:7px 11px;font-size:.82rem}
  .course-stage{padding:13px;border-radius:20px}
  .course-head{gap:5px;padding-bottom:10px}
  .course-head h2{font-size:1.65rem}
  .course-glyph{font-size:2.25rem}
  .lesson-path{gap:8px;padding:14px 0 4px}
  .lesson-path:before{left:24px;top:16px}
  .lesson-node{grid-template-columns:46px minmax(0,1fr);gap:8px}
  .lesson-node .node-orb{width:46px;height:46px;box-shadow:0 0 0 4px #0b2039}
  .lesson-node.current .node-orb{box-shadow:0 0 0 4px #0b2039,0 0 18px rgba(255,209,111,.18)}
  .lesson-node a{padding:11px 12px;border-radius:14px}
  .lesson-node strong{font-size:.98rem}
  .lesson-node small{font-size:.76rem}
  .lesson-node .mastery{font-size:.78rem}
  .learner-sidebar{gap:9px}
  .learn-card,.backend-card{padding:13px;border-radius:17px}

  .lesson-reader{border-radius:19px}
  .rep-rail{display:flex;overflow-x:auto;scrollbar-width:none;background:#0b2038;gap:5px;padding:5px}
  .rep-rail::-webkit-scrollbar{display:none}
  .rep-rail button{flex:1 0 auto;min-width:94px;min-height:44px;border-radius:12px;padding:8px 10px}
  .representation-stage{padding:12px}
  .representation-box{min-height:120px;padding:13px;border-radius:16px}
  .representation-box .big-symbol{font-size:2.3rem}
  .representation-box .plain-big{font-size:1rem}
  .lesson-section,.practice-block{padding:16px 13px}
  .lesson-section h2{font-size:1.28rem}
  .lesson-section p{font-size:.98rem;line-height:var(--lesson-line,1.58)}
  .worked-example{padding:14px 14px;margin:14px 0}
  .practice-question{padding:13px;border-radius:15px}
  .practice-options button{min-height:48px;padding:11px}
  .field-note-call{margin:12px 13px;padding:13px;border-radius:16px}
  .reader-dock{position:static;grid-template-columns:1fr 1fr;border-radius:17px;padding:12px}
  .mobile-panel-toggle{display:block;position:sticky;bottom:calc(var(--orbit-mobile-nav) + env(safe-area-inset-bottom) + 7px);z-index:42;box-shadow:0 8px 24px rgba(0,0,0,.28)}

  .instrument-head{display:block;padding:0 1px 7px}
  .instrument-head h1,.instrument-hero h1{font-size:2rem!important;letter-spacing:-.035em;margin:2px 0 5px}
  .instrument-head p,.instrument-hero p{font-size:.92rem;line-height:1.4;margin:0}
  .instrument-badge{display:inline-block;margin-top:7px;padding:5px 8px;white-space:normal}
  .instrument-work{gap:7px}
  .scale-stage,.gravity-stage,.pattern-stage,.sonic-stage,.living-stage,.instrument-canvas-wrap{min-height:390px;border-radius:18px}
  .instrument-canvas{height:390px}
  .sonic-stage canvas{height:245px}
  .instrument-console{grid-template-columns:1fr;border-radius:17px;padding:11px;gap:9px}
  .instrument-console button,.instrument-console select{min-height:48px}
  .preset-strip,.mode-strip,.species-strip,.field-tool-strip,.instrument-actions,.instrument-linkbar{gap:6px}
  .preset-strip button,.mode-strip button,.species-strip button,.field-tool-strip button,.instrument-actions button{flex:1 1 auto;min-width:92px;padding:8px 9px}
  .instrument-object-list{max-height:180px}
  .sequencer-grid{gap:4px;padding:10px;min-width:700px}
  .seq-step{min-width:32px;min-height:32px}
  .scale-hud,.gravity-hud,.living-hud{top:8px;left:8px;right:8px;gap:4px}
  .scale-hud span,.gravity-hud span,.living-hud span{padding:5px 7px;font-size:.7rem}
  .gravity-vector-help{bottom:8px;font-size:.7rem}
  .scale-zoom{grid-template-columns:42px 1fr 42px}

  /* Mobile launcher becomes a compact spatial menu rather than an oversized pseudo-map. */
  .instrument-dock{min-height:0;display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:13px;border-radius:20px;background:radial-gradient(circle at 50% 27%,#153d5a 0,#091d35 40%,#06152b 100%)}
  .dock-detail{position:relative;left:auto;right:auto;top:auto;grid-column:1/-1;max-width:none;padding:1px 2px 6px}
  .dock-detail h1{font-size:2rem!important;margin:2px 0 5px}
  .dock-detail p{font-size:.91rem;line-height:1.4;margin:0}
  .dock-orbit{opacity:.22;top:41%}
  .instrument-dock .dock-core{position:relative;left:auto;top:auto;transform:none;grid-column:1/-1;width:100%;height:auto;min-height:66px;border-radius:17px;padding:10px}
  .instrument-dock .dock-node,.instrument-dock .n1,.instrument-dock .n2,.instrument-dock .n3,.instrument-dock .n4,.instrument-dock .n5{position:relative;left:auto;right:auto;top:auto;bottom:auto;transform:none;width:auto!important;min-height:92px;padding:11px;border-radius:16px}
  .instrument-dock .n5{grid-column:1/-1}
  .instrument-dock .dock-node:hover,.instrument-dock .n5:hover{transform:none}
  .instrument-dock .dock-node b{font-size:1.45rem}
  .instrument-dock .dock-node strong{font-size:1rem}
  .instrument-dock .dock-node small{font-size:.75rem}
  .dock-footer{justify-content:flex-start;overflow-x:auto;flex-wrap:nowrap;padding-bottom:3px;scrollbar-width:none}
  .dock-footer::-webkit-scrollbar{display:none}
  .dock-footer a{flex:0 0 auto;min-height:44px}

  .educator-grid{display:block}
  .backend-nav{position:sticky;top:50px;z-index:44;display:flex;overflow-x:auto;gap:4px;margin:0 -10px 9px;padding:6px 10px;border-radius:0;background:rgba(7,22,44,.95);scrollbar-width:none}
  .backend-nav::-webkit-scrollbar{display:none}
  .backend-nav button{flex:0 0 auto;white-space:nowrap;padding:8px 10px}
  .overview-grid{gap:9px}
  .progress-orbit canvas{height:240px}
  .course-progress-row{grid-template-columns:95px 1fr 42px;gap:7px;font-size:.82rem}
  .plan-list,.support-summary-grid{grid-template-columns:1fr}

  body.core-native .bottom-nav{width:calc(100% - 12px);bottom:max(6px,env(safe-area-inset-bottom));padding:5px;border-radius:17px}
  body.core-native .bottom-nav .nav-link{min-height:51px;padding:5px 2px;font-size:.95rem;border-radius:12px}
  body.core-native .bottom-nav .label{font-size:.62rem;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}

@media (max-width:420px){
  body.core-native .site{padding-left:8px;padding-right:8px}
  body.core-native .topbar .brand>span:last-child{font-size:.86rem}
  body.core-native .topbar .searchbar{width:132px}
  body.core-native .bottom-nav .nav-link{font-size:.9rem}
  body.core-native .bottom-nav .label{font-size:.58rem}
  .scale-stage,.gravity-stage,.pattern-stage,.sonic-stage,.living-stage,.instrument-canvas-wrap{min-height:350px}
  .instrument-canvas{height:350px}
  .sonic-stage canvas{height:220px}
  .instrument-dock{grid-template-columns:1fr}
  .instrument-dock .n5{grid-column:auto}
  .instrument-dock .dock-core{grid-column:auto}
  .dock-detail{grid-column:auto}
  .reader-dock{grid-template-columns:1fr}
}

@media (prefers-reduced-motion:reduce){
  body.core-native .topbar{transition:none}
}

/* Final tablet density cap: titles orient the learner without dominating the workspace. */
@media (min-width:761px) and (max-width:1100px){
  body.core-native .page-head h1,body.core-native .core-hero h1,.learning-hero h1,.lesson-top h1,.instrument-head h1,.instrument-hero h1,.dock-detail h1{font-size:clamp(2rem,4vw,2.8rem);line-height:1}
  .learning-hero p,.lesson-top p,.instrument-head p,.dock-detail p{font-size:.94rem;line-height:1.42}
}
