/* Un-hack: identity layer over frontier-ds (ds/tokens.css + ds/components.css).
   Brief: leo-agents-v2/crew/design/briefs/unhack.md (v2 2026-11-23 on top of v1). Signature element: the
   date stamp (.datestamp) on the recovery timeline, recurring on home, the case plan, letters and errors.
   One section per page. Edit rules in place: do not stack "round" override blocks at the end (D21). */
:root {
  --ds-font-display: "Bricolage Grotesque Variable", "Public Sans Variable", system-ui, sans-serif;
  --ds-display-weight: 720;
  --ds-display-tracking: -0.03em;
  --ds-display-leading: 1.02;
  --ds-accent: #5B2C83;
  --ds-accent-hover: #47206A;
  --ds-accent-soft: #F1EAF7;
  --ds-accent-soft-fg: #47206A;
  --ds-highlight: #FFE7C2;
  --ds-bg: #F8F5F1;
  --ds-r-md: 10px;
  --ds-muted: #434B57;
}

/* ---------- Shell: one row at every width ---------- */
.shell__inner { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "brand nav"; column-gap: var(--ds-sp-4); }
.shell__nav { margin-inline: 0; }
.wordmark { font-size: 1.375rem; }
/* D6: "Beta" labels the brand; it has no border so it never reads as a button */
.wordmark__tag {
  position: relative; top: -0.45em; padding: 2px 6px; border-radius: var(--ds-r-sm);
  background: var(--ds-accent-soft); color: var(--ds-accent-soft-fg);
  font-family: var(--ds-font-mono); font-size: 0.6875rem; font-weight: 650; line-height: 1.2;
  letter-spacing: 0.06em; text-transform: uppercase;
}
@media (max-width: 719px) {
  .shell__nav { justify-content: flex-end; margin-inline: 0 calc(var(--ds-sp-2) * -1); }
  .shell__nav a { padding: 0 var(--ds-sp-2); }
}
@media (max-width: 479px) {
  .shell__inner { column-gap: var(--ds-sp-2); }
  /* .shell__nav a sets display:flex, so these need the same specificity */
  .shell__nav .nav__home, .nav__long { display: none; }
  .wordmark { font-size: 1.25rem; gap: 6px; }
  .shell__nav a { font-size: 0.9375rem; }
}

/* ---------- Honesty band: 44 px, one line on phones (D7; F5: the phone summary is a real 44 px box) ---------- */
.honesty__inner { padding-block: 10px; }
.honesty summary { min-height: 1.5rem; }
.honesty__short { color: var(--ds-fg-2); }
.honesty__tiny { display: none; color: var(--ds-fg-2); }
@media (max-width: 719px) { .honesty summary { font-size: var(--ds-fs-xs); line-height: 1.45; } }
/* Phones: the short line gives way to the one-line tiny version; the full text is one tap away
   ("What this means") and repeated in the footer on every page. */
@media (max-width: 599px) {
  .honesty__inner { padding-block: 0; }
  .honesty details { padding-left: var(--ds-sp-2); }
  .honesty summary { min-height: var(--ds-tap); gap: var(--ds-sp-2); font-size: 0.8125rem; line-height: 1.35; }
  .honesty__icon { display: none; }
  .honesty__short { display: none; }
  .honesty__tiny { display: inline; }
}

/* ---------- Footer ---------- */
.site-footer, .site-footer__meta, .site-footer__honesty { color: var(--ds-fg-2); }
.site-footer__inner.site-footer__cols { display: grid; gap: var(--ds-sp-6); grid-template-columns: none; }
.site-footer__col { display: grid; align-content: start; gap: var(--ds-sp-2); }
.site-footer__brand, .site-footer__h { font-size: var(--ds-fs-sm); line-height: 1.4; }
.site-footer__h { color: var(--ds-fg); font-weight: 650; }
.site-footer__col a { display: inline-flex; align-items: center; min-height: var(--ds-tap); }
.site-footer__col p:has(> a:only-child) { margin-block: calc(var(--ds-sp-2) * -1); }
@media (min-width: 960px) { .site-footer__inner.site-footer__cols { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--ds-sp-10); } }

