/* Layout: white, airy study desk. Thin header, generous whitespace, navy used sparingly for action and emphasis. */
:root {
  --bg: #ffffff;
  --soft: #f5f7fb;
  --ink: #0f1a2e;
  --muted: #647089;
  --line: #e5e9f0;
  --navy: #13254d;
  --navy-hover: #1d3a78;
  --on-navy: #ffffff;
  --tint: #edf2fb;
  --tint-ink: #1d3a78;
  --good: #1a7f52;
  --good-tint: #e5f5ed;
  --warn: #94590a;
  --warn-tint: #fcf1de;
  --bad: #b4342b;
  --focus: #3a72ee;
  --mark: #2563eb;
  --shadow: 0 1px 2px rgba(15, 26, 46, .04), 0 4px 16px rgba(15, 26, 46, .05);
  --sans: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120; --soft: #111a2d; --ink: #e8edf6; --muted: #94a0b8; --line: #1f2a40;
    --navy: #8fb1ff; --navy-hover: #adc6ff; --on-navy: #0b1120; --tint: #16233f; --tint-ink: #b4c9ff;
    --good: #52c78e; --good-tint: #10301f; --warn: #f0b45a; --warn-tint: #31240f; --bad: #ff8077; --focus: #8fb1ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.55; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
img { max-width: 100%; }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.muted { color: var(--muted); }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.code { font-family: var(--mono); font-size: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; }
kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.mark { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -0.01em; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; }
.mark svg { flex: none; }
.tabs { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.tab { border: 0; background: none; color: var(--muted); padding: 8px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; }
.tab:hover { color: var(--ink); background: var(--soft); }
.tab[aria-selected="true"] { color: var(--ink); background: var(--soft); }
.acct { border: 1px solid var(--line); background: var(--bg); padding: 7px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; }
.acct:hover { border-color: var(--navy); }
.acct.primary { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }

main { padding-block: 32px 72px; }

/* Buttons */
.btn { border: 1px solid var(--navy); background: var(--navy); color: var(--on-navy); padding: 9px 16px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover:not(:disabled) { background: var(--navy-hover); border-color: var(--navy-hover); }
.btn.ghost { background: var(--bg); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover:not(:disabled) { border-color: var(--navy); background: var(--bg); }
.btn.ghost[aria-pressed="true"] { background: var(--tint); color: var(--tint-ink); border-color: var(--tint); }
.btn.big { padding: 13px 22px; font-size: 15px; border-radius: 12px; }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn.danger { background: var(--bg); color: var(--bad); border-color: var(--line); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--tint-ink); }
.link:hover { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* Home */
.home { display: grid; gap: 72px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; padding-top: 24px; }
@media (max-width: 860px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.hero .kicker { display: inline-block; font-size: 13px; font-weight: 600; color: var(--tint-ink); background: var(--tint); padding: 4px 12px; border-radius: 999px; }
.hero h1 { margin: 16px 0 0; font-size: clamp(32px, 5vw, 52px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 800; text-wrap: balance; }
.hero p { margin: 18px 0 0; font-size: 17px; color: var(--muted); max-width: 46ch; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.stats { display: flex; gap: 36px; margin-top: 36px; }
.stats b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stats span { font-size: 13px; color: var(--muted); }
.preview { background: var(--soft); border-radius: 20px; padding: 28px; display: grid; gap: 12px; }
.preview .pcard { background: var(--bg); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); display: grid; gap: 8px; }
.preview .pline { height: 8px; border-radius: 4px; background: var(--line); }
.preview .prow { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.preview .ptag { font-family: var(--mono); font-size: 11px; color: var(--tint-ink); background: var(--tint); padding: 2px 8px; border-radius: 999px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 20px; }
.section-head h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.module { text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 20px; cursor: pointer; display: grid; gap: 6px; transition: border-color .12s, box-shadow .12s; }
.module:hover { border-color: var(--navy); box-shadow: var(--shadow); }
.module .num { font-size: 12px; font-weight: 700; color: var(--tint-ink); }
.module .name { font-size: 16px; font-weight: 700; line-height: 1.3; }
.module .meta { font-size: 13px; color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
.step b { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--tint); color: var(--tint-ink); font-size: 14px; margin-bottom: 12px; }
.step h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.step p { margin: 0; color: var(--muted); font-size: 14px; max-width: 34ch; }
.foot { border-top: 1px solid var(--line); padding-top: 20px; font-size: 13px; color: var(--muted); }

/* Practise */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.025em; }
.layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 28px; align-items: start; }
.viewer-col { min-width: 0; }
.qsearch { position: relative; margin-bottom: 14px; }
.qsearch svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted, #6b7280); pointer-events: none; }
.qsearch .search { padding-left: 36px; }
@media (max-width: 920px) { .layout { grid-template-columns: minmax(0, 1fr); } }
.rail { position: sticky; top: 84px; max-height: calc(100vh - 100px); display: flex; flex-direction: column; min-width: 0; background: var(--soft); border-radius: 14px; overflow: hidden; }
@media (max-width: 920px) { .rail { position: static; max-height: 65vh; } }
.rail-head { padding: 16px 16px 10px; display: grid; gap: 10px; }
.rail-head .row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rail-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.search { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.tools { display: flex; gap: 16px; flex-wrap: wrap; }
.tree { overflow-y: auto; padding: 4px 8px 14px; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul ul { padding-left: 14px; }
.node { display: grid; grid-template-columns: 20px 18px minmax(0, 1fr) auto; gap: 6px; align-items: start; padding: 6px 8px; border-radius: 8px; }
.node:hover { background: var(--bg); }
.caret { width: 20px; height: 20px; border: 0; background: none; padding: 0; cursor: pointer; display: grid; place-items: center; color: var(--muted); border-radius: 4px; }
.caret svg { transition: transform .12s; }
.caret[aria-expanded="true"] svg { transform: rotate(90deg); }
.node input { margin: 2px 0 0; width: 15px; height: 15px; accent-color: var(--navy); cursor: pointer; }
.node label { cursor: pointer; min-width: 0; font-size: 14px; }
.node .code { margin-right: 6px; color: var(--muted); }
.d0 > .node label { font-weight: 700; }
.d1 > .node label, .d2 > .node label { font-weight: 600; }
.d3 > .node label { font-size: 13.5px; color: var(--ink); }
.cnt { font-family: var(--mono); font-size: 11px; color: var(--muted); padding: 1px 7px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.cnt.has { background: var(--tint); color: var(--tint-ink); }
@media (prefers-reduced-motion: reduce) { .caret svg { transition: none; } }

.viewer { display: grid; gap: 16px; min-width: 0; }
.vhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.vhead h2 { margin: 0; font-size: 18px; font-weight: 700; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 14px; color: var(--muted); }
.filters select { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 14px; max-width: 260px; color: var(--ink); }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.toggle input { accent-color: var(--navy); }
.q { padding: 24px; display: grid; gap: 18px; min-width: 0; box-shadow: var(--shadow); }
.qmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.qnum { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.marks { font-size: 13px; font-weight: 600; color: var(--muted); }
.qmeta .push { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-family: var(--mono); font-size: 11px; color: var(--tint-ink); background: var(--tint); border-radius: 999px; padding: 2px 9px; cursor: help; }
.crop { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.missing { padding: 22px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; color: var(--muted); font-size: 14px; }
textarea { width: 100%; min-height: 130px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); resize: vertical; line-height: 1.55; }
textarea:focus { background: var(--bg); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.selfmark { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.selfmark select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-variant-numeric: tabular-nums; color: var(--ink); }
.reveal { display: grid; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.reveal h3 { margin: 0; font-size: 14px; font-weight: 700; }
.star { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; width: 36px; height: 36px; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.star[aria-pressed="true"] { color: var(--warn); border-color: var(--warn-tint); background: var(--warn-tint); }
.note { font-size: 13px; background: var(--warn-tint); color: var(--warn); padding: 8px 12px; border-radius: 10px; }
.foot-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.jump { display: flex; flex-wrap: wrap; gap: 5px; }
.jump button { min-width: 30px; height: 28px; padding: 0 6px; border: 0; background: var(--soft); border-radius: 7px; cursor: pointer; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.jump button.done { background: var(--good-tint); color: var(--good); }
.jump button[aria-current="true"] { background: var(--navy); color: var(--on-navy); }
.empty { padding: 56px 24px; text-align: center; display: grid; gap: 8px; justify-items: center; background: var(--soft); border: 0; }
.empty strong { font-size: 18px; font-weight: 700; }
.empty p { margin: 0; max-width: 50ch; }
.banner { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--tint); color: var(--tint-ink); border-radius: 12px; font-size: 14px; }

/* Progress */
.prog { display: grid; gap: 24px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.tile { padding: 20px; display: grid; gap: 2px; background: var(--soft); border: 0; }
.tile b { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.panel { padding: 24px; display: grid; gap: 16px; min-width: 0; }
.panel h2 { margin: 0; font-size: 18px; font-weight: 700; }
.scroll { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 12px 10px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
table.list tr:last-child td { border-bottom: 0; }
.bar-track { width: 120px; height: 6px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.bar-fill { height: 100%; background: var(--navy); border-radius: 999px; }

/* Dashboard */
.dash { display: grid; gap: 20px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field label { font-size: 13px; font-weight: 600; }
.field input[type="text"], .field input[type="number"], .field input[type="email"], .field input[type="password"] { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); width: 100%; }
.field input.invalid { border-color: var(--bad); }
input[type="file"] { font-size: 13px; max-width: 100%; }
.log { font-family: var(--mono); font-size: 12px; background: var(--soft); padding: 12px 14px; border-radius: 10px; white-space: pre-wrap; max-height: 220px; overflow: auto; }
.err { color: var(--bad); }
.ok { color: var(--good); }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.parts { display: grid; gap: 16px; }
.part { padding: 18px; display: grid; gap: 14px; border: 1px solid var(--line); border-radius: 12px; }
.part.off { opacity: .45; }
.part-head { display: grid; grid-template-columns: 110px 80px minmax(0, 1fr) auto; gap: 10px; align-items: end; }
@media (max-width: 640px) { .part-head { grid-template-columns: 1fr 1fr; } }
.part-head input[type="text"], .part-head input[type="number"] { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); width: 100%; }
.crops3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 920px) { .crops3 { grid-template-columns: minmax(0, 1fr); } }
.cell { display: grid; gap: 8px; align-content: start; min-width: 0; }
.cell .slot canvas, .cell .slot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.cell .btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill.yes, .pill.live { background: var(--good-tint); color: var(--good); }
.pill.draft { background: var(--tint); color: var(--tint-ink); }
.pill.flagged { background: var(--warn-tint); color: var(--warn); }
.status-sel { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 13px; color: var(--ink); }
.thumb { width: 160px; max-height: 70px; object-fit: cover; object-position: top left; border: 1px solid var(--line); border-radius: 6px; background: #fff; display: block; }
.pdfs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.pdfslot { background: var(--soft); border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; font-size: 14px; }

/* Dialogs */
dialog { padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); color: var(--ink); width: min(1120px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(10, 20, 45, .25); }
dialog::backdrop { background: rgba(8, 15, 35, .55); }
.ct { display: grid; grid-template-rows: auto minmax(0, 1fr); height: min(920px, calc(100vh - 34px)); }
.dlg-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.ct-body { display: grid; grid-template-columns: minmax(0, 1fr) 270px; min-height: 0; }
.ct.view .ct-body { grid-template-columns: minmax(0, 1fr); }
.ct.view .ct-side, .ct.view .crop-only { display: none !important; }
.ct:not(.view) .view-only { display: none !important; }
.ct-pages { overflow-y: auto; padding: 22px; background: var(--soft); display: grid; gap: 26px; align-content: start; }
.ct-page { position: relative; width: 100%; max-width: 860px; margin: 0 auto; background: #fff; box-shadow: 0 1px 4px rgba(10, 20, 50, .2); }
.ct-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ct-label { position: absolute; bottom: 100%; left: 0; font-size: 12px; color: var(--muted); padding-bottom: 4px; }
.ct-overlay { position: absolute; inset: 0; cursor: crosshair; }
.ct.view .ct-overlay { cursor: default; }
.ct-rect { position: absolute; border: 2px solid var(--mark); background: rgba(37, 99, 235, .12); }
.ct-rect .n { position: absolute; top: -2px; left: -2px; background: var(--mark); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.ct-rect .x { position: absolute; top: -2px; right: -2px; background: var(--mark); color: #fff; border: 0; width: 22px; height: 20px; cursor: pointer; font-size: 14px; line-height: 1; }
.ct-side { border-left: 1px solid var(--line); padding: 16px; overflow: auto; display: grid; gap: 12px; align-content: start; }
.ct-side ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.seg { display: inline-flex; background: var(--soft); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: var(--shadow); }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 800px) { .ct-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; } .ct-side { border-left: 0; border-top: 1px solid var(--line); max-height: 30vh; } }
.ed { padding: 20px; display: grid; gap: 16px; overflow: auto; max-height: calc(100vh - 110px); }

/* Sign in */
#auth-dlg { width: fit-content; }
.auth { padding: 26px; display: grid; gap: 14px; width: min(420px, calc(100vw - 32px)); }
.auth h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; font-weight: 600; }
.google:hover { border-color: var(--navy); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Polish: hero panel, quick practice, module badges, update banner, question types */
.hero { position: relative; padding: clamp(24px, 4vw, 48px); border-radius: 24px; background: radial-gradient(900px 360px at 0% 0%, var(--tint) 0%, transparent 65%), var(--soft); overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -80px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; border: 40px solid var(--tint); opacity: .6; pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.preview { background: var(--bg); box-shadow: var(--shadow); }
.preview .pcard { background: var(--soft); box-shadow: none; }

.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.qcard { text-align: left; display: grid; gap: 6px; padding: 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; }
.qcard:hover { border-color: var(--navy); box-shadow: var(--shadow); transform: translateY(-2px); }
.qicon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--navy); color: var(--on-navy); margin-bottom: 6px; }
.qtitle { font-size: 16px; font-weight: 700; }
.qsub { font-size: 13px; color: var(--muted); }

.module { grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: start; }
.module .mbadge { grid-row: span 3; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--tint); color: var(--tint-ink); font-weight: 800; font-size: 16px; }
.module:hover .mbadge { background: var(--navy); color: var(--on-navy); }

.update { display: flex; align-items: flex-start; gap: 14px; padding: 14px 18px; border-radius: 14px; background: var(--navy); color: var(--on-navy); margin-bottom: -40px; }
.update-tag { flex: none; font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, .16); padding: 3px 10px; border-radius: 999px; margin-top: 1px; }
.update-text { flex: 1; display: grid; gap: 2px; font-size: 14px; min-width: 0; }
.update-text span { opacity: .85; }
.update-x { flex: none; border: 0; background: none; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; opacity: .7; padding: 0 2px; }
.update-x:hover { opacity: 1; }

.page-head > div:first-child { display: grid; gap: 2px; }
.seg.big button { padding: 8px 14px; font-size: 14px; }
.pill.type-maths { background: #e6f0ff; color: #1d4fb8; }
.pill.type-extended { background: #f1e8ff; color: #6a35b8; }
@media (prefers-color-scheme: dark) {
  .pill.type-maths { background: #16284a; color: #9cc0ff; }
  .pill.type-extended { background: #2a1d44; color: #c8a8ff; }
}
.q { border-radius: 18px; }
@media (prefers-reduced-motion: reduce) { .qcard { transition: none; } .qcard:hover { transform: none; } }

/* ---------- Depth: soft shadows on buttons, cards and controls ---------- */
:root {
  --sh-xs: 0 1px 2px rgba(15, 26, 46, .06);
  --sh-sm: 0 1px 2px rgba(15, 26, 46, .06), 0 2px 6px rgba(15, 26, 46, .06);
  --sh-md: 0 2px 4px rgba(15, 26, 46, .05), 0 8px 24px rgba(15, 26, 46, .08);
  --sh-lg: 0 4px 8px rgba(15, 26, 46, .06), 0 18px 44px rgba(15, 26, 46, .12);
  --sh-navy: 0 1px 2px rgba(19, 37, 77, .25), 0 4px 12px rgba(19, 37, 77, .22);
  --tree: "Inter", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --sh-xs: 0 1px 2px rgba(0,0,0,.4); --sh-sm: 0 1px 3px rgba(0,0,0,.45); --sh-md: 0 6px 20px rgba(0,0,0,.45); --sh-lg: 0 16px 44px rgba(0,0,0,.55); --sh-navy: 0 4px 14px rgba(0,0,0,.45); }
}
.btn { box-shadow: var(--sh-navy); transition: background .12s, border-color .12s, box-shadow .15s, transform .15s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(19, 37, 77, .25), 0 8px 20px rgba(19, 37, 77, .25); }
.btn:active:not(:disabled) { transform: translateY(0); box-shadow: var(--sh-xs); }
.btn.ghost, .btn.danger { box-shadow: var(--sh-sm); }
.btn.ghost:hover:not(:disabled), .btn.danger:hover:not(:disabled) { box-shadow: var(--sh-md); }
.btn.danger:hover:not(:disabled) { border-color: var(--bad); }
.btn.ghost[aria-pressed="true"] { box-shadow: inset 0 1px 2px rgba(19, 37, 77, .12); }
.btn:disabled { box-shadow: none; }
.btn.light { background: #fff; color: #13254d; border-color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }
.btn.light:hover:not(:disabled) { background: #f1f5ff; border-color: #f1f5ff; }
.acct { box-shadow: var(--sh-sm); transition: box-shadow .15s, border-color .12s; }
.acct.primary { box-shadow: var(--sh-navy); }
.top { box-shadow: 0 1px 0 var(--line), 0 6px 20px rgba(15, 26, 46, .04); border-bottom-color: transparent; }
.tab[aria-selected="true"] { background: var(--bg); box-shadow: var(--sh-sm), inset 0 0 0 1px var(--line); }
.card { box-shadow: var(--sh-xs); }
.panel, .q { box-shadow: var(--sh-md); }
.module, .qcard { box-shadow: var(--sh-sm); }
.module:hover, .qcard:hover { box-shadow: var(--sh-lg); transform: translateY(-2px); }
.module { transition: border-color .12s, box-shadow .15s, transform .15s; }
.qicon { box-shadow: var(--sh-navy); }
.tile { background: var(--bg); border: 1px solid var(--line); box-shadow: var(--sh-sm); }
.star, .selfmark select, .filters select, .search, .status-sel { box-shadow: var(--sh-xs); }
.search:focus, .field input:focus, textarea:focus, select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.jump button { transition: transform .1s; }
.jump button:hover { transform: translateY(-1px); }
.jump button[aria-current="true"] { box-shadow: var(--sh-navy); }
.update { box-shadow: var(--sh-lg); }
.empty { box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .btn, .module, .jump button { transition: none; } .btn:hover:not(:disabled), .module:hover, .qcard:hover { transform: none; } }

/* ---------- Specification tree: cleaner, sleeker type ---------- */
.rail { background: var(--bg); border: 1px solid var(--line); box-shadow: var(--sh-md); border-radius: 16px; }
.rail-head { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.rail-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tree { font-family: var(--tree); padding: 8px 8px 14px; -webkit-font-smoothing: antialiased; }
.tree ul ul { padding-left: 12px; margin-left: 9px; border-left: 1px solid var(--line); }
.node { padding: 5px 8px; gap: 8px; border-radius: 8px; transition: background .1s; }
.node:hover { background: var(--soft); }
.node label { font-size: 13.5px; line-height: 1.45; letter-spacing: -0.006em; font-weight: 400; color: var(--ink); }
.node .code { font-family: var(--tree); font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 8px; }
.d0 > .node { padding-block: 9px; }
.d0 > .node label { font-weight: 600; font-size: 14.5px; letter-spacing: -0.012em; }
.d0 > .node .code { display: block; margin: 0 0 1px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; }
.d1 > .node label { font-weight: 500; font-size: 14px; }
.d2 > .node label { font-weight: 500; }
.d3 > .node label { font-size: 13px; color: color-mix(in srgb, var(--ink) 78%, var(--muted)); }
.d3 > .node .code { color: var(--tint-ink); font-weight: 600; }
.node:has(input:checked) > label .code { color: var(--tint-ink); }

/* Practise page: use more of wide screens, with a roomier spec tree. */
#view-practise { max-width: 1520px; }
#view-practise .layout { grid-template-columns: clamp(340px, 31vw, 460px) minmax(0, 1fr); gap: 32px; }
@media (max-width: 920px) { #view-practise .layout { grid-template-columns: minmax(0, 1fr); } }
#view-practise .rail { height: calc(100vh - 100px); max-height: none; }
@media (max-width: 920px) { #view-practise .rail { height: auto; max-height: 70vh; } }
.tree { padding: 10px 10px 18px; }
.node { padding: 7px 10px; }
.node label { font-size: 14.5px; }
.d0 > .node label { font-size: 15.5px; }
.d1 > .node label { font-size: 15px; }
.d3 > .node label { font-size: 14px; }
.node .code { font-size: 12.5px; }
.rail-head { padding: 18px 18px 14px; }

/* ---------- Topic heatmap ---------- */
:root { --h-high: #1a9a5f; --h-high-t: #e3f6ec; --h-mid: #d08a12; --h-mid-t: #fdf1dc; --h-low: #d0473c; --h-low-t: #fde8e6; --h-none-t: #eef1f6; }
@media (prefers-color-scheme: dark) { :root { --h-high: #4fd08f; --h-high-t: #123524; --h-mid: #f3b34f; --h-mid-t: #3a2a10; --h-low: #ff8a80; --h-low-t: #3d1a18; --h-none-t: #1a2336; } }
.heat-toggle { font-size: 13px; font-weight: 500; margin-left: auto; }
.cnt.heat { font-weight: 600; min-width: 40px; text-align: center; }
.cnt.h-high { background: var(--h-high-t); color: var(--h-high); }
.cnt.h-mid { background: var(--h-mid-t); color: var(--h-mid); }
.cnt.h-low { background: var(--h-low-t); color: var(--h-low); }
.cnt.h-none { color: var(--muted); }
.hm { display: grid; gap: 22px; }
.hm-mod h3 { margin: 0 0 10px; font-size: 14px; font-weight: 700; display: flex; gap: 10px; align-items: baseline; }
.hm-mod h3 span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.hm-cell { display: grid; gap: 2px; padding: 10px 8px; border-radius: 10px; border: 0; cursor: pointer; text-align: left; font-family: var(--tree); transition: transform .12s, box-shadow .12s; box-shadow: var(--sh-xs); }
.hm-cell b { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hm-cell span { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hm-cell:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--sh-md); }
.hm-cell.h-high { background: var(--h-high); color: #fff; }
.hm-cell.h-mid { background: var(--h-mid); color: #fff; }
.hm-cell.h-low { background: var(--h-low); color: #fff; }
.hm-cell.h-none { background: var(--h-none-t); color: var(--ink); }
.hm-cell.h-empty { background: transparent; border: 1px dashed var(--line); color: var(--muted); box-shadow: none; cursor: default; }
@media (prefers-color-scheme: dark) { .hm-cell.h-high, .hm-cell.h-mid, .hm-cell.h-low { color: #0b1120; } }
.hm-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.hm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hm-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.hm-legend .h-high { background: var(--h-high); } .hm-legend .h-mid { background: var(--h-mid); } .hm-legend .h-low { background: var(--h-low); } .hm-legend .h-none { background: var(--h-none-t); border: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .hm-cell { transition: none; } .hm-cell:hover:not(:disabled) { transform: none; } }

/* ---------- Wider pages and a fuller hero ---------- */
.wrap { max-width: 1440px; }
.hero { min-height: min(680px, calc(100vh - 150px)); padding: clamp(28px, 5vw, 72px); grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 80px);
  background: radial-gradient(1100px 480px at 0% 0%, var(--tint) 0%, transparent 65%), radial-gradient(700px 420px at 100% 100%, color-mix(in srgb, var(--tint) 70%, transparent) 0%, transparent 70%), var(--soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 60%, transparent), var(--sh-md); }
@media (max-width: 860px) { .hero { min-height: 0; } }
.hero h1 { font-size: clamp(36px, 5.6vw, 68px); }
.hero p { font-size: 18px; max-width: 52ch; }
.hero .preview { padding: 32px; gap: 14px; box-shadow: var(--sh-lg); transform: rotate(-1deg); }
.hero .preview .pcard { padding: 18px 20px; }

/* Depth on headings: a soft lift under the letters. */
.hero h1, .help-hero h1, .page-head h1, .prof-id h1 {
  text-shadow: 0 1px 0 rgba(255, 255, 255, .7), 0 2px 3px rgba(19, 37, 77, .14), 0 10px 28px rgba(19, 37, 77, .16);
}
.section-head h2, .stats b, .qnum, .tile b {
  text-shadow: 0 1px 2px rgba(19, 37, 77, .12), 0 6px 16px rgba(19, 37, 77, .10);
}
.cta-band h2 { text-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
@media (prefers-color-scheme: dark) {
  .hero h1, .help-hero h1, .page-head h1, .prof-id h1 { text-shadow: 0 2px 4px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .45); }
  .section-head h2, .stats b, .qnum, .tile b { text-shadow: 0 2px 8px rgba(0, 0, 0, .45); }
}
@media (prefers-reduced-motion: reduce) { .hero .preview { transform: none; } }

/* ---------- Home page update types ---------- */
.update { align-items: center; }
.update-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .14); }
.update.k-news { background: linear-gradient(135deg, #136c45, #1a8a57); color: #fff; }
.update.k-warning { background: linear-gradient(135deg, #8f1d17, #b4291f); color: #ffe08a; box-shadow: 0 10px 30px rgba(143, 29, 23, .3); }
.update.k-warning .update-icon { background: #ffd24d; color: #8f1d17; }
.update.k-warning .update-text strong { color: #ffe08a; }
.update.k-warning .update-text span { color: #fff1c7; opacity: .95; }
.update.k-warning .update-tag { background: rgba(255, 210, 77, .2); color: #ffe08a; }
@media (prefers-color-scheme: dark) {
  .update.k-announcement { background: #1b2f5e; color: #fff; }
}
.up-kinds { display: flex; flex-wrap: wrap; gap: 8px; }
.up-kinds label { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 600; box-shadow: var(--sh-xs); transition: border-color .12s, box-shadow .12s; }
.up-kinds input { position: absolute; opacity: 0; pointer-events: none; }
.up-kinds label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.up-ico { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; }
.k-announcement .up-ico { background: #13254d; }
.k-news .up-ico { background: #1a8a57; }
.k-warning .up-ico { background: #b4291f; color: #ffd24d; }
.up-kinds .k-announcement:has(input:checked) { border-color: #13254d; box-shadow: 0 0 0 3px rgba(19, 37, 77, .15); }
.up-kinds .k-news:has(input:checked) { border-color: #1a8a57; box-shadow: 0 0 0 3px rgba(26, 138, 87, .18); }
.up-kinds .k-warning:has(input:checked) { border-color: #b4291f; box-shadow: 0 0 0 3px rgba(180, 41, 31, .18); }
.pill.up-pill.k-announcement { background: var(--tint); color: var(--tint-ink); }
.pill.up-pill.k-news { background: var(--good-tint); color: var(--good); }
.pill.up-pill.k-warning { background: #fde8e6; color: #b4291f; }

/* ---------- Account button and profile ---------- */
.acct { display: inline-flex; align-items: center; gap: 8px; }
.acct:not(.primary) { padding-left: 5px; }
.acct[aria-current="true"] { border-color: var(--navy); }
.avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: var(--on-navy); font-size: 12px; font-weight: 800; flex: none; }
.avatar.big { width: 64px; height: 64px; font-size: 26px; box-shadow: var(--sh-navy); }
.profile { display: grid; gap: 20px; }
.prof-head { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 24px; box-shadow: var(--sh-md); background: radial-gradient(700px 240px at 0% 0%, var(--tint) 0%, transparent 70%), var(--bg); }
.prof-id { flex: 1; min-width: 200px; display: grid; gap: 2px; }
.prof-id h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.pf-name { flex-basis: 100%; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pf-name .input { max-width: 320px; }
.prof-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.goal { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ring { --p: 0; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--navy) calc(var(--p) * 1%), var(--soft) 0); flex: none; }
.ring > div { width: 104px; height: 104px; border-radius: 50%; background: var(--bg); display: grid; place-content: center; text-align: center; box-shadow: inset 0 1px 3px rgba(15, 26, 46, .08); }
.ring b { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ring span { font-size: 12px; color: var(--muted); }
.goal .hint { flex: 1; min-width: 160px; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; height: 170px; }
.bar-col { display: grid; grid-template-rows: 18px minmax(0, 1fr) 20px; justify-items: center; gap: 4px; }
.bar-val { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.bar-stick { width: 100%; max-width: 34px; background: var(--soft); border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; }
.bar-stick > div { width: 100%; background: color-mix(in srgb, var(--navy) 55%, var(--soft)); border-radius: 8px; }
.bar-stick > div.hit { background: var(--good); }
.bar-col.today .bar-stick > div:not(.hit) { background: var(--navy); }
.bar-day { font-size: 12px; font-weight: 600; color: var(--muted); }
.bar-col.today .bar-day { color: var(--ink); }
.sw { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sw b { font-variant-numeric: tabular-nums; }
.settings { display: grid; }
.settings > div { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.settings > div:last-child { border-bottom: 0; }
.settings > div > span:first-child { color: var(--muted); min-width: 130px; }
.node input { width: 15px; height: 15px; margin-top: 3px; }
.cnt { font-family: var(--tree); font-size: 11px; font-weight: 500; margin-top: 2px; }
.caret { margin-top: 1px; }
.caret:hover { background: var(--soft); color: var(--ink); }

/* ---------- Question card extras ---------- */
.zoomable { position: relative; }
.zoomable .crop { cursor: zoom-in; }
.enlarge { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer; box-shadow: var(--sh-md); opacity: .85; transition: opacity .12s, transform .12s; }
.zoomable:hover .enlarge, .enlarge:focus-visible { opacity: 1; }
.enlarge:hover { transform: translateY(-1px); }
.timer { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 11px; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; cursor: pointer; font-family: var(--mono); font-size: 12.5px; color: var(--muted); box-shadow: var(--sh-xs); font-variant-numeric: tabular-nums; }
.timer[aria-pressed="true"] { color: var(--tint-ink); border-color: var(--tint); background: var(--tint); }
.timer.over { color: var(--warn); background: var(--warn-tint); border-color: var(--warn-tint); }
.qfoot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; padding-top: 14px; border-top: 1px solid var(--line); }
.link.quiet { color: var(--muted); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.link.quiet:hover { color: var(--bad); }
.keys { font-size: 12px; color: var(--muted); }
.keys kbd { margin: 0 1px; }
@media (max-width: 700px) { .keys { display: none; } }
.banner.redo { background: var(--warn-tint); color: var(--warn); }

/* ---------- Enlarged image viewer ---------- */
#zoom-dlg { width: calc(100vw - 24px); max-width: none; height: calc(100vh - 24px); max-height: none; }
.zm { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
.zm-stage { position: relative; overflow: auto; background: var(--soft); padding: 24px; cursor: grab; overscroll-behavior: contain; }
.zm-stage.dragging { cursor: grabbing; user-select: none; }
.zm-stage img { display: block; margin: 0 auto; max-width: none; height: auto; background: #fff; border-radius: 8px; box-shadow: var(--sh-lg); -webkit-user-drag: none; user-select: none; }
.zm-ctrl { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: var(--sh-xs); }
.zm-ctrl button { border: 0; background: var(--bg); width: 34px; height: 32px; font-size: 18px; cursor: pointer; color: var(--ink); }
.zm-ctrl button:hover { background: var(--soft); }
.zm-ctrl span { min-width: 54px; text-align: center; font-family: var(--mono); font-size: 12px; color: var(--muted); border-inline: 1px solid var(--line); line-height: 32px; }
.zm-tip { margin: 0; padding: 8px 18px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); text-align: center; }
@media (max-width: 700px) { .zm-tip { display: none; } }

/* ---------- Small dialogs ---------- */
#report-dlg { width: fit-content; }
.reasons { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }
.reasons label { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 14px; transition: border-color .12s, background .12s; }
.reasons label:hover { border-color: var(--navy); }
.reasons label:has(input:checked) { border-color: var(--navy); background: var(--tint); color: var(--tint-ink); }
.reasons input { accent-color: var(--navy); margin: 0; }

/* ---------- Tab badge ---------- */
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; vertical-align: 1px; }

/* ---------- Home call-to-action band ---------- */
.cta-band { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; padding: clamp(24px, 4vw, 40px); border-radius: 24px; background: linear-gradient(135deg, #13254d, #1f3f86); color: #fff; box-shadow: var(--sh-lg); }
.cta-band h2 { margin: 0; font-size: clamp(20px, 3vw, 26px); font-weight: 800; letter-spacing: -0.02em; }
.cta-band p { margin: 6px 0 0; opacity: .82; }

/* ---------- Help & forum ---------- */
.help { display: grid; gap: 36px; }
.help-hero { padding: clamp(24px, 4vw, 44px); border-radius: 24px; background: radial-gradient(800px 300px at 0% 0%, var(--tint) 0%, transparent 65%), var(--soft); }
.help-hero .kicker { display: inline-block; font-size: 13px; font-weight: 600; color: var(--tint-ink); background: var(--bg); padding: 4px 12px; border-radius: 999px; box-shadow: var(--sh-xs); }
.help-hero h1 { margin: 14px 0 0; font-size: clamp(28px, 4.4vw, 44px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 800; }
.help-hero p { margin: 14px 0 0; color: var(--muted); font-size: 16px; max-width: 58ch; }
.help-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
@media (max-width: 960px) { .help-grid { grid-template-columns: minmax(0, 1fr); } .ask-col { order: -1; } }
.help-main { display: grid; gap: 40px; min-width: 0; }
.ask-col { position: sticky; top: 84px; display: grid; gap: 16px; }
@media (max-width: 960px) { .ask-col { position: static; } }
.ask-form { display: grid; gap: 12px; }
.ask-signin { display: grid; gap: 12px; justify-items: start; }
.input, .field select { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); width: 100%; color: var(--ink); }
.faqs { display: grid; gap: 10px; }
.faq { border: 1px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: var(--sh-xs); transition: box-shadow .15s; }
.faq[open] { box-shadow: var(--sh-md); }
.faq summary { list-style: none; cursor: pointer; padding: 16px 18px; font-weight: 600; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--tint-ink); font-weight: 700; transition: transform .15s; }
.faq[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 0; padding: 0 18px 18px; color: var(--muted); white-space: pre-wrap; }
.posts { display: grid; gap: 14px; }
.post { padding: 20px; display: grid; gap: 10px; box-shadow: var(--sh-sm); }
.post h3, .fq-item h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.post-body { margin: 0; color: var(--muted); font-size: 14px; white-space: pre-wrap; }
.answer { border-left: 3px solid var(--navy); background: var(--soft); border-radius: 0 10px 10px 0; padding: 12px 14px; display: grid; gap: 4px; }
.answer-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--tint-ink); }
.answer p { margin: 0; white-space: pre-wrap; font-size: 14.5px; }
.pill.cat-biology { background: var(--good-tint); color: var(--good); }
.pill.cat-revision { background: #f1e8ff; color: #6a35b8; }
.pill.cat-site { background: var(--tint); color: var(--tint-ink); }
@media (prefers-color-scheme: dark) { .pill.cat-revision { background: #2a1d44; color: #c8a8ff; } }
.mypost { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mypost:last-child { border-bottom: 0; padding-bottom: 0; }
.mypost:first-child { padding-top: 0; }
.mp-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ---------- Dashboard: forum, FAQs, reports ---------- */
.fq { display: grid; gap: 14px; }
.fq-item { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.fq-item textarea { min-height: 90px; }
.faq-edit { display: grid; gap: 12px; }
.faq-row { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.faq-row textarea, .faq-row input { background: var(--bg); }
tr.done-row td { opacity: .55; }

/* ---------- Animations ---------- */
@property --p { syntax: "<number>"; inherits: true; initial-value: 0; }
@keyframes rise-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes tile-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes line-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes grow-up { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes grow-right { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ring-fill { from { --p: 0; } }
@keyframes cell-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes star-pop { 0% { transform: scale(1); } 40% { transform: scale(1.3) rotate(-8deg); } 100% { transform: scale(1); } }
@keyframes banner-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  /* Home: hero text, then the preview tiles fade in one by one and their lines draw across.
     Timings are deliberately unhurried so people notice them. */
  .intro .hero > div:first-child > * { animation: rise-in 1s cubic-bezier(.2, .7, .2, 1) backwards; }
  .intro .hero > div:first-child > :nth-child(2) { animation-delay: .15s; }
  .intro .hero > div:first-child > :nth-child(3) { animation-delay: .3s; }
  .intro .hero > div:first-child > :nth-child(4) { animation-delay: .45s; }
  .intro .hero > div:first-child > :nth-child(5) { animation-delay: .6s; }
  .intro .hero .preview { animation: fade-in .9s ease-out .2s backwards; }
  .intro .preview .pcard { animation: tile-in 1s cubic-bezier(.2, .7, .2, 1) backwards; }
  .intro .preview .pcard:nth-child(1) { animation-delay: .6s; }
  .intro .preview .pcard:nth-child(2) { animation-delay: 1.05s; }
  .intro .preview .pcard:nth-child(3) { animation-delay: 1.5s; }
  .intro .preview .pcard:nth-child(4) { animation-delay: 1.95s; }
  .intro .preview .pline { transform-origin: left; animation: line-in 1s cubic-bezier(.3, .7, .2, 1) backwards; }
  .intro .preview .pcard:nth-child(1) .pline { animation-delay: 1s; }
  .intro .preview .pcard:nth-child(2) .pline { animation-delay: 1.45s; }
  .intro .preview .pcard:nth-child(3) .pline { animation-delay: 1.9s; }
  .intro .preview .pcard:nth-child(4) .pline { animation-delay: 2.35s; }
  .intro .preview .pill, .intro .preview .ptag { animation: pop-in .6s cubic-bezier(.2, .7, .2, 1) backwards; }
  .intro .preview .pcard:nth-child(1) .ptag { animation-delay: 1.2s; }
  .intro .preview .pcard:nth-child(3) .pill { animation-delay: 2.1s; }
  .intro .preview .pcard:nth-child(4) .pill { animation-delay: 2.55s; }
  .intro .update { animation: banner-in .8s ease-out backwards; }

  /* Home: each block rises in only when it scrolls into view; cards inside follow one by one */
  .rise { opacity: 0; transform: translateY(32px); }
  .rise.risen { opacity: 1; transform: none; transition: opacity 1s ease-out, transform 1s cubic-bezier(.2, .7, .2, 1); }
  .rise.risen:not(.settled) > :is(.qcard, .module, .flow-step) { animation: rise-in .9s cubic-bezier(.2, .7, .2, 1) backwards; }
  .rise.risen:not(.settled) > :nth-child(2) { animation-delay: .15s; }
  .rise.risen:not(.settled) > :nth-child(3) { animation-delay: .3s; }
  .rise.risen:not(.settled) > :nth-child(4) { animation-delay: .45s; }
  .rise.risen:not(.settled) > :nth-child(5) { animation-delay: .6s; }
  .rise.risen:not(.settled) > :nth-child(6) { animation-delay: .75s; }
  .flow.rise.risen:not(.settled)::before { animation: line-in 2s cubic-bezier(.3, .7, .2, 1) .2s backwards; }
  /* Every page eases in when you switch tabs */
  #view-practise, #view-progress, #view-help, #view-dash, #view-profile { animation: rise-in .4s cubic-bezier(.2, .7, .2, 1); }

  /* Practise: new question slides up, mark scheme and report open smoothly, stars pop */
  .q.enter { animation: rise-in .4s cubic-bezier(.2, .7, .2, 1); }
  .reveal:not([hidden]) { animation: rise-in .35s cubic-bezier(.2, .7, .2, 1); }
  .star[aria-pressed="true"] svg { animation: star-pop .35s ease-out; }
  .jump button[aria-current="true"] { animation: fade-in .25s; }

  /* Dialogs pop open over a fading backdrop */
  dialog[open] { animation: pop-in .25s cubic-bezier(.2, .7, .2, 1); }
  dialog[open]::backdrop { animation: fade-in .25s ease-out; }

  /* Progress and profile: bars grow, heatmap squares appear in a wave, the goal ring fills */
  .bar-fill { transform-origin: left; animation: grow-right .8s cubic-bezier(.2, .7, .2, 1) backwards .1s; }
  .hm-cell { animation: cell-in .4s cubic-bezier(.2, .7, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 12ms); }
  .tile, .prof-grid > .panel { animation: rise-in .5s cubic-bezier(.2, .7, .2, 1) backwards; }
  .tiles .tile:nth-child(2), .prof-grid > .panel:nth-child(2) { animation-delay: .06s; }
  .tiles .tile:nth-child(3) { animation-delay: .12s; }
  .tiles .tile:nth-child(4) { animation-delay: .18s; }
  .ring { animation: ring-fill 1.2s cubic-bezier(.3, .7, .2, 1) .2s backwards; }
  .bar-stick > div { transform-origin: bottom; animation: grow-up .8s cubic-bezier(.2, .7, .2, 1) backwards; }
  .bar-col:nth-child(2) .bar-stick > div { animation-delay: .05s; }
  .bar-col:nth-child(3) .bar-stick > div { animation-delay: .1s; }
  .bar-col:nth-child(4) .bar-stick > div { animation-delay: .15s; }
  .bar-col:nth-child(5) .bar-stick > div { animation-delay: .2s; }
  .bar-col:nth-child(6) .bar-stick > div { animation-delay: .25s; }
  .bar-col:nth-child(7) .bar-stick > div { animation-delay: .3s; }

  /* Help: FAQ answers slide open, forum posts rise in */
  .faq[open] p { animation: rise-in .3s ease-out; }
  .post { animation: rise-in .45s cubic-bezier(.2, .7, .2, 1) backwards; }
  .post:nth-child(2) { animation-delay: .05s; } .post:nth-child(3) { animation-delay: .1s; } .post:nth-child(4) { animation-delay: .15s; }
}

/* Rolling number dials */
.stats b { display: flex; }
.stats .dial, .stats .dial span { font-size: inherit; color: inherit; }
.dial { display: inline-block; height: 1.15em; line-height: 1.15em; overflow: hidden; vertical-align: top; }
.dial-strip { display: flex; flex-direction: column; transition: transform 2.2s cubic-bezier(.16, .9, .24, 1); }
.dial-strip > span { height: 1.15em; text-align: center; }

.preview .pill.flagged { font-size: 11px; }

/* ---------- Synapse Revision brand ---------- */
.mark { gap: 10px; }
.mark .logo { flex: none; filter: drop-shadow(0 2px 6px rgba(19, 37, 77, .25)); }
.brand { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; color: var(--ink); }
.brand span { font-weight: 600; color: var(--tint-ink); margin-left: 4px; }
@keyframes cross-gap { 0% { transform: translateX(-1.6px); opacity: 0; } 30% { opacity: 1; } 75% { opacity: 1; } 100% { transform: translateX(1.6px); opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .logo .nt { animation: cross-gap 2.4s ease-in-out infinite; }
  .logo .nt2 { animation-delay: 1.2s; }
}

/* ---------- Download as PDF ---------- */
.pdf-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
#pdf-dlg { width: fit-content; }
.pdf-plan { display: grid; gap: 8px; padding: 12px 14px; background: var(--soft); border-radius: 12px; font-size: 14px; }
.pdf-plan div { display: flex; gap: 10px; align-items: flex-start; }
.pdf-plan b { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: var(--on-navy); font-size: 12px; }
.pdf-progress { display: grid; gap: 6px; }
.pdf-progress .bar-fill { transition: width .3s ease-out; animation: none; }


/* ---------- Privacy page ---------- */
.legal-body { max-width: 860px; margin: 0 auto; }
.legal-body .kicker { display: inline-block; font-size: 13px; font-weight: 600; color: var(--tint-ink); background: var(--tint); padding: 4px 12px; border-radius: 999px; }
.legal-body h1 { margin: 14px 0 10px; font-size: clamp(30px, 4.4vw, 44px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 800; }
.legal-body .lead { font-size: 18px; color: var(--ink); margin: 0 0 6px; }
.legal-body h2 { margin: 36px 0 10px; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.legal-body p, .legal-body li { color: color-mix(in srgb, var(--ink) 82%, var(--muted)); font-size: 15.5px; }
.legal-body ul { padding-left: 20px; display: grid; gap: 6px; }
.legal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.legal-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: var(--bg); box-shadow: var(--sh-sm); }
.legal-card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.legal-card p, .legal-card li { font-size: 14px; margin: 0; }
.foot a, .auth a { color: var(--tint-ink); font-weight: 600; }

/* ---------- Delete account ---------- */
.danger-zone { border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }
.danger-zone .eyebrow { color: var(--bad); }
.del-form { display: grid; gap: 8px; }
.del-form label { font-size: 14px; }

/* ---------- Spec tag evidence (review, editor, re-check) ---------- */
.tagx-wrap { min-width: 0; }
.tagx { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tagx li { border: 1px solid var(--line); border-left: 4px solid var(--good); border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; font-size: 13px; background: var(--bg); }
.tagx li.conf-medium { border-left-color: var(--warn); }
.tagx li.conf-low { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 6%, var(--bg)); }
.tagx li.conf-manual { border-left-color: var(--tint-ink); }
.tagx-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tagx-role { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tagx-conf { font-size: 11px; }
.conf-high .tagx-conf { background: var(--good-tint); color: var(--good); }
.conf-medium .tagx-conf { background: var(--warn-tint); color: var(--warn); }
.conf-low .tagx-conf { background: color-mix(in srgb, var(--bad) 14%, var(--bg)); color: var(--bad); }
.tagx-name { color: var(--ink); font-weight: 500; }
.tagx-ev { color: var(--muted); }
.tagx-ev b { color: var(--ink); font-weight: 600; margin-right: 4px; }
.tagx-none { margin: 0; font-size: 13px; color: var(--bad); }
.part.needs-check { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 10%, transparent); }
.rt-list { display: grid; gap: 12px; }
.rt-item { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.rt-item.changed { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.rt-item.needs-check { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: color-mix(in srgb, var(--bad) 4%, var(--bg)); }
.rt-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.rt-num { font-size: 16px; min-width: 70px; }
.rt-cmp { flex: 1; min-width: 220px; display: grid; gap: 4px; font-size: 13px; }
.rt-cmp .eyebrow { display: inline-block; min-width: 72px; }

/* ---------- Essay plans ---------- */
.plan { display: grid; gap: 10px; padding: 14px; background: var(--soft); border-radius: 12px; }
.plan-box { display: grid; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.plan-over { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.plan-top { display: flex; align-items: center; gap: 8px; }
.plan-label { font-size: 13px; font-weight: 600; }
.plan-btns { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.plan-grip { cursor: grab; color: var(--muted); letter-spacing: -2px; padding: 2px 4px; user-select: none; }
.plan-grip:active { cursor: grabbing; }
.plan-text { min-height: 56px; field-sizing: content; }
@media (pointer: coarse) { .plan-grip { display: none; } }

/* ---------- Saved answers and drafts ---------- */
.ans-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill.done-pill { background: var(--good-tint); color: var(--good); }
.ans-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: -8px; }
.ans-status { font-size: 12.5px; color: var(--muted); }
.ans-status.ok { color: var(--good); }
.ans-status.err { color: var(--bad); }
.drafts { display: grid; gap: 8px; padding: 12px; background: var(--soft); border-radius: 12px; max-height: 340px; overflow-y: auto; }
.draft { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.draft-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.draft-text { margin: 0; font-size: 14px; white-space: pre-wrap; max-height: 120px; overflow-y: auto; }
.jump button.answered { background: var(--tint); color: var(--tint-ink); box-shadow: inset 0 -2px 0 var(--tint-ink); }
/* Your answers: compact rows in a box that scrolls, so a long history doesn't stretch the page. More rows load as you scroll. */
.ya-list { display: grid; gap: 6px; align-content: start; max-height: 460px; overflow-y: auto; overscroll-behavior: contain; padding: 2px 6px 2px 2px; scrollbar-gutter: stable; }
.ya-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.ya-row:hover { border-color: var(--navy); box-shadow: var(--sh-sm); }
.ya-q { display: flex; gap: 8px; align-items: baseline; font-size: 12px; min-width: 0; }
.ya-q b { font-size: 14px; flex: none; }
.ya-q .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ya-text { font-size: 13px; color: color-mix(in srgb, var(--ink) 80%, var(--muted)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ya-meta { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; justify-content: flex-end; font-size: 12px; white-space: nowrap; }
.ya-count { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
@media (max-width: 700px) { .ya-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; } .ya-text { grid-column: 1 / -1; grid-row: 2; } .ya-list { max-height: 60vh; } }

/* ---------- How it works: five stops on one straight journey line ---------- */
.how { padding: clamp(28px, 4.5vw, 56px); border-radius: 28px; position: relative; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--sh-md);
  background:
    radial-gradient(520px 260px at 0% 0%, rgba(42, 79, 158, .08), transparent 70%),
    radial-gradient(520px 260px at 100% 100%, rgba(31, 164, 99, .08), transparent 70%),
    var(--bg); }
.journey { margin-top: 24px; }
.flow { --icon: 56px; list-style: none; margin: 0; padding: 0; position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }
/* The line runs through the middle of every icon, from the first stop to the last. */
.flow::before { content: ""; position: absolute; top: calc(var(--icon) / 2 - 3px); left: 10%; right: 10%; height: 6px; border-radius: 3px; transform-origin: left;
  background: linear-gradient(90deg, #2a4f9e, #6d5ae6, #0f9488, #e09a1c, #1fa463); opacity: .85; }
.flow-step { --c: #2a4f9e; position: relative; display: grid; grid-template-rows: var(--icon) auto; justify-items: center; row-gap: 14px; text-align: center; }
.flow-step:nth-child(2) { --c: #6d5ae6; }
.flow-step:nth-child(3) { --c: #0f9488; }
.flow-step:nth-child(4) { --c: #e09a1c; }
.flow-step:nth-child(5) { --c: #1fa463; }
.flow-icon { position: relative; z-index: 1; width: var(--icon); height: var(--icon); border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--c);
  box-shadow: 0 0 0 6px var(--bg), 0 8px 20px color-mix(in srgb, var(--c) 40%, transparent); transition: transform .2s; }
.flow-step:hover .flow-icon { transform: scale(1.08); }
.flow-body { align-self: stretch; width: 100%; display: grid; gap: 6px; align-content: start; padding: 18px 16px 20px; border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 16px; background: var(--bg);
  box-shadow: 0 2px 4px rgba(15, 26, 46, .04), 0 10px 26px rgba(15, 26, 46, .07); transition: transform .2s, box-shadow .2s; }
.flow-step:hover .flow-body { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(15, 26, 46, .05), 0 18px 40px color-mix(in srgb, var(--c) 18%, transparent); }
.flow-num { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c); }
.flow-num::before { content: "Step "; }
.flow-step h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.flow-step p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
/* Narrower screens: the line runs down the left with each stop beside its card. */
@media (max-width: 900px) {
  .flow { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .flow::before { top: 20px; bottom: 20px; left: calc(var(--icon) / 2 - 3px); right: auto; width: 6px; height: auto; background: linear-gradient(180deg, #2a4f9e, #6d5ae6, #0f9488, #e09a1c, #1fa463); transform-origin: top; }
  .flow-step { grid-template-rows: none; grid-template-columns: var(--icon) minmax(0, 1fr); column-gap: 16px; align-items: center; text-align: left; justify-items: start; }
  .flow-body { border-top: 1px solid var(--line); border-left: 3px solid var(--c); }
}
@media (prefers-reduced-motion: reduce) { .flow-icon, .flow-body { transition: none; } .flow-step:hover .flow-icon, .flow-step:hover .flow-body { transform: none; } }

/* ---------- Phone header: logo and account on one row, tabs scroll sideways underneath ---------- */
@media (max-width: 760px) {
  .top .wrap { min-height: 0; gap: 0 10px; padding-top: 8px; flex-wrap: wrap; }
  .mark { gap: 8px; }
  .mark .logo { width: 26px; height: 26px; }
  .brand { font-size: 16px; }
  .acct { margin-left: auto; padding: 5px 12px; font-size: 13px; }
  .acct:not(.primary) { padding-left: 4px; }
  .avatar { width: 22px; height: 22px; font-size: 11px; }
  .tabs { order: 3; flex: 1 0 100%; margin: 6px calc(-1 * max(20px, env(safe-area-inset-left, 0px))) 0; padding: 0 max(20px, env(safe-area-inset-left, 0px)) 8px;
    flex-wrap: nowrap; gap: 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%); }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; padding: 6px 11px; font-size: 13.5px; white-space: nowrap; }
  main { padding-block: 20px 56px; }
}
@media (max-width: 760px) {
  .update { flex-wrap: wrap; gap: 10px 12px; padding: 14px 16px; margin-bottom: -20px; }
  .update-text { order: 3; flex: 1 0 100%; }
  .update-x { margin-left: auto; }
  .home { gap: 48px; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding: 28px 22px; gap: 28px; }
  .hero h1 { font-size: clamp(32px, 9vw, 44px); }
  .hero p { font-size: 16px; }
  .hero .preview { transform: none; padding: 18px; max-width: 460px; width: 100%; justify-self: center; }
  .hero .kicker { font-size: 12px; }
  .stats { gap: 28px; }
}

/* Biology / Geography switch in the header: two sites on one address */
.subj { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); margin-left: -8px; }
.subj-opt { padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; line-height: 1.2; white-space: nowrap; }
a.subj-opt:hover { color: var(--ink); background: color-mix(in srgb, var(--line) 60%, transparent); }
a.subj-opt:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.subj-opt[aria-current="page"] { background: var(--navy); color: var(--on-navy); box-shadow: var(--sh-navy, none); }
.subj-short { display: none; }
@media (max-width: 760px) {
  .subj { margin-left: 2px; padding: 2px; }
  .subj-opt { padding: 4px 9px; font-size: 12px; }
}
@media (max-width: 440px) {
  .subj-full { display: none; }
  .subj-short { display: inline; }
  .subj { margin-left: 0; }
  .subj-opt { padding: 3px 7px; }
  .top .wrap { gap: 0 8px; }
  .acct { padding: 5px 10px; }
}

/* Rotating the enlarged image: the box takes the rotated size, the image turns inside it */
.zm-box { position: relative; margin: 0 auto; }
.zm-stage .zm-box img { position: absolute; left: 50%; top: 50%; margin: 0; transform-origin: center; }

/* Review card for a question that is already in the bank (variant papers repeat questions) */
.dupe-note { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--warn-tint); color: var(--warn); font-size: 13px; font-weight: 600; }

/* Free account pitch: dialog, locked question card, free-questions bar and home section */
.lock { vertical-align: -1px; margin-right: 5px; flex: none; }
.pitch { position: relative; padding: 30px; display: grid; gap: 14px; width: min(560px, calc(100vw - 32px)); }
.pitch h2, .locked-body h2, .home-pitch h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.pitch-x { position: absolute; top: 18px; right: 20px; }
.pitch-badge { justify-self: start; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--tint-ink); background: var(--tint); padding: 4px 10px; border-radius: 999px; }
.pitch-lead { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.pitch-list { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 12px; }
.pitch-list li { display: flex; gap: 12px; align-items: flex-start; }
.pitch-list .tick { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: var(--on-navy); margin-top: 1px; }
.pitch-list b { display: block; font-size: 14.5px; }
.pitch-list span:not(.tick) { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.pitch-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.pitch-foot { margin: 0; font-size: 13px; color: var(--muted); }
.locked { position: relative; overflow: hidden; }
.locked-art { padding: 26px 26px 0; display: grid; gap: 10px; filter: blur(2px); opacity: .55; }
.locked-art .pline { height: 10px; border-radius: 5px; background: var(--line); }
.locked-body { padding: 22px 26px 26px; display: grid; gap: 12px; }
.locked-body p { margin: 0; }
.free-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 16px; margin-bottom: 14px; background: var(--tint); color: var(--tint-ink); border-radius: 12px; font-size: 14px; }
.home-pitch { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 28px; padding: 30px; align-items: start; }
.home-pitch > div { display: grid; gap: 12px; }
.home-pitch p { margin: 0; }
@media (max-width: 860px) { .home-pitch { grid-template-columns: minmax(0, 1fr); padding: 22px; } .pitch { padding: 24px 20px; } }

/* ---------- sign-up details ---------- */
#auth-dlg.wide .auth { width: min(500px, calc(100vw - 32px)); }
#auth-dlg, #details-dlg { max-height: calc(100dvh - 24px); overflow: auto; }
#details-dlg .auth { width: min(500px, calc(100vw - 32px)); }
#f-names, .details-more, #dt-fields { display: grid; gap: 14px; }
#f-names[hidden], .details-more[hidden] { display: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field input[type="tel"] { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); width: 100%; }
.field input[type="tel"]:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.opt { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.4; cursor: pointer; }
.check input { margin-top: 2px; width: 16px; height: 16px; flex: none; accent-color: var(--navy); }
@media (max-width: 480px) { .two { grid-template-columns: 1fr; } }

/* ---------- students (admin) ---------- */
.st-tiles { margin: 4px 0 14px; }
.st-tiles .tile b { font-size: 24px; }
.st-scroll { max-height: 460px; overflow: auto; }
tr.st-on td { background: var(--soft); }
.st-detail { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 18px; }
.st-detail[hidden] { display: none; }
.st-head { display: flex; align-items: center; gap: 16px; }
.st-head h2 { margin: 2px 0 0; }
.st-head .btn { margin-left: auto; }
.st-info { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 18px; margin: 0; }
.st-info dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.st-info dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.st-info a { color: var(--tint-ink); }
.st-block h3 { margin: 0 0 10px; font-size: 15px; font-weight: 700; }
.st-bars { grid-template-columns: repeat(14, 1fr); gap: 6px; height: 140px; }
.st-hm .hm-cell { cursor: default; }
.st-hm .hm-cell:hover { transform: none; box-shadow: var(--sh-xs); }
.st-act { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--bg); }
.st-act summary { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; padding: 10px 14px; cursor: pointer; font-size: 14px; }
.st-act[open] summary { border-bottom: 1px solid var(--line); }
.st-ans { padding: 12px 14px 4px; white-space: pre-wrap; font-size: 14px; line-height: 1.5; }
.st-act .hint { padding: 0 14px 12px; }

/* ---------- Question of the day slides (admin): full-screen 9:16 slides to screenshot for TikTok ---------- */
/* Everything inside a slide is sized in cqw/cqh (the slide's own width/height), so a slide looks identical as a small preview and full screen. */
html.qd-open, html.qd-open body { overflow: hidden; }
.qd { position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow-y: auto; overscroll-behavior: contain; }
.qd-setup-in { max-width: 560px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(40px, env(safe-area-inset-bottom, 0px)); display: grid; gap: 16px; }
.qd-setup-in > h1 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.qd-sh { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qd-sh .link { font-size: 15px; padding: 6px 0; }
.qd-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qd-setup input, .qd-setup select { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 16px; }
.qd-pick { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 12px; background: var(--soft); }
.qd-pick > div:first-child { display: grid; gap: 3px; }
.qd-pick .hint { margin: 0; }
.qd-warn { color: var(--warn); }
.qd-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.qd-thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x mandatory; }
.qd-thumb { flex: none; padding: 0; border: 0; background: none; cursor: pointer; scroll-snap-align: start; display: grid; gap: 4px; justify-items: center; color: var(--muted); font-size: 12px; font-weight: 600; }
.qd-thumb .qd-frame { width: 140px; border-radius: 12px; box-shadow: 0 1px 2px rgba(15, 26, 46, .08), 0 6px 18px rgba(15, 26, 46, .12); }
#qd-start { width: 100%; }
.qd-stage { position: fixed; inset: 0; z-index: 70; background: var(--qd-bg); display: grid; place-items: center; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.qd-stage .qd-frame { width: min(100vw, calc(100vh * 9 / 16)); width: min(100vw, calc(100dvh * 9 / 16)); background: none; }
.qd-frame { position: relative; aspect-ratio: 9 / 16; container-type: size; overflow: hidden; background: var(--qd-bg); color: var(--qd-ink); font-family: var(--sans); text-align: left; line-height: 1.25; }
.qd-frame svg { display: block; }
.qd-frame img { pointer-events: none; }
.qd-slide { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 5cqw; padding: 10cqw 11cqw 11cqh; }
.qd-deco { position: absolute; color: var(--qd-acc); opacity: .17; }
.qd-deco svg { width: 100%; height: auto; }
.qd-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 3cqw; }
.qd-mark { display: flex; align-items: center; gap: 2.4cqw; font-weight: 800; font-size: 4.6cqw; letter-spacing: -0.02em; white-space: nowrap; }
.qd-mark svg { width: 8.6cqw; height: 8.6cqw; flex: none; }
.qd-mark b { color: var(--qd-acc); font-weight: 800; }
.qd-pill { font-size: 3.4cqw; font-weight: 800; padding: 1.5cqw 3.2cqw; border-radius: 99px; background: var(--qd-chip); white-space: nowrap; }
.qd-mid { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 4.2cqw; }
.qd-badge { width: 19cqw; height: 19cqw; border-radius: 6cqw; display: grid; place-items: center; background: var(--qd-acc); color: var(--qd-on-acc); }
.qd-badge svg { width: 10.5cqw; height: 10.5cqw; }
.qd-kicker { margin: 0; font-size: 3.7cqw; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--qd-acc); }
.qd-hook { margin: 0; font-size: 10.6cqw; line-height: 1.04; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
.qd-hook-sm { font-size: 8.6cqw; }
.qd-tags { display: flex; flex-wrap: wrap; gap: 2cqw; }
.qd-tag { font-size: 3.6cqw; font-weight: 700; padding: 1.7cqw 3.3cqw; border-radius: 99px; background: var(--qd-chip); }
.qd-sub { margin: 0; font-size: 4.3cqw; line-height: 1.4; font-weight: 500; color: var(--qd-soft); }
.qd-cue { position: relative; align-self: flex-start; display: flex; align-items: center; gap: 2.4cqw; padding: 3.2cqw 5.4cqw; border-radius: 99px; background: var(--qd-ink); color: var(--qd-on-ink); font-weight: 800; font-size: 4.4cqw; }
.qd-cue svg { width: 5.2cqw; height: 5.2cqw; }
.qd-foot { margin: 0; display: flex; align-items: center; gap: 2.6cqw; font-size: 4.1cqw; font-weight: 700; line-height: 1.3; }
.qd-foot svg { width: 6cqw; height: 6cqw; flex: none; color: var(--qd-acc); }
.qd-biglogo svg { width: 17cqw; height: 17cqw; }
.qd-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.6cqw; }
.qd-feats li { display: flex; align-items: center; gap: 3cqw; font-size: 4.2cqw; font-weight: 700; }
.qd-feats span { width: 9.6cqw; height: 9.6cqw; flex: none; display: grid; place-items: center; border-radius: 3cqw; background: var(--qd-chip); color: var(--qd-acc); }
.qd-feats svg { width: 5.4cqw; height: 5.4cqw; }
.qd-url { padding: 3.6cqw 4cqw; border-radius: 4cqw; background: var(--qd-ink); color: var(--qd-on-ink); font-size: 4.1cqw; font-weight: 800; text-align: center; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.qd-cta { margin: 0; text-align: center; font-size: 4.2cqw; font-weight: 800; color: var(--qd-acc); }
.qd-crop { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 10px; }
.qd-crop[open] { gap: 12px; }
.qd-crop summary { cursor: pointer; font-weight: 700; font-size: 15px; }
.qd-crop .hint { margin: 0; }
.qd-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.qd-seg .btn[aria-pressed="true"], .qd-seg .btn[aria-pressed="true"]:hover { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }
.qd-range { display: grid; grid-template-columns: 56px 1fr 44px; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.qd-setup .qd-range input { padding: 0; border: 0; accent-color: var(--navy); }
.qd-range output { font-variant-numeric: tabular-nums; text-align: right; color: var(--muted); }
.qd-crop .link { justify-self: start; font-size: 14px; }
/* Question, mark scheme and report slides: the image fills the slide; the words are small labels.
   The bottom stays clear for TikTok's caption, which covers roughly the lowest tenth of the screen. */
.qd-slide-img { gap: 2.6cqw; padding: 10cqw 6.5cqw 12cqh; }
.qd-slide-img .qd-top { padding: 0 4cqw; }
.qd-hook-xs { margin: 1cqw 4cqw 0; font-size: 6.2cqw; line-height: 1.1; font-weight: 800; letter-spacing: -0.025em; text-wrap: balance; }
.qd-line { display: flex; align-items: center; justify-content: space-between; gap: 3cqw; padding: 0 4cqw; }
.qd-line .qd-kicker { font-size: 3.4cqw; }
.qd-chip { flex: none; font-size: 3.3cqw; font-weight: 800; padding: 1.2cqw 2.8cqw; border-radius: 99px; background: var(--qd-acc); color: var(--qd-on-acc); }
.qd-imgbox { position: relative; flex: 1; min-height: 0; container-type: size; display: flex; align-items: center; justify-content: center; }
.qd-card { box-sizing: border-box; max-width: 100cqw; max-height: 100cqh; display: flex; padding: 2.4cqw; border-radius: 3.6cqw; background: #ffffff; box-shadow: 0 1.5cqw 6cqw rgba(0, 0, 0, .2); }
.qd-card img { display: block; width: auto; height: auto; max-width: calc(100cqw - 4.8cqw); max-height: calc(100cqh - 4.8cqw); object-fit: contain; }
.qd-src { margin: 0; padding: 0 4cqw; font-size: 3cqw; font-weight: 600; color: var(--qd-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qd-slide-img .qd-foot { padding: 0 4cqw; font-size: 3.7cqw; }
.qd-slide-img .qd-foot svg { width: 5cqw; height: 5cqw; }
.qd-check { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.qd-setup .qd-check input { width: 20px; height: 20px; flex: none; accent-color: var(--navy); }
/* A mark scheme split in two: each half gets a label, with clear space between them. Sizes are of the image box. */
.qd-split { display: flex; flex-direction: column; align-items: center; max-width: 100cqw; }
.qd-part { align-self: stretch; margin: 0 0 1.6cqw; padding: 0 3cqw; display: flex; align-items: center; gap: 1.6cqw; font-size: 3.6cqw; font-weight: 800; letter-spacing: .02em; color: var(--qd-ink); }
.qd-part svg { width: 4.4cqw; height: 4.4cqw; flex: none; color: var(--qd-acc); }
.qd-part span { font-weight: 600; letter-spacing: 0; color: var(--qd-soft); }
.qd-part-2 { margin-top: 6cqw; }
.qd-split .qd-card img { max-height: calc((100cqh - 26cqw) / 2); }
.qd-post { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 12px; }
.qd-post.done { background: var(--soft); }
.qd-post p { margin: 0; display: grid; gap: 3px; }
.qd-post p b { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.qd-post svg { width: 20px; height: 20px; color: var(--good, #16774b); }
.qd-post .btn { width: 100%; }
.qd-post .link { justify-self: start; font-size: 14px; }
.qd-log ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 360px; overflow-y: auto; }
.qd-log li button { width: 100%; display: grid; grid-template-columns: 58px 1fr; gap: 2px 10px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.qd-log li button span { color: var(--muted); }
.qd-log li button em { grid-column: 2; font-style: normal; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.qd-log li.done button { background: var(--soft); }
.qd-log li.done em { color: var(--ink); font-weight: 600; }
.qd-log svg { width: 15px; height: 15px; flex: none; color: var(--good, #16774b); }
.qd-log li.on button { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }

/* ---------- Marked questions: green for the marks you got, red for the marks you dropped ---------- */
:root { --bad-tint: #fbe7e4; }
@media (prefers-color-scheme: dark) { :root { --bad-tint: #3b1714; } }
.jump button.scored:not([aria-current="true"]) {
  background:
    linear-gradient(90deg, var(--good) var(--score), var(--bad) var(--score)) bottom / 100% 3px no-repeat,
    linear-gradient(90deg, var(--good-tint) var(--score), var(--bad-tint) var(--score));
  color: var(--ink); font-weight: 600;
}
.jump button.s-full:not([aria-current="true"]) { color: var(--good); }
.jump button.s-zero:not([aria-current="true"]) { color: var(--bad); }
.pill.done-pill.s-zero { background: var(--bad-tint); color: var(--bad); }
.pill.done-pill.s-part { background: var(--warn-tint); color: var(--warn); }

/* ---------- Heatmap hover box: the topic in full, then each spec point's score ---------- */
.hm-tip { position: fixed; z-index: 90; width: min(440px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: hidden; padding: 12px 14px; border-radius: 12px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--sh-lg); font-family: var(--tree); font-size: 13px; line-height: 1.4; pointer-events: none; }
.hm-tip .tip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.hm-tip .tip-head b { font-size: 14px; font-weight: 700; }
.hm-tip .tip-sum { margin: 2px 0 8px; color: var(--muted); font-size: 12px; }
.hm-tip ul { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--line); display: grid; gap: 7px; }
.hm-tip li { display: grid; grid-template-columns: auto 1fr auto; gap: 0 8px; align-items: baseline; }
.hm-tip .tip-id { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
.hm-tip .tip-name { font-weight: 400; }
.hm-tip small { grid-column: 2 / 4; color: var(--muted); font-size: 11.5px; }
.hm-tip i { font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; padding: 1px 7px; border-radius: 99px; font-size: 12px; white-space: nowrap; }
.hm-tip i.h-high { background: var(--h-high-t); color: var(--h-high); }
.hm-tip i.h-mid { background: var(--h-mid-t); color: var(--h-mid); }
.hm-tip i.h-low { background: var(--h-low-t); color: var(--h-low); }
.hm-tip i.h-none { color: var(--muted); }

/* ---------- Reviews ---------- */
.help-ctas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.rv-sec { margin-top: 8px; }
.rv-summary { margin: 6px 0 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rv-avg { font-size: 20px; font-weight: 800; color: var(--ink); }
.rv-st { color: #f2a61f; letter-spacing: 2px; font-size: 15px; }
.rv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.rv-card { margin: 0; padding: 18px 20px; display: grid; gap: 10px; align-content: start; box-shadow: var(--sh-sm, var(--shadow)); }
.rv-card blockquote { margin: 0; font-size: 15px; line-height: 1.55; white-space: pre-wrap; }
.rv-card figcaption { font-size: 13px; font-weight: 600; }
.rv-stars { border: 0; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.rv-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.rv-stars label { cursor: pointer; width: 38px; height: 38px; display: grid; place-items: center; }
.rv-stars label::before { content: "★"; font-size: 32px; line-height: 1; color: var(--star-off); transition: color .12s, transform .12s; }
/* Fill every star up to the checked one (or the hovered one). */
.rv-stars:has(input:checked) label::before { color: #f2a61f; }
.rv-stars input:checked + label ~ label::before { color: var(--star-off); }
.rv-stars.rv-stars:has(label:hover) label::before { color: #f2a61f; }
.rv-stars.rv-stars label:hover ~ label::before { color: var(--star-off); }
.rv-stars label:hover::before { transform: scale(1.15); }
.rv-stars input:focus-visible + label { outline: 2px solid var(--focus); border-radius: 8px; }
.rv-word { margin-left: 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.rv-nudge { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 60; width: min(300px, calc(100vw - 32px)); background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px 12px; box-shadow: 0 16px 44px rgba(10, 20, 45, .22); display: grid; gap: 6px; animation: pop-in .35s cubic-bezier(.2, .7, .2, 1); }
.rv-nudge b { font-size: 15px; padding-right: 20px; }
.rvn-x { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px; }
.rvn-stars { display: flex; gap: 2px; }
.rvn-stars button { border: 0; background: none; font-size: 30px; line-height: 1; color: var(--star-off); cursor: pointer; padding: 2px; transition: color .1s, transform .1s; }
.rvn-stars:hover button { color: #f2a61f; }
.rvn-stars button:hover ~ button { color: var(--star-off); }
.rvn-stars button:hover { transform: scale(1.15); }
.rvn-foot { display: flex; justify-content: space-between; gap: 10px; }
.rvn-foot .link.quiet:hover { color: var(--ink); }

/* ---------- Mark reminder ---------- */
.mr h2 { font-size: 21px; }
.mr-art { background: var(--soft); border-radius: 14px; padding: 18px; display: grid; gap: 14px; justify-items: center; }
.mr-row { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.mr-sel { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--mark); border-radius: 8px; padding: 3px 10px; background: var(--bg); box-shadow: 0 0 0 4px color-mix(in srgb, var(--mark) 20%, transparent); animation: mr-glow 1.8s ease-in-out infinite; }
.mr-cells { display: flex; gap: 5px; }
.mr-cells i { width: 22px; height: 22px; border-radius: 6px; animation: cell-in .4s backwards; }
.mr-cells i:nth-child(2) { animation-delay: .08s; } .mr-cells i:nth-child(3) { animation-delay: .16s; } .mr-cells i:nth-child(4) { animation-delay: .24s; }
.mr-cells i:nth-child(5) { animation-delay: .32s; } .mr-cells i:nth-child(6) { animation-delay: .4s; } .mr-cells i:nth-child(7) { animation-delay: .48s; }
.mr-cells .c-hi { background: var(--h-high); } .mr-cells .c-mid { background: var(--h-mid); } .mr-cells .c-low { background: var(--h-low); }
.mr-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.mr-ctas { display: flex; gap: 8px; flex-wrap: wrap; }
@keyframes mr-glow { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--mark) 8%, transparent); } }
.selfmark.pulse { border-radius: 10px; animation: sm-pulse 1.2s ease-in-out 2; }
@keyframes sm-pulse { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--mark) 35%, transparent); } }

/* ---------- Guided tour ---------- */
.tour { position: fixed; inset: 0; z-index: 1000; animation: fade-in .3s ease-out; }
.tour.leaving { opacity: 0; transition: opacity .25s; }
.tour-block { position: absolute; inset: 0; }
.tour-hole { position: fixed; border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 200vmax rgba(8, 15, 35, .62); outline: 3px solid var(--focus); transition: left .4s cubic-bezier(.3, .7, .2, 1), top .4s cubic-bezier(.3, .7, .2, 1), width .4s cubic-bezier(.3, .7, .2, 1), height .4s cubic-bezier(.3, .7, .2, 1), opacity .3s; }
.tour-hole::after { content: ""; position: absolute; inset: -3px; border-radius: 14px; border: 3px solid var(--focus); animation: tour-ring 1.6s ease-out infinite; }
.tour.is-key .tour-hole { outline-color: #f2a61f; }
.tour.is-key .tour-hole::after { border-color: #f2a61f; }
.tour.no-target .tour-hole { box-shadow: 0 0 0 200vmax rgba(8, 15, 35, .7); outline-color: transparent; }
.tour.no-target .tour-hole::after { display: none; }
.tour-arrow { position: fixed; color: #fff; pointer-events: none; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45)); transform: rotate(var(--rot, 0deg)); animation: tour-bob 1s ease-in-out infinite; transition: left .4s cubic-bezier(.3, .7, .2, 1), top .4s cubic-bezier(.3, .7, .2, 1), opacity .2s; }
.tour.is-key .tour-arrow { color: #f2a61f; }
.tour-card { position: fixed; width: min(360px, calc(100vw - 24px)); background: var(--bg); color: var(--ink); border-radius: 16px; padding: 18px 20px 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); outline: none; transition: left .4s cubic-bezier(.3, .7, .2, 1), top .4s cubic-bezier(.3, .7, .2, 1); }
.tour-card.swap h2, .tour-card.swap p { animation: rise-in .35s cubic-bezier(.2, .7, .2, 1) backwards; }
.tour-card.swap p { animation-delay: .05s; }
.tour-card h2 { margin: 8px 0 6px; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.tour.is-key .tour-card h2 { color: var(--warn); }
.tour-card p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.tour-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tour-step { font-size: 12px; font-weight: 700; color: var(--tint-ink); background: var(--tint); padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.tour-dots { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background .2s, width .2s; }
.tour-dots i.past { background: color-mix(in srgb, var(--navy) 45%, var(--line)); }
.tour-dots i.on { background: var(--navy); width: 16px; border-radius: 3px; }
.tour-nav { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
@keyframes tour-ring { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.06); } }
@keyframes tour-bob { 0%, 100% { transform: rotate(var(--rot, 0deg)) translateY(0); } 50% { transform: rotate(var(--rot, 0deg)) translateY(7px); } }
@media (prefers-reduced-motion: reduce) {
  .tour-hole, .tour-card, .tour-arrow { transition: none; }
  .tour-arrow, .tour-hole::after, .mr-sel { animation: none; }
}
#review-dlg, #markrem-dlg { width: fit-content; max-height: calc(100dvh - 24px); overflow: hidden auto; }
:root { --star-off: color-mix(in srgb, var(--muted) 40%, var(--line)); }
