/* Design tokens: see the UX and visual design spec (paper and ink, A blue,
   B orange, Bricolage Grotesque for display, Atkinson Hyperlegible for text). */
:root {
  --paper: #fbfbf8;
  --surface: #ffffff;
  --ink: #16171a;
  --ink-muted: #5a5e66;
  --line: #e2e3de;
  --side-a: #2457d6;
  --side-b: #c2410c;
  --reveal: #fff3c4;
  --good: #15803d;
  --caution: #a16207;
  --bad: #b42318;
  /* Older names, kept so every rule reads from the tokens */
  --bg: var(--paper);
  --panel: var(--surface);
  --muted: var(--ink-muted);
  --a: var(--side-a);
  --b: var(--side-b);
  --warn: var(--caution);
  --accent: var(--ink);
  --accent-ink: var(--paper);
  --radius: 20px;
  --radius-sm: 12px;
  --font-display: "Bricolage Grotesque", "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --font-text: "Public Sans", "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Numbers: Public Sans digits (plain zero), tabular so columns line up */
  --font-num: "Public Sans", "Atkinson Hyperlegible Next", system-ui, sans-serif;
  font-family: var(--font-text);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141413;
    --surface: #1e1e1c;
    --ink: #edede8;
    --ink-muted: #a3a39c;
    --line: #33332f;
    --side-a: #6a9bff;
    --side-b: #ff8a4c;
    --reveal: #3d3612;
    --good: #5cc98a;
    --caution: #e5b24c;
    --bad: #f97066;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  font-size: 16px;
}

h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; }
h1 { font-size: 24px; }
h2 { font-size: 19px; }

button, select, input { font: inherit; color: inherit; }

/* Section and field labels: sentence case, never tiny caps */
.label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-muted);
  margin: 0 0 6px;
}
.label output { color: var(--ink); margin-left: 6px; font-family: var(--font-num); }

.hint { font-size: 14px; color: var(--ink-muted); margin: 6px 0 0; }

