/* examhunt — "highlighter & ink"
   paper:  warm off-white, easier on the eyes than pure white for long reading
   ink:    deep navy text, very high contrast
   brand:  deep ink-teal, calm and low-arousal for sustained focus
   hi:     highlighter yellow, used sparingly so it stands out (the isolation effect)
   red is deliberately kept out of the interface (it has been linked to worse test performance) */
:root {
  --bg: #f7f4ec;           /* paper */
  --surface: #fffdf7;      /* card paper */
  --ink: #13233a;
  --ink-2: #3a4a60;
  --muted: #6b7686;
  --line: #e4ddcd;
  --line-strong: #cfc6b2;
  --brand: #0e6b6b;        /* ink teal */
  --brand-dark: #0a5454;
  --brand-soft: #e2f0ec;
  --hi: #ffe066;           /* highlighter */
  --hi-soft: #fff5c7;
  --green: #2b7a4b;
  --green-soft: #e3f2e7;
  --amber: #8a5a00;
  --amber-soft: #fff1d0;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 0 rgba(19, 35, 58, .06);
  --shadow: 0 2px 0 rgba(19, 35, 58, .08);
  --offset: 4px 4px 0 var(--ink);
  --font-body: "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque", "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16.5px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
a { color: var(--brand); text-underline-offset: 3px; }
button { font: inherit; }
h1, h2, h3, .big { font-family: var(--font-display); letter-spacing: -.02em; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
mark { background: linear-gradient(transparent 52%, var(--hi) 52%, var(--hi) 92%, transparent 92%); color: inherit; padding: 0 .08em; }
::selection { background: var(--hi); }

/* ---------- header / footer ---------- */
.site-header { background: var(--bg); border-bottom: 2px solid var(--ink); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-mark { width: 34px; height: 34px; display: block; }
.logo-text, .footer-brand { font-family: var(--font-display); font-weight: 800; font-size: 23px; letter-spacing: -.035em; line-height: 1; }
.hunt { position: relative; z-index: 0; color: var(--brand); }
.hunt::after { content: ""; position: absolute; left: -2px; right: -3px; bottom: 1px; height: 8px; background: var(--hi); z-index: -1; transform: skewX(-12deg); border-radius: 2px; }
.main-nav { display: flex; gap: 2px; }
.main-nav a {
  text-decoration: none; color: var(--ink); font-weight: 700; font-size: 15px;
  padding: 8px 12px; border-radius: var(--radius-sm);
}
.main-nav a:hover { background: var(--hi-soft); }
.site-footer { background: var(--ink); color: #e9e4d8; margin-top: 72px; }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; padding-top: 34px; padding-bottom: 38px; font-size: 14px; }
.footer-inner p { margin: 8px 0 0; color: #b9c0cc; }
.footer-brand .hunt { color: var(--hi); }
.footer-brand .hunt::after { display: none; }
.footer-note { max-width: 520px; }

/* ---------- hero / home ---------- */
.hero { border-bottom: 2px solid var(--ink); background:
  repeating-linear-gradient(transparent 0 31px, rgba(19,35,58,.05) 31px 32px), var(--bg); }  /* faint exam-paper ruling */
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 48px; align-items: end; padding: 64px 24px 52px; }
.eyebrow { margin: 0 0 14px; font-family: var(--font-mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); font-weight: 700; }
.hero h1 { font-size: clamp(36px, 5.4vw, 64px); line-height: 1.02; letter-spacing: -.045em; margin: 0 0 18px; font-weight: 800; }
.hero p.lead { font-size: 18.5px; color: var(--ink-2); margin: 0 0 28px; max-width: 560px; }
.stats { margin: 0; display: grid; gap: 0; border: 2px solid var(--ink); background: var(--surface); box-shadow: var(--offset); }
.stat { padding: 16px 20px; border-bottom: 1.5px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; }
.stat:last-child { border-bottom: 0; }
.stat dt { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat dd { margin: 0; font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.search { position: relative; max-width: 560px; text-align: left; }
.search input {
  width: 100%; padding: 16px 18px 16px 48px; font: inherit; font-size: 17px; border-radius: var(--radius);
  border: 2px solid var(--ink); background: var(--surface); outline: none; box-shadow: var(--offset); transition: box-shadow .15s, transform .15s;
}
.search input:focus { box-shadow: 6px 6px 0 var(--brand); transform: translate(-1px, -1px); }
.search .search-icon { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: var(--ink); display: flex; }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 10px); background: var(--surface);
  border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--offset); overflow: hidden; z-index: 10;
}
.search-results a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a.active { background: var(--hi-soft); }
.search-results small { color: var(--muted); white-space: nowrap; }
.search-empty { padding: 14px 16px; color: var(--muted); }

/* ---------- page heading + stepper ---------- */
.page-head { padding: 30px 0 8px; }
.page-head h1 { font-size: clamp(30px, 3.6vw, 42px); line-height: 1.08; letter-spacing: -.035em; margin: 8px 0 8px; font-weight: 800; }
.page-head p { margin: 0; color: var(--ink-2); max-width: 760px; }
.stepper { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 6px; padding: 0; list-style: none; font-family: var(--font-mono); }
.stepper li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stepper li + li::before { content: "/"; color: var(--line-strong); margin-right: 0; }
.stepper .num { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 4px; display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
  background: transparent; border: 1.5px solid var(--line-strong); color: var(--muted); }
.stepper a { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink-2); }
.stepper .done .num { background: var(--ink); border-color: var(--ink); color: var(--hi); }
.stepper .done a:hover .value { background: var(--hi-soft); }
.stepper .current .num { background: var(--hi); border-color: var(--ink); color: var(--ink); }
.stepper .current .label { color: var(--ink); font-weight: 700; }
.stepper .label { display: none; }
.stepper .current .label { display: inline; }
.stepper .value { color: var(--ink); text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: 14px; font-weight: 700; }
.back-link { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; font-size: 14px; font-weight: 700; color: var(--ink); }
.back-link:hover { background: var(--hi-soft); }

/* ---------- choice cards ---------- */
.section-title { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 36px 0 12px; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin-top: 20px; }
.choice {
  position: relative; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); padding: 20px 20px 18px;
  transition: box-shadow .15s, transform .15s;
}
a.choice:hover, a.choice:focus-visible { box-shadow: var(--offset); transform: translate(-2px, -2px); outline: none; }
.choice .choice-icon {
  min-width: 42px; height: 42px; padding: 0 8px; border-radius: 8px; background: var(--hi); color: var(--ink); border: 2px solid var(--ink);
  display: inline-grid; place-items: center; justify-self: start; align-self: flex-start;
  font-family: var(--font-mono); font-weight: 700; font-size: 14px; margin-bottom: 8px;
}
.choice h3 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
.choice p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.choice .count { margin-top: auto; padding-top: 14px; font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .04em; }
.choice.disabled { opacity: .55; border-style: dashed; }
.choice.disabled .choice-icon { background: transparent; }
.topic-grid .choice p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.topic-grid .choice h3 { font-size: 19px; }

/* ---------- topic page layout ---------- */
.topic-layout { margin-top: 18px; }
/* ---------- filters: toolbar + drawer, in the style of fashion-site filters ---------- */
.toolbar { position: sticky; top: 66px; z-index: 15; display: flex; align-items: center; gap: 10px; padding: 12px 0; margin-bottom: 4px;
  background: var(--bg); border-bottom: 1.5px solid var(--line-strong); }
.tb-filter, .tb-pill, .tb-sort { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; cursor: pointer; white-space: nowrap; }
.tb-pill:hover, .tb-sort:hover { background: var(--hi-soft); }
.tb-filter { background: var(--ink); border-color: var(--ink); color: #fff; }
.tb-filter .badge { background: var(--hi); color: var(--ink); margin-left: 0; }
.tb-pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-right: 24px; }
.tb-pills::-webkit-scrollbar { display: none; }
.tb-pill.on { background: var(--hi); }
.tb-sum:not(:empty), .sort-now { padding-left: 8px; border-left: 1px solid var(--line-strong); }
.tb-sum, .sort-now { text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: 13.5px; font-weight: 700; color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.tb-pill.on .tb-sum { color: var(--ink); }
.caret { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 2px; }
.tb-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.tb-count { display: none; }
.sort-wrap { position: relative; }
.sort-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 220px; background: var(--surface); border: 2px solid var(--ink);
  border-radius: var(--radius-sm); box-shadow: var(--offset); padding: 6px 0; }
.sort-menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 11px 18px; border: 0; background: none; font: inherit; font-size: 14px; text-align: left; cursor: pointer; color: var(--ink); }
.sort-menu button:hover { background: var(--hi-soft); }
.sort-menu button[aria-checked="true"] { font-weight: 700; }
.sort-menu button[aria-checked="true"]::after { content: "✓"; margin-left: auto; }

