/* pocketmix site. One system: "mixing console" dark theme, one accent (the brand ball), Geist + Geist Mono.
   Direction and rules: ~/AgentHub/tasks/2026-10-21-design-taste.md, refined by docs/design/2026-10-22-visual-polish.md
   ("console, refined": tonal surfaces, hairlines, quiet mono labels, an accent that only points). */
@font-face { font-family: "Geist"; font-weight: 400; font-display: swap; src: url("../fonts/geist-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 600; font-display: swap; src: url("../fonts/geist-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-weight: 500; font-display: swap; src: url("../fonts/geist-mono-latin-500-normal.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  /* Color: one neutral ramp + one accent. Contrast on --bg: text 16.9, muted 8.3, faint 5.4, accent 6.9 */
  --bg: #0a0b0c;
  --surface: #111214;
  --surface-2: #17191c;
  --surface-3: #1e2024;
  --line: #212327;
  --line-strong: #34373c; /* decorative hairlines only */
  --control-border: #656b73; /* borders of form controls: 3.66 on --bg, 3.48 on --surface, 3.27 on --surface-2 */
  --text: #eceef0;
  --body: #cfd2d6;
  --muted: #a3a9b1;
  --faint: #80868e;
  --accent: #ff6a2b;
  --accent-hover: #ff7d45;
  --accent-soft: rgb(255 106 43 / .12);
  --on-accent: #0a0b0c;
  --ok: #4cc38a;

  /* Type scale (about 1.25) */
  --font: "Geist", ui-sans-serif, system-ui, "Apple SD Gothic Neo", "PingFang SC", "Hiragino Sans", "Noto Sans CJK KR", "Noto Sans CJK SC", "Noto Sans CJK JP", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", monospace;
  --fs-xs: .75rem;
  --fs-sm: .875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: clamp(1.75rem, 3vw, 2.25rem);
  --fs-display: clamp(2.5rem, 5.5vw, 4rem);

  /* Space (4px base) and layout */
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem; --s-8: 4rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --section: clamp(3.5rem, 7vw, 6rem);
  --header-h: 64px;

  /* Shape and motion */
  --radius: 6px;
  --radius-lg: 10px;
  --radius-xl: 12px; /* large lesson and tool panels only */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-enter: cubic-bezier(0.22, 1, 0.36, 1); /* view and step enter */
  --fast: 160ms;
  --hl: inset 0 1px 0 rgb(255 255 255 / .035); /* machined top edge on resting panels; resting panels get no shadow */
  --float: 0 12px 32px -8px rgb(0 0 0 / .55); /* floating things only: popovers, term sheet */
  --accent-line: rgb(255 106 43 / .65); /* accent-tinted hairline for selected states */
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs-base)/1.6 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-weight: 600; margin: 0; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
img { max-width: 100%; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius); }
.skip { position: absolute; left: var(--s-4); top: -4rem; z-index: 100; display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-4); background: var(--accent); color: var(--on-accent); border-radius: var(--radius); font-weight: 600; text-decoration: none; transition: top var(--fast) var(--ease-out); }
.skip:focus-visible { top: var(--s-2); outline-color: var(--text); }
main:focus { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kicker { font: 500 var(--fs-xs)/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: var(--s-3); }
/* Resting panels share one recipe: hairline (set per rule) + the faint top highlight. */
.track, .tool, .lpick, .school-panel, .gate, .demo-box, .wid, .metrics, .chart-wrap, .stems-panel, .stem-analysis, .locked, .teasy, .lreward { box-shadow: var(--hl); }
.lede { color: var(--muted); max-width: 46ch; font-size: var(--fs-md); line-height: 1.55; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: 0 1.15rem; border-radius: var(--radius); border: 1px solid var(--line-strong); background: transparent; color: var(--text); font: 600 .95rem var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform var(--fast) ease, background-color var(--fast) ease, border-color var(--fast) ease, color var(--fast) ease; }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* Disabled never dims the accent: a quiet tonal fill with faint text, so it cannot read as a muddy brown button. */
.btn:disabled { color: var(--faint); border-color: var(--line); background: transparent; cursor: not-allowed; }
.btn.primary:disabled { background: var(--surface-3); border-color: var(--surface-3); color: var(--faint); }
@media (hover: hover) and (pointer: fine) {
  .btn:not(:disabled):hover { border-color: var(--muted); background: var(--surface-2); }
  .btn.primary:not(:disabled):hover { background: var(--accent-hover); border-color: var(--accent-hover); }
}

/* ---------- Announcement strip: one line, the LED is the only ambient motion on the site ---------- */
.announce { display: flex; align-items: center; justify-content: center; gap: .6rem; min-height: 44px; padding: .4rem var(--gutter); background: var(--surface); border-bottom: 1px solid var(--line); color: var(--muted); font-size: var(--fs-sm); text-decoration: none; text-align: center; transition: color var(--fast) ease; }
.announce .led { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: led 2.4s ease-in-out infinite; }
.announce .arr { color: var(--faint); transition: transform var(--fast) var(--ease-out); }
@media (hover: hover) { .announce:hover { color: var(--text); } .announce:hover .arr { transform: translateX(2px); color: var(--text); } }
@keyframes led { 50% { opacity: .35; } }

/* ---------- Header: logo, big tabs (Fadr-style), small links, language ---------- */
.nav { position: sticky; top: 0; z-index: 10; background: rgb(10 11 12 / .98); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; height: var(--header-h); gap: var(--s-6); }
.brand { display: inline-flex; align-items: center; min-height: 44px; flex: none; }
.brand img { display: block; height: 26px; width: auto; }
.nav ul { display: flex; list-style: none; margin: 0; padding: 0; }
.htabs { display: flex; align-self: stretch; }
.htabs ul { display: flex; align-self: stretch; }
.htabs li { display: flex; }
.htabs [role="tab"], .htabs a { position: relative; display: inline-flex; align-items: center; justify-content: center; padding: 0 var(--s-4); background: none; border: 0; color: var(--muted); font: 600 1.0625rem var(--font); letter-spacing: -0.01em; text-decoration: none; cursor: pointer; transition: color var(--fast) ease; }
.htabs [role="tab"]::after, .htabs a::after { content: ""; position: absolute; left: var(--s-4); right: var(--s-4); bottom: -1px; height: 2px; background: var(--accent); transform: scaleX(0); transition: transform 240ms var(--ease-out); }
.htabs [role="tab"][aria-selected="true"], .htabs a[aria-current] { color: var(--text); }
.htabs [role="tab"][aria-selected="true"]::after, .htabs a[aria-current]::after { transform: scaleX(1); }
@media (hover: hover) { .htabs [role="tab"]:hover, .htabs a:hover { color: var(--text); } }
.htabs :focus-visible { outline-offset: -4px; }
.hsub { margin-left: auto; }
.hsub ul { gap: var(--s-5); }
.hsub a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; color: var(--muted); text-decoration: none; font-size: .9rem; transition: color var(--fast) ease; }
.hsub a[aria-current="page"] { color: var(--text); }
/* Reserve the language select's slot until js/common.js mounts it, so the header links do not jump. */
.nav .wrap:not(:has(.hlang))::after { content: ""; flex: none; width: 5.625rem; height: 44px; }
@media (hover: hover) { .hsub a:hover { color: var(--text); } }
.hlang { flex: none; min-height: 44px; padding: 0 .5rem; background: var(--surface); color: var(--muted); border: 1px solid var(--control-border); border-radius: var(--radius); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
/* Narrow (<= 1080px, long ko/es labels plus the glossary link do not fit one row): row 1 logo + language, row 2 the two tabs split the width, row 3 small links (scroll if needed) */
@media (max-width: 1080px) {
  :root { --header-h: 136px; } /* three 44px rows + hairlines */
  .nav .wrap { flex-wrap: wrap; height: auto; gap: 0; padding-top: 0; }
  .brand img { height: 22px; }
  .hlang { margin-left: auto; min-height: 44px; }
  .nav .wrap:not(:has(.hlang))::after { margin-left: auto; height: 44px; }
  .htabs { order: 3; width: 100%; border-top: 1px solid var(--line); }
  .htabs ul, .htabs li { flex: 1; }
  .htabs [role="tab"], .htabs a { flex: 1; min-height: 48px; }
  .hsub { order: 4; width: 100%; margin: 0; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line); }
  .hsub::-webkit-scrollbar { display: none; }
  .hsub ul { gap: 0; white-space: nowrap; }
  .hsub a { padding: 0 .8rem; font-size: var(--fs-sm); }
  .hsub li:first-child a { padding-left: 0; }
}

