/* /driving: web/templates/driving_cn/, web/static/js/driving-cn.js. Not bundled; only these pages
 * load it. Colours are tokens on .dv, so light mode only restates the tokens (bottom of the hand
 * rules); the generated light block below covers the few literal colours left. */
.dv {
  --dv-ink: rgb(241 245 249);
  --dv-text: rgb(203 213 225);
  --dv-muted: rgb(148 163 184);
  --dv-card: rgb(255 255 255 / 0.035);
  --dv-card-hi: rgb(255 255 255 / 0.06);
  --dv-line: rgb(255 255 255 / 0.1);
  --dv-line-hi: rgb(255 255 255 / 0.2);
  --dv-solid: rgb(15 21 38);
  --dv-accent: rgb(56 189 248);
  --dv-accent-ink: rgb(125 211 252);
  --dv-accent-soft: rgb(56 189 248 / 0.14);
  --dv-ok: rgb(52 211 153);
  --dv-ok-ink: rgb(110 231 183);
  --dv-ok-soft: rgb(16 185 129 / 0.16);
  --dv-bad: rgb(251 113 133);
  --dv-bad-ink: rgb(253 164 175);
  --dv-bad-soft: rgb(244 63 94 / 0.15);
  --dv-track: rgb(255 255 255 / 0.1);
  --dv-plate: rgb(255 255 255);
  --dv-btn-ink: rgb(8 47 73);
  --dv-shadow: 0 10px 30px -12px rgb(0 0 0 / 0.6);
  max-width: 60rem; margin: 0 auto; color: var(--dv-text);
}
.dv [hidden], .dv[hidden] { display: none !important; }
.dv-ic { width: 1.15rem; height: 1.15rem; flex: none; }
.dv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* The runner is a focus mode: the floating chat and feedback launchers would sit on the answers. */
body.dv-focus .ai-fab, body.dv-focus .feedback-launcher { display: none !important; }
body.dv-locked { overflow: hidden; }

/* ── buttons ── */
.dv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 2.75rem; padding: 0.55rem 1.1rem; border: 1px solid var(--dv-line-hi); border-radius: 0.75rem;
  background: var(--dv-card-hi); color: var(--dv-ink); font: inherit; font-size: 0.95rem; font-weight: 600;
  line-height: 1.2; text-decoration: none; cursor: pointer; transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
}
.dv-btn:hover { border-color: var(--dv-accent); }
.dv-btn:active { transform: scale(0.98); }
.dv-btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.dv-btn--primary { border-color: var(--dv-accent); background: var(--dv-accent); color: var(--dv-btn-ink); }
.dv-btn--primary:hover { filter: brightness(1.08); }
.dv-btn--ghost { background: transparent; }
.dv-btn--big { min-height: 3.25rem; padding: 0.7rem 1.6rem; font-size: 1.05rem; }
.dv-linkbtn { padding: 0; border: 0; background: none; color: var(--dv-accent-ink); font: inherit; text-decoration: underline; cursor: pointer; }