.scrim { position: fixed; inset: 0; z-index: 59; background: rgba(19, 35, 58, .42); }
.filters { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(440px, 100vw); display: flex; flex-direction: column;
  background: var(--surface); border-left: 2px solid var(--ink); box-shadow: -10px 0 0 rgba(19,35,58,.08); transform: translateX(100%); visibility: hidden;
  transition: transform .28s cubic-bezier(.2,.7,.2,1), visibility .28s; }
.filters.open { transform: none; visibility: visible; }
.filters-head { display: flex; align-items: center; padding: 18px 26px; border-bottom: 2px solid var(--ink); background: var(--bg); }
.filters-head h2 { margin: 0; flex: 1; font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.close-filters { border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--ink); width: 36px; height: 36px; }
.filters-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 26px; }
.fgroup { border-bottom: 1px solid var(--line); }
.fgroup-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 20px 0; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; color: var(--ink); }
.ftitle { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.fsum { margin-left: auto; color: var(--muted); font-size: 13px; max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { position: relative; width: 14px; height: 14px; flex: none; }
.chev::before, .chev::after { content: ""; position: absolute; left: 1px; right: 1px; top: 6px; height: 1.5px; background: var(--ink); transition: transform .2s; }
.chev::after { transform: rotate(90deg); }
.fgroup-head[aria-expanded="true"] .chev::after { transform: rotate(0deg); }
.fgroup-body { padding: 0 0 22px; }
.fhint { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.sizes { display: grid; grid-template-columns: repeat(6, 1fr); }
.chip, .chip-btn { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 6px 10px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; user-select: none; }
.chip-btn { min-height: 42px; flex-direction: row; font-size: 13px; font-weight: 500; padding: 0 14px; }
.chip input { position: absolute; inset: 0; opacity: 0; pointer-events: none; margin: 0; }
.chip .n { color: var(--muted); font-size: 11px; font-weight: 500; }
.chip.on, .chip-btn.on { border-color: var(--ink); background: var(--hi); box-shadow: inset 0 0 0 1px var(--ink); }
.chip:focus-within, .chip-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.chip.none { opacity: .35; cursor: default; text-decoration: line-through; }
.filters .check { display: flex; align-items: center; gap: 12px; padding: 10px 0; font-size: 14.5px; cursor: pointer; color: var(--ink); }
.filters .check input { position: absolute; opacity: 0; pointer-events: none; }
.filters .check .box { width: 20px; height: 20px; flex: none; border: 2px solid var(--ink); border-radius: 4px; background: var(--surface); display: grid; place-items: center; }
.filters .check.on .box { background: var(--ink); border-color: var(--ink); }
.filters .check.on .box::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.filters .check:focus-within .box { outline: 2px solid var(--brand); outline-offset: 2px; }
.filters .check .txt { flex: 1; }
.filters .check .code { display: inline-block; min-width: 34px; font-family: var(--font-mono); font-weight: 700; font-size: 13.5px; }
.filters .check .n { color: var(--muted); font-size: 12.5px; }
.filters .check.none { opacity: .35; cursor: default; }
.explain { margin-top: 12px; font-size: 13px; }
.explain summary { color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.explain dl { margin: 10px 0 0; display: grid; grid-template-columns: 34px 1fr; gap: 6px 8px; }
.explain dt { font-weight: 700; } .explain dd { margin: 0; color: var(--muted); }
.year-range { margin-top: 12px; }
.filters-foot { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; padding: 16px 26px calc(16px + env(safe-area-inset-bottom)); border-top: 2px solid var(--ink); background: var(--bg); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; border-radius: var(--radius-sm); height: 50px; justify-content: center; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
.btn.outline { background: var(--surface); border: 2px solid var(--ink); color: var(--ink); border-radius: var(--radius-sm); height: 50px; justify-content: center; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 14px; }
.tag { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--hi); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.tag:hover { background: var(--hi-soft); }
.active-filters .link-btn { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.link-btn { border: 0; background: none; color: var(--brand); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 0; }
.badge[hidden] { display: none; }
.badge { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--ink); color: var(--hi); font-family: var(--font-mono); font-weight: 700; font-size: 12px; text-align: center; letter-spacing: 0; }
body.sheet-open { overflow: hidden; }
.check { display: flex; align-items: center; gap: 9px; padding: 4px 0; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.check .n { margin-left: auto; color: var(--muted); font-size: 12px; }
.check.none { opacity: .4; cursor: default; }
.check .hint { color: var(--muted); font-size: 12px; }
.year-range { display: flex; gap: 8px; align-items: center; font-size: 14px; }
select {
  font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
}

.results-bar {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
  background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); padding: 16px 20px;
}
.results-bar .big { font-size: 24px; font-weight: 800; line-height: 1.1; }
.results-bar .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--ink); border-radius: var(--radius-sm);
  padding: 9px 16px; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none;
  background: var(--brand); color: #fff; transition: box-shadow .15s, transform .15s, background .15s;
}
.btn:hover { box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); }
.btn.ghost { background: var(--surface); color: var(--ink); }
.btn.ghost:hover { background: var(--hi-soft); }
.btn:disabled { opacity: .5; cursor: default; }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.progress { border: 1.5px solid var(--ink); background: var(--surface); height: 10px; }
.message { margin: 10px 0 0; font-size: 14px; color: var(--amber); background: var(--amber-soft); padding: 10px 14px; border-radius: var(--radius-sm); }
.message:empty { display: none; }

/* ---------- question cards ---------- */
.block-title { display: flex; justify-content: space-between; align-items: baseline; margin: 26px 0 12px; }
.block-title h2 { font-size: 26px; margin: 0; font-weight: 800; letter-spacing: -.03em; }
.qcard { background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; margin-bottom: 22px; }
.source { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 18px; border-bottom: 2px solid var(--ink); background: var(--bg); }
.board-badge { font-family: var(--font-mono); font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 4px; background: var(--ink); color: var(--hi); letter-spacing: .02em; }
.source .where { font-weight: 600; }
.source .where span { color: var(--muted); font-weight: 500; }
.source .qnum { margin-left: auto; font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--ink); white-space: nowrap; background: var(--hi); padding: 0 8px; border-radius: 4px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 13px; }
.pill { padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--ink-2); font-size: 12.5px; font-weight: 700; border: 1px solid var(--line); }
.pill.code { font-family: var(--font-mono); background: var(--hi-soft); color: var(--ink); border-color: #f0d76a; border-radius: 4px; }
.pill.ok { background: var(--green-soft); color: var(--green); border-color: #cfe5d6; }
.pill.warn { background: var(--amber-soft); color: var(--amber); border-color: #f2dca6; }
.qimage { padding: 14px; background: #fff; }
.qimage canvas { display: block; width: 100%; height: auto; }
.qimage .loading { color: var(--muted); padding: 30px; text-align: center; }
.qfoot { display: flex; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.ms-panel { display: none; border-top: 1px solid var(--line); }
.ms-panel.open { display: block; }
.ms-panel .ms-title { padding: 12px 18px 0; font-family: var(--font-mono); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--green); }
.part-note { padding: 10px 18px; font-size: 14px; color: var(--ink); background: var(--brand-soft); border-bottom: 1px solid var(--line); }

/* ---------- table ---------- */
.table-wrap { background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); background: var(--bg); padding: 11px 14px; border-bottom: 2px solid var(--ink); }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--hi-soft); }
td .view { font-weight: 600; color: var(--brand); white-space: nowrap; }
.table-foot { padding: 12px 14px; text-align: center; border-top: 1px solid var(--line); }
.empty { background: var(--surface); border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--muted); }

