/* ==========================================================================
   Winville Cyber Day · design system and layout
   Palette is taken from the Winville logo: brick red #B93D48, charcoal #43434D
   and white. Sections: tokens, base, layout, components, sections, games,
   leaderboard, utilities, motion preferences.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --brand-red: #B93D48;
  --brand-red-hover: #A3343E;
  --brand-red-press: #8D2C35;
  --brand-red-tint: #F7E7E9;
  --brand-red-soft: #FCF3F4;
  --brand-red-light: #EE9EA5;   /* red text on dark surfaces */
  --brand-charcoal: #43434D;

  /* Neutrals */
  --ink-950: #141418;
  --ink-900: #1D1D23;
  --ink-800: #27272F;
  --ink-700: #34343D;
  --text: #1D1D23;
  --text-muted: #565661;
  --paper: #F6F5F2;
  --surface: #FFFFFF;
  --surface-2: #FAF9F7;
  --line: #E3E1DC;
  --line-strong: #CAC7C0;
  --on-dark: #F4F3F1;
  --on-dark-muted: #BDBCC4;
  --line-dark: #3B3B45;

  /* Status (always paired with an icon and text) */
  --ok: #1A6F42;
  --ok-bg: #E8F3EC;
  --ok-line: #A5D1B7;
  --warn: #875100;
  --warn-bg: #FFF4D9;
  --warn-line: #E6C47A;
  --err: #B0261E;
  --err-bg: #FCECEA;
  --err-line: #EBB0AB;

  /* Type */
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --fs-xs: .8125rem;
  --fs-sm: .875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: clamp(1.5rem, 2.6vw, 1.875rem);
  --fs-2xl: clamp(1.875rem, 4vw, 2.625rem);
  --fs-hero: clamp(2.25rem, 5.6vw, 4rem);

  /* Space (4px base) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  /* Shape and depth */
  --r-sm: 6px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 24, .06);
  --shadow-md: 0 8px 24px -10px rgba(20, 20, 24, .18);
  --shadow-lg: 0 28px 64px -16px rgba(20, 20, 24, .4);

  /* Motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 120ms;
  --t-med: 220ms;
  --t-slow: 420ms;

  --header-h: 64px;
  --focus: 0 0 0 3px var(--surface), 0 0 0 5px var(--brand-red);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: var(--brand-red); text-underline-offset: 3px; }
a:hover { color: var(--brand-red-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--brand-red); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand-red); color: #fff; }
kbd {
  font-family: var(--mono); font-size: .8em; padding: 1px 6px; border-radius: 4px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--surface);
}

.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.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;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink-900); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
  font-weight: 600; text-decoration: none; transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Layout ---------- */
.container { width: min(1160px, calc(100% - 32px)); margin-inline: auto; }
.section { padding-block: clamp(56px, 8vw, 96px); }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: 680px; margin-bottom: var(--s6); }
.section-head h2 { font-size: var(--fs-2xl); }
.section-head .lead { margin-top: var(--s3); color: var(--text-muted); font-size: var(--fs-md); }
.section[tabindex="-1"]:focus { outline: none; }

/* Kicker: small label with the logo's chevron as its marker */
.kicker {
  display: inline-flex; align-items: flex-start; gap: 10px; margin-bottom: var(--s3);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand-red);
}
.hero .kicker::before {
  content: ""; flex: none; width: 8px; height: 8px; margin-top: .55em;
  border-top: 2.5px solid currentColor; border-left: 2.5px solid currentColor;
  transform: rotate(45deg);
}
.on-dark .kicker { color: var(--brand-red-light); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: var(--s5); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-right: auto; }
.brand:hover { color: var(--text); }
.brand img { width: 40px; height: 40px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.0625rem; letter-spacing: .01em; }
.brand-text span { font-size: .6875rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }

.site-nav ul { list-style: none; display: flex; gap: var(--s1); }
.site-nav a {
  display: block; padding: 8px 12px; border-radius: var(--r-sm);
  color: var(--text-muted); font-weight: 600; font-size: var(--fs-sm); text-decoration: none;
  position: relative; transition: color var(--t-fast), background-color var(--t-fast);
}
.site-nav a:hover { color: var(--text); background: var(--paper); }
.site-nav a[aria-current="true"] { color: var(--text); }
.site-nav a[aria-current="true"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px;
  background: var(--brand-red); border-radius: 2px;
}
.header-actions { display: flex; align-items: center; gap: var(--s2); }
.player-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 180px;
  padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font-size: var(--fs-sm); font-weight: 600; text-decoration: none;
}
.player-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-chip .icon { color: var(--brand-red); width: 16px; height: 16px; }
.player-chip:hover { color: var(--text); border-color: var(--line-strong); }
.nav-toggle {
  display: none; width: 44px; height: 44px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); place-items: center;
}
.nav-toggle .icon { width: 22px; height: 22px; }

@media (max-width: 860px) {
  .nav-toggle { display: grid; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: var(--header-h);
    background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md);
    padding: var(--s2) 16px var(--s4);
    visibility: hidden; opacity: 0; transform: translateY(-6px);
    transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease), visibility 0s linear var(--t-med);
  }
  .site-nav.is-open { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: 12px; font-size: var(--fs-base); }
  .site-nav a[aria-current="true"]::after { left: 0; right: auto; top: 12px; bottom: 12px; width: 3px; height: auto; }
}
@media (max-width: 420px) {
  .brand-text span { display: none; }
  .player-chip { max-width: 120px; }
}

/* ---------- Offline banner ---------- */
.offline-banner {
  background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid var(--warn-line);
  font-size: var(--fs-sm); font-weight: 600;
}
.offline-banner .container { display: flex; align-items: center; gap: var(--s2); padding-block: 8px; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-bd: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r-sm);
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  font-weight: 600; font-size: var(--fs-sm); line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn .icon { width: 18px; height: 18px; }
.btn:hover { color: var(--btn-fg); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

.btn-primary { --btn-bg: var(--brand-red); --btn-fg: #fff; --btn-bd: var(--brand-red); box-shadow: 0 1px 2px rgba(141, 44, 53, .3); }
.btn-primary:hover:not(:disabled) { --btn-bg: var(--brand-red-hover); --btn-bd: var(--brand-red-hover); }
.btn-primary:active:not(:disabled) { --btn-bg: var(--brand-red-press); }
.btn-secondary:hover:not(:disabled) { --btn-bg: var(--surface-2); --btn-bd: var(--ink-700); }
.btn-dark { --btn-bg: var(--ink-900); --btn-fg: #fff; --btn-bd: var(--ink-900); }
.btn-dark:hover:not(:disabled) { --btn-bg: var(--ink-700); --btn-bd: var(--ink-700); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { --btn-bg: rgba(29, 29, 35, .05); --btn-fg: var(--text); }
.btn-outline-light { --btn-bg: transparent; --btn-fg: var(--on-dark); --btn-bd: rgba(255, 255, 255, .35); }
.btn-outline-light:hover:not(:disabled) { --btn-bg: rgba(255, 255, 255, .08); --btn-bd: rgba(255, 255, 255, .6); }
.on-dark .btn:focus-visible { box-shadow: 0 0 0 3px var(--ink-900), 0 0 0 5px var(--brand-red-light); }
.btn-sm { min-height: 36px; padding: 0 12px; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: var(--fs-base); }
.btn-block { width: 100%; }

/* ---------- Cards, badges, chips ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: .75rem; font-weight: 700; letter-spacing: .02em; line-height: 1.4;
  background: var(--paper); color: var(--text-muted); border: 1px solid var(--line);
}
.badge .icon { width: 13px; height: 13px; }
.badge-red { background: var(--brand-red-tint); color: var(--brand-red-press); border-color: #EFC9CD; }
.badge-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.badge-dark { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip {
  padding: 6px 12px; border-radius: var(--r-pill); background: var(--paper); border: 1px solid var(--line);
  font-size: var(--fs-sm); color: var(--text);
}

/* Progress bar */
.progress { height: 8px; border-radius: var(--r-pill); background: #ECEAE5; overflow: hidden; }
.progress > span {
  display: block; height: 100%; width: 0; border-radius: inherit; background: var(--brand-red);
  transition: width var(--t-slow) var(--ease);
}

/* ---------- Forms ---------- */
.form { display: grid; gap: var(--s4); }
.field { display: grid; gap: 6px; }
.label { font-weight: 600; font-size: var(--fs-sm); }
.hint { font-size: var(--fs-xs); color: var(--text-muted); }
.input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); font-size: var(--fs-base);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:hover { border-color: var(--ink-700); }
.input:focus-visible { outline: none; border-color: var(--brand-red); box-shadow: 0 0 0 3px rgba(185, 61, 72, .22); }
.input[aria-invalid="true"] { border-color: var(--err); background: #FFFBFA; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); }
.check input {
  width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--brand-red);
}
.check input:focus-visible { outline: 3px solid var(--brand-red); outline-offset: 2px; }
.field-error, .form-status {
  display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-sm); font-weight: 600; color: var(--err);
}
.field-error .icon, .form-status .icon { width: 16px; height: 16px; margin-top: 2px; }
.form-status { padding: 10px 12px; border-radius: var(--r-sm); background: var(--err-bg); border: 1px solid var(--err-line); }
.field-error:not([hidden]), .form-status:not([hidden]) { animation: fade-in var(--t-med) var(--ease); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--ink-900); color: var(--on-dark);
  padding-block: clamp(48px, 9vw, 112px) clamp(56px, 9vw, 112px);
}
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--s7); align-items: center; }
.hero h1 { font-size: var(--fs-hero); line-height: 1.04; letter-spacing: -.035em; max-width: 14ch; }
.hero-lead { margin-top: var(--s5); max-width: 56ch; color: var(--on-dark-muted); font-size: clamp(1rem, 1.6vw, 1.1875rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s6); }
.hero-logo { justify-self: end; width: min(300px, 100%); }
.hero-logo img { width: 100%; height: auto; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--s6); }
  .hero-logo { order: -1; width: 132px; justify-self: start; }
}
@media (max-width: 480px) {
  .hero-actions .btn { flex: 1 1 100%; }
}

