/* The card clips what it holds to its round corners without scrolling, so its foot can stand sticky (holdFoot); it
   is as wide as its column, never as wide as a stage it holds. */
.walkthrough {
  min-width: 0;
  overflow: clip;
  margin-bottom: 32px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--raise);
  outline: 1px solid transparent;
  font-size: var(--text-sm);
}
/* A lesson diagram takes the arrow keys when it has focus; its ring replaces the card's unseen outline. */
.walkthrough:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Every stepped figure has a head. A played figure's head holds its title alone, at the size of the figure's other
   words, and the figure stands under it; a line, stopping short of the card's sides, stands under the title only
   where the first thing under it is bare text (a time axis, column names). */
.tw-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 16px 20px; }
:is(.flow, .lesson-diagram) .tw-head { position: relative; min-height: 0; padding: 18px 20px 2px; }
:is(.flow, .lesson-diagram) .tw-head h2 { font: 600 var(--text-body) / 1.3 var(--sans); }
:is(.flow, .lesson-diagram) .tw-head.is-ruled { padding-bottom: 16px; }
:is(.flow, .lesson-diagram) .tw-head.is-ruled::after {
  content: ""; position: absolute; bottom: 0; left: 20px; right: 20px; border-bottom: 1px solid var(--line);
}
/* A figure whose title stands outside its card, as a section's heading over it. */
.figure-block { display: grid; gap: 12px; }
.figure-block > .walkthrough { margin-top: 0; }
.has-outside-title > .flow-metrics,
.has-outside-title > .scroll-frame > :is(.flow-viewport, .lesson-diagram-scroll) { padding-top: 20px; }
.flow .tw-head + .tw-stages { border-top: 0; }
.tw-head h2 { margin: 0; font: 600 var(--text-lg) / 1.3 var(--sans); }
.tw-head > span { flex-shrink: 0; font-size: var(--text-xs); color: var(--faint); }
.tw-stages { display: grid; grid-template-columns: repeat(var(--tw-count, 4), minmax(0, 1fr)); border-block: 1px solid var(--line); }
.tw-stages button {
  min-height: 52px; padding: 12px 16px; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--muted); text-align: left; font: 400 var(--text-sm) / 1.35 var(--sans);
}
.tw-stages button span { margin-right: 10px; color: var(--faint); }
.tw-stages button:hover { background: var(--hover); }
.tw-stages button[aria-selected="true"] { color: var(--accent-ink); background: var(--accent-pale); border-bottom-color: var(--accent); }
.tw-stages button[aria-selected="true"] span { color: inherit; }
/* A pane shows all its stage puts in it, so it is no stop for the keyboard and fades no edge: "Receive a call"'s
   model response needs 367px (R8-04). The title's room gives the 7px, so every stage keeps the first's 495px. */
.tw-scene-heading { display: flex; align-items: center; min-height: 60px; padding: 12px 20px; }
.tw-scene-heading h3 { margin: 0; font: 400 var(--text-body) / 1.45 var(--sans); color: var(--ink); }
.tw-scene-heading strong, .tw-note strong { font-weight: 600; color: var(--ink); }
.tw-panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: 372px; border-block: 1px solid var(--line); }
.tw-pane { min-width: 0; min-height: 0; overflow: auto; padding: 16px 20px; }
.tw-pane + .tw-pane { border-left: 1px solid var(--line); }
.tw-pane h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font: 600 var(--text-sm) / 1.4 var(--sans); color: var(--ink); }
.tw-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--actor-runtime); }
.tw-dot-model { background: var(--actor-model); }
.tw-dot-you { background: var(--actor-you); }
.tw-dot-tool { background: var(--actor-tool); }
.walkthrough pre { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; overflow-wrap: anywhere; }
.walkthrough pre code { display: block; white-space: normal; font: 400 var(--text-xs) / 1.65 var(--mono); color: var(--ink); }
.walkthrough .tw-python code { font-size: var(--text-sm); }
.tw-code-line { display: block; padding-left: var(--hang-at); white-space: pre-wrap; }
.tw-focus-line {
  margin-inline: -8px; padding-inline: calc(8px + var(--hang-at)) 8px;
  border-radius: var(--radius-sm); background: var(--accent-pale);
}
.walkthrough .tw-match { padding: 1px 2px; border-radius: 2px; background: var(--accent-pale); color: var(--accent-ink); font: inherit; font-weight: 600; }
.tw-binding { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.tw-binding code { font: 600 var(--text-sm) / 1.55 var(--mono); color: var(--accent-ink); }
.tw-binding svg { flex-shrink: 0; color: var(--wire); }
.tw-binding span { width: 100%; font-size: var(--text-xs); color: var(--faint); }
.tw-waiting { margin: 20px 0 0; font-size: var(--text-sm); color: var(--muted); }
.tw-waiting strong { margin-left: 6px; color: var(--ink); font: 600 var(--text-sm) / 1.4 var(--mono); }
.tw-file { padding: 12px 0; }
.tw-file pre code { font-size: var(--text-sm); font-family: var(--mono); }
.tw-read { margin-top: 24px; font-size: var(--text-xs); color: var(--faint); }
.tw-note { min-height: 63px; margin: 0; padding: 12px 20px; color: var(--muted); font-size: var(--text-sm); line-height: 1.45; }
.tw-controls { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
/* Every figure's controls are one bar: 12px over and under, 20px at the sides, buttons 40px high. */
.tw-controls .button { gap: 8px; min-height: 40px; padding: 7px 12px; font-size: var(--text-sm); }
.walkthrough button:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
/* A button filled with the accent, as Play is, takes its ring outside it, as the Run trace's Play does: inside, the
   ring would be drawn in the button's own fill and show nothing (R8-01, safety and tools). */
.walkthrough .button.primary:focus-visible { outline-offset: 2px; }
/* A flow figure: parts, the lanes between them and the things that travel the lanes, on a stage of fixed size.
   A narrow page scrolls the stage sideways rather than shrinking it. */
.flow { margin-top: 16px; }
.flow-viewport { overflow-x: auto; padding: 24px 20px; }
/* A stage that scrolls inside its card, as on a phone, fades at an edge past which there is more of it. */
.flow-viewport[data-more="right"] { mask-image: linear-gradient(to right, black calc(100% - 28px), transparent); }
.flow-viewport[data-more="left"] { mask-image: linear-gradient(to left, black calc(100% - 28px), transparent); }
.flow-viewport[data-more="left right"] {
  mask-image: linear-gradient(to right, transparent, black 28px, black calc(100% - 28px), transparent);
}
.flow-stage { position: relative; margin: 0 auto; }
.flow-lines { position: absolute; inset: 0; }
.flow-lines path { fill: none; stroke: var(--wire); stroke-width: 1.5; }
.flow-lines marker path { fill: var(--wire); stroke: none; }
.flow-part {
  position: absolute; display: grid; place-items: center; border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: var(--surface); color: var(--ink); font: 600 var(--text-sm) / 1.2 var(--sans);
}
/* The loop names its lines along its right edge, so a passing thing never covers a name. */
.flow-lane { position: absolute; right: 10px; transform: translateY(-50%); font: 400 var(--text-xs) / 1 var(--sans); color: var(--muted); }
/* The lesson's part: the lanes run through it, and it carries one gate per lane it stands on. */
.flow-part.is-focus { border-color: var(--accent); background: var(--accent-pale); color: var(--accent-ink); }
.flow-part.is-focus > span:first-child { position: absolute; inset-inline: 0; text-align: center; transform: translateY(-50%); }
.flow-card.is-message { min-width: 118px; }
.flow[data-flow="branches"] .flow-card.is-message { width: 200px; }
/* Branches' phone layout (flow.mjs): a card 136 wide holds its role over its words. */
.flow[data-flow="branches"][data-layout="phone"] .flow-card.is-message { width: 136px; }
.flow[data-flow="branches"][data-layout="phone"] .flow-card.is-message .flow-row {
  flex-direction: column; align-items: flex-start; gap: 4px;
}
/* A part that is a row of the figure names itself at its left end. */
.flow-part.is-side { justify-items: start; padding-left: 16px; }
/* A bar of messages drawn to scale. A segment is as wide as its message is long, and one a frame sets to nothing
   is gone. A name too long for its segment stands under it. */
.flow-bar { position: relative; display: flex; width: 760px; height: 28px; }
.flow-gap { flex: none; }
.flow-seg {
  position: relative; flex: none; width: calc(var(--w) * 1px); height: 100%; opacity: var(--w);
  background: var(--actor-fill); box-shadow: inset -1px 0 var(--surface);
}
/* A segment grows or shrinks to its new size as a measure does, under Play and a seek alike. */
.flow-seg { transition: width var(--motion-grow) var(--motion-ease), opacity var(--motion-fade) ease-out; }
.flow-seg > b {
  position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; white-space: nowrap;
  font: 400 var(--text-xs) / 1 var(--mono); color: var(--series-ink);
}
.flow-seg > small {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  font: 400 var(--text-xs) / 1 var(--sans); color: var(--muted);
}
/* The first segment's name starts where the bar starts, so a name wider than a thin first segment, as the
   instruction of a summary request is, stays over its bar and not out before it. */
.flow-bar > .flow-seg:first-of-type > small { left: 0; transform: none; }
/* The window a request must fit, the size it is compacted at, and the names of both above the bar. */
.flow-window {
  position: absolute; inset-block: -6px; left: 0; border-radius: var(--radius-sm);
  background: var(--sunken);
}
.flow-tick { position: absolute; inset-block: -6px; width: 0; border-left: 1px dashed var(--wire); }
.flow-tick.is-end { border-left-color: transparent; }
.flow-tick > em {
  position: absolute; bottom: calc(100% + 6px); left: 0; transform: translateX(-50%); display: flex; align-items: center;
  gap: 4px; white-space: nowrap; font: normal 400 var(--text-xs) / 1 var(--sans); color: var(--muted);
}
.flow-tick.is-end > em { transform: translateX(-100%); }
/* A mark changes its colour, never its weight, so its words keep their width. The window's stop mark keeps its room,
   left of a name that ends at the mark, and shows once the request is over. */
.flow-tick:not(.is-end) .flow-mark { display: none; }
.flow-tick.is-end .flow-mark { visibility: hidden; }
.is-reached .flow-tick:not(.is-end) { border-left-color: var(--accent); }
.is-reached .flow-tick:not(.is-end) > em { color: var(--accent-ink); }
.is-over .flow-window { background: var(--danger-pale); }
.is-over .flow-tick.is-end > em { color: var(--danger); }
.is-over .flow-tick.is-end .flow-mark { visibility: visible; }
/* The turn about to be summarised: stripes laid over it, which fade in and out. */
.flow-seg.is-old-turn::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity var(--motion-fade) ease-out;
  background-image: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--surface) 60%, transparent) 4px 8px);
}
.is-old .flow-seg.is-old-turn::before { opacity: 1; }
/* A part a stage does without, and the lines to it. What changes on the stage moves with flow-motion.mjs, which fades
   it at the moment it changes. */
