/* ==========================================================================
   Toastmasters District 73 — Speech Contest Rules Quiz
   Styles follow docs/DESIGN.md. Every colour, font and radius here is a
   DESIGN.md token — no unapproved secondary colours.
   ========================================================================== */

:root {
  /* Colours — DESIGN.md palette, and nothing else */
  --color-primary: #004165;        /* Loyal Blue */
  --color-secondary: #772432;      /* True Maroon */
  --color-accent: #F2DF74;         /* Happy Yellow */
  --color-neutral-dark: #1A1C1E;   /* Charcoal */
  --color-neutral-light: #A9B2B1;  /* Cool Gray */
  --color-surface: #FFFFFF;        /* White */

  /* Derived neutrals. DESIGN.md permits only the palette above, so these
     tints are computed from it with color-mix() rather than picked by
     hand — every colour in this file traces back to a DESIGN.md token. */
  --color-border: color-mix(in srgb, var(--color-primary) 15%, var(--color-surface));
  --color-wash: color-mix(in srgb, var(--color-neutral-light) 12%, var(--color-surface));

  /* Semantic status colours for answer feedback. These are deliberately NOT
     brand colours — they carry meaning, not identity — and are permitted by
     the DESIGN.md UI guardrails. Green marks a correct answer; red marks an
     incorrect one. Red reuses the brand's True Maroon family so the app stays
     visually consistent.
     Contrast on the filled marker: white text on green = 5.0:1,
     white text on maroon = 10.1:1. Both pass WCAG AA. */
  --color-correct: #15803D;            /* deep green */
  --color-incorrect: var(--color-secondary); /* True Maroon */
  --color-wash-correct: color-mix(in srgb, var(--color-correct) 8%, var(--color-surface));
  --color-wash-incorrect: color-mix(in srgb, var(--color-incorrect) 6%, var(--color-surface));

  /* Typography */
  --font-headings: "Montserrat", "Segoe UI", Arial, sans-serif;
  --font-body: "Open Sans", "Segoe UI", Arial, sans-serif;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;

  --wrap-width: 46rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;              /* body-md */
  color: var(--color-neutral-dark);
  background-color: var(--color-surface);
  /* Generous whitespace per DESIGN.md */
  padding-bottom: var(--space-6);
}

h1, h2, h3 {
  font-family: var(--font-headings);
  margin: 0 0 var(--space-3);
  color: var(--color-primary);
}

h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }  /* headline-lg */
h2 { font-size: 1.375rem; font-weight: 600; line-height: 1.3; } /* headline-md */
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.3; }

p {
  margin: 0 0 var(--space-3);
}

a {
  color: var(--color-secondary);
}

.wrap {
  width: 100%;
  max-width: var(--wrap-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

/* Visible only to screen readers */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-accent);
  color: var(--color-neutral-dark);
  padding: var(--space-2) var(--space-3);
  z-index: 10;
}

.skip-link:focus {
  left: 0;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  background-color: var(--color-primary);
  color: var(--color-surface);
  padding: var(--space-4) 0;
  margin-bottom: var(--space-5);
  border-bottom: 6px solid var(--color-accent);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.site-header__logo {
  width: 88px;
  height: auto;
  flex: none;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  padding: var(--space-1);
}

.site-header__eyebrow {
  margin: 0;
  font-family: var(--font-headings);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;        /* label-lg */
  text-transform: uppercase;
  color: var(--color-accent);
}

.site-header__title {
  margin: var(--space-1) 0 0;
  font-size: 1.5rem;
  color: var(--color-surface);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.card__eyebrow {
  margin: 0 0 var(--space-1);
  font-family: var(--font-headings);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-secondary);
}

.card__title {
  margin-bottom: var(--space-3);
}

.card__title--question {
  font-size: 1.25rem;
  font-weight: 700;
}

.card__lede {
  color: var(--color-neutral-dark);
  margin-bottom: var(--space-4);
}

.card__actions {
  margin-top: var(--space-4);
}

/* --------------------------------------------------------------------------
   Call-out card — True Maroon for inline call-outs
   -------------------------------------------------------------------------- */

.callout {
  border-left: 4px solid var(--color-secondary);
  background-color: var(--color-wash);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-3) var(--space-4);
}