/* ---------- Steps (how it works) ---------- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s6); }
.step { padding-top: var(--s4); border-top: 2px solid var(--ink-900); }
.step:first-child { border-top-color: var(--brand-red); }
.step-num { display: block; margin-bottom: var(--s2); font-size: var(--fs-sm); font-weight: 700; color: var(--brand-red); font-variant-numeric: tabular-nums; }
.step h3 { font-size: var(--fs-md); margin-bottom: var(--s2); }
.step p { color: var(--text-muted); font-size: var(--fs-sm); }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, 1fr); gap: var(--s5); } }
@media (max-width: 540px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Challenge list ---------- */
.challenge-progress { display: flex; align-items: center; gap: var(--s4); margin: calc(-1 * var(--s3)) 0 var(--s5); max-width: 520px; }
.challenge-progress p { font-size: var(--fs-sm); color: var(--text-muted); white-space: nowrap; }
.challenge-progress .progress { flex: 1; }
.ch-list { list-style: none; border-top: 1px solid var(--line-strong); }
.ch-row {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) 130px 170px auto; align-items: center; gap: var(--s4);
  padding: var(--s5) var(--s2); border-bottom: 1px solid var(--line-strong);
  transition: background-color var(--t-fast) var(--ease);
}
.ch-row:hover { background: var(--surface); }
.ch-num { font-size: var(--fs-sm); font-weight: 700; color: var(--brand-red); font-variant-numeric: tabular-nums; }
.ch-title { font-size: var(--fs-lg); }
.ch-blurb { color: var(--text-muted); font-size: var(--fs-sm); margin-top: 2px; }
.ch-meta { font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.5; }
.challenge-best { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.challenge-best .icon { width: 15px; height: 15px; }
.challenge-best.is-done { color: var(--ok); }
.challenge-icon { display: grid; place-items: center; color: var(--brand-red); }
.challenge-icon .icon { width: 22px; height: 22px; }
.challenge-icon.is-muted { color: var(--brand-charcoal); }
.challenge-icon.lg .icon { width: 30px; height: 30px; }
@media (max-width: 860px) {
  .ch-row { grid-template-columns: 36px minmax(0, 1fr) auto; gap: var(--s2) var(--s3); }
  .ch-main { grid-column: 2 / -1; }
  .ch-num { grid-row: 1; align-self: start; padding-top: 4px; }
  .ch-meta { grid-column: 2; }
  .ch-meta br { display: none; }
  .ch-meta { display: none; }
  .challenge-best { grid-column: 2; }
  .ch-row .btn { grid-column: 3; grid-row: 2; }
}

/* ---------- Awareness ---------- */
.habit-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s7); counter-reset: habit; }
.habit-list li { counter-increment: habit; position: relative; padding: var(--s4) 0 var(--s4) 44px; border-bottom: 1px solid var(--line); }
.habit-list li::before { content: counter(habit, decimal-leading-zero); position: absolute; left: 0; top: var(--s4); font-size: var(--fs-sm); font-weight: 700; color: var(--brand-red); font-variant-numeric: tabular-nums; line-height: 1.6; }
.habit-list h3 { font-size: var(--fs-md); margin-bottom: 4px; }
.habit-list p { color: var(--text-muted); font-size: var(--fs-sm); }
@media (max-width: 760px) { .habit-list { grid-template-columns: 1fr; } }
.subhead { font-size: var(--fs-xl); margin: var(--s7) 0 var(--s4); }

/* Accordion (details/summary) */
.accordion { display: grid; gap: var(--s2); }
.acc-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; transition: border-color var(--t-fast); }
.acc-item[open] { border-color: var(--line-strong); }
.acc-item > summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s4) var(--s5); font-weight: 600; cursor: pointer; min-height: 56px;
}
.acc-item > summary::-webkit-details-marker { display: none; }
.acc-item > summary:hover { background: var(--surface-2); }
.acc-item > summary:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--brand-red); border-radius: var(--r-md); }
.acc-item > summary .icon { transition: transform var(--t-med) var(--ease); color: var(--text-muted); }
.acc-item[open] > summary .icon { transform: rotate(180deg); }
.acc-body { padding: 0 var(--s5) var(--s5); color: var(--text-muted); }
.acc-item[open] .acc-body { animation: slide-down var(--t-med) var(--ease); }
.acc-body p + p { margin-top: var(--s2); }
.acc-body ul { padding-left: 1.2em; display: grid; gap: 6px; }