/* ---------- Signature: the date stamp ---------- */
.datestamp {
  display: inline-flex; align-items: center; gap: 0.4em; padding: 3px var(--ds-sp-2);
  border: 1px solid var(--ds-border-strong); border-radius: var(--ds-r-sm);
  background: var(--ds-surface); color: var(--ds-fg-2); vertical-align: middle;
  font-family: var(--ds-font-mono); font-size: 0.875rem; font-weight: 650; line-height: 1.3;
  letter-spacing: 0.01em; text-transform: uppercase; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.datestamp--today { background: var(--ds-highlight); border-color: #D9A65A; color: #5A3500; }
.datestamp--overdue { background: var(--ds-danger-soft); border-color: var(--ds-danger); color: var(--ds-danger-fg); }
.datestamp--waiting { background: var(--ds-warning-soft); border-color: #D9B36A; color: var(--ds-warning-fg); border-style: dashed; }
.datestamp--done { background: var(--ds-success-soft); border-color: #8CC4A1; color: var(--ds-success-fg); }
/* Conditional chips: dashed means "not yet"; the ink and edge stay AA-strong */
.datestamp--locked, .datestamp--closed { border-style: dashed; border-color: #6B7380; color: var(--ds-fg-2); }

/* Timeline: never fade text (contrast); the circle shows the state */
.timeline__item--locked { opacity: 1; }
.timeline__item--locked::before { color: var(--ds-muted); background: var(--ds-bg); }
.timeline__item--closed::before { content: "\2013"; border-style: dashed; color: var(--ds-muted); }
.timeline__item--today::before { background: var(--ds-accent); border-color: var(--ds-accent); }
.timeline__item--waiting::before { background: var(--ds-warning-soft); }

/* Amber is reserved for time urgency (Do today / waiting); demo and status chips are purple or grey */
/* F6: amber is for time pressure only; the demo marker is the neutral lavender */
.badge--demo { background: var(--ds-accent-soft); color: var(--ds-accent-soft-fg); border: 1px dashed var(--ds-accent); }

/* ---------- Home ---------- */
/* Every page ends one section gap above the footer */
.page { padding-bottom: var(--ds-sp-8); }
@media (min-width: 960px) { .page { padding-bottom: var(--ds-sp-10); } }

/* ---------- Home ---------- */
.page--home { padding-top: var(--ds-sp-6); }
@media (min-width: 720px) { .page--home { padding-top: var(--ds-sp-12); } }
.home-status { margin-bottom: var(--ds-sp-6); }
/* D13: hero eyebrow and the sample's label start on the same line. From 900 px the copy below the
   eyebrow is centred against the sample (no dead cream under the trust line). */
.page--home .hero { padding-top: 0; }
/* F6: the four platforms keep one line on phones (a tighter track, no lead rule) */
@media (max-width: 479px) { .hero__platforms { font-size: 0.8125rem; letter-spacing: 0.04em; } .hero__platforms::before { display: none; } }
@media (min-width: 900px) {
  .page--home .grid--hero { align-items: stretch; }
  .page--home .hero { display: flex; flex-direction: column; }
  .page--home .hero > .eyebrow + * { margin-top: auto; }
  .page--home .hero > :last-child { margin-bottom: auto; }
}
.hero .display { max-width: 13ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--ds-sp-3); margin-top: var(--ds-sp-2); }
.hero__privacy { margin-top: 0; max-width: 46ch; }
@media (max-width: 599px) {
  .hero { gap: var(--ds-sp-4); }
  .hero .display { margin-top: 0; font-size: 2.375rem; }
  .hero__cta { display: grid; }
  .hero__cta .btn, .hero__demo .btn { width: 100%; }
}

.preview { display: grid; gap: var(--ds-sp-3); align-content: start; padding-top: 0; }
.preview__label {
  display: flex; align-items: center; gap: var(--ds-sp-2);
  font-size: var(--ds-fs-xs); font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ds-fg-2);
}
.preview__label::before { content: ""; flex: none; width: 1.25rem; height: 2px; border-radius: 1px; background: var(--ds-border-strong); }
.preview__caption { font-size: var(--ds-fs-sm); color: var(--ds-fg-2); max-width: 46ch; }
@media (max-width: 719px) { .preview { margin-top: var(--ds-sp-10); } }

.plan-sheet { box-shadow: var(--ds-shadow-lg); padding: 0; overflow: hidden; }
.plan-sheet > * + * { margin-top: 0; }
.plan-sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--ds-sp-3); padding: var(--ds-sp-5) var(--ds-sp-6); border-bottom: 1px solid var(--ds-border); background: var(--ds-accent-soft); }
.plan-sheet__kicker { display: flex; align-items: center; gap: var(--ds-sp-2); font-size: var(--ds-fs-xs); font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ds-accent-soft-fg); }
.plan-sheet__kicker .mark { width: 1.25rem; height: 1.25rem; color: var(--ds-accent); }
@media (max-width: 599px) { .plan-sheet__head { flex-direction: column; gap: var(--ds-sp-2); } .plan-sheet__head > .flag { order: -1; } }
.plan-sheet__handle { margin-top: 2px; font-family: var(--ds-font-display); font-weight: var(--ds-display-weight); letter-spacing: -0.02em; font-size: var(--ds-fs-lg); line-height: 1.2; overflow-wrap: anywhere; }
.plan-sheet__steps { padding: var(--ds-sp-5) var(--ds-sp-6) var(--ds-sp-2); }
.plan-sheet__steps .timeline__item { padding-bottom: var(--ds-sp-4); }
.plan-sheet__title { font-weight: 650; line-height: 1.3; }
.plan-sheet__meta { font-size: var(--ds-fs-sm); color: var(--ds-fg-2); }
.plan-sheet .timeline__body { margin-top: var(--ds-sp-1); }
.plan-sheet .timeline__body > * + * { margin-top: var(--ds-sp-1); }
/* D17: a wrapped log line keeps its dot on the first line */
.plan-sheet__log { display: flex; align-items: flex-start; gap: var(--ds-sp-2); padding: var(--ds-sp-3) var(--ds-sp-6); border-top: 1px solid var(--ds-border); background: var(--ds-surface-2); font-family: var(--ds-font-mono); font-size: var(--ds-fs-xs); color: var(--ds-fg-2); }
.chain-dot { width: 0.6rem; height: 0.6rem; margin-top: 0.4em; border-radius: 50%; background: var(--ds-success); flex: none; }
@media (max-width: 599px) {
  .plan-sheet__head, .plan-sheet__steps, .plan-sheet__log { padding-inline: var(--ds-sp-4); }
}

.home-get { margin-top: var(--ds-sp-12); }
.get-list li > div { display: grid; gap: var(--ds-sp-1); }
.get-list .muted { font-size: var(--ds-fs-sm); max-width: 40ch; }
.trust__list { list-style: none; display: grid; gap: var(--ds-sp-5); font-size: var(--ds-fs-sm); color: var(--ds-fg-2); }
.trust__list li { padding-left: var(--ds-sp-4); border-left: 3px solid var(--ds-accent); }
.trust__list strong { display: block; color: var(--ds-fg); font-size: var(--ds-fs-base); margin-bottom: 2px; }
@media (min-width: 720px) { .trust__list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ds-sp-8); } }

/* ---------- Page heads ---------- */
.page-head { display: grid; gap: var(--ds-sp-3); margin: var(--ds-sp-2) 0 var(--ds-sp-8); }
.page-head .h1 { font-size: clamp(2rem, 1.6rem + 1.6vw, 2.875rem); }
.section__lede { max-width: 65ch; margin-bottom: var(--ds-sp-6); color: var(--ds-fg-2); }

/* ---------- Start form ---------- */
.page--form { padding-top: var(--ds-sp-6); }
@media (min-width: 720px) { .page--form { padding-top: var(--ds-sp-10); } }
.page--form .page-head { margin-bottom: var(--ds-sp-6); }
.page--form .error-summary { margin-bottom: var(--ds-sp-6); }
.start-form { gap: var(--ds-sp-5); }
.start-form .card { display: grid; gap: var(--ds-sp-4); }
.start-form .card > * + * { margin-top: 0; }
.start-form .textarea { resize: none; }
.legend { display: grid; gap: 2px; font-family: var(--ds-font-display); font-weight: 680; letter-spacing: -0.015em; font-size: var(--ds-fs-xl); }
.legend__step { font-family: var(--ds-font-mono); font-size: var(--ds-fs-xs); font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ds-accent); }
.legend .legend__hint { font-family: var(--ds-font-body); letter-spacing: 0; margin-top: var(--ds-sp-1); }
.choice-list .choice { border-top: 1px solid var(--ds-border); padding-block: var(--ds-sp-3); }
.choice-list .choice:first-child { border-top: 0; padding-top: 0; }
.field__label-opt { color: var(--ds-fg-2); }
/* Card digits, currency and statement date: one row of one-line labels (hints sit under the inputs).
   Phones: digits + currency share a row, the date takes the next. */
