/* AV - Start safe (concept 10-safety). One promise, then its proofs, on paper with no card chrome.
   Each item is its text, then its instrument. The first item (--lead) is the promise: a full-width row with
   a larger title and the hand over rows, held closer to the head than to the proofs. The proofs follow as
   a ledger, each under a 1px hairline: one column under 768px; from 768px every item is a row on a three
   column subgrid (text in the first third, instrument across two); from 1024px the proofs sit three across,
   each a two-row subgrid so their instruments share a top line and a height.
   Two instruments are night windows (the Simulated call and Watch live), two are paper wells (the record
   and the hand over rows, which size to their content).
   The head ends with the Trust Centre button (the theme's tertiary button) and the optional evidence chips.
   Every instrument is aria-hidden; the item text carries the meaning. With labels on (labels.show_labels,
   off by default) each also carries the kit's neutral "Illustration" tag, and the Watch live window its
   Example call tag and a status bar with the fictional note; with them off nothing is left in their place.
   The default markup is the final frame. module.js adds .is-armed (the first frame) and .is-playing.
   Tokens come from va-kit.css; everything here is scoped under .va.va-safety. */
.va.va-safety { --saf-inst-h: 176px; }
.va.va-safety .va-saf__head { margin-bottom: clamp(48px, 5vw, 72px); }
/* The Trust Centre button, then the evidence chips (signed-off documents; none by default). */
.va.va-safety .va-saf__proof { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 28px; }
.va.va-safety .va-saf__docs { display: flex; flex-wrap: wrap; gap: 8px; }
.va.va-safety .va-saf__doc {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 4px 10px; border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.3; color: var(--ink-2);
  background: var(--paper-card); box-shadow: inset 0 0 0 1px var(--line);
}
.va.va-safety .va-saf__doc .va-i { flex: none; width: 14px; height: 14px; color: var(--forest); }

/* ---------- The promise and its proofs ---------- */
.va.va-safety .va-saf__grid { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 40px; }
.va.va-safety .va-saf__card { display: grid; row-gap: 20px; align-items: center; min-width: 0; }
.va.va-safety .va-saf__card:not(.va-saf__card--lead) { border-top: 1px solid var(--line); padding-top: 24px; }
.va.va-safety .va-saf__card--lead { row-gap: 24px; margin-bottom: 16px; }
.va.va-safety .va-saf__card--lead .va-saf__text { gap: 12px; }
/* From 768px every item is a row: text in the first third, the instrument across the other two. */
@media (min-width: 768px) {
  .va.va-safety .va-saf__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--col-gap); }
  .va.va-safety .va-saf__card { grid-column: 1 / -1; grid-template-columns: subgrid; }
  .va.va-safety .va-saf__card > .va-saf__inst { grid-column: 2 / -1; }
  .va.va-safety .va-saf__card--lead { margin-bottom: calc(clamp(56px, 6vw, 88px) - 40px); }
}
/* From 1024px the proofs sit three across, each a two-row subgrid (text, then instrument). A proof left
   alone in its row (2 or 5 cards) keeps the full-width row above. With 5 or 6 cards the second proof row
   gets the stacked 40px, as the grid's row gap is 0 here. */
@media (min-width: 1024px) {
  .va.va-safety .va-saf__grid { row-gap: 0; }
  .va.va-safety .va-saf__card--lead { margin-bottom: clamp(56px, 6vw, 88px); }
  .va.va-safety .va-saf__card:not(.va-saf__card--lead, :nth-child(3n+2):last-child) { grid-column: auto; grid-row: span 2; grid-template-columns: none; grid-template-rows: subgrid; align-items: stretch; }
  .va.va-safety .va-saf__card:not(.va-saf__card--lead, :nth-child(3n+2):last-child) > .va-saf__inst { grid-column: auto; }
  .va.va-safety .va-saf__card:nth-child(n+5) { margin-top: 40px; }
}
.va.va-safety .va-saf__inst { position: relative; min-height: var(--saf-inst-h); border-radius: var(--r-lg); overflow: hidden; isolation: isolate; container: va-saf-inst / inline-size; }
.va.va-safety .va-saf__text { display: grid; gap: 8px; align-content: start; }
/* Proof titles wrap in the narrow text third from 768 to 1023px: balance them so no word is left alone. */
.va.va-safety .va-saf__text .va-item { text-wrap: balance; }
.va.va-safety .va-saf__text .va-body { max-width: 44ch; }