/* ---------- Join ---------- */
.join-grid { display: grid; grid-template-columns: 1fr minmax(0, 440px); gap: var(--s7); align-items: start; }
.join-points { list-style: none; display: grid; gap: var(--s3); margin-top: var(--s5); }
.join-points li { position: relative; padding-left: var(--s5); color: var(--text-muted); }
.join-points li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 8px; height: 2px; background: var(--brand-red); }
.join-points .icon { color: var(--brand-red); margin-top: 3px; }
.join-card { padding: var(--s6); }
.join-card h3 { font-size: var(--fs-lg); margin-bottom: var(--s4); }
.joined { display: grid; gap: var(--s4); animation: fade-in var(--t-med) var(--ease); }
.joined-head { display: flex; gap: var(--s3); align-items: center; }
.joined-head .icon-wrap { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); flex: none; }
.joined-name { font-size: var(--fs-lg); font-weight: 700; word-break: break-word; }
.joined p { color: var(--text-muted); font-size: var(--fs-sm); }
.joined-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
@media (max-width: 860px) { .join-grid { grid-template-columns: 1fr; gap: var(--s5); } }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-900); color: var(--on-dark-muted); padding-block: var(--s8) var(--s5); font-size: var(--fs-sm); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s6); }
.footer-brand { display: flex; gap: var(--s3); align-items: flex-start; }
.footer-brand img { width: 48px; height: 48px; }
.footer-brand strong { display: block; color: #fff; font-size: var(--fs-base); margin-bottom: 4px; }
.site-footer h2 { font-size: var(--fs-xs); letter-spacing: .12em; text-transform: uppercase; color: #fff; margin-bottom: var(--s3); }
.site-footer ul { list-style: none; display: grid; gap: var(--s2); }
.site-footer a { color: var(--on-dark); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer a:focus-visible { outline-color: var(--brand-red-light); }
.footer-bottom { margin-top: var(--s7); padding-top: var(--s4); border-top: 1px solid var(--line-dark); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); font-size: var(--fs-xs); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Dialog ---------- */
.dialog {
  width: min(480px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; border: 0;
  border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.dialog[open] { animation: dialog-in var(--t-med) var(--ease); }
.dialog:focus, .dialog:focus-visible { outline: none; }
.dialog::backdrop { background: rgba(20, 20, 24, .55); animation: fade-in var(--t-med) var(--ease); }
.dialog.dialog-fallback { position: fixed; inset: 0; margin: auto; z-index: 90; height: fit-content; }
.dialog-inner { padding: var(--s6); display: grid; gap: var(--s4); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); }
.dialog-head h2 { font-size: var(--fs-lg); }
.dialog-lead { color: var(--text-muted); font-size: var(--fs-sm); }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s2); }
.icon-btn {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent; color: var(--text-muted);
  transition: background-color var(--t-fast);
}
.icon-btn:hover { background: var(--paper); color: var(--text); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--focus); }

/* ---------- Toasts ---------- */
.toast-region {
  position: fixed; z-index: 95; right: 16px; bottom: 16px; left: auto;
  display: grid; gap: var(--s2); width: min(380px, calc(100% - 32px)); pointer-events: none;
}
.toast {
  display: flex; gap: var(--s3); align-items: flex-start; padding: 14px 12px 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand-charcoal);
  border-radius: var(--r-md); box-shadow: var(--shadow-md); pointer-events: auto;
  animation: toast-in var(--t-med) var(--ease);
}
.toast.is-leaving { animation: toast-out 180ms var(--ease) forwards; }
.toast-success { border-left-color: var(--ok); }
.toast-success .toast-icon { color: var(--ok); }
.toast-error { border-left-color: var(--err); }
.toast-error .toast-icon { color: var(--err); }
.toast-warning { border-left-color: #C98A12; }
.toast-warning .toast-icon { color: var(--warn); }
.toast-icon { margin-top: 2px; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 700; font-size: var(--fs-sm); }
.toast-msg { font-size: var(--fs-sm); color: var(--text-muted); }
.toast-close { width: 32px; height: 32px; margin: -4px -2px 0 0; }
@media (max-width: 600px) { .toast-region { right: 16px; left: 16px; width: auto; } }

/* ==========================================================================
   Game stage
   ========================================================================== */
.view-play { padding-block: var(--s5) var(--s8); min-height: calc(100vh - var(--header-h)); }
.stage-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.stage-crumb { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage { max-width: 820px; margin-inline: auto; }

/* Intro */
.intro { padding: clamp(24px, 4vw, 40px); }
.intro-head { display: flex; gap: var(--s4); align-items: center; margin-bottom: var(--s5); }
.intro-head .kicker { margin-bottom: 4px; }
.intro-title { font-size: var(--fs-2xl); }
.intro-objective { font-size: var(--fs-md); margin-bottom: var(--s5); }
.intro-sub { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: var(--s3); }
.steps-list { display: grid; gap: var(--s2); padding-left: 1.3em; margin-bottom: var(--s5); }
.steps-list li::marker { color: var(--brand-red); font-weight: 700; }
.intro-meta { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s5); }
.intro-meta li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); background: var(--paper); border: 1px solid var(--line); font-size: var(--fs-sm); }
.intro-meta .icon { width: 16px; height: 16px; color: var(--brand-red); }
.intro-best { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--r-md); background: var(--ok-bg); color: var(--ok); font-size: var(--fs-sm); margin-bottom: var(--s5); }
.kbd-hint { font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: var(--s5); }
.intro-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
@media (hover: none) { .kbd-hint { display: none; } }

/* HUD */
.hud {
  display: flex; align-items: center; gap: var(--s5); padding: var(--s3) var(--s4); margin-bottom: var(--s4);
  position: sticky; top: calc(var(--header-h) + 8px); z-index: 5;
}
.hud-progress { flex: 1; min-width: 0; }
.hud-progress-label { display: flex; justify-content: space-between; gap: var(--s2); font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.hud-stat { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; min-width: 48px; }
.hud-k { font-size: .6875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.hud-v { font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; }
.hud-v.bump { animation: bump 380ms var(--ease); }
.hud-actions { display: flex; gap: var(--s2); }
.hud-actions .btn { padding: 0 12px; }
@media (max-width: 600px) {
  .hud { flex-wrap: wrap; gap: var(--s3) var(--s4); }
  .hud-progress { flex-basis: 100%; }
  .hud-stat { flex-direction: row; align-items: baseline; gap: 6px; }
  .hud-v { font-size: var(--fs-md); }
  .hud-actions { margin-left: auto; }
  .hud-actions .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .hud-actions .btn { min-width: 44px; }
}

/* Question card */
.q-card { padding: clamp(20px, 4vw, 36px); }
.q-tag { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-red); margin-bottom: var(--s2); }
.q-title { font-size: var(--fs-xl); line-height: 1.25; margin-bottom: var(--s5); }
.q-title:focus { outline: none; }
.q-help { color: var(--text-muted); margin: calc(-1 * var(--s3)) 0 var(--s5); font-size: var(--fs-sm); }

/* Email preview */
.email { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: var(--s5); background: var(--surface); }
.email-head { margin: 0; padding: var(--s3) var(--s4); background: var(--surface-2); border-bottom: 1px solid var(--line); display: grid; gap: 2px; font-size: var(--fs-sm); }
.email-head div { display: grid; grid-template-columns: 64px 1fr; gap: var(--s2); }
.email-head dt { color: var(--text-muted); }
.email-head dd { margin: 0; word-break: break-word; }
.email-head .from { font-weight: 600; }
.email-body { padding: var(--s4); white-space: pre-line; font-size: var(--fs-base); }

/* URL preview */
.url-box { margin-bottom: var(--s5); display: grid; gap: var(--s3); }
.url-context { display: flex; gap: 8px; color: var(--text-muted); font-size: var(--fs-sm); }
.url-context .icon { margin-top: 3px; width: 16px; height: 16px; }
.url-bar {
  display: flex; align-items: center; gap: var(--s2); padding: 12px 14px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--line-strong);
}
.url-bar .icon { color: var(--text-muted); width: 16px; height: 16px; }
.url-text { font-family: var(--mono); font-size: clamp(.875rem, 2.2vw, 1rem); word-break: break-all; }
.url-text mark { background: var(--brand-red-tint); color: var(--brand-red-press); border-radius: 3px; padding: 0 2px; font-weight: 700; }
.url-real { font-size: var(--fs-sm); color: var(--text-muted); }
.url-real strong { font-family: var(--mono); color: var(--text); }