.fields-card { display: grid; grid-template-columns: minmax(0, 1fr) 7rem; gap: var(--ds-sp-4); align-items: start; }
.fields-card > .field { min-width: 0; margin-top: 0; }
.fields-card > .field--wide { grid-column: 1 / -1; }
.fields-card .input { max-width: none; }
@media (min-width: 600px) {
  .fields-card { grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr) minmax(0, 1.3fr); gap: var(--ds-sp-5); }
  .fields-card > .field--wide { grid-column: auto; }
}
/* Amount and currency share one row at every width (currency is never an orphan box) */
.fields--money { grid-template-columns: minmax(0, 1fr) 6rem; align-items: end; }
.input--xs { max-width: 7rem; }
/* Selects: room for the chevron, and a long value ends in an ellipsis instead of clipping */
.select select { padding-right: 2.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Date: same face and chrome as the other inputs, with the app's own calendar glyph */
.input--date { max-width: 14rem; font-family: var(--ds-font-body); font-variant-numeric: tabular-nums; color-scheme: light; }
.input--date::-webkit-calendar-picker-indicator { cursor: pointer; width: 1.25rem; height: 1.25rem; padding: 2px; border-radius: var(--ds-r-sm); background: url("/static/calendar.svg") center / 1.1rem no-repeat; color: transparent; opacity: 1; }
.input--date::-webkit-calendar-picker-indicator:hover { background-color: var(--ds-accent-soft); }
.submit-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-sp-3) var(--ds-sp-5); }
.submit-bar__note { display: grid; flex: 1 1 18rem; }
.submit-bar__note > * { grid-area: 1 / 1; margin: 0; }
@media (max-width: 599px) {
  .submit-bar .btn { width: 100%; }
  .submit-bar__note { flex-basis: 100%; }
  .submit-bar .field__privacy { font-size: var(--ds-fs-xs); }
  .btn--sm { min-height: var(--ds-tap); }
  .fields--money { gap: var(--ds-sp-3); }
  .fields--money .input--xs { max-width: none; }
}
/* Busy state for "Build my recovery plan". The CSP forbids scripts, so this is CSS only: a
   pointer/touch press focuses the button without :focus-visible, and the label swaps until the next
   page loads. Rules that keep the click alive (anything that moves the button between mousedown and
   mouseup loses the click):
   - both labels share one grid cell, so the button never changes size;
   - the wait line shares one grid cell with the privacy line and only swaps visibility;
   - nothing here changes a box size (background and filter only).
   An empty required field never enters busy: the server answers with the error page instead.
   Keyboard focus keeps the normal label and focus ring. No opacity: text never fades. */
.submit-bar__btn { display: inline-grid; place-items: center; }
.submit-bar__idle, .submit-bar__busy { grid-area: 1 / 1; }
.submit-bar__busy { display: inline-flex; align-items: center; gap: var(--ds-sp-2); visibility: hidden; }
.submit-bar__wait { align-self: center; font-size: var(--ds-fs-sm); color: var(--ds-fg-2); visibility: hidden; }
.start-form:not(:has(:invalid)) .submit-bar__btn:focus:not(:focus-visible) .submit-bar__idle { visibility: hidden; }
.start-form:not(:has(:invalid)) .submit-bar__btn:focus:not(:focus-visible) .submit-bar__busy { visibility: visible; }
.start-form:not(:has(:invalid)) .submit-bar__btn:focus:not(:focus-visible) { cursor: progress; background: var(--ds-accent-hover); border-color: var(--ds-accent-hover); }
.start-form:not(:has(:invalid)):has(.submit-bar__btn:focus:not(:focus-visible)) .form__section { background: var(--ds-surface-2); filter: grayscale(1); }
.start-form:not(:has(:invalid)):has(.submit-bar__btn:focus:not(:focus-visible)) .submit-bar__wait { visibility: visible; }
.start-form:not(:has(:invalid)):has(.submit-bar__btn:focus:not(:focus-visible)) .field__privacy { visibility: hidden; }
.spinner { width: 1em; height: 1em; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; animation: unhack-spin 0.8s linear infinite; }
@keyframes unhack-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; border-color: #fff; } }

/* ---------- Case v2 (brief v2 sections 2-3) ----------
   One accent element on the page: the next-step card. Its "Report how this step went" is the
   page's one filled action: in a right column at >= 960 px, at the end of the card below that. */
/* F6: one vertical gap between every block below the plan list (plan tools, escalation, the cards) */
.page--case { --case-gap: var(--ds-sp-6); padding-top: var(--ds-sp-3); }
@media (min-width: 720px) { .page--case { --case-gap: var(--ds-sp-8); padding-top: var(--ds-sp-6); } }

/* Header (D8, F5): one column at every width: eyebrow + demo chip, title, the dates line ending in the
   state, then ONE slim progress line. Nothing else stands between the title and the plan. */
.case-head { display: grid; gap: var(--ds-sp-2); margin-bottom: var(--ds-sp-5); }
.case-head__main { display: grid; gap: var(--ds-sp-1); min-width: 0; }
.case-head__eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-sp-2) var(--ds-sp-3); }
.case-head__title { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); overflow-wrap: anywhere; }
.case-head__dates { font-size: var(--ds-fs-sm); color: var(--ds-fg-2); }
.case-head__state { color: var(--ds-fg); font-weight: 650; }
.case-head__side { min-width: 0; }
@media (max-width: 599px) { .case-head { gap: var(--ds-sp-1); margin-bottom: var(--ds-sp-3); } }
/* Phones: "Instagram case" keeps the demo chip on the eyebrow line */
@media (max-width: 479px) {
  .case-head__long { display: none; }
  .case-head__eyebrow { column-gap: var(--ds-sp-2); }
  .case-head__eyebrow .eyebrow::before { width: 0.75rem; }
}
/* A closed case: the outcome stamp stands where the meter was */
.case-head__closed .datestamp { padding: 6px var(--ds-sp-3); font-size: var(--ds-fs-sm); }
/* F2 meter: closed of open steps, a short bar, the locked ones after it, on one line. D5: the track reads
   as an empty meter on the paper (#6B7380 edge is 3:1), never a smudge */
.case-progress { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-sp-1) var(--ds-sp-3); font-size: var(--ds-fs-sm); color: var(--ds-fg-2); }
.case-progress > * { margin: 0; }
.case-progress__text strong { color: var(--ds-fg); font-weight: 700; white-space: nowrap; }
.case-progress__text .datestamp { margin-left: var(--ds-sp-2); vertical-align: 0.1em; }
.case-progress__bar {
  -webkit-appearance: none; appearance: none; display: block; flex: 0 1 10rem; width: 10rem; min-width: 3rem; height: 0.5rem; border: 0;
  border-radius: var(--ds-r-pill); background: #E3DCD2; box-shadow: inset 0 0 0 1px #6B7380; overflow: hidden;
}
.case-progress__bar::-webkit-progress-bar { background: #E3DCD2; box-shadow: inset 0 0 0 1px #6B7380; border-radius: var(--ds-r-pill); }
.case-progress__bar::-webkit-progress-value { background: var(--ds-success); border-radius: var(--ds-r-pill); }
.case-progress__bar::-moz-progress-bar { background: var(--ds-success); border-radius: var(--ds-r-pill); }
/* Phones: the bar takes what the line leaves (the all-closed line puts it on its own row) */
@media (max-width: 599px) {
  .case-progress__bar { flex: 1 1 3rem; width: auto; }
  .case-progress--all .case-progress__bar { flex-basis: 100%; }
}

/* Save note (F5): only while the case is fresh. One line that says the link matters and jumps to it in
   "Keep your case" (a copy button needs script, which the CSP forbids). */
.save-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--ds-sp-2); max-width: 44rem; margin-bottom: var(--ds-sp-6);
  padding: 0 var(--ds-sp-1) 0 var(--ds-sp-3); border-left: 3px solid var(--ds-accent); border-radius: 0 var(--ds-r-sm) var(--ds-r-sm) 0; background: var(--ds-accent-soft); font-size: var(--ds-fs-sm); line-height: 1.35; color: var(--ds-fg);
}
.save-note > svg { width: 1rem; height: 1rem; flex: none; color: var(--ds-accent); }
.save-note__text { flex: 1 1 0; min-width: 0; padding-block: var(--ds-sp-2); }
.save-note__go { display: inline-flex; color: var(--ds-accent-soft-fg); align-items: center; min-height: var(--ds-tap); padding-inline: var(--ds-sp-3); font-weight: 650; white-space: nowrap; }
@media (max-width: 599px) {
  .save-note { margin-bottom: var(--ds-sp-3); font-size: var(--ds-fs-xs); }
  .save-note__long { display: none; }
}

