/* Color Fields: white ground, one soft color per area, pill buttons.
   Display: Bricolage Grotesque. Body: Figtree. Math: KaTeX. */
:root {
  --bg: #ffffff; --card: #ffffff; --soft: #f6f5fa; --line: #e4e6ee; --line-2: #eeeff4;
  --ink: #1f1d2b; --ink-2: #4a475c; --muted: #5d5a70; --faint: #8e8ba3;
  --btn: #1f1d2b; --btn-ink: #ffffff;
  --good: #1e7a4c; --good-line: #2e9e63; --good-tint: #e3f5ea; --good-ink: #14522f; --good-edge: #a9dcc0;
  --bad: #a33a22; --bad-line: #e57a5c; --bad-tint: #fce6df; --bad-soft: #fff1ec; --bad-ink: #6e2614;
  --gold-tint: #fdf3d2; --gold-ink: #6e5508;
  --focus: #5b37d6;
  --display: 'Bricolage Grotesque Variable', 'Bricolage Grotesque', ui-rounded, system-ui, sans-serif;
  --body: 'Figtree Variable', 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
/* Per-area color: --c bar, --t tint, --d deep text on tint */
.a-NO  { --c: #f4a259; --t: #fdebd9; --d: #7a4a12; }
.a-FDP { --c: #f08db4; --t: #fde4ee; --d: #8a2350; }
.a-PA  { --c: #f3c944; --t: #fdf3d2; --d: #6e5508; }
.a-AM  { --c: #7ccb9f; --t: #e3f5ea; --d: #1e6142; }
.a-EQ  { --c: #62b5ea; --t: #e0f0fb; --d: #17567f; }
.a-FG  { --c: #9c86f2; --t: #ede8ff; --d: #4b2bb5; }
.a-GE  { --c: #ec8a70; --t: #fce6df; --d: #87331e; }
.a-TR  { --c: #53c3cb; --t: #ddf3f4; --d: #1d5e63; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15141c; --card: #1d1c27; --soft: #1d1c27; --line: #34323f; --line-2: #2b2936;
    --ink: #f1f0f7; --ink-2: #c9c6d8; --muted: #a9a5bd; --faint: #7f7b94;
    --btn: #f1f0f7; --btn-ink: #15141c;
    --good: #6fd29b; --good-line: #4fb87f; --good-tint: #16301f; --good-ink: #a6e8c2; --good-edge: #2f5c41;
    --bad: #ff9c82; --bad-line: #d9694c; --bad-tint: #36201b; --bad-soft: #2a1b18; --bad-ink: #ffc4b2;
    --gold-tint: #352c12; --gold-ink: #f3d77a;
    --focus: #b6a6ff;
    color-scheme: dark;
  }
  .a-NO  { --t: #33261a; --d: #f8c58f; }
  .a-FDP { --t: #351f2a; --d: #f6b3cd; }
  .a-PA  { --t: #322b14; --d: #f5dc84; }
  .a-AM  { --t: #19302a; --d: #a7e0c0; }
  .a-EQ  { --t: #172938; --d: #9fd1f3; }
  .a-FG  { --t: #241f3f; --d: #c9bbff; }
  .a-GE  { --t: #36211c; --d: #f4b29f; }
  .a-TR  { --t: #15302f; --d: #93dde2; }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.key-hint { display: none; text-align: center; margin: -6px 0 0; }
@media (hover: hover) and (pointer: fine) { .key-hint { display: block; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- frame ---------- */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 640px; margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 4px max(20px, env(safe-area-inset-left));
}
.brand { font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
.brand .debt { color: var(--ink-2); }
.mark { flex: none; }
.mark-bg { fill: var(--btn); }
.mark-line { fill: var(--btn-ink); }
.brand { flex: none; }
.who { display: flex; align-items: center; gap: 4px; min-width: 0; }
.code-chip { font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 4px 10px; border-radius: 999px; background: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; user-select: all; }
@media (max-width: 360px) { .code-chip { font-size: 13px; padding: 4px 8px; } .brand { font-size: 19px; } }
main {
  max-width: 640px; margin: 0 auto; min-height: calc(100dvh - 64px);
  padding: 8px max(20px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: 20px;
}
.screen { display: flex; flex-direction: column; gap: 20px; flex: 1; }
.push { margin-top: auto; }

/* ---------- type ---------- */
h1, h2, .display { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(30px, 8vw, 38px); line-height: 1.06; text-wrap: balance; }
h2 { font-size: 20px; line-height: 1.2; }
p { margin: 0; }
.lede { font-size: 17px; line-height: 1.45; color: var(--ink-2); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow { font-weight: 700; font-size: 14px; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 0 22px; border-radius: 999px; border: 2px solid var(--line);
  background: var(--card); color: var(--ink); font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); font-size: 17px; width: 100%; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-row { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.link { border: 0; background: none; padding: 8px; min-height: 44px; color: var(--ink-2); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px; margin-left: -4px; border: 0; background: none; color: var(--ink-2); font-weight: 600; font-size: 15px; cursor: pointer; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--ink-2); border-radius: 12px; cursor: pointer; margin-left: -8px; }

/* ---------- welcome ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--t); color: var(--d); border-radius: 18px; padding: 12px 14px; min-height: 64px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 14px; line-height: 1.2; }
.tile i { display: block; height: 6px; border-radius: 3px; background: var(--c); }
.code-form { display: flex; flex-direction: column; gap: 8px; }
.code-form label { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.code-row { display: flex; gap: 8px; }
.input {
  flex: 1; min-width: 0; height: 52px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); color: var(--ink);
  padding: 0 16px; font: inherit; font-size: 17px;
}
.input::placeholder { color: var(--faint); }
.square { width: 52px; height: 52px; border-radius: 16px; border: 2px solid var(--line); background: var(--soft); display: grid; place-items: center; cursor: pointer; flex: none; }
.error { color: var(--bad); font-weight: 600; font-size: 15px; }

/* ---------- code reveal ---------- */
.code-card { background: var(--t); border-radius: 26px; padding: 26px 18px 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.code-big { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 8vw, 32px); letter-spacing: -0.01em; color: var(--d); user-select: all; overflow-wrap: anywhere; text-align: center; }
.chip-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--card); color: var(--d); font-weight: 700; font-size: 15px; cursor: pointer; }
.rules { display: flex; flex-direction: column; gap: 14px; }
.rule { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; font-size: 16px; line-height: 1.45; }
.rule > span:first-child { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--t); color: var(--d); font-family: var(--display); font-weight: 700; }

/* ---------- question ---------- */
.qtop { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.track { flex: 1; height: 10px; border-radius: 5px; background: var(--line-2); overflow: hidden; }
.track > span { display: block; height: 100%; border-radius: 5px; background: var(--c, var(--focus)); transition: width 0.4s ease; }
.qcount { font-weight: 600; font-size: 14px; color: var(--muted); min-width: 1.5em; text-align: right; }
.qtopic { flex: 1; font-weight: 700; font-size: 14px; color: var(--d); min-width: 0; }
.streak { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--gold-tint); color: var(--gold-ink); font-weight: 700; font-size: 13px; white-space: nowrap; }
.qpanel { background: var(--t); border-radius: 26px; padding: 20px 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.qpanel .area { font-weight: 700; font-size: 13px; color: var(--d); }
.prompt { font-size: 18px; line-height: 1.55; overflow-wrap: anywhere; }
.prompt .katex-display, .prompt .katex { font-size: 1.12em; }
.mathcard { background: var(--card); border-radius: 18px; padding: 18px 16px; text-align: center; overflow-x: auto; overflow-y: hidden; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 58px; padding: 10px 18px; text-align: left;
  border-radius: 18px; border: 2px solid var(--line); background: var(--card); box-shadow: 0 3px 0 var(--line);
  cursor: pointer; font-size: 18px; overflow-x: auto; overflow-y: hidden; transition: transform 0.08s ease;
}
.choice:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.choice .txt { flex: 1; min-width: 0; }
.choice[aria-pressed="true"] { border-color: var(--d); background: var(--t); box-shadow: 0 3px 0 var(--d); }
.choice.right { border-color: var(--good-line); background: var(--good-tint); box-shadow: none; color: var(--ink); }
.choice.wrong { border-color: var(--bad-line); background: var(--bad-soft); box-shadow: none; color: var(--ink); }
.choice.dim { color: var(--faint); box-shadow: none; border-color: var(--line-2); }
.choice:disabled { cursor: default; }
.choice .tag { font-weight: 700; font-size: 12px; color: var(--bad); white-space: nowrap; }

/* ---------- feedback sheet ---------- */
.sheet { border-radius: 30px; padding: 22px 20px 22px; display: flex; flex-direction: column; gap: 14px; animation: rise 0.28s ease-out; }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet.good { background: var(--good-tint); color: var(--good-ink); }
.sheet.bad { background: var(--bad-tint); color: var(--bad-ink); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-title { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: -0.01em; }
.delta { height: 40px; padding: 0 16px; border-radius: 999px; font-family: var(--display); font-weight: 700; font-size: 22px; display: inline-flex; align-items: center; font-variant-numeric: tabular-nums; }
.sheet.good .delta { background: var(--good); color: var(--bg); animation: pop 0.45s cubic-bezier(.2,1.6,.4,1); }
.sheet.bad .delta { background: var(--card); color: var(--bad); font-size: 18px; height: 34px; }
@keyframes pop { from { transform: scale(0.6); } to { transform: none; } }
.lines { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.lines div { display: flex; justify-content: space-between; gap: 12px; }
.lines b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.note { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.slip { background: var(--card); color: var(--ink); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.slip > span:first-child { font-weight: 700; font-size: 13px; color: var(--bad); }
.steps { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: center; font-size: 16.5px; line-height: 1.85; padding: 10px 14px; border-radius: 16px; background: color-mix(in srgb, var(--card) 72%, transparent); counter-increment: s; overflow-x: auto; overflow-y: hidden; color: var(--ink); }
.steps li .katex { padding: 4px 0; display: inline-block; }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 10px; background: var(--card); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.sheet.good .steps li::before { color: var(--good); }
.sheet.bad .steps li::before { color: var(--bad); }
.sheet .btn:not(.primary) { border-color: var(--good-edge); }
.sheet.bad .btn:not(.primary) { border-color: var(--bad-line); }

/* ---------- ladder ---------- */
.ladder-card { background: var(--soft); border-radius: 26px; padding: 30px 14px 14px 8px; display: flex; flex-direction: column; gap: 8px; }
.ladder { display: flex; gap: 8px; }
.axis { position: relative; width: 46px; flex: none; }
.axis span { position: absolute; right: 0; font-size: 11px; font-weight: 500; color: var(--muted); line-height: 14px; white-space: nowrap; transform: translateY(50%); }
.plot { position: relative; flex: 1; min-width: 0; }
.rung { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); }
.lanes { position: relative; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; height: 100%; }
.lane { position: relative; display: block; border: 0; background: none; padding: 0; cursor: pointer; border-radius: 12px 12px 4px 4px; }
.lane .fill { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 12px 12px 4px 4px; background: var(--c); transition: filter 0.15s; animation: grow 0.6s ease-out both; transform-origin: bottom; }
.lane:hover .fill { filter: brightness(1.06) saturate(1.1); }
@keyframes grow { from { transform: scaleY(0); } to { transform: none; } }
.lane .val { position: absolute; left: -6px; right: -6px; text-align: center; font-size: 12px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.lane .val.prov { text-decoration: underline dotted; text-underline-offset: 3px; }
.lane-labels { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; font-size: 11px; font-weight: 600; color: var(--ink-2); text-align: center; margin-left: 54px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pcard { background: var(--t); color: var(--d); border-radius: 20px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; border: 0; text-align: left; cursor: pointer; }
.pcard span { font-size: 13px; font-weight: 600; }
.pcard b { font-family: var(--display); font-weight: 700; font-size: 17px; line-height: 1.2; color: var(--ink); }

/* ---------- area ---------- */
.ahead { background: var(--t); border-radius: 26px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.ahead-top { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ahead-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.ahead-row .big-elo { text-align: left; }
.ahead-row .gain { margin-top: 0; }
.ahead h1 { font-size: 28px; line-height: 1.05; color: var(--d); }
.big-elo { font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 0.95; color: var(--d); text-align: right; font-variant-numeric: tabular-nums; }
.gain { margin-top: 6px; display: inline-flex; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--card); font-weight: 700; font-size: 13px; align-items: center; white-space: nowrap; }
.gain.up { color: var(--good); } .gain.down { color: var(--bad); } .gain.flat { color: var(--muted); }
.spark { width: 100%; height: 48px; display: block; color: var(--d); }
.next { background: var(--card); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.next-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.next-row b { color: var(--ink); }
.next-row .togo { font-weight: 700; color: var(--d); }
.meter { height: 10px; border-radius: 5px; background: var(--t); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 5px; background: var(--d); }
.topics-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 6px; }
.topics { display: flex; flex-direction: column; margin: -8px 0 0; }
.topic { display: grid; grid-template-columns: 1fr 56px 42px; gap: 12px; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 14px; border: 0; background: none; text-align: left; font-size: 15px; font-weight: 500; cursor: pointer; color: var(--ink); }
.topic:hover { background: var(--soft); }
.topic .tbar { height: 6px; border-radius: 3px; background: var(--t); overflow: hidden; }
.topic .tbar > span { display: block; height: 100%; border-radius: 3px; background: var(--c); }
.topic .elo { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.prov { text-decoration: underline dotted var(--c); text-underline-offset: 4px; }

/* ---------- new rung ---------- */
.celebrate { position: relative; flex: 1; background: var(--t); border-radius: 30px; padding: 30px 20px 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; overflow: hidden; min-height: 560px; }
.celebrate h1 { text-align: center; color: var(--d); font-size: 32px; line-height: 1.08; }
.pill { height: 30px; padding: 0 14px; border-radius: 999px; background: var(--card); color: var(--d); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; }
.bit { position: absolute; border-radius: 6px; animation: drift 1.2s ease-out both; }
@keyframes drift { from { transform: translateY(-24px) rotate(0); opacity: 0; } to { opacity: 1; } }
.mini { position: relative; width: 100px; height: 290px; margin-top: 12px; border-left: 2px solid var(--c); border-right: 2px solid var(--c); }
.mini .rg { position: absolute; left: -22px; right: -22px; height: 2px; background: var(--c); opacity: 0.45; }
.mini .rg.hit { height: 3px; background: var(--d); opacity: 1; }
.mini .rl { position: absolute; right: calc(100% + 30px); font-weight: 600; font-size: 13px; color: var(--d); line-height: 16px; transform: translateY(50%); font-variant-numeric: tabular-nums; }
.mini .mfill { position: absolute; left: 10px; right: 10px; bottom: 0; border-radius: 14px 14px 4px 4px; background: var(--c); animation: grow 0.8s ease-out both; transform-origin: bottom; }
.mini .mval { position: absolute; left: 50%; transform: translateX(-50%); font-family: var(--display); font-weight: 700; font-size: 24px; color: var(--d); }
.stats { width: 100%; margin-top: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--card); border-radius: 18px; padding: 12px 8px; text-align: center; }
.stat b { display: block; font-family: var(--display); font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--ink-2); }

.errcard { background: var(--bad-tint); color: var(--bad-ink); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }

/* ---------- graphs ---------- */
.graphcard { background: var(--card); border-radius: 18px; padding: 8px; display: flex; justify-content: center; }
.graph { display: block; width: 100%; max-width: 360px; height: auto; }
.graph .g-bg { fill: var(--card); }
.graph .g-grid line { stroke: var(--line-2); stroke-width: 1; }
.graph .g-axis line { stroke: var(--faint); stroke-width: 1.5; }
.graph .g-tick text { fill: var(--muted); font: 600 11px var(--body); font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; }
.graph .g-asym { stroke: var(--faint); stroke-width: 1.5; stroke-dasharray: 5 5; }
.graph .g-curve { fill: none; stroke: var(--d, var(--ink)); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.graph .g-curve.dash { stroke-dasharray: 7 6; }
.graph .g-dot { fill: var(--d, var(--ink)); }
.graph .g-dot.open { fill: var(--card); stroke: var(--d, var(--ink)); stroke-width: 2.5; }
.graph.compact .g-curve { stroke-width: 2.5; }
.choices.graphs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice.gchoice { flex-direction: column; align-items: stretch; padding: 30px 8px 8px; gap: 6px; position: relative; overflow: visible; }
.choice.gchoice .graph { max-width: none; }
.choice.gchoice .gnum { position: absolute; top: 6px; left: 12px; font-weight: 800; font-size: 14px; color: var(--muted); }
.choice.gchoice .tag, .choice.gchoice .mark { position: absolute; top: 6px; right: 10px; }
.choice.gchoice.dim .graph { opacity: 0.45; }

/* ---------- select all that apply ---------- */
.multi-note { margin: 0; font-weight: 700; font-size: 14px; color: var(--d); }
.choice.multi .box { flex: none; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center; background: var(--card); }
.choice.multi .box svg { width: 16px; height: 16px; opacity: 0; }
.choice.multi[aria-checked="true"] { border-color: var(--d); background: var(--t); box-shadow: 0 3px 0 var(--d); }
.choice.multi[aria-checked="true"] .box { background: var(--d); border-color: var(--d); color: var(--card); }
.choice.multi[aria-checked="true"] .box svg { opacity: 1; }
.choice.gchoice.multi .box { position: absolute; top: 4px; right: 8px; width: 22px; height: 22px; }
.choice.missed { border-color: var(--good-line); border-style: dashed; background: var(--card); box-shadow: none; color: var(--ink); }
.choice.missed .tag { color: var(--good); }
.choice.right .box, .choice.wrong .box, .choice.missed .box, .choice.dim .box { display: none; }
.slips { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- root cause & topic network ---------- */
.root { background: var(--t); color: var(--ink); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.root p { margin: 0; }
.root b { color: var(--d); }
.root-k { font-weight: 700; font-size: 13px; color: var(--d); }
.root-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.root .btn { border-color: var(--d) !important; background: var(--card); }
.linkish { border: 0; background: none; padding: 6px 2px; font-weight: 700; font-size: 14px; color: var(--d); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.thead { background: var(--t); border-radius: 26px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.thead .eyebrow { color: var(--d); }
.thead h1 { font-size: 28px; line-height: 1.08; color: var(--d); }
.thead-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.thead .big-elo { text-align: left; }
.links { display: flex; flex-direction: column; gap: 6px; }
.links h2 { margin: 0 0 2px; padding: 0 6px; }
.link-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 16px; border: 2px solid var(--line-2); background: var(--card); text-align: left; cursor: pointer; color: var(--ink); }
.link-row:hover { background: var(--soft); }
.lr-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.lr-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lr-main b { font-size: 15px; }
.lr-why { font-size: 13px; color: var(--muted); line-height: 1.35; }
.lr-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.lr-side .elo { font-weight: 700; font-variant-numeric: tabular-nums; }
.lr-tag { font-size: 11px; font-weight: 700; color: var(--d); background: var(--t); border-radius: 6px; padding: 0 6px; }
/* After answering, the result colors win over the checked state. */
.choices .choice.multi.right { border-color: var(--good-line); background: var(--good-tint); box-shadow: none; }
.choices .choice.multi.wrong { border-color: var(--bad-line); background: var(--bad-soft); box-shadow: none; }
.choices .choice.multi.missed { border-color: var(--good-line); background: var(--card); box-shadow: none; }
.choices .choice.multi.dim { border-color: var(--line-2); background: var(--card); box-shadow: none; }