/* ── page head (hub and topic pages) ── */
.dv-crumb { display: inline-flex; align-items: center; gap: 0.35rem; margin-bottom: 1rem; color: var(--dv-accent-ink); font-size: 0.9rem; text-decoration: none; }
.dv-crumb:hover { text-decoration: underline; }
.dv-crumb .dv-ic { width: 1rem; height: 1rem; }
.dv-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.1rem; }
.dv-head-icon {
  display: grid; place-items: center; flex: none; width: 3.25rem; height: 3.25rem; border-radius: 1rem;
  background: linear-gradient(135deg, rgb(56 189 248), rgb(37 99 235)); color: rgb(255 255 255);
  box-shadow: 0 8px 24px -10px rgb(56 189 248 / 0.7);
}
.dv-head-icon .dv-ic { width: 1.7rem; height: 1.7rem; }
.dv-kicker { margin: 0 0 0.2rem; color: var(--dv-accent-ink); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; }
.dv-title { margin: 0; color: var(--dv-ink); font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
.dv-lede { max-width: 42rem; margin: 0.45rem 0 0; color: var(--dv-text); font-size: 0.98rem; line-height: 1.55; }
.dv-facts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.dv-facts li {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.75rem; border: 1px solid var(--dv-line);
  border-radius: 99rem; background: var(--dv-card); color: var(--dv-ink); font-size: 0.85rem; font-weight: 500;
}
.dv-facts .dv-ic { width: 1rem; height: 1rem; color: var(--dv-accent-ink); }

/* ── cards ── */
.dv-card { border: 1px solid var(--dv-line); border-radius: 1rem; background: var(--dv-card); }
.dv-section { margin-top: 2.25rem; }
.dv-section-head { margin-bottom: 0.9rem; }
.dv-section-head h2, .dv-h2 { margin: 0; color: var(--dv-ink); font-size: 1.2rem; font-weight: 700; }
.dv-section-head p { margin: 0.25rem 0 0; color: var(--dv-muted); font-size: 0.9rem; }

/* ── hub: progress ── */
.dv-progress {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.25rem;
  margin-bottom: 1rem; padding: 1.1rem 1.25rem; border: 1px solid var(--dv-line); border-radius: 1rem; background: var(--dv-card);
}
.dv-progress-ring, .dv-ring {
  position: relative; display: grid; place-items: center; width: 4.75rem; height: 4.75rem; border-radius: 50%;
  color: var(--dv-ink); font-size: 1.1rem; font-weight: 700;
}
.dv-progress-ring::before, .dv-ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--dv-ok) calc(var(--p, 0) * 1%), var(--dv-track) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
}
.dv-progress-h { margin: 0 0 0.45rem; color: var(--dv-ink); font-size: 1.05rem; font-weight: 700; }
.dv-stats { display: flex; flex-wrap: wrap; gap: 0.4rem 1.75rem; margin: 0; }
.dv-stats dt { color: var(--dv-muted); font-size: 0.78rem; }
.dv-stats dd { margin: 0; color: var(--dv-ink); font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.dv-progress-foot { margin: 0.5rem 0 0; color: var(--dv-muted); font-size: 0.78rem; }

/* ── hub: modes ── */
.dv-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.dv-mode {
  display: flex; flex-direction: column; gap: 0.75rem; padding: 1.15rem; border: 1px solid var(--dv-line);
  border-radius: 1rem; background: var(--dv-card); color: var(--dv-text); text-decoration: none;
  transition: border-color 0.15s, transform 0.15s, background-color 0.15s;
}
.dv-mode:hover { border-color: var(--dv-accent); background: var(--dv-card-hi); transform: translateY(-2px); }
.dv-mode-icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 0.8rem; background: var(--dv-accent-soft); color: var(--dv-accent-ink); }
.dv-mode-icon .dv-ic { width: 1.35rem; height: 1.35rem; }
.dv-mode-text { display: grid; gap: 0.3rem; flex: 1; font-size: 0.875rem; line-height: 1.45; }
.dv-mode-text strong { display: flex; align-items: center; min-height: 1.5rem; gap: 0.4rem; color: var(--dv-ink); font-size: 1.05rem; font-weight: 700; }
.dv-mode-go { display: none; color: var(--dv-muted); }
.dv-mode--mock { border-color: rgb(56 189 248 / 0.45); background: linear-gradient(150deg, rgb(56 189 248 / 0.18), rgb(37 99 235 / 0.08)); }
.dv-mode--mock .dv-mode-icon { background: var(--dv-accent); color: var(--dv-btn-ink); }
.dv-mode--review .dv-mode-icon { background: var(--dv-bad-soft); color: var(--dv-bad-ink); }
.dv-badge {
  display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 0.45rem; border-radius: 99rem;
  background: var(--dv-bad); color: rgb(255 255 255); font-size: 0.75rem; font-weight: 700;
}