/* Tags (Simulated call, and with labels on Illustration and Example call): the kit's neutral tag, sized to sit in a 34px window bar. */
.va.va-safety .va-tag { height: 22px; padding: 0 9px; }
.va.va-safety .va-saf__inst--well > .va-saf__illus { position: absolute; z-index: 3; top: 12px; right: 12px; background: color-mix(in srgb, var(--paper-sunk) 88%, transparent); }

/* ---------- Night windows (Simulated call and Watch live) ---------- */
.va.va-safety .va-saf__inst--night { display: flex; flex-direction: column; background: var(--night-800); }
.va.va-safety .va-saf__win { --patient: var(--pink); --now: var(--citron); flex: 1; display: flex; flex-direction: column; border-radius: var(--r-md); border: 0; }
.va.va-safety .va-saf__bar { flex: none; gap: 10px; }
.va.va-safety .va-saf__bar .va-saf__illus { margin-left: auto; }
/* The small orbs speak in paper, so citron is left to the word being said in Watch live. The Simulated
   call's speech crests are paper (the agent) and pink (the patient), as in the demo (module.js). */
.va.va-safety .va-saf__orb { --orb: 14px; --now: var(--paper); }
.va.va-safety .va-saf__eye { display: inline-grid; place-items: center; width: 16px; height: 16px; color: var(--ink-2); }
.va.va-safety .va-saf__eye .va-i { width: 16px; height: 16px; }
/* Labels off: the eye is the last thing in the Watch live bar and sits at its far end, opposite the orb. */
.va.va-safety .va-saf__bar > .va-saf__eye:last-child { margin-left: auto; }
/* "Bad line" only shows while the line is breaking up, as a tag in the patient's pink. */
.va.va-safety .va-saf__sig {
  position: absolute; z-index: 1; left: 12px; top: 12px;
  color: var(--pink); background: var(--night-800);
  border: 1px solid color-mix(in srgb, var(--pink) 45%, transparent);
  opacity: 0; transform: translateX(-4px); transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.va.va-safety .va-saf__card.is-noisy .va-saf__sig { opacity: 1; transform: none; }

.va.va-safety .va-saf__strip { position: relative; flex: 1; min-height: 120px; }
/* Soft ends, so the line runs in from off-window rather than stopping at a hard edge. */
.va.va-safety .va-saf__canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}

/* Watch any call live: one line, streamed word by word, the current word in citron. */
.va.va-safety .va-saf__live { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 14px 18px 12px; }
/* Labels off, so no status bar under it: the line and its voiceprint sit together, centred in the window
   (as the pass-to-team line and the sheet stack are in theirs), with even padding above and below. */