.flow-part.is-off { border-style: dashed; opacity: 0.45; }
.flow-lines path.is-off { opacity: 0.3; }
.flow-gate.is-off { opacity: 0.35; }
/* A part that holds others, such as a process: an outline with its name in the corner. A stage that draws it
   elsewhere leaves this one out. */
.flow-part.is-frame {
  place-items: start; padding: 8px 12px; border-style: dashed; border-color: var(--fig-group-line); background: transparent;
  font: 600 var(--text-sm) / 1.2 var(--sans); color: var(--muted);
}
/* A process that has exited: its outline and name turn to the failure colour. What ran in it is faded by the
   stage, and a new process that takes its place is drawn in the same outline under its own name. */
.flow-part.is-frame.is-down { border-color: var(--danger); background: var(--danger-pale); color: var(--danger); }
.flow-part.is-gone, .flow-lines path.is-gone { opacity: 0; }
/* The numbers a reader compares from step to step. Each has a box of its own width, so a change moves nothing. */
.flow-metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; padding: 14px 20px 0;
}
.flow-metric {
  position: relative; display: grid; align-content: start; gap: 2px; min-height: 54px; padding: 7px 12px;
  border-radius: var(--radius); background: var(--chip);
}
.flow-metric > span { font: 400 var(--text-xs) / 1.3 var(--sans); color: var(--muted); }
/* The value shown, over every value the metric takes, laid unseen in one cell so the box keeps its height. */
.flow-metric-values { display: grid; }
.flow-metric-values > * { grid-area: 1 / 1; font: 600 var(--text-body) / 1.3 var(--sans); font-variant-numeric: tabular-nums; }
.flow-metric-values > i { visibility: hidden; font-style: normal; }
.flow-metric-values > b { color: var(--ink); }
.flow-metric[data-tone="ok"] b { color: var(--ok); }
.flow-metric[data-tone="warn"] b { color: var(--warn); }
.flow-metric[data-tone="bad"] b { color: var(--danger); }
/* On a phone two numbers stand to a row, as Agent swarm's do, so three or four take two rows over the stage and not
   a column of their own; an odd last one takes the whole row. A number's name and its value are two rows of the
   grid they share, so two in a row stand level under names of one line or two. */
@media (max-width: 600px) {
  .flow-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: 16px; }
  .flow-metric { grid-row: span 2; grid-template-rows: subgrid; }
  .flow-metric:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* The foot of a stepped figure: the sentence for the current step. No line parts it from the figure above, except
   where the figure ends in bare text. */
.flow-foot { position: relative; display: grid; gap: 6px; padding: 0 20px 14px; }
.flow-foot.is-ruled { padding-top: 14px; }
.flow-foot.is-ruled::before { content: ""; position: absolute; top: 0; left: 20px; right: 20px; border-top: 1px solid var(--line); }
/* A figure taller than the screen (timeline.mjs holdFoot), a film and Structured Output's figures as well as a
   lesson diagram, a flow and a walkthrough, keeps its foot, the sentence over the controls, at the screen's foot
   while any of it shows, the two as one: the scene passes under them, fading into the sentence's ground as it goes.
   On a phone the foot holds the sentence and the transport's one row: the track and the stages' names under it hang
   past the screen's foot (`--foot-hung`), so the frame keeps the room. At rest, where the figure's foot is on the
   screen, it stands where it always does, whole. Structured Output's foot is its caption, which holds its sentence
   over its controls, and a film, which has no sentence, holds its transport. */
:is(.walkthrough, .so-figure, .player).is-tall > :is(.figure-foot, .tw-controls) {
  position: sticky; bottom: calc(-1 * var(--foot-hung, 0px)); z-index: 6;
}
/* A control the keyboard reaches in the part that hangs, the slider or a stage's name, raises the whole foot while it
   has the focus, so the focused control is never under the screen's foot (WCAG 2.4.11). */
:is(.walkthrough, .so-figure, .player).is-tall > :is(.figure-foot, .tw-controls):has(:focus-visible) { bottom: 0; }
/* A stop taller than the room the held foot leaves, as a flow's stage is on a small phone, lets the foot go while it
   has the focus (holdFoot), so the stop's ring stands whole on the screen. */
:is(.walkthrough, .so-figure, .player).is-tall.is-foot-free > :is(.figure-foot, .tw-controls) { position: relative; }
:is(.walkthrough, .so-figure).is-tall > .figure-foot { background: var(--surface); }
:is(:is(.walkthrough, .so-figure).is-tall > .figure-foot, :is(.walkthrough, .player).is-tall > .tw-controls)::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 16px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--surface));
}
/* While a box that scrolls in the figure, as its stage, has the focus, the fade gives way, as the box's own fades do,
   so it never lies over the ring's lower edge: a stage let go of the foot rests with its foot on the foot's top. */