.callout__title {
  font-size: 1rem;
  margin-bottom: var(--space-2);
  color: var(--color-secondary);
}

.callout__body {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Scoring levels table (setup screen)
   -------------------------------------------------------------------------- */

.levels {
  margin-top: var(--space-5);
}

.levels__heading {
  margin-bottom: var(--space-2);
}

.levels__lede {
  margin-bottom: var(--space-3);
  color: var(--color-neutral-dark);
}

.levels__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.level {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

/* The badge previews the colour the rank will earn on the results screen.
   The text colour is set inline alongside the background so the pair always
   matches the tier's WCAG AA combination. */
.level__badge {
  flex: none;
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.level__requirement {
  flex: 1;
  font-size: 0.9375rem;
  color: var(--color-neutral-dark);
}

/* Chief Judge needs a longer quiz as well as a higher score — call that
   out so the incentive to pick 35+ questions is visible up front. */
.level[data-tier="chief_judge"] {
  border-left: 4px solid var(--color-primary);
}

.level[data-tier="chief_judge"] .level__requirement {
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Form fields
   -------------------------------------------------------------------------- */

.field {
  border: 0;
  padding: 0;
  margin: 0 0 var(--space-4);
}

.field__label {
  font-family: var(--font-headings);
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
  text-transform: uppercase;
  color: var(--color-neutral-dark);
  padding: 0;
  margin-bottom: var(--space-2);
}

.field__hint {
  margin: var(--space-2) 0 0;
  font-size: 0.875rem;
  color: var(--color-neutral-dark);
}

.length-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.length-option {
  position: relative;
}

.length-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.length-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 4.25rem;
  padding: var(--space-2) var(--space-3);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-sm);
  font-family: var(--font-headings);
  font-weight: 700;
  color: var(--color-primary);
  background-color: var(--color-surface);
  cursor: pointer;
}

.length-option input[type="radio"]:checked + label {
  background-color: var(--color-primary);
  color: var(--color-surface);
}

.length-option input[type="radio"]:focus-visible + label {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Buttons — DESIGN.md components
   -------------------------------------------------------------------------- */

/* The "hidden" attribute must win over the button's own display rule.
   The UA stylesheet's "[hidden] { display: none }" is an attribute
   selector, and ".btn" is a class selector, so the class wins on
   specificity and the button stays visible despite the attribute. Without
   this rule the "Next question" button is visible before the first
   question is answered, and the learner can skip past questions. */
[hidden] {
  display: none !important;
}

.btn {
  display: inline-block;
  font-family: var(--font-headings);
  font-weight: 700;              /* label-lg */
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.9375rem;
  border-radius: var(--radius-sm);
  padding: 12px 24px;            /* button-primary padding */
  cursor: pointer;
  border: 2px solid transparent;
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-neutral-dark);   /* dark text on Happy Yellow */
  border-color: var(--color-accent);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background-color: var(--color-primary);
  color: var(--color-surface);
  border-color: var(--color-primary);
}

.btn--secondary {
  background-color: transparent;
  color: var(--color-secondary);
  border-color: var(--color-secondary);
}

.btn--secondary:hover,
.btn--secondary:focus-visible {
  background-color: var(--color-secondary);
  color: var(--color-surface);
}

.btn:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.btn--primary:focus-visible {
  outline-color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   Quiz progress
   -------------------------------------------------------------------------- */

.quiz-progress {
  margin-bottom: var(--space-4);
}

.quiz-progress__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.quiz-progress__label {
  font-family: var(--font-headings);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-primary);
}

.quiz-progress__score {
  font-size: 0.875rem;
  color: var(--color-neutral-dark);
}

.quiz-progress__track {
  height: 10px;
  background-color: var(--color-wash);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.quiz-progress__fill {
  height: 100%;
  width: 0;
  background-color: var(--color-primary);
  transition: width 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .quiz-progress__fill {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Answer options
   -------------------------------------------------------------------------- */

.options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.option {
  position: relative;
}

/* The radio lives inside its label, so the label handles the click and the
   input itself is visually hidden and sized to nothing. Keeping it out of
   the way matters: an absolutely-positioned input stretched over the label
   would sit on top of the option text and swallow its clicks. */
.option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
}

.option label {
  position: relative;
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  cursor: pointer;
}

.option__marker {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.option__text {
  flex: 1;
}

/* The "currently selected" look is driven by a data attribute the app sets,
   not by the ":checked" pseudo-class. Using the pseudo-class here made this
   rule compete with the answer-state rules below on specificity, so a later
   rule such as ":checked + label:hover" would silently repaint a locked
   answer in the brand blue. The attribute is removed the moment the answer
   is locked, so the two states never overlap.

   The radio now sits inside the label, so the usual "input:checked + label"
   pattern cannot match at all. */
.option[data-selected] > label {
  border-color: var(--color-primary);
  background-color: var(--color-wash);
}

.option[data-selected] .option__marker {
  background-color: var(--color-primary);
  color: var(--color-surface);
}

/* Focus indication. The radio now lives inside its label, so the focus
   ring has to be drawn on the label — ":focus-visible + label" no longer
   matches. ":has()" selects the option that contains the focused radio. */
.option:has(input[type="radio"]:focus-visible) > label {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Answered states — locked in once a choice is submitted */
/* --------------------------------------------------------------------------
   Answer states

   Correct answers use green and incorrect answers use red/maroon. These are
   semantic status colours rather than brand colours, permitted by the
   UI guardrails in docs/DESIGN.md ("semantic status colours for correct and
   incorrect answer feedback").

   Each state also carries a distinct glyph — a tick for correct, a cross for
   incorrect — so the meaning never depends on colour alone. That matters:
   under protanopia green and maroon are hard to tell apart, and roughly 1 in
   12 men has some form of red-green colour blindness.
   -------------------------------------------------------------------------- */

/* The answer state owns the marker outright.

   These rules deliberately do NOT go through the input's state. Once an answer
   is locked the radio is disabled, and any rule a future change adds for
   "disabled" or "checked" inputs would otherwise out-specify these and
   silently repaint a locked answer in the brand blue. Selecting the state
   through the wrapper class instead means the input's own pseudo-classes
   cannot interfere at all.

   The rules are written with the wrapper's state classes only, which keeps
   them independent of how the input is marked up. */
.option.option--correct.option--answered .option__marker {
  background-color: var(--color-correct);
  border-color: var(--color-correct);
  color: var(--color-surface);
}

.option.option--correct.option--answered > label {
  border-color: var(--color-correct);
  background-color: var(--color-wash-correct);
}

.option.option--incorrect.option--answered .option__marker {
  background-color: var(--color-incorrect);
  border-color: var(--color-incorrect);
  color: var(--color-surface);
}

.option.option--incorrect.option--answered > label {
  border-color: var(--color-incorrect);
  background-color: var(--color-wash-incorrect);
}

/* The glyph replaces the A/B/C/D letter once an answer is locked in. */
.option__marker--result {
  font-size: 1.0625rem;
  line-height: 1;
}

.option--muted label {
  opacity: 0.55;
  cursor: default;
}

/* A locked option is made inert rather than disabled, so that no
   ":disabled" selector can ever match it and out-specify the answer-state
   rules below. The label stops taking pointer events; the answer itself is
   blocked in app.js via state.locked. */
.option[aria-disabled="true"] > label {
  pointer-events: none;
}

.feedback {
  margin-top: var(--space-4);
  border-left: 4px solid var(--color-primary);
  background-color: var(--color-wash);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-3) var(--space-4);
}

.feedback--correct {
  border-left-color: var(--color-correct);
}

.feedback--incorrect {
  border-left-color: var(--color-incorrect);
}

.feedback__verdict {
  font-family: var(--font-headings);
  font-weight: 700;
  margin: 0 0 var(--space-2);
  color: var(--color-neutral-dark);
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

/* The verdict glyph repeats the marker glyph so the panel states the
   outcome in words, a symbol and a colour — not colour alone. */
.feedback__glyph {
  flex: none;
  font-size: 1.125rem;
  line-height: 1;
}

.feedback--correct .feedback__glyph {
  color: var(--color-correct);
}

.feedback--incorrect .feedback__glyph {
  color: var(--color-incorrect);
}

.feedback__reference {
  font-size: 0.875rem;
  margin: 0;
  color: var(--color-neutral-dark);
}

.feedback__reference:empty {
  display: none;
}

.feedback__explanation {
  font-size: 0.9375rem;
  color: var(--color-neutral-dark);
}

.feedback__explanation:empty {
  display: none;
}

.feedback__explanation p {
  margin: var(--space-2) 0 0;
}

/* Styled HTML content (explanations). Applied to the feedback panel's
   explanation block and to the review list's Rulebook text. */
.prose {
  font-size: 0.9375rem;
  color: var(--color-neutral-dark);
}

/* --------------------------------------------------------------------------
   Explanation prose (Rulebook text)

   The Rulebook excerpts contain paragraphs and nested lists, so the
   rendered output needs room to breathe. Lists are indented rather than
   bulleted where they came from numbered items, which keeps the
   "1. / a)" structure of the source visible.
   -------------------------------------------------------------------------- */

.prose p {
  margin: 0 0 var(--space-2);
}

.prose p:last-child {
  margin-bottom: 0;
}

/* Rulebook citations: the excerpt the authoring pipeline wraps each
   explanation in. Set off with a primary-coloured rule instead of the
   browser's default indent, and tightened to the prose spacing. */
.prose blockquote {
  margin: 0 0 var(--space-2);
  padding-left: var(--space-3);
  border-left: 3px solid var(--color-primary);
}

.prose blockquote > :last-child {
  margin-bottom: 0;
}

/* Section heading cited from the Rulebook ("2. Eligibility"). The global
   h3 is sized for app panels; inside prose it must sit under the panel
   titles (h2), so it steps down to body-emphasis size. */
.prose h3 {
  font-size: 1rem;
  margin: 0 0 var(--space-2);
}

.prose ol,
.prose ul {
  margin: 0 0 var(--space-2);
  padding-left: 1.4rem;
}

/* Rulebook numbering is decimal unless a list says otherwise. Browsers
   default a nested <ol>'s markers to letters, which would render a
   decimal sub-item's value="1" as "a." — pin the style so the number an
   author writes is the number that shows. The pin targets type-less
   lists only: any author list-style-type outranks the type attribute's
   presentational hint, and typing that hint (lower-alpha for "a",
   upper-alpha for "A", ...) is case-correct in the browser's own
   engine. The ol[type] rules below still letter the sub-lists that ask
   for it, in engines that support the s modifier. */
.prose ol:not([type]) {
  list-style-type: decimal;
}

/* Sub-lists that carry the Rulebook's own letters keep their marker
   style at any nesting depth. (type="1" needs no rule: decimal is what
   the browser's own hint gives it.) The two-value list-style-type is
   progressive enhancement; the plain lower-alpha line is the fallback.

   Case matters here, and in HTML documents CSS matches the type
   attribute's value case-INSENSITIVELY — HTML defines it that way
   because of <input type> — so an unflagged [type="a"] also matches
   type="A" and vice versa. Only the [attr val s] modifier distinguishes
   them. There is deliberately no unflagged fallback: on an engine
   without the modifier these rules simply don't match, and the type
   attribute's presentational hint renders the list with its correct
   case — strictly better than an unflagged rule forcing every lettered
   list to one case. */
.prose ol[type="a" s] {
  list-style-type: lower-alpha;
  list-style-type: lower-alpha ")";
}

/* Upper-alpha and Roman Rulebook numbering, matching the citations'
   "A."/"i." dot style — the browser's own marker separators. */
.prose ol[type="A" s] {
  list-style-type: upper-alpha;
}

.prose ol[type="i" s] {
  list-style-type: lower-roman;
}

.prose ol[type="I" s] {
  list-style-type: upper-roman;
}

.prose li {
  margin-bottom: var(--space-1);
}

.prose li:last-child {
  margin-bottom: 0;
}

.prose strong {
  font-family: var(--font-headings);
  font-weight: 700;
}

.prose code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background-color: var(--color-wash);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.1em 0.35em;
}

/* --------------------------------------------------------------------------
   Results screen
   -------------------------------------------------------------------------- */

.card--results {
  text-align: center;
}

.result-badge {
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-3);
  margin-bottom: var(--space-4);
}

.result-badge__eyebrow {
  margin: 0 0 var(--space-1);
  font-family: var(--font-headings);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.85;
}

.result-badge__title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: inherit;
}

/* The heading colour is set inline to match the badge background, so the
   outline needs to follow it too. */
.result-badge__title:focus-visible {
  outline: 3px solid var(--color-neutral-dark);
  outline-offset: 3px;
}

.result-badge__score {
  margin: var(--space-2) 0 0;
  font-family: var(--font-headings);
  font-weight: 600;
  font-size: 1rem;
}

.result-summary {
  font-size: 1rem;
  margin-bottom: var(--space-3);
}

.result-nudge {
  border-left: 4px solid var(--color-accent);
  background-color: var(--color-wash);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-3);
  margin: 0 0 var(--space-4);
  text-align: left;
}

.card__actions--results {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin-top: 0;
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Review list
   -------------------------------------------------------------------------- */

.review {
  margin-top: var(--space-5);
}

.review__heading {
  margin-bottom: var(--space-2);
}

.review__lede {
  margin-bottom: var(--space-4);
  color: var(--color-neutral-dark);
}

.review__list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}

.review-item {
  border: 1px solid var(--color-border);
  border-left-width: 4px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
  background-color: var(--color-surface);
}

.review-item--correct {
  border-left-color: var(--color-correct);
}

.review-item--incorrect {
  border-left-color: var(--color-incorrect);
}

.review-item__question {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 var(--space-2);
  color: var(--color-primary);
}

.review-item__status {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-family: var(--font-headings);
  font-weight: 700;
  margin: 0 0 var(--space-2);
  color: var(--color-neutral-dark);
}

.review-item__glyph {
  flex: none;
  font-size: 1rem;
  line-height: 1;
}

.review-item--correct .review-item__glyph {
  color: var(--color-correct);
}

.review-item--incorrect .review-item__glyph {
  color: var(--color-incorrect);
}

.review-item__row {
  margin: 0 0 var(--space-1);
  font-size: 0.9375rem;
  display: flex;
  gap: var(--space-2);
}

.review-item__label {
  flex: none;
  min-width: 8.5rem;
  font-family: var(--font-headings);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-secondary);
  padding-top: 0.15rem;
}

.review-item__value {
  flex: 1;
  color: var(--color-neutral-dark);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-6);
  padding-top: var(--space-4);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: space-between;
  align-items: center;
}

