/* FBCing — /quiz/ Where the Money Goes.
   Loads after /styles.css, which supplies the tokens, self-hosted IBM Plex
   Sans, the shell, the type scale and .button. This file adds only what the
   quiz needs: the top band, the question and its answer cards (the same
   cards as /start/), the quick-number ranges, the result and its doors, and
   the no-JavaScript fallback. No inline styles anywhere; the CSP's
   style-src 'self' is unchanged. Bar widths are set from quiz.js through
   the CSSOM, which the CSP permits. */

/* ---------- PAGE ---------- */

.quiz-body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.quiz-main {
  flex: 1 0 auto;
  padding-block: var(--gap-rule-content) var(--gap-section);
}

/* ---------- TOP BAND ----------
   The hero's Ink band reduced to a strip carrying the wordmark, as on /start/.
   Here the mark links home, since the quiz is a public page. */

.quiz-top {
  background-color: var(--ink);
  color: var(--paper);
  padding-block: var(--s-3);
}

.quiz-mark {
  display: inline-block;
  line-height: 0;
}

.quiz-mark svg {
  display: block;
  width: 136px;
  height: auto;
}

.quiz-mark:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 4px;
}

/* ---------- NAV ROW AND PROGRESS ---------- */

.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  min-height: 44px;
  max-width: var(--measure-body);
  margin-block-end: var(--s-1);
}

.quiz-nav[hidden] { display: none; }

.quiz-back {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 10px 12px 10px 0;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--slate);
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}

.quiz-back:hover { color: var(--ink); }
.quiz-back:focus-visible { outline: 2px solid var(--ledger); outline-offset: 2px; }
.quiz-back[hidden] { display: none; }

.quiz-progress {
  margin: 0;
  margin-inline-start: auto;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--slate);
}

/* A hairline track with a Ledger fill: the only progress indicator. */
.quiz-bar {
  position: relative;
  height: 2px;
  max-width: var(--measure-body);
  background-color: var(--rule);
  margin-block-end: var(--gap-rule-content);
}

.quiz-bar[hidden] { display: none; }

.quiz-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background-color: var(--ledger);
  transition: width 200ms ease;
}

/* ---------- STEPS ---------- */

.quiz-step[hidden] { display: none; }

.quiz-title {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: var(--measure-body);
  text-wrap: balance;
}

.quiz-lead {
  margin-block-start: var(--gap-rule-content);
}

.quiz-note {
  margin-block-start: var(--gap-paragraph);
  color: var(--slate);
}

.quiz-step .button {
  margin-block-start: var(--gap-subhead-button);
}

.quiz-eyebrow {
  margin: 0;
  margin-block-end: var(--s-1);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--slate);
}

.quiz-q {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
  margin-block-end: var(--gap-rule-content);
  max-width: var(--measure-body);
  color: var(--ink);
  text-wrap: balance;
  hyphens: none;
}

.quiz-q:focus { outline: none; }

/* ---------- QUICK NUMBERS ----------
   Six labelled rows; each range is a small card, so the tap target and the
   selected state match the sixteen questions that follow. */

.quick {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--measure-body);
}

.quick li {
  padding-block: var(--gap-row-pad);
  border-block-end: 1px solid var(--rule);
}

.quick li:first-child { padding-block-start: 0; }

.quick__label {
  display: block;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  margin-block-end: var(--s-1);
}

.quick__ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.range {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 8px 14px;
  min-height: 44px;
  border: 1px solid var(--mist);
  border-radius: 4px;
  background-color: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.range:hover { border-color: var(--slate); }
.range:focus-visible { outline: 2px solid var(--ledger); outline-offset: 2px; }
.range[aria-pressed="true"] {
  background-color: var(--ledger);
  border-color: var(--ledger);
  color: var(--paper);
}

.quiz-signal {
  margin-block-start: var(--gap-paragraph);
  max-width: var(--measure-body);
  color: var(--slate);
}

.quiz-signal[hidden] { display: none; }

.button[disabled] {
  background-color: var(--mist);
  border-color: var(--mist);
  cursor: default;
}

/* ---------- ANSWER CARDS ----------
   Identical to /start/: the whole card is the button, 64px minimum,
   Ledger fill when selected. */

.quiz-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: var(--measure-body);
}

