/* Accent Trainer. Colours, type and controls follow the other tools on samplesize1.com
   (Bone Atlas, World Capitals); the layout is its own: the course down the left, the recording and
   the paragraph in the middle, settings and progress on the right (bottom sheets on phones). */
:root {
  --bg: #0a0f14;
  --bg-lift: #121b23;
  --panel: rgba(13, 20, 27, 0.86);
  --line: #223140;
  --line-strong: #33475a;
  --fg: #e8edf0;
  --muted: #8d9ca9;
  --bone: #ecdec2;
  --scan: #6fd0e8;
  --ok: #5fd39a;
  --bad: #ff7a6b;
  --close: #f5d04e;
  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 10px;
  color-scheme: dark;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(120% 80% at 50% 30%, #121e28 0%, #0d151c 45%, var(--bg) 78%) fixed, var(--bg);
  color: var(--fg);
  font-family: var(--f-display);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 2px solid var(--scan); outline-offset: 2px; }

/* ---------- frame ---------- */
.app {
  height: 100%;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 292px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px 16px;
  padding-block: calc(env(safe-area-inset-top, 0px) + 14px) calc(env(safe-area-inset-bottom, 0px) + 14px);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- brand ---------- */
.brand { grid-column: 1; grid-row: 1; align-self: center; display: grid; gap: 5px; min-width: 0; }
.lockup { display: flex; align-items: center; gap: 10px; min-width: 0; }
.home { display: inline-flex; align-items: center; gap: 7px; color: var(--bone); text-decoration: none; flex: none; border-radius: 4px; }
.home .logo-mark { height: 21px; width: auto; color: var(--scan); flex: none; transition: filter .15s; }
.home:hover .logo-mark { filter: brightness(1.2) drop-shadow(0 0 6px rgba(111, 208, 232, 0.45)); }
.brand .mark { font-weight: 800; font-stretch: 125%; letter-spacing: -0.01em; font-size: 19px; color: var(--bone); line-height: 1; white-space: nowrap; }
.brand .mark span { color: var(--scan); }
.beta { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--scan); border: 1px solid var(--scan); border-radius: 999px; padding: 1px 6px; }
.brand .sub { color: var(--muted); font-size: 12.5px; font-stretch: 90%; }

/* ---------- mode tabs ---------- */
.modes { grid-column: 2; grid-row: 1; align-self: center; justify-self: center; width: min(100%, 520px); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 3px; }
.seg button { font-weight: 600; font-size: 13px; color: var(--muted); background: transparent; border: 0; border-radius: 6px; padding: 7px 6px; cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--bg-lift); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-strong); }
.seg button:hover { color: var(--fg); }
.modes .seg button { padding-block: 9px; font-size: 14px; }