/* Options */
.options { display: grid; gap: var(--s3); }
.options-binary { grid-template-columns: 1fr 1fr; }
.options-versus { grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) { .options-binary, .options-versus { grid-template-columns: 1fr; } }
.option {
  position: relative; width: 100%; min-height: 56px; display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: var(--s3);
  padding: 12px 14px; text-align: left; border-radius: var(--r-md);
  background: var(--surface); border: 1.5px solid var(--line-strong); color: var(--text);
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.option:hover:not(:disabled) { border-color: var(--ink-700); background: var(--surface-2); }
.option:active:not(:disabled) { transform: scale(.992); }
.option:focus-visible { outline: none; box-shadow: var(--focus); }
.option-key {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm);
  background: var(--paper); border: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 700; color: var(--text-muted);
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.option-text { line-height: 1.45; }
.option-text.mono { font-family: var(--mono); font-size: .95em; word-break: break-all; }
.options-versus .option { min-height: 88px; }
.option-state { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.option-state .icon { width: 16px; height: 16px; }
.option-state:empty { display: none; }

.option[aria-pressed="true"] { border-color: var(--brand-red); background: var(--brand-red-soft); box-shadow: 0 0 0 1px var(--brand-red); }
.option[aria-pressed="true"] .option-key { background: var(--brand-red); border-color: var(--brand-red); color: #fff; }
.option:disabled { cursor: default; }
.option.is-locked:not(.is-correct):not(.is-wrong):not(.is-partial):not(.is-answer) { opacity: .6; }
.option.is-correct, .option.is-answer { border-color: var(--ok); background: var(--ok-bg); box-shadow: 0 0 0 1px var(--ok); }
.option.is-correct .option-key, .option.is-answer .option-key { background: var(--ok); border-color: var(--ok); color: #fff; }
.option.is-correct .option-state, .option.is-answer .option-state { color: var(--ok); }
.option.is-answer { border-style: dashed; box-shadow: none; }
.option.is-wrong { border-color: var(--err); background: var(--err-bg); box-shadow: 0 0 0 1px var(--err); animation: nudge 320ms var(--ease); }
.option.is-wrong .option-key { background: var(--err); border-color: var(--err); color: #fff; }
.option.is-wrong .option-state { color: var(--err); }
.option.is-partial { border-color: #C98A12; background: var(--warn-bg); box-shadow: 0 0 0 1px #C98A12; }
.option.is-partial .option-key { background: #8F5D00; border-color: #8F5D00; color: #fff; }
.option.is-partial .option-state { color: var(--warn); }
@media (max-width: 480px) { .option { grid-template-columns: 32px 1fr; } .option-state { grid-column: 2; } }

/* Feedback panel */
.feedback {
  margin-top: var(--s4); padding: var(--s4); border-radius: var(--r-md); border: 1px solid var(--line);
  animation: slide-down var(--t-med) var(--ease);
}
.feedback-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.feedback-head strong { font-size: var(--fs-md); }
.feedback-pts { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.feedback p { font-size: var(--fs-sm); }
.feedback-ok { background: var(--ok-bg); border-color: var(--ok-line); }
.feedback-ok .feedback-head { color: var(--ok); }
.feedback-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.feedback-warn .feedback-head { color: var(--warn); }
.feedback-err { background: var(--err-bg); border-color: var(--err-line); }
.feedback-err .feedback-head { color: var(--err); }

.q-actions { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-top: var(--s5); flex-wrap: wrap; }
.q-actions .btn-primary { margin-left: auto; }
@media (max-width: 480px) { .q-actions .btn-primary { flex: 1 1 100%; } }

/* Pause */
.pause-panel { padding: var(--s7) var(--s5); text-align: center; animation: fade-in var(--t-med) var(--ease); }
.pause-panel .icon-wrap { width: 56px; height: 56px; margin: 0 auto var(--s4); border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: var(--brand-charcoal); }
.pause-panel h2 { font-size: var(--fs-xl); margin-bottom: var(--s2); }
.pause-panel h2:focus { outline: none; }
.pause-panel p { color: var(--text-muted); margin-bottom: var(--s5); }
.pause-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); }

/* Match board */
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); }
.match-col-title { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: var(--s3); }
.match-list { list-style: none; display: grid; gap: var(--s2); }
.match-item {
  width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: 12px 14px; border-radius: var(--r-md); text-align: left;
  background: var(--surface); border: 1.5px solid var(--line-strong);
  transition: border-color var(--t-fast), background-color var(--t-fast), transform var(--t-fast), opacity var(--t-med);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.match-item:hover:not(:disabled) { border-color: var(--ink-700); background: var(--surface-2); }
.match-item:focus-visible { outline: none; box-shadow: var(--focus); }
.match-item[aria-pressed="true"] { border-color: var(--brand-red); background: var(--brand-red-soft); box-shadow: 0 0 0 1px var(--brand-red); }
.match-item.is-matched { border-color: var(--ok-line); background: var(--ok-bg); cursor: default; }
.match-item.is-wrong { border-color: var(--err); background: var(--err-bg); animation: nudge 320ms var(--ease); }
.match-state { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.match-state:empty { display: none; }
.match-state .icon { width: 16px; height: 16px; }
.is-matched .match-state { color: var(--ok); }
.is-wrong .match-state { color: var(--err); }
.match-selection { font-size: var(--fs-sm); color: var(--text-muted); }
@media (max-width: 680px) { .match-grid { grid-template-columns: 1fr; } }

/* Summary */
.summary { display: grid; gap: var(--s4); }
.summary-card { padding: clamp(24px, 5vw, 48px); text-align: center; }
.summary-title { font-size: var(--fs-2xl); }
.summary-title:focus { outline: none; }
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }
.score-ring {
  --p: 0; width: 176px; height: 176px; margin: var(--s5) auto; border-radius: 50%; position: relative;
  display: grid; place-items: center;
  background: conic-gradient(var(--brand-red) calc(var(--p) * 1%), #ECEAE5 0);
  transition: --p 1s var(--ease);
}
.score-ring::before { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: var(--surface); }
.score-ring-inner { position: relative; display: grid; line-height: 1.1; }
.score-ring-inner strong { font-size: 2.75rem; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.score-ring-inner span { font-size: var(--fs-xs); color: var(--text-muted); }
.summary-label { font-size: var(--fs-lg); font-weight: 700; }
.summary-desc { color: var(--text-muted); max-width: 56ch; margin: var(--s2) auto 0; }
.summary-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin: var(--s5) auto 0; max-width: 520px; }
.summary-stats div { padding: var(--s3); border-radius: var(--r-md); background: var(--paper); display: flex; flex-direction: column-reverse; }
.summary-stats dt { font-size: var(--fs-xs); color: var(--text-muted); }
.summary-stats dd { margin: 0; font-weight: 700; font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.summary-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); margin-top: var(--s5); }
.submit-status {
  display: flex; gap: var(--s3); align-items: flex-start; justify-content: center; text-align: left;
  max-width: 520px; margin: var(--s5) auto 0; padding: var(--s3) var(--s4); border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface-2); font-size: var(--fs-sm);
}
.submit-status:empty { display: none; }
.submit-status > .icon { margin-top: 2px; }
.submit-status .btn { margin-top: var(--s2); }
.submit-status.is-ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.submit-status.is-ok p { color: var(--text); }
.submit-status.is-err { background: var(--err-bg); border-color: var(--err-line); color: var(--err); }
.submit-status.is-err p { color: var(--text); }
.submit-status.is-loading { color: var(--text-muted); align-items: center; }
.submit-status { animation: fade-in var(--t-med) var(--ease); }
.new-best { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--s3); }
@media (max-width: 480px) {
  .summary-stats { grid-template-columns: 1fr 1fr 1fr; gap: var(--s2); }
  .summary-actions .btn { flex: 1 1 100%; }
}

/* Loading dots (no spinning) */
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }

/* Review */
.review > summary { padding: var(--s4) var(--s5); }
.review-count { margin-left: auto; font-weight: 600; font-size: var(--fs-sm); color: var(--text-muted); }
.review-list { list-style: none; display: grid; gap: var(--s3); }
.review-item { padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.review-head { display: flex; gap: var(--s2); align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.review-head strong { color: var(--text); }
.review-answer { font-size: var(--fs-sm); margin-bottom: 6px; }
.review-answer strong { color: var(--text); }
.review-item p { font-size: var(--fs-sm); }
.note { text-align: center; color: var(--text-muted); font-size: var(--fs-xs); max-width: 64ch; margin: var(--s2) auto 0; }

/* Career result */
.career-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.career-grid .card, .career-more { padding: var(--s5); }
.career-grid h3, .career-more h3 { font-size: var(--fs-base); margin-bottom: var(--s3); }
.career-more p { color: var(--text-muted); }
.career-title { font-size: clamp(1.75rem, 5vw, 3rem); margin: var(--s2) 0 var(--s3); letter-spacing: -.03em; }
@media (max-width: 600px) { .career-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Leaderboard
   ========================================================================== */
.lb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s5); align-items: start; }
@media (max-width: 1000px) { .lb-layout { grid-template-columns: 1fr; } }
.lb-main { padding: var(--s5); }
.lb-toolbar { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: space-between; align-items: center; margin-bottom: var(--s5); }
.segmented { display: inline-flex; padding: 3px; border-radius: var(--r-md); background: var(--paper); border: 1px solid var(--line); }
.segmented button {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent;
  font-weight: 600; font-size: var(--fs-sm); color: var(--text-muted);
  transition: background-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.segmented button:focus-visible { outline: none; box-shadow: var(--focus); }
.lb-sort { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); }
.select {
  min-height: 40px; padding: 0 36px 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23565661' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none; -webkit-appearance: none; font-size: var(--fs-sm); font-weight: 600;
}
.select:focus-visible { outline: none; box-shadow: var(--focus); }
.lb-demo { margin-bottom: var(--s4); }

/* Podium */
.podium { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); align-items: end; margin-bottom: var(--s5); }
.podium-item {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; min-width: 0;
  padding: var(--s4) var(--s3); border-radius: var(--r-md); background: var(--surface-2);
  border: 1px solid var(--line); border-top: 3px solid var(--brand-charcoal);
}
.podium-1 { order: 2; border-top-color: var(--brand-red); }
.podium-2 { order: 1; }
.podium-3 { order: 3; }
.podium-rank { width: 40px; height: 40px; display: grid; place-items: center; position: relative; font-weight: 700; color: #fff; margin-bottom: var(--s2); }
.podium-rank::before { content: ""; position: absolute; inset: 6px; transform: rotate(45deg); border-radius: 4px; background: var(--brand-charcoal); }
.podium-1 .podium-rank::before { background: var(--brand-red); }
.podium-3 .podium-rank { color: var(--brand-charcoal); }
.podium-3 .podium-rank::before { background: var(--surface); border: 2px solid var(--brand-charcoal); }
.podium-rank span { position: relative; }
.podium-nick { font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-score { font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; }
.podium-meta { font-size: var(--fs-xs); color: var(--text-muted); }
.podium-you { margin-top: 4px; }
@media (max-width: 560px) {
  .podium { grid-template-columns: 1fr; }
  .podium-item { order: 0 !important; flex-direction: row; text-align: left; padding: var(--s3) var(--s4); gap: var(--s3); }
  .podium-rank { margin: 0; flex: none; }
  .podium-nick { flex: 1; }
  .podium-meta { display: none; }
}

/* Table */
.lb-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.lb-table th { text-align: left; font-size: .6875rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); font-weight: 700; padding: 0 var(--s3) var(--s2); border-bottom: 1px solid var(--line); }
.lb-table td { padding: var(--s3); border-bottom: 1px solid var(--line); vertical-align: middle; }
.lb-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.lb-row { animation: row-in var(--t-slow) var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.lb-row.is-me td { background: var(--brand-red-soft); }
.lb-row.is-me td:first-child { box-shadow: inset 3px 0 0 var(--brand-red); }
.lb-row.is-updated td { animation: flash 1.6s var(--ease); }
.rank { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: var(--r-sm); font-weight: 700; background: var(--paper); font-variant-numeric: tabular-nums; }
.rank-1 { background: var(--brand-red); color: #fff; }
.rank-2 { background: var(--brand-charcoal); color: #fff; }
.rank-3 { background: var(--surface); border: 2px solid var(--brand-charcoal); }
.lb-player { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.lb-nick { font-weight: 600; word-break: break-word; }
.lb-max { color: var(--text-muted); font-weight: 400; }
.mini-badges { display: inline-flex; gap: 2px; }
.mini-badge { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-red-tint); color: var(--brand-red-press); }
.mini-badge .icon { width: 13px; height: 13px; }
@media (max-width: 640px) {
  .lb-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .lb-table, .lb-table tbody { display: block; }
  .lb-table tr { display: grid; grid-template-columns: 40px 1fr auto; gap: 2px var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); align-items: center; }
  .lb-table td { padding: 0; border: 0; }
  .lb-table td:nth-child(1) { grid-row: span 2; }
  .lb-table td:nth-child(3) { text-align: right; }
  .lb-table td:nth-child(4), .lb-table td:nth-child(5) { grid-row: 2; color: var(--text-muted); font-size: var(--fs-xs); }
  .lb-table td:nth-child(4) { grid-column: 2; text-align: left; }
  .lb-table td:nth-child(4)::before { content: "Challenges "; }
  .lb-table td:nth-child(5) { grid-column: 3; text-align: right; }
  .lb-table td:nth-child(5)::before { content: "Time "; }
  .lb-table td.hide-sm { display: none; }
  .lb-row.is-me { background: var(--brand-red-soft); box-shadow: inset 3px 0 0 var(--brand-red); padding-left: 8px; padding-right: 8px; }
  .lb-row.is-me td { background: transparent; box-shadow: none !important; }
}

.lb-footer { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s4); font-size: var(--fs-xs); color: var(--text-muted); }

/* Leaderboard states */
.state { text-align: center; padding: var(--s7) var(--s4); display: grid; justify-items: center; gap: var(--s3); animation: fade-in var(--t-med) var(--ease); }
.state .icon-wrap { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: var(--brand-charcoal); }
.state .icon-wrap .icon { width: 26px; height: 26px; }
.state.is-error .icon-wrap { background: var(--err-bg); color: var(--err); }
.state h3 { font-size: var(--fs-md); }
.state p { color: var(--text-muted); font-size: var(--fs-sm); max-width: 42ch; }
.skeleton { display: grid; gap: var(--s3); padding: var(--s2) 0; }
.skeleton-row { height: 44px; border-radius: var(--r-sm); background: linear-gradient(90deg, #EFEDE9 0, #F7F6F3 40%, #EFEDE9 80%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }

/* Side panel */
.lb-side { display: grid; gap: var(--s4); }
@media (min-width: 1001px) { .lb-side { position: sticky; top: calc(var(--header-h) + 16px); } }
.me-card { padding: var(--s5); }
.me-card h3 { font-size: var(--fs-md); margin-bottom: var(--s3); }
.me-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin: 0 0 var(--s4); }
.me-stats div { padding: var(--s2) var(--s3); background: var(--paper); border-radius: var(--r-sm); display: flex; flex-direction: column-reverse; }
.me-stats dt { font-size: .6875rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.me-stats dd { margin: 0; font-size: var(--fs-md); font-weight: 700; font-variant-numeric: tabular-nums; }
.me-games { list-style: none; display: grid; gap: var(--s3); margin-bottom: var(--s4); }
.me-games .row { display: flex; justify-content: space-between; font-size: var(--fs-xs); margin-bottom: 4px; }
.me-games .row span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.me-games .progress { height: 6px; }
.me-games .is-empty .row span:last-child { color: var(--text-muted); font-weight: 400; }
.badge-list { display: flex; flex-wrap: wrap; gap: 6px; }
.badge-list .badge.is-locked { opacity: .55; background: transparent; border-style: dashed; }
.me-card p { font-size: var(--fs-sm); color: var(--text-muted); }
.rules-card > summary { font-size: var(--fs-base); }

/* ==========================================================================
   Motion
   ========================================================================== */
.js .reveal { opacity: 0; transform: translateY(6px); transition: opacity .55s var(--ease), transform .55s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.anim-in { animation: fade-up var(--t-slow) var(--ease) both; }
.view.is-entering { animation: fade-in var(--t-med) var(--ease); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes slide-down { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(12px); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); color: var(--brand-red); } 100% { transform: scale(1); } }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-4px); } 60% { transform: translateX(3px); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes row-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes flash { 0%, 30% { background: #F4D3D7; } 100% { background: var(--brand-red-soft); } }
@keyframes pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important;
    transition-duration: .01ms !important; transition-delay: 0ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .skeleton-row { animation: none; }
  .dots i { animation: none; opacity: .7; }
}

/* Forced colours (Windows high contrast) */
@media (forced-colors: active) {
  .option[aria-pressed="true"], .match-item[aria-pressed="true"] { outline: 3px solid Highlight; }
  .option.is-correct, .option.is-wrong, .option.is-answer, .match-item.is-matched { outline: 2px solid CanvasText; }
  .progress > span { background: Highlight; }
}

@media print {
  .site-header, .site-footer, .hero-actions, .toast-region { display: none; }
}

/* ==========================================================================
   Career assessment
   ========================================================================== */
/* Home band */
.career-band { background: var(--ink-900); color: var(--on-dark); position: relative; overflow: hidden; }
.career-band-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s7); align-items: center; }
.career-band h2 { font-size: var(--fs-2xl); max-width: 18ch; }
.career-lead { margin-top: var(--s4); color: var(--on-dark-muted); font-size: var(--fs-md); max-width: 56ch; }
.career-note { margin: var(--s4) 0 var(--s6); color: var(--on-dark-muted); font-size: var(--fs-sm); }
.career-paths { border-top: 1px solid var(--line-dark); padding-top: var(--s4); }
.career-paths h3 { font-size: var(--fs-sm); color: var(--on-dark-muted); font-weight: 600; margin-bottom: var(--s3); }
.career-paths ol { list-style: none; counter-reset: path; }
.career-paths li { counter-increment: path; display: flex; gap: var(--s4); padding: 10px 0; border-bottom: 1px solid var(--line-dark); color: var(--on-dark); }
.career-paths li::before { content: counter(path); width: 20px; flex: none; color: var(--brand-red-light); font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .career-band-grid { grid-template-columns: 1fr; } }

/* Question flow */
.as { display: grid; gap: var(--s4); }
.as-progress { padding: var(--s4); }
.as-steps { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s2); margin-bottom: var(--s4); }
.as-steps li { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); min-width: 0; }
.as-step-dot { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; background: var(--paper); border: 1px solid var(--line-strong); transition: background-color var(--t-med), color var(--t-med); }
.as-step-dot .icon { width: 14px; height: 14px; }
.as-steps li.is-done .as-step-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.as-steps li.is-current { color: var(--text); }
.as-steps li.is-current .as-step-dot { background: var(--brand-red); border-color: var(--brand-red); color: #fff; }
.as-step-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) {
  .as-steps { grid-template-columns: repeat(5, auto); justify-content: space-between; }
  .as-steps li:not(.is-current) .as-step-label { display: none; }
}
.as-section-intro { display: flex; gap: 8px; align-items: flex-start; padding: var(--s3) var(--s4); margin-bottom: var(--s4); border-radius: var(--r-md); background: var(--paper); font-size: var(--fs-sm); color: var(--text-muted); }
.as-section-intro .icon { color: var(--brand-red); margin-top: 2px; width: 18px; height: 18px; }
.as-section-intro strong { color: var(--text); }
.option.is-multi .option-key { border-radius: 6px; }
.option.is-multi .option-key .icon { width: 16px; height: 16px; opacity: 0; transition: opacity var(--t-fast); }
.option.is-multi[aria-pressed="true"] .option-key .icon { opacity: 1; }
.as-limit { min-height: 1.4em; margin-top: var(--s2); font-size: var(--fs-sm); font-weight: 600; color: var(--warn); }
.as-working { padding: var(--s7) var(--s5); text-align: center; color: var(--brand-red); }
.as-working h2 { color: var(--text); font-size: var(--fs-xl); margin: var(--s3) 0 var(--s4); }
.as-working h2:focus { outline: none; }
.as-working ul { list-style: none; display: grid; gap: 6px; color: var(--text-muted); font-size: var(--fs-sm); }

/* Results */
.as-results { display: grid; gap: var(--s4); }
.stage:has(.as-results) { max-width: 1000px; }
.as-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s5) var(--s6); padding: clamp(24px, 4vw, 40px); align-items: center; }
.as-title { font-size: var(--fs-2xl); letter-spacing: -.03em; }
.as-title:focus { outline: none; }
.as-summary { margin-top: var(--s3); color: var(--text-muted); font-size: var(--fs-md); max-width: 60ch; }
.as-secondary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s4); font-size: var(--fs-sm); color: var(--text-muted); }
.as-ring { width: 140px; height: 140px; margin: 0; }
.as-ring .score-ring-inner strong { font-size: 2.1rem; }
.as-facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); margin: 0; }
.as-facts div { padding: var(--s3) var(--s4); background: var(--paper); border-radius: var(--r-md); display: flex; flex-direction: column-reverse; justify-content: flex-end; align-items: flex-start; gap: 2px; }
.as-facts dt { font-size: var(--fs-xs); color: var(--text-muted); }
.as-facts dd { margin: 0; font-weight: 700; }
@media (max-width: 760px) { .as-facts { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .as-hero { grid-template-columns: 1fr; } .as-ring { order: -1; width: 120px; height: 120px; } }

.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line-strong); overflow-x: auto; scrollbar-width: none; scroll-margin-top: calc(var(--header-h) + 12px); }
.tab {
  position: relative; flex: none; min-height: 48px; padding: 0 var(--s4); border: 0; background: transparent;
  font-weight: 600; color: var(--text-muted); border-radius: var(--r-sm) var(--r-sm) 0 0; transition: color var(--t-fast), background-color var(--t-fast);
}
.tab:hover { color: var(--text); background: rgba(29, 29, 35, .04); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand-red); }
.tab:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--brand-red); }
.tab-panel { display: grid; gap: var(--s4); }
.tab-panel[hidden] { display: none; }
.tab-panel:focus-visible { outline: 3px solid var(--brand-red); outline-offset: 4px; border-radius: var(--r-md); }