/* Plan head (F5): the h2 alone; the plan's tools sit under the list */
.plan-head { margin-bottom: var(--ds-sp-5); }
@media (max-width: 599px) { .plan-head { margin-bottom: var(--ds-sp-3); } }
.plan-calm { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-sp-2) var(--ds-sp-3); margin-bottom: var(--ds-sp-5); color: var(--ds-fg-2); }
/* F5/F6 plan tools: one full-width card under the list (the case-rest card padding): the case in one
   sentence, the calendar caption, the Google warning and the note on sources on the left; the whole-plan
   calendar file on the right from 720 px, under the text on phones */
.plan-tools { display: grid; gap: var(--ds-sp-4); margin-top: var(--case-gap); padding: var(--ds-sp-6); }
.plan-tools__text { display: grid; gap: var(--ds-sp-2); min-width: 0; }
.plan-tools__text > * { max-width: 65ch; margin: 0; }
.plan-tools__sum { font-weight: 650; color: var(--ds-fg); }
.plan-tools__overdue { color: var(--ds-danger-fg); }
.plan-tools__note, .plan-tools__foot { font-size: var(--ds-fs-sm); line-height: 1.45; color: var(--ds-fg-2); }
.plan-tools__google {
  display: flex; gap: var(--ds-sp-2); padding: var(--ds-sp-1) var(--ds-sp-3); border-left: 3px solid var(--ds-warning);
  font-size: var(--ds-fs-sm); line-height: 1.45; color: var(--ds-fg);
}
.plan-tools__google svg { width: 1rem; height: 1rem; flex: none; margin-top: 0.15em; color: var(--ds-warning-fg); }
.plan-cal__link svg { color: var(--ds-accent); }
@media (min-width: 720px) {
  .plan-tools { grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--ds-sp-8); align-items: start; padding: 1.75rem var(--ds-sp-8); }
}
@media (max-width: 599px) { .plan-cal__link { width: 100%; padding-inline: var(--ds-sp-3); font-size: var(--ds-fs-sm); } }

/* Rail: one track. Every step, the current one included, has its node on the spine; the line runs
   from step 1's node into the card (behind it on phones, beside it from 720 px) and on to step 2. */
.plan { gap: 0; }
.plan .timeline__item { padding-bottom: var(--ds-sp-6); }
.plan .timeline__item::before { grid-column: 1; grid-row: 1 / span 2; }
.plan .plan__current { row-gap: var(--ds-sp-2); }
.plan .plan__current::before { grid-row: 1; }

/* The next-step card */
.next-step__kicker { grid-column: 2; align-self: center; min-width: 0; font-size: var(--ds-fs-sm); font-weight: 650; line-height: 1.35; color: var(--ds-accent); }
.next-step__kicker .nowrap { white-space: nowrap; }
.timeline__item--overdue .next-step__kicker { color: var(--ds-danger-fg); }
.next-step {
  --pad-x: var(--ds-sp-6); --pad-b: var(--ds-sp-5);
  position: relative; z-index: 1; grid-column: 1 / -1; grid-row: 2; min-width: 0; padding: var(--ds-sp-5) var(--pad-x) var(--pad-b);
  border: 1px solid var(--ds-border); border-top: 4px solid var(--ds-accent); border-radius: var(--ds-r-lg);
  background: var(--ds-surface); box-shadow: var(--ds-shadow-lg);
}
@media (min-width: 720px) { .next-step { grid-column: 2; } }
.next-step__title {
  font-family: var(--ds-font-display); font-weight: var(--ds-display-weight); font-size: var(--ds-fs-xl);
  letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; overflow-wrap: anywhere;
}
.next-step > .step__when { margin-top: var(--ds-sp-3); }
.next-step > .status { margin-top: var(--ds-sp-3); }
.next-step__do { margin-top: var(--ds-sp-4); }
.next-step__do > * + * { margin-top: var(--ds-sp-3); }
.next-step__do .step__do { max-width: 60ch; }
.next-step__do .step__do li + li { margin-top: var(--ds-sp-2); }
/* The collapsed rest of the list (< 960 only); a 44 px summary that takes 24 px of the flow */
.next-step__more { display: none; }
.next-step__more[open] > .step__more-toggle::after { transform: rotate(-135deg) translateY(-2px); }
.next-step__more > .step__do { margin-top: var(--ds-sp-3); }
.next-step__source { margin-top: var(--ds-sp-4); }
.next-step__draft { margin-top: var(--ds-sp-4); }
.next-step__draft .btn { width: 100%; justify-content: flex-start; text-align: left; }
@media (min-width: 600px) and (max-width: 959px) { .next-step__draft .btn { width: auto; } }
.next-step__label { margin-top: var(--ds-sp-5); font-size: var(--ds-fs-sm); color: var(--ds-fg-2); }
.next-step .next-step__report { margin-top: var(--ds-sp-2); padding-top: 0; }
.next-step__report > .step-report__toggle {
  display: flex; width: 100%; min-height: 3rem; justify-content: space-between; padding: 0 var(--ds-sp-5);
  border: 1.5px solid var(--ds-accent); border-radius: var(--ds-r-md); background: var(--ds-accent); color: var(--ds-accent-fg);
  font-size: var(--ds-fs-base);
}
.next-step__report > .step-report__toggle:hover { background: var(--ds-accent-hover); border-color: var(--ds-accent-hover); }
.next-step__report > .step-report__toggle::after { content: none; }
.toggle__open { display: none; }
.next-step__report[open] > .step-report__toggle { justify-content: flex-start; gap: var(--ds-sp-2); background: var(--ds-surface); color: var(--ds-accent); }
.next-step__report[open] > .step-report__toggle:hover { background: var(--ds-accent-soft); color: var(--ds-accent); }
.next-step__report[open] .toggle__closed { display: none; }
.next-step__report[open] .toggle__open { display: inline-flex; align-items: center; gap: var(--ds-sp-2); }
.next-step__report[open] .toggle__open::before {
  content: ""; flex: none; width: 0.75rem; height: 0.75rem; transform: rotate(45deg);
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat, linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
}
.next-step__report .step-report__buttons, .next-step__report .step-report__note { max-width: none; }