:is(.walkthrough, .so-figure, .player).is-tall:has([data-more]:focus-visible) > :is(.figure-foot, .tw-controls)::before {
  visibility: hidden;
}
.flow-step-said { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.flow-step-said .flow-said-now { flex: 1; }
/* The sentence is the size of the figure's other words; the one word it marks is semibold, its focus. */
.walkthrough .flow-step-said strong { font-weight: 600; }
/* A stage that shows a problem, and the stage that fixes it, say so after the sentence, which always starts on the
   row's left edge. */
.flow-step-tag {
  flex: none; padding: 1px 8px; border-radius: var(--radius-sm); font: 600 var(--text-xs) / 1.6 var(--sans);
}
.flow-step-tag { display: inline-grid; }
.flow-step-tag > span { grid-area: 1 / 1; text-align: center; }
.flow-step-tag > span[aria-hidden="true"], .flow-step-tag[data-tag=""] { visibility: hidden; }
.flow-step-tag[data-tag="problem"] { background: var(--danger-pale); color: var(--danger); }
.flow-step-tag[data-tag="fix"] { background: var(--ok-pale); color: var(--ok); }
/* A record a store keeps, such as an entry of the run journal; one not yet written is a dashed outline. */
.flow-pill.is-entry { border-color: var(--fig-store-line); }
.flow-pill.is-missing { border-style: dashed; border-color: var(--line-strong); color: var(--muted); }
/* A name over a column of the figure: no box. */
.flow-part.is-bare { justify-items: start; border-color: transparent; background: transparent; }
/* A running program drawn as a window with a title bar, the disk under it, and a file on the disk. */
.flow-part.is-window, .flow-part.is-disk, .flow-part.is-file { place-items: start; padding: 9px 14px; }
.flow-part.is-window::after { content: ""; position: absolute; inset: 34px 0 auto; border-top: 1px solid var(--line); }
.flow-part.is-disk { border-color: var(--line); background: var(--fig-outside-fill); font: 400 var(--text-xs) / 1.2 var(--sans); color: var(--muted); }
.flow-part.is-file {
  padding: 9px 6px; border-color: var(--accent); background: var(--accent-pale);
  font: 600 var(--text-xs) / 1.2 var(--mono); color: var(--accent-ink);
}
.flow-none { font: 400 var(--text-xs) / 1 var(--sans); color: var(--faint); }
/* Whether a program is running, in its title bar. */
.flow-status { display: inline-flex; align-items: center; gap: 6px; font: 400 var(--text-xs) / 1 var(--sans); color: var(--muted); }
.flow-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.flow-status b { font-weight: 400; }
.flow-status i { display: none; font-style: normal; }
.is-down .flow-status::before { background: var(--faint); }
.is-down .flow-status b { display: none; }
.is-down .flow-status i { display: inline; }
/* One message as a line of a window or a file: all lines are one width, so they stand as a column. */
.flow-line {
  display: flex; align-items: center; gap: 8px; width: var(--row-width, 366px); padding: 3px 6px 3px 2px; border-radius: var(--radius-sm);
  white-space: nowrap; font: 400 var(--text-xs) / 1.3 var(--mono); color: var(--ink);
}
.flow-line .flow-mark { display: none; margin-left: auto; }
.is-stopped .flow-line { background: var(--danger-pale); color: var(--danger); }
.is-landed .flow-line { background: var(--ok-pale); }
.is-stopped .flow-line .flow-mark, .is-landed .flow-line .flow-mark { display: block; }
.is-landed .flow-line .flow-mark { color: var(--ok); }
/* A session's id, standing at the last message the session holds; and a message no session points past. */
.flow-pill.is-pointer { border-color: var(--accent); background: var(--surface); color: var(--accent-ink); }
.flow-thing.is-shown.is-faint { opacity: 0.4; }
/* A place's number: on its gate in the figure and on its tab, so the two read as one. */
.flow-n {
  display: grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid var(--line-strong);
  border-radius: 50%; background: var(--surface); color: var(--muted); font: 600 var(--text-xs) / 1 var(--mono);
}
.flow-gate { position: absolute; transform: translate(-50%, -50%); }
.flow-gate.is-own { border-color: var(--accent); color: var(--accent-ink); }
.flow-gate.is-active {
  border-color: var(--accent); background: var(--accent); color: var(--on-accent);
}
/* The places of a figure stand side by side as tabs: a name, and under it what is done there. */
.flow-places button { display: grid; align-content: center; justify-items: start; gap: 2px; min-height: 60px; text-align: left; }
.flow-places strong { font-weight: 600; color: var(--ink); }
.flow-places small { font-size: var(--text-xs); line-height: 1.35; color: var(--muted); }
.flow-places [aria-selected="true"] strong { color: var(--accent-ink); }
.flow-places button + button { border-left: 1px solid var(--line); }
/* The overview and message detail share one clock and one active step. */
.flow-said-now > p { margin: 0; color: var(--ink); font: 400 var(--text-sm) / 1.5 var(--sans); text-wrap: pretty; }
/* Every line the figure says, laid unseen under the one it says now, so the foot keeps its height. */
.flow-said-now { display: grid; min-width: 0; }
.flow-said-now > p { grid-area: 1 / 1; }
.flow-said-now > p[aria-hidden="true"] { visibility: hidden; }
.flow-timeline { gap: 20px; align-items: start; padding-top: 20px; container-type: inline-size; }
.flow-transport { display: flex; flex: none; align-items: center; gap: 6px; }
.flow-transport [data-tw="play"] { min-width: 82px; }
.flow-transport [data-tw="frame-back"], .flow-transport [data-tw="frame-next"] { width: 40px; padding-inline: 0; }
.flow-scrubber { position: relative; flex: 1; min-width: 0; }
.flow-track { position: relative; margin: 0 8px; }
.flow-scrubber input { display: block; width: 100%; height: 32px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.flow-marker-rail { position: absolute; inset: 0 8px; z-index: 2; pointer-events: none; }
.flow-time-mark {
  position: absolute; left: var(--at); top: 10px; display: grid; place-items: center; width: 12px; height: 12px;
  border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--muted);
  transform: translateX(-50%); font: 600 var(--text-xs) / 1 var(--mono);
}
.flow-time-mark.is-current { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.flow-timeline-guides { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }
.flow-timeline-guides path { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 4; }
.flow-timeline-guides path.is-current { stroke: var(--accent); }
/* A stage's number and name on one line, the number under its mark on the track. */
.flow-checkpoints { position: relative; height: 30px; margin-top: 6px; }
.flow-checkpoints button {
  position: absolute; top: 0; left: calc(16px + var(--point) * (100% - 32px)); transform: translateX(-11.5px);
  display: flex; align-items: center; justify-content: flex-start;
  height: 28px; min-height: 0; padding: 0 8px 0 0; gap: 6px; text-align: center;
  border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--muted);
}
.flow-checkpoints button:hover { background: var(--hover); }
.flow-checkpoints b {
  position: relative; z-index: 2; display: grid; place-items: center; flex: none; width: 23px; height: 23px;
  border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: 50%; font: 600 var(--text-sm) / 1 var(--mono);
}
.flow-checkpoints strong { display: block; font: 600 var(--text-xs) / 1.2 var(--sans); white-space: nowrap; }
.flow-checkpoints [aria-current="step"] { color: var(--accent-ink); }
.flow-checkpoints button strong { color: inherit; }
.flow-checkpoints [aria-current="step"] b { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
/* Where a name would reach the next stage's number, every name stands under its number instead, centred under its
   mark (timeline.mjs decides). A button is no wider than the space between two marks, so one never covers its
   neighbour's number; a name keeps to one line, and where one would not fit its button the numbers stand alone. */
/* Room for the number and one line of name: 4 + 23 + 6 + 15.6 + 2 for a descender + 4, and the border. */
.flow-checkpoints.is-stacked { height: 58px; margin-top: 8px; }
.flow-checkpoints.is-stacked button {
  flex-direction: column; align-items: center; width: min(84px, calc((100% - 32px) / var(--tw-count) - 4px));
  height: auto; padding: 4px 2px; transform: translateX(-50%);
}
.flow-checkpoints.is-stacked strong { flex: none; padding-bottom: 2px; white-space: nowrap; text-align: center; }
/* The first mark stands at the track's start, where a centred name would reach past the figure's edge: its number stays
   under the mark and its name starts there. */
.flow-checkpoints.is-stacked button:first-of-type { align-items: flex-start; transform: translateX(-11.5px); }
.flow-checkpoints.is-stacked button:first-of-type strong { text-align: left; }
/* Where a name on one line would be wider than its button, or two names stand too close, the numbers stand alone:
   each name is kept for a screen reader, and the current stage's name stands whole on one line, starting under its
   own number and held inside the track (timeline.mjs places it), or, where the track is narrower than the name,
   reaching left from the track's end under the buttons beside it. */
.flow-stage-now { display: none; }
.flow-checkpoints.is-numbered { height: 52px; }
.flow-checkpoints.is-numbered strong {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.flow-checkpoints.is-numbered .flow-stage-now {
  display: block; position: absolute; top: 34px; left: 0; width: max-content; max-width: 100cqw;
  margin: 0; overflow: hidden;
  font: 600 var(--text-xs) / 1.2 var(--sans); color: var(--accent-ink); text-align: left;
  white-space: nowrap; text-overflow: ellipsis;
}
.flow-part.is-effect {
  place-items: start; padding: 9px 10px; border-color: var(--actor-tool); background: var(--surface);
  font: 600 var(--text-xs) / 1.2 var(--mono);
}
.flow-effect { white-space: nowrap; font: 400 var(--text-xs) / 1.2 var(--mono); color: var(--ink); }
.flow-transfer { display: inline-flex; gap: 6px; align-items: center; color: var(--accent-ink); font: 600 var(--text-sm) / 1.2 var(--sans); }
.flow-transfer svg { width: 14px; height: 14px; transform: rotate(90deg); }
.flow-transfer.is-loading svg { transform: rotate(-90deg); }
.flow[data-flow="sessions"] .flow-viewport { padding: 12px 16px 24px; }
.flow[data-flow="sessions"] .flow-timeline { padding-bottom: 6px; }
.flow[data-flow="sessions"] .flow-stage { --row-width: 432px; }
.flow-part.is-pane { justify-items: start; border: 0; background: transparent; line-height: 1.3; }
.flow-part.is-pane h3 { margin: 0; font: inherit; color: inherit; }
.flow-part.is-divider { border: 0; border-left: 1px solid var(--line-strong); border-radius: 0; background: transparent; }
.flow-part.is-node { padding: 8px; text-align: center; }
.flow-part.is-record { place-items: start; padding: 6px 18px; }
.flow-part.is-record::after { content: ""; position: absolute; inset: 28px 0 auto; border-top: 1px solid var(--line); }
.flow-record-rules { position: absolute; pointer-events: none; }
.flow-record-rule {
  position: absolute; width: var(--row-width); height: 1px; background: var(--line);
  transform: translate(-50%, -50%); opacity: 0; transition: opacity var(--motion-fade) ease-out;
}
/* A rule between two rows fades in once the new row's fill has cleared. */
.flow-record-rule.is-visible { opacity: 1; transition-delay: var(--motion-fade); }
.flow-part.is-store { border: 0; background: transparent; }
.flow-store-shape { position: absolute; inset: 0; width: 100%; height: 100%; }
.flow-store-shape path { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.2; }
.flow-store-label { position: absolute; top: 60%; inset-inline: 8px; transform: translateY(-50%); text-align: center; }
.flow-part.is-artifact {
  place-items: start center; padding-top: 12px; border-color: var(--line-strong);
}
.flow[data-flow="sessions"] .flow-effect { font: 400 var(--text-sm) / 1.2 var(--sans); color: var(--ok); }
.flow[data-flow="sessions"] .flow-part.is-frame, .flow[data-flow="sessions"] .flow-part.is-off { border-style: solid; }
.flow-part.is-active { border-color: var(--accent); background: var(--accent-pale); color: var(--accent-ink); }
.flow-part.is-frame.is-active, .flow-part.is-store.is-active { background: transparent; }
.flow-part.is-store.is-active .flow-store-shape path { stroke: var(--accent); fill: var(--accent-pale); }
.flow[data-flow="sessions"] .flow-line { height: 32px; padding: 6px 10px; gap: 12px; }
.flow[data-flow="sessions"] .flow-line .player-chip { flex: 0 0 76px; text-align: center; }
.flow-origin {
  display: none; position: absolute; right: calc(100% + 8px); top: 50%;
  transform: translateY(-50%); text-align: right; white-space: nowrap;
  font: 600 var(--text-xs) / 1.2 var(--sans); color: var(--accent-ink);
}
.is-response .flow-origin { display: block; }
.flow-thing.is-active .flow-line, .flow-thing.is-response .flow-line { background: var(--accent-pale); }
.flow-thing.is-new .flow-line { background: var(--ok-pale); }
.flow-part.is-record.is-active { background: var(--surface); border-color: var(--line-strong); }
.flow-edge-label { opacity: 0; fill: var(--muted); font: 400 var(--text-xs) / 1 var(--sans); }
.flow-edge-label.is-active { opacity: 1; fill: var(--accent-ink); }
.flow-edge-label.is-off { opacity: 0; }
/* A line's name that says what the line is, not what is moving on it, stays shown. */
.flow-edge-label.is-still { opacity: 1; }
/* A still name of a line whose part a stage does without fades with it, as a line's name over it does. */
.flow-edge-label.is-still.is-off { opacity: 0.3; }
.flow-lines path[data-edge].is-active { stroke: var(--accent); stroke-width: 2.4; }
.flow-lines marker path.flow-active-head { fill: var(--accent); }
/* One shared progress value draws the solid line and keeps its only arrowhead at the leading tip. At rest the line is
   whole; flow-motion.mjs draws it from 0 as the step that uses it plays, with what travels it. */
@property --flow-progress { syntax: "<number>"; inherits: true; initial-value: 0; }
.has-data-flow .flow-lines path[data-edge].is-active { stroke: var(--wire); stroke-width: 1.2; }
.flow-data { position: absolute; inset: 0; pointer-events: none; visibility: hidden; --flow-progress: 1; }
.flow-data.is-active:not(.is-off):not(.is-gone) { visibility: visible; }
.flow-trail { position: absolute; inset: 0; }
.flow-trail path {
  fill: none; stroke: var(--accent); stroke-width: 3; stroke-dasharray: 1 1;
  stroke-dashoffset: calc(1 - var(--flow-progress));
}
.flow-tip {
  position: absolute; left: 0; top: 0; width: 14px; height: 12px;
  offset-distance: calc(var(--flow-progress) * 100%); offset-rotate: auto; offset-anchor: 50% 50%;
  opacity: min(1, calc(var(--flow-progress) * 100));
}
.flow-tip svg { display: block; width: 100%; height: 100%; overflow: visible; }
.flow-tip path { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
/* A thing is placed by its centre. flow-motion.mjs moves it from where it stood: it travels, fades in or out in
   place, or settles after a seek. */
.flow-thing {
  position: absolute; left: 0; top: 0; opacity: 0; pointer-events: none;
  transform: translate(calc(var(--x) - 50%), calc(var(--y) - 50%));
}
.flow-thing.is-shown { opacity: 1; }
/* A row of a tree, as a span in a trace journal, stands from its left edge, so rows a step in line up. */
.flow-thing:has(> .flow-pill.is-tree) { transform: translate(var(--x), calc(var(--y) - 50%)); }
.flow-card {
  display: grid; gap: 4px; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface);
}
.flow-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; font: 400 var(--text-xs) / 1.2 var(--mono); }
.flow-row > i { width: 52px; height: 6px; border-radius: 3px; background: var(--line-strong); }
.flow-mark { flex: none; }
/* The line a hook adds opens in place, between the messages it sits between. */
.flow-added {
  display: grid; grid-template-rows: 0fr; margin-top: -4px;
  transition: grid-template-rows var(--motion-grow) var(--motion-ease), margin-top var(--motion-grow) var(--motion-ease);
}
.flow-added > .flow-row {
  min-height: 0; overflow: hidden; padding-inline: 6px; border-radius: var(--radius-sm);
  background: var(--ok-pale); color: var(--ok); transition: padding var(--motion-grow) var(--motion-ease);
}
.has-line .flow-added { grid-template-rows: 1fr; margin-top: 0; }
.has-line .flow-added > .flow-row { padding-block: 3px; }
.flow-later { display: none; gap: 4px; }
.is-second .flow-later { display: flex; }
/* A tool call is a pill in the colour of the model that wrote it; a result takes the tool's colour. */
.flow-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid var(--actor-model);
  border-radius: var(--radius-pill); background: var(--surface); color: var(--ink); white-space: nowrap;
  font: 400 var(--text-xs) / 1.3 var(--mono);
}
.flow-pill .flow-mark { display: none; }
/* A tool call is drawn as a Tool line is (elements.css): the icon of its tool in the tool's colour, then the call. A
   stopped call shows the stop mark in the icon's place, so it keeps its width. */
:is(.flow-pill, .flow-card).is-call .flow-tool { width: 13px; height: 13px; color: var(--actor-tool); }
.is-stopped :is(.flow-pill, .flow-card).is-call .flow-tool { display: none; }
.flow-pill.is-result { border-color: var(--actor-tool); }
.is-stopped .flow-pill { border-color: var(--danger); background: var(--danger-pale); color: var(--danger); }
.is-stopped .flow-pill .flow-mark { display: block; }
/* A secret in a result, and the dots that stand for it once a hook has masked it. */
.flow-secret { color: var(--danger); }
.flow-masked { display: none; color: var(--muted); }
.is-masked .flow-secret { display: none; }
.is-masked .flow-masked { display: inline; }
/* A server's tool by the server's own name, and by the name the MCP client gives it on its way to Tools. */
.flow-served .flow-named, .is-named .flow-served .flow-raw { display: none; }
.is-named .flow-served .flow-named { display: inline; }
/* A call to a server's tool carries the tool's mark alone until MCP Client gives it the server's name for the tool;
   the tool it names lights in Tools as it is made. */
.is-named .flow-pill > .flow-served { display: none; }
.flow-thing.is-active > .flow-served { box-shadow: 0 0 0 2px var(--accent); }
/* A part whose name sits at its top, 6 under its edge, leaves room under the name for what rests in it; a part
   outside the project is sunken. */
.flow-part.is-top { align-items: start; padding-top: 5px; }
.flow-part.is-outside { border-color: var(--fig-group-line); background: var(--fig-outside-fill); }
/* A command is a card of rows; the mark on its first row shows only once it has been stopped. */
.flow-card .flow-mark { display: none; }
.flow-added .flow-mark { display: block; }
.is-stopped .flow-card { border-color: var(--danger); background: var(--danger-pale); color: var(--danger); }
.is-stopped .flow-card .flow-mark { display: block; }
/* A person's answer at a gate. */
.flow-say b {
  display: none; align-items: center; gap: 4px; padding: 3px 9px; border: 1px solid currentColor;
  border-radius: var(--radius-pill); background: var(--surface); font: 600 var(--text-xs) / 1.3 var(--sans);
}
.is-no .when-no { display: inline-flex; color: var(--danger); }
.is-yes .when-yes { display: inline-flex; color: var(--ok); }
/* A write a command makes: a file on its way to disk. It is marked once it has landed or been stopped. */
.flow-pill.is-file { border-color: var(--actor-tool); }
.is-landed .flow-pill { border-color: var(--ok); background: var(--ok-pale); color: var(--ok); }
.is-landed .flow-pill .flow-mark { display: block; }
/* The sandbox is named in the band over the place it is drawn around. */
.flow[data-flow="sandbox"] [data-part="sandbox"] { padding-top: 4px; border-color: var(--fig-tool); }
/* What the place a command runs in says while nothing runs there. */
.flow-idle { white-space: nowrap; font: 400 var(--text-xs) / 1.2 var(--sans); color: var(--muted); }
/* A file a folder already holds: a write's shape, with no colour of its own. */
.flow-pill.is-there { border-color: var(--line-strong); color: var(--muted); }
/* A write that landed where it should not have: written, and marked as the harm it is. */
.is-breach .flow-pill { border-color: var(--danger); background: var(--danger-pale); color: var(--danger); }
/* A line of a file the model has found or read: the accent a pointer has, on the line where it stands. */
.is-read .flow-pill { border-color: var(--accent); color: var(--accent-ink); }
/* A task, a prompt's line or a draft that a check decides: its two marks share one cell and keep their room while
   neither shows, so a result changes colour and moves no text. Not yet decided, it is quiet; under test, accent. */
.flow-marks { display: grid; }
.flow-marked .flow-marks > .flow-mark { display: block; grid-area: 1 / 1; visibility: hidden; }
.is-landed .flow-marked .flow-marks > .flow-mark:first-child,
.is-stopped .flow-marked .flow-marks > .flow-mark:last-child { visibility: visible; }
.flow-thing:not(.is-landed, .is-stopped, .is-trying) .flow-marked { border-color: var(--line-strong); color: var(--muted); }
.flow-thing:not(.is-landed, .is-stopped, .is-trying) .flow-marked.is-prompt { border-color: var(--fig-store-line); color: var(--ink); }
.is-trying .flow-marked { border-color: var(--accent); background: var(--accent-pale); color: var(--accent-ink); }
.flow-marked.is-prompt { width: 340px; }
.flow-marked.is-task { width: 156px; }
.flow-marked.is-row { width: 216px; }
/* Approval, Permissions and Sandbox share one picture: Tools is named at its top right, over the tool it holds,
   which stands beside its gates. */
.flow:is([data-flow="safety"], [data-flow="capabilities"], [data-flow="sandbox"], [data-flow="injection"]) [data-part="tools"] {
  justify-items: end; padding-right: 14px;
}
.flow:is([data-flow="safety"], [data-flow="capabilities"], [data-flow="sandbox"], [data-flow="injection"]) [data-part="tools"] .flow-held {
  left: auto; right: 50px; transform: translate(50%, -50%);
}
/* Prompt injection draws the same picture, with Context and a page under it. Context is this lesson's part, so it
   has its class's full colour for its outline; the sandbox is named in its band, as in the Sandbox lesson. What a
   page says: its lines, then the order planted in it, left-aligned as text is. The page's text as a result is a
   narrow card, so it fits the gate it is labelled in; the label is a band across its top that opens when
   Permissions adds it. */
.flow[data-flow="injection"] [data-part="context"] { border-color: var(--fig-store); }
.flow[data-flow="injection"] [data-part="sandbox"] { padding-top: 4px; }
.flow-page { display: grid; gap: 4px; justify-items: start; }
.flow-page .flow-row > i + i, .flow-card.is-page .flow-row > i + i { width: 30px; }
.flow-card.is-page { gap: 3px; padding: 5px 4px; }
.flow-card.is-page > .flow-row { padding-inline: 3px; }
.flow-card.is-page .flow-added { margin-top: -3px; }
.flow-card.is-page .flow-added > .flow-row { justify-content: center; padding-inline: 0; }
.is-labelled .flow-card.is-page .flow-added { grid-template-rows: 1fr; margin-top: 0; }
.is-labelled .flow-card.is-page .flow-added > .flow-row { padding-block: 2px; }
/* An answer that has been handed over, and the notice an answer that failed is sent back with. */
.is-landed .flow-card { border-color: var(--ok); background: var(--ok-pale); }
.is-landed .flow-card .flow-mark { display: block; color: var(--ok); }
.flow-pill.is-notice { border-color: var(--warn); color: var(--warn); }
/* What the next tokens add to an answer that is being written. */
.flow-more { display: none; }
.is-full .flow-more { display: flex; }
/* A gate with no number is a plain check. */
.flow-gate:empty { width: 14px; height: 14px; }
/* A tool a part holds from the start sits on its row; a tool that arrives later comes to rest on the next one. */
.flow-held { position: absolute; left: 50%; transform: translate(-50%, -50%); font-weight: 400; }
/* With reduced motion a flow figure shows each frame settled: flow-motion.mjs moves nothing, and nothing the stylesheet
   moves itself is left to transition. */
@media (prefers-reduced-motion: reduce) {
  .flow :is(.flow-seg, .flow-added, .flow-added > .flow-row, .flow-record-rule, .flow-score > i),
  .flow .flow-seg::before { transition: none; }
}
@media (max-width: 720px) {
  .tw-head { align-items: flex-start; flex-direction: column; gap: 4px; padding: 14px 16px; }
  .tw-stages button { padding: 10px 6px; text-align: center; font-size: var(--text-xs); }
  .tw-stages button span { display: block; margin: 0 0 3px; }
  .tw-scene-heading { min-height: 92px; padding: 12px 16px; }
  .tw-panes { grid-template-columns: minmax(0, 1fr); grid-template-rows: 285px 365px; height: 650px; }
  .tw-pane { padding: 16px; }
  .tw-pane + .tw-pane { border-left: 0; border-top: 1px solid var(--line); }
  .tw-note { min-height: 100px; padding: 12px 16px; }
  .tw-controls { padding: 12px 10px; gap: 4px; }
  .tw-controls .button { padding: 7px 9px; }
}
/* On a phone the transport stands over the timeline, which takes the figure's whole width, so its stages have room
   for their numbers and names; beside the transport it would be squeezed into what is left of the row. */
@media (max-width: 760px) {
  .flow-timeline { flex-direction: column; align-items: stretch; gap: 8px; }
  .flow-timeline .flow-scrubber { width: 100%; }
}

/* External files and magnified session records. */
.flow-part.is-filesystem {
  align-content: start; justify-items: start; padding: 14px 12px;
  border: 1px solid var(--line-strong); background: var(--fig-outside-fill); color: var(--ink);
}
.flow-part.is-filesystem.is-active { border-color: var(--line-strong); background: var(--fig-outside-fill); }
.session-filesystem-title { font: 600 var(--text-sm) / 1.2 var(--sans); }
.session-record-cylinder { position: absolute; inset: 0; width: 100%; height: 100%; }
.session-file {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 8px;
  border-radius: var(--radius-sm); background: var(--surface);
}
.session-file > span { font: 600 var(--text-sm) / 1.2 var(--sans); color: var(--ink); }
.session-document { width: 16px; height: 20px; flex: none; }
.session-document path { fill: none; stroke: var(--muted); stroke-width: 1.3; stroke-linejoin: round; }
.session-file-check { width: 14px; height: 14px; margin-left: auto; flex: none; }
.session-file-check path {
  fill: none; stroke: var(--ok); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.flow[data-layout="overview"] .flow-lines path:not([data-edge]) { stroke: var(--line-strong); stroke-dasharray: 4 5; }
.flow[data-layout="expanded"] [data-part="detailStore"] {
  padding: 0; border: 0; background: transparent;
}
.session-record-cylinder path { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.2; }
.flow[data-layout="expanded"] [data-part="detailStore"].is-active .session-record-cylinder path {
  stroke: var(--accent);
}
.session-store-title { position: absolute; top: 32px; left: 18px; font: 600 var(--text-sm) / 1.2 var(--sans); }
.flow[data-layout="expanded"] [data-part="detailStore"]::after {
  top: 54px; inset-inline: 18px;
}
/* A part of the runtime takes the colour of its class on the home map and carries its mark before its name.
   The lesson's own part has the full colour for its outline. */
.flow-name { display: inline-flex; align-items: center; gap: 6px; }
.flow-part.c-runs { border-color: var(--fig-model-line); background: var(--fig-model-pale); color: var(--ink); }
.flow-part.c-data { border-color: var(--fig-store-line); background: var(--fig-store-pale); color: var(--ink); }
.flow-part.c-reach { border-color: var(--fig-tool-line); background: var(--fig-tool-pale); color: var(--ink); }
.flow-part.c-yours { border-color: var(--fig-you-line); background: var(--fig-you-pale); color: var(--ink); }
.flow-part.c-runs .part-mark, .flow-part.c-runs.is-focus { color: var(--fig-model); }
.flow-part.c-data .part-mark, .flow-part.c-data.is-focus { color: var(--fig-store); }
.flow-part.c-reach .part-mark, .flow-part.c-reach.is-focus { color: var(--fig-tool); }
.flow-part.c-yours .part-mark, .flow-part.c-yours.is-focus { color: var(--fig-you); }
.flow-part.c-runs.is-focus { border-color: var(--fig-model); }
.flow-part.c-data.is-focus { border-color: var(--fig-store); }
.flow-part.c-reach.is-focus { border-color: var(--fig-tool); }
.flow-part.c-yours.is-focus { border-color: var(--fig-you); }
.flow-part.is-store[class*="c-"] { background: transparent; }
.flow-part.is-store.c-data .flow-store-shape path { fill: var(--fig-store-pale); stroke: var(--fig-store-line); }
.flow-part.is-record[class*="c-"] { border-color: var(--line-strong); background: var(--surface); }
/* While a step uses a part, the part has its class's full colour for its outline and a deeper ground. */
.flow-part.c-runs.is-active { border-color: var(--fig-model); background: var(--fig-model-active); }
.flow-part.c-data.is-active { border-color: var(--fig-store); background: var(--fig-store-active); }
.flow-part.c-reach.is-active { border-color: var(--fig-tool); background: var(--fig-tool-active); }
.flow-part.c-yours.is-active { border-color: var(--fig-you); background: var(--fig-you-active); }
.flow-part.is-store.c-data.is-active { background: transparent; }
.flow-part.is-store.c-data.is-active .flow-store-shape path {
  stroke: var(--fig-store); fill: var(--fig-store-active);
}
.flow-part.is-record[class*="c-"].is-active { border-color: var(--line-strong); background: var(--surface); }
.flow-part.is-node.is-outside.is-active { border-color: var(--ink); background: var(--fig-outside-fill); color: var(--ink); }
/* A figure of places, with no parts and arrows between them: a row or a column holds its content with no box around
   it, and a hairline parts it from the next. A row that is a part of the runtime keeps its class's fill. */
.flow-part.is-side, .flow-part.is-side.is-active { border-color: transparent; }
.flow-part.is-side:not([class*="c-"]) { border-radius: 0; background: transparent; }
/* A row's name stays at the card's left edge while a stage that scrolls inside its card goes on under it, as a
   schedule's lanes do (flow.mjs's follow keeps what a frame changes right of it): it stands on its row's own fill, as
   tall as the row, over the bar that passes under it, from the card's own edge: past the viewport's 20px of padding,
   counted in the stage's pixels (`--stage-zoom`, flow.mjs). Faded, the row keeps that fill and fades its words. */
.flow-part.is-side > :is(.flow-name, .flow-rowname) {
  position: sticky; left: calc(-20px / var(--stage-zoom, 1)); z-index: 1; align-self: stretch; align-content: center;
  margin-left: -16px; padding: 0 12px 0 16px; background: var(--surface);
  border-top-left-radius: inherit; border-bottom-left-radius: inherit;
}
.flow-part.is-side[class*="c-"] > :is(.flow-name, .flow-rowname) { background: inherit; }
/* Once the stage has scrolled under it, a pinned name fades into its row over 16px, so a bar or a tag passing under
   it fades out at its edge rather than standing cut as a stray letter. The fade is the name's own ground. */
.flow-viewport[data-more~="left"] .flow-part.is-side > :is(.flow-name, .flow-rowname)::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 100%; width: 16px; pointer-events: none;
  background: inherit; mask-image: linear-gradient(to right, black, transparent);
}
.flow-part.is-side.is-off { opacity: 1; }
.flow-part.is-side.is-off > .flow-rowname { color: color-mix(in srgb, var(--ink) 45%, var(--surface)); }
.flow-part.is-side.is-off > .flow-rowname small { color: color-mix(in srgb, var(--muted) 45%, var(--surface)); }
/* Its left edge holds those names, so only its right edge fades. */
.flow-viewport:has(.flow-part.is-side)[data-more="left"] { mask-image: none; }
.flow-viewport:has(.flow-part.is-side)[data-more="left right"] {
  mask-image: linear-gradient(to right, black calc(100% - 28px), transparent);
}
.flow-part.is-side:not([class*="c-"]) ~ .flow-part.is-side::before {
  content: ""; position: absolute; inset: -15px 0 auto; border-top: 1px solid var(--line);
}
.flow:is([data-flow="retrieval"], [data-flow="discovery"]) .flow-part.is-record,
.flow:is([data-flow="retrieval"], [data-flow="discovery"]) .flow-part.is-record.is-active {
  border-color: transparent; border-radius: 0; background: transparent;
}
.flow:is([data-flow="retrieval"], [data-flow="discovery"]) .flow-part.is-record::after { content: none; }
.flow[data-flow="retrieval"] .flow-part.is-record + .flow-part.is-record::before {
  content: ""; position: absolute; inset: 0 auto 0 -7px; border-left: 1px solid var(--line);
}
.flow[data-flow="discovery"] [data-part="held"]::before {
  content: ""; position: absolute; inset: 0 -21px 0 auto; border-left: 1px solid var(--line);
}
.flow[data-flow="discovery"] [data-part="said"]::before {
  content: ""; position: absolute; inset: -11px 0 auto; border-top: 1px solid var(--line);
}
/* A figure with an overview and its detail: the frame, rows and guides of the Sessions figure. */
/* The sentence under the figure stands 24 under its lowest box, as in every figure. */
.flow.has-detail .flow-viewport { padding: 12px 16px 24px; }
.flow.has-detail .flow-timeline { padding-bottom: 6px; }
.flow.has-detail .flow-stage { --row-width: 432px; }
.flow.has-detail .flow-line { height: 32px; padding: 6px 10px; gap: 12px; }
.flow.has-detail .flow-line .player-chip, .flow.has-detail .flow-source { flex: 0 0 76px; text-align: center; }
.flow.has-detail .flow-lines path:not([data-edge]) { stroke: var(--line-strong); stroke-dasharray: 4 5; }
.flow-source { font: 400 var(--text-xs) / 1.3 var(--sans); color: var(--muted); white-space: nowrap; }
/* What state a saved entry is in, at the end of its row: how long it lasts, or why it no longer counts. */
.flow-tag { margin-left: auto; font: 400 var(--text-xs) / 1.3 var(--sans); color: var(--muted); }
.flow-tag > i { display: none; font-style: normal; }
.flow-tag > .when-live { display: inline; }
.is-replaced .flow-tag > .when-live, .is-expired .flow-tag > .when-live { display: none; }
.flow-thing.is-shown.is-replaced .flow-line > span:not(.flow-tag),
.flow-thing.is-shown.is-expired .flow-line > span:not(.flow-tag) { opacity: 0.45; }
.is-expired .flow-tag { color: var(--danger); }
/* A row of the compaction figure names what it is and, in smaller type, which of its kind. */
.flow-rowname { display: grid; gap: 2px; }
.flow-rowname small { font: 400 var(--text-xs) / 1.2 var(--sans); color: var(--muted); }
/* A document before it is cut into passages: its name and lines of text, as tall as the rows it becomes. */
.flow-block {
  display: grid; align-content: start; gap: 7px; width: var(--row-width, 366px); height: 140px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--sunken);
}
.flow-block span { font: 400 var(--text-xs) / 1.2 var(--mono); color: var(--muted); }
.flow-block i { height: 5px; border-radius: 3px; background: var(--line-strong); }
.flow-block i:nth-of-type(3n) { width: 62%; }
.flow-block i:nth-of-type(3n + 1) { width: 94%; }
.flow-block i:nth-of-type(3n + 2) { width: 81%; }
/* Saved facts and Skills: the overview is small, and what its parts hold is large enough to read across a room.
   Sessions keeps its overview and has the same rows, and so do the three lists of Tool search. */
