/* Quikfire 4: the October 2026 redesign. Loaded after v30.css. Tokens first, then one section per screen. */

/* ---------- tokens (no new colour families: each one points at an existing colour) ---------- */
:root {
  --edge: #6a7aa3;                 /* card and control borders: 3:1 against the page in dark */
  --gold-ink: var(--gold);         /* gold used as text or a thin mark: darker in light */
  --paper: #fffdf6;                /* the off-white of option cards, answer boxes and the QR code: the light theme surface, never pure white */
  --seg-ok: var(--tg-teal);
  --bar-danger: var(--chart-bad);
  --seg-wrong: var(--bar-danger);
  --seg-now: var(--gold-ink);
  --opt-edge: var(--edge);
  --bar-fill: var(--chart-a);
}
:root[data-theme="light"] {
  --edge: #847b5a;
  --gold-ink: #8f6f1b;
}

/* ---------- shared bits ---------- */
.backlink { display: inline-flex; align-items: center; min-height: 44px; padding: 0; }
.sec-h { font-size: 1.3rem; margin: 26px 0 12px; }
.hero h1 { margin-top: 0; }
.hero .backlink + h1 { margin-top: 0; }

/* ---------- Quick play card (Play hub and Solo) ---------- */
.quickplay {
  display: flex; flex-direction: column; gap: 14px; margin: 6px 0 22px; padding: 20px;
  background: var(--surface-2); border: 1px solid var(--edge); border-radius: 16px;
}
.qp-t { font-family: 'Lora', Georgia, serif; font-size: 1.5rem; font-weight: 600; margin: 0 0 4px; }
.qp-s { margin: 0 0 8px; font-size: 1rem; }
.qp-last { margin: 0; font-size: .8125rem; color: var(--muted); }
.qp-act { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.qp-act .start-btn { min-height: 52px; width: 100%; }
.qp-replay { align-self: center; min-height: 44px; font-size: .9375rem; }
@media (min-width: 700px) {
  .quickplay { flex-direction: row; align-items: center; justify-content: space-between; padding: 22px 26px; }
  .qp-act { align-items: center; min-width: 200px; }
  .qp-act .start-btn { width: auto; min-width: 150px; }
}

/* ---------- Play hub cards ---------- */
.modecard { border-color: var(--edge); }
.modegrid.top { grid-template-columns: 1fr 1fr; gap: 12px; }
.modegrid.top .modecard { flex-direction: column; align-items: flex-start; justify-content: flex-start; min-height: 196px; gap: 12px; }
.modegrid.top .modecard .mt { font-size: 1.05rem; }
.modegrid.top .modecard .ms { font-size: .9rem; line-height: 1.4; }
.modegrid.wide { grid-template-columns: 1fr; margin-top: 8px; }
.modecard.wide { flex-direction: row; align-items: center; }
.codeboxes { display: flex; gap: 6px; margin-top: 12px; }
.codeboxes .cb { width: 22px; height: 30px; border: 1px solid var(--edge); border-radius: 6px; background: var(--surface-2); }

/* ---------- Solo: modules ---------- */
.courses.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; overflow: visible; -webkit-mask-image: none; mask-image: none; padding: 0; }
.courses.grid .course-card { flex: none; min-width: 0; min-height: 64px; justify-content: flex-start; border-color: var(--edge); }
.courses.grid .course-card .t { font-size: 1rem; overflow-wrap: anywhere; }
.courses.grid .course-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.courses.grid .course-card[aria-pressed="true"] { border-color: var(--gold-ink); box-shadow: inset 0 0 0 1px var(--gold-ink); }
@media (min-width: 900px) {
  .courses.grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .courses.grid .course-card:last-child:nth-child(odd) { grid-column: auto; }
}