/* ── hub: topics ── */
.dv-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.dv-topic {
  position: relative; display: flex; align-items: center; gap: 0.9rem; padding: 0.85rem 0.9rem;
  border: 1px solid var(--dv-line); border-radius: 0.9rem; background: var(--dv-card); transition: border-color 0.15s, background-color 0.15s;
}
.dv-topic:hover { border-color: var(--dv-accent); background: var(--dv-card-hi); }
.dv-topic-icon { display: grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem; border-radius: 0.75rem; background: var(--dv-accent-soft); color: var(--dv-accent-ink); }
.dv-topic-main { flex: 1; min-width: 0; }
.dv-topic-link { color: var(--dv-ink); font-size: 0.98rem; font-weight: 650; text-decoration: none; }
.dv-topic-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.dv-topic-link:focus-visible { outline: none; }
.dv-topic-link:focus-visible::after { outline: 2px solid var(--dv-accent); outline-offset: 2px; }
.dv-topic-blurb { margin: 0.15rem 0 0.45rem; color: var(--dv-muted); font-size: 0.8rem; line-height: 1.4; }
.dv-topic-meta { display: flex; align-items: center; gap: 0.6rem; }
.dv-topic-count { flex: none; color: var(--dv-muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.dv-meter { position: relative; flex: 1; height: 0.375rem; overflow: hidden; border-radius: 99rem; background: var(--dv-track); }
.dv-meter > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--dv-ok); }
.dv-topic-browse {
  position: relative; z-index: 1; display: grid; justify-items: center; gap: 0.15rem; flex: none; padding: 0.4rem 0.5rem;
  border-radius: 0.6rem; color: var(--dv-muted); font-size: 0.7rem; text-decoration: none;
}
.dv-topic-browse:hover { background: var(--dv-card-hi); color: var(--dv-accent-ink); }

.dv-about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.dv-about-grid p { margin: 0; padding: 1rem; border: 1px solid var(--dv-line); border-radius: 0.9rem; background: var(--dv-card); font-size: 0.88rem; line-height: 1.6; }

/* ── questions (topic list and runner) ── */
.dv-list { display: grid; gap: 0.9rem; margin: 0; padding: 0; list-style: none; }
.dv-q { padding: 1.1rem 1.15rem 1.15rem; }
.dv-q-head { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.65rem; }
.dv-num {
  display: inline-grid; place-items: center; min-width: 1.9rem; height: 1.9rem; padding: 0 0.4rem; border-radius: 0.6rem;
  background: var(--dv-card-hi); color: var(--dv-ink); font-size: 0.82rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.dv-chip { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 0; color: var(--dv-muted); font-size: 0.8rem; }
.dv-chip .dv-ic { width: 0.95rem; height: 0.95rem; color: var(--dv-accent-ink); }
.dv-q-text { margin: 0 0 0.9rem; color: var(--dv-ink); font-size: 1.06rem; font-weight: 500; line-height: 1.5; }
.dv-fig { display: flex; justify-content: center; margin: 0 0 0.9rem; padding: 0.5rem; border-radius: 0.75rem; background: var(--dv-plate); }
.dv-fig img { display: block; max-width: 100%; max-height: min(30vh, 16rem); width: auto; height: auto; object-fit: contain; }
.dv-list .dv-fig { max-width: 26rem; }
.dv-opts { display: grid; gap: 0.5rem; }
.dv-opts--tf { grid-template-columns: 1fr 1fr; }
.dv-opt {
  display: flex; align-items: center; gap: 0.75rem; width: 100%; min-height: 3.1rem; padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--dv-line-hi); border-radius: 0.8rem; background: var(--dv-card); color: var(--dv-ink);
  font: inherit; font-size: 0.97rem; line-height: 1.4; text-align: left; cursor: pointer;
  transition: border-color 0.12s, background-color 0.12s;
}
.dv-opt:hover:not(:disabled) { border-color: var(--dv-accent); background: var(--dv-accent-soft); }
.dv-opt:focus-visible { outline: 2px solid var(--dv-accent); outline-offset: 2px; }
.dv-opt:disabled { cursor: default; }
.dv-key {
  display: grid; place-items: center; flex: none; width: 1.85rem; height: 1.85rem; border: 1.5px solid var(--dv-line-hi);
  border-radius: 50%; color: var(--dv-muted); font-size: 0.85rem; font-weight: 700;
}
.dv-key .dv-ic { width: 1rem; height: 1rem; }
.dv-opt-text { flex: 1; min-width: 0; }
.dv-opt.is-chosen { border-color: var(--dv-accent); background: var(--dv-accent-soft); }
.dv-opt.is-chosen .dv-key { border-color: var(--dv-accent); background: var(--dv-accent); color: var(--dv-btn-ink); }
.dv-opt.is-right { border-color: var(--dv-ok); background: var(--dv-ok-soft); }
.dv-opt.is-right .dv-key { border-color: var(--dv-ok); background: var(--dv-ok); color: rgb(2 44 34); }
.dv-opt.is-wrong { border-color: var(--dv-bad); background: var(--dv-bad-soft); }
.dv-opt.is-wrong .dv-key { border-color: var(--dv-bad); background: var(--dv-bad); color: rgb(76 5 25); }
.is-answered .dv-opt:not(.is-right):not(.is-wrong) { opacity: 0.55; }