.flow:is([data-flow="memory"], [data-flow="skills"]) .flow-stage { --row-width: 584px; }
.flow:is([data-flow="memory"], [data-flow="skills"], [data-flow="sessions"], [data-flow="discovery"]) .flow-line {
  height: 34px; font-size: var(--text-sm);
}
.flow:is([data-flow="memory"], [data-flow="skills"], [data-flow="sessions"], [data-flow="discovery"]) .flow-line :is(.player-chip, .flow-source, .flow-tag) {
  font-size: var(--text-sm);
}
.flow:is([data-flow="memory"], [data-flow="skills"], [data-flow="discovery"]) .flow-line :is(.player-chip, .flow-source) { flex-basis: 96px; }
.flow[data-flow="sessions"] .flow-line .player-chip { flex-basis: 92px; }
/* Saved facts lists the facts in one message of two lines: the runtime's heading, then the facts with their ids. */
.flow[data-flow="memory"] .flow-line.is-two { height: 52px; white-space: pre-line; line-height: 1.3; }
/* A message of several lines, such as a system prompt the skills catalog has listed its skills in: the chip stands
   by its first line, and only the lines just added take the new fill. */
.flow-line.is-block,
.flow:is([data-flow="memory"], [data-flow="skills"], [data-flow="sessions"], [data-flow="discovery"]) .flow-line.is-block {
  height: auto; align-items: start; padding-block: 4px; line-height: 18px;
}
.flow-line.is-block .player-chip { margin-top: 1px; }
.flow-said-lines { display: grid; min-width: 0; }
.flow-said-lines > span { overflow: hidden; text-overflow: ellipsis; border-radius: var(--radius-sm); }
/* The skills catalog's heading is longer than its row: it wraps onto a second line, which the figure leaves room
   for. */