/* ---------- Solo: Topic button and Round settings ---------- */
.topicbtn, .setbtn {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 64px; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--edge); border-radius: 14px; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.topicbtn:hover, .setbtn:hover { border-color: var(--gold-ink); }
.topicbtn.chosen { border-color: var(--gold-ink); }
.tb-txt, .sb-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tb-t, .sb-t { font-family: 'Lora', Georgia, serif; font-size: 1.1rem; font-weight: 600; }
.tb-s, .sb-s { font-size: .8125rem; color: var(--muted); line-height: 1.35; }
.tb-x, .sb-x { display: inline-flex; flex: none; width: 24px; height: 24px; color: var(--text); }
.tb-x svg, .sb-x svg { width: 24px; height: 24px; }
.setbtn.open .sb-x { transform: rotate(180deg); }
.setwrap { margin-top: 18px; }
.setbody { margin-top: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.setbody[hidden] { display: none; }
.setbody .section:last-child { margin-bottom: 0; }

/* ---------- the topic picker: a dialog on desktop, a full-screen sheet on a phone ---------- */
body.pick-open { overflow: hidden; }
.pickback { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; background: rgba(7, 11, 20, .72); }
.pickdlg { display: flex; flex-direction: column; width: min(720px, 92vw); height: min(760px, 88vh); background: var(--surface); border: 1px solid var(--edge); border-radius: 16px; overflow: hidden; color: var(--text); }
.pickhead { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 8px 18px; border-bottom: 1px solid var(--line); }
.pickhead h2 { margin: 0; font-size: 1.2rem; text-align: center; }
.pickhead .linkish { min-height: 44px; font-size: 1rem; justify-self: start; }
.pickhead #topicClear { justify-self: end; }
.pickhead #topicClear:disabled { opacity: .45; cursor: default; }
.pickctl { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.pickctl input[type="search"] { flex: 1; min-width: 0; min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--edge); background: var(--surface); color: var(--text); font: inherit; }
.pickctl .sortrow { display: flex; align-items: center; gap: 8px; font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.pickctl select { min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--edge); background: var(--surface); color: var(--text); font: inherit; }
.picklist.topics { flex: 1; max-height: none; border: 0; border-radius: 0; background: transparent; padding: 0 16px 8px; overflow: auto; }
.picklist .mod-head { color: var(--gold-ink); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.picklist .topic-row { min-height: 44px; font-size: .9375rem; align-items: center; }
.picklist .topic-row input { width: 22px; height: 22px; margin-top: 0; }
.picklist .topic-row .tt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pickbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--edge); background: var(--surface); }
.pickbar #topicDone { min-height: 48px; min-width: 120px; }
@media (max-width: 700px) {
  .pickback { align-items: stretch; background: var(--bg); }
  .pickdlg { width: 100%; height: 100%; border: 0; border-radius: 0; }
  .pickctl { flex-wrap: wrap; }
}

/* ---------- the docked "N questions match / Start round" bar ---------- */
.matchbar { align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 14px; margin: 24px -16px 0; padding: 12px 16px; background: var(--bg); border-top: 1px solid var(--edge); }
.matchbar .count { font-family: 'Lora', Georgia, serif; font-size: 1.05rem; line-height: 1.3; }
.matchbar .start-btn { min-height: 48px; white-space: nowrap; }
@media (min-width: 900px) {
  .matchbar { position: static; margin: 22px 0 0; padding: 14px 18px; background: var(--surface); border: 1px solid var(--edge); border-radius: 14px; box-shadow: 0 6px 22px rgba(0, 0, 0, .25); }
}

/* ---------- immersive rounds: nothing but the round on screen ---------- */
body.immersive .sidenav, body.immersive .tabbar, body.immersive .topline, body.immersive .hairline { display: none; }
body.immersive .main { margin-left: 0; }
body.immersive .wrap { padding-top: 14px; padding-bottom: 24px; }
.playbar { flex-wrap: nowrap; align-items: stretch; margin-bottom: 12px; }
.playbar .stat { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 44px; padding: 8px 14px; font-size: .8125rem; border: 1px solid var(--edge); border-radius: 12px; color: var(--muted); }
.playbar .pb-score { flex: 1; min-width: 0; }
.playbar .stat b { color: var(--text); }
.delta { color: var(--gold-ink); font-weight: 700; }
.streakbadge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: var(--gold); color: var(--ink); font-weight: 700; }
.streakbadge .bico { display: inline-flex; width: 14px; height: 14px; }
.streakbadge .bico svg { width: 14px; height: 14px; }
.pb-quit { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 48px; min-height: 44px; border: 1px solid var(--edge); border-radius: 12px; background: transparent; color: var(--gold-ink); cursor: pointer; }
.pb-quit svg { width: 22px; height: 22px; }