@media (min-width: 960px) {
  .next-step {
    --pad-x: var(--ds-sp-8); --pad-b: var(--ds-sp-6);
    display: grid; padding-top: var(--ds-sp-6); column-gap: var(--ds-sp-8);
    grid-template-columns: minmax(0, 1fr) 17rem;
    grid-template-areas: "title title" "when when" "saved saved" "do label" "do report" "do draft" "do ." "src .";
    grid-template-rows: auto auto auto auto auto auto 1fr auto; align-items: start;
  }
  .next-step__title { grid-area: title; }
  .next-step > .step__when { grid-area: when; margin-bottom: var(--ds-sp-5); padding-bottom: var(--ds-sp-4); border-bottom: 1px solid var(--ds-border); }
  .next-step > .status { grid-area: saved; justify-self: start; margin: 0 0 var(--ds-sp-4); }
  .next-step__do { grid-area: do; margin-top: 0; }
  .next-step__label { grid-area: label; margin-top: 0; }
  .next-step__report { grid-area: report; }
  .next-step__draft { grid-area: draft; margin-top: var(--ds-sp-3); }
  /* F6: the source closes the actions column, so the side column is only label + report + draft and the
     card is as tall as its actions */
  .next-step__source { grid-area: src; margin-top: var(--ds-sp-4); }
  .next-step__report > .step-report__toggle { padding: 0 var(--ds-sp-4); font-size: var(--ds-fs-sm); }
  .next-step::after { content: ""; grid-column: 2; grid-row: 4 / 8; margin-left: calc(var(--ds-sp-4) * -1); border-left: 1px solid var(--ds-border); pointer-events: none; }
}
/* < 960: one column in natural order: the first two actions (the rest one tap away), the draft, then
   the report, inline and opening in place; the source closes the card. Step 1's report lands on the
   first 390 x 844 screen. */
@media (max-width: 959px) {
  .step__do-wide { display: none; }
  .next-step__more { display: block; }
  .next-step__do > .next-step__more { margin-top: var(--ds-sp-2); }
  .next-step__label { display: none; }
  .next-step .next-step__report { margin-top: var(--ds-sp-4); }
}
@media (max-width: 599px) {
  .next-step { --pad-x: var(--ds-sp-4); --pad-b: var(--ds-sp-4); padding-top: var(--ds-sp-4); }
  .next-step__title { font-size: var(--ds-fs-lg); }
  .next-step > .step__when { margin-top: var(--ds-sp-2); }
  .next-step__do { margin-top: var(--ds-sp-3); }
  .next-step__draft, .next-step .next-step__report { margin-top: var(--ds-sp-3); }
}

/* Every other step: title, stamp row (with the drafted-message chip), details on demand */
.step__card { grid-column: 2; grid-row: 1 / span 2; min-width: 0; }
.step__card > .timeline__body { grid-column: auto; margin-top: var(--ds-sp-2); }
.plan .timeline__title { padding-top: 0.15rem; font-family: var(--ds-font-display); font-weight: 680; font-size: var(--ds-fs-lg); letter-spacing: -0.015em; line-height: 1.2; }
.step__when { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-sp-2) var(--ds-sp-3); font-size: var(--ds-fs-sm); color: var(--ds-fg-2); }
.step__due strong { color: var(--ds-fg); }
.step__attempts::before { content: "\00b7"; margin-inline: 0 var(--ds-sp-2); color: var(--ds-fg-2); }
.step__only { max-width: 60ch; padding: var(--ds-sp-2) var(--ds-sp-3); border-radius: var(--ds-r-sm); background: var(--ds-accent-soft); color: var(--ds-accent-soft-fg); font-size: var(--ds-fs-sm); }
.step__do { max-width: 60ch; padding-left: 1.25em; font-size: var(--ds-fs-base); }
.step__do li::marker { color: var(--ds-muted); font-weight: 600; }
.step__source { max-width: 60ch; font-size: var(--ds-fs-sm); color: var(--ds-fg-2); overflow-wrap: anywhere; }
.step__source a { color: var(--ds-fg-2); }
.step__checked { white-space: nowrap; }
/* F4: one quiet line per step; the warning-edged note only once a page is past the stale line */
.step__provenance > * { margin: 0; }
.step__provenance > * + * { margin-top: var(--ds-sp-2); }
.source-note { max-width: 60ch; padding: var(--ds-sp-1) var(--ds-sp-3); border-left: 3px solid var(--ds-warning); font-size: var(--ds-fs-sm); line-height: 1.45; color: var(--ds-fg); }
/* F1/F6: a dated step's own calendar file is a quiet 44 px row right after the step's actions (icon +
   underlined words over a hairline), in the next-step card and inside every other step's details: never a
   second button beside the report */
.step__cal { max-width: 60ch; border-top: 1px solid var(--ds-border); }
.next-step__do > .step__cal { margin-top: var(--ds-sp-4); }
.step__ics { display: flex; align-items: center; gap: var(--ds-sp-2); min-height: var(--ds-tap); padding-inline: var(--ds-sp-1); color: var(--ds-accent); font-size: var(--ds-fs-sm); font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; }
.step__ics svg { width: 1rem; height: 1rem; flex: none; }
.step__ics:hover { background: var(--ds-accent-soft); color: var(--ds-accent-hover); }
.step__draft svg { color: var(--ds-accent); }
/* D15: drafted messages are visible on the collapsed steps. 28 px chip, 44 px hit area. */
.step__draft--chip { position: relative; gap: var(--ds-sp-1); text-decoration: none; }
.step__draft--chip svg { width: 1rem; height: 1rem; flex: none; }
.step__draft--chip::after { content: ""; position: absolute; inset: -8px -4px; }
.step__draft--chip:hover { border-color: var(--ds-accent); color: var(--ds-accent-soft-fg); text-decoration: underline; }
@media (max-width: 599px) {
  .step__draft--chip { min-height: var(--ds-tap); padding-inline: var(--ds-sp-3); border-radius: var(--ds-r-sm); }
  .step__draft--chip::after { content: none; }
}
/* D16: the saved status is one inline line, never a slab, never an ISO date */
.status--inline { display: inline-flex; align-items: center; gap: var(--ds-sp-2); padding: var(--ds-sp-1) var(--ds-sp-3); border-radius: var(--ds-r-sm); font-size: var(--ds-fs-sm); }
.status--inline svg { width: 1rem; height: 1rem; flex: none; }