/* ---------- viewer dialog ---------- */
.viewer { width: min(920px, 94vw); max-height: 90vh; padding: 0; border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: 8px 8px 0 var(--ink); }
.viewer::backdrop { background: rgba(19, 35, 58, .45); }
.viewer-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 1; }
.viewer-body { overflow: auto; max-height: calc(90vh - 60px); }
.viewer-body .qcard { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.icon-btn { border: 1.5px solid var(--ink); background: var(--surface); width: 34px; height: 34px; border-radius: 6px; cursor: pointer; font-size: 15px; color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .topic-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .viewer { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .viewer-body { max-height: calc(100dvh - 58px); }
  .page-head h1 { font-size: 25px; }
  .results-bar .actions { width: 100%; }
  .results-bar .actions .btn { width: 100%; justify-content: center; }
  .qimage { padding: 6px; }
  .stepper { display: none; }          /* the path is shown as one line under the heading instead */
  .page-head { padding-top: 18px; }
  .block-title { flex-wrap: wrap; gap: 8px; }
  .qfoot .btn { flex: 1; justify-content: center; }
  .source { padding: 12px 14px; }
  .meta, .part-note { padding-left: 14px; padding-right: 14px; }
  .container { padding: 0 16px; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 40px 16px 36px; }
  .stat { padding: 12px 16px; }
  .stat dd { font-size: 24px; }
  .logo-text { font-size: 21px; }
  .main-nav a:not(:first-child) { display: none; }
  .footer-inner { flex-direction: column; }
  .source .qnum { margin-left: 0; }
  th.hide-sm, td.hide-sm { display: none; }
}

.path { font-size: 14px; color: var(--muted); margin-top: 4px; }
section { min-width: 0; }

/* tap a question image to enlarge it (handy on phones) */
.qimage { overflow-x: auto; }
.qimage canvas { cursor: zoom-in; }
.qimage.zoomed canvas { width: 200%; max-width: none; cursor: zoom-out; }
.zoom-hint { display: none; font-size: 12px; color: var(--muted); padding: 0 18px 8px; }
@media (max-width: 640px) { .zoom-hint { display: block; } }

@media (max-width: 760px) {
  .tb-pills, .tb-count { display: none; }
  .toolbar { top: 60px; }
  .tb-right { margin-left: 0; flex: 1; }
  .sort-wrap, .tb-sort { width: 100%; }
  .tb-sort { justify-content: center; }
  .tb-filter { flex: 1; justify-content: center; }
  .sort-menu { left: auto; right: 0; }
  .filters { width: 100vw; box-shadow: none; }
  .filters-head, .filters-foot { padding-left: 20px; padding-right: 20px; }
  .filters-body { padding: 0 20px; }
  .tb-sum, .sort-now { display: none; }
}

/* A-level switch: only topics with E/R marks */
.er-switch { display: flex; align-items: center; gap: 16px; margin: 18px 0 2px; padding: 14px 18px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); max-width: 760px; transition: box-shadow .15s, transform .15s; }
.er-switch:hover { box-shadow: var(--offset); transform: translate(-2px, -2px); }
.er-switch.on { background: var(--hi); }
.switch { position: relative; flex: none; width: 50px; height: 28px; border-radius: 999px; border: 2px solid var(--ink); background: var(--surface); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); transition: transform .18s; }
.er-switch.on .switch { background: var(--ink); }
.er-switch.on .switch::after { transform: translateX(22px); background: var(--hi); }
.er-text { display: flex; flex-direction: column; gap: 2px; }
.er-text strong { font-size: 16px; }
.er-text > span { font-size: 13.5px; color: var(--ink-2); }
.er-text .code { font-family: var(--font-mono); background: var(--ink); color: var(--hi); padding: 0 6px; border-radius: 4px; font-size: 13px; }