.dv-feedback { margin-top: 0.9rem; padding: 0.85rem 1rem; border-left: 4px solid var(--dv-ok); border-radius: 0.6rem; background: var(--dv-ok-soft); scroll-margin-bottom: 7rem; }
.dv-feedback.is-wrong { border-left-color: var(--dv-bad); background: var(--dv-bad-soft); }
.dv-feedback-h { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; margin: 0; color: var(--dv-ink); font-size: 0.95rem; }
.dv-feedback-h strong { color: var(--dv-ok-ink); }
.dv-feedback.is-wrong .dv-feedback-h strong { color: var(--dv-bad-ink); }
.dv-feedback-h .dv-ic { color: var(--dv-ok-ink); }
.dv-feedback.is-wrong .dv-feedback-h .dv-ic { color: var(--dv-bad-ink); }
.dv-feedback-yours, .dv-feedback-x { margin: 0.45rem 0 0; color: var(--dv-text); font-size: 0.9rem; line-height: 1.55; }

.dv-why { margin-top: 0.8rem; font-size: 0.9rem; line-height: 1.55; }
.dv-why summary { display: inline-flex; color: var(--dv-accent-ink); font-weight: 600; cursor: pointer; list-style: none; }
.dv-why summary::-webkit-details-marker { display: none; }
.dv-why summary::before { content: "+"; width: 1rem; }
.dv-why[open] summary::before { content: "−"; }
.dv-why[open] { padding: 0.75rem 0.9rem; border-left: 4px solid var(--dv-accent); border-radius: 0.6rem; background: var(--dv-accent-soft); }
.dv-why.is-right { border-left-color: var(--dv-ok); background: var(--dv-ok-soft); }
.dv-why.is-wrong { border-left-color: var(--dv-bad); background: var(--dv-bad-soft); }
.dv-why-answer { margin: 0.5rem 0 0; color: var(--dv-ink); }
.dv-why.is-right [data-dv-verdict] { color: var(--dv-ok-ink); font-weight: 700; }
.dv-why.is-wrong [data-dv-verdict] { color: var(--dv-bad-ink); font-weight: 700; }
.dv-why-text { margin: 0.35rem 0 0; color: var(--dv-text); }