.va.va-safety .va-saf__live:last-child { justify-content: center; padding-block: 18px; }
.va.va-safety .va-saf__live:last-child .va-saf__vp { margin-top: 0; }
/* Voiceprint: one segment per word, width by word length. Heard words turn signal, the current word is paper. */
.va.va-safety .va-saf__vp { display: flex; gap: 3px; height: 4px; margin-top: auto; }
.va.va-safety .va-saf__vp > i { flex: var(--saf-g, 1) 1 0; min-width: 2px; border-radius: 2px; background: var(--signal); opacity: 0.85; transition: background-color 120ms var(--ease-out), opacity 120ms var(--ease-out); }
.va.va-safety .va-saf__card.is-armed .va-saf__vp > i,
.va.va-safety .va-saf__card.is-streaming .va-saf__vp > i:not(.is-on) { background: var(--paper); opacity: 0.14; }
.va.va-safety .va-saf__card.is-streaming .va-saf__vp > i.is-now { background: var(--paper); opacity: 1; }
/* The speaker label runs in before the line, so four lines still fit at 390px. */
.va.va-safety .va-saf__said-row { font-family: var(--font-body); font-size: 16px; line-height: 1.42; color: var(--ink); max-width: 50ch; text-wrap: pretty; }
.va.va-safety .va-saf__who { display: inline-block; margin-right: 6px; font-family: var(--font-mono); font-weight: 400; font-size: var(--fs-tag); line-height: 1; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); vertical-align: 0.12em; }
.va.va-safety .va-saf__said .w { transition: opacity 140ms var(--ease-out), color 80ms var(--ease-out); }
.va.va-safety .va-saf__card.is-armed .va-saf__said .w,
.va.va-safety .va-saf__card.is-streaming .va-saf__said .w:not(.is-on) { opacity: 0; }
.va.va-safety .va-saf__said .w.is-now { color: var(--now); transition-duration: 60ms, 60ms; }
/* The window's status bar carries the fictional note, so it stays in any crop that shows the hospital's name. */
.va.va-safety .va-saf__foot {
  display: flex; flex: none; align-items: center; min-height: 30px; padding: 5px 18px;
  border-top: 1px solid var(--line-night); line-height: 1.35; color: var(--ink-3);
}

/* ---------- Paper wells (Hand over and On record): paper-sunk with a faint dot grid and a hairline edge ---------- */
.va.va-safety .va-saf__inst--well {
  box-shadow: inset 0 0 0 1px var(--line);
  background-color: var(--paper-sunk);
  background-image: radial-gradient(circle, color-mix(in srgb, var(--ink) 9%, transparent) 0.9px, transparent 1.3px);
  background-size: 14px 14px; background-position: 7px 7px;
}

/* Hand over, over time. A legend, then the plot: one row per call type (name, then track), the time axis
   under them and the time cursor over them. The plot is a subgrid of the hand's two columns, so the legend,
   the tracks, the axis and the cursor share the last column (the only one under 480px). Each track: the
   ghost (an outlined person mark at Go live), then the span, from the ghost's centre (Go live) to the
   right edge, which places by percent of its width (--at, the call type's handover_at): the bar (coral to
   --at, forest after it), the D (its flat edge on --at, a gap either side, so it stands as a milestone,
   not a knob) and the carrier (--at wide, the filled person mark centred on its right edge). The default
   is the final frame: bars whole, Ds facing right, person marks and cursor gone. Before it plays
   (.is-armed) the bars are clipped away and each carrier is shifted back its own width, so the person
   mark sits on its ghost. A picture, not a control (the well is inert): no knob, no hover, no cursor
   change. */
.va.va-safety .va-saf__card--lead .va-saf__inst { min-height: 0; }
.va.va-safety .va-saf__hand {
  --mk: 24px; --bar: 6px;
  /* Plain tokens where color-mix is missing (Safari before 16.2), so the bars and swatches still paint;
     the mixes below replace them everywhere else. */
  --saf-p: var(--coral);
  --saf-a: var(--forest);
  display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; column-gap: clamp(16px, 2.4vw, 32px); row-gap: 18px;
  padding: clamp(20px, 2.6vw, 32px) clamp(20px, 3vw, 40px);
}
/* Coral half way to coral-ink (about 3.3:1 on the well) and forest eased toward the well, so the two
   bars also differ in lightness, not only in hue. */
@supports (color: color-mix(in srgb, red, blue)) {
  .va.va-safety .va-saf__hand {
    --saf-p: color-mix(in srgb, var(--coral) 50%, var(--coral-ink));
    --saf-a: color-mix(in srgb, var(--forest) 72%, var(--paper-sunk));
  }
}
/* Labels on: the Illustration tag sits top right, so the legend starts below it. */
.va.va-safety .va-saf__illus + .va-saf__hand { padding-top: 52px; }
.va.va-safety .va-saf__legend {
  grid-column: -2 / -1; display: flex; flex-wrap: wrap; gap: 6px 24px;
  font-family: var(--font-mono); font-size: 12px; line-height: 16px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}