.as-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
@media (max-width: 760px) { .as-grid { grid-template-columns: 1fr; } }
.as-block { padding: var(--s5); }
.as-block h3 { font-size: var(--fs-md); margin-bottom: var(--s3); }
.as-sub { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: var(--s5) 0 var(--s3); }
.as-mt { margin-top: var(--s5); }
.as-small { font-size: var(--fs-sm); color: var(--text-muted); }
.as-small .icon { display: inline; width: 15px; height: 15px; vertical-align: -3px; }
.as-why { list-style: none; display: grid; gap: var(--s3); }
.as-why li { display: flex; gap: 10px; }
.as-why .icon { color: var(--ok); margin-top: 3px; }
.as-evidence { list-style: none; display: grid; gap: var(--s2); }
.as-evidence li { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--s3); padding: var(--s3); border-radius: var(--r-sm); background: var(--paper); font-size: var(--fs-sm); }
.as-ev-q { color: var(--text-muted); font-size: var(--fs-xs); grid-column: 1; }
.as-ev-a { font-weight: 600; grid-column: 1; }
.as-evidence .badge { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.as-bars { list-style: none; display: grid; gap: var(--s3); margin-bottom: var(--s3); }
.as-bars .row { display: flex; justify-content: space-between; gap: var(--s2); font-size: var(--fs-sm); margin-bottom: 4px; }
.as-bars .row .badge { margin-left: 4px; }
.as-bar { height: 8px; }
.as-bar > span { width: 0; background: var(--brand-charcoal); transition: width .8s var(--ease); }
.as-bars li.is-primary .as-bar > span { background: var(--brand-red); }
.chips .chip { display: inline-flex; align-items: center; gap: 4px; }
.chips .chip .icon { width: 14px; height: 14px; }
.chip-ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.as-level { margin-bottom: var(--s3); }
.as-roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.as-role-col h4 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--brand-red); margin-bottom: var(--s2); }
.as-role-col ul { list-style: none; display: grid; gap: 6px; }
.as-role-col li { padding: 8px 12px; border-radius: var(--r-sm); background: var(--paper); font-size: var(--fs-sm); }
@media (max-width: 640px) { .as-roles { grid-template-columns: 1fr; } }
.as-method .acc-body ul { padding-left: 1.2em; display: grid; gap: var(--s2); font-size: var(--fs-sm); }