.flow[data-flow="skills"] .flow-said-lines > span { white-space: normal; }
.flow-thing.is-new .flow-line.is-block { background: transparent; }
.flow-thing.is-new .flow-line.is-block .is-added { background: var(--ok-pale); }
/* What an empty panel says until its first row arrives. */
.flow-line.is-empty { padding-left: 10px; font-family: var(--sans); color: var(--muted); }
/* A tool as a list names it: its name in code, wide enough for the longest, then what it does. */
.flow.has-detail .flow-line.is-tool .flow-source { flex: 0 0 144px; text-align: left; font-family: var(--mono); color: var(--ink); }
/* A description longer than its column wraps under its own start, the name beside its first line. */
.flow.has-detail .flow-line.is-tool.is-wrapped {
  height: auto; align-items: start; white-space: normal; line-height: 18px;
}
/* A line's name stands at its left end, clear of the line by more than half a pill: above it, or below it for the
   lower line of a pair. On the line a place is on, the name takes the line's colour. */
/* A stage shrunk to its card shrinks its words with it; a line's name, the smallest of them, is scaled back up from
   its end nearest the line so it stands at 11px on the screen (flow.mjs sets --name-scale), and at its own size on a
   stage drawn at full size. */
.flow-wire-name {
  position: absolute; transform-origin: left bottom; transform: translateY(-100%) scale(var(--name-scale, 1));
  white-space: nowrap; font: 400 var(--text-xs) / 1 var(--sans); color: var(--muted);
}
.flow-wire-name.is-below { transform-origin: left top; transform: scale(var(--name-scale, 1)); }
.flow-edge-label { transform-box: fill-box; transform-origin: center; transform: scale(var(--name-scale, 1)); }
/* An active line is told by its colour: weight never signals state. */
.flow-wire-name.is-active { color: var(--accent-ink); }
.flow-wire-name.is-off { opacity: 0.3; }
.flow-wire-name.is-gone { opacity: 0; }
.flow-place-controls { justify-content: flex-start; }
/* The retrieval figure. A message, and the question the search is given: a short first line that says what it
   is, then its words. Nothing in a column has an outline; a fill sets it off the panel. */
