/* Inter (variable) and Space Mono, self-hosted under the SIL Open Font Licence: see fonts/*-OFL.txt. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('fonts/Inter-var-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('fonts/Inter-var-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/SpaceMono-400-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/SpaceMono-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/SpaceMono-700-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/SpaceMono-700-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Reply preference: rater app. App bar / one scrolling thread (situation, message, two equal panes, shared strip) / matte dock. */
:root {
  color-scheme: dark;
  --bg: #101013;
  --surface: #1a1a1e;
  --surface-2: #232328;
  --line: #2b2b30;
  --line-strong: #46464e;
  --fg: #fafaf4;
  --fg-2: #c8c8cc;
  --muted: #9494a0;
  --dim: #77777f;
  --accent: #ff8204;
  --accent-text: #ff9a3d;
  --on-accent: #101013;
  --dock: #121215;
  --ctl: #2a2a31;
  --ctl-line: #3e3e47;
  --x-red: #e51300;
  --go-green: #3ddc84;
  --s1: #ffd800; --s2: #ffaf00; --s3: #ff8205; --s4: #fa500f; --s5: #e10500;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "Space Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --matte: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .11 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --top: 0px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent-text); }
button { font-family: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Focus the app moves (the page, a heading, the strip) draws no ring; the thread, a keyboard scroll area, keeps one inside its edges. */
[tabindex="-1"]:focus-visible { outline: none; }
.thread:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.label { font: 400 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.blocks { display: grid; grid-template-columns: repeat(2, 7px); gap: 2px; flex: none; }
.blocks i { width: 7px; height: 7px; background: var(--accent); }
.blocks i:nth-child(1) { background: var(--s1); } .blocks i:nth-child(4) { background: var(--s5); }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); padding: 3px 8px; font: 400 11px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-2); white-space: nowrap; }
.chip.live { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- Shell ---------- */
.app { position: fixed; inset: var(--top) 0 0 0; display: grid; grid-template-rows: 56px auto minmax(0, 1fr) auto; background: var(--bg); overflow: hidden; }
.main { grid-row: 3; position: relative; min-height: 0; display: grid; }
.banner { grid-row: 2; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 7px 24px; border-bottom: 1px solid var(--line); background: #17171b; font: 400 12px/1.4 var(--mono); letter-spacing: .04em; color: var(--fg-2); }
.banner .px { width: 12px; height: 12px; }

/* ---------- 8-bit status ---------- */
.status { display: inline-flex; align-items: center; gap: 9px; font: 400 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2); white-space: nowrap; }
.px { display: block; width: 16px; height: 16px; flex: none; }
.px.lg { width: 48px; height: 48px; }
.px.xl { width: 96px; height: 96px; }
.px.wait { opacity: .45; }
.px.glow { filter: drop-shadow(0 0 3px var(--go-green)) drop-shadow(0 0 12px rgba(61, 220, 132, .55)); }
@media (prefers-reduced-motion: no-preference) {
  .px.glow.pulse { animation: glow 2.6s ease-in-out infinite; }
  @keyframes glow { 50% { filter: drop-shadow(0 0 6px var(--go-green)) drop-shadow(0 0 26px rgba(61, 220, 132, .8)); } }
  .px { transition: opacity .4s ease, filter .4s ease; }
}

/* ---------- App bar ---------- */
.appbar { grid-row: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 20px; padding-inline: 24px; border-bottom: 1px solid var(--line); position: relative; }
.appbar::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--s1) 0 20%, var(--s2) 20% 40%, var(--s3) 40% 60%, var(--s4) 60% 80%, var(--s5) 80%); }
.appbar .left { display: flex; align-items: center; gap: 12px; font-weight: 500; min-width: 0; white-space: nowrap; }
.appbar .mid { display: flex; align-items: center; gap: 14px; }
.appbar .right { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.pips { display: flex; gap: 3px; }
.pips i { width: 11px; height: 11px; border: 1px solid var(--dim); }
.pips i.done { background: var(--fg-2); border-color: var(--fg-2); }
.pips i.skip { background: repeating-linear-gradient(135deg, var(--dim) 0 2px, transparent 2px 4px); }
.pips i.now { background: var(--accent); border-color: var(--accent); }
.count { font: 400 13px/1 var(--mono); color: var(--fg); letter-spacing: .04em; white-space: nowrap; }
.saved { font: 400 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.ghost { border: 1px solid var(--line-strong); background: transparent; padding: 6px 10px; font: 400 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2); }
.ghost:hover { border-color: var(--fg-2); color: var(--fg); }
.linkish { border: 0; background: none; padding: 6px 2px; font: 400 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.linkish:hover { color: var(--fg); text-decoration-color: var(--fg-2); }

/* ---------- One scrolling thread ---------- */
.thread { min-height: 0; overflow-y: auto; padding: 16px 28px 28px; scrollbar-width: thin; scrollbar-color: var(--dim) transparent; }
.thread-in { max-width: 1400px; margin-inline: auto; display: grid; align-content: start; gap: 14px; }
.thread.practice { padding-bottom: 76px; }
.head { display: grid; gap: 10px; justify-items: center; }
.ctx { display: flex; gap: 12px; max-width: 980px; color: var(--muted); font-size: 13.5px; }
.ctx .label { flex: none; padding-top: 1px; }
.prompt { display: flex; align-items: baseline; gap: 10px; background: var(--surface-2); border: 1px solid var(--line-strong); padding: 9px 16px; font-size: 15px; max-width: 980px; min-width: 0; }
.prompt .caret { font: 700 13px/1 var(--mono); color: var(--accent); }
.prompt-body { display: grid; gap: 8px; min-width: 0; }
.prompt-body > * { min-width: 0; }
.umsg-wrap { display: grid; gap: 6px; min-width: 0; flex: 1 1 auto; }
.umsg { max-height: 340px; overflow: auto; min-width: 0; scrollbar-width: thin; scrollbar-color: var(--dim) transparent; }
.umsg.long { -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 36px), transparent); }
.umsg.long.at-end { -webkit-mask-image: none; mask-image: none; }
.more { display: inline-flex; align-items: center; gap: 8px; font: 400 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.more .px { width: 10px; height: 10px; transform: rotate(90deg); }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.pane { border: 1px solid var(--line); background: var(--surface); display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.pane-bar { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.glyph { display: grid; grid-template-columns: repeat(2, 5px); gap: 1px; }
.glyph i { width: 5px; height: 5px; background: var(--fg-2); }
.pane-bar .dots { display: grid; grid-template-columns: repeat(3, 6px); gap: 4px; margin-right: 2px; }
.pane-bar .dots i { width: 6px; height: 6px; background: var(--dim); }
.pane-bar .label { color: var(--fg); }
.pane-body { padding: 14px 18px 16px; font-size: 14.5px; line-height: 1.55; display: grid; gap: 10px; align-content: start; min-width: 0; }
.pane-body > * { min-width: 0; }
.pane-body p, .prompt-body p { margin: 0; }
.pane-body ul, .pane-body ol, .prompt-body ul, .prompt-body ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.pane-body strong, .prompt-body strong { font-weight: 600; }
.pane-body pre, .prompt-body pre { margin: 0; background: #0c0c0f; border: 1px solid var(--line); padding: 10px 12px; overflow-x: auto; font: 400 12.5px/1.55 var(--mono); white-space: pre; word-wrap: normal; overflow-wrap: normal; color: var(--fg); tab-size: 4; }
.pane-body code, .prompt-body code, .ctx code { font: 400 .88em/1.4 var(--mono); background: var(--surface-2); padding: 1px 4px; }
.pane-body pre code, .prompt-body pre code { font: inherit; background: none; padding: 0; white-space: inherit; }
.pane-body .ed, .prompt-body .ed { color: var(--muted); font-style: italic; }
/* Headings, tables and quotes, as the replies' formatting uses them; a wide table scrolls inside its pane. */
.pane-body h3, .pane-body h4, .prompt-body h3, .prompt-body h4 { margin: 0; font-weight: 600; letter-spacing: -.005em; color: var(--fg); }
.pane-body h3, .prompt-body h3 { font-size: 16px; line-height: 1.35; padding-top: 4px; }
.pane-body h4, .prompt-body h4 { font-size: 14.5px; line-height: 1.4; }
.pane-body blockquote, .prompt-body blockquote { margin: 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--line-strong); color: var(--fg-2); display: grid; gap: 8px; }
.tw { max-width: 100%; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--dim) transparent; }
.tw table { border-collapse: collapse; font-size: 13.5px; line-height: 1.45; }
.tw th, .tw td { border: 1px solid var(--line-strong); padding: 6px 10px; text-align: left; vertical-align: top; }
.tw th { background: var(--surface-2); font-weight: 600; color: var(--fg); }
.tw td { background: rgba(255, 255, 255, .015); }
.tw td code, .tw th code { white-space: nowrap; }
.prompt.terminal .tw table { font-family: var(--mono); font-size: 12.5px; }
/* A code block or table that hides text past its right edge (.sx.wide, set by the app): a drawn scrollbar, and a fade
   at that edge, in the colour behind it, until it is scrolled to the end. Firefox keeps its own thin scrollbar. */
.sx { position: relative; min-width: 0; --fade: #0c0c0f; }
.sx.tbl { --fade: var(--surface); }
.pane.terminal .sx.tbl { --fade: #0e0e11; }
.pane.code-web .sx.tbl { --fade: var(--ws); }
.prompt .sx.tbl { --fade: var(--surface-2); }
.sx.wide::after { content: ""; position: absolute; top: 1px; right: 1px; bottom: 9px; width: 28px; background: linear-gradient(90deg, transparent, var(--fade)); pointer-events: none; }
.sx.wide.at-end::after { display: none; }
@supports selector(::-webkit-scrollbar) {
  .sx.wide > * { scrollbar-width: auto; scrollbar-color: auto; }
}
.sx.wide > ::-webkit-scrollbar { height: 8px; }
.sx.wide > ::-webkit-scrollbar-thumb { background: var(--dim); }
.sx.wide > ::-webkit-scrollbar-track { background: transparent; }
.pane.terminal { background: #0e0e11; border-color: #2a2a30; }
.pane.terminal .pane-bar { background: #18181d; }
.prompt.terminal .prompt-body { font-family: var(--mono); font-size: 13px; }
/* Code workspace frame: a tab strip whose open tab, with a folder, holds the side label, over an editor surface with a slim gutter (a wider one clips code blocks that fit in the chat frame). */
.pane.code-web { --ws: #151518; --ws-edge: #2e2e35; background: var(--ws); border-color: var(--ws-edge); }
.pane.code-web .pane-bar { padding: 0; gap: 0; align-items: stretch; background: #0f0f12; border-bottom-color: var(--ws-edge); }
.pane.code-web .tab { display: flex; align-items: center; gap: 9px; padding: 8px 18px 8px 13px; margin-bottom: -1px; background: var(--ws); border-right: 1px solid var(--ws-edge); box-shadow: inset 0 2px 0 var(--accent); }
.pane.code-web .pane-body { padding-left: 28px; background: linear-gradient(90deg, #121215 0 10px, var(--ws-edge) 10px 11px, transparent 11px); }
.endmark { display: flex; gap: 3px; padding-top: 4px; }
.endmark i { width: 4px; height: 4px; background: var(--dim); }
.strip { display: grid; justify-items: center; gap: 6px; padding-top: 4px; }
.strip .label { color: var(--accent-text); }
.strip .prompt { border-color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .strip:not([hidden]) { animation: rise .35s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } }
}

/* ---------- Matte dock ---------- */
.dock { grid-row: 4; position: relative; z-index: 2; min-height: 168px; background-color: var(--dock); background-image: var(--matte);
  border-top: 1px solid #2e2e36; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 -16px 36px rgba(0, 0, 0, .55);
  display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 760px) minmax(270px, 1fr); align-items: center; gap: 0 20px; padding: 14px 24px; }
.dz { display: grid; gap: 10px; align-content: center; min-width: 0; }
.dz.side-l { justify-items: start; }
.dz.side-r { justify-items: end; }
.dz.centre { justify-items: center; gap: 9px; }
.qline { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 500; text-align: center; }
.qn { font: 700 11px/1 var(--mono); background: var(--accent); color: var(--on-accent); padding: 3px 5px; }
.scale { display: grid; grid-template-columns: 1fr 1fr 1.25fr 1fr 1fr; gap: 5px; width: 100%; }
.ctl { height: 40px; border: 1px solid var(--ctl-line); background: var(--ctl); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 1px 0 rgba(0, 0, 0, .5); font-size: 13.5px; font-weight: 500; color: var(--fg-2); display: flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; padding-inline: 10px; }
.ctl:not([aria-pressed="true"]):hover:not(:disabled) { border-color: var(--line-strong); color: var(--fg); }
.ctl .ar { font: 700 11px/1 var(--mono); color: var(--muted); }
.ctl[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .18); font-weight: 600; }
.ctl[aria-pressed="true"] .ar { color: var(--bg); }
.scale.off .ctl { opacity: .35; }
.keys { display: grid; grid-template-columns: 1fr 1fr 1.25fr 1fr 1fr; width: 100%; gap: 5px; }
.keys span { text-align: center; font: 400 10px/1 var(--mono); color: var(--dim); }
.hint { font-size: 12.5px; color: var(--muted); }
.lockchip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--ctl-line); background: #1b1b20; padding: 4px 10px; font-size: 12.5px; color: var(--fg-2); }
.lock { width: 10px; height: 10px; }
.cta { height: 40px; border: 0; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding-inline: 18px; white-space: nowrap; }
.cta:hover:not(:disabled) { background: #ff9122; }
.cta:disabled { background: #24242a; color: #6c6c76; }
.cta.busy { opacity: .7; }
.small { height: 34px; padding-inline: 14px; font-size: 13px; }
.note { width: 100%; max-width: 240px; height: 58px; resize: none; background: #0d0d10; border: 1px solid var(--ctl-line); padding: 7px 10px; font: 400 13px/1.4 var(--sans); color: var(--fg); }
.note::placeholder, .field textarea::placeholder { color: var(--muted); }

/* ---------- Coach marks (practice only) ---------- */
.coaches { position: absolute; left: 24px; right: 24px; bottom: 14px; z-index: 5; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; pointer-events: none; }
.coach { display: flex; align-items: center; gap: 10px; background: var(--fg); color: var(--bg); padding: 8px 12px; font-size: 13.5px; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .55); }
.coach b { font: 700 12px/1 var(--mono); background: var(--accent); color: var(--on-accent); padding: 4px 6px; }

/* ---------- Full-page steps ---------- */
.page { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: 32px 24px 44px; scrollbar-width: thin; scrollbar-color: var(--dim) transparent; }
.page > .card, .page > .done { margin: auto; }
.card { width: 100%; max-width: 620px; display: grid; gap: 20px; }
.card.wide { max-width: 720px; }
.card h1 { font-size: 40px; line-height: 1.05; font-weight: 500; letter-spacing: -.025em; text-wrap: balance; }
.card .lead { color: var(--fg-2); font-size: 17px; }
.card h1.h-md { font-size: 32px; }
.card > .aside { color: var(--fg-2); font-size: 14.5px; }
.code-in { flex: 1 1 200px; max-width: 280px; font: 400 16px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.facts div { padding: 14px 16px; border-left: 1px solid var(--line); display: grid; gap: 4px; }
.facts div:first-child { border-left: 0; }
.facts b { font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.rules { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--fg-2); }
.rules li { display: flex; gap: 12px; align-items: baseline; }
.rules li::before { content: ""; flex: none; width: 7px; height: 7px; background: var(--accent); transform: translateY(-2px); }
.small-print { font-size: 13px; color: var(--muted); }
.actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.formbox { background: var(--surface); border: 1px solid var(--line); padding: 22px; display: grid; gap: 18px; }
.formbox .note-p { color: var(--fg-2); font-size: 14.5px; }
.field { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field .q { font-weight: 500; display: flex; gap: 10px; align-items: baseline; padding: 0; }
.field .q .qn { flex: none; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choices .ctl { padding-inline: 14px; }
.choices.stack { flex-direction: column; align-items: stretch; }
.choices.stack .ctl { justify-content: flex-start; height: auto; min-height: 40px; padding: 9px 14px; white-space: normal; text-align: left; }
.field textarea { width: 100%; height: 76px; resize: vertical; background: #121215; border: 1px solid var(--ctl-line); padding: 8px 10px; color: var(--fg); font: 400 14px/1.45 var(--sans); }
.email-row { display: flex; gap: 8px; flex-wrap: wrap; }
.email { flex: 1 1 260px; height: 40px; background: #121215; border: 1px solid var(--ctl-line); padding: 0 12px; color: var(--fg); font: 400 14px/1 var(--sans); }
.email::placeholder { color: var(--muted); }
.email.bad { border-color: var(--x-red); }
.err { font-size: 13px; color: #ff6a55; }
.sumrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 16px; }
.sumrow .sum { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--fg-2); font-size: 14px; }
.sumtext { flex: 1 1 320px; min-width: 0; display: grid; gap: 10px; }
.consent { color: var(--fg-2); font-size: 13px; line-height: 1.5; }
.done { display: grid; justify-items: center; text-align: center; gap: 18px; max-width: 540px; }
.done h1 { font-size: 44px; font-weight: 500; letter-spacing: -.025em; }
.done .lead { font-size: 20px; line-height: 1.5; color: var(--fg); max-width: 34em; }

/* ---------- Guidelines ---------- */
.guide { display: grid; gap: 22px; }
.guide section { display: grid; gap: 10px; }
.guide h2 { font-size: 20px; font-weight: 500; letter-spacing: -.015em; }
.guide p, .guide li { color: var(--fg-2); }
.guide ul, .guide ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.guide strong { color: var(--fg); font-weight: 600; }

/* ---------- Veils ---------- */
.veil { position: absolute; inset: 56px 0 0 0; background: rgba(16, 16, 19, .82); z-index: 6; display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); padding: 28px; display: grid; gap: 14px; justify-items: start; }
.modal h2 { font-size: 26px; font-weight: 500; letter-spacing: -.02em; }
.modal p { color: var(--fg-2); }

/* ---------- Narrower windows ---------- */
@media (max-width: 1100px) {
  .dock { grid-template-columns: minmax(84px, 1fr) minmax(0, 620px) minmax(240px, 1fr); gap: 0 14px; padding-inline: 16px; }
  .dz.side-r .cta { font-size: 13px; padding-inline: 14px; }
  .ctl { font-size: 12.5px; padding-inline: 6px; }
  .coach { font-size: 12.5px; }
}
@media (max-width: 899px) {
  .appbar { padding-inline: 14px; gap: 10px; }
  .appbar .left .name { display: none; }
  .appbar .right { gap: 10px; }
  .thread { padding: 12px 14px 20px; }
  .thread.practice { padding-bottom: 160px; }   /* room for the coach marks, stacked, below the right reply's end */
  .pair { grid-template-columns: minmax(0, 1fr); }
  .dock { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "c c" "l r"; gap: 10px; padding: 12px 14px; }
  .dz.centre { grid-area: c; }
  .dz.side-l { grid-area: l; }
  .dz.side-r { grid-area: r; display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
  .note { max-width: none; height: 40px; flex: 1 1 auto; }
  .scale, .keys { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .scale .ctl { white-space: normal; line-height: 1.15; text-align: center; font-size: 12px; }
  .coaches { flex-direction: column; align-items: center; left: 14px; right: 14px; }
  .card h1 { font-size: 30px; }
  .card h1.h-md { font-size: 26px; }
  .facts { grid-template-columns: 1fr; }
  .facts div { border-left: 0; border-top: 1px solid var(--line); }
  .facts div:first-child { border-top: 0; }
  .page { padding: 22px 16px 32px; }
}
/* Up to 760 px (a 1280 or 1366 px laptop at 200% zoom), the pips would run under the bar's right group. */
@media (max-width: 760px) {
  .appbar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .appbar .mid { justify-content: center; min-width: 0; overflow: hidden; }
  .appbar .mid .pips { display: none; }   /* the count alone fits */
  .appbar .chip { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}
@media (max-width: 600px) {
  .dz.side-r { flex-wrap: wrap; }
  .note { flex: 1 1 100%; }
  .coach { font-size: 12px; padding: 6px 10px; }
}
/* Short windows, such as a laptop zoomed to 150% or 200%: a slimmer bar and dock leave the thread more room. */
@media (max-height: 560px) {
  .app { grid-template-rows: 44px auto minmax(0, 1fr) auto; }
  .veil { inset: 44px 0 0 0; }
  .dock { min-height: 0; padding-block: 8px; row-gap: 6px; }
  .dz, .dz.centre { gap: 6px; }
  .keys { display: none; }
  .scale .ctl, .dock .cta { height: 34px; }
  .note { height: 34px; padding-block: 5px; }
  /* The coach marks stay in one row, smaller, even when narrow: stacked, they would cover most of the replies. */
  .coaches { flex-direction: row; align-items: flex-end; }
  .coach { font-size: 12px; padding: 6px 10px; }
  .thread.practice { padding-bottom: 84px; }   /* room for that row, its marks up to three lines, below the right reply's end */
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