.va.va-safety .va-saf__key { display: inline-flex; align-items: center; gap: 8px; }
.va.va-safety .va-saf__sw { display: block; flex: none; height: var(--bar); border-radius: calc(var(--bar) / 2); }
.va.va-safety .va-saf__sw--p { width: 20px; background: var(--saf-p); }
.va.va-safety .va-saf__sw--d { width: 6px; height: 12px; border-radius: 0 6px 6px 0; background: var(--forest); }
.va.va-safety .va-saf__sw--a { width: 16px; margin-left: -5px; background: var(--saf-a); }
.va.va-safety .va-saf__plot { position: relative; grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; row-gap: 14px; }
.va.va-safety .va-saf__type { display: contents; }
.va.va-safety .va-saf__type-name { font-weight: 700; font-size: 16px; line-height: 1.2; color: var(--ink); }
.va.va-safety .va-saf__track { position: relative; display: block; height: var(--mk); }
.va.va-safety :is(.va-saf__track, .va-saf__span, .va-saf__hbar, .va-saf__car) > i { position: absolute; }
.va.va-safety .va-saf__span { left: calc(var(--mk) / 2); right: 0; top: 0; bottom: 0; }
.va.va-safety .va-saf__hbar { left: 0; right: 0; top: calc(50% - var(--bar) / 2); height: var(--bar); }
.va.va-safety .va-saf__seg { top: 0; height: 100%; border-radius: calc(var(--bar) / 2); }
.va.va-safety .va-saf__seg--p { left: 0; width: calc(var(--at) * 1% - 4px); background: var(--saf-p); }
.va.va-safety .va-saf__seg--a { left: calc(var(--at) * 1% + var(--mk) / 2 + 4px); right: 0; background: var(--saf-a); }
/* Ghost and person mark share a shape: the mark filled coral, the ghost outlined in it (on the well's own
   colour, so the bar starts under it). */
.va.va-safety :is(.va-saf__ghost, .va-saf__mark) { top: 0; display: grid; place-items: center; width: var(--mk); height: var(--mk); border-radius: 50%; }
.va.va-safety :is(.va-saf__ghost, .va-saf__mark) .va-i { width: 14px; height: 14px; }
.va.va-safety .va-saf__ghost { z-index: 1; left: 0; background: var(--paper-sunk); box-shadow: inset 0 0 0 1.5px var(--person); color: var(--person); }
/* The D: a forest half-disc whose flat edge sits on the handover point. */
.va.va-safety .va-saf__d { z-index: 2; left: calc(var(--at) * 1%); top: 0; width: calc(var(--mk) / 2); height: var(--mk); border-radius: 0 var(--mk) var(--mk) 0; background: var(--forest); transform-origin: 0 50%; }
.va.va-safety .va-saf__car { z-index: 3; left: 0; top: 0; bottom: 0; width: calc(var(--at) * 1%); }
.va.va-safety .va-saf__mark { right: calc(var(--mk) / -2); background: var(--person); color: var(--paper); opacity: 0; transform: scale(0.6); }
/* The time axis: a hairline from Go live with faint ticks every tenth, Go live a firmer tick, then the
   two quiet labels under its ends. No numbers: it claims an order, not a duration. */
