/* ==========================================================================
   Exam Hall — styles. Brand-neutral: every colour comes from the tokens below,
   so a host site re-skins the hall by overriding a handful of variables.
   ========================================================================== */
:root {
  --bg: #f2f5f9;
  --surface: #ffffff;
  --surface-2: #e9eff6;
  --ink: #0a1628;
  --ink-2: #42536a;
  --ink-3: #74859a;
  --line: #d9e2ec;
  --line-strong: #bccad9;
  --brand: #0977b9;
  --brand-ink: #075f95;
  --brand-tint: #e3f1fa;
  --on-brand: #ffffff;
  --navy: #0a1628;
  --on-navy: #ffffff;
  --ok: #157f3d;
  --ok-tint: #e2f4e8;
  --bad: #b42318;
  --bad-tint: #fbe9e7;
  --warn: #b45309;
  --warn-tint: #fdf1dc;
  --mark: #6d28d9;
  --mark-tint: #efe7fd;
  --shadow: 0 1px 2px rgba(10, 22, 40, 0.05), 0 8px 24px -12px rgba(10, 22, 40, 0.18);
  --radius: 14px;
  --font-display: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #070f1c; --surface: #0e1b30; --surface-2: #14253f; --ink: #e8eef7; --ink-2: #aab9ce; --ink-3: #74869f;
    --line: #1e3150; --line-strong: #2c4468; --brand: #4db0ee; --brand-ink: #7cc6f4; --brand-tint: #10304a; --on-brand: #04121f;
    --navy: #050b15; --ok: #4ade80; --ok-tint: #0f2f20; --bad: #f87171; --bad-tint: #3a1517; --warn: #fbbf24; --warn-tint: #33260b;
    --mark: #a78bfa; --mark-tint: #241a45; --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 30px -14px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #070f1c; --surface: #0e1b30; --surface-2: #14253f; --ink: #e8eef7; --ink-2: #aab9ce; --ink-3: #74869f;
  --line: #1e3150; --line-strong: #2c4468; --brand: #4db0ee; --brand-ink: #7cc6f4; --brand-tint: #10304a; --on-brand: #04121f;
  --navy: #050b15; --ok: #4ade80; --ok-tint: #0f2f20; --bad: #f87171; --bad-tint: #3a1517; --warn: #fbbf24; --warn-tint: #33260b;
  --mark: #a78bfa; --mark-tint: #241a45; --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 30px -14px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
a { color: var(--brand-ink); }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.boot { padding: 80px 24px; text-align: center; color: var(--ink-3); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 14px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); margin-right: auto; min-width: 0; }
.brand img { height: 30px; width: auto; display: block; }
.brand .logo-dark { display: none; }
:root[data-theme='dark'] .brand .logo-light { display: none; }
:root[data-theme='dark'] .brand .logo-dark { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .brand .logo-light { display: none; } :root:not([data-theme='light']) .brand .logo-dark { display: block; } }
.brand-div { width: 1px; height: 24px; background: var(--line-strong); flex: none; }
.brand-name { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; white-space: nowrap; }
.brand-site { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; color: var(--ink); }
.toplink { font-size: 13px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.toplink:hover { color: var(--ink); }
.iconbtn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; cursor: pointer; flex: none; }
.iconbtn:hover { border-color: var(--line-strong); }
.iconbtn svg { width: 17px; height: 17px; }
@media (max-width: 560px) { .toplink { display: none; } }

/* ---------- type helpers ---------- */
.eyebrow { font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brand-ink); }
.display { font-family: var(--font-display); font-weight: 400; font-size: clamp(34px, 5.2vw, 56px); line-height: 1.04; letter-spacing: -0.01em; }
.display em { font-style: italic; color: var(--brand-ink); }
.h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(24px, 3vw, 32px); line-height: 1.12; }
.lede { color: var(--ink-2); font-size: 16.5px; max-width: 62ch; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }

/* ---------- buttons & chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; transition: transform 0.12s ease, background 0.15s, border-color 0.15s; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-ink); }
:root[data-theme='dark'] .btn-primary:hover { background: var(--brand); filter: brightness(1.1); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-quiet { background: transparent; color: var(--ink-2); padding-inline: 10px; }
.btn-quiet:hover { color: var(--ink); background: var(--surface-2); }
.btn-danger { background: var(--bad); color: #fff; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip-live { background: var(--ok-tint); color: var(--ok); }
.chip-new { background: var(--warn-tint); color: var(--warn); }
.chip-easy { background: var(--ok-tint); color: var(--ok); }
.chip-balanced { background: var(--brand-tint); color: var(--brand-ink); }
.chip-hard { background: var(--bad-tint); color: var(--bad); }
.chip-mark { background: var(--mark-tint); color: var(--mark); }

/* ---------- catalogue ---------- */
.hero { padding-block: 54px 26px; }
.hero .display { margin-top: 14px; max-width: 17ch; }
.hero .lede { margin-top: 18px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 26px; color: var(--ink-2); font-size: 13.5px; }
.hero-facts b { font-family: var(--font-mono); color: var(--ink); font-size: 15px; margin-right: 6px; }
.section { padding-block: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-exams { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.exam-card { display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: inherit; transition: border-color 0.15s, box-shadow 0.2s, transform 0.15s; }
.exam-card:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-2px); }
.exam-card .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.series { font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--brand-ink); }
.exam-card h3 { font-family: var(--font-display); font-weight: 400; font-size: 25px; line-height: 1.12; }
.exam-card p { color: var(--ink-2); font-size: 14px; }
.mini-specs { display: grid; grid-template-columns: repeat(4, auto); gap: 4px 14px; justify-content: start; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.mini-specs div { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
.mini-specs b { display: block; font-family: var(--font-mono); font-size: 15px; color: var(--ink); letter-spacing: 0; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-2); }
.card-foot .go { color: var(--brand-ink); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.steps { counter-reset: step; }
.step { position: relative; padding-left: 46px; }
.step:before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 13px; background: var(--brand-tint); color: var(--brand-ink); }
.step h4 { font-size: 15px; font-weight: 600; }
.step p { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; }
.roadmap { display: flex; flex-wrap: wrap; gap: 8px; }
.roadmap span { border: 1px dashed var(--line-strong); border-radius: 99px; padding: 6px 12px; font-size: 13px; color: var(--ink-2); }
.roadmap span b { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); margin-right: 6px; font-weight: 700; }
.footer { border-top: 1px solid var(--line); margin-top: 30px; padding-block: 24px 40px; color: var(--ink-3); font-size: 12.5px; line-height: 1.65; }
.footer p + p { margin-top: 8px; }

