:root {
  /* Centurien light palette, matching app/globals.css. Equipment imagery stays unchanged. */
  --accent: #2453a8;
  --accent-700: #1c438c;
  --accent-50: #ebf1fb;
  --accent-100: #d7e3f7;
  --ink: #263740;
  --ink-2: #3d535c;
  --muted: #627982;
  --paper: #f7f9fa;
  --line: #e5eaed;
  --line-2: #dfe5e8;
  --gold: #b38a42;
  --gold-50: #faf3e8;
  --gold-ink: #805f28;
  --green: #278362;
  --green-50: #edf7f2;
  --shadow-1:
    0 1px 2px rgb(38 55 64 / 0.06), 0 2px 6px -2px rgb(38 55 64 / 0.08);
  --shadow-2:
    0 1px 2px rgb(38 55 64 / 0.05), 0 18px 40px -20px rgb(38 55 64 / 0.32);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --gutter: clamp(16px, 4vw, 40px);
  --studio: radial-gradient(
    120% 95% at 50% 28%,
    #fafbfd 0%,
    #edf2f9 52%,
    #e1e8f1 100%
  );
  font-family:
    "Plus Jakarta Sans",
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button,
a,
input,
summary {
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
}
a {
  color: inherit;
  text-underline-offset: 3px;
}
h1,
h2,
h3,
p,
figure {
  margin: 0;
}
h1:focus,
main:focus {
  outline: none;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.i {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 16px;
  top: -200px;
  z-index: 50;
  padding: 12px 18px;
  border-radius: 12px;
  background: #fff;
  font-weight: 700;
  box-shadow: var(--shadow-2);
}
.skip:focus {
  top: 12px;
}

/* ---------- Header & footer ---------- */
.training-notice {
  margin: 16px max(var(--gutter), calc((100% - 1280px) / 2 + var(--gutter))) 0;
  padding: 14px 18px;
  border: 1px solid #ead9b7;
  border-radius: 10px;
  background: var(--gold-50);
  font-size: 13px;
  line-height: 1.6;
}
.training-notice strong {
  display: block;
  color: var(--gold-ink);
}
.training-notice p {
  margin: 4px 0 0;
  color: var(--ink-2);
}
#begin-dialog .certification-copy {
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
  background: var(--gold-50);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-2);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 76px;
  padding: 0 max(var(--gutter), calc((100% - 1280px) / 2 + var(--gutter)));
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  color: var(--accent);
  text-decoration: none;
  border-radius: 8px;
}
.brand img {
  width: 52px;
  height: 46px;
  object-fit: contain;
}
.brand > span {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.05;
}
.brand small {
  display: block;
  margin-top: 4px;
  font-size: 8px;
  letter-spacing: 0.16em;
}
.product-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
}
.back-link:hover {
  text-decoration: underline;
}
main {
  max-width: 1280px;
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  padding: 34px var(--gutter) 72px;
}
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  padding: 20px max(var(--gutter), calc((100% - 1280px) / 2 + var(--gutter)));
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 4px;
  border-radius: 8px;
}
.text-button:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}
.text-button .i {
  width: 16px;
  height: 16px;
}
footer .text-button {
  font-size: 13px;
}