.step__more-toggle { display: inline-flex; align-items: center; gap: var(--ds-sp-2); min-height: var(--ds-tap); cursor: pointer; list-style: none; color: var(--ds-accent); font-weight: 650; font-size: var(--ds-fs-sm); }
.step__more-toggle::-webkit-details-marker { display: none; }
.step__more-toggle::after { content: ""; width: 0.45em; height: 0.45em; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
.step__more[open] > .step__more-toggle::after { transform: rotate(-135deg) translateY(-2px); }
/* F6: the disclosures read as tap rows: a bordered 44 px row with the chevron at its end */
.step__more > .step__more-toggle, .next-step__more > .step__more-toggle {
  display: flex; width: 100%; max-width: 26rem; padding-inline: var(--ds-sp-3); border: 1px solid var(--ds-border); border-radius: var(--ds-r-sm); background: var(--ds-surface);
}
.step__more > .step__more-toggle::after, .next-step__more > .step__more-toggle::after { margin-left: auto; }
.step__more > .step__more-toggle:hover, .next-step__more > .step__more-toggle:hover { border-color: var(--ds-accent); }
.step__more-count { color: var(--ds-fg-2); font-weight: 500; }
.step__more-body { padding-top: var(--ds-sp-1); }
.step__more-body > * + * { margin-top: var(--ds-sp-3); }

/* "Tell Un-hack what happened" on the other steps: an outlined button inside the details */
.step-report { padding-top: var(--ds-sp-2); }
.step-report__toggle {
  display: inline-flex; align-items: center; gap: var(--ds-sp-2); min-height: var(--ds-tap); padding: 0 var(--ds-sp-4);
  border: 1px solid var(--ds-accent); border-radius: var(--ds-r-md); background: var(--ds-surface); color: var(--ds-accent);
  font-weight: 650; font-size: var(--ds-fs-sm); cursor: pointer; list-style: none;
}
.step-report__toggle:hover { background: var(--ds-accent-soft); }
.step-report__toggle::-webkit-details-marker { display: none; }
.step-report__toggle::after { content: ""; width: 0.45em; height: 0.45em; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
.step-report[open] > .step-report__toggle::after { transform: rotate(-135deg) translateY(-2px); }
.step-report__form { padding-top: var(--ds-sp-3); }
.step-report__form legend { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Outcome answers: one stacked column of equal-height buttons at every width */
.step-report__buttons { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ds-sp-2); max-width: 26rem; }
.step-report__buttons .btn { width: 100%; min-height: var(--ds-tap); justify-content: flex-start; text-align: left; white-space: normal; }
.step-report__ok { border-color: var(--ds-success); color: var(--ds-success-fg); }
.step-report__ok:hover { background: var(--ds-success-soft); border-color: var(--ds-success); color: var(--ds-success-fg); }
.step-report__note { margin-top: var(--ds-sp-3); max-width: 26rem; }

@media (max-width: 599px) {
  .step__when { row-gap: var(--ds-sp-2); }
  .step-report__toggle { width: 100%; justify-content: space-between; }
}

.case-escalate { max-width: 48rem; margin-top: var(--case-gap); }
.callout__list { padding-left: 1.2em; }
.callout__list li + li { margin-top: var(--ds-sp-1); }

/* Below the plan: money, evidence and "Keep your case" full width, then log | outcome + delete. The log box
   is sized to its entries (up to 22rem, then it scrolls). */
.case-rest { display: grid; gap: var(--case-gap); margin-top: var(--case-gap); }
.case-rest > *, .case-rest__end > * { margin-top: 0; }
.case-rest__end { display: grid; gap: var(--case-gap); align-content: start; }
.case-rest .card { padding: var(--ds-sp-6); }
.case-rest .card .small { max-width: 65ch; }
.case-block { scroll-margin-top: var(--ds-sp-6); }
.card__headrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ds-sp-2) var(--ds-sp-4); }
@media (min-width: 720px) { .case-rest .card { padding: 1.75rem var(--ds-sp-8); } }
@media (min-width: 960px) {
  .case-rest { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .case-rest > .money, .case-rest > #evidence, .case-rest > .keep { grid-column: 1 / -1; }
}

/* F3 "Keep your case" (F5: the one place the case link is shown): the link with how to keep it, and the
   whole-case bundle. Full width; two columns from 720 px. */
.keep { display: grid; gap: var(--ds-sp-4); }
.keep > * { margin: 0; }
.keep__title { display: flex; align-items: center; gap: var(--ds-sp-2); }
.keep__title .mark { width: 1.25rem; height: 1.25rem; flex: none; color: var(--ds-accent); }
.keep__link, .keep__bundle { display: grid; gap: var(--ds-sp-2); align-content: start; min-width: 0; }
.keep__link > *, .keep__bundle > * { margin: 0; }
@media (min-width: 720px) {
  .keep { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--ds-sp-8); }
  .keep__title { grid-column: 1 / -1; }
}
/* A real link styled as a field: one press-and-hold (or right-click) gives the browser's own copy menu,
   and user-select: all makes any selection take the whole address */
.keep__url {
  display: flex; align-items: center; gap: var(--ds-sp-2); min-width: 0; min-height: var(--ds-tap); padding: var(--ds-sp-2) var(--ds-sp-3);
  border: 1px solid var(--ds-border-strong); border-radius: var(--ds-r-sm); background: var(--ds-surface); color: var(--ds-fg);
  font-family: var(--ds-font-mono); font-size: 0.875rem; line-height: 1.45; font-variant-ligatures: none; text-decoration: none;
  overflow-wrap: anywhere; -webkit-user-select: all; user-select: all;
}
.keep__url span { min-width: 0; }
.keep__url svg { width: 1rem; height: 1rem; flex: none; color: var(--ds-accent); }
.keep__url:hover { border-color: var(--ds-accent); color: var(--ds-fg); }
.keep__hint { font-size: var(--ds-fs-xs); line-height: 1.4; color: var(--ds-fg-2); }
.keep__zip { width: 100%; min-height: 3rem; padding-inline: var(--ds-sp-4); border-color: var(--ds-accent); }
@media (max-width: 479px) { .keep__zip { font-size: var(--ds-fs-sm); } }
.keep__zip:hover { border-color: var(--ds-accent); background: var(--ds-accent-soft); color: var(--ds-accent-soft-fg); }
.keep__zip svg { color: var(--ds-accent); }