/* ── topic page ── */
.dv-topic-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin: 0 0 1.5rem; }
.dv-topic-cta p { flex: 1 1 18rem; margin: 0; color: var(--dv-muted); font-size: 0.88rem; line-height: 1.5; }
.dv-pager { display: flex; justify-content: space-between; gap: 0.75rem; margin-top: 1.5rem; }
.dv-pager-link {
  display: flex; align-items: center; gap: 0.6rem; max-width: 48%; padding: 0.75rem 0.9rem; border: 1px solid var(--dv-line);
  border-radius: 0.8rem; background: var(--dv-card); color: var(--dv-ink); font-size: 0.9rem; font-weight: 600; text-decoration: none;
}
.dv-pager-link:hover { border-color: var(--dv-accent); }
.dv-pager-link small { display: block; color: var(--dv-muted); font-size: 0.72rem; font-weight: 500; }
.dv-pager-link--next { margin-left: auto; text-align: right; }

/* ── runner ── */
.dv-run { max-width: 44rem; }
.dv-topicpage { max-width: 48rem; }
.dv-run-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.75rem; margin-bottom: 0.7rem; }
.dv-exit {
  display: grid; place-items: center; flex: none; width: 2.4rem; height: 2.4rem; padding: 0; border: 1px solid var(--dv-line);
  border-radius: 50%; background: var(--dv-card); color: var(--dv-text); cursor: pointer;
}
.dv-exit:hover { border-color: var(--dv-accent); color: var(--dv-ink); }
.dv-run-title { flex: 1; margin: 0; color: var(--dv-ink); font-size: 1.2rem; font-weight: 700; }
.dv-select select {
  max-width: 100%; min-height: 2.4rem; padding: 0.4rem 2rem 0.4rem 0.75rem; border: 1px solid var(--dv-line-hi); border-radius: 0.7rem;
  background: var(--space-deep, rgb(11 16 32)); color: var(--dv-ink); font: inherit; font-size: 0.88rem;
}
.dv-tally { display: inline-flex; gap: 0.6rem; font-size: 0.9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.dv-tally span { display: inline-flex; align-items: center; gap: 0.2rem; }
.dv-tally .is-right { color: var(--dv-ok-ink); }
.dv-tally .is-wrong { color: var(--dv-bad-ink); }
.dv-tally .dv-ic { width: 1rem; height: 1rem; }
.dv-track { height: 0.3rem; margin-bottom: 0.9rem; overflow: hidden; border-radius: 99rem; background: var(--dv-track); }
.dv-track > span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--dv-accent); transition: width 0.25s; }
.dv-run .dv-q { box-shadow: var(--dv-shadow); }

.dv-dock {
  position: sticky; bottom: calc(var(--tabbar-h, 0px) + env(safe-area-inset-bottom, 0px) + 0.6rem); z-index: 15;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.5rem; margin-top: 0.9rem; padding: 0.45rem;
  border: 1px solid var(--dv-line); border-radius: 1rem; background: var(--dv-solid); box-shadow: var(--dv-shadow);
}
.dv-dock .dv-btn { min-width: 0; }
.dv-dock [data-dv-prev] { justify-self: start; }
.dv-dock [data-dv-next] { justify-self: end; min-width: 7.5rem; }
.dv-dock-mid {
  display: grid; justify-items: center; gap: 0.05rem; min-width: 4.5rem; padding: 0.3rem 0.6rem; border: 0; border-radius: 0.6rem;
  background: none; color: var(--dv-muted); font: inherit; font-size: 0.85rem; font-variant-numeric: tabular-nums; cursor: pointer;
}
.dv-dock-mid:disabled { cursor: default; }
.dv-dock-mid:not(:disabled):hover { background: var(--dv-card-hi); }
[data-mode="mock"] .dv-count { text-decoration: underline dotted; text-underline-offset: 3px; }
.dv-clock { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--dv-ink); font-size: 1.05rem; font-weight: 700; }
.dv-clock .dv-ic { width: 1rem; height: 1rem; }
.dv-clock.is-low { color: var(--dv-bad-ink); }
.dv-keys { margin: 0.75rem 0 0; color: var(--dv-muted); font-size: 0.75rem; text-align: center; }
@media (hover: none) { .dv-keys { display: none; } }