/* Roadmap */
.as-rm-summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s3); }
.as-rm-summary h3 { margin-bottom: 2px; }
.as-timeline { list-style: none; display: grid; gap: var(--s3); position: relative; }
.as-timeline::before { content: ""; position: absolute; left: 39px; top: 24px; bottom: 24px; width: 2px; background: var(--line-strong); }
.as-step { position: relative; padding: var(--s5); padding-left: 80px; }
.as-step-head { display: flex; gap: var(--s4); align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.as-step-num { position: absolute; left: 22px; top: 22px; width: 36px; height: 36px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: var(--fs-sm); }
.as-step-num::before { content: ""; position: absolute; inset: 5px; background: var(--brand-charcoal); transform: rotate(45deg); border-radius: 3px; }
.as-step:first-child .as-step-num::before { background: var(--brand-red); }
.as-step-num span { position: relative; }
.as-step-title { flex: 1; min-width: 200px; }
.as-step-title h3 { font-size: var(--fs-md); margin-bottom: 6px; }
.as-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.as-step-time { display: flex; gap: var(--s4); margin: 0; }
.as-step-time div { display: flex; flex-direction: column-reverse; text-align: right; }
.as-step-time dt { font-size: var(--fs-xs); color: var(--text-muted); }
.as-step-time dd { margin: 0; font-weight: 700; white-space: nowrap; }
.as-step-why { margin-top: var(--s3); font-size: var(--fs-sm); }
.as-step-meta { margin-top: 6px; font-size: var(--fs-sm); color: var(--text-muted); }
.as-step-meta .icon { display: inline; width: 15px; height: 15px; vertical-align: -3px; }
.as-step-meta strong { color: var(--text); }
.as-alts { margin-top: var(--s3); border-top: 1px dashed var(--line-strong); padding-top: var(--s2); }
.as-alts > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-weight: 600; font-size: var(--fs-sm); min-height: 40px; }
.as-alts > summary::-webkit-details-marker { display: none; }
.as-alts > summary .icon { margin-left: auto; transition: transform var(--t-med) var(--ease); }
.as-alts[open] > summary .icon { transform: rotate(180deg); }
.as-alts > summary:focus-visible { outline: 3px solid var(--brand-red); outline-offset: 2px; border-radius: 4px; }
.as-alts ul { list-style: none; display: grid; gap: var(--s3); margin-top: var(--s2); animation: slide-down var(--t-med) var(--ease); }
.as-alts li { padding: var(--s3); border-radius: var(--r-sm); background: var(--paper); font-size: var(--fs-sm); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.as-alts li p { flex-basis: 100%; color: var(--text-muted); }
.as-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.as-tags .chip { font-size: var(--fs-xs); padding: 3px 9px; background: var(--surface); }
.as-list { list-style: none; display: grid; gap: var(--s2); font-size: var(--fs-sm); color: var(--text-muted); }
.as-list strong { color: var(--text); }
.as-assume { padding: 0 var(--s2); }
@media (max-width: 560px) {
  .as-timeline::before { left: 27px; }
  .as-step { padding-left: 60px; padding-right: var(--s4); }
  .as-step-num { left: 10px; }
  .as-step-time div { text-align: left; }
}

/* Quotation */
.quote { padding: clamp(20px, 4vw, 40px); display: grid; gap: var(--s5); border-top: 4px solid var(--brand-red); }
.quote-head { display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; padding-bottom: var(--s4); border-bottom: 1px solid var(--line); }
.quote-provider { font-size: var(--fs-lg); font-weight: 700; }
.quote-id { text-align: left; }
.quote-id h3 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .12em; color: var(--brand-red); }
.mono { font-family: var(--mono); font-weight: 600; }
.quote-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3) var(--s5); margin: 0; }
.quote-meta div { display: flex; flex-direction: column-reverse; }
.quote-meta dt { font-size: var(--fs-xs); color: var(--text-muted); }
.quote-meta dd { margin: 0; font-weight: 600; word-break: break-word; }
@media (max-width: 640px) { .quote-meta { grid-template-columns: 1fr 1fr; } .quote-id { text-align: left; } }
.quote-table-wrap { overflow-x: auto; }
.quote-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 560px; }
.quote-table th { text-align: left; font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); padding: 0 var(--s3) var(--s2); border-bottom: 2px solid var(--line-strong); }
.quote-table td { padding: var(--s3); border-bottom: 1px solid var(--line); vertical-align: top; }
.quote-table td .as-small { display: block; font-size: var(--fs-xs); }
.quote-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.quote-table tfoot th, .quote-table tfoot td { padding: var(--s4) var(--s3); border-bottom: 0; font-size: var(--fs-md); color: var(--text); text-transform: none; letter-spacing: 0; }
.quote-table tfoot td { font-size: var(--fs-lg); }
.quote-comp { list-style: none; display: grid; gap: 4px; }
.quote-comp li { display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-xs); }
.quote-comp .icon { width: 14px; height: 14px; margin-top: 2px; }
@media (max-width: 560px) {
  .quote-table { min-width: 0; }
  .quote-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .quote-table, .quote-table tbody, .quote-table tfoot { display: block; }
  .quote-table tr { display: grid; grid-template-columns: 20px 1fr auto; gap: 6px 10px; padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
  .quote-table td { padding: 0; border: 0; }
  .quote-table td:nth-child(3), .quote-table td:nth-child(4) { grid-column: 2 / -1; }
  .quote-table td:nth-child(4) { font-size: var(--fs-xs); color: var(--text-muted); }
  .quote-table td:nth-child(4)::before { content: "Estimated start: "; }
  .quote-table td:nth-child(5) { grid-column: 3; grid-row: 1; }
  .quote-table tfoot tr { grid-template-columns: 1fr auto; border-bottom: 0; }
  .quote-table tfoot th, .quote-table tfoot td { padding: 0; }
}
.qc-included { color: var(--ok); }
.qc-confirm { color: var(--warn); }
.qc-external { color: var(--err); }
.quote-stages h4 { font-size: var(--fs-sm); margin-bottom: var(--s2); }
.quote-stages ul { list-style: none; display: grid; gap: 4px; margin-bottom: var(--s2); }
.quote-stages li { display: flex; justify-content: space-between; gap: var(--s3); padding: 8px 12px; border-radius: var(--r-sm); background: var(--paper); font-size: var(--fs-sm); }
.quote-stages li .as-small { display: block; }
.quote-notes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.quote-note { padding: var(--s4); border-radius: var(--r-md); border: 1px solid var(--line); font-size: var(--fs-sm); }
.quote-note h4 { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); margin-bottom: var(--s2); }
.quote-note h4 .icon { width: 18px; height: 18px; }
.quote-note ul { padding-left: 1.1em; display: grid; gap: 6px; }
.qn-in { background: var(--ok-bg); border-color: var(--ok-line); }
.qn-in h4 { color: var(--ok); }
.qn-out { background: var(--warn-bg); border-color: var(--warn-line); }
.qn-out h4 { color: var(--warn); }
@media (max-width: 640px) { .quote-notes { grid-template-columns: 1fr; } }
.quote-fine { list-style: none; display: grid; gap: 4px; font-size: var(--fs-xs); color: var(--text-muted); }
.quote-cta { display: flex; flex-wrap: wrap; gap: var(--s2); }
@media (max-width: 480px) { .quote-cta .btn { flex: 1 1 100%; white-space: normal; } }