.flow-piece {
  position: relative; display: grid; gap: 3px; justify-items: start; width: 250px; padding: 6px 10px 7px;
  border-radius: var(--radius-sm); background: var(--sunken);
  color: var(--ink);
}
.flow-piece > p { margin: 0; font: 400 var(--text-xs) / 1.4 var(--sans); }
.flow-piece.is-query { width: 240px; }
.flow-thing.is-new .flow-piece, .flow-thing.is-new .flow-passage { background: var(--ok-pale); }
.flow-thing.is-best .flow-passage { background: var(--accent-pale); }
/* A word the question and a passage share, lit while the search compares them. */
.flow-word { font-weight: inherit; border-radius: 2px; }
.is-matched .flow-word { background: var(--accent-pale); box-shadow: 0 0 0 2px var(--accent-pale); }
/* A text as its lines alone: a bar for each line, and on it a mark for each word of the question, lit by the
   search. */
.flow-text { display: grid; gap: var(--line-gap, 2px); justify-items: start; }
.flow-text > i { position: relative; display: block; height: var(--line-bar, 3px); border-radius: 1px; background: var(--line-strong); }
.flow-text b { position: absolute; top: 0; height: 100%; border-radius: 1px; }
.is-matched .flow-text b { background: var(--accent); }
/* A paragraph in the file: its lines, and beside them the numbers of the first and the last. Cut out, it has a
   ground of its own. */