.dv-intro-card { display: grid; justify-items: start; gap: 0.9rem; padding: 1.4rem; }
.dv-intro-card h2 { margin: 0; color: var(--dv-ink); font-size: 1.25rem; font-weight: 700; }
.dv-rules { display: grid; gap: 0.7rem; margin: 0; padding: 0; list-style: none; }
.dv-rules li { display: flex; gap: 0.7rem; color: var(--dv-text); font-size: 0.95rem; line-height: 1.5; }
.dv-rules .dv-ic { margin-top: 0.15rem; color: var(--dv-accent-ink); }

.dv-end { display: grid; gap: 0.6rem; padding: 1.5rem; text-align: center; }
.dv-end h2 { margin: 0; color: var(--dv-ink); font-size: 1.3rem; font-weight: 700; }
.dv-end p { margin: 0; color: var(--dv-text); }
.dv-end-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin-top: 0.6rem; }
.dv-error { padding: 1rem; color: var(--dv-bad-ink); }

/* mock: question overview sheet */
.dv.dv-sheet { max-width: none; margin: 0; }
.dv-sheet { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgb(2 6 23 / 0.6); backdrop-filter: blur(3px); }
.dv-sheet-panel {
  display: flex; flex-direction: column; width: min(100%, 40rem); max-height: min(88vh, 44rem); overflow: hidden;
  border: 1px solid var(--dv-line); border-radius: 1.1rem; background: var(--dv-solid); box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.7);
}
.dv-sheet-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1rem 0.6rem; }
.dv-sheet-head h2 { margin: 0; color: var(--dv-ink); font-size: 1.1rem; font-weight: 700; }
.dv-sheet-head span { flex: 1; color: var(--dv-muted); font-size: 0.85rem; }
.dv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.6rem, 1fr)); gap: 0.35rem; padding: 0.4rem 1rem 1rem; overflow-y: auto; }
.dv-cell {
  height: 2.5rem; padding: 0; border: 1px solid var(--dv-line-hi); border-radius: 0.55rem; background: transparent;
  color: var(--dv-text); font: inherit; font-size: 0.85rem; font-variant-numeric: tabular-nums; cursor: pointer;
}
.dv-cell:hover { border-color: var(--dv-accent); }
.dv-cell.is-done { border-color: transparent; background: var(--dv-accent-soft); color: var(--dv-accent-ink); font-weight: 700; }
.dv-cell.is-current { outline: 2px solid var(--dv-accent); outline-offset: 1px; }
.dv-sheet-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem; padding: 0.8rem 1rem; border-top: 1px solid var(--dv-line); }
.dv-sheet-foot p { flex: 1 1 100%; margin: 0 0 0.2rem; color: var(--dv-text); font-size: 0.88rem; }
.dv-sheet:not(.is-finishing) .dv-sheet-foot p { color: var(--dv-muted); }

