/* Where's Nigel — design tokens + components (from design/mockup, see HANDOFF.md).
   Crisp White palette, Cooper Hewitt throughout, sharp corners, rubber-stamp verdicts. */

/* Cooper Hewitt (SIL OFL 1.1), self-hosted: Fontsource build, latin subset */
@font-face { font-family: "Cooper Hewitt"; font-weight: 400; font-display: swap; src: url("/fonts/cooper-hewitt-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Cooper Hewitt"; font-weight: 500; font-display: swap; src: url("/fonts/cooper-hewitt-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cooper Hewitt"; font-weight: 600; font-display: swap; src: url("/fonts/cooper-hewitt-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cooper Hewitt"; font-weight: 700; font-display: swap; src: url("/fonts/cooper-hewitt-latin-700-normal.woff2") format("woff2"); }

:root {
  /* one family for everything; display = headings, numbers, stamps */
  --font-body: "Cooper Hewitt", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
  --font-display: "Cooper Hewitt", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;

  /* palette "Crisp White": navy brand, clear blue = you, green = the answer / right,
     red = wrong / errors only. Every pair checked to WCAG AA in light and dark. */

  /* light */
  --bg: #F3F6F9;
  --surface: #FFFFFF;
  --surface-2: #F7F9FB;
  --ink: #0F1C2B;
  --ink-2: #4A5866;
  --line: #D8E0E8;
  --line-strong: #7D8B99;
  --brand: #0B3C5D;       /* navy */
  --brand-ink: #FFFFFF;
  --brand-tint: #E7EEF4;
  --you: #0A72AE;         /* clear blue */
  --you-tint: #E2F1FA;
  --answer: #1E7342;      /* green */
  --answer-tint: #E4F3EA;
  --ok: #1E7342;
  --ok-tint: #E4F3EA;
  --no: #C62828;          /* red */
  --no-tint: #FDF1F1;
  --bar: #BCC7D2;
  --skeleton: #E3E9EF;
  --focus: #0A72AE;

  --r-sm: 0;
  --r-md: 0;
  --r-lg: 0;
  --r-pill: 2px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;

  --t-xs: 12px;
  --t-sm: 14px;
  --t-md: 16px;
  --t-lg: 20px;
  --t-xl: 26px;
  --t-2xl: 40px;
  --t-3xl: 56px;

  --shadow-1: 0 1px 0 rgba(15, 28, 43, .05), 0 1px 3px rgba(15, 28, 43, .08);
  --shadow-2: 0 8px 24px rgba(15, 28, 43, .14);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B141D;
    --surface: #121E2A;
    --surface-2: #182634;
    --ink: #E8EEF4;
    --ink-2: #A6B4C3;
    --line: #2B3A4C;
    --line-strong: #5E7186;
    --brand: #A9CBE8;
    --brand-ink: #0B141D;
    --brand-tint: #1C2E42;
    --you: #5AB4EA;
    --you-tint: #15304A;
    --answer: #6CCB8E;
    --answer-tint: #15301F;
    --ok: #6CCB8E;
    --ok-tint: #15301F;
    --no: #FF8A80;
    --no-tint: #3A1A18;
    --bar: #4A5D72;
    --skeleton: #223042;
    --focus: #5AB4EA;
    --shadow-1: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B141D;
  --surface: #121E2A;
  --surface-2: #182634;
  --ink: #E8EEF4;
  --ink-2: #A6B4C3;
  --line: #2B3A4C;
  --line-strong: #5E7186;
  --brand: #A9CBE8;
  --brand-ink: #0B141D;
  --brand-tint: #1C2E42;
  --you: #5AB4EA;
  --you-tint: #15304A;
  --answer: #6CCB8E;
  --answer-tint: #15301F;
  --ok: #6CCB8E;
  --ok-tint: #15301F;
  --no: #FF8A80;
  --no-tint: #3A1A18;
  --bar: #4A5D72;
  --skeleton: #223042;
  --focus: #5AB4EA;
  --shadow-1: none;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.contents { display: contents; } /* wrapper that keeps its children in the parent grid */
.app {
  min-height: 100vh;
  padding: var(--s-5) var(--s-4) var(--s-7);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-md);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
}
.app a { color: var(--brand); }
.app :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.col { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s-4); }
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* icons: inline stroke SVG */
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i--sm { width: 14px; height: 14px; stroke-width: 2.4; }
.i--lg { width: 28px; height: 28px; }

/* ---------- masthead (S1, S4) ---------- */
.masthead { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-2) 0 var(--s-3); }
.mark {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink);
}
.masthead h1 {
  margin: 0; font-family: var(--font-display); font-weight: 700;
  font-size: var(--t-xl); line-height: 1.15; letter-spacing: -.01em;
}
.masthead p { margin: 0; color: var(--ink-2); }
.masthead .lead { color: var(--ink); font-size: 17px; }

