/* FOH Academy — two themes from one token set.
   Light "B · bright study app": cool grey ground, white cards, orange lead, blue second.
   Dark  "A · modern console": graphite ground, amber select-LED lead, cyan meter second. */
:root {
  --bg: #F2F3F5;
  --side: #FFFFFF;
  --card: #FFFFFF;
  --card-2: #F5F6F8;
  --line: #E3E5E9;
  --ink: #15171A;
  --ink-2: #3A3F47;
  --muted: #5F6670;
  --accent: #FF5B22;
  --accent-text: #C2410C;
  --accent-ink: #FFFFFF;
  --accent-soft: #FFF1EA;
  --accent2: #2F6BFF;
  --accent2-text: #1F54D6;
  --accent2-soft: #E8EFFF;
  --ok: #12A150;
  --ok-text: #0B7A3B;
  --ok-soft: #E3F6EC;
  --bad: #D93A2B;
  --bad-text: #B42D20;
  --bad-soft: #FDECEA;
  --tip-bg: #FFF6D6;
  --tip-ink: #5C4A12;
  --tip-mark: #B07A00;
  --scr-bg: #F5F6F8;
  --scr-grid: #E3E5E9;
  --scr-line: #2F6BFF;
  --track: #DADDE2;
  --cap: #FFFFFF;
  --cap-edge: rgba(0,0,0,.22);
  --knob: #E9EBEF;
  --knob-cap: #FFFFFF;
  --scene-bg: #FF5B22;
  --scene-soft: #FF7A4A;
  --scene-line: #FFFFFF;
  --scene-ink: #FFFFFF;
  --scene-chip: rgba(255,255,255,.22);
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 6px 20px rgba(16,24,40,.06);
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 10px;
  --f-body: "Plus Jakarta Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D0F12; --side: #12151A; --card: #171B21; --card-2: #0A0C0F; --line: #232831;
    --ink: #ECEEF1; --ink-2: #C9CED6; --muted: #8A93A0;
    --accent: #FFB547; --accent-text: #FFB547; --accent-ink: #0D0F12; --accent-soft: rgba(255,181,71,.1);
    --accent2: #5CE1E6; --accent2-text: #5CE1E6; --accent2-soft: rgba(92,225,230,.1);
    --ok: #4DD68C; --ok-text: #4DD68C; --ok-soft: rgba(77,214,140,.1);
    --bad: #F06A5A; --bad-text: #F48A7D; --bad-soft: rgba(240,106,90,.12);
    --tip-bg: rgba(255,181,71,.08); --tip-ink: #E2D3B8; --tip-mark: #FFB547;
    --scr-bg: #0A0C0F; --scr-grid: #182027; --scr-line: #5CE1E6;
    --track: #262C35; --cap: #D9DEE4; --cap-edge: rgba(0,0,0,.6); --knob: #232831; --knob-cap: #12151A;
    --scene-bg: #14181E; --scene-soft: #1B2027; --scene-line: #4A5260; --scene-ink: #ECEEF1; --scene-chip: rgba(92,225,230,.12);
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D0F12; --side: #12151A; --card: #171B21; --card-2: #0A0C0F; --line: #232831;
  --ink: #ECEEF1; --ink-2: #C9CED6; --muted: #8A93A0;
  --accent: #FFB547; --accent-text: #FFB547; --accent-ink: #0D0F12; --accent-soft: rgba(255,181,71,.1);
  --accent2: #5CE1E6; --accent2-text: #5CE1E6; --accent2-soft: rgba(92,225,230,.1);
  --ok: #4DD68C; --ok-text: #4DD68C; --ok-soft: rgba(77,214,140,.1);
  --bad: #F06A5A; --bad-text: #F48A7D; --bad-soft: rgba(240,106,90,.12);
  --tip-bg: rgba(255,181,71,.08); --tip-ink: #E2D3B8; --tip-mark: #FFB547;
  --scr-bg: #0A0C0F; --scr-grid: #182027; --scr-line: #5CE1E6;
  --track: #262C35; --cap: #D9DEE4; --cap-edge: rgba(0,0,0,.6); --knob: #232831; --knob-cap: #12151A;
  --scene-bg: #14181E; --scene-soft: #1B2027; --scene-line: #4A5260; --scene-ink: #ECEEF1; --scene-chip: rgba(92,225,230,.12);
  --shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--ink); }