/* ---------- Buttons & segmented control ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  transition:
    background 0.15s,
    box-shadow 0.15s,
    transform 0.15s,
    opacity 0.15s;
}
.button:active:not(:disabled) {
  transform: translateY(1px);
}
.primary {
  background: var(--accent);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.14),
    0 8px 18px -10px rgb(36 83 168 / 0.7);
}
.primary:hover:not(:disabled) {
  background: var(--accent-700);
}
.secondary {
  background: #fff;
  border-color: var(--line-2);
  color: var(--ink);
}
.secondary:hover:not(:disabled) {
  border-color: var(--ink-2);
}
.button:disabled {
  opacity: 0.5;
  box-shadow: none;
}
.primary:disabled {
  background: #e8edf4;
  color: var(--muted);
  opacity: 1;
}
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #edf1f3;
}
.seg button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  transition:
    background 0.18s,
    color 0.18s,
    box-shadow 0.18s;
}
.seg button:hover {
  color: var(--ink);
}
.seg button[aria-pressed="true"] {
  background: #fff;
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1.5px var(--ink),
    0 3px 10px -3px rgb(38 55 64 / 0.22);
}
.seg .i {
  width: 18px;
  height: 18px;
}

/* ---------- Intro ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.8fr);
  align-items: end;
  gap: 32px 64px;
}
.hero-copy > *,
.how,
.choose-head,
.truck-card,
.intro-note {
  animation: rise 0.6s var(--ease) both;
}
.hero-copy h1 {
  animation-delay: 0.04s;
}
.hero-copy .lead {
  animation-delay: 0.08s;
}
.facts {
  animation-delay: 0.12s !important;
}
.how {
  animation-delay: 0.16s;
}
.spark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgb(179 138 66 / 0.22);
}
.hero h1 {
  margin-top: 14px;
  font-size: clamp(40px, 4.1vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  word-spacing: 0.04em;
  font-weight: 800;
}
.dot {
  margin-left: -0.07em; /* the face sets its full stop loose */
}
.lead {
  max-width: 34em;
  margin-top: 16px;
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.55;
  color: var(--muted);
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
.facts li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-1);
}
.facts .i {
  width: 18px;
  height: 18px;
  padding: 2px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  stroke-width: 3;
}
.how {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 10px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgb(255 255 255 / 0.6);
}
.how li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--muted);
}
.how b {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-50);
  color: var(--accent);
  font-size: 14px;
}
.how strong {
  display: block;
  font-size: 15px;
  color: var(--ink);
}
.choose {
  margin-top: 34px;
}
.choose-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  animation-delay: 0.18s;
}
.choose-head h2 {
  font-size: clamp(22px, 2vw, 26px);
  letter-spacing: -0.025em;
  line-height: 1.25;
}
.view-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.truck-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  text-align: left;
  box-shadow: var(--shadow-1);
  transition:
    transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    border-color 0.25s;
}
.truck-card:nth-child(1) {
  animation-delay: 0.22s;
}
.truck-card:nth-child(2) {
  animation-delay: 0.28s;
}
.truck-card:nth-child(3) {
  animation-delay: 0.34s;
}
.truck-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-100);
  box-shadow: var(--shadow-2);
}
.card-art {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--studio);
  overflow: hidden;
}
.card-art .shot,
.result-truck .shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.shot {
  object-fit: contain;
  opacity: 0;
  transition:
    opacity 0.45s var(--ease) 0.15s,
    transform 0.25s var(--ease);
}
.has-shot .shot {
  opacity: 1;
}
.truck-card:hover .shot {
  transform: scale(1.025);
}
.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  padding: 18px 22px 20px;
  border-top: 1px solid var(--line);
}
.card-title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.025em;
}
.card-detail {
  font-size: 14px;
  color: var(--muted);
}
.card-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
}
.go {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-50);
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.25s var(--ease);
}
.truck-card:hover .go {
  background: var(--accent);
  color: #fff;
  transform: translateX(3px);
}
.intro-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  font-size: 14px;
  color: var(--muted);
  animation-delay: 0.4s;
}
.intro-note .i {
  color: var(--accent);
}
.choose .visual-note {
  margin-bottom: 16px;
}