.va.va-safety .va-saf__axis {
  grid-column: -2 / -1; position: relative; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 14px;
  font-family: var(--font-mono); font-size: 12px; line-height: 16px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
}
.va.va-safety .va-saf__ticks {
  position: absolute; left: calc(var(--mk) / 2); right: 0; top: 0; height: 6px;
  border-top: 1px solid color-mix(in srgb, var(--ink) 32%, transparent);
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--ink) 20%, transparent) 0 1px, transparent 1px 10%);
}
.va.va-safety .va-saf__ticks::before { content: ""; position: absolute; left: 0; top: -5px; width: 1.5px; height: 11px; background: var(--ink-3); }
.va.va-safety .va-saf__axis-lab--end { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.va.va-safety .va-saf__axis-lab--end .va-i { width: 12px; height: 12px; }
/* The time cursor: a thin line over the bars, only while it plays (module.js). It spans the plot's last
   column from the first row down to the axis ticks, and is moved by its own width, which is the span's. */
.va.va-safety .va-saf__cursor { position: absolute; z-index: 2; grid-column: -2 / -1; left: calc(var(--mk) / 2); right: 0; top: -6px; bottom: 24px; opacity: 0; pointer-events: none; }
.va.va-safety .va-saf__cursor::before { content: ""; position: absolute; left: -0.75px; top: 0; bottom: 0; width: 1.5px; background: color-mix(in srgb, var(--ink) 55%, transparent); }

/* Every call on record: three offset sheets, the top one the demo's handover call as a transcript. The
   stack is in flow (the sheets share one grid cell, so the top sheet's lines set its height), centred in
   the well and capped at a paper-like width. */
.va.va-safety .va-saf__card[data-inst="record"] > .va-saf__inst { display: grid; align-content: center; }
.va.va-safety .va-saf__stack { display: grid; width: min(100%, 440px); margin-inline: auto; padding: 30px 20px 22px 26px; }
.va.va-safety .va-saf__illus + .va-saf__stack { padding-top: 50px; }
.va.va-safety .va-saf__sheet {
  --tx: 0px; --ty: 0px; --rot: 0deg;
  grid-area: 1 / 1; border-radius: var(--r-sm); background: var(--paper-card);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-sm);
  transform: translate(var(--tx), var(--ty)) rotate(var(--rot));
}
.va.va-safety .va-saf__sheet:nth-child(1) { --tx: -14px; --ty: -16px; --rot: -2.5deg; }
.va.va-safety .va-saf__sheet:nth-child(2) { --tx: -7px; --ty: -8px; --rot: -1.2deg; }
/* Speaker styling from the demo: a run-in mono label (as in Watch live), the patient in italic and their
   pink, darkened for paper (about 5.5:1 on the sheet), the agent in ink. */
.va.va-safety .va-saf__sheet--top {
  --saf-patient: color-mix(in srgb, var(--pink-ink) 70%, var(--night-900));
  display: grid; align-content: start; gap: 10px; padding: 14px 16px 16px; color: var(--ink-2);
}
.va.va-safety .va-saf__sheet-head { display: flex; align-items: center; gap: 8px; min-height: 18px; }
.va.va-safety .va-saf__sheet-head .va-i { width: 16px; height: 16px; color: var(--forest); flex: none; }
.va.va-safety .va-saf__sheet-head .va-saf__sk { margin-left: auto; }
.va.va-safety .va-saf__ln { display: block; font-size: 13.5px; line-height: 1.42; color: var(--ink); text-wrap: pretty; }
.va.va-safety .va-saf__ln .va-saf__who { color: var(--ink-3); }
.va.va-safety .va-saf__ln[data-speaker="patient"] .va-saf__who { color: var(--saf-patient); }
.va.va-safety .va-saf__ln[data-speaker="patient"] .va-saf__say { font-style: italic; color: var(--saf-patient); }
.va.va-safety .va-saf__sk { display: block; flex: none; width: var(--w, 50%); height: 7px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 14%, transparent); transform-origin: left center; }
/* The redaction chip at a legible size: 12px mono, its icon to match. */
.va.va-safety .va-saf__sheet .va-redact { margin: 0; padding: 0 7px; font-size: 12px; line-height: 18px; color: var(--ink-2); }
.va.va-safety .va-saf__sheet .va-redact .va-i { width: 12px; height: 12px; color: currentColor; }