/* the clock: a number and a bar, hatched when time is short so it never relies on colour alone */
.timerwrap.clock { display: flex; align-items: center; gap: 12px; height: auto; background: transparent; overflow: visible; margin-bottom: 12px; }
.clocktxt, .timerwrap.exam .examclock { font-family: 'Lora', Georgia, serif; font-size: 1.6rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.clocktxt small, .examclock small { font-size: .75rem; font-weight: 400; }
.clocktrack { flex: 1; height: 10px; background: var(--surface-2); border: 1px solid var(--edge); border-radius: 999px; overflow: hidden; }
.timerwrap.exam .examtrack { flex: 1; height: 10px; }
.timerwrap.clock .timerbar { background: var(--gold); }
.timerwrap.clock .timerbar.danger { background: repeating-linear-gradient(135deg, var(--bar-danger) 0 5px, var(--surface-2) 5px 8px); }
.timerwrap.low .clocktxt { color: var(--bar-danger); }

/* the explanation comes first, the tags fold away under it, Next stays pinned at the bottom */
.feedback .expl { margin: 0 0 8px; font-size: 1rem; line-height: 1.55; }
.feedback .source { display: block; margin-bottom: 10px; font-size: .8125rem; opacity: .85; }
.tagsfold { background: rgba(255, 255, 255, .75); color: #121a2b; border: 1px solid rgba(18, 26, 43, .18); border-radius: 10px; margin-top: 10px; }
.tagsfold > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px; cursor: pointer; list-style: none; font-size: .8125rem; }
.tagsfold > summary::-webkit-details-marker { display: none; }
.tagsfold > summary::after { content: ''; margin-left: auto; flex: none; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.tagsfold[open] > summary::after { transform: rotate(-135deg); }
.tagsfold .k { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .75rem; opacity: .75; }
.tagsfold .v { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tagsfold .tagspanel { margin: 0 8px 8px; }
body.immersive .next-row { position: sticky; bottom: 0; z-index: 5; margin: 0 -16px; padding: 12px 16px; background: var(--bg); flex-wrap: nowrap; }
body.immersive .next-row .grow { display: none; }
body.immersive .next-row .btn { flex: 1; min-height: 52px; }
body.immersive .next-row #backBtn { flex: 0 0 auto; min-width: 104px; }
body.immersive .next-row .btn.hidden { display: none; }
.modal-box.sheet .row-gap { flex-wrap: nowrap; }
.modal-box.sheet .row-gap .btn { flex: 1; min-height: 48px; }

/* ---------- the question tracker: one slim bar, count chips, a Questions list ---------- */
.qtrack { margin: 0 0 4px; }
.qt-bar { display: flex; align-items: center; gap: 4px; width: 100%; min-height: 44px; padding: 0; background: transparent; border: 0; cursor: pointer; }
.qt-seg { flex: 1 1 0; min-width: 0; height: 14px; border: 1.5px solid var(--edge); border-radius: 5px; background: transparent; box-sizing: border-box; }
.qt-seg.s-correct { background: var(--seg-ok); border-color: var(--seg-ok); }
.qt-seg.s-wrong { border-color: var(--seg-wrong); background: repeating-linear-gradient(135deg, var(--seg-wrong) 0 2px, transparent 2px 5px); }
.qt-seg.s-skipped { border-style: dashed; border-color: var(--muted); }
.qt-seg.here { height: 22px; border: 2px solid var(--seg-now); }
.qt-bar.dense { gap: 0; padding: 0; background: var(--surface-2); border: 1.5px solid var(--edge); border-radius: 6px; min-height: 0; height: 20px; margin: 12px 0 0; overflow: hidden; }
.qt-bar.dense .qt-seg { height: 100%; border-radius: 0; border-width: 0; }
.qt-bar.dense .qt-seg.s-skipped { border: 0; background: repeating-linear-gradient(90deg, var(--muted) 0 2px, transparent 2px 4px); }
.qt-bar.dense .qt-seg.s-unseen { background: transparent; }
.qt-bar.dense .qt-seg.here { height: 100%; border: 0; box-shadow: inset 0 0 0 2px var(--seg-now); background-color: var(--seg-now); }
.qt-ticks { position: relative; height: 22px; font-size: .75rem; color: var(--muted); }
.qt-tick { position: absolute; top: 2px; transform: translateX(-50%); }
.qt-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 6px; }
.qt-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.qt-chip { display: inline-flex; align-items: center; gap: 2px; min-height: 28px; padding: 2px 12px; border: 1px solid var(--edge); border-radius: 999px; font-size: .8125rem; color: var(--text); }
.qt-chip.ok [aria-hidden] { color: var(--seg-ok); }
.qt-chip.bad [aria-hidden] { color: var(--seg-wrong); }
.qt-link { min-height: 44px; padding: 0 4px; font-size: .9375rem; }

.qgrid .qg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qgrid .qg-head h2 { margin: 0; font-size: 1.3rem; }
.qgrid .qg-head .btn { min-height: 44px; }
.qg-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; max-height: 52vh; overflow: auto; padding: 4px 2px; }
.qg-cell { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 48px; min-height: 48px; padding: 0; border: 1px solid var(--edge); border-radius: 10px; background: transparent; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.qg-cell .g { font-size: .8125rem; font-weight: 400; }
.qg-cell.s-correct { background: rgba(77, 182, 172, .16); border-color: var(--seg-ok); }
.qg-cell.s-wrong { background: repeating-linear-gradient(135deg, rgba(224, 106, 122, .22) 0 3px, transparent 3px 8px); border-color: var(--seg-wrong); }
.qg-cell.s-skipped { border-style: dashed; border-color: var(--muted); }
.qg-cell.here { box-shadow: 0 0 0 2px var(--seg-now); color: var(--gold-ink); }
.qg-key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; font-size: .8125rem; color: var(--muted); }
@media (min-width: 700px) {
  .qg-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .modal-backdrop.qg-pop-mode { background: transparent; align-items: flex-start; justify-content: center; }
  .modal-box.qg-pop { position: relative; left: min(222px, 14vw); top: 160px; width: 460px; max-width: 92vw; border: 1px solid var(--edge); box-shadow: 0 18px 48px rgba(0, 0, 0, .45); }
}

/* ---------- group: start, join, host, lobby, results ---------- */
.bigchoice { border-color: var(--edge); }
.bigchoice:first-child { border-color: var(--gold-ink); }
#join label.field-label, #host .field-label { margin-top: 14px; }
.codeinput { letter-spacing: .3em; font-size: 1.5rem; }
.quickstrip { margin: 4px 0 14px; padding: 16px 18px; background: var(--surface-2); border: 1px solid var(--edge); border-radius: 14px; }
.quickstrip .qp-t { font-size: 1.2rem; margin: 0 0 4px; }
.quickstrip .qp-s { margin: 0; font-size: .9375rem; color: var(--muted); }
#host .pill-group { margin-bottom: 4px; }
.sharerow { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 6px; }
.sharerow .btn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; }
.btn .bico, .bico { display: inline-flex; width: 18px; height: 18px; }
.btn .bico svg { width: 18px; height: 18px; }
.playerlist { list-style: none; margin: 0 0 14px; padding: 0; }
.playerlist li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); }
.rmplayer { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: transparent; color: var(--text); font-size: 1.1rem; cursor: pointer; border-radius: 10px; }
.rmplayer:hover { background: var(--surface-2); }