/* ---------- Views (tab panels) and view heads ---------- */
[role="tabpanel"][hidden] { display: none; }
[role="tabpanel"]:focus { outline: none; }
.view:not([hidden]) { animation: viewIn 240ms var(--ease-enter); }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.nav-instant .view:not([hidden]) { animation: none; } /* Back/Forward between tabs: no entry motion (js/tabs.js) */
.vsec { padding: clamp(2.5rem, 5vw, 4rem) 0 var(--section); scroll-margin-top: calc(var(--header-h) + 1rem); }
.vsec + .vsec { padding-top: 0; }
.vhead { display: grid; gap: var(--s-4) var(--s-8); align-items: end; padding-bottom: var(--s-6); margin-bottom: var(--s-6); border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .vhead { grid-template-columns: 7fr 5fr; } .vhead.single { grid-template-columns: 1fr; } }
.vhead h1 { font-size: var(--fs-display); letter-spacing: -0.035em; line-height: 1.02; }
.vhead .lede { justify-self: start; }

/* ---------- Lesson tracks: each level is a bordered panel of full-row links ---------- */
.tracks { display: grid; gap: var(--s-5); grid-template-columns: 1fr; }
@media (min-width: 900px) { .tracks { grid-template-columns: 1fr 1fr; } }
.track { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); overflow: hidden; }
.track.wide { grid-column: 1 / -1; }
/* Tracks are filled by js/lessons-list.js: hold their usual height until then so the sections below do not jump. */
#lessons-beginner:empty, #lessons-intermediate:empty { min-height: 32.5rem; }
#lessons-guides:empty { min-height: 7.75rem; }
#school-beginner:empty, #school-intermediate:empty { min-height: 44.5rem; }
.thead { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--line); font: 500 var(--fs-xs)/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.thead .tcount { color: var(--faint); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li + li { border-top: 1px solid var(--line); }
@media (min-width: 900px) {
  .track.wide .rows { display: grid; grid-template-columns: 1fr 1fr; }
  .track.wide .rows li + li { border-top: 0; border-left: 1px solid var(--line); }
}
.row { display: grid; grid-template-columns: 2.5rem 1fr auto; align-items: start; gap: var(--s-3); padding: var(--s-4) var(--s-5); min-height: 56px; text-decoration: none; transition: background-color var(--fast) ease, box-shadow var(--fast) ease; }
.track.wide .row { grid-template-columns: 1fr auto; }
.track.wide .row .id { display: none; }
.row .id { font: 500 var(--fs-sm)/1.5 var(--mono); color: var(--faint); padding-top: .05rem; }
.row .body { display: grid; gap: var(--s-1); min-width: 0; } /* title and meta 4px apart */
.row .head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.row .title { font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em; line-height: 1.35; }
.row .meta { color: var(--muted); font-size: .9rem; line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.row .go { color: var(--faint); font-family: var(--mono); padding-top: .1rem; transition: transform var(--fast) var(--ease-out), color var(--fast) ease; }
a.row:active { background: var(--surface-3); }
@media (hover: hover) { a.row:hover { background: var(--surface-2); } a.row:hover .go { color: var(--accent); transform: translateX(3px); } }
/* The start row and a focused row get a 2px accent bar on the left edge and a tonal fill, never a full orange box. */
a.row:focus-visible, .rows li:has(.status.here) > a.row { outline: none; border-radius: 0; background: var(--surface-2); box-shadow: inset 2px 0 0 var(--accent); }
div.row { color: var(--muted); }
div.row .title { color: var(--muted); }
/* Tags are neutral hairlines; only "Start here" uses the accent, as text on a soft tint. */
.status, .kotag { font: 500 .7rem/1.5 var(--mono); letter-spacing: .04em; color: var(--faint); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 .4rem; white-space: nowrap; }
.status.free { color: var(--muted); }
.status.adv { color: var(--accent); border-color: var(--accent-line); }
.tnote { margin: var(--s-2) 0 var(--s-3); font-size: var(--fs-sm); color: var(--muted); max-width: 70ch; }
.track details.more { border-top: 1px solid var(--line); }
.track details.more summary { display: flex; align-items: center; gap: .6rem; min-height: 48px; padding: 0 var(--s-5); color: var(--muted); font-size: .9rem; cursor: pointer; list-style: none; transition: color var(--fast) ease, background-color var(--fast) ease; }
.track details.more summary::-webkit-details-marker { display: none; }
.track details.more summary::after { content: "+"; font: 500 1.05rem var(--mono); transition: transform 200ms var(--ease-out); }
.track details.more[open] summary::after { transform: rotate(45deg); }
.track details.more[open] summary { border-bottom: 1px solid var(--line); }
@media (hover: hover) { .track details.more summary:hover { color: var(--text); background: var(--surface-2); } }
.rows li:target, .rows li:focus-within { scroll-margin-top: calc(var(--header-h) + 3rem); }
.track { scroll-margin-top: calc(var(--header-h) + 1rem); } /* the level test places a visitor at their track */
.status.here { color: var(--accent); background: var(--accent-soft); border-color: transparent; }

/* ---------- Lesson start: choice cards, level test, result (js/level-test.js) ---------- */
#panel-lessons [hidden] { display: none !important; } /* the tracks and the School block leave the page while a visitor chooses */
.vside { display: grid; gap: var(--s-3); justify-items: start; }
.mylevel { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-4); }
.lvchip { font: 500 var(--fs-xs)/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text); border: 1px solid var(--line-strong); border-radius: 4px; padding: .1rem .5rem; }
.linkbtn { min-height: 44px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: var(--fs-sm); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; cursor: pointer; transition: color var(--fast) ease, text-decoration-color var(--fast) ease; }
@media (hover: hover) { .linkbtn:hover { color: var(--text); text-decoration-color: var(--accent); } }
.lstart { margin-bottom: var(--section); }
.lstart h2 { font-size: var(--fs-xl); letter-spacing: -0.03em; margin-bottom: var(--s-3); }
.lstart h2:focus { outline: none; }
.lstart > div > .lede { margin-bottom: var(--s-6); }
.lpicks { display: grid; gap: var(--s-4); }
.lpick { display: grid; grid-template-rows: auto 1fr auto auto auto; gap: var(--s-3); min-height: 260px; padding: var(--s-6); text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); color: var(--text); font: inherit; cursor: pointer; transition: border-color var(--fast) ease, background-color var(--fast) ease, transform var(--fast) ease; }
/* Side by side, both cards share one row grid (subgrid), so titles and descriptions line up whatever the copy length. */
@media (min-width: 720px) { .lpicks { grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr auto auto auto; gap: 0 var(--s-5); } .lpick { grid-row: span 5; grid-template-rows: subgrid; } }
.lpick .ch { font: 500 var(--fs-xs)/1 var(--mono); letter-spacing: .08em; color: var(--faint); }
/* Small instruments in the landing card language: rising level bars (the test) and stacked lesson rows, lesson 1 lit (from the beginning). */
.lviz { display: flex; align-items: flex-end; gap: 6px; height: 64px; align-self: end; }
.lviz i { display: block; flex: 1; max-width: 16px; background: var(--line-strong); border-radius: 1px; transition: background-color var(--fast) ease; }
.lviz-steps i:nth-child(1) { height: 18%; } .lviz-steps i:nth-child(2) { height: 28%; } .lviz-steps i:nth-child(3) { height: 38%; } .lviz-steps i:nth-child(4) { height: 48%; }
.lviz-steps i:nth-child(5) { height: 60%; background: var(--accent); } .lviz-steps i:nth-child(6) { height: 70%; } .lviz-steps i:nth-child(7) { height: 82%; } .lviz-steps i:nth-child(8) { height: 94%; }
.lviz-rows { flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 8px; }
.lviz-rows i { flex: none; height: 7px; max-width: none; }
.lviz-rows i:nth-child(1) { width: 90%; background: var(--accent); } .lviz-rows i:nth-child(2) { width: 64%; } .lviz-rows i:nth-child(3) { width: 78%; } .lviz-rows i:nth-child(4) { width: 46%; }
.lpick .pt { align-self: end; font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.lpick .pd { color: var(--muted); max-width: 40ch; }
.lpick .po { font: 500 var(--fs-xs)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); transition: color var(--fast) ease; }
.lpick .arrow { display: inline-block; transition: transform var(--fast) var(--ease-out); }
.lpick:active { transform: scale(0.99); }
@media (hover: hover) { .lpick:hover { border-color: var(--line-strong); background: var(--surface-2); } .lpick:hover .po { color: var(--accent); } .lpick:hover .arrow { transform: translateX(4px); } .lpick:hover .lviz i:not(:is(.lviz-steps :nth-child(5), .lviz-rows :nth-child(1))) { background: var(--muted); } }
.ltest { max-width: 44rem; }
.ltest, .lres { padding-bottom: var(--s-4); }
.lqtop { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.lqtop .kicker { margin: 0; }
/* Progress segments (level test and lesson player): 3px, rounded ends. done = line-strong, current = accent, upcoming = line. */
.lbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin: var(--s-3) 0 var(--s-6); }
.lbar i { height: 3px; border-radius: 2px; background: var(--line); transition: background-color var(--fast) ease; }
.lbar i.done { background: var(--line-strong); }
.lbar i.now { background: var(--accent); }
.ltest h2 { font-size: var(--fs-lg); line-height: 1.25; letter-spacing: -0.02em; }
.lq h2 { margin-bottom: var(--s-5); }
.lplay { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin-bottom: var(--s-5); }
.lopts { display: grid; gap: var(--s-2); margin-bottom: var(--s-6); }
/* Quiz option rows (level test; the school quiz `.topt` below matches): row on --surface, 10px radius, custom radio; checked = accent ring + dot, tonal fill. */
.lopt { display: flex; align-items: center; gap: var(--s-3); min-height: 52px; padding: var(--s-2) var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--hl); cursor: pointer; transition: border-color var(--fast) ease, background-color var(--fast) ease; }
.lopt input { appearance: none; -webkit-appearance: none; flex: none; display: grid; place-content: center; width: 16px; height: 16px; margin: 0; border: 1.5px solid var(--control-border); border-radius: 50%; background: transparent; transition: border-color var(--fast) ease; }
.lopt input::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform var(--fast) ease; }
.lopt input:checked { border-color: var(--accent); }
.lopt input:checked::before { transform: scale(1); }
.lopt:has(input:checked) { border-color: var(--accent-line); background: var(--surface-2); }
.lopt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.lopt input:focus-visible { outline: none; }
@media (hover: hover) { .lopt:hover { background: var(--surface-2); } }
.lnav { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.lnav .btn.primary { margin-left: auto; }
.lres .lnav .btn.primary { margin-left: 0; }
.lres h2 { font-size: var(--fs-xl); letter-spacing: -0.03em; }
.lscore { list-style: none; margin: var(--s-4) 0; padding: var(--s-4) 0; border-block: 1px solid var(--line); display: grid; gap: var(--s-1); font: 500 var(--fs-sm)/1.6 var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.lfirst { margin: var(--s-4) 0 var(--s-5); color: var(--text); font-size: var(--fs-md); }
.lnote { margin-top: var(--s-4); }
/* Level test reward: one free lesson for the placed level. Accent edge so it reads as a gift, not a warning. */
.lreward { margin-top: var(--s-5); padding: var(--s-4) var(--s-5); background: var(--surface); border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: var(--radius-lg); }
.lreward h3 { font-size: var(--fs-md); margin-bottom: var(--s-2); }
.lreward p { margin-bottom: var(--s-3); color: var(--muted); }
.lreward .lnote { margin: var(--s-3) 0 0; }
.lreview { margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--line); }
.lreview h3 { font-size: var(--fs-md); margin-bottom: var(--s-3); }
.lreview ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.lreview a { color: var(--body); text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
@media (hover: hover) { .lreview a:hover { color: var(--text); text-decoration-color: var(--accent); } }

/* ---------- School block: the one primary action of the Lessons view ---------- */
.school-panel { padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); }
.school-head { display: grid; gap: var(--s-5); align-items: end; margin-bottom: var(--s-6); }
@media (min-width: 900px) { .school-head { grid-template-columns: 1fr auto; } }
.school-head h2 { font-size: var(--fs-xl); letter-spacing: -0.03em; }
.school-head .lede { margin-top: var(--s-2); font-size: var(--fs-base); }
.school-head .kicker::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: .5rem; border-radius: 50%; background: var(--accent); vertical-align: .1em; }
.crosslink { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-6); padding: var(--s-5) 0 0; border-top: 1px solid var(--line); color: var(--muted); }
.crosslink p { font-size: var(--fs-md); }