/* mock: result */
.dv-result { padding: 1.4rem; }
.dv-result.is-pass { border-color: rgb(52 211 153 / 0.5); }
.dv-result.is-fail { border-color: rgb(251 113 133 / 0.45); }
.dv-result-note { margin: 0 0 0.9rem; color: var(--dv-bad-ink); font-weight: 600; }
.dv-result-top { display: flex; align-items: center; gap: 1.25rem; }
.dv-ring { width: 6.25rem; height: 6.25rem; font-size: 1.9rem; }
.dv-result.is-fail .dv-ring::before { background: conic-gradient(var(--dv-bad) calc(var(--p, 0) * 1%), var(--dv-track) 0); }
.dv-result-h { display: flex; align-items: center; gap: 0.5rem; margin: 0; color: var(--dv-ink); font-size: 1.5rem; font-weight: 800; }
.dv-result.is-pass .dv-result-h .dv-ic { color: var(--dv-ok-ink); }
.dv-result.is-fail .dv-result-h .dv-ic { color: var(--dv-bad-ink); }
.dv-result-h .dv-ic { width: 1.5rem; height: 1.5rem; }
.dv-result-line { margin: 0.3rem 0 0; color: var(--dv-text); }
.dv-stats--result { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-top: 1.2rem; }
.dv-stats--result > div { padding: 0.6rem 0.75rem; border-radius: 0.7rem; background: var(--dv-card-hi); }
.dv-stats--result .is-right dd { color: var(--dv-ok-ink); }
.dv-stats--result .is-wrong dd { color: var(--dv-bad-ink); }
.dv-result .dv-end-actions { justify-content: flex-start; }
.dv-bytopic { margin-top: 1rem; padding: 1.2rem 1.4rem; }
.dv-bytopic ul { display: grid; gap: 0.55rem; margin: 0.8rem 0 0; padding: 0; list-style: none; }
.dv-bytopic li { display: grid; grid-template-columns: auto minmax(0, 14rem) 1fr auto; align-items: center; gap: 0.6rem; font-size: 0.88rem; }
.dv-bytopic li > .dv-ic { color: var(--dv-accent-ink); }
.dv-bytopic-name { overflow: hidden; color: var(--dv-ink); text-overflow: ellipsis; white-space: nowrap; }
.dv-bytopic-n { color: var(--dv-muted); font-variant-numeric: tabular-nums; }
.dv-bytopic .dv-meter.is-partial > span { background: var(--dv-accent); }
.dv-mistakes-h { margin: 1.75rem 0 0.75rem; }
.dv-run .dv-stage > .dv-q + .dv-q { margin-top: 0.8rem; }