.winner { position: relative; overflow: hidden; margin: 6px 0 18px; padding: 16px 18px; background: var(--surface-2); border: 1px solid var(--edge); border-radius: 16px; }
.winner .wlabel { display: block; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.winner .whead { display: flex; align-items: center; gap: 8px; color: var(--gold-ink); font-family: 'Lora', Georgia, serif; font-size: 1.15rem; }
.winner .trophy { display: inline-flex; flex: none; width: 34px; height: 34px; }
.winner .trophy svg { width: 34px; height: 34px; }
.winner .spark { display: inline-flex; flex: none; width: 12px; height: 12px; }
.winner .spark svg { width: 12px; height: 12px; }
.winner .wline { margin: 10px 0 0; font-size: .9375rem; }
.winner .shine { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, .16) 50%, transparent 65%); transform: translateX(-120%); animation: wshine 2.4s ease-out .4s 1 forwards; }
.winner .spark.s1 { animation: wspark 1.6s ease-in-out .6s 2; }
.winner .spark.s2 { animation: wspark 1.6s ease-in-out 1s 2; }
@keyframes wshine { to { transform: translateX(120%); } }
@keyframes wspark { 0%, 100% { opacity: .5; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) {
  .winner .shine { display: none; animation: none; }
  .winner .spark { animation: none; opacity: 1; transform: none; }
}
#tieRule { margin-top: 8px; }
#playAgain:disabled { opacity: .55; cursor: default; }
.endbtns #playAgain { min-height: 48px; }

/* ---------- results, feedback and Progress ---------- */
.pageh { margin: 0 0 14px; font-size: 1.8rem; }
.score-hero { padding: 18px 8px 8px; }
.score-hero .score-sub { color: var(--muted); }
.chg { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .875rem; }
.chg.up { color: var(--seg-ok); }
.chg.down { color: var(--bar-danger); }
.chg.flat { color: var(--muted); }
.score-hero .chg { margin: 12px auto 0; padding: 6px 16px; border: 1px solid var(--edge); border-radius: 999px; background: var(--surface-2); color: var(--text); }
.resbtns { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 8px; }
.resbtns .btn { min-height: 52px; width: 100%; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 .btn:only-child { grid-column: 1 / -1; }

/* verdict pills, the bar with its 50 and 70 marks */
.verdict.v-base { border-style: dotted; border-color: var(--muted); color: var(--muted); }
.mxbar { position: relative; overflow: visible; height: 8px; background: var(--bar-track); border-radius: 999px; }
.mxbar i { border-radius: 999px; background: var(--bar-fill); }
.mxbar .tick { position: absolute; top: -4px; width: 2px; height: 16px; margin-left: -1px; background: var(--text-dim); border-radius: 1px; }
.fbmod summary { grid-template-areas: "name score" "bar bar" "verdict chg"; align-items: center; }
.fbmod .fbscore b { font-family: 'Lora', Georgia, serif; font-size: 1.1rem; }
.fbchg { justify-self: end; }
.fbtopics .showall, .hrows + .showall { display: block; min-height: 44px; margin: 6px 0 0; }
.howto { margin-top: 10px; }
.howto summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--gold-ink); font-size: .9375rem; }