/* ---------- home: boards ---------- */
.grid.boards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.stage-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px !important; }
.stage-tag { font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 8px; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--hi); color: var(--ink); }
.board-note { font-size: 13px; color: var(--ink-2); flex-basis: 100%; }
.grid.stages { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); max-width: 760px; }
.choice.big h3 { font-size: 30px; }

/* ---------- topics browser ---------- */
.browse-head p strong { font-family: var(--font-display); }
.browse-filters { background: var(--bg); border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 14px 16px; margin: 18px 0 26px; display: flex; flex-direction: column; gap: 10px; }
.seg-group { display: flex; align-items: center; gap: 12px; min-width: 0; }
.seg-label { flex: none; width: 108px; font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; padding: 1px; }
.seg::-webkit-scrollbar { display: none; }
.seg-btn { flex: none; display: inline-flex; align-items: center; height: 34px; padding: 0 13px; border: 1.5px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 700; white-space: nowrap; }
.seg-btn:hover { border-color: var(--ink); }
.seg-btn.on { background: var(--ink); border-color: var(--ink); color: var(--hi); }
.bf-row { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; padding-top: 4px; }
.er-switch.compact { margin: 0; padding: 8px 14px; gap: 12px; max-width: none; }
.er-switch.compact .er-text strong { font-size: 14.5px; }
.er-switch.compact .er-text > span { font-size: 12.5px; }
.er-switch.compact .switch { width: 44px; height: 24px; }
.er-switch.compact .switch::after { width: 14px; height: 14px; }
.er-switch.compact.on .switch::after { transform: translateX(20px); }
.topic-search { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border: 2px solid var(--ink);
  border-radius: var(--radius); background: var(--surface); }
