/* ExamVerdict design system.
   The look comes from the paper answer sheet: form-green rules on white, graphite pencil marks,
   a pencil-yellow button. Shape rule: ovals are things you mark or press; square-cornered
   boxes are printed facts. The bottom-right corner of every page stays empty for the rank badge. */

@font-face {
  font-family: "Besley";
  src: url("/assets/fonts/besley-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Franklin";
  src: url("/assets/fonts/libre-franklin-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ev-sheet: #f3f8f5;       /* page: answer-sheet paper */
  --ev-paper: #ffffff;
  --ev-graphite: #24282c;    /* text and pencil marks */
  --ev-lead: #535b61;        /* secondary text */
  --ev-form: #0b7a5c;        /* answer-sheet green */
  --ev-form-soft: #cfe4da;   /* hairlines */
  --ev-form-tint: #e6f3ec;
  --ev-pencil: #ffc533;      /* the one action colour */
  --ev-miss: #b9324a;
  --ev-miss-tint: #fbebee;
  --ev-display: "Besley", "Rockwell", "Georgia", serif;
  --ev-text: "Libre Franklin", "Franklin Gothic Medium", "Arial", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  padding-bottom: 6rem; /* lets the last line scroll clear of the rank badge */
  background: var(--ev-sheet);
  color: var(--ev-graphite);
  font: 400 1.0625rem/1.55 var(--ev-text);
}
h1, h2, h3 {
  margin: 0;
  font-family: var(--ev-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.15rem, 1.35rem + 3.6vw, 3.75rem); line-height: 1.04; }
h2 { font-size: clamp(1.5rem, 1.25rem + 1.1vw, 2rem); }
h3 { font-size: 1.2rem; letter-spacing: 0; }
p, ul, ol, dl, figure, blockquote { margin: 0; }
a { color: var(--ev-form); text-underline-offset: 0.18em; }
a:hover { color: var(--ev-graphite); }
:focus-visible { outline: 3px solid var(--ev-graphite); outline-offset: 3px; border-radius: 4px; }
.ev-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- layout ---------- */
.ev-shell { width: min(100% - 2.5rem, 70rem); margin-inline: auto; }
.ev-read { max-width: 41rem; }
.ev-section { padding-block: clamp(2.25rem, 6vw, 4.25rem); }
.ev-section > h2 { margin-bottom: 1.25rem; }
.ev-lede { font-size: clamp(1.125rem, 1.05rem + 0.4vw, 1.3rem); line-height: 1.5; color: var(--ev-lead); }
.ev-flow > * + * { margin-top: 1rem; }
.ev-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }

.ev-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1rem; }
.ev-mark {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font: 800 1.3rem/1 var(--ev-display); letter-spacing: -0.02em;
  color: var(--ev-graphite); text-decoration: none;
}
.ev-mark svg { width: 2.2rem; height: 1.45rem; flex: none; }
.ev-nav { display: flex; gap: 1.25rem; font-weight: 600; }
.ev-nav a { color: var(--ev-graphite); text-decoration: none; padding-block: 0.4rem; }
.ev-nav a:hover { text-decoration: underline; }

.ev-crumbs { font-size: 0.95rem; color: var(--ev-lead); }
.ev-crumbs a { color: var(--ev-lead); }

.ev-foot { margin-top: 3rem; padding-block: 2rem; border-top: 1.5px solid var(--ev-form); font-size: 0.95rem; color: var(--ev-lead); }
.ev-foot ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin-bottom: 1rem; }
.ev-foot a { color: var(--ev-graphite); }