/* Next up */
.nextup { margin: 14px 0; padding: 18px; background: var(--surface-2); border: 1px solid var(--edge); border-radius: 16px; }
.nextup .eyebrow { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.nextup h3 { margin: 6px 0 8px; font-size: 1.3rem; }
.nu-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.nu-why { margin: 0 0 14px; font-size: .9375rem; }
.nextup .btn { width: 100%; min-height: 52px; }
.nu-alt { text-align: center; margin: 10px 0 0; }
.nu-alt .linkish { min-height: 44px; }

/* the profile strip */
.profstrip { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; }
.ptile { display: flex; align-items: center; gap: 12px; min-height: 84px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--edge); border-radius: 14px; }
.ptile:not(.seen) { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; }
.ptile .pn { font-family: 'Lora', Georgia, serif; font-size: 2rem; line-height: 1.1; font-weight: 700; color: var(--gold-ink); }
.ptile .pn.sm { font-size: 1.15rem; }
.ptile .pl { font-size: .8125rem; color: var(--muted); }
.ring { --p: 0; display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 50%; background: conic-gradient(var(--bar-fill) calc(var(--p) * 1%), var(--bar-track) 0); }
.ring span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); font-size: .75rem; font-weight: 700; }
.touched, .detailsfold { margin: 0 0 14px; }
.touched summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--gold-ink); font-size: .9375rem; }
.tl { display: grid; gap: 6px; }
.tp { display: flex; justify-content: space-between; font-size: .9375rem; }
.detailsfold { background: var(--surface); border: 1px solid var(--edge); border-radius: 14px; padding: 4px 16px; }
.detailsfold > summary { display: flex; align-items: center; gap: 14px; min-height: 56px; cursor: pointer; }
.detailsbody { padding: 6px 0 16px; }

/* the radar and the module list */
.radarcard h2, #modList h2, #trendCard h2, #history h2 { margin: 0 0 6px; font-size: 1.3rem; }
.radar { display: block; width: 100%; max-width: 460px; margin: 0 auto; height: auto; font-family: inherit; }
.radar .rg { fill: none; stroke: var(--chart-grid); stroke-width: 1; }
.radar .rg.band { stroke-dasharray: 3 4; }
.radar .axis { stroke: var(--chart-grid); stroke-width: 1; }
.radar .rn { font-size: 12px; fill: var(--muted); }
.radar .rnow { fill: color-mix(in srgb, var(--bar-fill) 28%, transparent); stroke: var(--bar-fill); stroke-width: 2.5; }
.radar .rghost { fill: none; stroke: var(--chart-b); stroke-width: 2; stroke-dasharray: 6 4; }
.radar .vx { fill: var(--bar-fill); stroke: var(--surface); stroke-width: 1.5; }
.radar .vx.thin { fill: none; stroke: var(--text); stroke-width: 2.5; }
.radar .nx { fill: var(--gold-ink); stroke: var(--surface); stroke-width: 1; }
.radar .hit { cursor: pointer; outline: none; }
.radar .hit .nm { font-size: 13px; font-weight: 600; fill: var(--text); }
.radar .hit .pc { font-size: 12px; fill: var(--text-dim); }
.radar .hit .pc.none { fill: var(--muted); }
.radar .hit.sel .nm { fill: var(--gold-ink); text-decoration: underline; }
.radar .hit:focus-visible .nm { text-decoration: underline; }
.rkey { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0 0; font-size: .8125rem; color: var(--text-dim); }
.rkey span { display: inline-flex; align-items: center; gap: 6px; }
.rkey i { display: inline-block; width: 20px; height: 0; border-top: 2.5px solid var(--bar-fill); }
.rkey .k-ghost { border-top: 2px dashed var(--chart-b); }
.rkey .k-few { width: 12px; height: 12px; border: 2.5px solid var(--text); border-radius: 50%; }
.modhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.modhead h2 { margin: 0; }
.mpc { color: var(--gold-ink); }
.hrows { display: grid; gap: 0; }
.hrow { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.hr-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.hn { font-size: .9375rem; }
.hp { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; }
.hrow.unseen .hp { font-weight: 400; color: var(--muted); }
.few { display: inline-block; width: 10px; height: 10px; border: 2px solid var(--text); border-radius: 50%; }
.modcta { width: 100%; min-height: 52px; margin-top: 14px; }

/* the trend chart */
#docket .chips2 { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 10px; }
#docket .chips2 .pill { min-height: 44px; }
.pchart .band { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 5 4; }
.pchart .bandlbl { font-size: 12px; fill: var(--muted); }
.viewtable summary { min-height: 44px; display: flex; align-items: center; color: var(--gold-ink); cursor: pointer; }
.hist { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); font-size: .9375rem; }