.topic-search input { flex: 1; border: 0; outline: none; background: none; font: inherit; font-size: 15px; height: 40px; min-width: 0; }
.area-block { margin-bottom: 30px; }
.area-block[hidden] { display: none; }
.area-h { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; font-size: 24px; font-weight: 800; letter-spacing: -.03em;
  padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.area-h span { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.topic-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.topic-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 8px 12px 8px 14px;
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 8px; color: var(--ink); text-decoration: none;
  font-weight: 700; font-size: 15px; line-height: 1.25; transition: border-color .12s, box-shadow .12s, transform .12s; }
.topic-row:hover, .topic-row:focus-visible { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); outline: none; }
.topic-row[hidden] { display: none; }
.tyear { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; text-transform: uppercase; padding: 1px 5px; border-radius: 3px;
  background: var(--brand-soft); color: var(--brand); white-space: nowrap; vertical-align: 2px; }
.tcount { flex: none; min-width: 34px; text-align: center; font-family: var(--font-mono); font-size: 12.5px; font-weight: 700;
  padding: 3px 7px; border-radius: 999px; background: var(--hi); border: 1.5px solid var(--ink); }
@media (max-width: 640px) {
  .browse-filters { position: static; padding: 10px 12px; gap: 8px; margin: 12px 0 20px; }
  .seg-group { flex-direction: column; align-items: stretch; gap: 4px; }
  .seg-label { width: auto; }
  .topic-list { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .topic-row { min-height: 40px; padding: 6px 10px 6px 12px; font-size: 14.5px; }
  .area-h { font-size: 21px; }
  .bf-row { flex-direction: column; }
}

/* ---------- email unlock ---------- */
.lock-note { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 4px; padding: 16px 20px;
  background: var(--hi); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--offset); }