/* ---------- Question ---------- */
body[data-screen="question"] main {
  padding-top: 24px;
}
.check-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 32px;
  margin-bottom: 22px;
}
.truck-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 16px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: var(--shadow-1);
}
.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.steps {
  display: flex;
  gap: 14px;
  max-width: 600px;
  width: 100%;
  justify-self: center;
}
/* Each group's width follows its question count (--n, set from the bank) */
.seg-group {
  flex: var(--n, 1) 1 0;
  min-width: 0;
}
.bars {
  display: flex;
  gap: 4px;
}
.bars i {
  flex: 1;
  height: 6px;
  border-radius: 6px;
  background: #dfe5e8;
  transition: background 0.3s var(--ease);
}
.bars i.done {
  background: var(--accent);
}
.bars i.now {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgb(179 138 66 / 0.25);
}
.seg-group span {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.seg-group.active span {
  color: var(--ink);
}
.check-meta {
  display: flex;
  align-items: center;
  gap: 18px;
}
.count {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Elapsed time (m:ss), beside the count */
.timer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.timer .i {
  width: 17px;
  height: 17px;
  color: var(--muted);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr);
  gap: 40px;
}
.visual {
  --r: 24px;
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  box-shadow: var(--shadow-2);
}
.stage {
  position: relative;
  height: clamp(360px, calc(100vh - 320px), 660px);
  overflow: hidden;
  isolation: isolate;
  background: var(--studio);
  transition: background 0.35s;
}
.stage.is-photo {
  background: #18191b;
}
.stage.is-art {
  background: #e8edf4;
}
.view {
  position: absolute;
  inset: 0;
}
.view > svg,
.view canvas,
.scene-art,
.scene-art svg {
  display: block;
  width: 100%;
  height: 100%;
}
.view > svg,
.scene-art {
  animation: fade 0.4s var(--ease) both;
}
.view > svg {
  position: relative;
}
/* Photo + pointer appear once loaded; letterboxed over a blurred copy */
.view > svg.photo {
  animation: none;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.view > svg.ready {
  opacity: 1;
}
.photo-bg {
  position: absolute;
  inset: -24px;
  display: none;
  background: #18191b no-repeat;
  filter: blur(16px) brightness(0.55);
  will-change: transform;
}
.letterbox .photo-bg {
  display: block;
}
.view canvas {
  cursor: grab;
  outline-offset: -3px;
}
.view canvas:active {
  cursor: grabbing;
}
/* Two-tone focus on the stage: visible on light and dark content */
@supports selector(:has(*)) {
  .view canvas:focus-visible {
    outline: none;
  }
  .stage:has(canvas:focus-visible)::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    border-radius: calc(var(--r) - 1px) calc(var(--r) - 1px) 0 0;
    box-shadow:
      inset 0 0 0 3px var(--accent),
      inset 0 0 0 6px #fff;
  }
}
.scene-art svg {
  overflow: visible;
}
.photo .pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: pulse 2s var(--ease) infinite;
}
.stage-top {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
}
.stage .seg {
  border-color: rgb(255 255 255 / 0.65);
  background: rgb(255 255 255 / 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 18px -8px rgb(38 55 64 / 0.35);
}
.stage .seg button:not([aria-pressed="true"]) {
  color: var(--ink-2);
}
.stage.is-photo .seg {
  border-color: rgb(255 255 255 / 0.14);
  background: rgb(24 25 27 / 0.78);
}
.stage.is-photo .seg button:not([aria-pressed="true"]) {
  color: #fff;
}
#stage button:focus-visible {
  outline-offset: 2px;
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 7px #fff;
}
.tools {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 4;
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid rgb(255 255 255 / 0.65);
  border-radius: 16px;
  background: rgb(255 255 255 / 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 18px -8px rgb(38 55 64 / 0.35);
}
.tools:empty {
  display: none;
}
.stage.is-photo .tools {
  top: 14px;
  bottom: auto;
}
@media (pointer: coarse) {
  /* Touch: drag turns the model; the rotate buttons stay for keyboard and switch users. */
  .tools:not(:focus-within) .tool.rot {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  /* 36 px buttons, 44 px hit areas */
  .tools {
    flex-direction: column;
    gap: 10px;
    padding: 0;
    right: 10px;
    bottom: 10px;
    border: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
  }
  .stage.is-photo .tools {
    top: 10px;
  }
  .stage .tools .tool {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgb(255 255 255 / 0.9);
    box-shadow: 0 2px 8px -2px rgb(38 55 64 / 0.4);
  }
  .tool::before {
    content: "";
    position: absolute;
    inset: -4px;
  }
}
.tool {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  transition: background 0.15s;
}
.tool:hover,
.tool[aria-pressed="true"] {
  background: rgb(38 55 64 / 0.08);
}
.stage-status {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  background: var(--studio);
  opacity: 0;
  visibility: hidden;
}
.stage.is-photo .stage-status {
  background: #18191b;
  color: #e4e5e7;
}
.stage.loading .stage-status {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s;
}
.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgb(38 55 64 / 0.12);
  border-top-color: var(--gold);
  animation: spin 0.9s linear infinite;
}
.model-ring {
  --size: var(--ring, 56px);
  position: absolute;
  z-index: 2;
  width: var(--size);
  height: var(--size);
  margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
  border: 3px solid var(--gold);
  border-radius: 50%;
  pointer-events: none;
  box-shadow:
    0 0 0 2px rgb(255 255 255 / 0.95),
    0 0 0 3px rgb(38 55 64 / 0.4),
    inset 0 0 0 2px rgb(255 255 255 / 0.95),
    inset 0 0 0 3px rgb(38 55 64 / 0.3),
    0 6px 16px rgb(24 25 27 / 0.28);
}
.model-ring::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  animation: pulse 2s var(--ease) infinite;
}
.model-ring[hidden] {
  display: none;
}
.model-ring.moving::after {
  animation: none;
  opacity: 0;
}
.visual-foot {
  display: grid;
  gap: 10px;
  padding: 14px 20px 16px;
  border-top: 1px solid var(--line);
}
.caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 18px;
}
.hint {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
}
.hint-sub {
  font-weight: 500;
  color: var(--muted);
}
.ring-ico {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  border: 3px solid var(--gold);
  border-radius: 50%;
  box-shadow:
    0 0 0 1.5px #fff,
    0 0 0 3px rgb(38 55 64 / 0.14);
}
.credit {
  font-size: 13px;
  color: var(--muted);
}
.visual-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--gold-50);
  color: var(--gold-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}