/* the feedback header */
.fbhead .btn { min-height: 44px; }
@media (min-width: 900px) {
  .resbtns { flex-direction: row; align-items: stretch; }
  .resbtns > .btn { width: auto; flex: 1; }
  .profstrip { grid-template-columns: repeat(4, 1fr); }
}
.hrow .tier-chip { justify-self: start; }

/* ---------- topic rows lead with the past-paper record ---------- */
.picklist .topic-row .tt { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tl1 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tl1 .ttl { min-width: 0; }
.cnt { flex: none; font-weight: 700; font-size: 1rem; white-space: nowrap; }
.cnt .ap { margin-left: 2px; font-weight: 400; color: var(--muted); }
.tl2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl2.none { font-size: .8125rem; color: var(--muted); }
.tl2 .dk-cells { gap: 3px; }
.tl2 .hc { width: 14px; height: 14px; border-radius: 3px; }
.cp { font-size: .8125rem; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 0 16px 10px; font-size: .8125rem; color: var(--muted); }
.legend .dk-key { margin: 0; gap: 14px; font-size: .8125rem; }
.mod-all-l { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: .8125rem; font-weight: 700; color: var(--text); text-transform: none; letter-spacing: 0; cursor: pointer; }
.picklist .mod-head { display: flex; align-items: center; justify-content: space-between; }

/* the info sheet (bottom sheet on a phone, popover on a wide screen) */
.dk-detail .big { font-size: 1.35rem; margin: 0 0 2px; }
.dk-detail .fine, .fine { font-size: .8125rem; color: var(--muted); }
.dk-hist.large .dk-cells { gap: 5px; }
.dk-hist.large .dk-cells .hc { flex: 1; width: auto; height: 26px; border-radius: 6px; }
.dk-hist.large .dk-hl { font-size: .8125rem; }
.dk-hist.large .dk-key { font-size: .8125rem; }
.dk-count { margin: 14px 0 6px; font-size: 1rem; line-height: 1.4; }
.dk-count b { font-size: 1.15rem; }
.mf { margin: 12px 0 8px; border-top: 1px solid var(--line); }
.mf > summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.picklist .mod-head .mod-all-l input { margin: 0; }

/* ---------- wide screens: numbered squares at the top of the test page, ten to a row ---------- */
.qsq-grid { display: none; }
@media (min-width: 700px) {
  .qtrack, .qt-meta { display: none; }
  .qsq-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
  .qsq { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; padding: 0; border: 1px solid var(--edge); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
  .qsq .g { font-size: .8125rem; font-weight: 400; }
  .qsq.s-correct { background: rgba(77, 182, 172, .16); border-color: var(--seg-ok); }
  .qsq.s-wrong { background: repeating-linear-gradient(135deg, rgba(224, 106, 122, .22) 0 3px, transparent 3px 8px); border-color: var(--seg-wrong); }
  .qsq.s-skipped { background: transparent; border-style: dashed; border-color: var(--muted); }
  .qsq.here { box-shadow: 0 0 0 2px var(--seg-now); color: var(--gold-ink); }
}

/* ===== Docket page: Revise first, priority and format marks, generated summaries ===== */
/* ===== v9: Docket leads with an answer (Revise first), marks the eye can read, summary under each card ===== */
#docket .pill{min-height:44px;}
#docket h2.serif{font-size:1.15rem;margin:0 0 4px;font-weight:600;}
#docket .dk-h2{margin:22px 0 2px;}
.dk-mods{margin:14px 0 14px;}
.dk-rf{padding:14px 16px;margin-bottom:6px;}
.rf-list{list-style:none;margin:6px 0 10px;padding:0;}
.rf-row{display:grid;grid-template-columns:26px 1fr auto;gap:0 10px;align-items:center;padding:10px 0;min-height:44px;border-top:1px solid var(--line);}
.rf-n{font-weight:700;color:var(--muted);font-variant-numeric:tabular-nums;}
.rf-main{min-width:0;display:flex;flex-direction:column;gap:6px;}
.rf-t{font:inherit;font-family:'Lora',serif;font-weight:600;font-size:.98rem;color:var(--text);text-decoration:none;overflow-wrap:anywhere;background:none;border:0;padding:0;text-align:left;cursor:pointer;}
.rf-row{position:relative;}
.rf-t::after{content:"";position:absolute;inset:0;}
.rf-t:focus-visible{outline-offset:-2px;}
.rf-t:hover{text-decoration:underline;text-underline-offset:3px;}
.rf-cells{display:block;}
.rf-main .dk-cells{display:flex;gap:3px;max-width:300px;}
.rf-main .dk-cells .hc{flex:1 1 0;height:14px;max-width:26px;border-radius:3px;}
.rf-side{display:flex;flex-direction:column;align-items:flex-end;gap:2px;}
.rf-side .cnt{font-variant-numeric:tabular-nums;font-size:1.05rem;font-weight:700;white-space:nowrap;}
.rf-side .ap{font-weight:600;color:var(--muted);margin-left:2px;}
.rf-p{font-size:.78rem;color:var(--muted);white-space:nowrap;}
.rf-actions{display:flex;flex-wrap:wrap;gap:10px;margin:4px 0 6px;}
.rf-actions .btn{min-height:44px;}
.dk-sort{align-items:center;margin:8px 0 8px;}
.dk-sort .sortlbl{font-size:.82rem;color:var(--muted);margin-right:2px;}
.mx-row .mx-title{margin:0;font-size:.98rem;font-weight:600;}
.mx-row .dk-cells .hc{height:22px;}
.mx-row .dk-hl{font-size:.75rem;}
.dk-marks{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:12px 0 6px;max-width:520px;}
.mk{display:flex;flex-direction:column;gap:5px;font-size:.82rem;min-width:0;}
.mk-k{font-size:.75rem;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);}
.mk-v{color:var(--text-dim);}
.mk-v b{color:var(--text);font-size:1.05rem;font-variant-numeric:tabular-nums;}
.pbar,.fbar{display:block;height:8px;border-radius:999px;background:var(--bar-track);overflow:hidden;box-shadow:inset 0 0 0 1px var(--edge);}
.pbar i,.fbar i{display:block;height:100%;background:var(--chart-a);}
.fb-l{display:flex;justify-content:space-between;gap:8px;font-size:.78rem;color:var(--text-dim);font-variant-numeric:tabular-nums;}
.mx-chips{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 0;}
#docket .chip{display:inline-flex;align-items:center;min-height:24px;padding:0 10px;border:1px solid var(--edge);border-radius:999px;font-size:.78rem;color:var(--text-dim);}
.dk-sum{margin:10px 0 4px;font-size:.92rem;line-height:1.5;color:var(--text);max-width:68ch;}
.mx-row .mx-more summary{min-height:44px;display:flex;align-items:center;}
.mx-row .btn.sm{min-height:44px;}
.dk-more{margin:4px 0 12px;min-height:44px;}
.dk-none{margin:6px 0 4px;}
.dk-none summary{min-height:44px;display:flex;align-items:center;cursor:pointer;color:var(--accent-text);}
.dk-none ul{margin:0 0 8px;padding-left:20px;color:var(--text-dim);font-size:.9rem;}
.dk-views{margin:8px 0 6px;}
#docket :focus-visible{outline-color:var(--gold-ink);}

/* Docket page: strip, legend and figures */
/* ===== v8: Docket rows lead with N/10 and the 10-sitting strip, no tier chips, no bars ===== */
.mx-row .mx-head{align-items:baseline;flex-wrap:nowrap;margin-bottom:8px;}
.mx-row .cnt{flex:none;font-variant-numeric:tabular-nums;font-size:1.1rem;font-weight:700;color:var(--text);white-space:nowrap;}
.mx-row .cnt .ap{font-weight:600;color:var(--muted);margin-left:2px;}
.mx-row .dk-cells{display:flex;gap:4px;max-width:420px;}
.mx-row .dk-cells .hc{flex:1 1 0;height:20px;max-width:40px;border-radius:4px;}
.mx-row .dk-hl{max-width:420px;}
.mx-row .mx-more .mf{display:flex;justify-content:space-between;gap:12px;font-size:.88rem;padding:4px 0;}
.mx-row .mx-more .fine{margin:8px 0 0;font-size:.78rem;color:var(--muted);line-height:1.4;}
.dk-legend{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;font-size:.78rem;color:var(--text-dim);margin:2px 0 12px;}
.dk-legend span{display:inline-flex;align-items:center;gap:6px;}
.dk-legend .hc{width:12px;height:12px;border-radius:3px;}
.dk-legend .lg-t{color:var(--muted);}
.dk-legend .ap{font-weight:700;}

.mx-row .dk-cells .hc{height:22px;}

/* ---------- Play hub on a phone: everything on one screen, no scrolling ---------- */
@media (max-width: 699px) {
  .wrap:has(#playhub) { padding: 8px 16px calc(80px + env(safe-area-inset-bottom, 0px)); }
  .wrap:has(#playhub) .hairline { margin: 8px 0 12px; }
  .wrap:has(#playhub) > p.hint { margin-top: 10px !important; font-size: .75rem; }
  #playhub .hero h1 { font-size: 1.7rem; margin: 0 0 4px; }
  #playhub .hero p { margin: 0 0 12px; font-size: .9rem; line-height: 1.4; }
  #playhub .quickplay { gap: 8px; padding: 14px 16px; margin: 0 0 12px; }
  #playhub .qp-t { font-size: 1.3rem; margin: 0 0 2px; }
  #playhub .qp-s { margin: 0; font-size: .95rem; }
  #playhub .qp-last { margin-top: 2px; }
  #playhub .qp-act { flex-direction: row; align-items: center; gap: 10px; }
  #playhub .qp-act .start-btn { flex: 1; min-height: 48px; width: auto; }
  #playhub .qp-replay { flex: none; padding: 0 4px; }
  #playhub .modegrid { margin: 0; }
  #playhub .modegrid.top { gap: 10px; }
  #playhub .modegrid.top .modecard { display: grid; grid-template-columns: 36px 1fr; align-items: center; align-content: start; column-gap: 10px; row-gap: 6px; min-height: 0; padding: 12px; margin: 0; }
  #playhub .modegrid.top .modecard .mtxt { display: contents; }
  #playhub .modegrid.top .modecard .mico { width: 36px; height: 36px; }
  #playhub .modegrid.top .modecard .mico svg { width: 20px; height: 20px; }
  #playhub .modegrid.top .modecard .mt { grid-column: 2; }
  #playhub .modegrid.top .modecard .ms { grid-column: 1 / -1; font-size: .85rem; line-height: 1.35; }
  #playhub .modegrid.top .modecard .codeboxes { grid-column: 1 / -1; margin-top: 2px; }
  #playhub .codeboxes .cb { width: 20px; height: 26px; }
  #playhub .modegrid.wide { margin-top: 10px; }
  #playhub .modecard.wide { padding: 12px; margin: 0; gap: 12px; }
  #playhub .modecard.wide .mico { width: 36px; height: 36px; }
  #playhub .modecard.wide .ms { font-size: .85rem; line-height: 1.35; }
}
@media (max-width: 699px) and (max-height: 700px) {
  #playhub .hero p { display: none; }
  #playhub .hero h1 { font-size: 1.5rem; }
  .wrap:has(#playhub) .hairline { margin: 6px 0 8px; }
  #playhub .quickplay { margin-bottom: 10px; padding: 12px 14px; }
  #playhub .modegrid.top .modecard .ms { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  #playhub .modecard.wide .ms { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
}
@media (max-width: 699px) and (min-height: 780px) {
  .wrap:has(#playhub) { padding-top: 16px; }
  .wrap:has(#playhub) .hairline { margin: 12px 0 18px; }
  #playhub .hero h1 { font-size: 2rem; margin-bottom: 6px; }
  #playhub .hero p { margin-bottom: 18px; }
  #playhub .quickplay { gap: 12px; padding: 20px; margin-bottom: 16px; }
  #playhub .qp-t { font-size: 1.5rem; }
  #playhub .qp-act .start-btn { min-height: 52px; }
  #playhub .modegrid.top { gap: 12px; }
  #playhub .modegrid.top .modecard { padding: 16px; row-gap: 10px; }
  #playhub .modegrid.wide { margin-top: 12px; }
  #playhub .modecard.wide { padding: 16px; }
}