/* ---------- stats ---------- */
.stats { grid-column: 3; grid-row: 1; justify-self: end; align-self: center; display: flex; gap: 6px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: grid; gap: 1px; min-width: 64px; }
.stat b { font-family: var(--f-mono); font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.stat small { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

/* ---------- shared pieces ---------- */
.btn { font-size: 12.5px; font-weight: 600; color: var(--fg); background: var(--bg-lift); border: 1px solid var(--line-strong); border-radius: 7px; padding: 7px 11px; cursor: pointer; }
.btn:hover { border-color: var(--scan); }
.btn[aria-pressed="true"] { border-color: var(--scan); color: var(--scan); }
.btn.primary { background: var(--bone); color: #1b1610; border-color: var(--bone); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.big { padding: 10px 18px; font-size: 14px; }
.btn.quiet { background: transparent; border-color: var(--line); color: var(--muted); }
.btn.quiet:hover { color: var(--fg); border-color: var(--line-strong); }
.btn.danger { color: var(--bad); border-color: rgba(255, 122, 107, 0.45); }
.btn.danger:hover { border-color: var(--bad); }
.btn:disabled { opacity: .45; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eyebrow { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--scan); }
.label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.hint kbd, kbd { font-family: var(--f-mono); font-size: 11px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; color: var(--fg); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.meter { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--scan); border-radius: 2px; transition: width .35s ease; }
.meter.done i { background: var(--ok); }
a { color: var(--scan); text-underline-offset: 2px; }

/* ---------- left: the course ---------- */
.rail, .panel {
  background: var(--panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--r);
  overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.rail { grid-column: 1; grid-row: 2; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; align-self: start; max-height: 100%; }
.rail-level { margin: 10px 6px 4px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rail-level:first-child { margin-top: 2px; }
.rail-level em { font-style: normal; font-family: var(--f-mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.rail-level .label { letter-spacing: 0.1em; }
.rail .meter { height: 2px; }
.rail button.set {
  color: var(--fg); background: transparent; border: 1px solid transparent; border-radius: 7px; cursor: pointer; text-align: left;
  padding: 6px 9px 7px; display: grid; gap: 5px; font-size: 13.5px; font-weight: 650;
}
.rail button.set .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rail button.set em { font-style: normal; font-family: var(--f-mono); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 400; }
.rail button.set:hover { background: var(--bg-lift); }
.rail button.set[aria-pressed="true"] { border-color: var(--scan); background: #13232c; }
.rail button.set[aria-pressed="true"] em { color: var(--scan); }
.close-sheet { display: none; align-self: flex-end; }

/* ---------- right: settings and this set ---------- */
.panel { grid-column: 3; grid-row: 2; padding: 14px; display: grid; gap: 16px; align-self: start; max-height: 100%; }
.panel section { display: grid; gap: 7px; }
.switch { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; }
.switch input { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line-strong); position: relative; cursor: pointer; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked { border-color: var(--scan); }
.switch input:checked::after { transform: translateX(14px); background: var(--scan); }
.accent-rows { display: grid; gap: 2px; }
.accent-row { background: transparent; border: 0; border-radius: 6px; padding: 5px 6px; cursor: pointer; text-align: left; display: grid; gap: 4px; }
.accent-row:hover { background: var(--bg-lift); }
.accent-row .top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.accent-row .top span:last-child { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.credit { font-size: 11px; color: var(--muted); line-height: 1.55; }
.credit a { color: var(--muted); }
.credit a:hover { color: var(--fg); }

/* ---------- centre: the stage ---------- */
.stage { grid-column: 2; grid-row: 2; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; outline: none; padding-bottom: 8px; }
.stage > * { width: min(100%, 780px); margin-inline: auto; }
.stage > * + * { margin-top: 12px; }
.card {
  background: var(--panel); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong); border-radius: var(--r); padding: 18px 20px; display: grid; gap: 12px;
}
.card.is-ok { border-color: var(--ok); }
.card.is-bad { border-color: var(--bad); }
.card h1 { font-weight: 750; font-stretch: 112%; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.12; color: var(--bone); text-wrap: balance; }
.card h2 { font-weight: 700; font-stretch: 108%; font-size: 17px; color: var(--bone); }
.card p { color: var(--muted); max-width: 68ch; text-wrap: pretty; }
.card p b, .card li b { color: var(--fg); font-weight: 600; }
.lede { font-size: 15px; color: var(--fg) !important; }
.crumbs { font-size: 12px; color: var(--muted); }
.meta { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.start { text-align: left; }
.facts { display: flex; gap: 22px; flex-wrap: wrap; }
.facts div { display: grid; gap: 1px; }
.facts b { font-family: var(--f-mono); font-size: 18px; font-weight: 600; color: var(--bone); }
.facts small { font-size: 11px; color: var(--muted); }

/* the recording */
.listen { display: flex; align-items: center; gap: 16px; }
.play {
  --p: 0; flex: none; width: 68px; height: 68px; border-radius: 50%; border: 0; cursor: pointer; position: relative;
  background: conic-gradient(var(--scan) calc(var(--p) * 1turn), var(--line-strong) 0);
  display: grid; place-items: center;
}
.play::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--bg-lift); }
.play:hover::before { background: #16222c; }
.play svg { position: relative; width: 24px; height: 24px; fill: var(--bone); }
.play .i-pause, .play .i-load, .play .i-warn { display: none; }
.play[data-status="playing"] .i-play, .play[data-status="loading"] .i-play, .play[data-status="error"] .i-play { display: none; }
.play[data-status="playing"] .i-pause { display: block; }
.play[data-status="loading"] .i-load { display: block; animation: spin 0.9s linear infinite; }
.play[data-status="error"] .i-warn { display: block; fill: var(--bad); }
@keyframes spin { to { transform: rotate(360deg); } }
.play.small { width: 34px; height: 34px; }
.play.small::before { inset: 2px; }
.play.small svg { width: 13px; height: 13px; }
.listen-text { display: grid; gap: 3px; min-width: 0; }
.listen-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.listen-text .who { font-size: 14.5px; color: var(--fg); }
.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--bg-lift); border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 12px 3px 3px; cursor: pointer; font-size: 12.5px; font-weight: 600; }
.pill:hover { border-color: var(--scan); }

/* answers */
.answers { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 7px; }
.answer {
  text-align: left; background: var(--bg-lift); border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; cursor: pointer;
  display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: baseline;
}
.answer kbd { grid-row: 1; align-self: center; }
.answer b { font-weight: 650; font-size: 14.5px; }
.answer small { grid-column: 2; color: var(--muted); font-size: 12px; line-height: 1.4; }
.answer:hover:not(:disabled) { border-color: var(--scan); }
.answer:disabled { cursor: default; opacity: .5; }
.answer.is-right { border-color: var(--ok); opacity: 1; background: rgba(95, 211, 154, 0.08); }
.answer.is-wrong { border-color: var(--bad); opacity: 1; background: rgba(255, 122, 107, 0.08); }
.answer.is-picked { border-color: var(--scan); opacity: 1; }

/* feedback */
.card h1.verdict.ok { color: var(--ok); }
.card h1.verdict.bad { color: var(--bad); }
kbd.on-primary { color: inherit; border-color: rgba(0, 0, 0, 0.35); }
.field.flag { margin-left: auto; color: var(--muted); max-width: 110px; }
.tip { border-left: 2px solid var(--close); padding: 2px 0 2px 12px; color: var(--fg) !important; }
.tip .label { display: block; margin-bottom: 2px; color: var(--close); }

/* cues: what to listen for */
.cues { display: grid; gap: 4px; list-style: none; margin: 0; padding: 0; }
.cue { display: grid; grid-template-columns: 112px 1fr; gap: 2px 12px; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 7px 9px; cursor: pointer; text-align: left; width: 100%; }
.cue:hover { background: var(--bg-lift); }
.cue[aria-pressed="true"] { border-color: var(--scan); background: rgba(111, 208, 232, 0.07); }
.cue .kind { font-family: var(--f-mono); font-size: 10.5px; color: var(--muted); padding-top: 3px; }
.cue b { font-weight: 650; font-size: 14px; color: var(--fg); }
.cue span.d { grid-column: 2; color: var(--muted); font-size: 13px; line-height: 1.45; }
.cue[aria-pressed="true"] .kind { color: var(--scan); }
.cue.shared b { font-weight: 600; }
.cues-from { margin: 8px 0 0 9px; }

/* the paragraph every speaker reads */
.passage { font-size: 18px; line-height: 1.75; font-stretch: 96%; color: #6f7f8c; display: grid; gap: 2px; }
.passage span.w { border-radius: 3px; padding: 1px 1px; transition: color .15s, background .15s; }
.passage span.w.hit { color: var(--bone); background: rgba(111, 208, 232, 0.14); box-shadow: inset 0 -2px 0 var(--scan); }
.passage.plain { color: var(--fg); }
.passage-note { font-size: 12px; color: var(--muted); }

/* learn */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 13px; font-weight: 600; color: var(--fg); background: var(--bg-lift); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.chip:hover { border-color: var(--line-strong); }
.chip[aria-pressed="true"] { border-color: var(--scan); color: var(--scan); background: rgba(111, 208, 232, 0.09); }
.chip.sub { font-weight: 500; color: var(--muted); }
.picker { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.picker select { width: 100%; }
.picker select, .field { font-size: 13px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 7px; padding: 7px 10px; max-width: 100%; }
.picker select:focus, .field:focus { outline: none; border-color: var(--scan); }
.voices { display: grid; gap: 10px; }
.voices.two { grid-template-columns: 1fr 1fr; gap: 16px; }
.voices.two .listen { flex-wrap: wrap; }
.voices.two .listen-text { flex: 1; }
.voices.two .listen-actions { margin-left: 0; width: 100%; justify-content: flex-start; }
.voice h3 { font-size: 15px; font-weight: 700; color: var(--bone); margin-bottom: 8px; }
.duo { display: grid; grid-template-columns: 96px 1fr 1fr; gap: 0 14px; }
.duo > div { padding: 7px 0; border-top: 1px solid var(--line); min-width: 0; }
.duo > .kind { font-family: var(--f-mono); font-size: 10.5px; color: var(--muted); padding-top: 16px; }
.duo > .head { border-top: 0; font-weight: 700; color: var(--bone); padding-top: 0; }
.duo > .none { color: var(--line-strong); padding-top: 14px; }
.duo .cue { grid-template-columns: 1fr; padding: 6px 8px; }
.duo .cue .kind { display: none; }
.duo .cue span.d { grid-column: 1; }

/* results and progress */
.score { font-family: var(--f-mono); font-size: 44px; font-weight: 600; color: var(--bone); line-height: 1; }
.score small { font-size: 16px; color: var(--muted); font-weight: 400; }
.table { display: grid; gap: 0; }
.trow { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(60px, 1fr) 64px 84px; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.trow.head { border-top: 0; padding-top: 0; }
.trow .num { font-family: var(--f-mono); font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.trow .label.num { font-family: var(--f-display); font-size: 10.5px; }
.trow button.link { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; color: var(--fg); font-weight: 600; }
.trow button.link:hover { color: var(--scan); }
.misses { display: grid; gap: 6px; list-style: none; margin: 0; padding: 0; }
.misses li { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); }
.misses li > div { display: grid; gap: 1px; min-width: 0; flex: 1; }
.misses .said { color: var(--muted); font-size: 12.5px; }
.mix { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.mix:first-of-type { border-top: 0; }
.mix div { display: grid; gap: 1px; }
.mix small { color: var(--muted); font-size: 12px; }

/* ---------- overlays, toast ---------- */
.overlay {
  position: fixed; inset: 0; display: grid; place-items: center; z-index: 20;
  background: rgba(6, 10, 14, 0.62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); padding: 16px;
}
.dialog { width: min(480px, 100%); max-height: 86vh; overflow-y: auto; background: var(--bg-lift); border: 1px solid var(--line-strong); border-radius: 14px; padding: 22px; display: grid; gap: 14px; }
.dialog.wide { width: min(640px, 100%); }
.dialog h2 { font-weight: 800; font-stretch: 118%; font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--scan); }
.dialog p { color: var(--muted); }
.dialog .actions { justify-content: flex-end; }
.tree { display: grid; gap: 1px; }
.tree label { display: flex; align-items: center; gap: 9px; padding: 4px 6px; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.tree label:hover { background: var(--bg); }
.tree label.off { color: var(--muted); cursor: default; }
.tree label em { margin-left: auto; font-style: normal; font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.tree input { accent-color: var(--scan); margin: 0; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
  background: var(--bg-lift); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 8px 16px; font-size: 13.5px; max-width: min(560px, calc(100% - 32px)); text-align: center;
  opacity: 0; transition: opacity .2s ease; pointer-events: none; z-index: 30;
}
.toast.show { opacity: 1; }
.toast.bad { border-color: var(--bad); }
.toast.ok { border-color: var(--ok); }

/* ---------- dock (phones, clean view) ---------- */
.dock { display: none; }
#cleanExit { display: none; }

/* ---------- clean view, for recording ---------- */
body.clean .rail, body.clean .panel, body.clean .brand .sub, body.clean .stats { display: none; }
body.clean .app { grid-template-columns: minmax(0, 1fr); }
body.clean .brand, body.clean .modes, body.clean .stage { grid-column: 1; }
body.clean .brand { justify-self: center; }
body.clean .modes { grid-row: 2; }
body.clean .app { grid-template-rows: auto auto minmax(0, 1fr) auto; }
body.clean .stage { grid-row: 3; }
body.clean .stage > * { width: min(100%, 900px); }
body.clean .dock { display: flex; grid-row: 4; justify-content: center; }
body.clean .dock .btn { display: none; }
body.clean #cleanExit { display: inline-block; opacity: .55; }
body.clean .passage { font-size: 22px; }

/* ---------- medium screens: settings move under the course ---------- */
@media (max-width: 1280px) and (min-width: 901px) {
  .app { grid-template-columns: 300px minmax(0, 1fr); }
  .modes { justify-self: start; width: min(100%, 440px); }
  .stats { grid-column: 2; justify-self: end; }
  .stats .stat:last-child { display: none; }
  .rail { max-height: 52%; }
  .panel { grid-column: 1; grid-row: 2; align-self: end; max-height: 46%; }
}

/* ---------- phones ---------- */
@media (max-width: 900px) {
  html, body { height: auto; }
  .app { height: auto; min-height: 100dvh; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; gap: 10px; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 70px); }
  .brand, .modes, .stats, .stage { grid-column: 1; grid-row: auto; }
  .brand { justify-self: center; }
  .brand .sub { display: none; }
  .brand .mark { font-size: 16px; }
  .home .logo-mark { height: 17px; }
  .modes { width: 100%; position: sticky; top: 0; z-index: 5; padding-block: 6px; margin-block: -6px; background: linear-gradient(var(--bg) 70%, transparent); }
  .modes .seg button { font-size: 13px; padding-inline: 2px; }
  .stats { justify-self: center; }
  .stat { padding: 4px 9px; min-width: 56px; }
  .stat b { font-size: 14px; }
  .stage { overflow: visible; }
  .card { padding: 14px; }
  .passage { font-size: 16px; line-height: 1.7; }
  .cue { grid-template-columns: 1fr; }
  .cue span.d { grid-column: 1; }
  .answers { grid-template-columns: 1fr 1fr; }
  .answer { padding: 9px 10px; }
  .answer kbd { display: none; }
  .answer { grid-template-columns: 1fr; }
  .answer small { grid-column: 1; }
  .voices.two { grid-template-columns: 1fr; }
  .picker { grid-template-columns: auto minmax(0, 1fr); }
  .listen { flex-wrap: wrap; }
  .listen-actions { margin-left: 0; width: 100%; justify-content: flex-start; }
  .field.flag { margin-left: 0; }
  .duo { grid-template-columns: 1fr 1fr; gap: 0 8px; }
  .duo > .kind { grid-column: 1 / -1; padding-bottom: 0; }
  .duo > .kind + div, .duo > .kind + div + div { border-top: 0; padding-top: 2px; }
  .duo > .head.kind { display: none; }
  .trow { grid-template-columns: minmax(0, 1.4fr) minmax(40px, 1fr) 48px 64px; gap: 8px; font-size: 13px; }
  .rail, .panel {
    position: fixed; left: 0; right: 0; bottom: 0; max-height: 76vh; z-index: 15; align-self: auto;
    border-radius: 16px 16px 0 0; border-bottom: 0; background: var(--bg-lift);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    transform: translateY(105%); transition: transform .25s ease; visibility: hidden;
  }
  body.sheet-rail .rail, body.sheet-panel .panel { transform: none; visibility: visible; }
  .close-sheet { display: inline-block; }
  .dock {
    display: flex; gap: 6px; justify-content: center; position: fixed; left: 0; right: 0; z-index: 10;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  }
  .dock .btn { background: var(--bg-lift); padding: 10px 16px; font-size: 13px; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45); }
  body.clean .dock { position: fixed; }
}
@media (max-width: 420px) { .answers { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