/* ---------- things you press ---------- */
.ev-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.25rem; padding: 0.7rem 1.7rem;
  border: 2px solid var(--ev-graphite); border-radius: 999px;
  background: var(--ev-pencil); color: var(--ev-graphite);
  font: 700 1.0625rem/1.2 var(--ev-text); text-decoration: none; text-align: center;
  cursor: pointer; box-shadow: 0 3px 0 var(--ev-graphite);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
}
.ev-btn:hover { background: #ffd35c; color: var(--ev-graphite); }
.ev-btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ev-graphite); }
.ev-btn:disabled { background: #e7ece9; border-color: #a9b3ad; color: #6a7378; box-shadow: none; cursor: not-allowed; transform: none; }
.ev-btn--quiet {
  min-height: 2.75rem; padding: 0.45rem 1.15rem;
  background: var(--ev-paper); border: 1.5px solid var(--ev-form); color: var(--ev-form);
  font-weight: 600; box-shadow: none;
}
.ev-btn--quiet:hover { background: var(--ev-form-tint); color: var(--ev-form); }
.ev-btn--quiet:active { transform: none; }
@media (max-width: 30rem) { .ev-btn--wide { width: 100%; } }

.ev-search {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.3rem 1.1rem; border: 2px solid var(--ev-graphite); border-radius: 999px;
  background: var(--ev-paper);
}
.ev-search svg { width: 1.3rem; height: 1.3rem; flex: none; color: var(--ev-lead); }
.ev-search input { flex: 1; min-width: 0; padding: 0.7rem 0; border: 0; outline: 0; background: none; color: inherit; font: inherit; font-size: 1.125rem; }
.ev-search input::placeholder { color: #6a7378; }
.ev-search:focus-within { box-shadow: 0 0 0 4px var(--ev-pencil); }
.ev-field-label { display: block; margin-bottom: 0.5rem; font-weight: 700; }

.ev-input {
  display: block; width: 100%; padding: 0.65rem 0.8rem; border: 1.5px solid var(--ev-lead); border-radius: 6px;
  background: var(--ev-paper); color: inherit; font: inherit;
}
.ev-input:focus-visible { outline: 3px solid var(--ev-graphite); outline-offset: 2px; }
.ev-report { font-size: 1rem; }
.ev-report summary { color: var(--ev-form); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.ev-report form { margin-top: 0.9rem; }

/* long-form text pages */
.ev-prose > * + * { margin-top: 1rem; }
.ev-prose h2 { margin-top: 2.25rem; font-size: 1.45rem; }
.ev-prose ul { padding-left: 1.3rem; }
.ev-prose li + li { margin-top: 0.35rem; }

/* ---------- answer bubbles ---------- */
.ev-options { display: grid; gap: 0.6rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.ev-options legend { padding: 0; }
.ev-option {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.3rem 0.9rem;
  padding: 0.8rem 0.9rem; border: 1.5px solid var(--ev-form-soft); border-radius: 6px;
  background: var(--ev-paper); font-size: 1.125rem; line-height: 1.35; cursor: pointer;
}
.ev-option:hover { border-color: var(--ev-form); }
.ev-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ev-option:focus-within { outline: 3px solid var(--ev-graphite); outline-offset: 2px; }
.ev-bubble {
  position: relative; overflow: hidden; display: grid; place-items: center;
  width: 3rem; height: 1.9rem; border: 1.5px solid var(--ev-form); border-radius: 50%;
  background: var(--ev-paper); color: var(--ev-form); font: 700 0.95rem/1 var(--ev-text);
}
.ev-bubble::before { /* the pencil mark: sweeps in from the left when the option is chosen */
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(-62deg, #24282c 0 2px, #3d4349 2px 3.5px);
  clip-path: inset(0 100% 0 0); transition: clip-path 0.22s ease-out;
}
.ev-option input:checked ~ .ev-bubble { border-color: var(--ev-graphite); color: transparent; }
.ev-option input:checked ~ .ev-bubble::before { clip-path: inset(0); }
.ev-option:has(input:checked) { border-color: var(--ev-graphite); box-shadow: inset 0 0 0 1px var(--ev-graphite); }

.ev-option--done { cursor: default; }
.ev-option--done:hover { border-color: var(--ev-form-soft); }
.ev-option--right, .ev-option--right:hover { border-color: var(--ev-form); background: var(--ev-form-tint); }
.ev-option--right .ev-bubble { background: var(--ev-form); border-color: var(--ev-form); color: #fff; }
.ev-option--wrong, .ev-option--wrong:hover { border-color: var(--ev-miss); background: var(--ev-miss-tint); }
.ev-option--wrong .ev-bubble { background: var(--ev-miss); border-color: var(--ev-miss); color: #fff; }
.ev-option-note { display: block; font-size: 0.9rem; font-weight: 700; }
.ev-option--right .ev-option-note { color: var(--ev-form); }
.ev-option--wrong .ev-option-note { color: var(--ev-miss); }
.ev-share { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ev-lead); white-space: nowrap; }
.ev-share-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: rgb(36 40 44 / 0.1); }
.ev-share-bar > span { display: block; width: var(--v, 0%); height: 100%; border-radius: 2px; background: var(--ev-lead); transition: width 0.5s ease-out; }
.ev-option--right .ev-share-bar > span { background: var(--ev-form); }
.ev-option--wrong .ev-share-bar > span { background: var(--ev-miss); }

h1.ev-question { font-family: var(--ev-text); letter-spacing: -0.005em; text-wrap: wrap; }
.ev-question { font: 600 clamp(1.3rem, 1.15rem + 0.8vw, 1.65rem)/1.3 var(--ev-text); letter-spacing: -0.005em; margin-bottom: 1.1rem; }
.ev-verdict { font: 700 1.4rem/1.2 var(--ev-display); text-wrap: balance; }
.ev-hint { color: var(--ev-miss); font-weight: 700; }
.ev-verdict--right { color: var(--ev-form); }
.ev-verdict--wrong { color: var(--ev-miss); }

/* progress: one small oval per question, like a row on the answer sheet */
.ev-strip { display: flex; flex-wrap: wrap; gap: 4px 3px; list-style: none; padding: 0; }
.ev-strip li { flex: 1 1 0.6rem; max-width: 1.1rem; min-width: 0.6rem; aspect-ratio: 1.55; border: 1.5px solid var(--ev-form); border-radius: 50%; background: var(--ev-paper); }
.ev-strip .is-right { background: var(--ev-form); }
.ev-strip .is-wrong { background: var(--ev-miss); border-color: var(--ev-miss); }
.ev-strip .is-now { border-color: var(--ev-graphite); box-shadow: 0 0 0 2.5px var(--ev-pencil); }
.ev-runbar { display: grid; gap: 0.6rem; padding-block: 0.25rem 1.25rem; }
.ev-runbar-top { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.ev-runbar-top b { display: block; font-size: 1.125rem; }
.ev-runbar-top span { font-size: 0.95rem; color: var(--ev-lead); }
.ev-runbar-top a { font-size: 0.95rem; color: var(--ev-lead); white-space: nowrap; }

/* ---------- printed facts ---------- */
.ev-card { padding: 1.2rem; border: 1.5px solid var(--ev-form); border-radius: 6px; background: var(--ev-paper); }
@media (min-width: 40rem) { .ev-card { padding: 1.75rem; } }
.ev-card-title { font: 700 1rem/1.3 var(--ev-text); color: var(--ev-form); margin-bottom: 0.75rem; }

.ev-facts { border-top: 1.5px solid var(--ev-form); }
.ev-facts > div { display: grid; grid-template-columns: minmax(8.5rem, 2fr) 3fr; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--ev-form-soft); }
.ev-facts dt { color: var(--ev-lead); }
.ev-facts dd { margin: 0; font-weight: 700; }

.ev-source { padding: 0.15rem 0 0.15rem 1rem; border-left: 4px solid var(--ev-form); font-size: 1rem; }
.ev-source cite { font-style: normal; font-weight: 700; }
.ev-source blockquote { margin-top: 0.4rem; color: var(--ev-lead); }

.ev-meter { position: relative; height: 0.9rem; margin-block: 0.9rem 0.5rem; border-radius: 999px; background: var(--ev-form-soft); }
.ev-meter > span { display: block; width: var(--v, 0%); height: 100%; border-radius: 999px; background: var(--ev-form); }
.ev-meter--plain::after { display: none; }
.ev-meter::after { content: ""; position: absolute; top: -0.4rem; bottom: -0.4rem; left: var(--pass, 60%); width: 2px; background: var(--ev-graphite); }

.ev-hist { display: grid; grid-template-columns: repeat(11, 1fr); align-items: end; gap: 3px; height: 9rem; padding-bottom: 1px; border-bottom: 1.5px solid var(--ev-graphite); }
.ev-hist span { display: block; height: var(--h, 2%); min-height: 2px; background: var(--ev-form-soft); }
.ev-hist .is-pass { background: var(--ev-form); }
.ev-hist-axis { position: relative; display: flex; justify-content: space-between; margin-top: 0.4rem; font-size: 0.9rem; color: var(--ev-lead); }
.ev-hist-axis .ev-hist-pass { position: absolute; right: calc(100% - var(--pass, 54.5%)); padding-right: 0.4rem; border-right: 2px solid var(--ev-graphite); color: var(--ev-graphite); font-weight: 700; }

.ev-list { list-style: none; padding: 0; border-top: 1.5px solid var(--ev-form); }
.ev-list > li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--ev-form-soft); }
.ev-list-name { font: 700 1.15rem/1.25 var(--ev-display); color: var(--ev-graphite); text-decoration: none; }
.ev-list-name:hover { text-decoration: underline; }
.ev-list small { display: block; margin-top: 0.15rem; font-size: 0.95rem; color: var(--ev-lead); }
.ev-list .ev-share { white-space: nowrap; }
@media (min-width: 52rem) {
  .ev-list--two { display: grid; grid-template-columns: 1fr 1fr; column-gap: 3rem; }
}
.ev-empty { padding: 1rem 0; color: var(--ev-lead); }

.ev-live { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); gap: 1rem; padding-block: 1.25rem; border-block: 1.5px solid var(--ev-form); }
.ev-live b { display: block; font: 700 clamp(1.45rem, 1rem + 2.2vw, 2.4rem)/1.1 var(--ev-display); }
.ev-live span { font-size: 0.95rem; color: var(--ev-lead); }

.ev-steps { list-style: none; padding: 0; display: grid; gap: 1.5rem; counter-reset: step; }
.ev-steps li { counter-increment: step; display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.9rem; }
.ev-steps li::before {
  content: counter(step); grid-row: span 2; display: grid; place-items: center;
  width: 3rem; height: 1.9rem; border: 1.5px solid var(--ev-form); border-radius: 50%;
  color: var(--ev-form); font: 700 0.95rem/1 var(--ev-text);
}
.ev-steps p { color: var(--ev-lead); }
@media (min-width: 52rem) { .ev-steps { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }

.ev-ad { display: grid; place-items: center; min-height: 280px; margin-block: 2rem; }

/* sample questions on exam and topic pages: the answer opens on request */
.ev-sample { border-bottom: 1px solid var(--ev-form-soft); }
.ev-sample:first-of-type { border-top: 1.5px solid var(--ev-form); }
.ev-sample summary { padding: 0.9rem 0; font-weight: 600; font-size: 1.125rem; line-height: 1.35; cursor: pointer; }
.ev-sample summary:hover { color: var(--ev-form); }
.ev-sample-body { padding: 0 0 1.25rem; }
.ev-sample-body > * + * { margin-top: 0.8rem; }
.ev-answers { padding-left: 1.6rem; list-style: upper-alpha; }
.ev-answers li { padding: 0.1rem 0; }
.ev-answers .is-right { font-weight: 700; color: var(--ev-form); }

.ev-gap-top { margin-top: 1.25rem; }
.ev-center { margin-inline: auto; }
.ev-section--flush { padding-top: 0; }
.ev-note { font-size: 0.95rem; color: var(--ev-lead); }

/* ---------- admin ---------- */
.ev-adm-nav { justify-content: flex-end; margin-bottom: 1.5rem; font-weight: 600; }
.ev-adm-h2 { margin-top: 3rem; margin-bottom: 1rem; }
.ev-adm-login { max-width: 24rem; }
.ev-adm-filter { margin-block: 1.75rem 1rem; font-weight: 600; }
.ev-adm-filter [aria-current] { color: var(--ev-graphite); text-decoration: none; }
.ev-adm-bulk { position: sticky; top: 0; z-index: 1; padding: 0.75rem 0; background: var(--ev-sheet); border-bottom: 1.5px solid var(--ev-form); }
.ev-adm-select { width: auto; }
.ev-adm-list { list-style: none; padding: 0; }
.ev-adm-q { padding: 1.25rem 0; border-bottom: 1px solid var(--ev-form-soft); }
.ev-adm-pick { display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; color: var(--ev-lead); cursor: pointer; }
.ev-adm-pick input, .ev-adm-bulk input { width: 1.15rem; height: 1.15rem; accent-color: var(--ev-form); }
.ev-adm-stem { font-weight: 600; font-size: 1.125rem; }
.ev-adm-cols { display: grid; gap: 1rem; }
@media (min-width: 60rem) { .ev-adm-cols { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 2.5rem; align-items: start; } }
.ev-adm-notice { margin-bottom: 1.5rem; padding: 0.8rem 1rem; border-left: 4px solid var(--ev-form); background: var(--ev-form-tint); font-weight: 600; }
.ev-adm-key { align-items: flex-start; }
.ev-adm-key .ev-report { margin-top: 0.5rem; }
.ev-adm-forms { margin-top: 3rem; row-gap: 3rem; }
.ev-adm-forms h2 { font-size: 1.45rem; }
.ev-adm-payload { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.9rem; }

/* ---------- page: home ---------- */
.ev-hero { display: grid; gap: 2rem; padding-block: 1.25rem 2.5rem; }
.ev-hero-copy > * + * { margin-top: 1.25rem; }
@media (min-width: 60rem) {
  .ev-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 28rem); gap: 4.5rem; align-items: center; padding-block: 3.5rem 4.5rem; }
}

/* ---------- page: exam ---------- */
.ev-split { display: grid; gap: 2.5rem; }
@media (min-width: 60rem) { .ev-split { grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); gap: 4.5rem; align-items: start; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.ev-adm-material { min-height: 16rem; font-family: inherit; line-height: 1.5; resize: vertical; }
