:root {
  /* Gold #FCB040 is a fill: always dark ink on it (9:1). Gold-coloured text on white uses
     --accent-text (#885F23, 5.7:1). In dark mode plain gold reads fine as text (9.8:1). */
  --bg: #ffffff;
  --surface: #faf8f3;
  --ink: #1d1f22;
  --muted: #5d6168;
  --line: #e4dfd3;
  --accent: #fcb040;
  --accent-edge: #d9952f;
  --accent-ink: #1d1f22;
  --accent-text: #885f23;
  --warn: #a4400f;
  --warn-ink: #ffffff;
  --ok: #2f7d32;
  --radius: 14px;
  --plot-dot: #bf7c17; /* 3.2:1 vs the card, 4.8:1 under the dark number, inside the chart lightness band */
  --font-body: "Epilogue", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Big Shoulders", "Epilogue", ui-sans-serif, system-ui, sans-serif;
  font-family: var(--font-body);
  color-scheme: light;
}
/* Dark: the OS setting, unless overridden with ?theme=light (theme.js); ?theme=dark forces it. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a;
    --surface: #1e2125;
    --ink: #eceae4;
    --muted: #a0a4ab;
    --line: #33373d;
    --accent: #fcb040;
    --accent-edge: #fcb040;
    --accent-ink: #15171a;
    --accent-text: #fcb040;
    --warn: #f0a070;
    --warn-ink: #15171a;
    --ok: #7cc47f;
    --plot-dot: #fcb040;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15171a;
  --surface: #1e2125;
  --ink: #eceae4;
  --muted: #a0a4ab;
  --line: #33373d;
  --accent: #fcb040;
  --accent-edge: #fcb040;
  --accent-ink: #15171a;
  --accent-text: #fcb040;
  --warn: #f0a070;
  --warn-ink: #15171a;
  --ok: #7cc47f;
  --plot-dot: #fcb040;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* layout rules below must never un-hide an element */
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); line-height: 1.45; -webkit-text-size-adjust: 100%; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 800; line-height: 1.05; letter-spacing: .01em; margin: 0 0 .4em; }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.35rem; }
a { color: var(--accent-text); font-weight: 600; }
.wrap { max-width: 560px; margin: 0 auto; padding: 24px 16px 48px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stack > * + * { margin-top: 14px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=password], textarea {
  width: 100%; font: inherit; font-size: 1.1rem; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink);
}
input.code { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .2em; font-weight: 800; text-align: center; font-size: 2rem; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 650; font-size: 1.05rem; padding: 12px 20px; min-height: 48px;
  border-radius: 10px; border: 1px solid var(--accent-edge); background: var(--accent); color: var(--accent-ink);
  cursor: pointer; text-decoration: none;
}
button.secondary, .button.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
button.warn { background: var(--warn); border-color: var(--warn); color: var(--warn-ink); }
button:disabled { opacity: .5; cursor: default; }
.error { color: var(--warn); font-weight: 600; }

/* connection status */
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.conn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.conn[data-status=live]::before { background: var(--ok); }
.conn[data-status=polling]::before { background: var(--warn); }
.conn[data-status=offline]::before { background: var(--warn); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* phone */
.phone { min-height: 100dvh; display: flex; flex-direction: column; }
.phone header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; font-size: .85rem; color: var(--muted); }
.phone main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 16px; }
.phone .screen { text-align: center; max-width: 420px; }
.phone .screen h1 { font-size: 2.6rem; }
.phone .screen p { font-size: 1.15rem; color: var(--muted); }

