/* Layout: an app shell the height of the screen. A header, then the deck: the slide's
   panel (question, choices, then Back and Next right under them) and the stage picture.
   On phones Back and Next become a bar along the bottom. The page itself doesn't scroll;
   a long slide scrolls inside its panel. The design notes are a drawer.
   Tokens come from tokens.css. Motion lives at the end, with the reduced-motion block last. */

*, *::before, *::after { box-sizing: border-box; }
:root { --gutter: max(16px, var(--space-48)); --stage-h: 34dvh; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--p-sm);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ol, ul, dl, dd, figure, blockquote { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); }
[hidden] { display: none !important; }
[tabindex="-1"]:focus { outline: none; }
[tabindex="-1"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Shell ── */
.shell {
  height: 100vh; height: 100dvh;
  display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr);
}

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px var(--gutter);
  min-height: 60px;
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 18px; min-width: 0; }
.wordmark {
  font-weight: 600; font-size: 1rem;
  letter-spacing: 0.3em; text-transform: uppercase; white-space: nowrap;
}
.collection { font-size: 0.8125rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 599px) {
  .brand { flex-direction: column; gap: 0; }
  .wordmark { font-size: 0.9375rem; letter-spacing: 0.28em; }
  .collection { font-size: 0.75rem; }
}
@media (max-width: 369px) {
  .wordmark { font-size: 0.8125rem; letter-spacing: 0.14em; }
  .collection { font-size: 0.6875rem; }
  .notes-btn { padding-inline: 10px; gap: 6px; }
}
/* The visitor's control, so it is dressed apart from the app: a black outline, where
   the app's buttons are mint or grey. Hover fills it black, like the notes it opens. */