/* Save panel */
.as-save { padding: clamp(20px, 4vw, 32px); border: 2px solid var(--brand-red-tint); }
.as-save-title { font-size: var(--fs-xl); margin-bottom: var(--s2); }
.as-save-title:focus { outline: none; }
.as-form { margin-top: var(--s4); max-width: 560px; }
.as-actions { justify-content: flex-start; }

/* Staff export bar (?admin=1) */
.admin-plans { background: var(--ink-950); color: var(--on-dark); padding: var(--s3) 0; font-size: var(--fs-sm); }
.admin-plans .container { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.admin-plans p { margin-right: auto; }

/* PDF export: branded A4 document (Winville event + Tenebix training partner).
   Only rendered when printing from the career assessment. */
#print-root { display: none; }
@media print {
  @page {
    size: A4; margin: 14mm 14mm 18mm;
    @bottom-left { font: 6.5pt "Segoe UI", system-ui, Arial, sans-serif; color: #565661; vertical-align: top; padding-top: 3mm; border-top: .3mm solid #E3E1DC; }
    @bottom-right { font: 6.5pt "Segoe UI", system-ui, Arial, sans-serif; color: #565661; vertical-align: top; padding-top: 3mm; border-top: .3mm solid #E3E1DC; }
  }
  @page :first { margin-top: 10mm; }
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing { background: #fff; }
  body.printing #print-root { display: block; }
  #print-root {
    font: 9.5pt/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: #1D1D23;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  #print-root * { box-sizing: border-box; }
  /* :where() keeps the reset at zero specificity so the .pd-* spacing below wins */
  :where(#print-root) :where(h1, h2, h3, p, ul, ol, dl) { margin: 0; }
  :where(#print-root) :where(ul, ol) { padding: 0; list-style: none; }
  #print-root .nw { white-space: nowrap; }

  /* Header band and footer */
  .pd-band { display: flex; justify-content: space-between; align-items: center; gap: 10mm; padding: 7mm 8mm; background: #1D1D23; color: #fff; border-radius: 2.5mm 2.5mm 0 0; }
  .pd-band-left { display: flex; align-items: center; gap: 4mm; }
  .pd-winville { width: 13mm; height: 13mm; }
  .pd-band-event { font-weight: 700; font-size: 11pt; line-height: 1.25; }
  .pd-band-sub { font-size: 7pt; color: #BDBCC4; letter-spacing: .12em; text-transform: uppercase; margin-top: .8mm; }
  .pd-band-right { text-align: right; }
  .pd-band-label { font-size: 6.5pt; letter-spacing: .16em; text-transform: uppercase; color: #BDBCC4; margin-bottom: 1.5mm; }
  .pd-tenebix { height: 11mm; width: auto; display: inline-block; }
  .pd-rule { height: 1.2mm; background: #B93D48; margin: 0 0 7mm; border-radius: 0 0 1mm 1mm; }

  /* Summary */
  .pd-kicker { font-size: 7.5pt; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #B93D48; margin-bottom: 1.5mm; }
  .pd-intro h1 { font-size: 23pt; line-height: 1.1; letter-spacing: -.02em; }
  .pd-lead { font-size: 10.5pt; color: #3A3A44; margin-top: 2.5mm; max-width: 150mm; }
  .pd-meta { font-size: 8pt; color: #565661; margin-top: 2.5mm; }
  .pd-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2.5mm; margin: 6mm 0 2mm; }
  .pd-kpi { display: flex; flex-direction: column; gap: .8mm; padding: 3mm; background: #F6F5F2; border-top: 1mm solid #43434D; border-radius: 1.5mm; }
  .pd-kpi-accent { border-top-color: #B93D48; }
  .pd-kpi-v { font-weight: 700; font-size: 10pt; line-height: 1.2; }
  .pd-kpi-accent .pd-kpi-v { font-size: 17pt; color: #B93D48; }
  .pd-kpi-k { font-size: 6.5pt; color: #565661; text-transform: uppercase; letter-spacing: .08em; }

  /* Sections */
  .pd-section-head { display: flex; align-items: center; gap: 3mm; margin: 6mm 0 3.5mm; padding-bottom: 2mm; border-bottom: .4mm solid #E3E1DC; break-after: avoid; }
  .pd-num { font-size: 8pt; font-weight: 700; color: #fff; background: #B93D48; padding: .6mm 2mm; border-radius: 1mm; letter-spacing: .06em; }
  .pd-section-head h2 { font-size: 13pt; }
  .pd-sub { font-size: 8.5pt; color: #565661; margin: -1.5mm 0 3mm; }
  .pd-page { break-before: page; }
  .pd-avoid, .pd-avoid-head { break-inside: avoid; }
  .pd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; margin-bottom: 4mm; }
  .pd-card { border: .3mm solid #E3E1DC; border-radius: 2mm; padding: 3.5mm 4mm; margin-bottom: 4mm; break-inside: avoid; }
  .pd-cols > .pd-card { margin-bottom: 0; }
  .pd-card h3, .pd-box h3 { font-size: 9.5pt; margin-bottom: 2mm; }
  .pd-muted { color: #565661; font-size: 8.5pt; }
  .pd-note { font-size: 8.5pt; margin-top: 2mm; }
  .pd-bullets li { position: relative; padding-left: 5mm; margin-bottom: 1.8mm; }
  .pd-bullets li::before { content: ""; position: absolute; left: .8mm; top: 1.7mm; width: 1.8mm; height: 1.8mm; background: #B93D48; transform: rotate(45deg); }
  .pd-bars li { display: grid; grid-template-columns: 30mm 1fr 9mm; align-items: center; gap: 2mm; font-size: 8pt; margin-bottom: 1.4mm; }
  .pd-bar { display: block; height: 2.2mm; background: #ECEAE5; border-radius: 1mm; overflow: hidden; }
  .pd-bar > span { display: block; height: 100%; background: #9C9CA6; border-radius: 1mm; }
  .pd-bars .is-secondary .pd-bar > span { background: #43434D; }
  .pd-bars .is-primary { font-weight: 700; }
  .pd-bars .is-primary .pd-bar > span { background: #B93D48; }
  .pd-bar-v { text-align: right; font-variant-numeric: tabular-nums; }
  .pd-chips { display: flex; flex-wrap: wrap; gap: 1.5mm; }
  .pd-chip { font-size: 8pt; padding: .7mm 2.5mm; border-radius: 10mm; border: .3mm solid #CAC7C0; }
  .pd-chip-ok { border-color: #A5D1B7; background: #E8F3EC; color: #1A6F42; }
  .pd-roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; margin-top: 1mm; }
  .pd-role-t { font-size: 7pt; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #B93D48; margin-bottom: 1mm; }
  .pd-roles li { font-size: 8.5pt; padding: 1mm 0; border-bottom: .2mm solid #ECEAE5; }

  /* Roadmap */
  .pd-step { display: grid; grid-template-columns: 10mm 1fr; gap: 3mm; padding: 3mm 0; border-bottom: .3mm solid #ECEAE5; break-inside: avoid; }
  .pd-step-num { position: relative; width: 8mm; height: 8mm; display: grid; place-items: center; margin-top: .3mm; color: #fff; font-weight: 700; font-size: 8.5pt; }
  .pd-step-num::before { content: ""; position: absolute; inset: 1.2mm; background: #43434D; transform: rotate(45deg); border-radius: .6mm; }
  .pd-step:first-child .pd-step-num::before { background: #B93D48; }
  .pd-step-num span { position: relative; }
  .pd-step-top { display: flex; justify-content: space-between; align-items: baseline; gap: 4mm; }
  .pd-step-top h3 { font-size: 10.5pt; }
  .pd-step-time { font-size: 8pt; color: #565661; white-space: nowrap; }
  .pd-tags { display: flex; gap: 1.5mm; margin: 1mm 0 1.5mm; }
  .pd-tag { font-size: 7pt; font-weight: 700; padding: .3mm 2mm; border-radius: 10mm; background: #F6F5F2; border: .2mm solid #E3E1DC; }
  .pd-tag-brand { background: #F7E7E9; border-color: #EFC9CD; color: #8D2C35; }
  .pd-step-body p + p { margin-top: 1mm; }
  .pd-list li { font-size: 8.5pt; margin-bottom: 1.2mm; }
  .pd-fine { font-size: 7.5pt; color: #565661; margin-top: 3mm; }

  /* Quotation */
  .pd-q-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8mm; padding-bottom: 4mm; margin-bottom: 4mm; border-bottom: 1mm solid #B93D48; }
  .pd-q-logo { height: 12mm; width: auto; margin-bottom: 2mm; display: block; }
  .pd-q-title { text-align: right; }
  .pd-q-title .pd-kicker { font-size: 17pt; letter-spacing: .22em; margin: 0; }
  .pd-q-number { font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: 10pt; }
  .pd-q-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5mm 6mm; margin-bottom: 5mm; }
  .pd-q-meta div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
  .pd-q-meta dt { font-size: 6.5pt; text-transform: uppercase; letter-spacing: .08em; color: #565661; }
  .pd-q-meta dd { margin: 0; font-weight: 600; }
  .pd-valid dd { color: #B93D48; font-weight: 700; }
  .pd-table { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
  .pd-table thead th { background: #1D1D23; color: #fff; text-align: left; font-size: 6.5pt; text-transform: uppercase; letter-spacing: .08em; padding: 2mm 2.5mm; }
  .pd-table td { padding: 2.2mm 2.5mm; border-bottom: .3mm solid #E3E1DC; vertical-align: top; }
  .pd-table tbody tr:nth-child(even) td { background: #FAF9F7; }
  .pd-table tr { break-inside: avoid; }
  .pd-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
  .pd-comp { display: block; font-size: 7.5pt; }
  .pd-comp b { display: inline-block; width: 3.5mm; }
  .pd-comp-included { color: #1A6F42; }
  .pd-comp-confirm { color: #875100; }
  .pd-comp-external { color: #B0261E; }
  .pd-total { display: flex; justify-content: space-between; align-items: center; padding: 3mm 3.5mm; margin-bottom: 3mm; background: #B93D48; color: #fff; border-radius: 0 0 1.5mm 1.5mm; font-size: 10pt; font-weight: 600; }
  .pd-total strong { font-size: 14pt; }
  .pd-stages { display: flex; flex-wrap: wrap; gap: 1.5mm 6mm; margin-bottom: 4mm; font-size: 8.5pt; }
  .pd-box { padding: 3.5mm 4mm; border-radius: 2mm; font-size: 8.5pt; }
  .pd-box ul { list-style: disc; padding-left: 4mm; }
  .pd-box li { margin-bottom: 1mm; }
  .pd-box-in { background: #E8F3EC; border: .3mm solid #A5D1B7; }
  .pd-box-in h3 { color: #1A6F42; }
  .pd-box-out { background: #FFF4D9; border: .3mm solid #E6C47A; }
  .pd-box-out h3 { color: #875100; }
  .pd-enrol { display: flex; justify-content: space-between; align-items: center; gap: 6mm; margin: 4mm 0; padding: 4mm 5mm; background: #1D1D23; color: #fff; border-radius: 2mm; }
  .pd-enrol h3 { font-size: 11pt; margin-bottom: 1mm; }
  .pd-enrol p { font-size: 8.5pt; color: #DADAE0; }
  .pd-enrol strong { color: #fff; }
  #print-root .pd-enrol-contact { text-align: right; font-weight: 600; color: #fff; white-space: nowrap; }
  .pd-fine-list li { font-size: 7pt; color: #565661; margin-bottom: .6mm; }
}