.visual-note[hidden] {
  display: none;
}
.visual-note .i {
  margin-top: 1px;
}
.unavailable {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 100%;
  padding: 28px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}
.unavailable > .i {
  width: 32px;
  height: 32px;
  color: var(--accent);
}
.small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.panel {
  display: flex;
  flex-direction: column;
  padding-top: 6px;
}
.panel.enter-next > *,
.panel.enter-back > * {
  animation: rise 0.42s var(--ease) both;
}
.panel.enter-back > * {
  animation-name: drop;
}
.panel > :nth-child(2) {
  animation-delay: 0.03s;
}
.panel > :nth-child(3) {
  animation-delay: 0.06s;
}
.panel > :nth-child(4) {
  animation-delay: 0.09s;
}
.panel > :nth-child(n + 5) {
  animation-delay: 0.12s;
}
.panel h1 {
  margin-top: 14px;
  font-size: clamp(25px, 2.3vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-weight: 800;
  text-wrap: balance;
}
.helper {
  margin-top: 10px;
  font-size: 15px;
  color: var(--muted);
}
.answers {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}
.answer {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 12px 16px 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #fff;
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: var(--shadow-1);
  transition:
    border-color 0.15s,
    background 0.15s,
    box-shadow 0.2s,
    transform 0.15s;
}
.answer:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow-2);
}
.answer:active {
  transform: scale(0.992);
}
.letter {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
  transition:
    background 0.15s,
    color 0.15s;
}
.answer-text {
  flex: 1;
}
.tick {
  color: var(--accent);
  opacity: 0;
  transform: scale(0.5);
  transition:
    opacity 0.2s,
    transform 0.25s var(--ease);
  stroke-width: 2.6;
}
.answer[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-50);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.answer[aria-pressed="true"] .letter {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.answer[aria-pressed="true"] .tick {
  opacity: 1;
  transform: none;
}
.alternates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.alt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px 0 12px;
  border: 1.5px dashed var(--line-2);
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s;
}
.alt:hover {
  border-color: var(--ink-2);
}
.alt[aria-pressed="true"] {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-50);
  color: var(--accent);
}
.question-nav {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding: 22px 0 16px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.question-nav .primary {
  min-width: min(168px, 55%);
}
.layout-note {
  margin: 18px 0 24px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Result ---------- */
.result {
  max-width: 880px;
  margin: 0 auto;
}
.result-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.8fr);
  align-items: center;
  gap: 24px 40px;
  margin-bottom: 28px;
}
.result-copy > * {
  animation: rise 0.55s var(--ease) both;
}
.result-copy > :nth-child(2) {
  animation-delay: 0.06s;
}
.result-copy > :nth-child(3) {
  animation-delay: 0.1s;
}
.result-copy > :nth-child(4) {
  animation-delay: 0.14s;
}
.done-badge {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: var(--green-50);
  color: var(--green);
  box-shadow:
    inset 0 0 0 2px #fff,
    0 0 0 1px var(--line);
}
.done-badge::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  animation: pulse 1.6s var(--ease) 0.3s 2 both;
}
.done-badge .i {
  width: 28px;
  height: 28px;
  stroke-width: 2.6;
  stroke-dasharray: 24;
  animation: draw 0.6s var(--ease) 0.25s both;
}
.result h1 {
  margin-top: 12px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  word-spacing: 0.04em;
}
.result-truck {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 24px;
  background: var(--studio);
  border: 1px solid var(--line);
  overflow: hidden;
  animation: fade 0.8s var(--ease) 0.1s both;
}
.result-card,
.result-actions {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-2);
}
.result-card {
  overflow: hidden;
  animation: rise 0.6s var(--ease) 0.15s both;
}
.result-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}
.result-label strong {
  display: block;
  font-size: 17px;
}
.result-label span {
  font-size: 14px;
  color: var(--muted);
}
.result-when {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.result-label .result-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-weight: 700;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.result-time .i {
  width: 17px;
  height: 17px;
  color: var(--muted);
}
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}
.tiles.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tile {
  padding: 20px 22px;
  border-radius: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.tile-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.tile-score {
  display: block;
  margin: 8px 0 4px;
  font-size: clamp(40px, 5vw, 54px);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.tile-score small {
  font-size: 0.42em;
  letter-spacing: 0;
  font-weight: 600;
  color: var(--muted);
}
.tile p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}
.tile.flag {
  background: var(--gold-50);
  border-color: #ead9b7;
}
.tile.flag .tile-label,
.tile.flag p {
  color: var(--gold-ink);
}
.result-note {
  display: flex;
  gap: 12px;
  margin: 0 16px 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--green-50);
  font-size: 14px;
  line-height: 1.6;
}
.result-note .i {
  margin-top: 2px;
  color: var(--green);
}
.result-note.flagged {
  background: var(--gold-50);
}
.result-note.flagged .i {
  color: var(--gold-ink);
}
.result-actions {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 22px 24px;
  animation: rise 0.6s var(--ease) 0.22s both;
}
.field {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}
.field em {
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
}
.field input {
  width: 100%;
  max-width: 440px;
  min-height: 50px;
  padding: 0 16px;
  border: 1.5px solid var(--line-2);
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
  font-weight: 500;
}
.field input::placeholder {
  color: #627982;
}
.field input:focus-visible {
  border-color: var(--accent);
  outline-offset: 2px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.toast {
  min-height: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
}
.toast:empty {
  display: none;
}
.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}
.privacy-note .i {
  width: 18px;
  height: 18px;
}
.print-head,
.so-s {
  display: none;
}
.review {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  overflow: hidden;
}
.review summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.review summary::-webkit-details-marker {
  display: none;
}
.review summary::after {
  content: "";
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.2s;
}
.review[open] summary::after {
  transform: rotate(-135deg);
}
.review summary:focus-visible {
  outline-offset: -4px;
  border-radius: 24px;
}
.review-row {
  display: grid;
  gap: 4px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.review-row strong {
  font-size: 15px;
}
.review-row p {
  color: var(--ink-2);
}
.review-row .why {
  color: var(--muted);
}
.review-row a,
.review-credit {
  justify-self: start;
  font-size: 13px;
  color: var(--muted);
}
.review-credit {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
}
.status {
  justify-self: start;
  margin-bottom: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.status.ok {
  background: var(--green-50);
  color: var(--green);
}
.status.follow {
  background: var(--accent-50);
  color: var(--accent);
}
.status.layout {
  background: var(--gold-50);
  color: var(--gold-ink);
}
.result-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Dialogs ---------- */
dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: min(86vh, 780px);
  padding: 36px 36px 30px;
  border: 0;
  border-radius: 24px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgb(24 25 27 / 0.5);
  overflow: auto;
}
dialog[open] {
  animation: pop 0.28s var(--ease);
}
dialog::backdrop {
  background: rgb(38 55 64 / 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
dialog h2 {
  margin: 12px 0 14px;
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.03em;
}
dialog h3 {
  margin-top: 24px;
  font-size: 16px;
}
dialog p,
dialog li {
  margin: 10px 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
}
.sources {
  padding-left: 20px;
}
.sources a[href] {
  color: var(--accent);
}
/* Sticky close (no top padding: sticky offsets agree) */
#about-dialog {
  padding-top: 0;
}
#about-dialog .eyebrow {
  margin-top: 34px;
}
.close {
  position: sticky;
  top: 14px;
  z-index: 1;
  float: right;
  margin: 14px -22px 0 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 6px #fff;
}
.close:hover {
  background: var(--line);
}
.close svg,
.dialog-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#reset-dialog {
  width: min(460px, calc(100vw - 32px));
}
.dialog-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-50);
  color: var(--accent);
}
/* Begin: the chosen check waits, blurred past reading, behind this dialog until the applicant is ready */
#begin-dialog {
  width: min(480px, calc(100vw - 32px));
}
#begin-dialog::backdrop {
  background: rgb(38 55 64 / 0.32);
}
.begin-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
#begin-dialog .begin-facts li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 5px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
}
#begin-dialog #begin-desc {
  margin-top: 16px;
}
:is(.topbar, footer, .check-head, .visual, .panel > *) {
  transition: filter 0.3s var(--ease);
}
.awaiting-begin :is(.topbar, footer, .check-head, .visual, .panel > *) {
  filter: blur(18px);
  transition: none;
}
dialog .actions {
  margin-top: 22px;
}
dialog .actions .button {
  flex: 1 1 auto;
}
.no-script {
  max-width: 640px;
  margin: 40px auto;
  padding: 24px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 600;
}