.flow-para {
  display: flex; gap: 8px; width: 176px; padding: 3px 8px; border-radius: var(--radius-sm);
}
.flow-para-n { display: grid; flex: 0 0 18px; align-content: space-between; justify-items: end; }
.flow-para-n i { font: normal 400 var(--text-xs) / 1 var(--mono); color: var(--faint); }
.is-cut .flow-para { background: var(--sunken); }
/* A line of the handbook is as tall as its number, so a number stands beside its line; a heading is a darker line
   and is never cut out. */
.flow[data-flow="retrieval"] .flow-para .flow-text { --line-gap: 6px; }
.flow[data-flow="retrieval"] .flow-para .flow-text > i { margin-block: 5px; }
.flow[data-flow="retrieval"] .flow-para-n { gap: 6px; align-content: start; }
.flow[data-flow="retrieval"] .flow-para-n i { line-height: 13px; }
.flow-para.is-heading .flow-text > i { background: var(--faint); }
/* The tool's result in Context: its role, with the passages it returned inside it. */
.flow-piece.is-result { height: 132px; align-content: start; }
.flow-passage.is-quoted { background: var(--surface); }
/* A passage: the lines it came from, and those lines in small. Its score stands beside it in the search: a bar
   to scale, and the number. */
.flow-passage {
  position: relative; display: grid; align-content: center; justify-items: start; gap: 6px; width: 164px; height: 48px;
  padding: 0 10px; border-radius: var(--radius-sm); background: var(--sunken);
}
.flow .flow-passage .flow-source { text-align: left; color: var(--ink); }
.flow-passage .flow-text { --line-bar: 2px; --line-gap: 1px; }
.flow-score {
  position: absolute; left: calc(100% + 10px); top: 50%; display: flex; align-items: center; gap: 6px;
  transform: translateY(-50%); opacity: 0;
}
.flow-score > i {
  display: block; width: 0; height: 8px; border-radius: 2px; background: var(--fig-store);
  transition: width var(--motion-grow) var(--motion-ease);
}
.flow-score > b { font: 400 var(--text-xs) / 1 var(--mono); color: var(--muted); }
.is-scored .flow-score { opacity: 1; }
.is-scored .flow-score > i { width: var(--w); }
/* What a column says while it holds nothing. */
.flow-piece.is-note { width: auto; padding: 0; background: transparent; color: var(--muted); font: 400 var(--text-xs) / 1.4 var(--sans); }
/* The first stage of the Tools walkthrough. Its left pane is two blocks: Tools, with a card for each tool, over the
   actual functions, each under the card it is registered as. The two blocks share their columns. */