.notes-btn {
  flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 6px 14px 6px 12px;
  border: 0; border-radius: var(--radius-full); cursor: pointer;
  background: var(--ground); color: var(--demo-bg);
  box-shadow: inset 0 0 0 1.5px var(--demo-bg);
  font-size: 0.8125rem; font-weight: 600;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.notes-btn svg { width: 16px; height: 16px; }
/* The way back to the site's experiments, worded as on the other experiments. A plain
   link, so Design notes stays the visitor's one button. */
.visitor { display: flex; align-items: center; gap: 12px; flex: none; }
.back-site {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 4px;
  font-size: 0.8125rem; font-weight: 600; color: var(--ink); white-space: nowrap;
  text-decoration: none; text-underline-offset: 0.2em; text-decoration-thickness: 1px;
}
.back-site:hover { color: var(--accent-ink); text-decoration-line: underline; }
.back-site:hover > span[aria-hidden] { text-decoration: none; }
/* No room beside the wordmark on phones. There the way back is the cover's breadcrumb
   and "All experiments" in the design notes. */
@media (max-width: 599px) { .back-site { display: none; } }
.notes-btn:hover { background: var(--demo-bg); color: var(--demo-ink); }

/* ── Deck: panel and stage. Phones stack the picture on top; wide screens read
   left to right: the question and choices, then the picture they change. ── */
.deck {
  min-height: 0;
  display: grid;
  grid-template-rows: var(--stage-h) minmax(0, 1fr);
  grid-template-areas: "stage" "panel";
}
.panel {
  grid-area: panel;
  min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 22px var(--gutter) 0;
}
.panel-inner { flex: 1 0 auto; display: flex; flex-direction: column; gap: var(--space-32); }
#req { display: contents; }
.panel:focus-visible { outline-offset: -3px; }
.slide { display: grid; gap: var(--space-24); justify-items: start; width: 100%; max-width: 520px; }

@media (max-width: 899px) {
  [data-slide="check"] { --stage-h: 22dvh; }
  [data-slide="result"] { --stage-h: 30dvh; }
  [data-slide="approved"] { --stage-h: 40dvh; }
  [data-slide="intro"] .deck, [data-slide="pending"] .deck { grid-template-rows: 0 minmax(0, 1fr); }
  [data-slide="intro"] .stage { display: none; }
}
@media (min-width: 900px) {
  .deck {
    grid-template-columns: minmax(420px, 1fr) minmax(0, 1.05fr);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "panel stage";
  }
  /* The title and the footer hold their place on every slide: content starts at the top,
     the footer is pinned to the bottom, and a long slide scrolls between them. Only the
     cover, which has no footer, sits in the middle. */
  .panel { padding: var(--space-48) var(--space-64) 0; scroll-padding-bottom: 180px; }
  .panel-inner { flex: 1 0 auto; }
  :root[data-slide="intro"] .panel-inner { flex: 0 0 auto; margin-block: auto; }
  /* A one-line band above every title. A status pill or notice sits in it, so it never
     pushes the title down. */
  .slide:not(.slide-intro) { --band: 40px; position: relative; padding-top: var(--band); }
  .slide :is(.pill, .notice):has(+ .slide-h) { position: absolute; top: 0; left: 0; margin: 0; }
  .slide .pill + .slide-h { margin-top: 0; }
}
[data-slide="pending"] .slide-intro { display: none; }
/* Short screens (a phone on its side, a zoomed window): let the page scroll instead,
   so nothing is squeezed into a sliver. The footer stays in reach. */
@media (max-height: 560px) {
  body { overflow: auto; }
  .shell { height: auto; min-height: 100dvh; }
  .deck { grid-template-rows: auto auto; }
  .stage { height: 240px; }
  .panel { overflow: visible; }
}
@media (max-height: 560px) and (min-width: 900px) {
  .deck { grid-template-rows: auto; }
  .stage { height: auto; min-height: 420px; }
  /* The page scrolls here, so the footer just follows the slide. (Listed before the
     desktop footer rule below, so it needs the extra class to win.) */
  .panel .foot { position: static; }
}

/* ── Stage: the picture ── */
/* The picture is a framed shot on the white page: its paper backdrop stays inside the frame. */
.stage { --frame: 16px; grid-area: stage; position: relative; overflow: hidden; background: var(--ground); min-height: 0; }
@media (min-width: 900px) { .stage { --frame: var(--space-32); } }
.stage-art, .art, .layer { position: absolute; inset: 0; }
.stage-art { inset: var(--frame); }
.stage svg { display: block; width: 100%; height: 100%; transition: filter var(--dur) var(--ease), opacity var(--dur) var(--ease); }

/* The brief as line art: what you asked for, before anything is generated. */
.sl-sketch .sk * {
  fill: none; stroke: #574d44; stroke-width: 1.5px;
  stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke;
}

/* Generating develops like a print: the render comes down over the sketch one stage at
   a time, soft and grey at first and sharper with each stage. */
.layer-render {
  clip-path: inset(0 0 calc(100% - var(--reveal, 0) * 100%) 0);
  transition: clip-path 1.2s var(--ease);
}
.stage .layer-render svg {
  filter: blur(calc((1 - var(--reveal, 0)) * 7px)) saturate(calc(0.35 + var(--reveal, 0) * 0.65));
  transition: filter 1.2s var(--ease);
}
/* Checking the result: one slow pass of light across what has developed. */
.layer-render::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 250, 240, 0.42) 50%, transparent 65%);
}
.stage-art::after {
  content: ""; position: absolute; left: 0; right: 0; height: 2px;
  top: calc(var(--reveal, 0) * 100%);
  background: rgba(252, 252, 252, 0.9);
  box-shadow: 0 0 18px 3px rgba(252, 252, 252, 0.75);
  opacity: 0; pointer-events: none;
  transition: top 1.2s var(--ease), opacity var(--dur) var(--ease);
}
.stage-art[data-mode="generating"]::after { opacity: 1; }
.stage-art[data-mode="queued"] .layer-sketch { opacity: 0.7; }
.stage-art[data-mode="failed"] .layer-sketch { filter: grayscale(1); opacity: 0.5; }
.stage-art[data-mode="out"] svg { filter: grayscale(1); opacity: 0.45; }