/* ---------- Motion ---------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}
@keyframes pulse {
  0% {
    opacity: 0.85;
    transform: scale(1);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(1.6);
  }
}
@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}
@keyframes draw {
  from {
    stroke-dashoffset: 24;
  }
  to {
    stroke-dashoffset: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .model-ring::after,
  .photo .pulse,
  .done-badge::after {
    display: none;
  }
  .done-badge .i {
    stroke-dasharray: none;
  }
}

/* ---------- Responsive ---------- */
@media (min-width: 1500px) {
  main {
    padding-top: 56px;
  }
}
@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .how {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .workspace {
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 1fr);
    gap: 28px;
  }
}
@media (max-width: 960px) {
  .workspace {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .stage {
    height: clamp(260px, 42svh, 440px);
  }
  .check-head {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }
  .steps {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
  }
  .cards {
    gap: 14px;
  }
  .card-body {
    padding: 16px 18px 18px;
  }
  .card-title {
    font-size: 19px;
  }
}
@media (max-width: 960px) and (min-height: 501px) {
  html:has(body[data-screen="question"]) {
    scroll-padding-bottom: 100px;
  }
  body[data-screen="question"] main {
    padding-bottom: 128px;
  }
  body[data-screen="question"] footer {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }
  .question-nav {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 20;
    padding: 12px max(16px, 50% - 360px)
      calc(12px + env(safe-area-inset-bottom));
    background: rgb(255 255 255 / 0.9);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 -10px 30px -18px rgb(38 55 64 / 0.35);
  }
  .question-nav .primary {
    flex: 1;
  }
  .panel.enter-next > .question-nav,
  .panel.enter-back > .question-nav {
    animation: none;
  }
}
@media (max-width: 720px) {
  .topbar {
    height: 60px;
  }
  .brand img {
    width: 38px;
    height: 34px;
  }
  .brand > span {
    font-size: 18px;
  }
  .brand small {
    font-size: 7px;
    margin-top: 3px;
  }
  .product-label {
    display: none;
  }
  .back-link {
    font-size: 13px;
  }
  main {
    padding-top: 28px;
    padding-bottom: 48px;
  }
  .hero h1 {
    margin-top: 14px;
  }
  .lead {
    margin-top: 12px;
  }
  .facts {
    margin-top: 20px;
  }
  .facts li {
    font-size: 13px;
    padding: 6px 12px 6px 8px;
  }
  .how {
    display: none;
  }
  .choose {
    margin-top: 32px;
  }
  .choose-head {
    margin-bottom: 16px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .truck-card {
    display: grid;
    grid-template-columns: 46% minmax(0, 1fr);
    border-radius: 20px;
  }
  .card-art {
    aspect-ratio: auto;
    min-height: 148px;
  }
  .card-body {
    justify-content: center;
    padding: 14px 16px;
    border-top: 0;
    border-left: 1px solid var(--line);
  }
  .card-title {
    font-size: 18px;
    line-height: 1.2;
  }
  .card-detail {
    font-size: 13px;
    line-height: 1.4;
  }
  .card-cta {
    margin-top: 0;
    padding-top: 10px;
    font-size: 14px;
  }
  .go {
    width: 36px;
    height: 36px;
  }
  .intro-note {
    align-items: flex-start;
  }
  body[data-screen="question"] .topbar {
    height: 48px;
  }
  body[data-screen="question"] main {
    min-height: calc(100vh - 48px);
    padding: 8px 12px 128px;
  }
  .check-head .seg-group span,
  .count-word,
  body[data-screen="question"] .helper,
  .panel > .eyebrow {
    display: none;
  }
  /* Progress bars get their own full-width row: one bar per question stays readable */
  .check-head {
    grid-template-columns: auto auto;
    justify-content: space-between;
    gap: 8px 12px;
    margin: 0 4px 10px;
  }
  .steps {
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 6px;
  }
  .bars {
    gap: 3px;
  }
  .bars i {
    height: 5px;
  }
  .truck-chip {
    min-height: 34px;
    padding: 0 12px 0 10px;
    font-size: 13px;
  }
  .check-meta {
    gap: 8px;
  }
  .count {
    font-size: 13px;
  }
  .check-meta .text-button {
    margin: -4px 0;
    font-size: 13px;
  }
  .visual {
    --r: 20px;
  }
  .stage {
    height: clamp(190px, 28vh, 300px);
    height: clamp(190px, 28svh, 300px);
  }
  .stage-top {
    top: 10px;
    left: 10px;
  }
  .stage .seg button {
    padding: 0 14px;
    font-size: 14px;
  }
  .stage .seg .i {
    display: none;
  }
  .visual-foot {
    padding: 8px 14px;
    gap: 6px;
  }
  .caption {
    gap: 0 12px;
    line-height: 1.4;
  }
  .hint {
    gap: 8px;
    font-size: 13px;
  }
  .ring-ico {
    margin-top: 1px;
  }
  .credit {
    font-size: 12px;
  }
  .visual-note {
    font-size: 13px;
  }
  .panel {
    padding: 0 4px;
  }
  .workspace {
    gap: 14px;
  }
  .panel h1 {
    margin-top: 0;
    font-size: clamp(21px, 6vw, 25px);
  }
  .answers {
    margin-top: 12px;
    gap: 8px;
  }
  /* Four answers and both alternates: compact rows, the two alternates on one line */
  .answer {
    min-height: 52px;
    gap: 12px;
    padding: 9px 14px 9px 11px;
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.35;
  }
  .letter {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 13px;
  }
  .alternates {
    gap: 6px;
    margin-top: 12px;
  }
  .alt {
    gap: 6px;
    padding: 0 12px 0 9px;
    font-size: 13px;
  }
  .alt .i {
    width: 18px;
    height: 18px;
  }
  .layout-note {
    margin: 14px 0 20px;
  }
  .result-hero {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .result-truck {
    aspect-ratio: 16 / 9;
    order: -1;
  }
  .done-badge {
    width: 48px;
    height: 48px;
    margin-bottom: 14px;
  }
  .tiles,
  .tiles.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
  }
  .tile.flag {
    grid-column: 1 / -1;
  }
  .tile {
    padding: 16px;
  }
  .result-label {
    padding: 16px 18px;
  }
  .result-note {
    margin: 0 12px 12px;
  }
  .result-actions {
    padding: 18px;
  }
  .actions .button {
    flex: 1 1 auto;
  }
  .review summary,
  .review-row {
    padding-left: 18px;
    padding-right: 18px;
  }
  dialog {
    padding: 28px 22px 22px;
  }
  .close {
    margin-right: -8px;
  }
  footer {
    flex-direction: column;
    gap: 4px;
    padding-top: 18px;
    padding-bottom: 22px;
    text-align: center;
  }
}
@media (max-width: 380px) {
  .brand > span {
    font-size: 16px;
  }
  .hero h1 {
    font-size: 36px;
  }
  .truck-card {
    grid-template-columns: 42% minmax(0, 1fr);
  }
  .card-title {
    font-size: 16px;
  }
  .stage .seg button {
    padding: 0 10px;
  }
  .tiles,
  .tiles.three {
    grid-template-columns: 1fr;
  }
  .question-nav .secondary span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .check-meta .so {
    display: none;
  }
  .so-s {
    display: inline;
  }
}
/* Phones (not landscape, which keeps one row): the timer ends the progress row, so the truck, count and Start over keep
   the first row to themselves */
@media (max-width: 639px), (max-width: 720px) and (min-height: 501px) {
  .check-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  .check-meta {
    display: contents;
  }
  .truck-chip {
    min-width: 0;
  }
  .count {
    order: 1;
    margin-left: auto;
  }
  .check-meta .reset {
    order: 2;
  }
  .steps {
    order: 3;
    flex: 1 1 calc(100% - 96px);
    min-width: 0;
  }
  .timer {
    order: 4;
    gap: 4px;
    font-size: 13px;
    line-height: 16px;
  }
  .timer .i {
    width: 15px;
    height: 15px;
  }
}
/* Short phones: smaller stage, tighter prompt and answers, so a question opens with all four choices above Back / Next */
@media (max-width: 720px) and (max-height: 700px) {
  .stage {
    height: clamp(130px, 24svh, 300px);
  }
  .workspace {
    gap: 10px;
  }
  .visual-foot {
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .panel h1 {
    font-size: 20px;
  }
  .answers {
    margin-top: 10px;
    gap: 6px;
  }
  .answer {
    min-height: 46px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .letter {
    width: 28px;
    height: 28px;
  }
}
/* Short windows (landscape, zoom): Back / Next in the flow */
@media (max-width: 960px) and (max-height: 500px) {
  body[data-screen="question"] main {
    padding-bottom: 32px;
  }
  .stage {
    height: clamp(160px, 60svh, 360px);
  }
  .question-nav {
    position: static;
    padding-bottom: 0;
  }
}
/* Landscape phones: stage in view on the left, Back / Next pinned */
@media (min-width: 640px) and (max-width: 960px) and (max-height: 500px) {
  body[data-screen="question"] .topbar {
    display: none;
  }
  body[data-screen="question"] main {
    padding: 8px 16px 16px;
  }
  .check-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
    margin-bottom: 8px;
  }
  .steps {
    grid-column: auto;
    grid-row: auto;
  }
  .seg-group span,
  .panel > .eyebrow,
  body[data-screen="question"] .helper {
    display: none;
  }
  .workspace {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 20px;
  }
  .visual {
    position: sticky;
    top: 8px;
  }
  .stage {
    height: calc(100svh - 128px);
  }
  .panel h1 {
    margin-top: 0;
    font-size: 22px;
  }
  .question-nav {
    position: sticky;
    padding: 12px 0;
  }
}
/* Short windows (landscape phones): the Begin dialog drops its icon so Begin stays in view without scrolling */
@media (max-height: 500px) {
  #begin-dialog {
    padding-top: 24px;
    padding-bottom: 20px;
  }
  #begin-dialog .dialog-icon {
    display: none;
  }
  #begin-dialog h2 {
    margin-top: 0;
  }
  #begin-dialog #begin-desc {
    margin: 12px 0 0;
  }
  #begin-dialog .actions {
    margin-top: 16px;
  }
}
/* Shorter desktops: Back / Next at the window's foot */
@media (min-width: 961px) and (max-height: 920px) {
  .panel {
    min-height: calc(100vh - 166px);
  }
}
@media (min-width: 961px) and (max-height: 760px) {
  .stage {
    height: clamp(320px, calc(100vh - 360px), 660px);
  }
  .panel h1 {
    font-size: 24px;
  }
}

/* ---------- Print ---------- */
@media print {
  @page {
    margin: 14mm;
  }
  :root,
  body {
    background: #fff;
    color: #111;
  }
  .topbar {
    height: auto;
    padding: 0 0 10px;
  }
  .back-link,
  .product-label,
  footer,
  dialog,
  .skip,
  .result-hero,
  .result-label,
  .result-actions,
  .result-bottom,
  .review summary,
  .review-row a,
  .review-credit {
    display: none !important;
  }
  main {
    max-width: none;
    min-height: 0;
    padding: 18px 0 0;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
  }
  /* A record: title, applicant, truck and date first */
  .print-head {
    display: block;
    margin-bottom: 14px;
    font-size: 13px;
  }
  .print-head strong {
    font-size: 20px;
  }
  .result-card,
  .review {
    border-radius: 10px;
    border-color: #bbb;
  }
  .tile-score {
    font-size: 32px;
  }
  .tile,
  .result-card,
  .review-row {
    break-inside: avoid;
  }
  .review > :not(summary) {
    display: grid !important;
  }
  .review-row {
    padding: 10px 14px;
    font-size: 12px;
  }
}

/* A fixed assignment has no truck-selection action. Button layout must not override hidden. */
#begin-back[hidden] {
  display: none;
}