/* slim top bar (S2, S3) */
.topbar { display: flex; align-items: center; gap: var(--s-3); }
.topbar .mark { width: 36px; height: 36px; }
.topbar .mark .i { width: 18px; height: 18px; }
.topbar h1 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: var(--t-md); line-height: 1.25; }

/* ---------- question card ---------- */
.q {
  position: relative; min-width: 0; margin: 0;
  padding: var(--s-5) var(--s-4) var(--s-4);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-1);
}
.q > legend {
  float: left; width: 100%; padding: 0; margin: 0 0 var(--s-4);
  display: flex; gap: var(--s-3); align-items: flex-start;
  font-weight: 650; font-size: var(--t-lg); line-height: 1.3;
}
.q > legend + * { clear: both; }
.q__num {
  flex: none; margin-top: 1px; padding: 2px 8px; border-radius: 2px;
  font-family: var(--font-display); font-size: var(--t-sm); font-weight: 600; line-height: 1.5;
  background: var(--brand-tint); color: var(--brand);
}
.q__flag { flex: none; margin-left: auto; color: var(--no); display: inline-flex; }
.q--error { border-color: var(--no); box-shadow: 0 0 0 1.5px var(--no); }
.q--error .q__num { background: var(--no-tint); color: var(--no); }

/* choice options (radio cards) */
.opts { display: grid; gap: var(--s-2); }
.opts--dest { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 600px) { .opts--dest { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.opts--dest .opt__tick, .opts--2 .opt__tick { position: absolute; top: 8px; right: 8px; } /* corner tick keeps the text column wide */
.opts--2 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 400px) { .opts--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.opt {
  position: relative; display: flex; align-items: center; gap: var(--s-3);
  min-height: 52px; padding: var(--s-3);
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); font-weight: 500; line-height: 1.25; cursor: pointer;
}
.opt:hover { border-color: var(--line-strong); }
.opt input {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; cursor: pointer;
}
.opt input::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand); transform: scale(0); transition: transform .12s ease-out;
}
.opt input:checked { border-color: var(--brand); }
.opt input:checked::before { transform: scale(1); }
.opt input:focus-visible { outline: none; }
.opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--brand); }
.opt__text { min-width: 0; }
.opt__tick { margin-left: auto; color: var(--brand); opacity: 0; }
.opt:has(input:checked) .opt__tick { opacity: 1; }

/* write-in */
.writein-toggle {
  display: flex; align-items: center; gap: var(--s-2); width: 100%;
  min-height: 48px; margin-top: var(--s-3); padding: var(--s-2) var(--s-3);
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-md);
  background: transparent; color: var(--brand); font: inherit; font-weight: 600;
  text-align: left; cursor: pointer;
}
.writein-toggle[aria-expanded="true"] { border-style: solid; border-color: var(--brand); background: var(--brand-tint); }
.writein { margin-top: var(--s-3); display: flex; flex-direction: column; gap: var(--s-2); }

/* fields */
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field > label { font-weight: 650; }
.input {
  width: 100%; min-height: 48px; padding: var(--s-3);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); font: inherit;
}
.input::placeholder { color: var(--ink-2); }
.input--error { border-color: var(--no); box-shadow: 0 0 0 1px var(--no); }
.hint { margin: 0; display: flex; gap: 6px; align-items: flex-start; font-size: var(--t-sm); color: var(--ink-2); }
.hint .i { margin-top: 2px; }
.hint--error { color: var(--no); font-weight: 600; }
.count { margin-left: auto; padding-left: var(--s-2); font-family: var(--font-display); font-size: var(--t-xs); white-space: nowrap; }

