/* DiffSnack — app + landing styles (ported from docs/prototype). Self-hosted fonts, no third-party requests. */
@font-face { font-family: "Bricolage Grotesque"; src: url("/fonts/bricolage-grotesque-800.woff2") format("woff2"); font-weight: 700 800; font-display: optional; }
@font-face { font-family: "DM Sans"; src: url("/fonts/dm-sans.woff2") format("woff2"); font-weight: 400 700; font-display: optional; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-400.woff2") format("woff2"); font-weight: 400 600; font-display: optional; }

/* Layout: pitch left, a live phone running the Daily Run right; stacks to one column on phones. */
:root {
  --bg: #EEF0F6;
  --surface: #FFFFFF;
  --surface-2: #F5F6FB;
  --ink: #14162B;
  --muted: #5B6078;
  --line: #D9DCE8;
  --accent: #2F4BFF;
  --accent-ink: #FFFFFF;
  --snack: #FFD23F;
  --snack-ink: #14162B;
  --good: #12924A;
  --good-soft: #DDF5E6;
  --bad: #D9363C;
  --bad-soft: #FDE3E4;
  --bad-ink: #B3262C; /* #99: red text on light surfaces ≥ 4.5:1 (--bad is 4.06:1 on white) */
  --device: #14162B;
  --shadow: 0 30px 60px -30px rgba(20, 22, 60, .45);

  --code-bg: #12152B;
  --code-fg: #E6E8F5;
  --code-dim: #5E6488;
  --code-comment: #8187AD; /* #105: comments/doctype ≥ 4.5:1 on --code-bg (5.1:1), still dimmer than --code-fg */
  --code-kw: #FF8FB1;
  --code-str: #FFD23F;
  --code-num: #7EE0C3;
  --code-fn: #8FB4FF;
  --code-line-hover: #1C2040;
  --code-good: #0F3B2A;
  --code-bad: #4A1820;
  --code-add: #3DD68C;
  --code-del: #FF6B70;

  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "DM Sans", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D0F1E; --surface: #171A31; --surface-2: #1E2240; --ink: #ECEEF8; --muted: #9AA0BD;
    --line: #2C3052; --accent: #7A8CFF; --accent-ink: #0B0D1A; --good: #3DD68C; --good-soft: #143425;
    --bad: #FF6B70; --bad-soft: #3D1A20; --bad-ink: #FF6B70; --device: #2C3052; --shadow: 0 30px 60px -30px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D0F1E; --surface: #171A31; --surface-2: #1E2240; --ink: #ECEEF8; --muted: #9AA0BD;
  --line: #2C3052; --accent: #7A8CFF; --accent-ink: #0B0D1A; --good: #3DD68C; --good-soft: #143425;
  --bad: #FF6B70; --bad-soft: #3D1A20; --bad-ink: #FF6B70; --device: #2C3052; --shadow: 0 30px 60px -30px rgba(0,0,0,.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- Hero ---------- */
.hero { padding-block: 40px 56px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 56px; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--snack); color: var(--snack-ink); font-family: var(--f-mono); font-weight: 600; font-size: 15px; transform: rotate(-6deg); }
.pitch { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.hero-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.diff-chip { display: inline-flex; gap: 10px; white-space: nowrap; flex-shrink: 0; font-family: var(--f-mono); font-size: 13px; padding: 5px 12px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); }
.diff-chip .del { color: var(--muted); }
.diff-chip .del s { text-decoration-color: var(--bad); text-decoration-thickness: 2px; }
.diff-chip .del b { color: var(--bad); }
.diff-chip .add { color: var(--ink); font-weight: 600; }
.diff-chip .add b { color: var(--good); }
.hero-title { font-family: var(--f-display); font-weight: 800; font-size: clamp(34px, 5.2vw, 66px); line-height: 1.02; letter-spacing: -.035em; margin: 0; text-wrap: balance; overflow-wrap: anywhere; }
.hero-title mark { background: linear-gradient(transparent 58%, var(--snack) 58%, var(--snack) 92%, transparent 92%); color: inherit; padding: 0 .04em; }
.lede { font-size: 19px; color: var(--muted); max-width: 34em; margin: 0; }
.lede strong { color: var(--ink); font-weight: 700; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.hero-cta small { color: var(--muted); font-size: 14px; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none; }
.facts li { font-family: var(--f-mono); font-size: 13px; padding: 7px 12px; border: 1.5px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--surface); }
.tier-pick { display: grid; gap: 8px; }
.tier-pick b { font-size: 15px; }
.tier-pick small { color: var(--muted); font-size: 13px; }
.tiers { display: flex; flex-wrap: wrap; gap: 8px; }
.tier { appearance: none; font: inherit; font-weight: 700; font-size: 15px; min-height: 44px; padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.tier:hover { border-color: var(--accent); }
.tier[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.share-preview { font-family: var(--f-mono); font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.share-preview code { color: var(--ink); background: var(--surface); border: 1.5px dashed var(--line); padding: 10px 14px; border-radius: 12px; display: inline-block; width: fit-content; max-width: 100%; overflow-wrap: anywhere; white-space: pre-line; }

/* ---------- Device ---------- */
.device {
  width: 392px; height: 790px; border-radius: 48px; border: 11px solid var(--device);
  background: var(--surface); overflow: hidden; position: relative; box-shadow: var(--shadow);
}
.device::before { content: ""; position: absolute; top: 9px; left: 50%; width: 92px; height: 24px; margin-left: -46px; border-radius: 20px; background: var(--device); z-index: 5; }
.app { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--surface); }
.app-top { padding: 44px 18px 10px; display: flex; align-items: center; gap: 10px; }
.app-top .brand { font-size: 17px; gap: 7px; }
.app-top .brand-mark { width: 26px; height: 26px; font-size: 12px; border-radius: 8px; }
.pills { margin-left: auto; display: flex; gap: 6px; }
.pill { font-family: var(--f-mono); font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill.xp { background: var(--snack); color: var(--snack-ink); border-color: transparent; }
.screen { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.dock { padding: 12px 18px 22px; display: grid; gap: 8px; border-top: 1px solid var(--line); background: var(--surface); }

/* buttons */
.btn { appearance: none; border: 0; cursor: pointer; border-radius: 16px; padding: 15px 18px; font-weight: 700; font-size: 16px; width: 100%; transition: transform .12s ease, box-shadow .12s ease; }
.btn:active { transform: translateY(2px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 55%, var(--ink)); }
.btn-primary:active { box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 55%, var(--ink)); }
.btn-ghost { background: transparent; border: 1.5px solid var(--line); }
.btn-snack { background: var(--snack); color: var(--snack-ink); box-shadow: 0 4px 0 #C99C12; }

/* start screen */
.eyebrow { font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.run-title { font-family: var(--f-display); font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: -.03em; margin: 2px 0 0; }
.chip { appearance: none; border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 500; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.chip small { font-size: 11px; opacity: .8; }
.run-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.run-meta div { border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.run-meta b { display: block; font-family: var(--f-display); font-size: 20px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.run-meta span { font-size: 12.5px; color: var(--muted); }
.fineprint { font-size: 12.5px; color: var(--muted); text-align: center; margin: 0; }

/* play screen */
.progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.progress i { height: 6px; border-radius: 4px; background: var(--line); }
.progress i.ok { background: var(--good); }
.progress i.bad { background: var(--bad); }
.progress i.now { background: var(--accent); }
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mode { font-family: var(--f-mono); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 7px; background: var(--snack); color: var(--snack-ink); }
.mode.predict { background: var(--accent); color: var(--accent-ink); }
.combo { font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.combo b { color: var(--ink); }
.prompt { font-family: var(--f-display); font-weight: 700; font-size: 21px; line-height: 1.18; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
.prompt small { display: block; font-family: var(--f-body); font-weight: 400; font-size: 14px; color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.timer { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; position: relative; }
.timer i { position: absolute; inset: 0; background: var(--ink); transform-origin: left; }
.timer.low i { background: var(--bad); }

.code { background: var(--code-bg); color: var(--code-fg); border-radius: 16px; overflow: hidden; font-family: var(--f-mono); font-size: 12.8px; line-height: 1.62; }
.code-head { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; color: var(--code-dim); font-size: 11px; border-bottom: 1px solid #23284A; }
.code ol { list-style: none; margin: 0; padding: 6px 0; overflow-x: auto; }
.ln { display: grid; grid-template-columns: 26px minmax(0, 1fr); width: 100%; text-align: left; background: transparent; border: 0; padding: 0 10px 0 4px; font: inherit; color: inherit; white-space: pre; position: relative; }
button.ln { cursor: pointer; }
button.ln:hover { background: var(--code-line-hover); }
.ln .no { color: var(--code-dim); text-align: right; padding-right: 10px; user-select: none; }
.ln.is-bug { background: var(--code-good); box-shadow: inset 3px 0 0 var(--code-add); }
.ln.is-wrong { background: var(--code-bad); box-shadow: inset 3px 0 0 var(--code-del); animation: shake .32s; }
.ln.is-bug::after, .ln.is-wrong::after { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 5px; letter-spacing: .04em; }
.ln.is-bug::after { content: attr(data-label); background: var(--code-add); color: var(--code-bg); }
.ln.is-wrong::after { content: attr(data-label); background: var(--code-del); color: var(--code-bg); }
.t-tag { color: var(--code-kw); }
.t-value { color: var(--code-str); }
.t-entity { color: var(--code-num); }
.t-attr { color: var(--code-fn); }
.t-comment, .t-doctype { color: var(--code-comment); font-style: italic; }
.t-punct { color: #B6BAD6; }

.options { display: grid; gap: 8px; }
.opt { appearance: none; text-align: left; cursor: pointer; display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font-family: var(--f-mono); font-size: 14px; box-shadow: 0 3px 0 var(--line); transition: transform .1s ease; }
.opt:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.opt kbd { font-family: var(--f-mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; text-align: center; padding: 2px 0; }
.opt.is-right { border-color: var(--good); background: var(--good-soft); box-shadow: 0 3px 0 var(--good); }
.opt.is-wrong { border-color: var(--bad); background: var(--bad-soft); box-shadow: 0 3px 0 var(--bad); animation: shake .32s; }
.opt:disabled { cursor: default; }
.hint { font-size: 13px; color: var(--muted); text-align: center; margin: 0; }

/* feedback sheet */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 18px 18px 22px; border-radius: 24px 24px 0 0; background: var(--surface); border-top: 3px solid var(--good); box-shadow: 0 -18px 40px -20px rgba(0,0,0,.35); display: grid; gap: 12px; animation: up .28s cubic-bezier(.2,.9,.3,1.2); }
.sheet.bad { border-top-color: var(--bad); }
.sheet-top { display: flex; align-items: center; gap: 10px; }
.sheet-top strong { font-family: var(--f-display); font-size: 22px; letter-spacing: -.02em; color: var(--good); }
.sheet.bad .sheet-top strong { color: var(--bad); }
.sheet-top .gain { font-family: var(--f-mono); font-weight: 600; font-size: 13px; padding: 3px 8px; border-radius: 7px; background: var(--snack); color: var(--snack-ink); }
.report { margin-left: auto; appearance: none; border: 0; background: none; color: var(--muted); font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px; }
.sheet p { margin: 0; font-size: 14.5px; line-height: 1.5; }
.sheet p code, .card-why code { font-family: var(--f-mono); font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.fix { font-family: var(--f-mono); font-size: 12.5px; background: var(--code-bg); color: var(--code-fg); border-radius: 12px; padding: 8px 0; overflow-x: auto; }
.fix div { white-space: pre; padding: 0 12px; }
.fix .d { background: #3A1820; color: #FFB3B6; }
.fix .a { background: #0F3426; color: #A8F0CB; }
.fix-label { font-family: var(--f-mono); font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

.pop { position: absolute; z-index: 6; left: 50%; top: 42%; transform: translate(-50%, 0); font-family: var(--f-display); font-weight: 800; font-size: 40px; color: var(--accent); pointer-events: none; animation: pop .9s ease-out forwards; }

/* result */
.result-hero { text-align: center; display: grid; gap: 6px; padding-top: 6px; }
.score { font-family: var(--f-display); font-weight: 800; font-size: 76px; line-height: .9; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.score span { color: var(--muted); font-size: .5em; }
.squares { font-size: 26px; letter-spacing: 4px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { background: var(--surface-2); border-radius: 14px; padding: 10px; text-align: center; }
.stats b { display: block; font-family: var(--f-display); font-size: 22px; font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--muted); }
.share-box { display: grid; gap: 8px; }
.share-box textarea { width: 100%; resize: none; font-family: var(--f-mono); font-size: 13.5px; border: 1.5px dashed var(--line); background: var(--surface-2); color: var(--ink); border-radius: 12px; padding: 10px 12px; line-height: 1.45; height: calc(3 * 1.45em + 23px); overflow: hidden; } /* #71: 3 lines = wrapped result line + site link (20px padding + 3px border, border-box) */
.review { display: grid; gap: 6px; }
.review-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13.5px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); }
.review-row .dot { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--surface); }
.review-row .dot.ok { background: var(--good); }
.review-row .dot.bad { background: var(--bad); }
.review-row .name { font-family: var(--f-mono); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-row .due { font-size: 12px; color: var(--muted); white-space: nowrap; }

.toast { position: absolute; left: 18px; right: 18px; bottom: 96px; z-index: 8; background: var(--ink); color: var(--surface); padding: 11px 14px; border-radius: 12px; font-size: 13.5px; text-align: center; animation: up .2s ease-out; }

/* ---------- Below the fold ---------- */
.how { padding-block: 24px 72px; display: grid; gap: 28px; }
/* #56: "What you'll learn" reuses .how/.cards/.card; only spacing and the lede differ. */
.learn { padding-block: 48px 8px; }
/* #72: beginner FAQ — native <details>, default disclosure marker, global focus ring. */
.faq { padding-block: 24px 48px; display: grid; }
.faq h2 { font-family: var(--f-display); font-weight: 800; font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -.03em; line-height: 1.05; margin: 0 0 12px; text-wrap: balance; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { cursor: pointer; font-weight: 700; font-size: 17px; padding-block: 14px; min-height: 44px; }
.faq-item p { margin: 0 0 16px; color: var(--muted); max-width: 46em; line-height: 1.55; }
.learn-lede { margin: 0; max-width: 40em; color: var(--muted); font-size: 17px; line-height: 1.5; }
.how h2 { font-family: var(--f-display); font-weight: 800; font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -.03em; line-height: 1.05; margin: 0; max-width: 20em; text-wrap: balance; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--surface); border-radius: 22px; padding: 22px; display: grid; gap: 12px; align-content: start; border: 1px solid var(--line); }
.card h3 { font-family: var(--f-display); font-size: 22px; letter-spacing: -.02em; margin: 0; }
.card-why { margin: 0; color: var(--muted); font-size: 15px; }
.mini { font-family: var(--f-mono); font-size: 12px; background: var(--code-bg); color: var(--code-fg); border-radius: 12px; padding: 8px 0; overflow-x: auto; }
.mini div { white-space: pre; padding: 0 12px; }
.mini .hit { background: var(--code-bad); box-shadow: inset 3px 0 0 var(--code-del); }
.mini .n { color: var(--code-dim); display: inline-block; width: 18px; }
.mini-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-opts span { font-family: var(--f-mono); font-size: 12px; padding: 4px 9px; border-radius: 8px; border: 1.5px solid var(--line); }
.mini-opts span.r { border-color: var(--good); background: var(--good-soft); }
.boxes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; align-items: end; }
.box { border: 1.5px solid var(--line); border-radius: 10px; text-align: center; padding: 8px 4px; display: grid; gap: 2px; }
.box b { font-family: var(--f-display); font-size: 18px; }
.box span { font-size: 11px; color: var(--muted); }
.box:nth-child(1) { background: var(--bad-soft); }
.box:nth-child(4) { background: var(--good-soft); }
.foot { padding-block: 0 40px; font-size: 13px; color: var(--muted); }

@keyframes shake { 0%,100% { translate: 0; } 25% { translate: -5px; } 75% { translate: 5px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); } 25% { opacity: 1; transform: translate(-50%, 0) scale(1.08); } 100% { opacity: 0; transform: translate(-50%, -60px) scale(1); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Top nav ---------- */
.topnav { display: flex; align-items: center; gap: 18px; padding-block: 18px 0; }
.topnav nav { margin-left: auto; display: flex; gap: 6px; }
.topnav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15px; padding: 7px 13px; border-radius: 999px; }
.topnav a:hover { background: var(--surface); }
.topnav a[aria-current="page"] { background: var(--ink); color: var(--surface); }
.topnav .brand, .topnav nav a { white-space: nowrap; flex-shrink: 0; }
.topnav nav { flex-shrink: 1; min-width: 0; }
@media (max-width: 480px) {
  .topnav { gap: 8px; padding-block: 12px 0; }
  .topnav nav { gap: 2px; }
  .topnav a, .topnav .nav-login { font-size: 14px; padding: 6px 9px; }
  .topnav .brand { font-size: 19px; gap: 7px; }
  .topnav .brand-mark { width: 28px; height: 28px; font-size: 12px; border-radius: 8px; }
}
/* Compact: every phone below 375 px, and up to 480 px when the nav holds four links (admins). */
@media (max-width: 374px) {
  .topnav a, .topnav .nav-login { font-size: 13px; padding: 6px 5px; }
}
/* #78: up to 413 px the brand word + three links do not fit; the mark stays, the word stays readable for screen readers. */
@media (max-width: 413px) {
  .topnav .brand { gap: 0; }
  .topnav .brand-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 480px) {
  .topnav:has(nav a:nth-child(4)) a, .topnav:has(nav a:nth-child(4)) .nav-login { font-size: 13px; padding: 6px 5px; }
  .topnav:has(nav a:nth-child(4)) .brand { gap: 0; }
  .topnav:has(nav a:nth-child(4)) .brand-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.eyebrow-hero { font-family: var(--f-mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 600; }

/* ---------- AI band ---------- */
.band { background: var(--ink); color: var(--surface); }
.band-in { padding-block: 64px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.band .eyebrow { color: color-mix(in srgb, var(--surface) 65%, var(--ink)); }
.band h2 { font-family: var(--f-display); font-weight: 800; font-size: clamp(32px, 4.6vw, 56px); line-height: 1.02; letter-spacing: -.035em; margin: 8px 0 18px; text-wrap: balance; }
.band h2 mark { background: var(--snack); color: var(--snack-ink); padding: 0 .12em; border-radius: 6px; }
.band p { margin: 0; font-size: 18px; max-width: 32em; color: color-mix(in srgb, var(--surface) 82%, var(--ink)); }
.chat { display: grid; gap: 10px; font-size: 14.5px; min-width: 0; }
.msg { padding: 12px 15px; border-radius: 16px; max-width: 88%; line-height: 1.4; }
.msg.me { justify-self: end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 5px; }
.msg.ai { background: color-mix(in srgb, var(--surface) 12%, var(--ink)); border-bottom-left-radius: 5px; font-family: var(--f-mono); font-size: 13px; }
.msg.ai b { color: var(--code-add); font-weight: 600; }
.msg.q { justify-self: end; background: var(--snack); color: var(--snack-ink); font-weight: 700; border-bottom-right-radius: 5px; }

/* ---------- Toilet budget ---------- */
.budget { padding-block: 16px 72px; display: grid; gap: 26px; }
.budget h2 { font-family: var(--f-display); font-weight: 800; font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -.03em; line-height: 1.05; margin: 0; text-wrap: balance; }
.budget > p { margin: 0; color: var(--muted); font-size: 18px; max-width: 36em; }
.timeline { display: grid; gap: 10px; }
.tl-bar { display: flex; height: 56px; border-radius: 16px; overflow: hidden; border: 1.5px solid var(--line); background: var(--surface); }
.tl-bar span { display: flex; align-items: center; padding: 0 14px; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; min-width: 0; }
.tl-run { background: var(--accent); color: var(--accent-ink); }
.tl-wash { background: var(--snack); color: var(--snack-ink); }
.tl-life { color: var(--muted); font-weight: 500 !important; }
.tl-scale { position: relative; height: 18px; font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.tl-scale span { position: absolute; top: 0; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--muted); margin: 0; padding: 0; list-style: none; }
.tl-legend li { display: flex; align-items: center; gap: 8px; }
.tl-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; border: 1.5px solid var(--line); }
.budget-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.budget-stats div { border-top: 2px solid var(--ink); padding-top: 12px; }
.budget-stats b { display: block; font-family: var(--f-display); font-weight: 800; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.budget-stats span { font-size: 14.5px; color: var(--muted); }

/* ---------- KB teaser + KB ---------- */
.final-cta { padding-block: 8px 48px; display: grid; gap: 14px; justify-items: start; }
.final-cta h2 { font-family: var(--f-display); font-weight: 800; font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -.03em; line-height: 1.05; margin: 0; text-wrap: balance; }
.final-cta p { margin: 0; color: var(--muted); max-width: 34em; }
.teaser { padding-block: 0 72px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; }
.teaser h2 { font-family: var(--f-display); font-weight: 800; font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -.03em; margin: 0 0 8px; line-height: 1.05; }
.teaser p { margin: 0; color: var(--muted); max-width: 34em; }
.link-btn { display: inline-block; text-decoration: none; text-align: center; width: auto; padding: 14px 22px; }
.kb-link { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 700; color: var(--accent); text-decoration: none; padding: 2px 0; }
.kb-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.kb { padding-block: 32px 72px; display: grid; gap: 28px; }
.kb-head h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(38px, 5.4vw, 64px); letter-spacing: -.035em; line-height: 1; margin: 6px 0 12px; }
.kb-head p { margin: 0; color: var(--muted); font-size: 18px; max-width: 36em; }
.kb-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.kb-search { flex: 1 1 260px; min-width: 0; font: inherit; font-size: 16px; padding: 12px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); }
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.kb-card { display: grid; gap: 8px; align-content: start; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; transition: transform .12s ease, border-color .12s ease; }
.kb-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.kb-card h3 { font-family: var(--f-display); font-size: 20px; letter-spacing: -.02em; line-height: 1.15; margin: 0; }
.kb-card p { margin: 0; font-size: 14.5px; color: var(--muted); }
.kb-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-family: var(--f-mono); font-size: 11.5px; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.kb-empty { color: var(--muted); }
.article { display: grid; gap: 26px; max-width: 760px; }
.crumbs { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 500; }
.crumbs a:hover { color: var(--ink); }
.crumbs a.back-game { color: var(--accent); font-weight: 700; }
.article h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(32px, 4.6vw, 52px); letter-spacing: -.035em; line-height: 1.03; margin: 8px 0 14px; text-wrap: balance; }
.article .lede { font-size: 19px; color: var(--ink); }
.article h2 { font-family: var(--f-display); font-size: 22px; letter-spacing: -.02em; margin: 0 0 10px; }
.article p, .article li { font-size: 16.5px; line-height: 1.6; }
.article code, .kb-card code { font-family: var(--f-mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
.steps { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; }
.code-block { background: var(--code-bg); color: var(--code-fg); border-radius: 14px; font-family: var(--f-mono); font-size: 13.5px; line-height: 1.6; padding: 10px 0; overflow-x: auto; }
.code-block div { white-space: pre; padding: 0 14px; }
.code-block .hit { background: var(--code-bad); box-shadow: inset 3px 0 0 var(--code-del); }
.code-block .ok { background: var(--code-good); box-shadow: inset 3px 0 0 var(--code-add); }
.code-block .n { color: var(--code-dim); display: inline-block; width: 24px; user-select: none; }
.code-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.code-pair > div { min-width: 0; display: grid; gap: 8px; align-content: start; }
.code-cap { font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rule { background: var(--snack); color: var(--snack-ink); border-radius: 18px; padding: 18px 20px; }
.rule b { display: block; font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.rule p { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 21px; line-height: 1.25; letter-spacing: -.01em; }
.rule code { background: rgba(0,0,0,.08); border-color: rgba(0,0,0,.12); }
.article-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.article-actions .btn { width: auto; }

/* ---------- Lupe ---------- */
.q-tools { display: flex; align-items: center; gap: 8px; }
.lupe-btn { appearance: none; display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 10px 4px 7px; font-size: 13px; font-weight: 700; cursor: pointer; }
.lupe-btn svg { width: 16px; height: 16px; flex: none; }
.lupe-btn[aria-pressed="true"] { background: var(--snack); color: var(--snack-ink); border-color: var(--snack); }
.lupe-note { font-size: 13px; line-height: 1.4; background: color-mix(in srgb, var(--snack) 30%, var(--surface)); border-radius: 12px; padding: 8px 12px; }
.lupe-on .code { outline: 2px solid var(--snack); outline-offset: 3px; }
.lupe-on .code .gl { background: rgba(255, 210, 63, .14); box-shadow: inset 0 -1.5px 0 var(--code-str); border-radius: 3px; cursor: help; }
.lupe-on .code .gl:hover, .lupe-on .code .gl.is-open { background: rgba(255, 210, 63, .38); }
.lupe-on button.ln { cursor: default; }
.lupe-on button.ln:hover { background: transparent; }
.sheet.gl-sheet { border-top-color: var(--snack); z-index: 7; }
.gl-term { font-family: var(--f-mono); font-weight: 600; font-size: 24px; }
.gl-sheet .fix div { padding: 0 12px; }

.nav-login { appearance: none; border: 0; cursor: pointer; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 15px; padding: 7px 15px; border-radius: 999px; }
.sheet.auth-sheet { border-top-color: var(--accent); z-index: 7; text-align: center; }
.auth-badge { justify-self: center; font-family: var(--f-mono); font-weight: 600; font-size: 14px; padding: 5px 12px; border-radius: 999px; background: var(--snack); color: var(--snack-ink); }
.auth-title { font-family: var(--f-display); font-weight: 800; font-size: 26px; letter-spacing: -.02em; line-height: 1.1; margin: 0; }
.auth-sheet .report { margin: 0 auto; }
.auth-ask, .auth-sent { display: grid; gap: 12px; }
.auth-sent .auth-title:focus { outline: none; }
.auth-sent .btn { justify-self: center; }

/* ---------- Glossary page ---------- */
.gl-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 8px; align-content: start; min-width: 0; }
/* #88: 79 cards (~1.9k nodes) — skip layout/paint of off-screen cards. `auto` remembers each card's real size once
   rendered. The intrinsic size is the CONTENT box: measured median card 216px minus 2×16px padding and 2×1px border. */
.gl-card { content-visibility: auto; contain-intrinsic-size: auto 182px; }
.gl-card h3 { margin: 0; font-family: var(--f-mono); font-size: 19px; font-weight: 600; }
/* #73: the term name links to its page — card text colour in both themes, underline only as the link hint. */
.gl-card h3 a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.gl-card p { margin: 0; font-size: 14.5px; color: var(--muted); }
.gl-card p code { font-family: var(--f-mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
.gl-card .code-block { font-size: 12.5px; }

@media (max-width: 900px) {
  .band-in { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-block: 48px; }
  .budget-stats { grid-template-columns: minmax(0, 1fr); }
  .teaser { grid-template-columns: minmax(0, 1fr); }
  .code-pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-block: 24px 40px; }
  .device { margin: 0 auto; }
  .cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 440px) {
  .device { width: 100%; height: 740px; border-width: 6px; border-radius: 30px; }
  .device::before { display: none; }
  .app-top { padding-top: 16px; }
  .screen, .dock { padding-left: 12px; padding-right: 12px; }
  .code { font-size: 12px; }
  .lede { font-size: 17px; }
}

/* ---------- App page (/, /play when signed in): the game IS the screen, no phone frame ---------- */
.is-app { margin: 0; overflow: hidden; }
.is-app .hero { display: block; max-width: none; padding: 0; }
.is-app .device { width: min(100%, 720px); height: 100vh; height: 100dvh; min-height: 0; margin: 0 auto;
  border: 0; border-radius: 0; box-shadow: none; }
@media (min-width: 721px) { .is-app .device { border-left: 1px solid var(--line); border-right: 1px solid var(--line); width: 720px; } }
.is-app .device::before { display: none; }
.is-app .app-top { padding-top: max(14px, env(safe-area-inset-top, 0px)); }
.is-app .dock { padding-bottom: max(14px, env(safe-area-inset-bottom, 0px)); }
.app-top a.brand { color: inherit; text-decoration: none; }
.app-top .logout { appearance: none; border: 0; background: none; color: var(--muted); font-size: 12.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 4px; }
.noscript { padding: 18px; font-size: 14px; color: var(--muted); }
.code { overflow-x: auto; }
.ln { white-space: pre-wrap; overflow-wrap: anywhere; }
.auth-form { display: grid; gap: 8px; }
.auth-form input, .auth-form select { font: inherit; font-size: 16px; padding: 13px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); width: 100%; }
.auth-page { max-width: 460px; margin: 0 auto; padding-block: 64px; display: grid; gap: 16px; }
.auth-page h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(30px, 6vw, 42px); letter-spacing: -.03em; line-height: 1.05; margin: 0; }
.auth-page p { margin: 0; color: var(--muted); }
.auth-page form { display: grid; gap: 10px; }
/* #59: site footer on public pages (never in the game). Links wrap on narrow phones; ≥ 24 px tap targets. */
.site-footer { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 20px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 15px; padding-block: 0 12px; }
.footer-links a { color: var(--ink); min-height: 24px; display: inline-flex; align-items: center; }
.lang-switch { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); padding-block: 0 24px; }
.lang-switch a { color: var(--ink); }
.kb-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.kb-filter .chip { text-decoration: none; color: var(--ink); }
.kb-filter .chip[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.empty { display: grid; gap: 10px; text-align: center; padding-block: 24px; }
.empty h2 { font-family: var(--f-display); font-size: 26px; margin: 0; }
.tl-run, .tl-life { flex: 130; }
.tl-wash { flex: 40; }
.tl-scale .s0 { left: 0; }
.tl-scale .s1 { left: 43.33%; transform: translateX(-50%); }
.tl-scale .s2 { left: 86.67%; transform: translateX(-50%); }
.tl-scale .s3 { right: 0; }
.tl-legend .lg-run { background: var(--accent); border-color: var(--accent); }
.tl-legend .lg-wash { background: var(--snack); border-color: var(--snack); }
.mode-sr { background: var(--surface-2); color: var(--ink); }
.kb-page { padding-block: 32px 72px; }
.glossary-link { border-color: var(--snack); }
.review-head { margin-bottom: 8px; }
/* Feedback sheet: collapsible so the code above stays readable (magnifier after answering). */
.sheet-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: center; }
.sheet-toggle { appearance: none; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 14px; padding: 13px 14px; font-weight: 700; font-size: 14px; cursor: pointer; }
.sheet.collapsed > :not(.sheet-top):not(.sheet-actions) { display: none; }
.sheet.collapsed { gap: 8px; padding-block: 12px 16px; }
.screen { scroll-padding-bottom: 24px; }
/* Never let the game screen squeeze its children (the code card has overflow-x and would
   otherwise shrink to its header when the screen is crowded). The screen scrolls instead. */
.screen > * { flex-shrink: 0; }
/* Long words (German compounds, the pseudo-locale) wrap instead of overflowing into the game. */
body { overflow-wrap: anywhere; }
.pitch, .band-in > div, .kb-card, .gl-card, .article { min-width: 0; }
[hidden] { display: none !important; }
/* Sheets never cover the whole game: the top bar with the magnifier stays reachable. */
.sheet { max-height: 62%; overflow-y: auto; overscroll-behavior: contain; }
.gl-card h3 code.gl-name { background: none; border: 0; padding: 0; font-size: inherit; }
.data-note { font-size: 12.5px; color: var(--muted); padding-block: 0 16px; max-width: 70ch; }
/* Lesson before a card and the "Explain" sheet (content from the knowledge article). */
.lesson-summary { margin: 0; font-size: 15px; }
.screen .steps, .lesson-sheet .steps { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; font-size: 14.5px; }
.screen .code-block, .lesson-sheet .code-block { font-size: 12.5px; }
.screen .rule p, .lesson-sheet .rule p { font-size: 16px; }
.q-tools { flex-wrap: wrap; justify-content: flex-end; }
.explain-btn { padding-left: 10px; }
/* Never any left/right scrolling (user rule): pages clip, code and diffs wrap, sheets scroll only vertically. */
html, body { overflow-x: clip; max-width: 100%; }
.sheet { overflow-x: hidden; }
.code ol, .fix, .mini, .code-block { overflow-x: hidden; }
.fix div, .mini div, .code-block div, .ln { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.share-box textarea { overflow-x: hidden; white-space: pre-wrap; }
a.nav-login { text-decoration: none; display: inline-block; }
.topnav a.nav-login, .topnav a.nav-login:hover { background: var(--accent); color: var(--accent-ink); }
.exercise-list { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.exercise-list a { color: var(--ink); font-weight: 600; }
.exercise-options .is-answer { font-weight: 700; color: var(--good); }
.auth-form label { font-size: 15px; }
.form-error { color: var(--bad-ink) !important; font-weight: 600; } /* #113: --bad is 4.06:1 on the light page background */
.form-ok { color: var(--good) !important; font-weight: 600; }
/* #99: delete the account on /settings */
.danger-zone { margin-top: 28px; padding-top: 20px; border-top: 1.5px solid var(--line); display: grid; gap: 8px; }
.danger-zone h2 { font-size: 18px; margin: 0; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check-row input { width: 22px; height: 22px; flex: none; accent-color: var(--bad); }
.btn-danger { background: var(--bad-soft); color: var(--bad-ink); border: 1.5px solid var(--bad-ink); }
.deleted-note { margin: 12px 0 0; }

/* ---------- Admin board (plan 008) ---------- */
.admin { padding-block: 20px 48px; display: grid; gap: 22px; }
.admin-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.admin-head h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(24px, 5vw, 34px); margin: 0; letter-spacing: -.02em; }
.admin-periods { margin-left: auto; display: flex; gap: 4px; }
.admin-periods a { color: var(--ink); text-decoration: none; padding: 6px 12px; border-radius: 999px; font-size: 14px; white-space: nowrap; }
.admin-periods a[aria-current="page"] { background: var(--ink); color: var(--surface); }
.admin-note { margin: 0; color: var(--muted); font-size: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; gap: 4px; min-width: 0; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi b { font-family: var(--f-display); font-size: 26px; }
.kpi small { font-size: 12px; color: var(--muted); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.bars { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; gap: 8px; min-width: 0; }
.bars figcaption { font-weight: 600; font-size: 14px; }
.bars svg { width: 100%; height: 90px; display: block; }
.bars .bar { fill: var(--accent); }
.bars-axis { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); font-family: var(--f-mono); }
.admin-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; align-items: start; }
.admin table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; font-size: 14px; }
.admin caption { text-align: left; font-weight: 600; padding: 0 0 6px; }
.admin th, .admin td { padding: 6px 10px; border-top: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; }
.admin td { text-align: right; font-variant-numeric: tabular-nums; }
.admin-cards h2 { font-size: 18px; margin: 0 0 6px; }
.cards-table { table-layout: fixed; }
.cards-table th:first-child { width: 34%; }
.cards-table thead th { font-size: 12px; color: var(--muted); font-weight: 600; text-align: right; }
.cards-table thead th:first-child { text-align: left; }
@media (max-width: 480px) { .cards-table { font-size: 12px; } .admin th, .admin td { padding: 5px 6px; } }
a.brand { color: inherit; text-decoration: none; }

/* ---------- My cards (issue #12) ---------- */
.my-cards { max-width: 760px; margin: 0 auto; padding-block: 32px 64px; display: grid; gap: 16px; }
.my-cards h1 { font-family: var(--f-display); margin: 8px 0 0; }
.card-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.card-row { background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 16px; display: grid; gap: 6px; min-width: 0; }
.card-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.card-title { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
a.card-title { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.card-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; color: var(--muted); }
.card-meta b { color: var(--ink); font-weight: 600; }
.result { font-family: var(--f-mono); font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.result-right { background: var(--good-soft); color: var(--good); }
.result-wrong, .result-timeout { background: var(--bad-soft); color: var(--bad); }
.card-row details summary { cursor: pointer; font-size: 14px; color: var(--accent); }
.answer-history { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.exercise-dialog { width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: 18px; padding: 0; overflow-x: hidden; overflow-y: auto; }
.exercise-dialog::backdrop { background: rgba(20, 22, 43, .55); }
.exercise-dialog-bar { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.exercise-dialog-bar .btn { width: auto; flex: 0 0 auto; min-height: 40px; padding: 8px 18px; font-size: 15px; }
#exerciseContent { padding: 16px; min-width: 0; }
#exerciseContent .code-block { overflow-wrap: anywhere; }
/* Signed-in nav (issue #12): Knowledge, My cards, Settings, Play — and Admin for admins.
   Words never wrap (LESSONS "navbar wrapped word-by-word"); on the smallest phones the links get
   tighter, and with five links the logo is visually hidden (still a link for screen readers). */
@media (max-width: 480px) {
  .topnav:has(nav a:nth-child(5)) nav { gap: 0; }
  .topnav:has(nav a:nth-child(5)) a, .topnav:has(nav a:nth-child(5)) .nav-login { font-size: 12.5px; padding: 6px 4px; }
}
@media (max-width: 374px) {
  .topnav:has(nav a:nth-child(4)) { gap: 4px; }
  .topnav:has(nav a:nth-child(4)) nav { gap: 0; }
  .topnav:has(nav a:nth-child(4)) a, .topnav:has(nav a:nth-child(4)) .nav-login { font-size: 12.5px; padding: 6px 4px; }
  .topnav:has(nav a:nth-child(5)) .brand { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .topnav:has(nav a:nth-child(5)) nav { margin-left: 0; }
  .topnav:has(nav a:nth-child(5)) a, .topnav:has(nav a:nth-child(5)) .nav-login { font-size: 12px; padding: 6px 3px; }
}

/* ---------- Settings: level boxes (issue #10) ---------- */
.level-boxes { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.level-boxes legend { padding: 0; margin-bottom: 4px; }
.level-boxes p { margin: 0; }
.levels { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.lvl { position: relative; display: grid; place-items: center; height: 40px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 9px; cursor: pointer; font-family: var(--f-mono); font-weight: 600; font-size: 13px; }
.lvl input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.lvl:has(input:checked) { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.lvl:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.lvl:hover { border-color: var(--accent); }
.level-note { margin: 0; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: 14px; }

/* ---------- Practice round (issue #50) ---------- */
.practice-note { margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font-size: 13.5px; font-weight: 600; }
.practice-done { display: grid; gap: 10px; padding-block: 24px; }
.practice-done p { margin: 0; color: var(--muted); }

/* #112: below-the-fold landing sections skip style/layout until they come near the screen. Placeholder sizes are the
   midpoints of the heights measured in the e2e container (fonts loaded) per layout step (375 / 481 / 901 px, the
   landing's own breakpoints), each within 60 px of the real height (tests/e2e/landing-sections.spec.js); `auto` keeps the
   real size once a section has rendered. Re-measure when landing copy changes. */
#home > .band, #home .how, #home .budget, #home .faq, #home .final-cta, #home .teaser { content-visibility: auto; overflow-clip-margin: 16px; }
#home > .band { contain-intrinsic-size: auto 657px; }
#home .how.learn { contain-intrinsic-size: auto 814px; }
#home .how:not(.learn) { contain-intrinsic-size: auto 1087px; }
#home .budget { contain-intrinsic-size: auto 740px; }
#home .faq { contain-intrinsic-size: auto 399px; }
#home .final-cta { contain-intrinsic-size: auto 227px; }
#home .teaser { contain-intrinsic-size: auto 269px; }
@media (max-width: 374px) {
  #home > .band { contain-intrinsic-size: auto 753px; }
  #home .how.learn { contain-intrinsic-size: auto 900px; }
  #home .how:not(.learn) { contain-intrinsic-size: auto 1180px; }
  #home .budget { contain-intrinsic-size: auto 824px; }
  #home .faq { contain-intrinsic-size: auto 452px; }
  #home .final-cta { contain-intrinsic-size: auto 251px; }
  #home .teaser { contain-intrinsic-size: auto 281px; }
}
@media (min-width: 481px) {
  #home > .band { contain-intrinsic-size: auto 570px; }
  #home .how.learn { contain-intrinsic-size: auto 720px; }
  #home .how:not(.learn) { contain-intrinsic-size: auto 999px; }
  #home .budget { contain-intrinsic-size: auto 658px; }
  #home .faq { contain-intrinsic-size: auto 389px; }
  #home .final-cta { contain-intrinsic-size: auto 201px; }
  #home .teaser { contain-intrinsic-size: auto 245px; }
}
@media (min-width: 901px) {
  #home > .band { contain-intrinsic-size: auto 444px; }
  #home .how.learn { contain-intrinsic-size: auto 506px; }
  #home .how:not(.learn) { contain-intrinsic-size: auto 546px; }
  #home .budget { contain-intrinsic-size: auto 513px; }
  #home .faq { contain-intrinsic-size: auto 395px; }
  #home .final-cta { contain-intrinsic-size: auto 194px; }
  #home .teaser { contain-intrinsic-size: auto 162px; }
}