/* ---------- Armed: the first frame, before an instrument plays ---------- */
.va.va-safety .va-saf__card.is-armed .va-saf__hbar { clip-path: inset(0 100% 0 0); }
.va.va-safety .va-saf__card.is-armed .va-saf__car { transform: translateX(-100%); }
.va.va-safety .va-saf__card.is-armed .va-saf__mark { opacity: 1; transform: none; }
.va.va-safety .va-saf__card.is-armed .va-saf__d { opacity: 0; transform: rotate(var(--d-rot)); }
.va.va-safety .va-saf__card.is-armed .va-saf__sheet { opacity: 0; transform: translate(var(--tx), calc(var(--ty) - 14px)) rotate(var(--rot)); }
.va.va-safety .va-saf__card.is-armed .va-saf__sk { transform: scaleX(0); }
.va.va-safety .va-saf__card.is-armed :is(.va-saf__chip-r, .va-saf__ln) { opacity: 0; }

/* ---------- Playing: one pass, under 4s, ending on the default (final) frame ---------- */
/* Hand over: the cursor sweeps the axis at a steady pace (time is linear), the bars clipped to it, so
   each grows with it. Each row's person mark rides its bar's head (its carrier moves at the same pace,
   for --at percent of the sweep), then at the handover point lets go as the D swings round to face
   right, and the bar runs on in forest. FAQs (32) switch first, Appointments (68) later; the cursor
   fades once it reaches the end. About 2.8s in all, whatever the rows. */
.va.va-safety .va-saf__hand { --saf-t0: 200ms; --saf-sweep: 2200ms; --d-rot: 128deg; }
.va.va-safety .va-saf__type { --saf-at: calc(var(--saf-t0) + var(--saf-sweep) * var(--at) / 100 - 60ms); }
.va.va-safety .va-saf__card.is-playing .va-saf__hbar { animation: va-saf-reach var(--saf-sweep) linear var(--saf-t0) both; }
.va.va-safety .va-saf__card.is-playing .va-saf__cursor { animation: va-saf-sweep var(--saf-sweep) linear var(--saf-t0) both, va-saf-cursor calc(var(--saf-sweep) + 400ms) linear var(--saf-t0) both; }
.va.va-safety .va-saf__card.is-playing .va-saf__car { animation: va-saf-carry calc(var(--saf-sweep) * var(--at) / 100) linear var(--saf-t0) both; }
.va.va-safety .va-saf__card.is-playing .va-saf__mark { animation: va-saf-let-go 240ms var(--ease-out) var(--saf-at) both; }
.va.va-safety .va-saf__card.is-playing .va-saf__d { animation: va-saf-d 360ms var(--ease-out) var(--saf-at) both; }
.va.va-safety .va-saf__card.is-playing .va-saf__sheet { animation: va-saf-file 260ms var(--ease-out) both; animation-delay: calc(var(--k) * 150ms); }
.va.va-safety .va-saf__card.is-playing .va-saf__sk { animation: va-saf-print 220ms var(--ease-out) both; animation-delay: calc(560ms + var(--j) * 90ms); }
.va.va-safety .va-saf__card.is-playing .va-saf__chip-r { animation: va-saf-chip 220ms var(--ease-out) both; animation-delay: calc(560ms + var(--j) * 90ms); }
.va.va-safety .va-saf__card.is-playing .va-saf__ln { animation: va-saf-line 320ms var(--ease-out) both; animation-delay: calc(560ms + var(--j) * 180ms); }