/* 1–10 scale: 2 rows of 5 on phones, 1 row of 10 from 600px */
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-2); }
@media (min-width: 600px) { .scale { grid-template-columns: repeat(10, minmax(0, 1fr)); } }
.scale__opt {
  position: relative; display: grid; place-items: center; min-height: 48px;
  border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  font-family: var(--font-display); font-weight: 600; font-size: var(--t-lg); cursor: pointer;
}
.scale__opt:hover { border-color: var(--line-strong); }
.scale__opt input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.scale__opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.scale__opt:has(input:checked) { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.scale__opt:has(input:checked)::after {
  content: ""; position: absolute; top: 5px; right: 5px;
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.scale-ends { display: flex; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-3); font-size: var(--t-sm); color: var(--ink-2); line-height: 1.35; }
.scale-ends > span { flex: 1 1 0; min-width: 0; }
.scale-ends > span:last-child { text-align: right; }
.scale-ends b { display: block; font-family: var(--font-display); color: var(--ink); }

/* submit zone */
.submit-zone { display: flex; flex-direction: column; gap: var(--s-4); padding-top: var(--s-2); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-5);
  border: 1.5px solid transparent; border-radius: var(--r-md);
  font: inherit; font-weight: 650; line-height: 1.2; text-decoration: none; cursor: pointer;
}
.btn--primary { background: var(--brand); color: var(--brand-ink); }
.btn--primary:hover { filter: brightness(1.12); }
.btn--secondary { background: var(--surface); color: var(--brand); border-color: var(--line-strong); }
.btn--secondary:hover { border-color: var(--brand); }
.btn--block { width: 100%; }
.btn--xl { min-height: 60px; font-family: var(--font-display); font-size: var(--t-lg); letter-spacing: .02em; }
.btn[disabled] { cursor: progress; opacity: .75; filter: none; }
.spinner {
  width: 18px; height: 18px; flex: none; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* alerts + banners */
.alert {
  display: flex; gap: var(--s-3); align-items: flex-start;
  padding: var(--s-3) var(--s-4); border: 1.5px solid; border-radius: var(--r-md);
  font-weight: 600; line-height: 1.4;
}
.alert p { margin: 0; }
.alert .i { margin-top: 1px; }
.alert--error { background: var(--no-tint); border-color: var(--no); color: var(--no); }
.banner {
  display: flex; gap: var(--s-3); align-items: flex-start;
  padding: var(--s-4); border-radius: var(--r-lg);
  background: var(--brand); color: var(--brand-ink);
}
.banner .i { margin-top: 3px; }
.banner__title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: var(--t-lg); line-height: 1.3; }
.banner__note { margin: var(--s-1) 0 0; }

/* stamps (verdicts + rank) */
.stamp {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border: 2px solid currentColor; border-radius: 2px;
  font-family: var(--font-display); font-weight: 700; font-size: var(--t-sm);
  text-transform: uppercase; letter-spacing: .06em; line-height: 1.4;
  transform: rotate(-2deg);
}
.stamp--ok { color: var(--ok); background: var(--ok-tint); }
.stamp--no { color: var(--no); background: var(--no-tint); }
.stamp--rank { color: var(--brand); background: var(--brand-tint); font-size: var(--t-md); padding: 4px 12px; }

/* pills (chart markers) */
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px;
  border-radius: var(--r-pill); white-space: nowrap;
  font-family: var(--font-display); font-size: var(--t-xs); font-weight: 700; line-height: 1.6;
}
.pill--you { background: var(--you); color: var(--surface); }
.pill--answer { background: var(--answer); color: var(--surface); }
.pill--avg { background: var(--surface); color: var(--ink); border: 1.5px dashed var(--ink-2); }