select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.primary {
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 999px;
  min-height: 44px;
  padding: 10px 20px;
  font-weight: 700;
  cursor: pointer;
}
.ghost {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 44px;
  padding: 9px 16px;
  cursor: pointer;
  white-space: nowrap;
}
.ghost.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.primary:focus-visible, .ghost:focus-visible, .ab:focus-visible, select:focus-visible, .cmp-card:focus-visible, .node:focus-visible { outline: 3px solid var(--side-a); outline-offset: 2px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.seg-btn { border: 0; background: transparent; min-height: 38px; padding: 6px 16px; border-radius: 999px; cursor: pointer; color: var(--ink-muted); }
.seg-btn.on { background: var(--ink); color: var(--paper); }

/* App */
.app { max-width: 1200px; margin: 0 auto; padding: 24px 20px 56px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.badge { font-size: 13px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; color: var(--ink-muted); }

.transport {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.play { min-width: 96px; }
input[type="range"] { width: 100%; accent-color: var(--ink); }
.scale { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-muted); margin-top: 2px; }
.level-desc { margin: 10px 0 0; font-weight: 700; font-family: var(--font-display); font-size: 17px; line-height: 1.3; }

.compare { display: grid; grid-template-columns: 1fr 230px 1fr; gap: 20px; align-items: start; }

.setup {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.setup header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.setup header h2 { font-size: 22px; font-weight: 800; }
.readout { margin: 0; border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 8px; }
.readout div { display: grid; grid-template-columns: 130px 1fr; gap: 8px; font-size: 14px; }
.readout dt { color: var(--ink-muted); }
.readout dd { margin: 0; }
.amp-meter.warn, .spk-meter.warn { color: var(--caution); font-weight: 700; }
.amp-meter.bad, .spk-meter.bad { color: var(--bad); font-weight: 700; }
.busy { font-size: 14px; color: var(--ink-muted); margin: 10px 0 0; }

.switch { display: flex; flex-direction: column; align-items: center; gap: 12px; position: sticky; top: 16px; }
.ab {
  width: 100%; max-width: 200px; height: 104px;
  font-family: var(--font-display);
  font-size: 48px; font-weight: 800;
  border-radius: 20px;
  border: 2px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  color: var(--ink-muted);
}
.ab[data-side="A"].on { border-color: var(--side-a); color: var(--side-a); border-width: 3px; }
.ab[data-side="B"].on { border-color: var(--side-b); color: var(--side-b); border-width: 3px; }
.switch .hint { margin: 0; }
.switch-hint { text-align: center; max-width: 200px; }
/* Keyboard hints show only where there is a keyboard; touch hints only on touch screens */
.hint .touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .hint .keys { display: none; }
  .hint .touch { display: inline; }
}

/* The verdict: the answer card of the spec */
.impact { width: 100%; text-align: center; background: var(--reveal); border-radius: var(--radius); padding: 16px 14px; margin-top: 4px; }
.impact .label { margin-bottom: 2px; color: var(--ink); opacity: .75; }
.impact-label { font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px; }
.impact-bar { height: 8px; background: color-mix(in oklab, var(--ink) 12%, transparent); border-radius: 999px; overflow: hidden; }
.impact-bar span { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.3s; }
.impact-detail { color: var(--ink); opacity: .85; line-height: 1.45; }

.presets { margin-top: 36px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.presets .hint { margin: -2px 0 14px; }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.cmp-group { border-top: 1px solid var(--line); }
.cmp-group:last-child { border-bottom: 1px solid var(--line); }
.cmp-group summary { cursor: pointer; padding: 12px 2px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cmp-group-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.cmp-group summary { list-style: none; }
.cmp-group summary::-webkit-details-marker { display: none; }
.cmp-group summary::before { content: "▸"; color: var(--ink-muted); width: 12px; transition: transform .15s; }
.cmp-group[open] summary::before { transform: rotate(90deg); }
.cmp-group summary .hint { margin: 0; }
.cmp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; padding: 0 0 14px; }
.cmp-card:disabled { opacity: 0.5; cursor: not-allowed; }
.cmp-current { margin: 0 0 14px; font-size: 15px; color: var(--ink-muted); max-width: 820px; }
.cmp-current b { color: var(--ink); }
.cmp-card { text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, transform .15s, box-shadow .15s; }
.cmp-card:hover { border-color: var(--ink-muted); transform: translateY(-1px); }
.cmp-card.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.cmp-card .kind { font-size: 14px; font-weight: 700; color: var(--ink-muted); }
.cmp-card strong { font-family: var(--font-display); font-size: 16px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.cmp-card .plays { margin-top: auto; padding-top: 4px; font-size: 13px; color: var(--ink-muted); }
.cmp-card .hear { font-size: 15px; color: var(--ink-muted); line-height: 1.45; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-size: 14px; }
.chip:hover { border-color: var(--ink); }

.notes { margin-top: 36px; font-size: 14px; color: var(--ink-muted); max-width: 820px; }
.notes p { margin: 0 0 8px; }
.q-own, .own-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 4px 0 12px; }
.q-own p, .own-box p { margin: 0 0 8px; }
.keep-row { margin: 6px 0 0; }
.my-songs { margin: 4px 0 0; font-size: 14px; }
.my-songs summary { cursor: pointer; color: var(--accent); }
.my-songs-list { list-style: none; padding: 0; margin: 6px 0 0; max-height: 220px; overflow-y: auto; }
.my-songs-list li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }
/* Position in the song */
.scrub { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; }
.scrub-range { flex: 1; min-width: 0; }
.scrub .q-play, .scrub .play { flex: none; min-width: 84px; min-height: 40px; padding: 6px 16px; }
.keys-hint { margin: 6px 0 0; }
.scrub-time { margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* The nudge toward your own songs: up front, not small print */
.own-nudge { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; background: var(--reveal); border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; }
.own-nudge[hidden] { display: none; }
.own-nudge-btns { display: flex; align-items: center; gap: 12px; }
/* The first-visit song choice comes before anything else in a question */
#qview:has(.q-own:not([hidden])) .q-steps { display: none; }
.own-nudge p { margin: 0; font-size: 16px; flex: 1 1 280px; }
.primary.small { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.q-own-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.q-orig-row { margin: 6px 0 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-orig-row .hint { margin: 0; }
.orig-btn[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.t-resume { margin-bottom: 16px; }
/* Taste results, round by round: a dot per vote */
.t-traits { list-style: none; padding: 0; margin: 8px 0 0; }
.t-traits > li { margin: 0 0 14px; }
.t-traits p { margin: 2px 0 0; font-size: 15px; }
.t-dots { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; vertical-align: middle; }
.t-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); vertical-align: middle; }
.t-dot.up { background: var(--ink); }
.t-dot.down { background: transparent; }
.t-dot.none { border-color: var(--ink-muted); width: 10px; height: 2px; border-width: 1px; border-radius: 1px; background: var(--ink-muted); }
.t-rounds { margin-top: 4px; font-size: 14px; }
.t-rounds summary { cursor: pointer; color: var(--accent); }
.t-rounds ul { margin: 4px 0 0; padding-left: 0; list-style: none; }
.t-rounds li { margin: 2px 0; }
.t-legend { color: var(--ink-muted); font-size: 13px; }
.t-lean { font-weight: 700; }
.t-traits p.t-note { color: var(--ink-muted); font-size: 13px; }
.t-notes-h { margin-top: 18px; }
.t-notes { margin: 6px 0 0; padding-left: 20px; font-size: 14px; color: var(--ink-muted); line-height: 1.5; }
.t-notes li { margin: 3px 0; }
.t-next-links { display: flex; gap: 18px; margin: 10px 0 0; }
.t-resume-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
/* The product and measurement notes distract during the taste test */
body[data-view="taste"] footer.notes, body[data-view="question"] footer.notes { display: none; }

@media (max-width: 900px) {
  .transport { grid-template-columns: 1fr; gap: 18px; padding: 18px; }
  .compare { grid-template-columns: 1fr; }
  .switch { position: sticky; top: 0; z-index: 2; flex-direction: row; flex-wrap: wrap; justify-content: center; background: var(--paper); padding: 8px 0; order: -1; }
  .ab { width: 80px; height: 56px; font-size: 26px; }
  .switch-hint { flex-basis: 100%; max-width: none; }
  .impact { margin-top: 0; padding: 12px; }
  .readout div { grid-template-columns: 1fr; gap: 2px; }
}

/* Sources page */
.doc { max-width: 980px; }
.doc h1 { font-size: 36px; font-weight: 800; letter-spacing: -0.02em; margin: 12px 0 8px; }
.doc h2 { margin: 32px 0 10px; }
.doc a { color: var(--ink); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.doc table { border-collapse: collapse; width: 100%; font-size: 14px; }
.doc th, .doc td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { font-size: 13px; font-weight: 700; color: var(--ink-muted); }
.doc tr:last-child td { border-bottom: 0; }
.doc td.num { font-family: var(--font-num); font-size: 13px; }
.tag { display: inline-block; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; border: 1px solid currentColor; }
.tag-cited, .tag-traced, .tag-standard { color: var(--good); }
.tag-typical { color: var(--warn); }
.tag-spec { color: var(--a); }
.tag-design { color: var(--muted); }
.notes a { color: var(--accent); }

/* Blind test */
.blind-btn { width: 100%; }
.abx { border: 1px solid var(--line); border-radius: 24px; padding: 30px; max-width: 480px; width: calc(100% - 32px); background: var(--panel); color: var(--ink); }
.abx::backdrop { background: rgba(0, 0, 0, 0.55); }
.abx h2 { font-size: 28px; font-weight: 800; margin-bottom: 10px; }
.abx p { margin: 0 0 12px; }
.abx-how { padding-left: 20px; margin: 0 0 16px; }
.abx-how li { margin-bottom: 4px; }
.abx-length { border: 0; padding: 0; margin: 0 0 12px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.abx-length legend { float: left; margin-right: 8px; }
.abx-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.abx-actions .primary { flex: 1; }
.abx-bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 20px; }
.abx-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.3s; }
.abx-players { display: flex; gap: 12px; justify-content: center; margin-bottom: 8px; }
.abx-play { width: 96px; height: 84px; font-family: var(--font-display); font-size: 34px; font-weight: 800; border-radius: 18px; border: 2px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.abx-play.x { width: 104px; }
.abx-play.on { border-color: var(--accent); color: var(--accent); }
.abx-keys { text-align: center; }
.abx-question { text-align: center; font-family: var(--font-display); font-size: 20px; font-weight: 700; margin-top: 16px !important; }
.abx-score { font-size: 32px !important; }
.link { background: none; border: 0; color: var(--ink-muted); text-decoration: underline; cursor: pointer; padding: 6px 0; font-size: 14px; }
@media (hover: none) and (pointer: coarse) { .abx-keys { display: none; } }

/* Music picker */
.loop-row { margin-top: 8px; gap: 8px; }
.loop-row .hint { margin: 0; }
input.time { width: 80px; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-family: var(--font-num); }
.credit a, .recommended a { color: var(--ink); }
.recommended { margin-top: 10px; font-size: 14px; }
.recommended summary { cursor: pointer; color: var(--ink); font-weight: 700; }
.recommended ul { padding-left: 18px; margin: 8px 0 0; }
.recommended li { margin-bottom: 8px; }
body.dragging::after { content: 'Drop an audio file to play it'; position: fixed; inset: 12px; border: 3px dashed var(--accent); border-radius: 16px; display: grid; place-items: center; font-size: 20px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--bg) 85%, transparent); pointer-events: none; z-index: 10; }

/* Vinyl stages */
.vinyl-stages { border-left: 3px solid var(--line); padding-left: 12px; margin: -4px 0 14px; }
.vinyl-stages .blurb { min-height: 0; }

/* Famous systems */
.systems { margin-top: 36px; }
.system-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.system { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.system h3 { margin: 0; font-size: 19px; }
.system p { margin: 0; font-size: 14px; color: var(--ink-muted); line-height: 1.5; }
.system .chain { color: var(--ink); }
.system .row { margin-top: auto; }

/* ---- A/B identity --------------------------------------------------------- */
body { --active: var(--a); }
body[data-active="B"] { --active: var(--b); }
.setup { transition: border-color .2s, box-shadow .2s; }
.setup.active[data-side="A"] { border-color: var(--a); box-shadow: 0 0 0 1px var(--a), 0 8px 30px -18px var(--a); }
.setup.active[data-side="B"] { border-color: var(--b); box-shadow: 0 0 0 1px var(--b), 0 8px 30px -18px var(--b); }
.setup[data-side="A"] h2 { color: var(--a); }
.setup[data-side="B"] h2 { color: var(--b); }
.ab { transition: border-color .15s, color .15s, background .15s, transform .1s; }
.ab:active { transform: scale(.97); }
.ab[data-side="A"].on { background: color-mix(in oklab, var(--a) 12%, var(--panel)); }
.ab[data-side="B"].on { background: color-mix(in oklab, var(--b) 12%, var(--panel)); }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 3px transparent; } }

/* ---- Chain diagram -------------------------------------------------------- */
.arrow { position: relative; }
.arrow::before { content: ""; position: absolute; left: 2px; right: 2px; top: 50%; border-top: 1.5px solid var(--line); }
.arrow::after { content: ""; position: absolute; right: 1px; top: calc(50% - 4px); border: 4px solid transparent; border-left-color: var(--line); border-right: 0; }

/* ---- Details panel -------------------------------------------------------- */
.details { margin-top: 24px; }
.details > details { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.details summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.details summary::-webkit-details-marker { display: none; }
.details summary::before { content: "▸"; color: var(--muted); transition: transform .15s; display: inline-block; }
.details details[open] summary::before { transform: rotate(90deg); }
.details summary .label { margin: 0; font-family: var(--font-display); font-size: 19px; color: var(--ink); }
#details-body, .why-body { padding: 0 18px 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 18px 28px; grid-auto-flow: row dense; }
#details-body > p, .why-body > p { grid-column: 1 / -1; }
.d-summary { grid-column: 1 / -1; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.d-summary ul { margin: 6px 0; padding-left: 20px; font-size: 17px; }
.d-summary li { margin: 3px 0; }
.d-block h3, .d-summary h3 { font-size: 19px; margin: 4px 0 8px; }
.d-block p { font-size: 15px; color: var(--ink-muted); margin: 0 0 10px; line-height: 1.55; }
/* Wide blocks span the panel; their charts sit side by side, each under its own heading */
.d-block.wide { grid-column: 1 / -1; }
.d-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 22px 28px; margin-top: 6px; }
.d-panel h4 { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0 0 4px; }
.d-panel p { font-size: 14px; margin-bottom: 8px; }
@media (min-width: 900px) {
  .d-block.lead { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); grid-template-rows: auto 1fr; column-gap: 28px; align-items: start; }
  .d-block.lead > .chart { grid-column: 2; grid-row: 1 / span 2; margin-top: 4px; }
}
.step { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; color: var(--ink); background: var(--line); white-space: nowrap; }
.step.r0 { color: var(--ink-muted); background: transparent; border: 1px solid var(--line); }
.step.r3 { font-weight: 700; }
.facts { margin: 8px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.55; }
.facts li { margin: 3px 0; }
.dtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.dtable td { font-family: var(--font-num); font-size: 13px; }
.dtable th, .dtable td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line); }
.dtable thead th { font-weight: 700; color: var(--ink-muted); font-size: 13px; }
.dtable tbody th:first-child { width: 22px; }
.rtable-wrap { container-type: inline-size; }
.rtable { table-layout: fixed; }
.rtable thead th { vertical-align: bottom; color: var(--ink); }
.rtable td { vertical-align: top; }
.rtable tbody th:first-child { width: 42%; font-weight: 400; color: var(--ink-muted); font-size: 13px; vertical-align: top; }
.rtable thead td:first-child { width: 42%; border-bottom: 1px solid var(--line); }
/* Narrow: each measurement's name on its own line, the two values below */
@container (max-width: 539px) {
  .rtable, .rtable thead, .rtable tbody { display: block; }
  .rtable tr { display: grid; grid-template-columns: 1fr 1fr; }
  .rtable thead td:first-child { display: none; }
  .rtable tbody th:first-child { width: auto; grid-column: 1 / -1; padding-top: 10px; border-bottom: 0; }
}
.chart { margin: 4px 0 12px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .g { stroke: var(--line); stroke-width: 1; }
.chart .g.z { stroke: var(--muted); stroke-opacity: .5; }
.chart .ax { fill: var(--ink-muted); font-size: 12px; font-family: var(--font-num); }
.chart .ax.val { fill: var(--ink); font-size: 12px; font-family: var(--font-num); }
.chart figcaption { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); align-items: center; }
.chart .key { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.chart .key i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.chart .note { margin-left: auto; }
#level-out, .dtable td, .chart .ax, .doc td.num, input.time, .readout dd { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* ---- Mobile transport bar ------------------------------------------------- */
.mbar { display: none; }
@media (max-width: 900px) {
  .mbar:not([hidden]) { display: flex; /* bottom padding leaves room for Netlify's badge */ position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; gap: 10px; align-items: center; padding: 10px 16px calc(64px + env(safe-area-inset-bottom)); background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .mplay { flex: 0 0 auto; min-width: 84px; height: 48px; }
  .mab { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .mab .ab { width: auto; max-width: none; height: 52px; font-size: 26px; border-radius: 14px; }
  body:has(.mbar:not([hidden])) .app { padding-bottom: 140px; }
  .switch { position: static; order: 0; }
  .switch > .ab, .switch .switch-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

.impact-why { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--accent); }
@media (max-width: 900px) { .switch { order: -1; } }

/* ---- Taste test --------------------------------------------------------- */
.taste-answer:disabled { opacity: .45; cursor: wait; }
.taste-result p { margin: 0 0 10px; line-height: 1.5; }
.taste-result h3 { font-size: 17px; margin: 16px 0 4px; }
.abx-length label { display: block; margin: 4px 0; }


/* ---- Home: questions ------------------------------------------------------ */
.home { max-width: 1200px; margin: 0 auto; padding: 20px 20px 64px; }
.home-top { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.wordmark, .wordmark-btn { font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.wordmark-btn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); }
.home-mode { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.home-mode .hint { margin: 0; white-space: nowrap; }
.home-hero { padding: 48px 0 28px; max-width: 900px; }
.home-hero > p { max-width: 760px; }
.home-hero h1 { font-size: clamp(38px, 6vw, 64px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.02; }
.q-about { font-size: 15px; color: var(--ink-muted); margin: 0 0 10px; max-width: 820px; }
.home-hero .lead { font-size: 20px; color: var(--ink-muted); margin: 16px 0 8px; line-height: 1.45; }
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.q-section { margin: 0 0 26px; }
.q-section-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--ink-muted); text-transform: none; letter-spacing: 0; margin: 0 0 10px; }
.q-card { text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; min-height: 150px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; transition: transform .15s, border-color .15s; }
.q-card:hover { transform: translateY(-2px); border-color: var(--ink-muted); }
.q-card:focus-visible { outline: 3px solid var(--side-a); outline-offset: 2px; }
.q-topic { font-size: 14px; font-weight: 700; color: var(--ink-muted); }
.q-card-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; }
.q-count { margin-top: auto; font-size: 14px; color: var(--ink-muted); }
.q-card.q-start { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.q-card.q-off { opacity: 0.55; cursor: not-allowed; }
.q-card.q-off:hover { transform: none; border-color: var(--line); }
.q-card.q-start .q-topic, .q-card.q-start .q-count { color: color-mix(in oklab, var(--paper) 80%, var(--ink)); }
.home-h { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -0.015em; margin: 8px 0 14px; }
/* The three paths, numbered in the suggested order */
.paths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 4px 0 18px; }
.path { text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 20px 22px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: transform .15s, border-color .15s; }
.path:hover { transform: translateY(-2px); border-color: var(--ink-muted); }
.path:focus-visible { outline: 3px solid var(--side-a); outline-offset: 2px; }
.path-n { font-size: 14px; font-weight: 700; color: var(--ink-muted); }
.path-title { font-family: var(--font-display); font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.path-text { font-size: 15px; line-height: 1.45; color: var(--ink-muted); }
.path-meta { margin-top: auto; padding-top: 4px; font-size: 14px; font-weight: 700; }
.path.path-start { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.path.path-start .path-n, .path.path-start .path-text { color: color-mix(in oklab, var(--paper) 78%, var(--ink)); }
.home-own { margin: 0 0 36px; font-size: 15px; }
.home-own .link { font-weight: 700; }

/* ---- App navigation ------------------------------------------------------- */
.app-nav { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; flex: 1 1 auto; justify-content: center; }
/* The three sections as one segmented control: the main way around the site */
.nav-seg { display: flex; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.nav-btn { border: 0; background: transparent; border-radius: 999px; min-height: 42px; padding: 8px 16px; cursor: pointer; color: var(--ink); font: inherit; font-weight: 700; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.nav-btn:hover { background: color-mix(in oklab, var(--ink) 6%, var(--surface)); }
.nav-btn[aria-current="true"] { background: var(--ink); color: var(--paper); }
.nav-n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-family: var(--font-num); background: color-mix(in oklab, var(--ink) 10%, var(--surface)); }
.nav-btn[aria-current="true"] .nav-n { background: color-mix(in oklab, var(--paper) 22%, var(--ink)); }
.nav-doc { color: var(--ink-muted); font-weight: 700; text-decoration: none; white-space: nowrap; }
.nav-doc:hover, .nav-doc[aria-current="true"] { color: var(--ink); }
.nav-doc[aria-current="true"] { text-decoration: underline; text-underline-offset: 4px; }
/* What you're listening on: set once, so it stays quiet */
.seg.quiet { padding: 2px; }
.seg.quiet .seg-btn { min-height: 30px; padding: 4px 12px; font-size: 14px; }
.seg.quiet .seg-btn.on { background: color-mix(in oklab, var(--ink) 12%, var(--surface)); color: var(--ink); font-weight: 700; }
.q-nextpath { text-align: right; margin: 10px 0 0; font-size: 15px; }
.q-nextpath .link { font-weight: 700; }

/* ---- Views ---------------------------------------------------------------- */
body[data-view="question"] #workspace { display: none; }
body[data-view="question"][data-reveal] #workspace { display: block; margin-top: 28px; }
body[data-view="question"] #workspace .transport,
body[data-view="question"] #workspace .presets,
body[data-view="question"] #workspace .systems,
body[data-view="question"] #workspace .switch { display: none; }
body[data-view="question"] #workspace .compare { grid-template-columns: 1fr 1fr; }

/* ---- Question view -------------------------------------------------------- */
.qview { margin-bottom: 8px; }
.q-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.q-progress { margin: 0; color: var(--ink-muted); font-size: 15px; }
.q-title { font-size: clamp(30px, 4vw, 44px); font-weight: 800; letter-spacing: -0.025em; margin: 6px 0 8px; }
.q-intro { color: var(--ink-muted); font-size: 18px; margin: 0 0 8px; max-width: 820px; }
.q-pair { font-size: 16px; margin: 0 0 22px; max-width: 820px; line-height: 1.5; }
.q-play { min-width: 84px; }
.q-steps { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
/* The song nudge spans the row above the steps; on phones it follows Listen */
.q-steps > .own-nudge { order: -1; flex: 1 1 100%; margin: 0; }
.q-step { flex: 1 1 300px; background: color-mix(in oklab, var(--ink) 4%, var(--paper)); border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.q-step-n { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink-muted); }
.q-ab { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.q-ab .ab { width: 100%; max-width: none; height: 120px; font-size: 52px; }
.q-music { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-muted); }
.q-music select { flex: 1; min-width: 0; }
.q-prompt { font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 1.2; margin: 0; }
.q-guess-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.q-guess-btns button { flex: 1 1 80px; min-height: 52px; font-size: 17px; }
.q-guess-btns button:disabled { opacity: .45; cursor: default; }
.q-guess-btns button.picked { opacity: 1; box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.q-skip { align-self: flex-start; }
.q-skip:disabled { visibility: hidden; }
.q-answer { flex: 1.25 1 340px; transition: background .2s; }
.q-answer.open { background: var(--reveal); }
.q-answer-body p { margin: 0 0 10px; line-height: 1.5; }
.q-result { font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.q-which b.sa { color: var(--side-a); }
.q-which b.sb { color: var(--side-b); }
.q-verdict-label { font-size: 13px; font-weight: 700; color: var(--ink-muted); margin: 10px 0 -4px !important; }
.q-verdict { font-family: var(--font-display); font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 4px !important; }
.q-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

@media (max-width: 700px) {
  .home-hero { padding: 28px 0 20px; }
  .q-ab .ab { width: 100%; height: 132px; font-size: 56px; }
  .top { margin-bottom: 12px; gap: 6px; }
  .top .home-mode { display: none; }
  .brand { flex: 1 1 auto; }
  .nav-doc { order: 1; font-size: 14px; }
  .home-mode { order: 2; }
  .app-nav { order: 3; flex-basis: 100%; }
  .nav-seg { flex: 1 1 auto; }
  .nav-btn { flex: 1 1 0; justify-content: center; min-height: 40px; padding: 6px 8px; font-size: 15px; gap: 5px; }
  .paths { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .path { padding: 16px 18px; gap: 6px; }
  .path-title { font-size: 22px; }
  .q-nextpath { text-align: left; }
  .q-title { font-size: 28px; margin: 2px 0 6px; }
  .q-about { font-size: 14px; margin-bottom: 6px; }
  .q-intro { font-size: 15px; margin-bottom: 6px; }
  .q-pair { font-size: 14px; margin-bottom: 12px; }
  .q-steps > .own-nudge { order: 0; }
  .q-play { display: none; } /* the bottom bar has Play/Pause on phones */
  .q-step { padding: 16px; }
  .q-foot { justify-content: stretch; }
  .q-foot button { flex: 1 1 100%; }
}

/* ---- Why panel and live A/B curves --------------------------------------- */
.q-why { margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 20px 0 4px; }
.q-why > h3 { font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -0.015em; margin: 0 20px 12px; }
.q-why .why-body { padding: 0 20px 18px; }
.live { margin: 0 20px 18px; }
.live-build { margin: 0 18px 18px; }
.live-note { margin: 0 0 8px; font-size: 15px; color: var(--ink-muted); line-height: 1.5; }
.live-canvas { display: block; width: 100%; height: 240px; background: color-mix(in oklab, var(--ink) 3%, var(--paper)); border-radius: 14px; font-family: var(--font-num); }
.live figcaption { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-muted); align-items: center; margin-top: 8px; }
.live .key { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 700; }
.live .key i { width: 16px; height: 4px; border-radius: 2px; display: inline-block; }
.ka { background: var(--side-a); }
.kb { background: var(--side-b); }
.kr { background: repeating-linear-gradient(90deg, var(--ink-muted) 0 5px, transparent 5px 9px); }
.chart .key-band i { height: 10px; width: 14px; border: 1.25px dashed; border-radius: 2px; }
.live .note { margin-left: auto; }
.q-why-open { font-weight: 700; margin-top: 4px; }

.src-chip { display: inline-block; vertical-align: 1px; margin-left: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.6; text-decoration: none; white-space: nowrap; }
.src-chip.m { background: color-mix(in oklab, var(--good) 12%, var(--surface)); color: var(--good); }
.src-chip.t { background: color-mix(in oklab, var(--ink) 7%, var(--surface)); color: var(--ink-muted); }
.src-chip:hover { text-decoration: underline; }

@media (max-width: 700px) {
  .q-why { border-radius: 18px; padding-top: 16px; }
  .q-why > h3 { font-size: 22px; margin: 0 16px 10px; }
  .live { margin: 0 16px 16px; }
  .q-why .why-body { padding: 0 16px 16px; }
  .live-canvas { height: 200px; }
  .live .note { margin-left: 0; flex-basis: 100%; }
}

/* ---- Build your own: part tiles and the part sheet ------------------------ */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tiles { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.tile { text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: border-color .15s, box-shadow .15s; }
.tile:hover { border-color: var(--ink-muted); }
.tile:focus-visible { outline: 3px solid var(--side-a); outline-offset: 2px; }
.tile-k { font-size: 13px; font-weight: 700; color: var(--ink-muted); display: flex; align-items: center; gap: 8px; }
.tile-diff { font-size: 12px; font-weight: 700; color: var(--ink); background: var(--reveal); padding: 1px 8px; border-radius: 999px; }
.tile-v { font-family: var(--font-display); font-size: 18px; font-weight: 700; line-height: 1.2; }
.tile-note { font-size: 14px; color: var(--ink-muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-chips, .opt-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.trait { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: color-mix(in oklab, var(--ink) 7%, var(--surface)); color: var(--ink); }
.tile.diff { border-color: color-mix(in oklab, var(--ink) 45%, var(--line)); }
.tile.off { cursor: default; opacity: .6; }
.tile.off:hover { border-color: var(--line); }

.sheet { width: min(640px, calc(100vw - 32px)); max-height: min(86vh, 900px); padding: 0; border: 0; border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px -20px rgba(0, 0, 0, .45); overflow: hidden; }
.sheet[open] { display: flex; flex-direction: column; }
.sheet::backdrop { background: rgba(10, 10, 12, .4); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px 10px; }
.sheet-title { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -0.015em; margin: 0; }
.sheet-for { font-family: var(--font-text); font-size: 16px; font-weight: 400; color: var(--ink-muted); margin-left: 4px; }
.sheet-for b.sa { color: var(--side-a); }
.sheet-for b.sb { color: var(--side-b); }
.sheet-search-row { display: block; padding: 0 20px 10px; }
.sheet-search { width: 100%; font: inherit; font-size: 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); }
.sheet-search:focus-visible { outline: 3px solid var(--side-a); outline-offset: 1px; }
.sheet-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 6px; }
.sheet-filter { font: inherit; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.sheet-filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.sheet-note { margin: 4px 20px 8px; font-size: 13px; }
.sheet-note:empty { display: none; }
.sheet-list { overflow-y: auto; padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.sheet-group { font-size: 13px; font-weight: 700; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .06em; margin: 10px 0 0; }
.opt { text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.opt:hover { border-color: var(--ink-muted); }
.opt:focus-visible { outline: 3px solid var(--side-a); outline-offset: 2px; }
.sheet[data-side="A"] .opt.current { border: 2px solid var(--side-a); background: color-mix(in oklab, var(--side-a) 6%, var(--surface)); }
.sheet[data-side="B"] .opt.current { border: 2px solid var(--side-b); background: color-mix(in oklab, var(--side-b) 6%, var(--surface)); }
.opt-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.opt-name { font-weight: 700; font-size: 16px; }
.opt-blurb { font-size: 14px; color: var(--ink-muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.on-badge { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; color: var(--surface); }
.on-badge.sa { background: var(--side-a); }
.on-badge.sb { background: var(--side-b); }
.opt-chips .src-chip { margin-left: 0; }
.sheet-empty { color: var(--ink-muted); }

@media (max-width: 700px) {
  #workspace { display: flex; flex-direction: column; }
  #workspace > .compare { order: -1; }
  .compare { gap: 10px; grid-template-columns: minmax(0, 1fr); }
  .setup { min-width: 0; }
  .tile.diff { order: -1; } /* what differs comes first in the strip */
  .setup .readout { gap: 4px; }
  .setup .readout div { display: flex; flex-wrap: wrap; gap: 0 6px; font-size: 13px; }
  .setup .readout dt::after { content: ":"; }
  .compare > .setup { order: 0; }
  .compare > .switch { order: 1; position: static; }
  .setup { padding: 12px 0 12px 14px; }
  .setup header { margin: 0 14px 8px 0; }
  .setup header h2 { font-size: 18px; }
  .tiles { flex-direction: row; overflow-x: auto; scroll-snap-type: x proximity; gap: 8px; margin-bottom: 8px; padding: 2px 14px 4px 0; -webkit-overflow-scrolling: touch; }
  .tile { flex: 0 0 auto; width: 148px; scroll-snap-align: start; padding: 10px 12px; }
  .tile-v { font-size: 15px; }
  .tile-note, .tile-chips { display: none; }
  .setup .readout { margin-right: 14px; padding-top: 8px; }
  .sheet { width: 100vw; max-width: none; max-height: 88vh; margin: auto 0 0; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .sheet[open] { animation: sheet-up .22s ease-out; }
  .sheet-head { padding: 16px 16px 8px; }
  .sheet-title { font-size: 21px; }
  .sheet-search-row, .sheet-filters { padding-left: 16px; padding-right: 16px; }
  .sheet-note { margin-left: 16px; margin-right: 16px; }
  .sheet-list { padding: 4px 16px 24px; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }

/* ---- Find your taste: its own section, styled like the questions ---------- */
body[data-view="taste"] #workspace { display: none; }
/* The phone bar (Play, A, B) only during rounds */
body[data-view="taste"]:has(#taste:not([data-current="trial"])) .mbar { display: none !important; }
.tview { margin-bottom: 8px; }
.tview .q-title { margin-top: 6px; }
.t-how { padding-left: 20px; margin: 0; line-height: 1.55; }
.t-how li { margin-bottom: 6px; }
.t-length { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.t-opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; line-height: 1.45; font-size: 15px; }
.t-opt:has(input:checked) { border: 2px solid var(--ink); padding: 13px 15px; }
.t-opt input { margin-top: 4px; accent-color: var(--ink); }
.taste-begin { align-self: flex-start; min-width: 160px; min-height: 52px; font-size: 17px; }
.t-bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 6px 0 18px; }
.t-bar span { display: block; height: 100%; width: 0; background: var(--ink); transition: width .3s; }
.tview .q-head span { display: flex; gap: 16px; }
.taste-answers button { flex: 1 1 120px; }
.taste-answers .ghost { flex-basis: 100%; }
.t-result-card { flex: 2 1 420px; background: var(--reveal); }
.t-next { flex: 1 1 260px; }
.t-next .taste-load { min-height: 52px; font-size: 17px; }
.t-next .taste-close { align-self: flex-start; }
.t-load-note b.sa, .systems .hint b.sa { color: var(--side-a); }
.t-load-note b.sb, .systems .hint b.sb { color: var(--side-b); }
.t-load-note { margin: 0; line-height: 1.5; }
.t-listen-note { margin: 8px 0 0; line-height: 1.5; }
.taste-listen-go:disabled { opacity: .45; cursor: default; }
.taste-listen-go { align-self: flex-start; min-width: 160px; min-height: 52px; font-size: 17px; }
.taste-listen-answers button { flex: 1 1 120px; }
.taste-listen-answers .ghost { flex-basis: 100%; }
.t-listen-text { margin: 0; line-height: 1.55; }
.t-listen-own { display: flex; gap: 10px; align-items: center; line-height: 1.45; }
.t-listen-own input { accent-color: var(--ink); }
.systems .hint { margin: -2px 0 14px; }
.system .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.system .row .ghost { flex: 1 1 auto; }
.system .row .link { flex: 0 0 auto; font-size: 14px; }

/* ---- How it works ---------------------------------------------------------- */
a.nav-btn { display: inline-flex; align-items: center; text-decoration: none; }
.nav-short { display: none; }
@media (max-width: 480px) {
  .home-top .badge, .top .badge { display: none; } /* room for How it works beside the name */
  .nav-btn .nav-long { display: none; }
  .nav-btn .nav-short { display: inline; }
}
a.wordmark-btn { color: var(--ink); text-decoration: none; }
.how .doc { max-width: 860px; }
.how .q-title { margin-top: 8px; }
.how-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.how-toc a { font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.how-toc a:hover { border-color: var(--ink-muted); }
.how-section { scroll-margin-top: 16px; padding-top: 8px; }
.how-section h2 { font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -0.015em; margin: 36px 0 10px; }
.how-section h3 { font-size: 19px; margin: 24px 0 8px; }
.how-section > p, .how-list li, .how-chain p, .how-chain li { line-height: 1.6; font-size: 16px; }
.how-list { padding-left: 20px; }
.how-list li { margin-bottom: 8px; }
.how-chain { list-style: none; counter-reset: stage; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
.how-chain > li { counter-increment: stage; background: color-mix(in oklab, var(--ink) 4%, var(--paper)); border-radius: 18px; padding: 16px 20px 14px; }
.how-chain > li h3 { margin: 0 0 6px; font-size: 20px; }
.how-chain > li h3::before { content: counter(stage) " · "; color: var(--ink-muted); }
.how-chain ul { margin: 6px 0 0; padding-left: 20px; }
.how-chain li li { margin-bottom: 4px; }
.how-chain p { margin: 0 0 4px; }
.how .doc td .src-chip { margin-left: 0; }
.verdict-table { min-width: 620px; }
.verdict-table td:first-child { min-width: 200px; }
.verdict-table td.num { white-space: nowrap; }
.how-back { margin: 40px 0 0; }
.how-back a { font-weight: 700; }
@media (max-width: 700px) {
  .how-section h2 { font-size: 24px; }
  .how-chain > li { padding: 14px 16px 12px; }
}

/* Build: music on the left, how it's played on the right; the invitation to
   use your own songs spans both */
.transport > .own-banner, .transport > .own-nudge { grid-column: 1 / -1; margin: 0; }
.transport > * { min-width: 0; }
.transport .upload[hidden] { display: none; }
.transport .track > .row select { flex: 1 1 240px; min-width: 0; width: auto; }
.transport .upload { flex: none; }
.listening { display: flex; flex-direction: column; gap: 22px; }
.mono-row .hint { margin: 6px 0 0; }
.loop-from:not([hidden]) { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* DSP and room setup controls in the part sheet */
.ctl-note { margin: 2px 0 4px; font-size: 13px; }
.ctl-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt:disabled { cursor: default; opacity: .5; }
.tone-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px; grid-template-areas: "name out" "range range"; align-items: center; gap: 2px 8px; padding: 6px 0; }
.tone-name { grid-area: name; font-weight: 700; font-size: 15px; }
.tone-name .hint { font-weight: 400; font-size: 13px; }
.tone-row output { grid-area: out; text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 14px; }
.tone-range { grid-area: range; width: 100%; accent-color: var(--ink); }
.ctl-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
