/* 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 */
@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;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --fast: 160ms;
}

/* ---------- 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: 3px; 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: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: var(--s-3); }
.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) var(--ease-out), background-color var(--fast) ease, border-color var(--fast) ease; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { border-color: var(--muted); background: var(--surface-2); }
  .btn.primary: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 / .94); 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: 148px; }
  .nav .wrap { flex-wrap: wrap; height: auto; gap: 0; padding-top: .25rem; }
  .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-out); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.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-lg); 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: .06em; 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; }
.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: .15rem; min-width: 0; }
.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); } }
a.row:focus-visible { outline-offset: -3px; border-radius: 0; }
div.row { color: var(--muted); }
div.row .title { color: var(--muted); }
.status, .kotag { font: 500 .7rem/1.5 var(--mono); color: var(--faint); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 .4rem; white-space: nowrap; }
.status.free { color: var(--accent); border-color: rgb(255 106 43 / .5); }
.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); }

/* ---------- School block: the one primary action of the Lessons view ---------- */
.school-panel { padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--bg); }
.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-lg); }
@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: .06em; text-transform: uppercase; color: var(--muted); }
.slabel .ch { color: var(--accent); }
.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); } }
.seg input:checked + label { background: var(--text); border-color: var(--text); color: var(--bg); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 3px; }
.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); 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: 3px; }
@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); 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: .06em; 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: .06em; 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(--accent); 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: 5fr 7fr; align-items: start; } }
.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: .06em; 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 small { font-size: 1rem; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: .35rem; }
.plan ul { list-style: none; margin: var(--s-5) 0 0; padding: 0; min-height: 8.5rem; } /* room for the JS-built list (3 items); member plan has 4 */
#plan-member ul { min-height: 11.5rem; }
.plan-action { margin-top: var(--s-5); align-self: flex-start; }
.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); }
.plan form { margin-top: var(--s-6); display: grid; gap: var(--s-3); max-width: 380px; }

/* ---------- 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: 4fr 5fr auto; } }
.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-6) 0 var(--section); }
.back { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; font-size: .95rem; }
.back::before { content: "←"; margin-right: .5rem; font-family: var(--mono); }
@media (hover: hover) { .back:hover { color: var(--text); } }
.player { max-width: 760px; scroll-margin-top: calc(var(--header-h) + 2rem); }
.pbar { display: flex; gap: 6px; margin-bottom: 2rem; }
.pbar i { flex: 1; height: 4px; border-radius: 2px; background: var(--line-strong); transition: background-color 200ms ease; }
.pbar i.done { background: var(--muted); }
.pbar i.now { background: var(--accent); }
.pstage { min-height: 50vh; padding-bottom: 3rem; }
.step.enter { animation: stepIn 320ms var(--ease-out); }
@keyframes stepIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.pmeta { display: flex; align-items: baseline; gap: .75rem; margin: 0 0 1.5rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.pmeta .pidx { font: 500 .85rem var(--mono); color: var(--accent); }
.pmeta .ptitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step.is-demo .demo { margin-top: 0; }
.step .prose { max-width: none; }
.step .prose h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.step .prose h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); margin: 0 0 1rem; letter-spacing: -0.03em; }
.step .prose p, .step .prose li { font-size: 1.15rem; line-height: 1.65; }
.step .prose ol { counter-reset: n; list-style: none; padding: 0; gap: 1rem; }
/* 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 260ms var(--ease-out); }
.step .prose ol > li::before { content: counter(n); position: absolute; left: 0; top: .25rem; font: 500 1rem var(--mono); color: var(--accent); }
.pnav { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding: 1rem 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.player:has(.step:not([hidden]) :is(.demo, .wid)) .pnav { position: static; background: none; }
.pnav .btn[hidden] { display: none; }
.pcount { color: var(--muted); font-size: .85rem; }
.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-lg); 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 .85rem var(--mono); color: var(--muted); margin-bottom: .75rem; }
.lead { font-size: 1.35rem; line-height: 1.5; font-weight: 500; margin-top: 1rem; color: var(--text); }
.lead b, .more b { color: var(--text); }
.step .more, .step .tryit { margin-top: 1rem; font-size: 1.15rem; line-height: 1.65; 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: 1rem 1.25rem; border-left: 2px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 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: 1rem; }
.tq { font-size: 1.3rem; font-weight: 600; margin: .5rem 0 1rem !important; }
.topts { display: grid; gap: .6rem; margin-top: 1rem; }
.topt { text-align: left; min-height: 48px; padding: .6rem 1rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: border-color var(--fast) ease; }
@media (hover: hover) { .topt:not(:disabled):hover { border-color: var(--muted); } }
.topt:active:not(:disabled) { transform: scale(.98); }
.topt.right { border-color: var(--ok); background: rgb(76 195 138 / .12); }
.topt.wrong { border-color: var(--accent); background: var(--accent-soft); }
.tfb { margin-top: 1rem; display: grid; gap: .75rem; }
.teasy { padding: 1rem; border-radius: var(--radius); background: var(--surface); color: var(--body); }
.teasy b { display: block; color: var(--text); margin-bottom: .25rem; }
.tdone { font-size: 1.4rem; font-weight: 600; margin: 0 0 .5rem !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 .75rem/1.6 var(--mono); 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-lg); 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) {
  .announce { justify-content: flex-start; text-align: left; font-size: .8rem; line-height: 1.4; }
  .announce .arr { margin-left: auto; }
  .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%; }
  .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; }
}

/* ===== 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: 0 12px 32px rgb(0 0 0 / .5); 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 app settles in from slightly zoomed-in. */
.arrive main { animation: arriveApp 320ms var(--ease-out) both; }
@keyframes arriveApp { from { opacity: 0; transform: scale(1.05); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .arrive main { 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: .06em; 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; } }