/* Results: a contact sheet, the prints laid out on the white table. */
.sheet {
  position: absolute; top: 50%; left: 50%; translate: -50% -50%;
  /* Clear of the AI-generated tag above and the caption below. */
  height: calc(100% - var(--clear, 96px)); aspect-ratio: 4 / 5; max-width: calc(100% - 16px);
  display: grid; grid-template: 1fr 1fr / 1fr 1fr; gap: 12px;
}
/* Prints on a table: each one slightly askew, and each one opens for review. */
.print {
  display: block; min-height: 0; overflow: hidden; padding: 0; border: 0; border-radius: 0; cursor: pointer;
  background: #e3ddd3;
  box-shadow: 0 1px 2px rgba(9, 9, 11, 0.12), 0 12px 28px rgba(9, 9, 11, 0.16);
  rotate: var(--r);
  transition: translate var(--dur) var(--ease);
}
.print:hover { translate: 0 -4px; }
.print:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.print:nth-child(1) { --r: -1.2deg; --from: -14deg; --dx: -30px; }
.print:nth-child(2) { --r: 0.9deg; --from: 12deg; --dx: 30px; }
.print:nth-child(3) { --r: 0.6deg; --from: -10deg; --dx: -24px; }
.print:nth-child(4) { --r: -0.8deg; --from: 16deg; --dx: 26px; }
.print:nth-child(5) { --r: 1.1deg; --from: -12deg; --dx: 28px; }
/* Five views: three over two, each print still 4:5. */
.sheet-5 { aspect-ratio: 6 / 5; grid-template: 1fr 1fr / repeat(6, 1fr); }
.sheet-5 .print { grid-column: span 2; }
.sheet-5 .print:nth-child(4) { grid-column: 2 / span 2; }
@media (max-width: 899px) { .sheet-5 .print-badge { left: 4px; top: 4px; padding: 1px 4px; font-size: 0.5625rem; } }
.print { position: relative; }
.print-badge {
  position: absolute; left: 8px; top: 8px;
  padding: 2px 7px; border-radius: 2px;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.02em;
}
.print-mismatch { background: var(--block-soft); color: var(--block-ink); }
.print-approved { background: var(--ok-soft); color: var(--ok-ink); }