.lock-note[hidden] { display: none; }
.lock-note span { color: var(--ink-2); }
.lock-note .btn { background: var(--ink); color: #fff; }
.gate { width: min(460px, 94vw); padding: 0; border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: 8px 8px 0 var(--ink); background: var(--surface); color: var(--ink); }
.gate::backdrop { background: rgba(19, 35, 58, .5); }
.gate form { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 26px 26px 22px; }
.gate .eyebrow { margin: 0; }
.gate h2 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.035em; line-height: 1.05; }
.gate-close { position: absolute; top: 14px; right: 14px; }
.gate-why { margin: 0; color: var(--ink-2); }
.gate-why:empty { display: none; }
.gate-perks { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14.5px; }
.gate-perks li::before { content: "✓"; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 8px; border-radius: 4px; background: var(--hi); border: 1.5px solid var(--ink); font-size: 11px; font-weight: 700; }
.gate-field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; }
.gate-field input { font: inherit; font-size: 16px; padding: 12px 14px; border: 2px solid var(--ink); border-radius: var(--radius-sm); background: var(--bg); outline: none; }
.gate-field input:focus { box-shadow: 3px 3px 0 var(--brand); }
.gate-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.gate-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.gate-go { height: 50px; width: 100%; justify-content: center; }
.gate-msg { margin: 0; min-height: 1.2em; font-size: 14px; color: var(--amber); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.footer-link { color: var(--hi); }
.prose { max-width: 760px; }
.prose h2 { font-size: 22px; font-weight: 800; margin: 26px 0 6px; }
.prose ul { padding-left: 20px; }
.forget { display: flex; gap: 10px; flex-wrap: wrap; }
.forget input { flex: 1; min-width: 220px; font: inherit; padding: 10px 12px; border: 2px solid var(--ink); border-radius: var(--radius-sm); background: var(--surface); }

.locked-list { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 22px; border: 2px dashed var(--ink); border-radius: var(--radius); background: var(--surface); }
.locked-list span { color: var(--ink-2); }

/* ---------- Hikmah Tutors advert ---------- */
.promo { display: flex; align-items: center; gap: 12px; background: var(--ink); color: #f7f4ec;
  border-radius: var(--radius); padding: 14px 18px; margin: 18px 0; box-shadow: 4px 4px 0 var(--hi); }
.promo p { margin: 0; font-size: 15.5px; line-height: 1.5; }
.promo strong { color: var(--hi); font-family: var(--font-display); font-weight: 800; }
.promo-tag { flex: none; font: 700 10.5px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink); background: var(--hi); border-radius: 4px; padding: 4px 6px; }
.promo-link { color: var(--hi); font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px;
  text-underline-offset: 3px; white-space: nowrap; }
.promo-link:hover, .promo-link:focus-visible { background: var(--hi); color: var(--ink); text-decoration: none; border-radius: 3px; }
.promo.strip { border-radius: 0; box-shadow: none; margin: 0; padding: 10px 0; border-bottom: 2px solid var(--ink); }
.promo.strip .container { display: flex; align-items: center; gap: 12px; }
.promo.in-hero { max-width: 560px; margin: 0 0 22px; }
.promo.between { margin: 0 0 22px; }
@media (max-width: 640px) {
  .promo { padding: 12px 14px; align-items: flex-start; }
  .promo p { font-size: 14.5px; }
  .promo-tag { margin-top: 3px; }
  .promo.strip { padding: 9px 0; }
}