body { font-family: var(--f-body); font-size: 16px; line-height: 1.75; margin: 0; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg); }
h1, h2, h3 { margin: 0; text-wrap: balance; line-height: 1.3; }
h1 { font-size: clamp(26px, 3.6vw, 36px); font-weight: 800; }
h2 { font-size: clamp(22px, 2.8vw, 30px); font-weight: 800; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent-text); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.note { font-size: 13px; color: var(--muted); line-height: 1.7; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--accent-text); text-transform: uppercase; }

/* ---------- shell: full-width page, course tree in a drawer ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; display: flex; align-items: center; gap: 14px; height: 56px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar .crumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--muted); }
.topbar .crumb b { color: var(--ink); font-weight: 800; }
.topbar .grow { flex: 1; }
.menu-btn { display: inline-flex; align-items: center; gap: 8px; }
.menu-btn svg { width: 18px; height: 18px; }
.shell { min-height: calc(100vh - 56px); padding-block: 16px 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.side { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(340px, 88vw); overflow-y: auto; background: var(--side); border-right: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0,0,0,.25); padding: calc(18px + env(safe-area-inset-top, 0px)) 14px calc(24px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px)); display: grid; align-content: start; gap: 18px; transform: translateX(-105%); transition: transform .32s cubic-bezier(.2,.7,.2,1); visibility: hidden; }
.side.open { transform: none; visibility: visible; }
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(8,10,14,.45); opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; font-size: 18px; line-height: 1; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.logo { width: 36px; height: 36px; border-radius: 12px; background: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.logo svg { width: 20px; height: 20px; }
.brand b { font-size: 16px; font-weight: 800; display: block; line-height: 1.2; }
.brand span { font-size: 12px; color: var(--muted); }
.progress-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-md); background: var(--accent-soft); }
.progress-card b { font-size: 18px; font-weight: 800; display: block; line-height: 1.2; }
.progress-card span { font-size: 12px; color: var(--muted); }
.ring { width: 48px; height: 48px; flex-shrink: 0; }
.ring .bgc { fill: none; stroke: var(--line); stroke-width: 6; }
.ring .fgc { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; transition: stroke-dasharray .6s; }
.tree { display: grid; gap: 16px; }
.stage-t { font-size: 12px; font-weight: 800; color: var(--muted); padding: 0 8px 2px; }
.les { display: grid; gap: 2px; }
.les-t { font-size: 13px; font-weight: 700; padding: 4px 8px; display: flex; gap: 8px; color: var(--ink-2); }
.les-t .no { font-family: var(--f-mono); font-size: 12px; color: var(--accent-text); padding-top: 1px; }
.les.soon .les-t { color: var(--muted); font-weight: 500; }
.les.soon .no { color: var(--muted); }
.kp-link { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: center; text-decoration: none; color: var(--ink); font-size: 13.5px; line-height: 1.45; padding: 8px 8px; border-radius: 12px; }
.kp-link:hover { background: var(--card-2); }
.kp-link.cur { background: var(--ink); color: var(--bg); font-weight: 700; }
.kp-link.locked { color: var(--muted); }
.num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }
.num.pass { background: var(--ok); border-color: var(--ok); color: #fff; }
.num.open { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.side-foot { display: grid; gap: 8px; font-size: 13px; padding: 0 6px; }
.theme-sw { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); justify-self: start; }
.theme-sw button { border: 0; background: transparent; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--muted); }
.theme-sw button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.main { min-width: 0; display: grid; gap: 16px; align-content: start; }
.main.learning .scene { display: none; }

/* ---------- scene banner ---------- */
.scene { position: relative; min-height: 196px; border-radius: var(--r-lg); overflow: hidden; background: var(--scene-bg); border: 1px solid var(--line); color: var(--scene-ink); }
.scene svg.bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene .over { position: relative; display: grid; gap: 6px; align-content: end; min-height: 196px; padding: 26px 30px; }
.scene .place { justify-self: start; font-size: 12px; font-weight: 800; background: var(--scene-chip); padding: 4px 12px; border-radius: 999px; }
.scene .crumb { font-size: 13px; opacity: .85; }
.sc-line { fill: none; stroke: var(--scene-line); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.sc-thin { fill: none; stroke: var(--scene-line); stroke-width: 1.5; opacity: .7; }
.sc-fill { fill: var(--scene-line); }
.sc-soft { fill: var(--scene-soft); }
.sc-acc { fill: var(--accent); }
.sc-acc2 { fill: var(--accent2); }
:root:not([data-theme="dark"]) .scene .sc-acc { fill: #FFFFFF; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .scene .sc-acc { fill: var(--accent); } }

/* ---------- tabs ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--side); border: 1px solid var(--line); justify-self: start; flex-wrap: wrap; }
.tab { border: 0; background: transparent; padding: 8px 18px; border-radius: 10px; color: var(--muted); font-weight: 700; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; }
.tab.on { background: var(--accent); color: var(--accent-ink); }
.tab .pill { font-size: 11px; }
.body { display: grid; gap: 18px; min-width: 0; }

/* ---------- buttons, pills ---------- */
.btn { border: 1px solid var(--line); background: var(--card); padding: 9px 18px; border-radius: 12px; font-size: 14px; font-weight: 700; line-height: 1.4; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.ghost { background: transparent; }
.btn.on, .btn.playing { border-color: var(--accent); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent); }
.btn:disabled { opacity: .4; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill { font-size: 12px; padding: 2px 9px; border-radius: 999px; font-weight: 700; white-space: nowrap; line-height: 1.6; background: var(--card-2); color: var(--muted); }
.pill.ok { background: var(--ok-soft); color: var(--ok-text); } .pill.warn { background: var(--tip-bg); color: var(--tip-mark); } .pill.acc { background: var(--accent); color: var(--accent-ink); }
.chip { border: 1px solid var(--line); background: var(--card); padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }

/* ---------- slide deck ---------- */
.deck { display: grid; gap: 14px; }
.deck-top { display: flex; align-items: center; gap: 14px; }
.deck-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.deck-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s cubic-bezier(.2,.7,.2,1); }
.deck-count { font-size: 13px; color: var(--muted); min-width: 56px; text-align: right; }
.stagebox { position: relative; overflow: hidden; border-radius: var(--r-lg); }
/* the slide fills the window: topbar 56 + tabs ~50 + deck chrome ~110 + paddings */
.slide { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); min-height: max(500px, calc(100vh - 270px)); padding: clamp(24px, 4vw, 72px); display: grid; gap: clamp(18px, 2vw, 30px); align-content: center; font-size: clamp(16px, 1.15vw, 20px); }
.slide .kicker { font-size: 0.78em; font-weight: 800; letter-spacing: .08em; color: var(--accent-text); }
.slide h2 { font-size: clamp(24px, 2.6vw, 44px); }
.slide .cover h1, .slide.cover h1 { font-size: clamp(30px, 3.6vw, 58px); }
.slide .lead { font-size: 1.15em; color: var(--ink-2); line-height: 1.8; }
.slide .txt { display: grid; gap: 14px; align-content: center; min-width: 0; }
.slide .txt p { color: var(--ink-2); max-width: 62ch; }
.slide .termbox p, .slide .live, .slide .tipbox { font-size: 0.92em; }
.vis svg.ill { max-width: min(640px, 100%); }
.slide .q-text { font-size: 1.15em; }
.slide .txt b { color: var(--ink); }
.slide .txt ul { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; color: var(--ink-2); }
.split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 44px); align-items: center; }
.split.flip > .vis { order: -1; }
.vis { min-width: 0; display: grid; place-items: center; }
.vis svg.ill { width: 100%; height: auto; display: block; max-height: calc(100vh - 380px); min-height: 200px; }
.figure { background: var(--card-2); border-radius: var(--r-md); padding: 18px; width: 100%; display: grid; place-items: center; }
.figure figcaption { font-size: 13px; color: var(--muted); text-align: center; padding-top: 8px; }
.cover { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.cover h1 { font-size: clamp(30px, 4.4vw, 46px); }
.goals { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.goals li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; color: var(--ink-2); font-size: 15px; }
.goals li::before { content: ""; width: 18px; height: 18px; margin-top: 4px; border-radius: 6px; background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.big-stmt { text-align: center; justify-items: center; }
.big-stmt .bignum { font-family: var(--f-mono); font-size: clamp(40px, 7vw, 76px); font-weight: 600; line-height: 1.1; color: var(--accent-text); letter-spacing: -.02em; }
.big-stmt p { max-width: 52ch; color: var(--ink-2); font-size: 17px; }
.termbox { border-radius: var(--r-md); background: var(--card-2); border: 1px solid var(--line); padding: 16px 18px; display: grid; gap: 6px; }
.termbox .th { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.termbox .th b { font-size: 19px; font-weight: 800; }
.termbox .en { font-size: 13px; color: var(--muted); font-weight: 600; }
.termbox .tag { font-size: 11px; font-weight: 800; color: var(--accent2-text); background: var(--accent2-soft); padding: 1px 8px; border-radius: 999px; }
.live { font-size: 14px; color: var(--ink-2); background: var(--accent-soft); border-radius: var(--r-sm); padding: 10px 14px; }
.live::before { content: "现场里  "; font-weight: 800; color: var(--accent-text); }
.tipbox { border-radius: var(--r-md); background: var(--tip-bg); color: var(--tip-ink); padding: 14px 18px; display: grid; grid-template-columns: 28px 1fr; gap: 10px; font-size: 14px; }
.tipbox i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: var(--tip-mark); color: var(--card); }
.tipbox b { display: block; color: var(--tip-ink); }
.gearbox { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: start; }
.gear-ic { width: 96px; height: 96px; border-radius: 22px; background: var(--card-2); border: 1px solid var(--line); display: grid; place-items: center; }
.gear-ic svg { width: 64px; height: 64px; }
.brandbox { border: 1px dashed var(--line); border-radius: var(--r-md); padding: 14px 16px; display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.brandbox b { color: var(--ink); }
.check { gap: 16px; align-content: start; }
.check .qcard { border: 0; padding: 0; box-shadow: none; background: transparent; }
.check-tag { justify-self: start; display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 800; color: var(--accent2-text); background: var(--accent2-soft); padding: 5px 12px; border-radius: 999px; }
.deck-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; flex: 1; }
.dots button { width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; background: var(--line); }
.dots button.done { background: var(--muted); }
.dots button.cur { background: var(--accent); width: 24px; border-radius: 5px; }
.dots button.q { box-shadow: 0 0 0 2px var(--accent2) inset; background: transparent; }
.dots button.q.done { background: var(--accent2); }
.kbd { font-family: var(--f-mono); font-size: 11px; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; color: var(--muted); }
.sum-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.sum-list li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; color: var(--ink-2); }
.sum-list li span { width: 26px; height: 26px; border-radius: 8px; background: var(--ok-soft); color: var(--ok-text); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.tchips { display: flex; flex-wrap: wrap; gap: 6px; }
.tchips span { font-size: 13px; font-weight: 600; padding: 3px 11px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); }

/* illustration classes (inline SVG follows the theme) */
.ill .l { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ill .lt { fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linecap: round; }
.ill .dash { fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 4 4; }
.ill .a { fill: var(--accent); }
.ill .as { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ill .b { fill: var(--accent2); }
.ill .bs { fill: none; stroke: var(--accent2); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ill .s { fill: var(--card); stroke: var(--ink-2); stroke-width: 2; }
.ill .s2 { fill: var(--card-2); }
.ill .s3 { fill: var(--line); }
.ill .ink { fill: var(--ink); }
.ill .ok { fill: var(--ok); }
.ill text { font-family: var(--f-body); fill: var(--ink-2); font-size: 13px; font-weight: 600; }
.ill text.m { fill: var(--muted); font-weight: 500; font-size: 12px; }
.ill text.at { fill: var(--accent-text); font-weight: 800; }
.ill text.bt { fill: var(--accent2-text); font-weight: 800; }
.ill text.mono { font-family: var(--f-mono); }
.ill text.big { font-size: 22px; font-weight: 800; fill: var(--ink); }

/* ---------- content tables ---------- */
.tbl { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.55; }
th, td { text-align: left; padding: 10px 10px; border-top: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 800; white-space: nowrap; }
td.num { font-family: var(--f-mono); white-space: nowrap; }

/* ---------- hardware panels (demos & widgets) ---------- */
.hw { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; display: grid; gap: 14px; width: 100%; min-width: 0; }
.hw-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.hw-head .tag { font-size: 12px; font-weight: 800; color: var(--accent2-text); }
.screen { width: 100%; height: 160px; display: block; background: var(--scr-bg); border: 1px solid var(--line); border-radius: 12px; }
.readouts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.readouts div { display: grid; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.readouts b { font-family: var(--f-mono); font-size: 17px; font-weight: 600; color: var(--accent2-text); }
.readouts span { font-size: 12px; color: var(--muted); }
.controls { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; }
.knob-w { display: grid; justify-items: center; gap: 2px; width: 92px; user-select: none; }
.knob { width: 76px; height: 76px; touch-action: none; cursor: ns-resize; border-radius: 50%; }
.knob svg { width: 100%; height: 100%; }
.knob .k-body { fill: var(--knob); stroke: var(--line); stroke-width: 2; }
.knob .k-cap { fill: var(--knob-cap); }
.knob .k-bg { fill: none; stroke: var(--track); stroke-width: 6; stroke-linecap: round; }
.knob .k-arc { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; }
.knob .k-ind { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.knob-l { font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--muted); }
.knob-v { font-family: var(--f-mono); font-size: 13px; color: var(--accent2-text); min-height: 1.4em; }
.fader-w { display: grid; justify-items: center; gap: 4px; user-select: none; }
.fader { position: relative; width: 70px; height: 190px; touch-action: none; cursor: ns-resize; }
.fader .slot { position: absolute; left: 50%; top: 10px; bottom: 10px; width: 6px; transform: translateX(-50%); background: var(--track); border-radius: 3px; }
.fader .tick { position: absolute; left: 0; width: 22px; font-family: var(--f-mono); font-size: 9px; color: var(--muted); text-align: right; transform: translateY(-50%); line-height: 1; }
.fader .cap { position: absolute; left: 50%; width: 30px; height: 40px; transform: translate(-50%, -50%); background: var(--cap); border-radius: 6px; box-shadow: 0 2px 6px var(--cap-edge), inset 0 -2px 0 var(--cap-edge); }
.fader .cap::after { content: ""; position: absolute; left: 4px; right: 4px; top: 50%; height: 2px; background: var(--accent); }
.fader-v { font-family: var(--f-mono); font-size: 13px; color: var(--accent2-text); }
.geq-scroll { overflow-x: auto; max-width: 100%; }
.geq-unit { display: grid; grid-template-columns: repeat(31, minmax(18px, 1fr)); gap: 2px; min-width: 640px; background: var(--scr-bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px 8px 6px; }
.geq-col { display: grid; justify-items: center; gap: 4px; cursor: pointer; border-radius: 8px; padding: 4px 0 2px; touch-action: none; }
.geq-col:hover { background: var(--line); }
.geq-track { position: relative; width: 5px; height: 116px; background: var(--track); border-radius: 3px; }
.geq-track::before { content: ""; position: absolute; left: -6px; right: -6px; top: 50%; height: 1px; background: var(--muted); opacity: .4; }
.geq-cap { position: absolute; left: 50%; top: 50%; width: 15px; height: 9px; transform: translate(-50%, -50%); background: var(--cap); border-radius: 3px; box-shadow: 0 1px 3px var(--cap-edge); }
.geq-col.oct .geq-cap { background: var(--accent); }
.geq-col span { font-family: var(--f-mono); font-size: 9px; color: var(--muted); writing-mode: vertical-rl; transform: rotate(180deg); height: 36px; }
.geq-col.right { background: var(--ok-soft); } .geq-col.right .geq-cap { background: var(--ok); }
.geq-col.wrong { background: var(--bad-soft); } .geq-col.wrong .geq-cap { background: var(--bad); }
.geq-col.dim { opacity: .3; }
.geq-read { font-family: var(--f-mono); font-size: 13px; color: var(--accent2-text); min-height: 1.5em; }

/* ---------- questions ---------- */
.qcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 24px; display: grid; gap: 16px; min-width: 0; }
.q-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.q-text { font-size: 19px; font-weight: 700; line-height: 1.65; }
.q-text b { color: var(--accent-text); }
.opts { display: grid; gap: 8px; }
.opt { text-align: left; display: grid; grid-template-columns: 30px 1fr; gap: 6px; align-items: center; border: 1.5px solid var(--line); background: var(--card); padding: 11px 14px; border-radius: 14px; font-size: 15px; transition: border-color .15s, transform .15s; }
.opt .k { width: 24px; height: 24px; border-radius: 8px; background: var(--card-2); display: grid; place-items: center; font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.opt:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.opt:disabled { cursor: default; }
.opt.right, .ord.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right .k { background: var(--ok); color: #fff; }
.opt.wrong, .ord.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .k { background: var(--bad); color: #fff; }
.numin { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.numin input { width: 150px; font: inherit; font-family: var(--f-mono); background: var(--card-2); color: var(--ink); border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.order-picked { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 46px; padding: 8px; border: 1.5px dashed var(--line); border-radius: 14px; }
.order-picked .ord { border: 1.5px solid var(--line); background: var(--card-2); padding: 4px 12px; border-radius: 10px; font-size: 14px; }
.order-picked .arrow { color: var(--muted); }
.order-pool { display: flex; flex-wrap: wrap; gap: 6px; }
.fb { border-radius: 14px; padding: 14px 16px; display: grid; gap: 4px; font-size: 15px; }
.fb.ok { background: var(--ok-soft); } .fb.bad { background: var(--bad-soft); }
.fb .v { font-weight: 800; }
.fb.ok .v { color: var(--ok-text); } .fb.bad .v { color: var(--bad-text); }
.fb .ex { color: var(--ink-2); }
.fb .ex b { color: var(--ink); }
.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stats span { font-size: 12px; font-weight: 700; background: var(--card); border: 1px solid var(--line); padding: 5px 11px; border-radius: 999px; color: var(--muted); }
.stats span b { color: var(--ink); font-family: var(--f-mono); }
.stats span.hot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stats span.hot b { color: var(--accent-ink); }
.tprog { display: grid; gap: 4px; grid-template-columns: repeat(10, 1fr); }
.tprog span { height: 6px; border-radius: 3px; background: var(--line); }
.tprog span.ok { background: var(--ok); } .tprog span.bad { background: var(--bad); } .tprog span.cur { background: var(--accent); }
.result .big { font-family: var(--f-mono); font-size: 60px; font-weight: 600; line-height: 1; }
.locked-box { background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--r-lg); padding: 28px; display: grid; gap: 12px; }

/* ---------- immersive learning: full-bleed pages that scroll and snap ---------- */
body.immersive { overflow: hidden; }
body.immersive .topbar { display: none; }
.imm { position: fixed; inset: 0; z-index: 25; overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y proximity; background: var(--bg); }
.pg { position: relative; min-height: 100vh; min-height: 100dvh; scroll-snap-align: start; display: grid; align-items: center; overflow: hidden;
  padding-block: calc(86px + env(safe-area-inset-top, 0px)) calc(100px + env(safe-area-inset-bottom, 0px));
  padding-left: max(56px, env(safe-area-inset-left, 0px)); padding-right: max(64px, env(safe-area-inset-right, 0px)); }
.pg:nth-child(even) { background: var(--card); }
.imm .slide { background: none; border: 0; box-shadow: none; border-radius: 0; min-height: 0; width: 100%; max-width: 1280px; margin: 0 auto; padding: 0; font-size: clamp(16px, 1.25vw, 22px); position: relative; }
.imm .slide h2 { font-size: clamp(28px, 3.2vw, 56px); line-height: 1.2; }
.imm .slide.cover h1 { font-size: clamp(36px, 4.6vw, 76px); line-height: 1.12; }
.imm .vis svg.ill { max-height: calc(100vh - 260px); }
.imm .figure { background: transparent; padding: 0; }
.pg:nth-child(odd) .termbox { background: var(--card); }
.pg-cover { background: var(--scene-bg) !important; color: var(--scene-ink); }
.pg-art { position: absolute; inset: 0; opacity: .9; }
.pg-art svg { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 120%; height: auto; max-height: 100%; }
.pg-cover .slide h1, .pg-cover .slide .kicker, .pg-cover .slide .lead, .pg-cover .goals li { color: var(--scene-ink); }
.pg-cover .goals li::before { background: var(--scene-chip); box-shadow: inset 0 0 0 2px var(--scene-ink); }
.pg-cover .slide.cover { grid-template-columns: minmax(0, 1fr); max-width: 1280px; }
.pg-cover .slide.cover .txt { max-width: 640px; }
.scroll-hint { position: absolute; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); font-size: 13px; font-weight: 700; color: var(--scene-ink); opacity: .8; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translate(-50%, 6px); } }
.gate { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.gate::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent2); }
/* reveal on enter */
.imm [data-a] { opacity: 0; transform: translateY(22px); animation: none; transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.imm .pg.in [data-a] { opacity: 1; transform: none; }
/* practice / test pages share the immersive look */
.pg.solo { align-items: start; }
.pg.center { align-items: center; }
.imm .qpage { max-width: 940px; display: grid; gap: clamp(20px, 2.4vw, 36px); align-content: start; }
.qpage-head { display: grid; gap: 14px; }
.imm .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.imm .qcard { background: none; border: 0; box-shadow: none; padding: 0; border-radius: 0; gap: clamp(16px, 2vw, 26px); }
.imm .q-text { font-size: clamp(21px, 2.2vw, 36px); line-height: 1.5; }
.imm .opt { padding: 16px 20px; font-size: 1.02em; border-radius: 16px; }
.imm .opt .k { width: 30px; height: 30px; }
.imm .fb { font-size: 0.98em; padding: 18px 20px; }
.imm .big-stmt { max-width: 880px; text-align: center; justify-items: center; }
.imm .big-stmt .bignum { font-size: clamp(56px, 9vw, 140px); }
.imm .tprog { max-width: 520px; }
@media (max-width: 760px) {
  .imm .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin-right: -18px; }
  .imm .chips .chip { flex-shrink: 0; }
}
/* floating HUD */
.hud-bar { position: fixed; z-index: 31; top: env(safe-area-inset-top, 0px); left: 0; height: 3px; width: 0; background: var(--accent); transition: width .45s cubic-bezier(.2,.7,.2,1); }
.hud-top { position: fixed; z-index: 30; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; pointer-events: none;
  padding-block: calc(14px + env(safe-area-inset-top, 0px)) 0; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.hud-top > * { pointer-events: auto; }
.glass { background: color-mix(in srgb, var(--card) 80%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); }
.hud-top .menu-btn { border-radius: 999px; }
.hud-crumb { font-size: 13px; color: var(--muted); padding: 8px 16px; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-crumb b { color: var(--ink); }
.hud-tabs { display: inline-flex; padding: 4px; gap: 2px; }
.hud-tabs button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); }
.hud-tabs button.on { background: var(--accent); color: var(--accent-ink); }
.hud-top .theme-sw { border-radius: 999px; }
.hud-rail { position: fixed; z-index: 30; right: max(18px, env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); display: grid; gap: 7px; justify-items: center; }
.hud-rail button { width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; background: var(--line); transition: height .25s, background .25s; }
.hud-rail button.done { background: var(--muted); }
.hud-rail button.cur { background: var(--accent); height: 22px; border-radius: 5px; }
.hud-rail button.q { box-shadow: inset 0 0 0 2px var(--accent2); background: transparent; }
.hud-rail button.q.done { background: var(--accent2); }
.hud-rail button.lock { opacity: .3; cursor: default; }
.hud-nav { position: fixed; z-index: 30; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 5px; }
.hud-nav button { border: 0; background: none; padding: 9px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--ink); white-space: nowrap; }
.hud-nav button.primary { background: var(--accent); color: var(--accent-ink); }
.hud-nav button:disabled { opacity: .45; cursor: default; }
.hud-nav .cnt { font-family: var(--f-mono); font-size: 13px; color: var(--muted); padding: 0 10px; white-space: nowrap; }
@media (max-width: 760px) {
  .pg { padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); padding-block: calc(76px + env(safe-area-inset-top, 0px)) calc(92px + env(safe-area-inset-bottom, 0px)); }
  .hud-rail, .hud-crumb, .hud-top .theme-sw { display: none; }
  .hud-nav button { padding: 9px 12px; }
  .pg-art svg { width: 220%; opacity: .35; }
}

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.slide [data-a] { animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }

@media (max-width: 760px) {
  .topbar .crumb span { display: none; }
  .menu-btn .lbl { display: none; }
  .split, .cover { grid-template-columns: 1fr; }
  .split.flip > .vis { order: 0; }
  .slide { min-height: 0; }
  .scene .over { padding: 20px; }
  .readouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gearbox { grid-template-columns: 1fr; }
  .qcard { padding: 18px; }
  .q-text { font-size: 17px; }
  .dots { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, .slide [data-a] { animation: none !important; transition: none !important; } .imm [data-a] { opacity: 1; transform: none; } }