.card {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  padding: 18px 20px;
  min-height: 64px;
  border: 1px solid var(--mist);
  border-radius: 4px;
  background-color: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
  text-align: left;
  text-wrap: pretty;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.card:hover { border-color: var(--slate); }
.card:focus-visible { outline: 2px solid var(--ledger); outline-offset: 2px; }
.card[aria-pressed="true"] {
  background-color: var(--ledger);
  border-color: var(--ledger);
  color: var(--paper);
}

.quiz[data-busy="true"] .card:not([aria-pressed="true"]) {
  color: var(--slate);
  pointer-events: none;
}

/* ---------- RESULT ----------
   Four scores as Ledger rules on hairline tracks, banded in words. */

.scores {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--measure-body);
}

.scores li {
  padding-block: var(--s-2) var(--s-3);
}

.scores__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-2);
  font-size: 18px;
  line-height: 1.4;
}

.scores__band {
  color: var(--slate);
  font-size: 15px;
  white-space: nowrap;
}

.scores__n {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.scores__track {
  position: relative;
  height: 1px;
  margin-block-start: 10px;
  background-color: var(--rule);
}

.scores__track i {
  position: absolute;
  top: -1px;
  left: 0;
  height: 3px;
  width: 0;
  background-color: var(--ledger);
}

.finding {
  max-width: var(--measure-body);
  margin-block-start: var(--gap-rule-content);
}

.finding:focus { outline: none; }

.finding h2 {
  font-size: 26px;
  margin-block-end: var(--s-2);
}

.finding p + p { margin-block-start: var(--gap-paragraph); }

.finding .quiz-note { margin-block-start: var(--s-2); }

.quiz-line {
  max-width: var(--measure-body);
  margin-block-start: var(--gap-section);
  padding-block-start: var(--gap-rule-content);
  border-block-start: 1px solid var(--rule);
}

.doors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-5);
  margin-block-start: var(--gap-rule-content);
}

@media (max-width: 639px) {
  .doors { grid-template-columns: 1fr; }
}

.door__title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
  margin: 0;
  padding-block-end: var(--s-1);
  border-block-end: 2px solid var(--ledger);
}

.door__desc {
  margin-block-start: var(--s-2);
  font-size: 17px;
  color: var(--slate);
}

/* The heading is the link: the Ledger rule beneath it is the cue, as on the
   homepage hero. Padding keeps the tap target at 44px without moving the text. */
.door__link {
  display: block;
  padding-block: 8px;
  margin-block: -8px;
  color: var(--ink);
  text-decoration: none;
}

/* Buttons on the Paper ground: the outlined one takes Ledger text here
   (4.7:1 on Paper), where the hero's Paper text would vanish. Both sit
   16px under the description, the site's label-to-control gap. */
.door .button {
  margin-block-start: var(--s-2);
}

.button--on-paper {
  color: var(--ledger);
}

.button--on-paper:hover {
  color: var(--paper);
}

.door__link:focus-visible { outline: 2px solid var(--ledger); outline-offset: 2px; }

.quiz-restart {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  margin: 0;
  margin-block-start: var(--gap-section);
  padding: 10px 0;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--slate);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.quiz-restart:hover { color: var(--ink); }
.quiz-restart:focus-visible { outline: 2px solid var(--ledger); outline-offset: 2px; }

/* ---------- NO JAVASCRIPT ---------- */

.quiz-nojs[hidden] { display: none; }

.quiz-nojs p + p { margin-block-start: var(--gap-paragraph); }

.quiz-nojs .button { margin-block-start: var(--gap-subhead-button); }

@media (prefers-reduced-motion: reduce) {
  .card, .range, .quiz-bar i { transition: none; }
}

.quiz-app {
  margin-block-start: var(--s-4);
  max-width: var(--measure-body);
  font-size: 15px;
  line-height: 1.45;
  color: var(--slate);
}

.quiz-app__link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.quiz-app__link:focus-visible { outline: 2px solid var(--ledger); outline-offset: 2px; }