/* ---------- exam home ---------- */
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); text-decoration: none; margin-top: 26px; }
.crumb:hover { color: var(--ink); }
.exam-head { padding-block: 14px 8px; }
.exam-head .display { font-size: clamp(30px, 4.4vw, 46px); margin-top: 10px; max-width: 24ch; }
.exam-head .lede { margin-top: 12px; }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 22px; overflow: hidden; }
.spec { padding: 14px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.spec .l { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.spec .v { font-family: var(--font-mono); font-size: 19px; font-weight: 700; margin-top: 3px; }
.spec .v small { font-family: var(--font-ui); font-size: 12px; font-weight: 400; color: var(--ink-2); margin-left: 6px; }
.verified { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.verified a { color: var(--ink-2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 30px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 11px 13px; border: 0; background: none; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected='true'] { color: var(--brand-ink); border-bottom-color: var(--brand); }
.tab .n { font-family: var(--font-mono); font-size: 11px; background: var(--surface-2); border-radius: 99px; padding: 1px 7px; margin-left: 6px; color: var(--ink-2); }
.tabpanel { padding-block: 22px; }
.banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; background: var(--warn-tint); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); margin-bottom: 16px; font-size: 14px; }
.banner b { color: var(--ink); }
.banner .sp { margin-left: auto; display: flex; gap: 8px; }
.paper { display: flex; flex-direction: column; gap: 10px; }
.paper h3 { font-family: var(--font-display); font-weight: 400; font-size: 23px; line-height: 1.15; }
.paper p { color: var(--ink-2); font-size: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--ink-2); padding-top: 10px; border-top: 1px dashed var(--line-strong); margin-top: auto; }
.meta b { font-family: var(--font-mono); color: var(--ink); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.field { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
select, input[type='search'] { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 12px; min-width: 0; }
input[type='search'] { width: min(100%, 380px); }
.empty { text-align: center; color: var(--ink-3); padding: 34px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* syllabus + tables */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.modrow td { background: var(--brand-tint); font-weight: 600; color: var(--brand-ink); font-size: 13px; }
.bar { height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; min-width: 90px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.bar.ok i { background: var(--ok); } .bar.bad i { background: var(--bad); } .bar.warn i { background: var(--warn); }

/* key numbers */
.kgroup + .kgroup { margin-top: 22px; }
.kgroup h3 { font-size: 13px; font-family: var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.kitem { display: grid; grid-template-columns: minmax(150px, 230px) 1fr; gap: 6px 20px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.kitem:last-child { border-bottom: 0; }
.kitem .k { font-weight: 600; }
.kitem .v { font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6; }
.kitem .nn { grid-column: 2; font-size: 13px; color: var(--ink-2); }
@media (max-width: 620px) { .kitem { grid-template-columns: 1fr; } .kitem .nn { grid-column: 1; } }

/* stats */
.stat { padding: 16px 18px; }
.stat .l { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.stat .v { font-family: var(--font-mono); font-size: 26px; font-weight: 700; margin-top: 4px; line-height: 1.1; }
.stat .s { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }

/* ---------- exam hall ---------- */
/* minmax(0,1fr): without an explicit column the implicit one is `auto` and grows to its content's
   max-content width — on a phone the nowrap title and the footer buttons pushed every row past the
   viewport, leaving "Next" off-screen. */
.hall { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; background: var(--bg); z-index: 50; }
.hall-top { background: var(--navy); color: var(--on-navy); display: flex; align-items: center; gap: 14px; padding: 10px 18px; }
.hall-top img { height: 24px; width: auto; display: block; }
.hall-title { min-width: 0; margin-right: auto; }
.hall-title b { display: block; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hall-title span { font-size: 12px; color: rgba(255, 255, 255, 0.62); }
.timer { font-family: var(--font-mono); font-weight: 700; font-size: 20px; padding: 6px 14px; border-radius: 9px; background: rgba(255, 255, 255, 0.1); display: flex; align-items: center; gap: 9px; font-variant-numeric: tabular-nums; }
.timer svg { width: 16px; height: 16px; opacity: 0.8; }
.timer.warn { background: #92400e; } .timer.crit { background: #991b1b; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.72; } }
.hall-top .btn-inv { background: transparent; border: 1px solid rgba(255, 255, 255, 0.28); color: #fff; padding: 7px 12px; font-size: 13px; }
.hall-top .btn-inv:hover { background: rgba(255, 255, 255, 0.1); }
.hall-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; min-height: 0; }
.qpane { overflow-y: auto; min-height: 0; }
.qhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 2; }
.qhead .qn { font-weight: 700; font-size: 15px; }
.qhead .sp { margin-left: auto; }
.pill { font-size: 12px; border: 1px solid var(--line-strong); border-radius: 99px; padding: 2px 10px; color: var(--ink-2); background: var(--surface); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.mono { font-size: 11.5px; }
.qbody { padding: 26px 24px 40px; max-width: 860px; }
.casebox { border: 1px solid var(--line-strong); border-left: 4px solid var(--brand); background: var(--surface); border-radius: 12px; padding: 16px 18px; margin-bottom: 22px; font-size: 14.5px; line-height: 1.65; white-space: pre-line; max-height: 40vh; overflow-y: auto; }
.casebox .ct { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand-ink); font-weight: 700; display: block; margin-bottom: 6px; white-space: normal; }
.qtext { font-size: 18px; line-height: 1.55; font-weight: 500; white-space: pre-line; }
.opts { display: grid; gap: 10px; margin-top: 22px; }
.opt { display: flex; align-items: flex-start; gap: 13px; width: 100%; text-align: left; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: 15.5px; line-height: 1.5; transition: border-color 0.12s, background 0.12s; }
.opt:hover:not([disabled]) { border-color: var(--brand); }
.opt .ltr { width: 26px; height: 26px; flex: none; border-radius: 8px; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 12.5px; background: var(--surface-2); color: var(--ink-2); margin-top: -1px; }
.opt[aria-checked='true'] { border-color: var(--brand); background: var(--brand-tint); }
.opt[aria-checked='true'] .ltr { background: var(--brand); color: var(--on-brand); }
.opt.is-correct { border-color: var(--ok); background: var(--ok-tint); } .opt.is-correct .ltr { background: var(--ok); color: #fff; }
.opt.is-wrong { border-color: var(--bad); background: var(--bad-tint); } .opt.is-wrong .ltr { background: var(--bad); color: #fff; }
:root[data-theme='dark'] .opt.is-correct .ltr, :root[data-theme='dark'] .opt.is-wrong .ltr { color: #04121f; }
.opt[disabled] { cursor: default; }
.opt .tagr { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; padding-top: 3px; }
.opt.is-correct .tagr { color: var(--ok); } .opt.is-wrong .tagr { color: var(--bad); }
.explain { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14.5px; line-height: 1.6; }
.explain b { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: 4px; }
.explain a { font-size: 12.5px; }
.kbd-hint { margin-top: 26px; font-size: 12px; color: var(--ink-3); }
kbd { font-family: var(--font-mono); font-size: 11px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--surface); }
.palette { border-left: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.pal-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.pal-head h3 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend i { font-style: normal; min-width: 24px; height: 20px; padding-inline: 4px; border-radius: 6px; display: grid; place-items: center; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; }
/* legend swatch for "not visited" — its own class, NOT .pq, so that selecting
   .pq always means "a question button" (reusing .pq here caused an off-by-one). */
.legend i.lg-nv { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); }
.pal-grid { padding: 14px 16px; overflow-y: auto; display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; align-content: start; flex: 1; min-height: 0; }
.pq { aspect-ratio: 1; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--ink-2); position: relative; padding: 0; }
.pq:hover { border-color: var(--ink-3); }
.s-na { background: var(--bad); border-color: var(--bad); color: #fff; }
.s-ans { background: var(--ok); border-color: var(--ok); color: #fff; }
.s-mark { background: var(--mark); border-color: var(--mark); color: #fff; border-radius: 50%; }
.s-markans { background: var(--mark); border-color: var(--mark); color: #fff; border-radius: 50%; }
.s-markans:after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid var(--surface); }
:root[data-theme='dark'] .s-na, :root[data-theme='dark'] .s-ans, :root[data-theme='dark'] .s-mark, :root[data-theme='dark'] .s-markans { color: #04121f; }
.pq.cur { outline: 2.5px solid var(--ink); outline-offset: 2px; }
.pal-foot { padding: 14px 16px; border-top: 1px solid var(--line); }
.pal-foot .btn { width: 100%; }
.hall-foot { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-top: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.hall-foot .sp { margin-left: auto; display: flex; gap: 8px; }
.pal-toggle { display: none; }
.pal-close { display: none; }
@media (max-width: 900px) {
  .hall-body { grid-template-columns: 1fr; }
  .palette { position: fixed; inset: auto 0 0 0; max-height: 78vh; border-left: 0; border-top: 1px solid var(--line-strong); border-radius: 18px 18px 0 0; transform: translateY(105%); transition: transform 0.22s ease; z-index: 60; box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, 0.5); }
  .palette.open { transform: none; }
  .pal-grid { grid-template-columns: repeat(8, 1fr); }
  .pal-toggle { display: inline-flex; }
  .pal-close { display: inline-flex; position: absolute; right: 10px; top: 8px; }
  .pal-head { position: relative; }
  .qbody { padding: 20px 16px 30px; } .qhead { padding-inline: 16px; }
  .qtext { font-size: 16.5px; } .opt { font-size: 15px; padding: 12px 13px; }
  .hall-top { padding-inline: 12px; gap: 10px; } .hall-top img { display: none; } .timer { font-size: 17px; padding: 5px 10px; }
  .hall-foot { padding-inline: 12px; } .hall-foot .btn { padding-inline: 12px; } .hide-sm { display: none; }
}

/* ---------- result ---------- */
.verdict { border-radius: 18px; padding: 26px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; border: 1px solid var(--line); background: var(--surface); margin-top: 22px; }
.verdict.pass { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: linear-gradient(135deg, var(--ok-tint), var(--surface) 70%); }
.verdict.fail { border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: linear-gradient(135deg, var(--bad-tint), var(--surface) 70%); }
.verdict h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(28px, 4vw, 40px); line-height: 1.08; margin-top: 8px; }
.verdict p { color: var(--ink-2); margin-top: 8px; max-width: 56ch; }
.scorebig { text-align: right; font-family: var(--font-mono); font-weight: 700; font-size: clamp(38px, 6vw, 58px); line-height: 1; }
.scorebig small { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-top: 8px; font-family: var(--font-ui); }
@media (max-width: 640px) { .verdict { grid-template-columns: 1fr; } .scorebig { text-align: left; } }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filt { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 99px; padding: 6px 13px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.filt[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.rev { padding: 18px 20px; }
.rev + .rev { margin-top: 12px; }
.rev-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); margin-bottom: 10px; }
.rev-head .sp { margin-left: auto; }
.rev .qtext { font-size: 16px; }
.rev .opts { margin-top: 14px; gap: 8px; }
.rev .opt { padding: 10px 13px; font-size: 14.5px; cursor: default; }
.rev .casebox { max-height: 220px; font-size: 13.5px; }
.cta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; border-radius: 16px; padding: 22px 24px; background: var(--navy); color: #fff; margin-top: 26px; }
.cta h3 { font-family: var(--font-display); font-weight: 400; font-size: 24px; }
.cta p { color: rgba(255, 255, 255, 0.72); font-size: 14px; margin-top: 4px; max-width: 60ch; }
.cta .btn { margin-left: auto; background: #fff; color: #0a1628; }

/* ---------- dialog + toast ---------- */
.scrim { position: fixed; inset: 0; z-index: 100; background: rgba(5, 11, 21, 0.55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 18px; }
.dialog { background: var(--surface); color: var(--ink); border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.55); width: min(100%, 480px); padding: 24px; max-height: 90vh; overflow-y: auto; }
.dialog h2 { font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.15; }
.dialog p { color: var(--ink-2); margin-top: 8px; font-size: 14.5px; }
.rules { margin: 16px 0 4px; border-top: 1px solid var(--line); }
.rules div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rules b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.dialog .actions { justify-content: flex-end; margin-top: 20px; }
#toast-root { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 120; display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow); animation: toast 0.25s ease; }
@keyframes toast { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
body.embed .topbar .toplink { display: none; }

/* ---------- accounts: topbar chip + login modal ---------- */
.btn-sm { padding: 7px 14px; font-size: 13px; }
.authchip { display: inline-flex; align-items: center; gap: 10px; padding: 5px 6px 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; }
.authname { font-weight: 600; color: var(--ink); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkbtn { background: none; border: 0; color: var(--brand); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.linkbtn:hover { background: var(--brand-tint); }
.authbox { display: flex; flex-direction: column; gap: 14px; }
.auth-head { display: flex; flex-direction: column; gap: 2px; }
.auth-head b { font-size: 18px; color: var(--ink); }
.auth-head span { font-size: 12.5px; color: var(--ink-2); }
.auth-tabs { display: flex; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 12px; }
.auth-tab { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 9px; font: inherit; font-weight: 600; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.auth-tab.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.auth-f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.auth-f input { font: inherit; font-weight: 500; font-size: 15px; color: var(--ink); padding: 11px 12px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.auth-f input:focus { outline: none; border-color: var(--brand); }
.auth-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.auth-consent input { margin-top: 3px; flex: none; width: 16px; height: 16px; }
.auth-note { font-size: 13px; color: var(--ink-2); margin: 0; }
.auth-resend { display: flex; gap: 14px; }
.auth-err { background: var(--bad-tint); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.auth-dev { background: var(--warn-tint); border: 1px dashed var(--warn); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; color: var(--ink-2); font-family: var(--font-mono); }