/* ── phones ── */
@media (max-width: 767px) {
  .dv-head { gap: 0.8rem; }
  .dv-head-icon { width: 2.75rem; height: 2.75rem; border-radius: 0.8rem; }
  .dv-head-icon .dv-ic { width: 1.4rem; height: 1.4rem; }
  .dv-lede { font-size: 0.92rem; }
  .dv-facts { gap: 0.4rem; margin-bottom: 1.1rem; }
  .dv-facts li { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
  .dv-progress { grid-template-columns: auto 1fr; gap: 0.9rem; padding: 1rem; }
  .dv-progress-cta { grid-column: 1 / -1; }
  .dv-stats { gap: 0.3rem 1.1rem; }
  .dv-modes { grid-template-columns: 1fr; gap: 0.6rem; }
  .dv-mode { flex-direction: row; align-items: center; gap: 0.85rem; padding: 0.95rem; }
  .dv-mode-text span { font-size: 0.82rem; }
  .dv-mode-go { display: block; }
  .dv-about-grid { grid-template-columns: 1fr; }
  .dv-topic-blurb { display: none; }
  .dv-topic-link { display: block; margin-bottom: 0.4rem; font-size: 0.93rem; }
  .dv-q { padding: 0.9rem; }
  .dv-q-head { margin-bottom: 0.5rem; }
  .dv-q-text { margin-bottom: 0.75rem; font-size: 1.02rem; }
  .dv-fig { margin-bottom: 0.75rem; padding: 0.35rem; }
  .dv-fig img { max-height: min(22vh, 12rem); }
  .dv-opts { gap: 0.4rem; }
  .dv-opt { min-height: 2.9rem; padding: 0.5rem 0.75rem; }
  /* The runner sits right under the header and keeps one compact row of chrome: the topic
     picker stands in for the page title. */
  .dv-run { margin-top: -1rem; }
  .dv-run-title { font-size: 1.05rem; }
  .dv-run-top--filter .dv-run-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .dv-select { flex: 1 1 0; min-width: 0; }
  .dv-select select { width: 100%; }
  .dv-track { margin-bottom: 0.7rem; }
  .dv-dock [data-dv-prev] span { display: none; }
  .dv-dock [data-dv-next] { min-width: 6.5rem; }
  .dv-sheet { align-items: flex-end; padding: 0; }
  .dv-sheet-panel { width: 100%; max-height: 85vh; border-radius: 1.1rem 1.1rem 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .dv-grid { grid-template-columns: repeat(auto-fill, minmax(2.5rem, 1fr)); }
  .dv-sheet-foot .dv-btn { flex: 1; }
  .dv-result-top { gap: 1rem; }
  .dv-ring { width: 5rem; height: 5rem; font-size: 1.5rem; }
  .dv-result-h { font-size: 1.25rem; }
  .dv-stats--result { grid-template-columns: 1fr 1fr; }
  .dv-bytopic { padding: 1rem; }
  .dv-bytopic li { grid-template-columns: auto minmax(0, 1fr) 4.5rem auto; }
  .dv-pager-link { max-width: none; flex: 1; }
}

/* ── light theme: the tokens (hand-tuned; doubled classes so they outrank the generated block below) ── */
html[data-theme="light"] .dv.dv {
  --dv-ink: rgb(15 23 42);
  --dv-text: rgb(51 65 85);
  --dv-muted: rgb(100 116 139);
  --dv-card: rgb(255 255 255);
  --dv-card-hi: rgb(241 245 249);
  --dv-line: rgb(15 23 42 / 0.1);
  --dv-line-hi: rgb(15 23 42 / 0.18);
  --dv-solid: rgb(255 255 255);
  --dv-accent: rgb(2 132 199);
  --dv-accent-ink: rgb(3 105 161);
  --dv-accent-soft: rgb(14 165 233 / 0.1);
  --dv-ok: rgb(5 150 105);
  --dv-ok-ink: rgb(4 120 87);
  --dv-ok-soft: rgb(16 185 129 / 0.1);
  --dv-bad: rgb(225 29 72);
  --dv-bad-ink: rgb(190 18 60);
  --dv-bad-soft: rgb(244 63 94 / 0.09);
  --dv-track: rgb(15 23 42 / 0.08);
  --dv-plate: rgb(255 255 255);
  --dv-btn-ink: rgb(255 255 255);
  --dv-shadow: 0 8px 24px -14px rgb(15 23 42 / 0.25);
}
html[data-theme="light"] .dv .dv-fig { border: 1px solid rgb(15 23 42 / 0.08); }
html[data-theme="light"] .dv .dv-mode--mock { border-color: rgb(2 132 199 / 0.35); background: linear-gradient(150deg, rgb(224 242 254), rgb(255 255 255)); }
html[data-theme="light"] .dv .dv-select select { background: rgb(255 255 255); }
html[data-theme="light"] .dv.dv-sheet { background: rgb(15 23 42 / 0.35); }

html[data-theme="light"] .dv .dv-head-icon, html[data-theme="light"] .dv .dv-badge { color: rgb(255 255 255); }
html[data-theme="light"] .dv .dv-head-icon { box-shadow: 0 8px 20px -10px rgb(2 132 199 / 0.6); }

/* ▼▼ LIGHT THEME — GENERATED by scripts/build_light_theme.py from the rules above. Do not edit by hand: run the builder. Hand tuning goes in 36-theme-light.css. ▼▼ */
html[data-theme="light"] .dv{--dv-ink:rgb(38 66 94);--dv-text:rgb(48 65 85);--dv-line:rgb(15 23 42/0.14);--dv-line-hi:rgb(15 23 42/0.18);--dv-accent-ink:rgb(0 90 133);--dv-ok-ink:rgb(16 111 73);--dv-bad-ink:rgb(133 0 16);--dv-shadow:0 10px 30px -12px rgb(0 0 0/0.21)}
html[data-theme="light"] .dv-head-icon{color:rgb(51 63 82);box-shadow:0px 8px 24px -10px rgb(15 23 42/0.2)}
html[data-theme="light"] .dv-badge{color:rgb(51 63 82)}
html[data-theme="light"] .dv-select select{background:var(--space-deep, rgb(247 247 251))}
html[data-theme="light"] .dv-sheet{background-color:rgb(250 251 252/0.6)}
html[data-theme="light"] .dv-sheet-panel{box-shadow:0px 30px 60px -20px rgb(15 23 42/0.2)}
/* ▲▲ LIGHT THEME END ▲▲ */