.site-footer__note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-neutral-dark);
  max-width: 30rem;
}

.site-footer__link {
  font-family: var(--font-headings);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.8125rem;
  color: var(--color-secondary);
  text-decoration: none;
  border-bottom: 2px solid var(--color-secondary);
  padding-bottom: 2px;
}

.site-footer__link:hover,
.site-footer__link:focus-visible {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   Small screens
   -------------------------------------------------------------------------- */

@media (max-width: 32rem) {
  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-header__title {
    font-size: 1.25rem;
  }

  .card {
    padding: var(--space-3);
  }

  .length-option label {
    min-width: 3.75rem;
  }
}

/* --------------------------------------------------------------------------
   Print — BRIEF §3.3 requires a print-friendly stylesheet
   -------------------------------------------------------------------------- */

@media print {
  .site-header,
  .site-footer,
  .skip-link,
  .card__actions,
  .quiz-progress {
    display: none !important;
  }

  body {
    padding: 0;
  }

  .card {
    border: 0;
    padding: 0;
  }

  .option {
    break-inside: avoid;
  }

  /* The results screen is the thing being printed, so its badge and
     review list must survive. The badge keeps its background colour (it is
     how the tier is conveyed), but drops its shadow-free padding so it
     prints compactly. */
  .card--results {
    text-align: left;
  }

  .result-badge {
    border: 1px solid var(--color-border);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding: var(--space-3);
  }

  .review__lede {
    display: none;
  }

  /* Keep each question's review entry whole rather than splitting it across
     a page break. */
  .review-item {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    padding: var(--space-2) 0;
  }

  .review-item__label {
    min-width: 7.5rem;
  }
}

/* --------------------------------------------------------------------------
   Answer states

   Correct answers use green and incorrect answers use red/maroon. These are
   semantic status colours rather than brand colours, permitted by the
   UI guardrails in docs/DESIGN.md ("semantic status colours for correct and
   incorrect answer feedback").

   Each state also carries a distinct glyph - a tick for correct, a cross for
   incorrect - so the meaning never depends on colour alone. That matters:
   under protanopia green and maroon are hard to tell apart, and roughly 1 in
   12 men has some form of red-green colour blindness.

   These rules are deliberately LAST in the stylesheet, and are keyed off the
   wrapper's state classes rather than the input's pseudo-classes. That is what
   makes them robust: an earlier version styled the "selected" look with the
   ":checked" pseudo-class, so the selected rule and these answer-state rules
   competed on specificity, and adding a single later rule (a ":hover"
   variant, say) silently repainted a locked answer in the brand blue. Now the
   selected look is driven by a "data-selected" attribute that the app removes
   the moment the answer is locked, the two states never overlap, and any
   future rule about ":checked" or ":disabled" inputs cannot reach these.
   -------------------------------------------------------------------------- */

/* The answer state owns the marker outright.

   These rules are keyed off the wrapper's state attribute, not the input's
   pseudo-classes, so they cannot be out-specified by a rule written against
   ":checked" or ":disabled" inputs. An earlier version styled the "selected"
   look with ":checked", which made the selected rule and these answer-state
   rules compete on specificity: adding a single later rule (a ":hover"
   variant, say) silently repainted a locked answer in the brand blue.

   Now the selected look is driven by a "data-selected" attribute that the app
   removes the moment the answer is locked, a locked option is made inert with
   "aria-disabled" rather than "disabled", and these rules sit at the end of
   the stylesheet. The states cannot overlap, so nothing can reach them by
   accident. */
.option[data-answered="correct"] > label {
  border-color: var(--color-correct);
  background-color: var(--color-wash-correct);
}

.option[data-answered="correct"] .option__marker {
  background-color: var(--color-correct);
  border-color: var(--color-correct);
  color: var(--color-surface);
}

.option[data-answered="incorrect"] > label {
  border-color: var(--color-incorrect);
  background-color: var(--color-wash-incorrect);
}

.option[data-answered="incorrect"] .option__marker {
  background-color: var(--color-incorrect);
  border-color: var(--color-incorrect);
  color: var(--color-surface);
}