.money { display: grid; gap: var(--ds-sp-5) var(--ds-sp-8); }
.money > * + * { margin-top: 0; }
.money__text > * + * { margin-top: var(--ds-sp-2); }
.money__text p { max-width: 65ch; }
@media (min-width: 600px) { .money { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }

/* Evidence vault (D11, D12, D20) */
.vault__intro { color: var(--ds-fg-2); }
.vault { table-layout: fixed; }
.vault__c-time { width: 8.5rem; }
.vault__c-hash { width: 13rem; }
.vault__c-act { width: 5.5rem; }
.vault__file { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
@media (max-width: 599px) { .vault__file { line-height: var(--ds-tap); } }
.vault__type { display: block; font-size: var(--ds-fs-sm); color: var(--ds-fg-2); }
.vault__note { display: block; font-size: var(--ds-fs-xs); color: var(--ds-fg-2); }
/* JetBrains Mono at 14 px sits optically level with Public Sans at 15 px */
.vault__time { font-family: var(--ds-font-mono); font-size: 0.875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vault__time span { display: block; }
/* The fingerprint is the evidence: all 64 characters, never cut */
.vault__hash { display: block; font-size: 0.875rem; line-height: 1.45; color: var(--ds-fg-2); word-break: break-all; }
.vault__del summary { display: inline-flex; align-items: center; min-height: var(--ds-tap); cursor: pointer; color: var(--ds-danger-fg); font-weight: 600; font-size: var(--ds-fs-sm); }
.vault__del form { margin-top: var(--ds-sp-2); }
@media (max-width: 599px) {
  .vault { table-layout: auto; }
  .vault__time span { display: inline; }
}
@media (min-width: 960px) {
  .vault__c-time { width: 10rem; }
  .vault__c-hash { width: 19rem; }
  .vault__time span { display: inline; }
  .vault__hash { max-width: 32ch; }
}

.vault-form { display: grid; gap: var(--ds-sp-4); }
.vault-form__row { display: grid; gap: var(--ds-sp-4); }
.vault-form__submit { width: 100%; }
@media (min-width: 720px) {
  .vault-form__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; }
  .vault-form__submit { width: auto; }
}
/* Dropzone: the native input covers the whole zone invisibly (click, drop and keyboard all work, the
   ring comes from :focus-within). With no files yet it is the vault's designed empty state. */
.vault-form .dropzone { position: relative; row-gap: var(--ds-sp-2); padding: var(--ds-sp-6) var(--ds-sp-4); }
.vault-form .dropzone__icon { width: 2rem; height: 2rem; }
.dropzone__icon--mark { display: block; color: var(--ds-accent); }
.dropzone__icon--mark .mark { display: block; width: 100%; height: 100%; }
.vault-form .dropzone__input { position: absolute; inset: 0; width: 100%; max-width: none; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.vault-form .dropzone__title-sub { font-weight: 500; color: var(--ds-fg-2); }
.vault-form .dropzone__hint { color: var(--ds-fg-2); }
.dropzone__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--ds-sp-2); }
.dropzone__chips .badge { background: var(--ds-surface); }
.vault-form .dropzone__cta {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--ds-control-h); margin-top: var(--ds-sp-2); padding: 0 var(--ds-sp-5);
  border: 1.5px solid var(--ds-accent); border-radius: var(--ds-r-md); background: var(--ds-surface); color: var(--ds-accent);
  font-weight: 650; font-size: var(--ds-fs-base); line-height: 1.2;
}
.vault-form .dropzone:hover .dropzone__cta { background: var(--ds-accent); color: var(--ds-accent-fg); }
.vault-form .dropzone__picked { display: none; align-items: center; gap: var(--ds-sp-2); margin-top: var(--ds-sp-1); font-size: var(--ds-fs-sm); font-weight: 650; color: var(--ds-success-fg); }
.vault-form .dropzone__picked svg { width: 1.25rem; height: 1.25rem; flex: none; color: var(--ds-success); }
.vault-form:has(.dropzone__input:valid) .dropzone { border-style: solid; border-color: var(--ds-success); background: var(--ds-success-soft); }
.vault-form:has(.dropzone__input:valid) .dropzone__picked { display: inline-flex; }
.vault-form:has(.dropzone__input:valid) .dropzone__cta { background: var(--ds-surface); }
@media (min-width: 720px) {
  .vault-form .dropzone { grid-template-columns: auto minmax(0, 1fr) auto; justify-items: start; align-items: center; text-align: left; column-gap: var(--ds-sp-5); row-gap: var(--ds-sp-1); padding: var(--ds-sp-5) var(--ds-sp-6); }
  .vault-form .dropzone__icon { grid-column: 1; grid-row: 1 / span 2; width: 2.5rem; height: 2.5rem; padding: var(--ds-sp-2); box-sizing: content-box; border-radius: var(--ds-r-md); background: var(--ds-accent-soft); }
  .vault-form .dropzone__title { grid-column: 2; grid-row: 1; align-self: end; }
  .vault-form .dropzone__hint { grid-column: 2; grid-row: 2; align-self: start; max-width: none; }
  .dropzone__chips { grid-column: 2; grid-row: 3; justify-content: flex-start; margin-top: var(--ds-sp-2); }
  .vault-form .dropzone__cta { grid-column: 3; grid-row: 1 / span 2; margin-top: 0; }
  .vault-form .dropzone__picked { grid-column: 2 / span 2; grid-row: 4; margin-top: var(--ds-sp-2); }
}

/* The scroll box is a focusable, labelled region so keyboard users can scroll it too */
.log-wrap { max-height: 22rem; overflow-y: auto; border: 1px solid var(--ds-border); border-radius: var(--ds-r-md); background: var(--ds-surface-2); }
.log-wrap:focus-visible { outline: 3px solid var(--ds-accent); outline-offset: 2px; }
.log { list-style: none; display: grid; font-size: var(--ds-fs-sm); }
.log li { display: grid; gap: 2px var(--ds-sp-4); padding: var(--ds-sp-2) var(--ds-sp-4); border-bottom: 1px solid var(--ds-border); }
.log li:last-child { border-bottom: 0; }
.log__at { font-family: var(--ds-font-mono); font-size: var(--ds-fs-xs); color: var(--ds-fg-2); white-space: nowrap; }
.log__detail { overflow-wrap: anywhere; }
@media (min-width: 720px) { .log li { grid-template-columns: 12.5rem 1fr; } }