.tag {
  position: absolute; left: calc(var(--frame) + 12px); top: calc(var(--frame) + 12px);
  padding: 4px 8px; border-radius: 2px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
  background: color-mix(in srgb, var(--black) 82%, transparent); color: var(--white);
}
.tag, .stage-cap { pointer-events: none; }
.stage-cap {
  position: absolute; left: calc(var(--frame) + 12px); bottom: calc(var(--frame) + 12px);
  max-width: min(46ch, calc(100% - var(--frame) * 2 - 24px));
  padding: 6px 10px; border-radius: 2px;
  background: color-mix(in srgb, var(--white) 92%, transparent); color: var(--black);
  font-size: 0.8125rem; line-height: 1.4;
}
.stage-cap strong { font-weight: 700; margin-right: 4px; }
@media (max-width: 899px) {
  .sheet { --clear: 64px; }
  .tag { left: calc(var(--frame) + 8px); top: calc(var(--frame) + 8px); font-size: 0.6875rem; }
  /* One line on a small picture; the full text is still the figure's name. */
  .stage-cap {
    left: calc(var(--frame) + 8px); bottom: calc(var(--frame) + 8px); max-width: calc(100% - var(--frame) * 2 - 16px); font-size: 0.75rem; padding: 4px 8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
}
.stamp {
  position: absolute; right: 24px; bottom: 64px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 2px;
  background: var(--teal-50); color: var(--teal-800);
  font-size: 0.875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  transform: rotate(-3deg);
}
.stamp svg { width: 18px; height: 18px; }
.check-draw path, .ring { stroke-dasharray: 1; stroke-dashoffset: 0; }
/* On a phone the hint has no room; Next appears once there's a way forward. */
@media (max-width: 599px) { .foot-hint { display: none; } }
@media (max-width: 899px) { .stamp { right: 14px; bottom: 44px; font-size: 0.75rem; padding: 6px 10px; } }

/* ── Cover ── */
.slide-intro { gap: 0; max-width: 620px; padding-bottom: 28px; }
.crumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0 10px; font-size: 0.8125rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 10px; }
.title {
  margin-top: var(--space-32);
  font-weight: 200;
  font-size: var(--h1); line-height: 1; letter-spacing: -0.03em;
}
.title em { font-style: normal; font-weight: 600; color: var(--no); }
.standfirst {
  margin-top: var(--space-24); max-width: 52ch;
  font-size: var(--p-lg); line-height: var(--lh-l); color: var(--ink-2);
}
.disclaimer {
  margin-top: var(--space-24);
  font-size: 0.8125rem; color: var(--muted);
  display: flex; gap: 8px; align-items: baseline;
}
.disclaimer::before { content: ""; width: 7px; height: 7px; flex: none; background: var(--no); transform: translateY(-1px); }
.intro-go { margin-top: var(--space-32); display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.intro-hint { max-width: 40ch; font-size: 0.875rem; color: var(--muted); }

/* ── Slides ── */
.slide-h {
  font-weight: 600;
  font-size: clamp(1.75rem, 1.25rem + 1.6vw, 3rem); line-height: 1.08; letter-spacing: -0.025em;
  max-width: 18ch;
}
.slide-h label { cursor: default; }
.slide-sub, .lede { font-size: var(--p); line-height: var(--lh-l); color: var(--ink-2); max-width: 46ch; }
.slide-h + .slide-sub { margin-top: calc(var(--space-24) * -0.5); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Tiles */
.tiles { border: 0; margin: 0; padding: 0; min-width: 0; width: 100%; display: grid; gap: 8px; }
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tiles-5 .tile-pic { aspect-ratio: 4 / 5; margin-bottom: 8px; }
.tiles-5 .tile-name { font-size: 0.875rem; }
@media (max-width: 599px) {
  /* Three over two: five across leaves no room for the tick beside "3/4 front". */
  .tiles-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles-5 .tile { padding: 6px 6px 10px; }
  .tiles-5 .tile:has(:checked)::after { right: 10px; bottom: 14px; }
}
.tiles-cast { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.tile {
  position: relative; cursor: pointer;
  display: grid; align-content: start; gap: 2px;
  padding: 8px 8px 12px;
  background: var(--panel);
  border-radius: 2px;
  transition: background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.tile input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tile-pic { display: block; overflow: hidden; background: #e3ddd3; }
.tile-pic svg { width: 100%; height: 100%; display: block; }
.tiles-3 .tile-pic { aspect-ratio: 4 / 5; margin-bottom: 8px; }
.tile-text { display: grid; gap: 2px; min-width: 0; }
.tile-name { font-weight: 600; line-height: 1.25; }
.tile-desc { font-size: 0.8125rem; line-height: 1.35; color: var(--muted); }
.tile:hover:not(:has(:checked)) { background: var(--panel-2); }
/* Chosen: an ink border on the same grey, drawn inside so nothing shifts. The green focus
   ring sits outside it, so the two never read as one. */
.tile:has(:checked) { box-shadow: inset 0 0 0 2px var(--ink); }
.tile:has(:checked)::after {
  content: ""; position: absolute; right: 14px; bottom: 16px; width: 10px; height: 5px;
  border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg);
}
.tile:has(:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }

.tile-row, .tile-cast { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; padding: 8px 40px 8px 8px; }
.tile-row .tile-pic { width: 56px; height: 70px; }
.tile-cast .tile-pic { width: 48px; height: 48px; border-radius: 50%; background: none; }
.tile-row:has(:checked)::after, .tile-cast:has(:checked)::after { bottom: auto; top: calc(50% - 5px); }
.tiles-3 .tile-name { font-size: 0.875rem; }
@media (max-width: 520px) {
  .tiles-3 .tile { padding: 6px 6px 10px; }
  .tiles-3 .tile-desc { font-size: 0.75rem; }
  .tiles-3 .tile:has(:checked)::after { right: 8px; bottom: 12px; }
  .tile-cast { padding-right: 32px; gap: 10px; }
  .tile-cast:has(:checked)::after { right: 10px; }
}

/* Direction */
.note-wrap { display: grid; gap: 8px; justify-items: end; width: 100%; }
textarea {
  width: 100%;
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 12px 14px;
  line-height: 1.5; font-size: 1rem;
  resize: vertical; min-height: 7em;
}
textarea[aria-invalid] { border-color: var(--block-ink); box-shadow: inset 0 0 0 1px var(--block-ink); }
.flag { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8125rem; font-weight: 600; color: var(--block-ink); }
.flag svg { width: 14px; height: 14px; flex: none; }
.ready-extra { display: grid; gap: 12px; width: 100%; }
.ready-extra:empty { display: none; }
.notice { font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.kept { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 0.875rem; color: var(--ink-2); }
.kept .btn { margin-left: -8px; }

/* The check */
.check { display: grid; gap: var(--space-24); justify-items: start; }
.tripped { width: 100%; }
.tripped figcaption { font-size: 0.8125rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.tripped blockquote { font-size: var(--p-lg); line-height: var(--lh-l); padding: 12px 16px; background: var(--panel); }
/* A highlighter swipe under the exact phrase. */
mark {
  background: linear-gradient(var(--block-soft), var(--block-soft)) no-repeat 0 0 / 100% 100%;
  color: var(--ink);
  text-decoration: underline 2px var(--block-ink); text-underline-offset: 0.18em;
  padding: 0 2px;
}
.check .btn-primary { text-align: left; }
.why { font-size: 0.875rem; color: var(--ink-2); max-width: 56ch; }
.why summary { cursor: pointer; font-weight: 600; color: var(--ink); width: fit-content; list-style: none; display: flex; gap: 8px; align-items: center; min-height: 32px; }
.why summary::-webkit-details-marker { display: none; }
.why summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform var(--dur) var(--ease); }
.why[open] summary::before { transform: rotate(45deg) translate(-2px, -1px); }
.why p { margin-top: 6px; }

.diff { width: 100%; background: var(--panel); padding: 14px 16px; border-radius: 2px; display: grid; gap: 10px; justify-items: start; }
.diff dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 0.875rem; }
.diff dt { color: var(--muted); }
.diff del {
  color: var(--ink); padding: 0 3px; text-decoration: none;
  /* The strike-through is drawn as a line, so it can be struck while you watch. */
  background:
    linear-gradient(var(--ink), var(--ink)) no-repeat 0 58% / 100% 1.5px,
    linear-gradient(var(--block-soft), var(--block-soft));
}
@media (forced-colors: active) { .diff del { text-decoration: line-through; } }
.diff ins { color: var(--ok-ink); background: var(--ok-soft); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; padding: 0 3px; }
.diff .btn { margin-left: -8px; }

/* A status pill sits tight above its heading. */
.pill + .slide-h { margin-top: calc(var(--space-24) * -0.5); }

/* The studio */
.studio-body { display: grid; gap: var(--space-16); justify-items: start; }
.stages { list-style: none; padding: 0; display: grid; gap: 10px; font-size: 1rem; }
.st { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.st-done { color: var(--ink-2); }
.st-now { color: var(--ink); font-weight: 600; }
.st-mark { position: relative; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line); flex: none; }
.st-done .st-mark { box-shadow: none; color: var(--ok-ink); }
.st-done .st-mark svg { position: absolute; inset: 0; width: 16px; height: 16px; }
.st-now .st-mark { box-shadow: inset 0 0 0 1.5px var(--accent-mark); }
.st-now .st-mark::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent-mark); }
.elapsed { font-size: 0.875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.slow-note { font-size: 0.9375rem; color: var(--ink-2); max-width: 46ch; padding: 12px 14px; background: var(--panel); border-radius: 2px; }
.slow-note strong { color: var(--ink); font-weight: 600; }

/* Review */
.picker { border: 0; margin: 0; padding: 0; min-width: 0; width: 100%; }
.picks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-width: 420px; }
.picks:has(> :nth-child(5)) { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 480px; }
.pick { position: relative; cursor: pointer; display: grid; gap: 6px; }
.pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pick-pic { display: block; aspect-ratio: 4 / 5; overflow: hidden; background: #e3ddd3; border-radius: 2px; transition: box-shadow var(--dur) var(--ease); }
.pick-pic svg { width: 100%; height: 100%; display: block; }
.pick:has(:checked) .pick-pic { box-shadow: 0 0 0 2px var(--ground), 0 0 0 4px var(--ink); }
.pick:has(:focus-visible) .pick-pic { box-shadow: 0 0 0 2px var(--ground), 0 0 0 4px var(--focus); }
.pick-name { display: grid; font-weight: 600; font-size: 0.875rem; line-height: 1.25; color: var(--ink-2); }
.pick:has(:checked) .pick-name { color: var(--ink); }
.pick-state { font-weight: 500; font-size: 0.75rem; color: var(--muted); }
.pick.is-rejected svg { filter: grayscale(1); opacity: 0.4; }
.pick.is-approved .pick-state { color: var(--ok-ink); font-weight: 600; }
.pick.is-drift .pick-state { color: var(--block-ink); font-weight: 600; }
.v-actions { width: 100%; }
.v-status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9375rem; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.v-status svg { width: 16px; height: 16px; }
.v-ok { color: var(--ok-ink); }
.v-flag { color: var(--block-ink); margin-bottom: 4px; }
.mismatch { margin-bottom: 14px; max-width: 46ch; font-size: 0.9375rem; color: var(--ink-2); }
.changes { display: grid; gap: 8px; width: 100%; }
.changes label { font-size: 0.875rem; font-weight: 600; }
.changes textarea { min-height: 4.5em; font-size: 0.9375rem; }
.changes .hint { font-size: 0.8125rem; color: var(--block-ink); }
.all-out { display: grid; gap: 12px; justify-items: start; background: var(--panel); padding: 14px 16px; width: 100%; }

/* Approved */
#approved-body { display: grid; gap: var(--space-24); justify-items: start; }
.meta { font-size: 0.875rem; color: var(--muted); margin-top: calc(var(--space-24) * -0.5); }
.thesis { font-style: italic; font-size: var(--p-lg); line-height: var(--lh-l); }
.ap-set-h { font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.ap-thumbs { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
/* One fixed column, so a long name ("3/4 front") wraps under its picture instead of
   widening it; every picture stays the same size. */
.ap-thumbs li { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 4px; width: 64px; }
.ap-thumbs .pick-name { font-size: 0.75rem; line-height: 1.2; }
.undo {
  padding: 2px 0; min-height: 24px; border: 0; background: none; cursor: pointer;
  font: inherit; color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px;
}
.undo:hover { color: var(--accent-ink); }
.undo:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.next { display: grid; gap: 10px; justify-items: start; width: 100%; }
.next-note { font-size: 0.9375rem; color: var(--ink-2); max-width: 46ch; }
/* Everything approved so far, and the one download that takes it. */
.tray { display: grid; gap: 12px; justify-items: start; width: 100%; padding-top: var(--space-16); border-top: 1px solid var(--rule); }
.download { display: grid; gap: 10px; justify-items: start; width: 100%; }
.dl-note { font-size: 0.8125rem; line-height: 1.45; color: var(--muted); max-width: 44ch; }
.download .btn.is-saved { background: var(--ok-soft); color: var(--ok-ink); box-shadow: none; }
.dl-done { display: inline-flex; gap: 6px; font-size: 0.8125rem; font-weight: 600; color: var(--ok-ink); overflow-wrap: anywhere; }

/* ── Buttons. Only the main one is filled; the rest are outlined, so the two
   differ by more than hue (mint and sand look alike to red-green colour blindness). ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  border: 0; border-radius: var(--radius-full);
  background: var(--ground); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 600; line-height: 1.25; text-align: center;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:hover { background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-quiet { background: transparent; box-shadow: none; text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; padding-inline: 8px; }
.btn-quiet:hover { background: var(--panel-2); }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: 0.875rem; }
.btn-large { min-height: 52px; padding: 12px 36px; font-size: 1.0625rem; }
.btn svg { width: 16px; height: 16px; flex: none; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 3px 10px 3px 8px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 600;
  background: var(--panel-2); color: var(--ink-2);
}
.pill svg { width: 14px; height: 14px; flex: none; }
.pill-blocked { background: var(--block-soft); color: var(--block-ink); }
.pill-failed { background: var(--fail-soft); color: var(--fail-ink); }
.pill-ok { background: var(--ok-soft); color: var(--ok-ink); }

/* ── Back, where you are, the way forward ──
   Phones: a bar along the bottom of the panel (Back · step · Next), pinned while the
   slide scrolls. Wide screens: right under the slide, with the progress line below. */
.foot {
  margin-top: auto;
  position: sticky; bottom: 0; z-index: 2;
  margin-inline: calc(var(--gutter) * -1);
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "back mid end";
  align-items: center; gap: 8px;
  min-height: 64px; padding: 10px var(--gutter);
  border-top: 1px solid var(--rule);
  background: var(--ground);
}
.foot-back { grid-area: back; justify-self: start; padding-left: 6px; text-decoration: none; line-height: 1.15; text-align: left; }
.foot-back:hover { text-decoration: underline; }
.foot-mid { grid-area: mid; display: flex; flex-direction: column-reverse; align-items: center; min-width: 0; }
.progress { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.8125rem; }
.progress li { color: var(--muted); }
.progress a, .progress span { display: inline-block; }
.progress li span span { padding: 0; }
.progress a { color: var(--ink-2); text-decoration: none; }
.progress a:hover { color: var(--accent-ink); text-decoration: underline; }
.progress [aria-current] > span { color: var(--ink); font-weight: 600; }
.progress li:not([aria-current]) { display: none; }
.pg-count { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.foot-end { grid-area: end; justify-self: end; display: flex; align-items: center; gap: 12px; min-width: 0; }
.foot-hint { font-size: 0.8125rem; color: var(--muted); text-align: right; max-width: 16ch; line-height: 1.3; }
.foot .btn { padding-inline: 14px; }
@media (min-width: 900px) {
  .foot {
    margin: auto 0 0; position: sticky; bottom: 0;
    width: 100%; max-width: 520px;
    grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "back end" "mid mid";
    gap: var(--space-32) 16px; min-height: 0; padding: var(--space-24) 0 var(--space-48);
    border-top: 0; background: var(--ground);
  }
  /* Content scrolling under the footer fades out instead of being cut. */
  .foot::before {
    content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 24px;
    background: linear-gradient(transparent, var(--ground)); pointer-events: none;
  }
  .foot .btn { padding-inline: 20px; }
  .foot-back { padding-left: 4px; }
  .foot-mid { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; border-top: 1px solid var(--rule); }
  .progress li:not([aria-current]) { display: list-item; }
  .progress a, .progress span { padding: 2px 0; }
  .progress [aria-current] > span { box-shadow: inset 0 -2px var(--accent-ink); }
  /* The whole list is on show here, so "6 of 7" only repeats it and pushes the list to wrap. */
  .pg-count { display: none; }
  .foot-hint { max-width: none; }
}

/* ── Design notes drawer: inverted, so it never reads as part of the app ── */
.notes {
  margin: 0 0 0 auto; padding: 0; border: 0;
  height: 100%; max-height: none;
  width: min(420px, calc(100vw - 32px)); max-width: none;
  background: var(--demo-bg); color: var(--demo-ink);
  overflow-y: auto; overscroll-behavior: contain;
}
.notes::backdrop { background: rgba(9, 9, 11, 0.4); }
.notes :focus-visible { outline-color: var(--demo-ink); }
.notes-top {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px 14px 24px; background: var(--demo-bg);
}
.notes-h { font-weight: 600; font-size: 1.375rem; letter-spacing: -0.015em; }
.notes-close {
  width: 40px; height: 40px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--demo-hover); color: var(--demo-ink);
  display: grid; place-items: center;
}
.notes-close svg { width: 16px; height: 16px; }
.notes-sec { border: 0; margin: 0; padding: 18px 24px; min-width: 0; border-top: 1px solid var(--demo-hover); }
.notes-label { font-size: 0.8125rem; font-weight: 600; color: var(--demo-muted); padding: 0; margin-bottom: 8px; }
.dn-screen { font-weight: 600; font-size: 1.25rem; letter-spacing: -0.01em; line-height: 1.2; margin-bottom: 6px; }
.dn-text { font-size: 1rem; line-height: var(--lh-l); color: var(--demo-ink); }
.sr-echo { margin-top: 16px; }
.dn-echo { font-size: 0.9375rem; color: var(--demo-ink); }
.jumper ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.jumper a, .speed label {
  display: inline-flex; align-items: center; min-height: 40px;
  padding: 6px 12px; border-radius: 2px;
  background: var(--demo-hover); color: var(--demo-ink); text-decoration: none; font-weight: 500;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.jumper a:hover, .speed label:hover { background: var(--white-alpha-20); color: var(--demo-ink); }
.jumper a[aria-current], .speed label:has(:checked) { background: var(--demo-ink); color: var(--demo-bg); }
.speed { display: flex; flex-wrap: wrap; gap: 6px; }
.speed legend { float: left; width: 100%; }
.speed label { position: relative; cursor: pointer; }
.speed input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.speed label:has(:focus-visible) { outline: 2px solid var(--demo-ink); outline-offset: 2px; }
.about p { font-size: 0.875rem; color: var(--demo-ink); line-height: 1.5; }
.about-links { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.about a:hover { color: var(--demo-ink); }
.link-btn { border: 0; background: none; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

/* ── Motion: 400ms, small and quiet. The one longer move is the render coming down. ── */
@keyframes in-fwd { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes in-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes drawer { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes land { 0% { opacity: 0; transform: rotate(-9deg) scale(1.25); } 100% { opacity: 1; transform: rotate(-3deg) scale(1); } }
@keyframes breathe { 50% { transform: scale(0.5); opacity: 0.5; } }
@keyframes waiting { 50% { opacity: 0.35; } }
@keyframes sweep { from { opacity: 1; transform: translateX(-100%); } to { opacity: 1; transform: translateX(100%); } }
@keyframes deal {
  from { opacity: 0; transform: translate(var(--dx), -48px) rotate(var(--from)) scale(1.08); }
  to { opacity: 1; transform: none; }
}
@keyframes exhale { from { transform: scale(1.035); filter: brightness(1.06); } to { transform: none; filter: none; } }
@keyframes thud { 40% { transform: translateY(3px); } }
@keyframes draw { from { stroke-dashoffset: 1; } }
@keyframes swipe { from { background-size: 0% 100%; } }
@keyframes strike { from { background-size: 0% 1.5px, 100% 100%; } }

.slide.in-fwd { animation: in-fwd var(--dur) var(--ease) both; }
.slide.in-back { animation: in-back var(--dur) var(--ease) both; }
.art.enter { animation: fade var(--dur) var(--ease) both; }
.notes[open] { animation: drawer var(--dur) var(--ease); }
.stamp { animation: land 420ms cubic-bezier(0.3, 1.4, 0.5, 1) both 520ms; }
.stage-art[data-mode="generating"][data-stage="2"] .layer-render::after { animation: sweep 2.4s var(--ease) 0.4s both; }
.print { animation: deal var(--dur-long) var(--ease-settle) backwards; animation-delay: calc(300ms + var(--i) * 170ms); }
/* Approval: the picture lets out a breath, then takes the stamp's weight. */
.art.approving .layer { animation: exhale var(--dur-long) var(--ease) backwards, thud 260ms ease-out 900ms; }
.check-draw path { animation: draw 450ms var(--ease) backwards; }
/* The check circles what it found, as a reviewer would with a pen. */
.ring { animation: draw 700ms var(--ease) 450ms backwards; }
/* A print growing into the big picture (a view transition; skipped with reduced motion). */
::view-transition-group(print) { animation-duration: 1000ms; animation-timing-function: var(--ease); }
/* The rest of the page: the old slide clears quickly so the two never read on top of each other. */
::view-transition-old(root) { animation: vt-out 160ms ease-out both; }
::view-transition-new(root) { animation: vt-in 620ms var(--ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
.check-draw path + path { animation-delay: 150ms; }
.pill .check-draw path { animation-delay: 300ms; }
.pill .check-draw path + path { animation-delay: 450ms; }
.stamp .check-draw path { animation-delay: 900ms; }
.stamp .check-draw path + path { animation-delay: 1050ms; }
mark { animation: swipe 600ms var(--ease) 350ms backwards; }
.diff del { animation: strike 600ms var(--ease) 300ms backwards; }
.st-now .st-mark::after { animation: breathe 1.6s ease-in-out infinite; }
.stage-art[data-slow]::after { animation: waiting 1.6s ease-in-out infinite; }
.tile:not(:has(:checked)):hover { transform: translateY(-2px); }

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