/* ---------- dashboard ---------- */
.dash { max-width: 960px; margin: 0 auto; display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 880px) {
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span2 { grid-column: 1 / -1; }
}
.opener { margin: 0; font-family: var(--font-display); font-size: var(--t-sm); color: var(--ink-2); }
.card {
  min-width: 0; padding: var(--s-4);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-1);
}
.card h2 { margin: 0; font-size: var(--t-lg); line-height: 1.3; }
.card__head { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); align-items: flex-start; justify-content: space-between; margin-bottom: var(--s-4); }
/* A long stamp ("Close enough, point awarded") wraps under the heading instead of squeezing it. */
.card__head h2 { flex: 1 1 12rem; min-width: 0; }
.sub { margin: var(--s-1) 0 var(--s-4); font-size: var(--t-sm); color: var(--ink-2); }

/* reveal hero */
.hero { padding: 0; overflow: hidden; display: grid; grid-template-areas: "head" "photo" "msg"; }
.hero__head { grid-area: head; padding: var(--s-4) var(--s-4) var(--s-3); }
.hero__label { margin: 0; font-family: var(--font-display); font-size: var(--t-sm); color: var(--ink-2); }
.hero__dest { margin: 2px 0 0; font-family: var(--font-display); font-weight: 700; font-size: var(--t-3xl); line-height: 1.05; letter-spacing: -.02em; }
.hero__photo { grid-area: photo; margin: 0; }
.photo {
  aspect-ratio: 16 / 9; display: grid; place-items: center; color: var(--ink-2);
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 14px, var(--skeleton) 14px 28px);
}
.hero__photo figcaption { padding: var(--s-2) var(--s-4) 0; font-size: var(--t-sm); color: var(--ink-2); }
.message {
  grid-area: msg; margin: var(--s-3) var(--s-4) var(--s-4); padding: var(--s-3) var(--s-4);
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); background: var(--surface-2);
}
.message p { margin: 0; }
.hero--bare .hero__head { padding: var(--s-5) var(--s-4); }
@media (min-width: 880px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-areas: "head photo" "msg photo"; align-content: start; }
  .hero__head { padding: var(--s-6) var(--s-6) var(--s-3); }
  .message { margin: 0 var(--s-6) var(--s-6); align-self: start; }
  .hero__photo { display: flex; flex-direction: column; padding-bottom: var(--s-3); }
  .hero__dest { font-size: 80px; }
  .hero--bare { grid-template-columns: 1fr; grid-template-areas: "head"; }
}

/* score + crowd */
.score__line { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-2); font-size: var(--t-lg); font-weight: 650; }
.score__big { font-family: var(--font-display); font-size: var(--t-2xl); line-height: 1; font-weight: 700; }
.score__rank { margin: var(--s-3) 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); font-weight: 650; }
.score__quip { margin: var(--s-2) 0 0; color: var(--ink-2); }
.stat { margin: 0; display: flex; gap: var(--s-3); align-items: flex-start; }
.stat + .stat { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--line); }
.stat > .i { margin-top: 3px; color: var(--brand); }
.stat strong { font-family: var(--font-display); font-size: var(--t-lg); }

/* choice bars */
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.bar__row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.bar__label { min-width: 0; font-weight: 550; }
.bar__meta { margin-left: auto; white-space: nowrap; font-family: var(--font-display); font-size: var(--t-sm); color: var(--ink-2); }
.bar__track { height: 12px; margin-top: 6px; overflow: hidden; border-radius: 0; background: var(--surface-2); border: 1px solid var(--line); }
.bar__fill { height: 100%; border-radius: inherit; background: var(--bar); transform-origin: left; animation: grow .7s ease-out both; }
.bar--you .bar__fill { background: var(--you); }
.bar--answer .bar__fill { background: var(--answer); }
@keyframes grow { from { transform: scaleX(0); } }