/* ---------- Analyzer: two stations (01 genre, 02 file) ---------- */
.tool { display: grid; gap: var(--s-5); padding: clamp(1rem, 2.5vw, 1.5rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); }
@media (min-width: 960px) { .tool { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-6); } }
.station { min-width: 0; }
.slabel { display: flex; align-items: center; gap: .6rem; margin-bottom: var(--s-3); font: 500 var(--fs-xs)/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.slabel .ch { color: var(--faint); }
.seg { display: flex; flex-wrap: wrap; gap: .4rem; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { min-height: 44px; display: inline-flex; align-items: center; padding: 0 .85rem; border: 1px solid var(--control-border); border-radius: var(--radius); font-size: .9rem; cursor: pointer; color: var(--muted); transition: transform var(--fast) var(--ease-out), background-color var(--fast) ease, color var(--fast) ease, border-color var(--fast) ease; }
.seg label:active { transform: scale(0.97); }
@media (hover: hover) { .seg label:hover { color: var(--text); border-color: var(--muted); } }
/* Selected chip: tonal fill + text colour + accent-tinted hairline. */
.seg input:checked + label { background: var(--surface-3); border-color: var(--accent-line); color: var(--text); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop { position: relative; display: grid; place-items: center; text-align: center; min-height: 280px; padding: 2rem 1rem 2.5rem; border: 1px dashed var(--control-border); border-radius: var(--radius-lg); cursor: pointer; background:
  repeating-linear-gradient(90deg, transparent 0 15px, rgb(255 255 255 / .07) 15px 16px) bottom 10px left 12px / calc(100% - 24px) 10px no-repeat,
  repeating-linear-gradient(90deg, transparent 0 79px, rgb(255 255 255 / .14) 79px 80px) bottom 10px left 12px / calc(100% - 24px) 16px no-repeat,
  var(--bg);
  transition: border-color var(--fast) ease, background-color var(--fast) ease; }
.drop > div { display: grid; gap: .35rem; }
.drop:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .drop:hover { border-color: var(--muted); } }
.drop.over { border-color: var(--accent); background-color: rgb(255 106 43 / .06); }
.drop strong { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -0.02em; }
.drop span { color: var(--muted); font-size: .9rem; }
.tool .privacy { margin-top: var(--s-2); font-size: .85rem; color: var(--muted); }
.drop[aria-busy="true"] strong::after { content: ""; display: inline-block; width: .5em; height: .5em; margin-left: .5em; border-radius: 50%; background: var(--accent); animation: pulse 700ms ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .25; } to { opacity: 1; } }

/* ---------- Results ---------- */
.results { padding: 0 0 var(--section); }
.results[hidden] { display: none; }
.results h2 { font-size: var(--fs-xl); line-height: 1.08; letter-spacing: -0.03em; padding-top: var(--s-6); border-top: 1px solid var(--line); }
.results h2:focus { outline: none; }
.results, #tool { scroll-margin-top: calc(var(--header-h) + 1rem); }
#resTitle { scroll-margin-top: calc(var(--header-h) + 2rem); }
.res-grid { margin-top: var(--s-6); display: grid; gap: var(--s-7); grid-template-columns: 1fr; }
@media (min-width: 960px) { .res-grid { grid-template-columns: 1.1fr 1fr; gap: var(--s-8); } }
.chart-wrap h3, .findings h3 { font: 500 var(--fs-xs)/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-4); }
.chart-wrap { padding: var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.chart { width: 100%; height: auto; display: block; }
.chart text { font: 500 11px var(--mono); fill: var(--muted); }
.chart .you { stroke: var(--accent); stroke-width: 2.5; fill: none; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 700ms var(--ease-out) 100ms forwards; }
.chart .target { stroke: var(--muted); stroke-width: 1.5; fill: none; stroke-dasharray: 4 5; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .dot, .chart .flag { fill: var(--accent); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.legend { display: flex; gap: var(--s-5); margin-top: var(--s-3); font-size: .85rem; color: var(--muted); }
.legend i { display: inline-block; width: 1.25rem; height: 0; border-top: 2.5px solid var(--accent); vertical-align: middle; margin-right: .5rem; }
.legend i.t { border-top: 1.5px dashed var(--muted); }
.note { color: var(--muted); font-size: .85rem; margin-top: var(--s-4); }
.findings ol { list-style: none; margin: 0; padding: 0; display: grid; }
.finding { padding: var(--s-4) 0; border-bottom: 1px solid var(--line); opacity: 0; transform: translateY(8px); animation: rise 320ms var(--ease-out) forwards; }
.finding:first-child { padding-top: 0; }
.finding:nth-child(2) { animation-delay: 50ms; } .finding:nth-child(3) { animation-delay: 100ms; } .finding:nth-child(4) { animation-delay: 150ms; } .finding:nth-child(n+5) { animation-delay: 200ms; }
@keyframes rise { to { opacity: 1; transform: none; } }
.finding p.t { font-size: 1.05rem; }
.tag { display: inline-block; margin-right: .5rem; padding: 0 .45rem; border-radius: 4px; border: 1px solid var(--line-strong); font: 500 .72rem/1.6 var(--mono); color: var(--muted); vertical-align: .1em; }
.tag.major { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.finding .fix { margin-top: .35rem; font-size: .9rem; color: var(--muted); }
.finding .fix a { color: var(--text); text-underline-offset: 3px; }
.findings > .btn { margin-top: var(--s-5); }
.empty { color: var(--muted); }
.metrics { margin: var(--s-7) 0 0; display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
@media (min-width: 760px) { .metrics { grid-template-columns: repeat(4, 1fr); } }
.metrics > div { padding: var(--s-4) var(--s-5); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-right: -1px; margin-bottom: -1px; }
.metrics dt { font: 500 var(--fs-xs)/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.metrics dd { margin: .25rem 0 0; font-size: 1.6rem; letter-spacing: -0.02em; }
.metrics small { font-size: .8rem; color: var(--muted); }
.metrics .mhint { margin: .35rem 0 0; font: 400 .78rem/1.4 var(--font); letter-spacing: 0; color: var(--muted); }
.cardbar { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-6); }

/* ---------- Gate: the one free/paid boundary on the main page ---------- */
.gate { margin-top: var(--s-6); padding: var(--s-5); background: var(--surface); border: 1px solid var(--line); border-left: 2px solid var(--line-strong); border-radius: var(--radius-lg); }
.gate h3 { font-size: var(--fs-lg); }
.gate p.sub { margin-top: .35rem; color: var(--muted); }
.gate form { margin-top: var(--s-5); display: grid; gap: var(--s-3); max-width: 420px; }
.gate .gatenote { font-size: .85rem; color: var(--muted); margin: 0; }
.gate .stored { margin-top: .5rem; font-size: .8rem; color: var(--muted); }
.gate .prose h1 { font-size: 1.9rem; margin-top: var(--s-5); }
.field { width: 100%; min-height: 44px; padding: 0 .9rem; background: var(--bg); color: var(--text); border: 1px solid var(--control-border); border-radius: var(--radius); font: 400 1rem var(--font); transition: border-color var(--fast) ease; }
.field:focus { border-color: var(--muted); }
.field::placeholder { color: var(--faint); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; color: var(--muted); }
.check input { appearance: none; display: grid; place-content: center; width: 20px; height: 20px; margin: .15rem 0 0; background: var(--bg); border: 1px solid var(--control-border); border-radius: 4px; flex: none; cursor: pointer; }
.check input::after { content: ""; width: 10px; height: 10px; background: var(--on-accent); clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%); transform: scale(0); transition: transform var(--fast) var(--ease-out); }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { transform: scale(1); }
.err { color: var(--accent); font-size: .9rem; min-height: 1.3em; }

/* ---------- Pricing ---------- */
.compare { display: grid; gap: var(--s-5); grid-template-columns: 1fr; }
@media (min-width: 900px) { .compare { grid-template-columns: repeat(3, minmax(0, 1fr)); } } /* free, monthly, yearly; cards stretch so the buttons line up */
.plan { display: flex; flex-direction: column; padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.plan.member { background: var(--surface); border-color: rgb(255 106 43 / .55); }
.plan h2 { font: 500 var(--fs-xs)/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.plan .price { margin-top: var(--s-3); font-size: 3rem; letter-spacing: -0.04em; font-weight: 600; line-height: 1; }
.plan .price-regular { margin: var(--s-3) 0 0; font: 500 var(--fs-sm)/1.2 var(--mono); color: var(--faint); }
.plan .price-regular + .price { margin-top: var(--s-1); }
.plan-badge { display: inline-block; margin-left: var(--s-2); padding: 1px 8px; border-radius: 999px; background: rgb(255 106 43 / .12); color: var(--accent); font: 500 var(--fs-xs)/1.6 var(--mono); letter-spacing: .06em; vertical-align: 1px; }
.plan-badge[hidden] { display: none; }
.plan .price small { font-size: 1rem; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: .35rem; }
.plan ul { flex: 1; list-style: none; margin: var(--s-5) 0 0; padding: 0; min-height: 8.5rem; } /* room for the JS-built list (3 items); monthly has 4 */
#plan-monthly ul { min-height: 11.5rem; }
#plan-yearly ul { min-height: 5.75rem; } /* 2 items */
.plan-action { margin-top: var(--s-5); align-self: flex-start; }
.plan.featured { border-color: var(--accent); box-shadow: var(--hl), 0 0 0 1px var(--accent); position: relative; }
.plan-flag { align-self: flex-start; margin-bottom: var(--s-3); padding: 2px 10px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 600 var(--fs-xs)/1.6 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.plan .per-day { margin-top: var(--s-2); font: 500 var(--fs-sm)/1.4 var(--mono); color: var(--accent); }
.plan .per-day[hidden] { display: none; }
.guarantee { margin-top: var(--s-3); font-size: var(--fs-sm); color: var(--body); }
.guarantee a { color: var(--muted); }
.founding[hidden] { display: none; }
.objections { margin-top: var(--section); }
.objections h2 { font-size: var(--fs-xl); letter-spacing: -0.025em; margin-bottom: var(--s-5); }
#objList { min-height: 11.5rem; } /* room for the JS-built rows (3 x 61px) */
.plan li { padding: .6rem 0 .6rem 1.4rem; border-top: 1px solid var(--line); color: var(--body); position: relative; }
.plan li::before { content: ""; position: absolute; left: 0; top: 1.15rem; width: 8px; height: 1px; background: var(--muted); }
.plan.member li::before { background: var(--accent); }
.btn.primary.plan-buy:disabled { background: transparent; border-color: var(--line-strong); color: var(--muted); cursor: default; transform: none; } /* "Coming soon" / "active": quiet outline, readable; beats the primary hover */
.paynote { margin-top: var(--s-4); color: var(--muted); font: 500 var(--fs-xs)/1.6 var(--mono); letter-spacing: .04em; }
.paystatus { margin-top: var(--s-4); min-height: 1.5em; color: var(--body); }
.paystatus a { color: var(--text); }

/* ---------- FAQ and how it works ---------- */
.faq-list { max-width: 820px; min-height: 15.25rem; } /* room for the JS-built rows (4 x 61px) */
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { display: grid; grid-template-columns: 2.5rem 1fr auto; align-items: center; gap: var(--s-3); min-height: 60px; padding: var(--s-3) 0; cursor: pointer; font-weight: 600; font-size: 1.05rem; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font: 500 1.25rem var(--mono); color: var(--muted); transition: transform 200ms var(--ease-out); }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list .qn { font: 500 var(--fs-sm) var(--mono); color: var(--faint); }
.faq-list details > p { margin: 0 0 var(--s-5) calc(2.5rem + var(--s-3)); color: var(--muted); max-width: 60ch; }
@media (hover: hover) { .faq-list summary:hover .qt { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-strong); } }
.how .wrap { display: grid; gap: var(--s-7); grid-template-columns: 1fr; }
.how .wrap::before { content: ""; grid-column: 1 / -1; border-top: 1px solid var(--line); margin-bottom: calc(var(--section) - var(--s-7)); }
@media (min-width: 960px) { .how .wrap { grid-template-columns: 5fr 7fr; gap: var(--s-8); } .how .stick { position: sticky; top: 6rem; align-self: start; } }
.how h2 { font-size: var(--fs-xl); letter-spacing: -0.03em; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; min-height: 22rem; } /* room for the JS-built steps */
.steps li { counter-increment: s; display: grid; grid-template-columns: 2.5rem 1fr; gap: var(--s-3); padding: var(--s-5) 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; padding-top: 0; }
.steps li::before { content: counter(s, decimal-leading-zero); font: 500 var(--fs-sm) var(--mono); color: var(--accent); padding-top: .2rem; }
.steps h3 { font-size: var(--fs-lg); }
.steps p { margin-top: .4rem; color: var(--muted); max-width: 48ch; }

/* ---------- Footer ---------- */
footer.foot { padding: var(--s-7) 0 var(--s-6); border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.foot .wrap { display: grid; gap: var(--s-5) var(--s-7); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .foot .wrap { grid-template-columns: 3fr 6fr auto; } } /* links column fits the seven footer links on one row at 1280+ (en ja ko zh) */
.fbrand { display: flex; gap: var(--s-3); align-items: center; }
.fbrand img { flex: none; }
.flinks ul { display: flex; flex-wrap: wrap; gap: 0 var(--s-3); list-style: none; margin: 0; padding: 0; }
.flinks a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; color: var(--muted); text-decoration: none; }
@media (hover: hover) { .flinks a:hover { color: var(--text); } }
.langs { display: flex; flex-wrap: wrap; gap: .35rem; }
.langs button { min-height: 44px; padding: 0 .8rem; background: none; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); font: inherit; cursor: pointer; transition: color var(--fast) ease, border-color var(--fast) ease; }
.langs button[aria-current] { color: var(--text); border-color: var(--accent); cursor: default; }
@media (hover: hover) { .langs button:not([aria-current]):hover { color: var(--text); border-color: var(--line-strong); } }

/* ---------- Prose (lessons) ---------- */
.prose { max-width: 66ch; }
.prose h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); letter-spacing: -0.035em; }
.prose h2 { font-size: 1.4rem; margin: 2.5rem 0 .75rem; }
.prose h3 { font-size: 1.15rem; margin: 2rem 0 .5rem; }
.prose p, .prose li { color: var(--body); }
.prose p { margin-top: 1rem; }
.prose ul, .prose ol { margin: 1rem 0 0; padding-left: 1.25rem; display: grid; gap: .6rem; }
.prose strong { color: var(--text); font-weight: 600; }
.prose em { color: var(--muted); }
.prose a { color: var(--text); text-underline-offset: 3px; }
.gate .prose { max-width: 66ch; }
.prose .fade, .fade { position: relative; }
.fade::after { content: ""; position: absolute; inset: auto 0 0 0; height: 8rem; background: linear-gradient(to bottom, transparent, var(--bg)); pointer-events: none; }

/* ---------- Lesson page and player ---------- */
.lesson-page { padding: var(--s-5) 0 var(--section); }
/* Desktop: one centered 720px column holds the back link, the progress and the step, so the page is balanced instead of hugging the left edge. */
.lesson-page > .wrap { max-width: calc(720px + 2 * var(--gutter)); }
.back { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; font-size: var(--fs-sm); transition: color var(--fast) ease; }
.back::before { content: "←"; margin-right: .5rem; font-family: var(--mono); }
@media (hover: hover) { .back:hover { color: var(--text); } }
.player { max-width: 720px; scroll-margin-top: calc(var(--header-h) + 2rem); }
.pbar { display: flex; gap: 4px; margin-bottom: var(--s-6); }
.pbar i { flex: 1; height: 3px; border-radius: 2px; background: var(--line); transition: background-color var(--fast) ease; }
.pbar i.done { background: var(--line-strong); }
.pbar i.now { background: var(--accent); }
.pstage { min-height: 16rem; }
.step.enter { animation: stepIn 240ms var(--ease-enter); }
@keyframes stepIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* Mono labels (step index, counters, eyebrow, kicker) share one voice: xs, uppercase, tracked, faint. */
.pmeta { display: flex; align-items: baseline; gap: var(--s-3); margin: 0 0 var(--s-5); padding-bottom: var(--s-3); border-bottom: 1px solid var(--line); font: 500 var(--fs-xs)/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.pmeta .pidx { font: inherit; color: var(--text); }
.pmeta .ptitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step.is-demo .demo { margin-top: 0; }
.step .prose { max-width: none; }
/* Step hierarchy: label -> title (xl, tight) -> lede (md, 62ch) -> body (1.0625rem / 1.7, --body). */
.step .prose h1, .step .prose h2 { font-size: var(--fs-xl); line-height: 1.08; letter-spacing: -0.03em; color: var(--text); }
.step .prose h1 { margin: 0; }
.step .prose h2 { margin: 0 0 var(--s-4); }
.step .prose p, .step .prose li { font-size: 1.0625rem; line-height: 1.7; }
/* Label, lede, quiz and answer text sit inside .prose p, so they restate their size here to win over the body rule above. */
.step .prose .eyebrow, .step .prose .tcount { font-size: var(--fs-xs); line-height: 1.4; }
.step .prose .lead { font-size: var(--fs-md); line-height: 1.6; }
.step .prose .more, .step .prose .tryit { margin-top: var(--s-4); }
.step .prose .tq { font-size: var(--fs-lg); line-height: 1.3; color: var(--text); }
.step .prose .tdone { font-size: var(--fs-xl); line-height: 1.08; }
.step .prose ol { counter-reset: n; list-style: none; padding: 0; gap: var(--s-4); }
/* Items hold mixed inline content (bold + text). A grid here made every text run its own cell and collapsed the body into the number column. */
.step .prose ol > li { counter-increment: n; position: relative; padding-left: 3rem; animation: stepIn 240ms var(--ease-enter); }
.step .prose ol > li::before { content: counter(n); position: absolute; left: 0; top: .2rem; font: 500 var(--fs-sm) var(--mono); font-variant-numeric: tabular-nums; color: var(--faint); }
/* Step nav sits right under the step with a hairline above it; it only sticks to the bottom when the step is taller than the screen. */
.pnav { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-6); padding: var(--s-4) 0; background: var(--bg); border-top: 1px solid var(--line); }
.player:has(.step:not([hidden]) :is(.demo, .wid)) .pnav { position: static; }
.pnav .btn[hidden] { display: none; }
.pcount { color: var(--faint); font-size: var(--fs-xs); letter-spacing: .08em; }
.pnav .btn.primary { margin-left: auto; }

/* ---------- Demos ---------- */
.demo { margin: 2rem 0 0; }
.demo-box { padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); display: grid; gap: 1rem; }
.dtop { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.dseg { margin: 0; }
.dctl { display: grid; grid-template-columns: 1fr; gap: .4rem; font-size: .95rem; }
.dctl span:first-child { color: var(--muted); }
.dctl .mono { font-size: 1.1rem; }
.dctl input[type=range] { width: 100%; min-height: 44px; accent-color: var(--accent); }
.dtog { display: flex; align-items: center; gap: .6rem; min-height: 44px; font-size: .95rem; color: var(--text); cursor: pointer; }
.dtog input { width: 20px; height: 20px; accent-color: var(--accent); }
.dlayers { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.dscope { width: 100%; height: auto; display: block; border-radius: var(--radius); background: var(--bg); }
.dbar { position: relative; height: 8px; border-radius: 4px; background: linear-gradient(to right, var(--line) 50%, var(--line-strong) 50%); }
.dbar::after { content: ""; position: absolute; left: 50%; top: -4px; width: 1px; height: 16px; background: var(--muted); }
.dbar i { position: absolute; top: -5px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--text); transition: left 120ms var(--ease-out), background-color var(--fast) ease; }
.dbar.bad i { background: var(--accent); }
.dread { display: flex; flex-wrap: wrap; gap: .25rem 2rem; }
.dread p, .dnote { font-size: 1rem !important; color: var(--muted); }
.dread .mono { color: var(--text); font-size: 1.1rem; }
.dhint { font-size: .9rem !important; color: var(--muted); }

/* ---------- School lessons ---------- */
.eyebrow { font: 500 var(--fs-xs)/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: var(--s-3); }
.lead { font-size: var(--fs-md); line-height: 1.6; font-weight: 400; max-width: 62ch; margin-top: var(--s-4); color: var(--body); }
.lead b, .more b { color: var(--text); }
.step .more, .step .tryit { margin-top: var(--s-4); font-size: 1.0625rem; line-height: 1.7; color: var(--body); }
.tw { overflow-x: auto; margin: 1rem 0; }
.step table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.step th, .step td { padding: .5rem .75rem; text-align: left; border-bottom: 1px solid var(--line); }
.step th { color: var(--muted); font-weight: 400; }
.tryit { padding: var(--s-4) var(--s-5); border-left: 2px solid var(--line-strong); background: var(--surface); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
.plays { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1rem 0; }
.playb.now { border-color: var(--accent); color: var(--accent); }
.playb::before { content: ""; width: 0; height: 0; margin-right: .6rem; border-style: solid; border-width: .32em 0 .32em .55em; border-color: transparent transparent transparent currentColor; }
.hint { color: var(--muted); }
.freq { position: relative; height: 150px; margin: 1.5rem 0 2rem; border-bottom: 1px solid var(--line); }
.freq .z { position: absolute; bottom: 0; padding: .4rem .1rem; font-size: clamp(.6rem, 2.4vw, .75rem); white-space: nowrap; overflow: hidden; text-align: center; background: var(--surface-2); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; color: var(--text); }
.freq .z.alt { background: var(--accent-soft); border-color: rgb(255 106 43 / .35); }
.freq .t { position: absolute; bottom: -1.5rem; transform: translateX(-50%); font: 500 .75rem var(--mono); color: var(--muted); }
.tutor { margin-top: var(--s-4); }
.tcount { font: 500 var(--fs-xs)/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.tq { font-size: var(--fs-lg); line-height: 1.3; font-weight: 600; letter-spacing: -0.02em; margin: var(--s-2) 0 var(--s-4) !important; }
.topts { display: grid; gap: var(--s-2); margin-top: var(--s-4); }
.topt { text-align: left; min-height: 52px; padding: var(--s-2) var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--hl); color: var(--text); font: inherit; cursor: pointer; transition: border-color var(--fast) ease, background-color var(--fast) ease, color var(--fast) ease; }
@media (hover: hover) { .topt:not(:disabled):hover { background: var(--surface-2); border-color: var(--muted); } }
.topt:active:not(:disabled) { transform: scale(.99); }
.topt:disabled:not(.right):not(.wrong) { color: var(--muted); }
.topt.right { border-color: var(--ok); background: rgb(76 195 138 / .12); }
.topt.wrong { border-color: var(--accent); background: var(--accent-soft); }
/* School quiz in the player: the same custom radio as the level test (ring, accent dot when it is the pick). Scoped to .lesson-page so the immersive quiz keeps its own letters. */
.lesson-page .tutor .topt { display: flex; align-items: center; gap: var(--s-3); }
.lesson-page .tutor .topt::before { content: ""; flex: none; width: 16px; height: 16px; box-sizing: border-box; border: 1.5px solid var(--control-border); border-radius: 50%; background: transparent; transition: border-color var(--fast) ease, background-color var(--fast) ease; }
.lesson-page .tutor .topt:not(:disabled):hover::before { border-color: var(--text); }
.lesson-page .tutor .topt.right::before { border-color: var(--ok); background: radial-gradient(circle, var(--ok) 0 4px, transparent 4.5px); }
.lesson-page .tutor .topt.wrong::before { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 4px, transparent 4.5px); }
.tfb { margin-top: var(--s-4); display: grid; gap: var(--s-3); }
.teasy { padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--body); }
.teasy b { display: block; color: var(--text); margin-bottom: .25rem; }
.tdone { font-size: var(--fs-xl); line-height: 1.08; letter-spacing: -0.03em; font-weight: 600; margin: 0 0 var(--s-2) !important; }
.srclist { list-style: none; padding: 0; display: grid; gap: .6rem; }
.chip { display: inline-block; padding: 0 .5rem; border: 1px solid var(--line-strong); border-radius: 4px; font: 500 var(--fs-xs)/1.6 var(--mono); letter-spacing: .04em; color: var(--muted); }

/* ---------- Lesson widgets: keyboard, scale, chords, drum grid ---------- */
.wid { margin: 1.25rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); display: grid; gap: .9rem; }
.wrow { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem 1rem; }
.wsel { display: grid; gap: .3rem; font-size: .85rem; color: var(--muted); }
.wsel.wide { grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; }
.wsel select { min-height: 44px; padding: 0 .6rem; border: 1px solid var(--control-border); border-radius: var(--radius); background: var(--surface-2); color: var(--text); font: inherit; }
.wsel input[type=range] { width: 100%; min-height: 44px; accent-color: var(--accent); }
.wnote, .wms { margin: 0; font-size: .85rem; color: var(--muted); }
.kb { position: relative; display: flex; height: 120px; user-select: none; }
.kb .w { flex: 1; min-width: 0; padding: 0 0 .35rem; display: flex; align-items: flex-end; justify-content: center; border: 1px solid #b9bdc4; border-radius: 0 0 6px 6px; background: #e9ebef; color: #4a4f57; font: 500 clamp(.5rem, 2.2vw, .68rem) var(--mono); cursor: pointer; }
.kb .bk { position: absolute; top: 0; width: calc(100% / 14 * .62); height: 60%; padding: 0; transform: translateX(-50%); z-index: 2; border: 1px solid #000; border-radius: 0 0 4px 4px; background: #0a0b0c; cursor: pointer; }
.kb .mark { box-shadow: inset 0 -6px 0 var(--accent); }
.kb .hit { background: var(--accent) !important; color: var(--on-accent); }
.kb-out { margin: 0; min-height: 1.6em; font: 500 .88rem var(--mono); color: var(--muted); }
.kb-out b { color: var(--text); }
.notes { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.notes span { padding: .2rem .55rem; border-radius: var(--radius); background: var(--surface-2); font: 500 .88rem var(--mono); }
.notes span.bl { background: #0a0b0c; border: 1px solid var(--line); }
.notes i { font: normal 500 .7rem var(--mono); color: var(--muted); }
.chords { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: .5rem; }
.chip-btn { padding: .5rem .25rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg); color: var(--text); text-align: center; line-height: 1.3; cursor: pointer; }
.chip-btn small { display: block; font: 500 .72rem var(--mono); color: var(--muted); }
.chip-btn b { font-size: 1.05rem; }
@media (hover: hover) { .chip-btn:hover { border-color: var(--accent); } }
.grid16 { display: grid; grid-template-columns: 3.4em repeat(16, minmax(0, 1fr)); gap: 2px; align-items: center; font: 500 .7rem var(--mono); color: var(--muted); }
.grid16 i { height: 20px; border-radius: 3px; background: var(--surface-2); }
.grid16 i:nth-of-type(4n+1) { box-shadow: inset 0 0 0 1px var(--line-strong); }
.grid16 i.on { background: var(--accent); }
.grid16 i.gh { background: var(--accent); opacity: .4; }
.grid16 i.ac { background: #ffa66b; }
.grid16 i.ph { outline: 2px solid var(--text); }

/* ---------- Version history (results) ---------- */
.history { margin-top: var(--s-7); padding-top: var(--s-6); border-top: 1px solid var(--line); }
.history h3 { font-size: var(--fs-lg); }
.history h4 { font-size: 1rem; margin-top: 1.5rem; }
.history .sub { color: var(--muted); margin-top: .35rem; }
.histform { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; margin: 1rem 0 .5rem; }
.histform .fld { flex: 1 1 14rem; display: grid; gap: .5rem; font-size: .8rem; color: var(--muted); }
.histscroll { overflow-x: auto; margin: .75rem 0; }
.histtable { border-collapse: collapse; width: 100%; font-size: .9rem; }
.histtable th, .histtable td { padding: .5rem .75rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.histtable th { color: var(--muted); font-weight: 400; }
.histdiff { margin: .5rem 0 0; padding-left: 1.2rem; }

/* ---------- Login page (admin page styles live in admin/admin.css) ---------- */
.adminbar { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: 0 var(--gutter); background: var(--surface-2); border-bottom: 1px solid var(--accent); font-size: .85rem; color: var(--muted); }
.adminbar .btn { min-height: 44px; padding: 0 .75rem; font-size: .85rem; border: 0; }
.authpage { padding: clamp(2rem, 6vw, 4.5rem) 0 var(--section); }
.authcard { max-width: 460px; margin: 0 auto; padding: 1.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); display: grid; gap: .9rem; }
.authcard h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); }
.authcard h2 { font-size: 1.4rem; }
.authcard .sub { color: var(--muted); }
.authcard form { display: grid; gap: .5rem; }
.authcard form .btn { margin-top: .75rem; }
.authcard form .btn[disabled] { opacity: .6; cursor: progress; }
.flabel { font-size: .85rem; color: var(--muted); margin-top: .5rem; }
.authcard .linkbtn { display: inline-flex; align-items: center; min-height: 44px; vertical-align: middle; background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.demobanner { padding: .6rem .8rem; border: 1px dashed var(--accent); border-radius: var(--radius); font-size: .85rem; color: var(--text); background: var(--surface-2); }
.authactions { display: flex; flex-wrap: wrap; gap: .75rem; }
.authfoot { font-size: .9rem; }
.authfoot a { text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; min-height: 44px; }
.authcard[hidden], .authcard form[hidden], .authresult[hidden], .demobanner[hidden] { display: none; }

/* ---------- CJK: Geist ships Latin only, so tune for system CJK fonts. Korean breaks at spaces, not mid-word. ---------- */
:lang(ko) { word-break: keep-all; }
:lang(ko) .vhead h1, :lang(ja) .vhead h1, :lang(zh-Hans) .vhead h1 { letter-spacing: -0.02em; line-height: 1.15; }
:lang(ja) .vhead h1, :lang(zh-Hans) .vhead h1 { line-break: strict; }
:lang(ko) .tool-view .vhead h1, :lang(ja) .tool-view .vhead h1, :lang(es) .tool-view .vhead h1 { font-size: clamp(2rem, 4vw, 3.2rem); }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  /* Phone header: the announcement is one ellipsized line, the first lesson content stays in the first screen. */
  .announce { justify-content: flex-start; text-align: left; font-size: var(--fs-xs); line-height: 1.4; padding-block: 0; gap: var(--s-2); }
  .announce > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .announce .arr { margin-left: auto; }
  .lesson-page { padding-top: var(--s-2); }
  .lesson-page #lesson { margin-top: var(--s-2) !important; } /* beats the inline margin set in lesson.html */
  .pbar { margin-bottom: var(--s-4); }
  .pmeta { margin-bottom: var(--s-4); }
  .step .prose p, .step .prose li { font-size: 1rem; }
  .vhead { padding-bottom: var(--s-5); margin-bottom: var(--s-5); }
  .lede { font-size: var(--fs-base); }
  .row { grid-template-columns: 2.25rem 1fr auto; padding: var(--s-3) var(--s-4); }
  .thead, .track details.more summary { padding-left: var(--s-4); padding-right: var(--s-4); }
  .drop { min-height: 180px; }
  .crosslink .btn { width: 100%; }
  .lpick { min-height: 220px; padding: var(--s-5); }
  .lviz { height: 48px; }
  .chart text { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .view:not([hidden]), .finding, .step.enter, .step .prose ol > li { animation: none; opacity: 1; transform: none; }
  .announce .led, .drop[aria-busy="true"] strong::after { animation: none; }
  .chart .you { animation: none; stroke-dashoffset: 0; }
  .btn, .seg label, .row, .row .go, .announce .arr, .htabs [role="tab"]::after, .htabs a::after, .faq-list summary::after, .track details.more summary::after { transition: none; }
  .lpick, .lpick .po, .lpick .arrow, .lviz i, .lopt, .lopt input, .lopt input::before, .linkbtn, .topt, .topt::before, .pbar i, .lbar i, .back { transition: none; }
  .btn:active, .topt:active, .lpick:active { transform: none; }
}

/* ===== Glossary (glossary.html + inline term marks and popover/sheet from js/glossary.js) ===== */
.glossary-page { padding: 3rem 0 var(--section); --gl-nav: var(--header-h); }
.glossary-page [hidden] { display: none !important; }
.glossary-page h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.035em; }
.glossary-page .lede { margin-top: 1rem; max-width: 56ch; }
.gl-search { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; }
.gl-search .field { flex: 1 1 18rem; max-width: 32rem; }
.gl-count { font-size: .85rem; flex-basis: 100%; }
.gl-rail { position: sticky; top: var(--gl-nav); z-index: 5; display: flex; gap: .35rem; margin: .75rem calc(var(--gutter) * -1) 1.5rem; padding: .5rem var(--gutter); overflow-x: auto; scrollbar-width: none; background: rgb(13 14 15 / .94); border-bottom: 1px solid var(--line); }
.gl-rail::-webkit-scrollbar { display: none; }
.gl-rail-btn { flex: none; min-width: 40px; min-height: 40px; padding: 0 .6rem; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; color: var(--text); font: 500 .9rem var(--mono); cursor: pointer; transition: transform 160ms var(--ease-out), border-color 160ms ease, background-color 160ms ease; }
.gl-rail-btn:active { transform: scale(0.97); }
.gl-rail-btn:disabled { color: #5d636b; border-color: transparent; cursor: default; }
@media (hover: hover) and (pointer: fine) { .gl-rail-btn:not(:disabled):hover { border-color: var(--accent); } }
.gl-group { margin-top: 2rem; scroll-margin-top: calc(var(--gl-nav) + 4.5rem); }
.gl-letter { font-size: 1.1rem; color: var(--accent); letter-spacing: 0; margin-bottom: .75rem; }
.gl-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.gl-card { padding: 1.1rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); scroll-margin-top: calc(var(--gl-nav) + 5rem); transition: border-color 200ms ease, background-color 200ms ease; }
.gl-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.gl-card.hit { border-color: var(--accent); background: var(--surface-2); }
.gl-name { font-size: 1.5rem; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.gl-aliases { margin-top: .5rem; display: flex; flex-wrap: wrap; gap: .35rem; }
.gl-alias { padding: 0 .5rem; border: 1px solid var(--line); border-radius: var(--radius); font-size: .8rem; line-height: 1.7; color: var(--muted); }
.gl-def { margin-top: .75rem; color: #cfd2d6; }
.gl-ex { margin-top: .6rem; padding-left: .75rem; border-left: 2px solid var(--line); color: var(--muted); font-size: .95rem; }
.gl-ex b { color: var(--text); font-weight: 600; }
.gl-note { margin-top: .6rem; font-size: .8rem; }
.gl-none { margin-top: 2rem; }
@media (max-width: 640px) {
  .glossary-page { padding-top: 1.5rem; }
}

/* Inline term marks: dotted underline, no layout shift (no padding, margin or font change). */
.gterm { display: inline; position: relative; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-align: inherit; white-space: normal; cursor: pointer; text-decoration: underline dotted var(--accent) 1.5px; text-underline-offset: 4px; }
.gterm::after { content: ""; position: absolute; inset: -10px -3px; }
@media (hover: hover) and (pointer: fine) { .gterm:hover { text-decoration-style: solid; } }
.gterm[aria-expanded="true"], .gterm:focus-visible { text-decoration-style: solid; }
.gterm:focus-visible { outline-offset: 2px; }

.gpop { position: absolute; z-index: 40; width: min(340px, calc(100vw - 16px)); padding: 1rem 1.1rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--float); animation: gpopIn 160ms var(--ease-out); }
.gpop[hidden], .gpop-back[hidden] { display: none; }
.gpop:focus { outline: none; }
.gpop-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.gpop-name { font-size: 1.25rem; letter-spacing: -0.02em; line-height: 1.2; }
.gpop-x { flex: none; width: 44px; height: 44px; margin: -.6rem -.7rem 0 0; border: 0; background: none; color: var(--muted); font: 400 1.6rem/1 var(--font); cursor: pointer; border-radius: var(--radius); }
@media (hover: hover) { .gpop-x:hover { color: var(--text); } }
.gpop-alias { margin-top: .15rem; font-size: .85rem; color: var(--muted); }
.gpop-s { margin-top: .6rem; font-size: .95rem; color: #cfd2d6; }
.gpop-e { margin-top: .5rem; padding-left: .7rem; border-left: 2px solid var(--line); font-size: .9rem; color: var(--muted); }
.gpop-e b { color: var(--text); font-weight: 600; }
.gpop-note { margin-top: .5rem; font-size: .8rem; color: var(--muted); }
.gpop-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: .25rem; color: var(--accent); font-size: .9rem; text-underline-offset: 3px; }
@keyframes gpopIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.gpop-back { position: fixed; inset: 0; z-index: 39; background: rgb(0 0 0 / .45); }
@media (max-width: 640px) {
  .gpop { position: fixed; inset: auto 0 0 0; width: auto; max-height: 70vh; overflow-y: auto; border-radius: var(--radius) var(--radius) 0 0; border-bottom: 0; padding: 1.1rem var(--gutter) calc(1rem + env(safe-area-inset-bottom)); animation: gsheetIn 220ms var(--ease-out); }
  .gpop-x { margin-right: -.7rem; }
}
@keyframes gsheetIn { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .gpop { animation: none; } .gl-card, .gl-rail-btn { transition: none; } }

/* Arriving from the landing warp: the page keeps the forward pull, growing into place out of the cover (never shrinking back). */
.arrive main, .arrive .nav, .arrive .announce { animation: arriveApp 420ms var(--ease-out) both; }
@keyframes arriveApp { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .arrive main, .arrive .nav, .arrive .announce { animation: none; } }

/* ---------- Stereo width: gauge + per-band mini meters (level-meter style) ---------- */
.width { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.width h3 { margin-bottom: var(--s-3); }
.width h4 { font: 500 var(--fs-xs)/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: var(--s-4) 0 var(--s-2); }
.wtrack { position: relative; height: 10px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.wmeter.big .wtrack { height: 16px; }
.wfill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ok); border-radius: 2px; transition: width 400ms var(--ease-out); }
.wmeter.z-narrow .wfill { background: var(--muted); }
.wmeter.z-mid .wfill { background: var(--ok); }
.wmeter.z-wide .wfill { background: var(--accent); }
.wmeter.z-warning .wfill { background: repeating-linear-gradient(135deg, #e5484d 0 6px, #8d2a2e 6px 12px); }
.wtick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--bg); z-index: 1; }
.wscale { display: flex; justify-content: space-between; margin-top: var(--s-1); font-size: var(--fs-xs); color: var(--faint); }
.wzone { display: flex; gap: .5rem; align-items: baseline; margin-bottom: var(--s-2); }
.wzone.z-warning strong { color: #ff8a8e; }
.wverdict { margin-top: var(--s-3); color: var(--body); }
.wrow { display: grid; grid-template-columns: 5.5rem 1fr 3rem; gap: var(--s-3); align-items: center; padding: 3px 0; }
.wname { font-size: var(--fs-sm); color: var(--muted); }
.wval { font-size: var(--fs-xs); color: var(--muted); text-align: right; }
@media (prefers-reduced-motion: reduce) { .wfill { transition: none; } }

/* ---------- Analyzer extras: wide spectrum (paid), stems (free), per-stem diagnosis (paid), locked panels ---------- */
.extra:not(:empty) { margin-top: var(--s-7); }
.panel-head { display: flex; align-items: center; gap: var(--s-3); }
.panel-head h3 { font: 500 var(--fs-xs)/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; }
.panel-sub { color: var(--body); max-width: 70ch; margin: var(--s-2) 0 var(--s-4); }
.btn.sm { min-height: 36px; padding: 0 .8rem; font-size: .85rem; }
/* Selected chip: tonal fill + text colour + accent-tinted hairline (no white border, no brown fill). */
.btn[aria-pressed="true"] { background: var(--surface-3); border-color: var(--accent-line); color: var(--text); }

/* locked state: text and a call to action, no chart-shaped decoration */
.locked { padding: var(--s-5); background: var(--surface); border: 1px dashed var(--control-border); border-radius: var(--radius-lg); }
.locked-head { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.locked-head h3 { font-size: var(--fs-lg); margin: 0; letter-spacing: -0.02em; }
.lock-icon { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.locked-body { color: var(--body); max-width: 60ch; margin: var(--s-3) 0 var(--s-4); }
.locked-cta { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; }

/* wide spectrum */
.wide-spectrum { padding: var(--s-5); }
.wide-chart { min-height: 260px; touch-action: pan-y; }
.wide-chart .band-shade { fill: rgb(255 255 255 / .025); }
.wide-chart .band-edge { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 2 4; }
.wide-chart .band-name { fill: var(--faint); font-size: 11px; letter-spacing: .04em; }
.wide-chart .axis-title { fill: var(--faint); font-size: 10px; }
.wide-chart .area { fill: var(--accent-soft); stroke: none; }
.wide-chart .you-wide { stroke: var(--accent); stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.wide-chart .target { stroke: var(--muted); stroke-width: 1.75; fill: none; stroke-dasharray: 5 5; }
.wide-chart .cross { stroke: var(--text); stroke-width: 1; opacity: .5; }
.wide-chart .tip { fill: var(--text); font-size: 12px; }

/* stems */
.stems-panel { padding: var(--s-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.engine-note { margin: var(--s-3) 0; padding: var(--s-3) var(--s-4); border-left: 2px solid var(--line-strong); color: var(--muted); }
.engine-note.warn { border-left-color: var(--accent); color: var(--body); }
.stem-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-4); }
.stem-status { margin-top: var(--s-3); color: var(--body); min-height: 1.6em; }
.stem-status.err { color: #ff8a8e; }
.stem-progress { width: 100%; max-width: 420px; height: 6px; accent-color: var(--accent); }
.stem-list { display: grid; gap: var(--s-3); margin-top: var(--s-4); }
.stem-row { display: grid; grid-template-columns: 9.5rem 1fr auto; gap: var(--s-4); align-items: center; padding: var(--s-3); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); transition: opacity var(--fast) ease; }
.stem-row.off { opacity: .5; }
.stem-info { display: grid; gap: .15rem; }
.stem-info .mono { font-size: var(--fs-xs); }
.level { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.level i { display: block; height: 100%; background: var(--ok); }
.wave { position: relative; height: 56px; background: var(--surface); border-radius: 4px; overflow: hidden; }
.wave canvas { width: 100%; height: 100%; display: block; }
.playhead { position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: var(--text); opacity: .8; pointer-events: none; }
.stem-ctl { display: flex; gap: var(--s-2); flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 760px) {
  .stem-row { grid-template-columns: 1fr; }
  .stem-ctl { justify-content: flex-start; }
}

/* per-stem diagnosis */
.stem-analysis { padding: var(--s-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.scards { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.scard { padding: var(--s-4); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: var(--s-3); align-content: start; }
.scard h4 { font-size: var(--fs-md); margin: 0; letter-spacing: -0.01em; }
.snums { margin: 0; display: flex; gap: var(--s-5); }
.snums dt { font: 500 var(--fs-xs)/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.snums dd { margin: 0; font-size: 1.2rem; }
.snums small { color: var(--muted); font-size: .75rem; }
.sbands h5 { font: 500 var(--fs-xs)/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s-2); }
.sband { display: grid; grid-template-columns: 4.6rem 1fr 2.6rem; gap: var(--s-2); align-items: center; padding: 2px 0; }
.sname { font-size: var(--fs-xs); color: var(--muted); }
.sval { font-size: var(--fs-xs); color: var(--muted); text-align: right; }
.sbar { position: relative; height: 8px; background: var(--surface-3); border-radius: 2px; }
.sbar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 2px; }
.sbar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .85; }
.swidth .wzone { margin-bottom: var(--s-2); font-size: var(--fs-sm); color: var(--muted); }
.sfindings { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); font-size: .92rem; }
.sfindings .empty { color: var(--muted); }
.scorr { margin: var(--s-2) 0 0; font-size: var(--fs-sm); color: var(--muted); }

/* ---------- Points: header chip, tier panel, unlock prices (js/points-ui.js) ----------
   The tier colour is only a small dot; the accent stays reserved. */
:root { --tier-bronze: #b0793c; --tier-silver: #aeb6bf; --tier-gold: #d9b45a; --tier-platinum: #cfe3ea; }
.pchip { flex: none; display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-2); color: var(--muted); text-decoration: none; font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.pchip i, .tierpanel .tp-head i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--tier-bronze); }
.pchip[data-tier="silver"] i, .tierpanel[data-tier="silver"] i { background: var(--tier-silver); }
.pchip[data-tier="gold"] i, .tierpanel[data-tier="gold"] i { background: var(--tier-gold); }
.pchip[data-tier="platinum"] i, .tierpanel[data-tier="platinum"] i { background: var(--tier-platinum); }
@media (hover: hover) { .pchip:hover { color: var(--text); } }
.tierpanel { margin: 0 0 var(--s-5); padding: var(--s-4) var(--s-5); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--hl); }
.tierpanel .tp-head { display: flex; align-items: center; gap: var(--s-3); margin: 0 0 var(--s-3); font: 500 var(--fs-xs)/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.tierpanel .tp-name { color: var(--text); font-weight: 500; }
.tierpanel .tp-pts { margin-left: auto; color: var(--text); }
.tierpanel .tp-bar { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.tierpanel .tp-bar i { display: block; height: 100%; width: 0; background: var(--muted); transition: width 240ms var(--ease-enter); }
.tierpanel .tp-note { margin: var(--s-2) 0 0; font-size: var(--fs-sm); color: var(--muted); }
.status.unlock { color: var(--text); border-color: var(--control-border); }
[data-member] .status.unlock, [data-member] .pgate { display: none; }
.pbar i.lit { background: var(--accent); box-shadow: 0 0 8px rgb(255 106 43 / .6); }
.pbar i.done.lit { background: var(--line-strong); box-shadow: none; }
.ppoints { min-height: 0; margin: var(--s-4) 0 0; font: 500 var(--fs-xs)/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text); }
.ppoints:empty { display: none; }
#lessons:not([data-view="lists"]) .tierpanel { display: none; } /* the tier panel belongs to the lists, not to the start choice or the level test */
/* Phone level test: the page header folds away while a question or the result is on screen (still read by screen readers). */
@media (max-width: 720px) {
  #lessons[data-view="test"] .vhead { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 560px) { .pchip { padding: 0 var(--s-2); } .pchip .pc-tier { display: none; } }
@media (prefers-reduced-motion: reduce) { .tierpanel .tp-bar i { transition: none; } }
@media (max-width: 1080px) { .pchip { margin-left: auto; } .pchip + .hlang { margin-left: 0; } .nav .wrap:has(.pchip):not(:has(.hlang))::after { margin-left: 0; } }

/* pricing: phones */
@media (max-width: 899px) {
  .plan.featured { order: -1; } /* the featured tier comes first on phones */
  .compare { display: flex; flex-direction: column; }
  .plan-action { align-self: stretch; width: 100%; min-height: 48px; justify-content: center; }
}
