/* ExamPrep in the shared 1a "Drafting table" system. Loaded after style.css and
   brand.css, and after system/system.css, so it only re-points tokens and reshapes
   what those sheets drew. No markup, marking or progress logic is touched.
   Status is always a shape plus a word; mono is for code, equations and times only. */

:root {
  color-scheme: light;
  --bg: var(--sy-bg);
  --surface: var(--sy-bg);
  --surface-2: var(--sy-surf);
  --glass: var(--sy-bg);
  --ink: var(--sy-ink);
  --ink-2: var(--sy-ink2);
  --ink-3: var(--sy-ink3);
  --line: var(--sy-line2);
  --line-2: var(--sy-line);
  --control: var(--sy-ink2);
  --accent: var(--sy-acc-ink);
  --accent-hover: #2c455d;
  --accent-fill: var(--sy-acc-fill);
  --accent-fill-hover: #2c455d;
  --accent-soft: var(--sy-acc-soft);
  --k: var(--sy-ep);
  --k-ink: var(--sy-acc-ink);
  --k-soft: var(--sy-acc-soft);
  --good: var(--sy-ok-ink); --good-soft: rgba(59, 131, 78, .10);
  --bad: var(--sy-bad-ink); --bad-soft: rgba(175, 61, 52, .09);
  --warn: var(--sy-warn-ink); --warn-soft: rgba(165, 109, 0, .14);
  --shadow: none; --shadow-hover: none; --card-edge: var(--sy-line);
  --sans: var(--sy-body);
  --display: var(--sy-head);
  --mono: var(--sy-mono);
  --r-ctl: 0; --r-row: 0; --r-card: 0;
}