/* 1–10 histogram */
.histo { position: relative; padding-top: 34px; }
.histo__cols {
  height: 120px; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; align-items: end;
  border-bottom: 1.5px solid var(--line-strong);
}
.histo__col { min-height: 0; border-radius: 0; background: var(--bar); transform-origin: bottom; animation: rise .7s ease-out both; }
.histo__col--you { background: var(--you); }
.histo__col--answer { background: var(--answer); }
.histo__col--you.histo__col--answer { box-shadow: inset 0 0 0 3px var(--you); }
@keyframes rise { from { transform: scaleY(0); } }
.histo__axis, .histo__marks { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.histo__axis { padding-top: 4px; text-align: center; font-family: var(--font-display); font-size: var(--t-xs); color: var(--ink-2); }
.histo__marks { margin-top: 6px; min-height: 22px; }
.histo__marks + .histo__marks { margin-top: 4px; }
.histo__mark { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.histo__avg { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--ink); }
.histo__avg .pill { position: absolute; top: 0; left: 0; transform: translateX(-50%); }
.histo__avgwrap { position: absolute; top: 0; left: 0; right: 0; height: 154px; }

/* wildcard chips */
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip {
  max-width: 100%; display: inline-flex; align-items: baseline; gap: var(--s-2);
  padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2); line-height: 1.35; overflow-wrap: anywhere;
}
.chip--lg { font-size: var(--t-lg); font-weight: 650; }
.chip--md { font-size: 17px; font-weight: 600; }
.chip__n { flex: none; white-space: nowrap; font-family: var(--font-display); font-size: var(--t-sm); font-weight: 700; color: var(--ink-2); }
.empty { margin: 0; padding: var(--s-4); border: 1.5px dashed var(--line); border-radius: var(--r-md); color: var(--ink-2); text-align: center; }

/* score distribution 0–5 */
.dist { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s-2); }
.dist__col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.dist__plot { width: 100%; height: 120px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; border-bottom: 1.5px solid var(--line-strong); }
.dist__n { font-family: var(--font-display); font-size: var(--t-xs); color: var(--ink-2); }
.dist__bar { width: 100%; border-radius: 0; background: var(--bar); transform-origin: bottom; animation: rise .7s ease-out both; }
.dist__col--you .dist__bar { background: var(--you); }
.dist__col--you .dist__n { color: var(--you); font-weight: 700; }
.dist__score { font-family: var(--font-display); font-weight: 600; }
.dist__mark { min-height: 22px; }

/* footer actions */
.actions { display: flex; flex-direction: column; gap: var(--s-3); }
.actions__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
.actions__row .btn--primary { flex: 1 1 200px; }
.updated { font-family: var(--font-display); font-size: var(--t-sm); color: var(--ink-2); }
.toast {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--ok-tint); color: var(--ok); font-weight: 700; font-size: var(--t-sm);
}

/* skeletons */
.sk { border-radius: var(--r-sm); background: var(--skeleton); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* holding screen (S4) + results failed */
.holding { display: flex; flex-direction: column; align-items: center; gap: var(--s-4); padding: var(--s-6) var(--s-5); text-align: center; }
.holding__icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); }
.holding__text { margin: 0; font-family: var(--font-display); font-size: var(--t-lg); font-weight: 600; line-height: 1.35; }

@media (min-width: 720px) {
  .app { padding: var(--s-7) var(--s-5) 64px; }
  .masthead h1 { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .app *, .app *::before, .app *::after { animation: none !important; transition: none !important; }
}

/* ---------- loading skeleton layout ---------- */
.sk-stack { display: flex; flex-direction: column; gap: var(--s-3); }
.sk-line { height: 14px; }
.sk-title { height: 52px; width: 200px; }
.sk-photo { aspect-ratio: 16 / 9; border-radius: 0; }
.sk-w30 { width: 30%; } .sk-w55 { width: 55%; } .sk-w60 { width: 60%; } .sk-w75 { width: 75%; } .sk-w90 { width: 90%; }
.sk-big { height: 36px; width: 180px; }
.sk-mid { height: 26px; width: 220px; }

/* ---------- app additions (not in the mockup) ---------- */
/* Turnstile mounts here; interaction-only, so it's usually empty and takes no space. */
.turnstile { display: flex; justify-content: center; }
.turnstile:empty { display: none; }
.hero__photo img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-2); }
.your-writein { margin: var(--s-3) 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-2); overflow-wrap: anywhere; }
.histo__avgwrap { pointer-events: none; }
@media (min-width: 880px) {
  .hero--nophoto { grid-template-columns: 1fr; grid-template-areas: "head" "msg"; }
}
.histo--noavg { padding-top: 0; }