.tw-blocks { display: grid; gap: 8px; }
.tw-block { display: grid; gap: 12px; padding: 14px 16px 16px; border-radius: var(--radius); background: var(--sunken); }
.tw-block h5 { display: flex; align-items: center; gap: 6px; margin: 0; font: 600 var(--text-sm) / 1.3 var(--sans); color: var(--ink); }
.tw-block.is-tools { background: var(--fig-tool-pale); }
.tw-block.is-tools .part-mark { color: var(--fig-tool); }
.tw-cards, .tw-ups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 16px; gap: 8px; align-items: stretch; }
.tw-ups { padding-inline: 17px; color: var(--wire); }
.tw-ups span { display: grid; place-items: center; height: 30px; }
.tw-more { align-self: center; text-align: center; font: 600 var(--text-body) / 1 var(--sans); color: var(--faint); }
/* A tool's name, what it is for and its parameters each have a colour: a box of it on the tool's card, and the same
   box around the lines of the definition that say the same thing. */
.tw-part { border: 1px solid var(--part-line); background: var(--part-pale); }
.tw-part.is-name { --part-line: var(--fig-model-line); --part-pale: var(--fig-model-pale); }
.tw-part.is-does { --part-line: color-mix(in srgb, var(--ok) 45%, var(--surface)); --part-pale: var(--ok-pale); }
.tw-part.is-takes { --part-line: var(--fig-store-line); --part-pale: var(--fig-store-pale); }
.tw-card > .tw-part { padding: 5px 8px; border-radius: var(--radius-sm); }
.tw-code-line.tw-part { margin-inline: -8px; padding-inline: calc(7px + var(--hang-at)) 7px; border-block: 0; }
.tw-code-line.tw-part.is-first { margin-top: 4px; padding-top: 2px; border-top: 1px solid var(--part-line); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.tw-code-line.tw-part.is-last { margin-bottom: 4px; padding-bottom: 2px; border-bottom: 1px solid var(--part-line); border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.tw-code-line.tw-part.is-first.is-last { border-radius: var(--radius-sm); }
/* What Tools holds for one tool: its name, what it is for, its parameters. A card is a button: the one picked has the
   accent ring, and its definition stands on the right. */
.tw-card { display: grid; gap: 6px; align-content: start; padding: 10px; border-radius: var(--radius-sm); background: var(--surface); }
.tw-card, .tw-fn { border: 0; font: inherit; text-align: left; color: inherit; cursor: pointer; box-shadow: 0 0 0 1px transparent; }
.tw-card:hover, .tw-fn:hover { box-shadow: 0 0 0 1px var(--line-strong); }
.tw-card.is-picked, .tw-fn.is-picked { box-shadow: 0 0 0 2px var(--accent); }
.tw-pick-hint { margin-left: auto; font: 400 var(--text-xs) / 1.3 var(--sans); color: var(--muted); }
.tw-scene.is-picked .tw-card { animation: none; opacity: 1; }
.tw-card-name { font: 600 var(--text-sm) / 1.3 var(--mono); color: var(--ink); }
.tw-card .is-does { min-height: 2.8em; margin: 0; font: 400 var(--text-sm) / 1.4 var(--sans); color: var(--ink); }
.tw-card-takes { display: grid; min-height: 2.9em; align-content: start; font: 400 var(--text-xs) / 1.45 var(--mono); color: var(--muted); }
/* A function as a thing: the language's mark and its name. */
.tw-fn {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; padding: 9px 8px;
  border-radius: var(--radius-sm); background: var(--surface); white-space: nowrap;
}
.tw-fn code { font: 400 var(--text-sm) / 1.3 var(--mono); color: var(--ink); }
.tw-py { flex: none; color: var(--accent-ink); }
/* The cards arrive one after another, each from the function under it. */
.tw-card { opacity: 0; animation: tw-register 520ms cubic-bezier(0.16, 1, 0.3, 1) forwards; animation-delay: calc(500ms + var(--i) * 450ms); }
@keyframes tw-register { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tw-card { animation: none; opacity: 1; } }
/* A stage with no line over or under its panes: the panes take that room, so the controls do not move, and what
   the panes hold stands in the middle of it. */
.tw-scene.has-no-note .tw-panes { height: 435px; border-bottom: 0; }
.tw-scene.has-no-title .tw-panes { border-top: 0; }
.tw-scene.has-no-note.has-no-title .tw-panes { height: 495px; }
.tw-scene.has-no-title .tw-pane { display: grid; align-content: center; }
/* The first stage's left pane refits to its width. Where three cards have room for their widest name, they stand
   side by side over the functions they are registered as; narrower, each card is a row (its name and parameters on
   one line, what it is for under them), one arrow stands for all three, and the functions stand in one row under it. */
.tw-pane.is-registry { container-type: inline-size; }
@container (max-width: 470px) {
  .tw-block { gap: 10px; }
  .tw-block.is-tools .tw-cards { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .tw-card { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 4px 8px; padding: 6px; }
  .tw-card > .tw-part { padding-block: 3px; }
  .tw-card > .tw-card-name { grid-area: 1 / 1; }
  .tw-card > .tw-card-takes { grid-area: 1 / 2; display: flex; flex-wrap: wrap; gap: 0 10px; justify-self: start; min-height: 0; }
  .tw-card > .is-does { grid-area: 2 / 1 / 3 / 3; min-height: 0; }
  .tw-block.is-tools .tw-more { text-align: left; line-height: 0.6; }
  .tw-ups { grid-template-columns: minmax(0, 1fr); }
  .tw-ups span { height: 20px; }
  .tw-ups span:not(:first-child) { display: none; }
  .tw-block:not(.is-tools) .tw-cards { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .tw-fn { gap: 6px; padding: 8px; }
  .tw-fn code { font-size: var(--text-xs); }
  .tw-block:not(.is-tools) .tw-more { flex: none; width: 16px; }
}
/* The definition shown, over every other laid unseen in one cell, so the pane is as tall as the longest. */
.tw-definitions { display: grid; min-width: 0; }
.tw-definitions > * { grid-area: 1 / 1; min-width: 0; }
.tw-definitions > .is-unseen { visibility: hidden; }
@media (max-width: 720px) {
  .tw-scene.has-no-note .tw-panes { grid-template-rows: 285px 465px; height: 750px; }
  .tw-scene.has-no-note.has-no-title .tw-panes { grid-template-rows: 331px 511px; height: 842px; }
}
/* Where the walkthrough is too narrow for two panes side by side, as on a phone or beside the sidebar at a small
   window, the panes stand one over the other, and every stage keeps the height of the first, whose cards and
   definition both stand whole (below). */
.tools-walkthrough { position: relative; container: tools-walkthrough / inline-size; }
/* The stage just left, laid over the new one where it stood while it fades out, its cards as they were. */
.tw-ghost { position: absolute; z-index: 1; margin: 0; pointer-events: none; background: var(--surface); }
.tw-ghost .tw-card { animation: none; opacity: 1; }
/* The held foot's sentence shows only where the panes stand one over the other (below). */
.tw-said { display: none; }
.flow-said-now > p.tw-said-ghost { visibility: visible; background: var(--surface); pointer-events: none; }
@container tools-walkthrough (max-width: 600px) {
  /* Here the walkthrough is taller than a phone's screen, so a stage's title stands in the foot it holds, over the
     transport, and the scene is the panes and the note (R8-02). Each pane is as tall as what it holds and the note
     stands under them, so what a stage shows stands together in the room the foot leaves: "Return the result" needs
     443px, where panes of 480 and 440px left the return value above the screen (R9-02). The scene keeps the height
     of the first stage, its tallest, at every stage, so the slack stands under the note and the transport stays. */
  .tw-scene { min-height: 996px; }
  .tw-scene-heading { display: none; }
  .tw-said { display: grid; padding-inline: 16px; }
  .tw-said::before { left: 16px; right: 16px; }
  .tw-note { min-height: 0; padding: 12px 16px; }
  .tw-pane { padding: 16px; }
  .tw-pane + .tw-pane { border-left: 0; border-top: 1px solid var(--line); }
  .tw-panes, .tw-scene.has-no-note .tw-panes, .tw-scene.has-no-note.has-no-title .tw-panes {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; height: auto; border-top: 0;
  }
  /* The request's four definitions scroll in their pane, which leaves the messages over it and the note under it
     the room of a 390x844 screen. */
  .tw-pane[data-scroll-name="tools"] { max-height: 300px; }
}