body { font-family: var(--sy-body); font-size: 17px; letter-spacing: 0; background: var(--sy-bg); color: var(--sy-ink); }
h1, h2, h3 { font-family: var(--sy-head); font-weight: 600; letter-spacing: var(--sy-head-ls); }
h1 { font-size: clamp(2.25rem, 1.6rem + 3vw, 2.875rem); line-height: 1; }
h2 { font-size: 1.75rem; line-height: 1.1; letter-spacing: var(--sy-head-ls); }
h3 { font-size: 1.25rem; letter-spacing: var(--sy-head-ls); font-weight: 600; }
.hero h1 { font-size: clamp(2.75rem, 1.5rem + 6vw, 4.5rem); letter-spacing: var(--sy-head-ls); }
.big-num, .facts strong, .countdown-num { font-family: var(--sy-head); font-weight: 600; letter-spacing: var(--sy-head-ls); }
a { color: var(--sy-acc-ink); text-underline-offset: 3px; }
a:hover { color: #2c455d; }
:focus-visible { outline: 2px solid var(--sy-acc); outline-offset: 3px; border-radius: 0; }
.skip { border-radius: 0; background: var(--sy-acc-fill); color: var(--sy-on-acc); }
.label, .q-num { font-weight: 600; }
.chapter-title, .label-accent { letter-spacing: .1em; }
.chapter-title { font-size: .75rem; color: var(--sy-acc-ink); }

/* ---- header: hairline, flat ------------------------------------------------- */
.site-header { background: var(--sy-bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 1px solid var(--sy-line); }
.site-header .bar { min-height: 64px; }
.brand { font: 600 1.375rem/1 var(--sy-head); letter-spacing: var(--sy-head-ls); }
.site-header .brand-mark, .brand-mark { width: 20px; height: 20px; border-radius: 0; background: var(--sy-ep); color: var(--sy-on-acc); }
.brand-mark svg { width: 13px; height: 13px; }
.site-nav a, .linkbtn { border-radius: 0; opacity: 1; font-size: 15px; color: var(--sy-ink); border-bottom: 2px solid transparent; }
.site-nav a:hover, .linkbtn:hover { background: transparent; border-bottom-color: var(--sy-line); }
.site-nav a[aria-current="page"] { color: var(--sy-acc-ink); border-bottom-color: var(--sy-ep); font-weight: 600; }
.nav-actions .btn-small { min-height: 44px; }
.hub-return { color: var(--sy-ink2); }
.phone-menu-toggle { border-radius: 0; min-height: 44px; min-width: 44px; background: transparent; border: 1px solid var(--sy-line); }

/* ---- buttons: only the primary is filled and marked -------------------------- */
.btn, .btn-ghost {
  position: relative; border-radius: 0; font: 600 1.0625rem/1 var(--sy-head); letter-spacing: var(--sy-head-ls);
  background: var(--sy-acc-fill); color: var(--sy-on-acc); border: 1px solid var(--sy-acc-fill);
}
.btn:hover { background: #2c455d; border-color: #2c455d; color: var(--sy-on-acc); }
.btn:active { transform: none; }
.btn:not(.btn-small):not(.btn-outline):not(.btn-ghost)::after { content: ""; position: absolute; inset: -6px; pointer-events: none; background: var(--sy-marks); background-repeat: no-repeat; }
.btn-small { min-height: 44px; padding: 0 16px; font-size: 1rem; }
.btn-large { min-height: 52px; }
.btn-outline, .btn-ghost { background: transparent; color: var(--sy-ink); border: 1px solid var(--sy-line); box-shadow: none; }
.btn-outline:hover, .btn-ghost:hover { background: transparent; color: var(--sy-ink); border-color: var(--sy-ink2); }

/* ---- fields ------------------------------------------------------------------- */
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], input[type="search"], select, textarea {
  border-radius: 0; border: 1px solid var(--sy-line); background: var(--sy-surf); font: 400 1rem/1.4 var(--sy-body);
}
input:hover, select:hover, textarea:hover { border-color: var(--sy-ink2); }
input:focus, select:focus, textarea:focus { border-color: var(--sy-acc); box-shadow: none; outline: 2px solid var(--sy-acc); outline-offset: 2px; }
.topic-search input { border-radius: 0; padding-left: 12px; }
.form label, .field { font-weight: 500; }

/* ---- cards and rows: hairline, square, no fill -------------------------------- */
.card, .steps li, .cells, details.paper > summary, .quiz fieldset, .review fieldset { background: transparent; box-shadow: none; border: 1px solid var(--sy-line); border-radius: 0; }
.card, .quiz fieldset, .review fieldset { position: relative; }
.card::after, .quiz fieldset::after, .review fieldset::after { content: ""; position: absolute; inset: -6px; pointer-events: none; background: var(--sy-marks); background-repeat: no-repeat; }
.card-link:hover { transform: none; box-shadow: none; border-color: var(--sy-ink2); }
.card-link:active { transform: none; }
.facts { border-radius: 0; box-shadow: none; border: 1px solid var(--sy-line); background: var(--sy-line2); }
.facts li { background: var(--sy-bg); }
.tile { border-radius: 0; background: var(--sy-ep); color: var(--sy-on-acc); }
.step-n { border-radius: 0; background: var(--sy-acc-soft); }
a.cell:hover { background: var(--sy-acc-soft); }
.mcq-link:hover { background: var(--sy-acc-soft); }
details.paper > summary { font: 600 1.25rem var(--sy-head); letter-spacing: var(--sy-head-ls); min-height: 56px; }
details.more summary { color: var(--sy-acc-ink); }

/* ---- small bits --------------------------------------------------------------- */
.tag, .chip { border-radius: 0; background: transparent; border: 1px solid var(--sy-line); color: var(--sy-ink2); }
.chip-accent { background: var(--sy-acc-soft); color: var(--sy-acc-ink); border-color: transparent; }
.status { font-variant-numeric: tabular-nums; }
.flash { border-radius: 0; background: var(--sy-acc-soft); border: 1px solid var(--sy-line); border-left: 0; }
.flash-error { background: rgba(175, 61, 52, .09); color: var(--sy-bad-ink); }
.flash-error::before { content: "\25A0  "; }
.callout { border-radius: 0; background: var(--sy-acc-soft); border: 1px solid var(--sy-line); border-left: 0; }
.callout.info { background: var(--sy-acc-soft); }
.callout.warn { background: var(--warn-soft); }
.callout.warn::before { content: "\25B2  "; color: var(--sy-warn-ink); }
.callout.good { background: var(--good-soft); }

/* ---- quiz --------------------------------------------------------------------- */
.prompt { font-size: 1.125rem; font-weight: 500; }
.code, .prompt.code { border-radius: 0; background: var(--sy-surf); border: 1px solid var(--sy-line2); font: 400 .875rem/1.55 var(--sy-mono); }
.choice { border-radius: 0; border: 1px solid var(--sy-line); min-height: 48px; }
.choice:hover { background: var(--sy-acc-soft); }
.choice:has(input:checked) { border: 1.5px solid var(--sy-ep); background: var(--sy-acc-soft); }
.choice:active { transform: none; }
.choice input[type="radio"] { border: 1.5px solid var(--sy-ink2); background: var(--sy-bg); }
.choice input[type="radio"]::before { background: var(--sy-ep); }
.choice input[type="radio"]:checked { border-color: var(--sy-ep); }
.quiz textarea { background: var(--sy-surf); }
.submit-bar { border-radius: 0; background: var(--sy-bg); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; border: 1px solid var(--sy-line); padding: 10px 10px 10px 18px; }

/* ---- results and marking states: shape + word ------------------------------------ */
progress { border-radius: 0; height: 6px; background: var(--sy-surf); }
progress::-webkit-progress-bar { background: var(--sy-surf); border-radius: 0; }
progress::-webkit-progress-value { background: var(--sy-ep); border-radius: 0; }
progress::-moz-progress-bar { background: var(--sy-ep); border-radius: 0; }
.verdict { border-radius: 0; font-weight: 600; }
.answer-list li { border-radius: 0; }
.your-answer pre { border-radius: 0; background: var(--sy-surf); font: 400 1rem/1.5 var(--sy-body); }
.ai-mark { border-radius: 0; background: var(--good-soft); border: 1px solid var(--sy-line2); }
.ai-mark .mark { font: 600 1.25rem var(--sy-head); letter-spacing: var(--sy-head-ls); }
.ai-mark .mark::before { content: "\25CF  "; font-size: .8em; }                                  /* ● AI mark */
fieldset[data-state="self_marked"] .ai-mark .mark::before { content: "\270E  "; font-size: .9em; } /* ✎ Your mark */
.marking { border-radius: 0; background: var(--sy-acc-soft); border: 1px solid var(--sy-line2); }
.marking::before { content: "\25D4"; width: auto; height: auto; border: 0; border-radius: 0; animation: none; font-size: 1.1rem; line-height: 1; color: var(--sy-acc-ink); } /* ◔ Marking... */
fieldset[data-state="failed"] .callout.warn::before { content: "\25A0  "; color: var(--sy-bad-ink); }  /* ■ failed */
.mark-scheme, .model-answer { border-radius: 0; background: var(--sy-surf); border: 1px solid var(--sy-line2); }
.model-answer { background: var(--sy-acc-soft); }
.mark-list li::marker { color: var(--sy-acc-ink); }
.selfmark input { width: 8rem; }
.tip { color: var(--sy-acc-ink); }

/* ---- times and countdowns are the only mono in running UI ------------------------- */
.paper-timer strong, .countdown-num { font-family: var(--sy-mono); font-weight: 500; letter-spacing: 0; }
.countdown-num { font-size: clamp(2.5rem, 8vw, 4rem); }
.paper-timer strong.over { color: var(--sy-bad-ink); }
time { font-variant-numeric: tabular-nums; }

/* ---- tables --------------------------------------------------------------------- */
.table th { font: 600 .6875rem/1.2 var(--sy-body); letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid var(--sy-line); }
.table td { border-bottom: 1px solid var(--sy-line2); }

/* ---- footer / 404 ------------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--sy-line); }

/* ---- phones ----------------------------------------------------------------------- */
@media (max-width: 700px) {
  body.has-tabs .site-header { background: var(--sy-bg); }
  body.has-tabs .site-nav { background: var(--sy-bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-top: 1px solid var(--sy-line); }
  body.has-tabs .site-nav a { border-radius: 0; border-bottom: 0; min-height: 44px; }
  body.has-tabs .site-nav a[aria-current="page"] { color: var(--sy-acc-ink); background: var(--sy-acc-soft); box-shadow: inset 0 2px 0 var(--sy-ep); }
  .submit-bar { border-radius: 0; }
  .card, .quiz fieldset, .review fieldset { padding: 18px; }
}
@media (max-width: 760px) {
  .menu-ready body.has-tabs .site-nav a { min-height: 44px; }
}

/* ---- 44px targets for stand-alone links ------------------------------------------ */
.brand, .nav-actions > a, .site-footer a, .list-plain a, .mcq-inline, .back-link, .hub-return { display: inline-flex; align-items: center; min-height: 44px; }
.list-plain li { align-items: center; }

/* ---- brand.css "v2" (footer, account, tables) hard-codes dark colours and radii ---- */
.site-footer { background: var(--sy-bg); }
.foot-brand p { color: var(--sy-ink2); }
.foot-links a { color: var(--sy-ink2); }
.foot-links a:hover { color: var(--sy-ink); }
.account-avatar { border-radius: 0; background: var(--sy-acc-soft); color: var(--sy-acc-ink); font-family: var(--sy-head); }
.account-links a { border-bottom-color: var(--sy-line2); }
.danger-zone { border-color: var(--sy-line) !important; border-style: solid; }
.danger-zone h2 { color: var(--sy-bad-ink); }
.danger-zone h2::before { content: "\25A0  "; font-size: .7em; vertical-align: .15em; }
/* destructive: outlined only; filled only inside a confirmation dialog */
.btn-danger { background: transparent !important; color: var(--sy-bad-ink) !important; border: 1px solid var(--sy-bad) !important; }
.btn-danger:hover { background: rgba(175, 61, 52, .08) !important; }
.btn-danger::after { display: none; }
.table-card .table thead th { background: transparent; color: var(--sy-ink2); letter-spacing: .08em; font-size: .6875rem; }
.table-card .table th, .table-card .table td { border-bottom-color: var(--sy-line2); }
.table-card .table td { color: var(--sy-ink2); }
.table-card:focus-visible { outline: 2px solid var(--sy-acc); }
/* Links inside footer sentences: the steel ink is close to the grey text, so underline them. */
.site-footer p a, .foot-brand p a { text-decoration: underline; text-underline-offset: 3px; }
/* Phones: the topic name was squeezed into a narrow column by the count and the
   "Multiple choice" link beside it. Put that link on its own full-width 44px row. */
@media (max-width: 560px) {
  .cells li.has-mcq { flex-wrap: wrap; }
  .cells li.has-mcq > a.cell { flex: 1 1 100%; }
  .mcq-link { flex: 1 1 100%; min-height: 44px; border-left: 0; border-top: 1px solid var(--sy-line2); padding: 0 16px; font-size: 14px; }
}