@keyframes va-saf-reach { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes va-saf-sweep { from { transform: none; } to { transform: translateX(100%); } }
@keyframes va-saf-carry { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes va-saf-cursor { 0% { opacity: 0; } 6% { opacity: 1; } 84% { opacity: 1; } 100% { opacity: 0; } }
@keyframes va-saf-let-go { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(0.6); } }
@keyframes va-saf-d { from { opacity: 0; transform: rotate(var(--d-rot)); } to { opacity: 1; transform: none; } }
@keyframes va-saf-line { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes va-saf-file {
  from { opacity: 0; transform: translate(var(--tx), calc(var(--ty) - 14px)) rotate(var(--rot)); }
  to { opacity: 1; transform: translate(var(--tx), var(--ty)) rotate(var(--rot)); }
}
@keyframes va-saf-print { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes va-saf-chip { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }

/* Narrow instruments, 480px or less: phones; the rows at the very start of 768 to 1023px (477px wide at
   768, past 480 by about 772); and the proofs three across at every width from 1024px (312 wide at 1024,
   451 at 1440). The line drops a size so it stays four lines at most. */
@container va-saf-inst (max-width: 480px) {
  .va.va-safety .va-saf__said-row { font-size: 15px; }
  .va.va-safety .va-saf__live { gap: 12px; padding: 12px 14px 12px; }
  .va.va-safety .va-saf__live:last-child { padding-block: 14px; }
  .va.va-safety .va-saf__foot { padding-inline: 14px; }
  .va.va-safety .va-saf__stack { padding-inline: 22px 16px; }
  .va.va-safety .va-saf__ln { font-size: 13px; }
  .va.va-safety .va-saf__hand { grid-template-columns: minmax(0, 1fr); row-gap: 14px; }
  .va.va-safety .va-saf__plot { row-gap: 8px; }
  .va.va-safety .va-saf__type-name { margin-top: 8px; font-size: 15px; }
  /* One column puts each call type's name between the tracks, where a cursor down the whole plot would
     cross it. Here each track carries its own short stretch of the cursor instead (on its span, so it
     starts at Go live), swept in step with the bars. */
  .va.va-safety .va-saf__cursor { display: none; }
  .va.va-safety .va-saf__card.is-playing .va-saf__span::after {
    content: ""; position: absolute; z-index: 2; left: -0.75px; right: 0.75px; top: -4px; bottom: -4px; pointer-events: none;
    background: linear-gradient(color-mix(in srgb, var(--ink) 55%, transparent) 0 0) 0 0 / 1.5px 100% no-repeat;
    animation: va-saf-sweep var(--saf-sweep) linear var(--saf-t0) both, va-saf-cursor calc(var(--saf-sweep) + 400ms) linear var(--saf-t0) both;
  }
}

/* ---------- Reduced motion: the final frame, whatever state the script left ---------- */
@media (prefers-reduced-motion: reduce) {
  .va.va-safety .va-saf__card .va-saf__sk,
  .va.va-safety .va-saf__card .va-saf__chip-r,
  .va.va-safety .va-saf__card .va-saf__ln,
  .va.va-safety .va-saf__card .va-saf__said .w { opacity: 1 !important; animation: none !important; }
  .va.va-safety .va-saf__card :is(.va-saf__sk, .va-saf__ln) { transform: none !important; }
  .va.va-safety .va-saf__card :is(.va-saf__hbar, .va-saf__car, .va-saf__d) { animation: none !important; clip-path: none !important; opacity: 1 !important; transform: none !important; }
  .va.va-safety .va-saf__card :is(.va-saf__mark, .va-saf__cursor),
  .va.va-safety .va-saf__card .va-saf__span::after { animation: none !important; opacity: 0 !important; }
  .va.va-safety .va-saf__card .va-saf__sheet { opacity: 1 !important; animation: none !important; transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) !important; }
  .va.va-safety .va-saf__card .va-saf__vp > i { background: var(--signal) !important; opacity: 0.85 !important; }
}

/* ---------- Forced colours: keep the paths, the marks, the chips and the sheets visible ---------- */
@media (forced-colors: active) {
  .va.va-safety .va-saf__inst { border: 1px solid CanvasText; }
  .va.va-safety .va-saf__vp > i { forced-color-adjust: none; background: CanvasText; }
  /* The person's time outlined, the agent's solid, so the two still differ without colour. */
  .va.va-safety :is(.va-saf__seg--a, .va-saf__sw--a, .va-saf__sw--d, .va-saf__d) { forced-color-adjust: none; background: CanvasText; }
  .va.va-safety :is(.va-saf__seg--p, .va-saf__sw--p) { forced-color-adjust: none; background: Canvas; border: 1px solid CanvasText; }
  .va.va-safety .va-saf__ticks { forced-color-adjust: none; border-top-color: CanvasText; }
  .va.va-safety .va-saf__sheet, .va.va-safety .va-saf__mark, .va.va-safety .va-saf__ghost, .va.va-safety .va-saf__doc { border: 1px solid CanvasText; }
}