.outcome__ok { border-color: var(--ds-success); color: var(--ds-success-fg); }
.outcome__ok:hover { background: var(--ds-success-soft); border-color: var(--ds-success); color: var(--ds-success-fg); }
.outcome__closed { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-sp-3) var(--ds-sp-4); }
.outcome__closed .datestamp { padding: 6px var(--ds-sp-3); font-size: var(--ds-fs-sm); }
.danger-zone { border-color: #F2C4BF; }
.danger-zone__form { display: grid; gap: var(--ds-sp-3); justify-items: start; }

/* ---------- Drafts and letters ---------- */
.page--doc { padding-top: var(--ds-sp-4); }
.page--doc .page-head { margin-top: var(--ds-sp-4); }
.page--doc .error-summary { margin-bottom: var(--ds-sp-6); }
/* D14: one block of text that wraps as a paragraph, never a ragged flex pair */
.demo-flag { display: block; width: fit-content; max-width: 100%; margin-top: var(--ds-sp-3); padding: var(--ds-sp-2) var(--ds-sp-3); border-radius: var(--ds-r-md); line-height: 1.45; }
.doc-layout { display: grid; gap: var(--ds-sp-6); }
@media (min-width: 900px) { .doc-layout { grid-template-columns: minmax(0, 1fr) 20rem; gap: var(--ds-sp-10); align-items: start; } }
.doc-aside .callout { grid-template-columns: auto 1fr; }
.steps--compact { gap: var(--ds-sp-3); font-size: var(--ds-fs-sm); }
.steps--compact li { grid-template-columns: 1.5rem 1fr; gap: var(--ds-sp-2); }
.steps--compact li::before { width: 1.5rem; height: 1.5rem; font-size: var(--ds-fs-xs); }
.card--inset > .h4 + .steps { margin-top: var(--ds-sp-3); }
.letter-result { margin-bottom: var(--ds-sp-6); }
.cb-form { display: grid; gap: 0; }
.cb-form__card { display: grid; gap: var(--ds-sp-5); }
.cb-form__card > * + * { margin-top: 0; }
@media (min-width: 720px) { .cb-form__card { padding: var(--ds-sp-6); } }
.cb-form__actions { margin-top: var(--ds-sp-5); }
@media (max-width: 599px) { .cb-form__actions .btn { width: 100%; } }
/* Drafts: the text box is the page's main object; copying is the user's own select-all + copy */
.copy-hint { max-width: 70ch; font-size: var(--ds-fs-sm); line-height: 1.45; color: var(--ds-fg-2); }
.how--mouse { display: none; }
@media (hover: hover) and (min-width: 600px) { .how--touch { display: none; } .how--mouse { display: inline; } }
.doc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-sp-3); }
.doc-actions__go svg { width: 1rem; height: 1rem; flex: none; }
@media (max-width: 599px) { .doc-actions .btn { width: 100%; } }
.doc-aside { display: grid; gap: var(--ds-sp-3); padding: var(--ds-sp-5); border-radius: var(--ds-r-lg); background: var(--ds-surface-2); font-size: var(--ds-fs-sm); line-height: 1.5; color: var(--ds-fg-2); }
.doc-aside strong { color: var(--ds-fg); }
.doc-aside .doc-aside__warn { color: var(--ds-warning-fg); }
.doc-aside__steps { display: grid; gap: var(--ds-sp-2); padding-left: 1.25em; }
.doc-editor > * + *, .letter-result form > * + * { margin-top: var(--ds-sp-4); }
.doc-editor .textarea--draft, .letter-result .textarea--draft { border: 1.5px solid var(--ds-border-strong); background: var(--ds-surface); box-shadow: inset 0 1px 2px rgba(27, 31, 39, 0.06); }
/* Drafts read as letters, not code */
.textarea--draft { max-width: 70ch; font-family: var(--ds-font-body); font-size: 1rem; line-height: 1.6; }
/* D10: citations line up in a mono column, the text keeps a readable measure */
.rule-list { list-style: none; display: grid; gap: var(--ds-sp-3); font-size: var(--ds-fs-base); color: var(--ds-fg-2); }
.rule-list li { max-width: 65ch; }
.rule-list a { font-weight: 650; overflow-wrap: anywhere; }
.rule-list a.mono { white-space: nowrap; overflow-wrap: normal; }
@media (min-width: 720px) {
  .rule-list li { display: grid; grid-template-columns: 12rem minmax(0, 65ch); gap: var(--ds-sp-4); max-width: none; }
}

/* ---------- About ---------- */
.page--about .page-head { max-width: var(--ds-measure); }
.page--about .section__head { justify-content: flex-start; }
/* Sources are the page; the four fact cards sit below them in one band */
.about-grid { grid-template-columns: minmax(0, 1fr); gap: var(--ds-sp-12); }
@media (min-width: 720px) { .about-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-sp-5); align-items: start; } .about-aside > * { margin-top: 0; } }
/* D9: sources grouped by platform, the retrieved date once per group */
.source-groups { display: grid; gap: var(--ds-sp-6); }
.source-group__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--ds-sp-1) var(--ds-sp-4); padding-bottom: var(--ds-sp-2); border-bottom: 2px solid var(--ds-accent); }
.source-group__title { font-family: var(--ds-font-display); font-weight: 680; letter-spacing: -0.015em; font-size: var(--ds-fs-lg); }
.source-group__date { font-size: var(--ds-fs-sm); color: var(--ds-fg-2); }
.source-group > .source-note { margin-top: var(--ds-sp-3); }
.source-list { list-style: none; display: grid; }
.source-row { display: grid; gap: var(--ds-sp-1) var(--ds-sp-6); padding-block: var(--ds-sp-3); border-bottom: 1px solid var(--ds-border); }
.source-row a { font-weight: 600; }
/* Phones: every source link is a 44 px row of its own */
@media (max-width: 599px) { .source-row { padding-block: var(--ds-sp-1); } .source-row > a { padding-block: 10px; } }
.source-row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-sp-2) var(--ds-sp-3); font-size: var(--ds-fs-sm); color: var(--ds-fg-2); }
@media (min-width: 720px) { .source-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } .source-row__meta { justify-content: flex-end; } }
/* F6: how a page was read is plain meta text, not a pill */
.source-row__method { white-space: nowrap; }
.sources__ref { margin-left: 2px; font-size: 0.75rem; color: var(--ds-fg-2); }
.footnotes { max-width: 65ch; margin-top: var(--ds-sp-4); padding-left: 1.4em; font-size: var(--ds-fs-sm); color: var(--ds-fg-2); }
.footnotes li + li { margin-top: var(--ds-sp-1); }
.rule-card > * + * { margin-top: var(--ds-sp-3); }
.checklist { list-style: none; display: grid; gap: var(--ds-sp-3); font-size: var(--ds-fs-sm); }
.checklist li { position: relative; padding-left: var(--ds-sp-8); }
.checklist--never li::before, .checklist--never li::after { content: ""; position: absolute; left: 0.3rem; top: 0.65em; width: 1rem; height: 2.5px; border-radius: 2px; background: var(--ds-accent); transform: rotate(45deg); }
.checklist--never li::after { transform: rotate(-45deg); }
.limits { padding-left: 1.1em; color: var(--ds-fg-2); }
.limits li + li { margin-top: var(--ds-sp-2); }
.data-kv { grid-template-columns: 1fr; gap: var(--ds-sp-3); }
.data-kv > div { display: grid; gap: 2px; }
.data-kv dd { color: var(--ds-fg-2); }
#data { scroll-margin-top: var(--ds-sp-6); }

/* ---------- Errors (404 / 409 / 413 / 429 / 500) ---------- */
/* A capped, centred column; red stays for validation errors, the mark is the illustration */
.error-page { min-height: 50vh; align-content: center; margin-inline: auto; }
.error-page__mark { width: 3.5rem; height: 3.5rem; padding: var(--ds-sp-3); box-sizing: content-box; border-radius: var(--ds-r-xl); background: var(--ds-accent-soft); color: var(--ds-accent); }
.error-page__mark .mark { width: 100%; height: 100%; }
.error-page__code { font-size: var(--ds-fs-sm); color: var(--ds-fg-2); }
.error-page__detail { font-size: var(--ds-fs-base); max-width: var(--ds-measure-lead); }
.error-page__body.error-page__detail { font-size: var(--ds-fs-md); color: var(--ds-fg-2); }
.error-page__trail { margin-top: var(--ds-sp-2); max-width: 36rem; }
.error-page__trail .timeline__item { padding-bottom: var(--ds-sp-4); }
.error-page__trail .timeline__body { margin-top: var(--ds-sp-1); color: var(--ds-fg-2); }

@media print {
  .preview, .save-note, .keep__hint, .step-report, .vault-form, .danger-zone, .submit-bar { display: none; }
  .next-step { box-shadow: none; }
  .step__do-wide { display: list-item; }
  .next-step__more { display: none; }
}