/* host console */
.host { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 24px; padding: 24px; min-height: 100dvh; }
@media (max-width: 800px) { .host { grid-template-columns: 1fr; padding: 16px; } }
.join-panel { text-align: center; }
.join-panel img { width: 100%; max-width: 360px; aspect-ratio: 1; background: #fff; border-radius: 12px; padding: 8px; }
.join-code { font-family: var(--font-head); font-size: 4rem; font-weight: 800; letter-spacing: .12em; line-height: 1; margin: 8px 0 0; }
.join-url { font-size: 1.1rem; color: var(--muted); word-break: break-all; }
.joined { font-family: var(--font-head); font-size: 5rem; font-weight: 800; line-height: 1; }
.stepper { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.stepper li { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.stepper li.done { color: var(--ink); }
.stepper li.current { background: var(--accent); border-color: var(--accent-edge); color: var(--accent-ink); font-weight: 700; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* admin */
.admin-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.session-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.session-row + .session-row { border-top: 1px solid var(--line); padding-top: 14px; }
.session-row h3 { margin: 0 0 2px; font-size: 1.1rem; }
.session-row .meta { color: var(--muted); font-size: .875rem; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions button, .row-actions .button { min-height: 40px; padding: 8px 14px; font-size: .95rem; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form input { flex: 1 1 220px; }
button.link { background: none; border: none; color: var(--accent-text); padding: 0; min-height: 0; font-weight: 600; }

/* phone: header status */
.phone .status { display: inline-flex; gap: 10px; align-items: center; }
.sync { font-size: .8rem; font-weight: 600; color: var(--warn); }
.item-preview { list-style: none; padding: 0; margin: 12px 0 0; text-align: left; }
.item-preview li { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; background: var(--surface); font-weight: 600; }

/* phone: scoring flow */
.phone main.scoring-main { display: block; align-items: stretch; padding: 0 16px 32px; }
.scoring { max-width: 560px; margin: 0 auto; }
.q-head { padding: 8px 0 4px; }
.q-meta { font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.q-bar { height: 4px; background: var(--line); border-radius: 2px; margin: 8px 0 14px; overflow: hidden; }
.q-bar span { display: block; height: 100%; background: var(--plot-dot); }
.q-title { font-size: 2.1rem; margin: 0 0 8px; }
.anchors { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.anchors summary { padding: 10px 14px; font-weight: 600; color: var(--accent-text); cursor: pointer; }
.anchors dl { margin: 0; padding: 0 14px 12px; display: grid; grid-template-columns: 2.2rem 1fr; gap: 8px 10px; }
.anchors dt { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; line-height: 1.2; }
.anchors dd { margin: 0; font-size: .95rem; }
.prompt { font-size: 1.2rem; font-weight: 700; margin: 18px 0 4px; }
.hint { color: var(--muted); font-size: .9rem; margin: 0 0 8px; }
.picks, .cards { display: grid; gap: 10px; margin-top: 10px; }
.pick {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  width: 100%; min-height: 56px; padding: 14px 16px; border-radius: 12px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); font-weight: 500;
}
.pick.chosen { background: var(--accent); border-color: var(--accent-edge); color: var(--accent-ink); }
.pick .name, .score-card .name { font-weight: 700; font-size: 1.05rem; }
.pick .desc, .score-card .desc { font-size: .9rem; color: var(--muted); }
.pick.chosen .desc { color: var(--accent-ink); }
.tag {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; background: var(--ink); color: var(--bg);
}
.tag.weak { background: var(--muted); }
.score-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 12px; display: grid; gap: 4px; justify-items: start; }
.strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; width: 100%; margin-top: 8px; }
@media (min-width: 520px) { .strip { grid-template-columns: repeat(10, 1fr); } }
.strip .n {
  min-height: 46px; padding: 0; border-radius: 8px; font-family: var(--font-head); font-size: 1.4rem; font-weight: 800;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line);
}
.strip .n.on { background: var(--accent); border-color: var(--accent-edge); color: var(--accent-ink); }
.readback { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.readback li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 10px; }
.readback li.open { border-color: var(--accent-edge); padding-bottom: 12px; }
.rb-row {
  display: grid; grid-template-columns: 2rem 1fr auto; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; color: var(--ink); padding: 10px 4px; text-align: left; min-height: 52px; font-weight: 600;
}
.rb-row .rank { font-family: var(--font-head); font-size: 1.3rem; color: var(--muted); }
.rb-row .score { font-family: var(--font-head); font-size: 2rem; font-weight: 800; }
.words { display: grid; gap: 14px; margin-top: 10px; }
.word { display: grid; gap: 6px; margin: 0; }
.word .name { font-weight: 700; }
.actions { display: grid; gap: 10px; margin-top: 22px; }
.actions .primary { width: 100%; }
.actions .secondary { width: 100%; }
.actions .back { justify-self: start; margin-top: 4px; }

/* host: panels */
.panel { display: grid; gap: 12px; }
.panel h2 { margin: 0; }
.item-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.item-row:first-of-type { border-top: none; }
.item-row .name { font-weight: 700; }
.item-row .desc { color: var(--muted); font-size: .9rem; }
.item-form { display: grid; gap: 8px; }
.item-form .row { display: flex; gap: 8px; flex-wrap: wrap; }
.progress-row { display: grid; grid-template-columns: 5.5rem 1fr 4.5rem; gap: 10px; align-items: center; }
.progress-row .bar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.progress-row .bar span { display: block; height: 100%; background: var(--plot-dot); }
.progress-row.finished .label::after { content: " ✓"; color: var(--ok); }
.big-count { font-family: var(--font-head); font-size: 3.5rem; font-weight: 800; line-height: 1; }
.scoring.phase-done { text-align: center; padding-top: 22vh; }
.scoring.phase-done .screen { margin: 0 auto; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--accent-text); }

/* host: wide stages (Teach, Define) */
.host.wide { grid-template-columns: 1fr; }
.host.wide .join-panel { display: flex; align-items: center; gap: 20px; text-align: left; padding: 12px 16px; }
.host.wide .join-panel > * + * { margin-top: 0; }
.host.wide .join-panel img { width: 96px; padding: 4px; }
.host.wide .join-code { font-size: 2.4rem; margin: 0; }
.host.wide .join-url { font-size: .95rem; margin: 0; }

/* host: Teach */
.teach-reading { font-size: 1.15rem; margin: 0; color: var(--muted); max-width: 70ch; }
.teach-list { display: grid; gap: 10px; }
.teach-card {
  display: grid; justify-content: stretch; justify-items: start; gap: 12px; text-align: left; width: 100%; padding: 18px 20px; border-radius: 14px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); font-weight: 500;
}
.teach-card.open { border-color: var(--accent-edge); box-shadow: inset 6px 0 0 var(--accent); }
.teach-q { display: flex; gap: 14px; align-items: baseline; font-family: var(--font-head); font-weight: 800; font-size: 1.9rem; line-height: 1.1; }
.teach-n { color: var(--accent-text); min-width: 1.2em; }

/* host: Define */
.define-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.define-head h2 { margin: 0; }
.define-stats { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.define-stats .stat strong { font-family: var(--font-head); font-size: 2rem; font-weight: 800; }
.define-stats .total { padding: 2px 12px; border-radius: 10px; border: 1px solid var(--line); }
.define-stats .total.ok { background: var(--accent); border-color: var(--accent-edge); }
.define-stats .total.ok .muted { color: var(--accent-ink); }
.problems { margin: 0; padding-left: 1.2em; color: var(--warn); font-weight: 600; }
.problems:empty { display: none; }
.define-group h3 { margin: 12px 0 8px; font-size: 1.3rem; color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.index-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 10px; align-content: start; }
.index-card.killed .index-top, .index-card.killed .index-anchors { opacity: .5; } /* the Bring back button stays full contrast */
.index-card.killed .index-q { text-decoration: line-through; }
.index-top { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.index-q { font-weight: 700; font-size: 1.05rem; }
.index-anchors { margin: 0; display: grid; grid-template-columns: 1.8rem 1fr; gap: 4px 8px; font-size: .85rem; color: var(--muted); }
.index-anchors dt { font-family: var(--font-head); font-weight: 800; color: var(--ink); }
.index-anchors dd { margin: 0; }
.index-anchors.big { font-size: 1.1rem; gap: 8px 14px; grid-template-columns: 2.4rem 1fr; color: var(--ink); }
.index-anchors.big dt { font-size: 1.5rem; }
.index-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.index-foot .weight { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; }
.index-foot .weight input { width: 5.2rem; font-family: var(--font-head); font-size: 1.4rem; font-weight: 800; text-align: center; padding: 6px 8px; }
.index-weight-locked { font-family: var(--font-head); font-weight: 800; font-size: 1.4rem; }
.index-card.editing .field { display: grid; gap: 4px; margin: 0; font-weight: 400; }
.add-card summary { font-weight: 700; color: var(--accent-text); cursor: pointer; }
.add-card form { margin-top: 12px; }
.radio { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; margin: 0; }
input[type=number] {
  font: inherit; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink);
}

/* phone: Teach mirror */
.teach-mirror { text-align: left; width: 100%; max-width: 560px; margin: 0 auto; }
.teach-mirror details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-top: 10px; }
.teach-mirror details[open].focus { border-color: var(--accent-edge); box-shadow: inset 5px 0 0 var(--accent); }
.teach-mirror summary { padding: 14px 16px; font-weight: 700; cursor: pointer; }
.teach-mirror dl { margin: 0; padding: 0 16px 14px; display: grid; grid-template-columns: 2.2rem 1fr; gap: 8px 10px; }
.teach-mirror dt { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; }
.teach-mirror dd { margin: 0; }

.host.wide .joined-card { display: none; }
.join-inline { display: none; }
.host.wide .join-inline { display: block; margin: 0 0 0 auto; font-weight: 600; color: var(--muted); }
.host.wide .join-inline strong { font-family: var(--font-head); font-size: 2rem; color: var(--ink); }
input[type=radio], input[type=checkbox] { accent-color: var(--accent-text); }

/* host: Reveal */
.reveal-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .reveal-top { grid-template-columns: 1fr; } }
.plot-card { margin: 0; display: grid; gap: 10px; }
.plot-wrap { position: relative; }
.plot { width: 100%; height: auto; display: block; font-family: var(--font-body); }
.plot .grid { stroke: var(--line); stroke-width: 1; }
.plot .threshold { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
.plot .tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.plot .axis-label { fill: var(--muted); font-size: 13px; font-weight: 600; }
.plot .quad-label { fill: var(--muted); font-family: var(--font-head); font-weight: 800; font-size: 24px; letter-spacing: .02em; opacity: .75; }
.plot .dot { cursor: default; outline: none; }
.plot .dot .hit { fill: transparent; }
.plot .dot .mark { fill: var(--plot-dot); stroke: var(--surface); stroke-width: 2; }
.plot .dot:hover .mark, .plot .dot:focus-visible .mark { r: 14; }
.plot .dot:focus-visible .hit { stroke: var(--accent-text); stroke-width: 2; }
.plot .dot-label { fill: var(--ink); font-size: 13px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.plot-tip {
  position: absolute; transform: translate(-50%, calc(-100% - 14px)); pointer-events: none; display: grid; gap: 2px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: .85rem; white-space: nowrap;
  box-shadow: 0 4px 16px rgb(0 0 0 / .18);
}
.plot-tip strong { font-size: 1rem; }
.sliders { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.sliders label { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; }
.sliders output { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; min-width: 2ch; }
.sliders input[type=range] { width: 160px; accent-color: var(--accent-text); }
.quad-list { display: grid; gap: 14px; }
.quad h3 { margin: 0 0 6px; font-size: 1.5rem; }
.quad-item { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.quad-item .name { font-weight: 700; }
.assignments { margin: 2px 0 8px; padding-left: 1.2em; color: var(--muted); font-size: .9rem; }
.q-do_now h3 { color: var(--accent-text); }
.table-card { display: grid; gap: 10px; }
.table-scroll { overflow-x: auto; }
.totals { border-collapse: collapse; width: 100%; font-size: .95rem; }
.totals th, .totals td { padding: 8px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.totals thead th { font-weight: 700; white-space: nowrap; }
.totals .item-col { min-width: 12rem; font-weight: 700; }
.totals .ix-col { text-align: center; }
.totals .ix-col.ai { color: var(--accent-text); }
.totals .ix-sub { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); }
.totals .warn-text { color: var(--warn); }
.totals .num-col { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.totals .strong { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; }
.totals .quad-cell { font-weight: 700; white-space: nowrap; }
.score-cell { text-align: center; min-width: 4.2rem; }
.cell-num { display: block; font-variant-numeric: tabular-nums; font-weight: 600; }
.band-track { position: relative; display: block; height: 6px; margin-top: 4px; border-radius: 3px; background: var(--line); }
.band { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--plot-dot); opacity: .45; }
.band-tick { position: absolute; top: -2px; width: 2px; height: 10px; margin-left: -1px; background: var(--ink); }
.thin-tag { display: block; font-size: .7rem; color: var(--warn); font-weight: 600; }
.score-cell.thin .cell-num { color: var(--muted); }
.index-legend { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 4px 0 0; font-size: .85rem; color: var(--muted); }
.index-legend dt { font-weight: 700; color: var(--ink); }
.index-legend dd { margin: 0; }

.plot .dot-no { fill: #1d1f22; font-family: var(--font-head); font-weight: 800; font-size: 15px; pointer-events: none; }
.item-no {
  display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; margin-right: 8px; border-radius: 999px;
  background: var(--plot-dot); color: #1d1f22; font-family: var(--font-head); font-weight: 800; font-size: .95rem; vertical-align: middle;
}
.nowrap { white-space: nowrap; }

/* host: drill-down */
.item-link {
  display: inline-flex; align-items: center; gap: 0; background: none; border: none; padding: 0; min-height: 0;
  color: var(--ink); font: inherit; font-weight: 700; text-align: left; cursor: pointer;
}
.item-link:hover { text-decoration: underline; text-decoration-color: var(--accent-text); text-underline-offset: 3px; }
.plot .dot { cursor: pointer; }
.drill { display: grid; gap: 14px; }
.drill-nav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.drill-title { display: flex; align-items: center; font-size: 2.2rem; margin: 0; }
.drill-title .item-no { min-width: 2rem; height: 2rem; font-size: 1.2rem; }
.drill-stats { display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline; margin: 6px 0 0; font-weight: 600; }
.drill-stats span { font-family: var(--font-head); font-size: 1.5rem; font-weight: 800; }
.drill-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(240px, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1000px) { .drill-body { grid-template-columns: 1fr; } }
.drill-rows { display: grid; gap: 0; }
.drill-row {
  display: grid; grid-template-columns: minmax(11rem, 1.1fr) minmax(0, 2.4fr) 11.5rem; gap: 14px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.drill-row:first-child { border-top: none; }
@media (max-width: 800px) { .drill-row { grid-template-columns: 1fr; } }
.drill-label { display: grid; gap: 2px; }
.drill-code { font-family: var(--font-head); font-weight: 800; font-size: 1.1rem; }
.drill-code.ai { color: var(--accent-text); }
.drill-q { font-size: .88rem; color: var(--muted); }
.strip-svg { width: 100%; height: auto; display: block; }
.strip-axis { stroke: var(--line); stroke-width: 1; }
.strip-tick { stroke: var(--line); stroke-width: 1; }
.strip-num { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.strip-dot { fill: var(--plot-dot); stroke: var(--surface); stroke-width: 2; }
.strip-mean { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.drill-mean { display: grid; gap: 4px; justify-items: start; }
.drill-mean-num { font-family: var(--font-head); font-weight: 800; font-size: 1.6rem; line-height: 1; }
.shape-flag { display: inline-grid; gap: 0; font-size: .78rem; line-height: 1.25; padding: 3px 8px; border-radius: 8px; border: 1px solid var(--line); }
.shape-flag strong { font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }
.shape-flag.shape-none { display: none; }
.shape-flag.shape-tight { color: var(--muted); }
.shape-flag.shape-wide { border-color: var(--ink); }
.shape-flag.shape-split { background: var(--accent); border-color: var(--accent-edge); color: var(--accent-ink); }
.shape-flag.shape-thin { color: var(--warn); border-color: var(--warn); }
.drill-words h3 { margin: 0; }
.drill-words ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.drill-words li { padding: 8px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: .95rem; }
.drill-words li { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.note-count { font-family: var(--font-head); font-weight: 800; color: var(--accent-text); white-space: nowrap; }
.downloads { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 16px; }
.downloads .button { min-height: 40px; padding: 8px 14px; font-size: .95rem; }

/* phone: mirror (Reveal / Closed) */
.mirror { max-width: 560px; margin: 0 auto; display: grid; gap: 12px; }
.mirror-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.mirror-tab {
  display: inline-flex; align-items: center; gap: 0; flex: 0 0 auto; max-width: 16rem; min-height: 44px; padding: 8px 12px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .9rem;
}
.mirror-tab span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mirror-tab.on { border-color: var(--accent-edge); box-shadow: inset 0 0 0 1px var(--accent-edge); }
.mirror-tab .on-screen { margin-left: 8px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-text); }
.mirror-head h3 { margin: 4px 0 6px; font-size: 1.7rem; }
.mirror-blend { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; }
.mirror-blend dt { font-weight: 700; }
.mirror-blend dd { margin: 0; font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; }
.mirror-quad { margin: 6px 0 0; color: var(--muted); }
.mirror-row { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line); }
.mirror-label { display: grid; gap: 2px; }
.mirror-strip { width: 100%; height: auto; display: block; }
.mirror-strip .you-dot { fill: var(--ink); stroke: var(--accent); stroke-width: 3; }
.mirror-strip .you-label { fill: var(--ink); font-size: 11px; font-weight: 700; }
.mirror-nums { display: flex; gap: 14px; align-items: center; font-weight: 700; }
.mirror-nums .shape-flag { display: inline-block; padding: 1px 8px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
/* A disabled main action still carries information ("2 left to score"), so it stays readable. */
.actions .primary:disabled { opacity: 1; background: var(--surface); border-color: var(--line); color: var(--muted); }
