/* What a lesson says before and after its figure, without motion: a heading with a line beside it, a sentence or
   two, and a still figure. The figures share the flow figures' marks, class colours and message rows. */
.lead-in { max-width: 1049px; }
.lead-section { padding-bottom: 28px; }
/* A section that is a heading alone hands the reader the panel under it, and stands 12 over it. */
.lead-section.is-handover { padding-bottom: 0; }
.lead-section.is-handover > .lead-heading { margin-bottom: 0; }
.lead-in:has(> .lead-section.is-handover:last-child) { margin-bottom: 12px; }
.lead-section + .lead-section, .lead-in.is-after .lead-section:first-child { padding-top: 28px; border-top: 1px solid var(--line); }
.lead-in.is-after { margin-top: 28px; }
.lead-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 10px; }
.lead-heading h2 { margin: 0; font-size: var(--text-lg); font-weight: 600; line-height: 1.3; }
.lead-heading p { margin: 0; font-size: var(--text-sm); color: var(--muted); }
.lead-text { margin: 0; max-width: var(--measure); font-size: var(--text-body); line-height: 1.55; }
.lead-text strong { font-weight: 600; color: var(--ink); }
.lead-text code, .lead-note code {
  font: 400 var(--text-xs) / 1 var(--mono);
  color: var(--ink);
  padding: 1px 4px; border-radius: calc(var(--radius-sm) / 2); background: var(--stage);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
/* A still figure, a table among them, stands on the page with no frame. A figure that is played or operated (a
   control in it, or a round trip, a stream or a flow line that keeps playing) is a card. */
.lead-figure { display: grid; gap: 14px; margin-top: 18px; }
.lead-figure:has(button, input, select, [role="tab"], .sf-trip, .sf-stream, .sf-flowline) {
  padding: 20px 24px; border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--raise); outline: 1px solid transparent;
}
.lead-figure > .sf-map:only-child:not(:has(.sf-trip, .sf-stream, .sf-flowline)) { margin-inline: 0; }
.lead-note {
  max-width: var(--measure); margin: 14px 0 0; padding-left: 12px; border-left: 1px solid var(--line-strong);
  font-size: var(--text-sm); line-height: 1.5; color: var(--faint);
}
/* A request to scale. The window is a track of the bar's own height with rounded ends, and the request fills it from
   the left; a request that passes its end turns the track red. Rows stand apart, so three rows are three bars. */
.sf-bar-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 72px; align-items: center; gap: 16px; }
.sf-bar-row + .sf-bar-row { margin-top: 6px; }
.sf-bar-label { font: 400 var(--text-sm) / 1.3 var(--sans); color: var(--ink); }
.sf-bar { position: relative; display: flex; height: 22px; border-radius: 6px; }
.sf-bar::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: var(--window);
  border-radius: 6px; background: var(--sunken);
}
.sf-bar.is-over::before { background: var(--danger-pale); }
.sf-seg { position: relative; flex: none; height: 100%; box-shadow: inset -2px 0 var(--surface); }
.sf-bar > .sf-seg:first-child { border-radius: 6px 0 0 6px; }
.sf-bar > .sf-seg:last-child { border-radius: 0 3px 3px 0; box-shadow: none; }
.sf-bar > .sf-seg:only-child { border-radius: 6px 3px 3px 6px; }
.sf-seg.is-system { background: var(--actor-runtime-fill, var(--line-strong)); }
.sf-seg.is-user { background: var(--actor-you-fill, var(--fig-you-line)); }
.sf-seg.is-assistant { background: var(--actor-model-fill, var(--fig-model-line)); }
.sf-seg.is-tool, .sf-seg.is-tools { background: var(--actor-tool-fill, var(--fig-tool-line)); }
/* A notice is an entry the runtime adds, so it takes the runtime's grey, paler than the system prompt's. */
.sf-seg.is-notice { background: color-mix(in srgb, var(--actor-runtime-fill, var(--line-strong)) 45%, var(--surface)); }
.sf-seg.is-messages { background: var(--actor-model-fill, var(--fig-model-line)); }
.sf-seg.is-needed { background: var(--actor-session-fill, var(--fig-store-line)); }
.sf-seg.is-unrelated { background: color-mix(in srgb, var(--actor-session-fill, var(--fig-store-line)) 40%, var(--surface)); }
.sf-seg.is-gap { box-shadow: none; }
/* A picture about what a request holds, not about its limit, has no window behind it. */
.sf-bar.is-open::before { content: none; }
.sf-seg.is-window { border-radius: 2px; background: var(--sunken); box-shadow: none; }
.sf-seg[data-name]::after {
  content: attr(data-name); position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden;
  white-space: nowrap; font: 400 var(--text-xs) / 1 var(--sans); color: var(--series-ink, var(--ink));
}
/* A segment names itself only where its whole name fits, as measured once it is drawn (lead-ins.mjs `fitStills`); a
   narrower one leaves its part to the legend, so no name is shown cut. Until then, one too narrow for any name shows
   none. */
.sf-bar > .sf-seg[data-name] { container-type: inline-size; }
@container (width < 42px) { .sf-bar > .sf-seg[data-name]::after { visibility: hidden; } }
.sf-bar > .sf-seg.is-unnamed::after { visibility: hidden; }
.sf-bar-note { font: 400 var(--text-xs) / 1.3 var(--sans); color: var(--muted); }
.sf-bar-note.is-over { font-weight: 600; color: var(--danger); }
.sf-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 6px; padding-left: 166px; font: 400 var(--text-xs) / 1.3 var(--sans); color: var(--muted); }
.sf-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sf-legend .sf-seg { width: 10px; height: 10px; border-radius: 3px; box-shadow: none; }
.sf-legend .sf-seg.is-window { width: 22px; box-shadow: inset 0 0 0 1px var(--line-strong); }
.sf-legend .sf-seg.is-listed { box-shadow: inset 0 0 0 1px var(--accent); }
/* Message rows, and two lists set beside each other with an arrow between them. */
.sf-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; align-content: start; min-width: 0; }
.sf-list h4 { margin: 0 0 4px; font: 600 var(--text-sm) / 1.3 var(--sans); color: var(--ink); }
/* A row's text wraps rather than being cut, so a narrow column keeps every word; the chip and the size stand on its
   first line. The chip column is one width, as wide as `assistant`, so every row's text starts at one edge. */
.sf-row {
  display: flex; align-items: baseline; gap: 10px; min-height: 28px; padding: 4px 10px; border-radius: var(--radius-sm);
  background: var(--sunken); font: 400 var(--text-xs) / 1.45 var(--mono); color: var(--ink);
}
/* The chip column is as wide as the widest role, assistant, so every row's words start at one place. */
.sf-row .player-chip, .sf-name { flex: 0 0 84px; text-align: center; }
.sf-name { font: 400 var(--text-xs) / 1.3 var(--sans); color: var(--muted); }
.sf-row > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
.sf-row small { flex: none; margin-left: auto; padding-left: 12px; white-space: nowrap; font: 400 var(--text-xs) / 1.3 var(--sans); color: var(--muted); }
.sf-compare { display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr); align-items: center; gap: 16px; }
.sf-arrow { display: grid; justify-items: center; gap: 4px; color: var(--wire); }
.sf-arrow small { font: 400 var(--text-xs) / 1.2 var(--sans); color: var(--muted); white-space: nowrap; }
.sf-arrow svg { width: 64px; height: 10px; }
.sf-arrow path { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
/* A part of the runtime, as the flow figures draw it, its name at their size. */
.sf-part {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface);
  font: 600 var(--text-sm) / 1.2 var(--sans); color: var(--ink); white-space: nowrap;
}
.sf-part.c-runs { border-color: var(--fig-model-line); background: var(--fig-model-pale); }
.sf-part.c-data { border-color: var(--fig-store-line); background: var(--fig-store-pale); }
.sf-part.c-reach { border-color: var(--fig-tool-line); background: var(--fig-tool-pale); }
.sf-part.c-yours { border-color: var(--fig-you-line); background: var(--fig-you-pale); }
.sf-part.c-runs .part-mark { color: var(--fig-model); }
.sf-part.c-data .part-mark { color: var(--fig-store); }
.sf-part.c-reach .part-mark { color: var(--fig-tool); }
.sf-part.c-yours .part-mark { color: var(--fig-you); }
.sf-part.is-outside { border-color: var(--fig-group-line); background: var(--fig-outside-fill); }
.sf-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.sf-columns.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
/* Lists of messages set side by side, in columns or with an arrow between two (`is-rows`): a row's words wrap
   rather than end in an ellipsis, and where a phone has no room for two the lists stand one under another, the
   arrow between them turned down. */
:is(.sf-columns, .sf-compare.is-rows) .sf-row > span:nth-child(2) { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .sf-columns, .sf-columns.is-two, .sf-compare.is-rows {
    grid-template-columns: minmax(0, 1fr); gap: 20px;
  }
  .sf-compare.is-rows > .sf-arrow {
    grid-auto-flow: column; justify-content: start; align-items: center; gap: 10px; padding-left: 20px;
  }
  .sf-compare.is-rows > .sf-arrow small { order: 2; }
  .sf-compare.is-rows > .sf-arrow svg { width: 32px; margin: 11px -11px; transform: rotate(90deg); }
}
/* A file as text. Lines marked `listed` and `body` are the two parts of a skill. */
.sf-doc { display: grid; gap: 2px; max-width: 520px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--sunken); }
.sf-doc h4 { margin: 0 0 8px; font: 600 var(--text-xs) / 1.3 var(--mono); color: var(--muted); }
/* On a small phone (360px) a file keeps less room at its sides, so a long name, as a test's, stands whole in it. */
@media (max-width: 380px) { .sf-doc { padding-inline: 10px; } }
.sf-doc span { min-height: 20px; padding: 1px 8px; border-radius: 2px; font: 400 var(--text-xs) / 1.5 var(--mono); color: var(--ink); }
.sf-doc .is-listed, .sf-seg.is-listed { background: var(--accent-pale); }
/* A name written on a listed segment takes the accent's ink, which reads on its pale fill in both themes. */
.sf-seg.is-listed[data-name]::after { color: var(--accent-ink); }
.sf-doc .is-body, .sf-seg.is-body { background: color-mix(in srgb, var(--wire) 18%, transparent); }
.sf-doc .is-body { color: var(--muted); }
/* What stands for the lines not shown is a note about the file, not a line of it: no ground, and the sans. */
.sf-doc .is-more { font-family: var(--sans); color: var(--faint); }
/* Two or more things set side by side. The columns are set, not drawn from the words (`table-layout: fixed`): the
   row names' column takes the share its table gives it (`--name-share`, lesson-resources.mjs), about a quarter, and
   the value columns share the rest equally, so alternatives always compare at one width; a verdict, a short answer
   beside its grounds, takes only what its words need. Where the table is narrow, in a pair or on a phone, the names
   take half as much again, and beside a verdict no more than its grounds keep (`--name-narrow`). A row is 14 over
   and under its words, and a long word or a piece of code wraps inside its cell. Each value column opens with the 24
   that parts it from the column before, so every value has one measure. */
.sf-table {
  width: 100%; border-collapse: collapse; table-layout: fixed; font: 400 var(--text-sm) / 1.55 var(--sans);
}
.sf-table th, .sf-table td {
  padding: 14px 0 14px 24px; text-align: left; vertical-align: top; border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.sf-table :is(th, td):first-child { padding-left: 0; }
/* The column names are 600 over a stronger rule; the row names are names, in ink at 600. */
.sf-table thead th {
  padding-top: 0; padding-bottom: 10px; border-top: 0; border-bottom: 1px solid var(--line-strong);
  font-weight: 600; color: var(--ink);
}
.sf-table thead th:first-child { width: var(--name-share, 22%); }
/* A verdict column takes the share its longest line needs (`--verdict-share`, lesson-resources.mjs, verdictShare),
   so its grounds have the room it does not use. */
.sf-table thead th[data-verdict] { width: var(--verdict-share); }
@container (max-width: 640px) {
  .sf-table thead th:first-child { width: var(--name-narrow, calc(var(--name-share, 22%) * 1.5)); }
}
@media (max-width: 600px) {
  .sf-table thead th:first-child { width: var(--name-narrow, calc(var(--name-share, 22%) * 1.5)); }
}
.sf-table tbody tr:first-child > * { border-top: 0; }
.sf-table tbody th { font-weight: 600; color: var(--ink); }
/* A table stands on the page, so a rule closes it under its last row as a hairline parts each row from the next. */
.sf-table tbody tr:last-child :is(th, td) { border-bottom: 1px solid var(--line); }
/* On a phone a table of three or more columns stands as one block per row, between the same rules: the row's name
   as its title, a size larger, then each value under the name of its column, so no column is cut and every value
   keeps its heading; where every value is a few words (`is-compact`), two stand side by side. The first column's
   name is a small line of its own over the row's name. The column names stay in the table for a screen reader. The
   doubled class and `:nth-child(n)` outrank the rules a wide table sets on its last row. */
@media (max-width: 600px) {
  .sf-table.is-stacking, .sf-table.is-stacking :is(tbody, tfoot) { display: block; }
  .sf-table.is-stacking thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .sf-table.is-stacking tr { display: grid; gap: 12px; padding: 18px 0 20px; border-top: 1px solid var(--line); }
  .sf-table.is-stacking > tbody > tr:first-child { border-top-color: var(--line-strong); }
  .sf-table.is-stacking > tbody > tr:last-child { border-bottom: 1px solid var(--line); }
  .sf-table.is-stacking.is-stacking > :is(tbody, tfoot) > tr:nth-child(n) > :is(th, td) {
    display: block; width: auto; padding: 0; border: 0; white-space: normal;
  }
  .sf-table.is-stacking tbody th { font-weight: 600; font-size: var(--text-body); color: var(--ink); }
  .sf-table.is-stacking.is-compact tr { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .sf-table.is-stacking.is-compact tr > :is(th, td[colspan]) { grid-column: 1 / -1; }
  .sf-table.is-stacking :is(th, td)[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 3px; font: 400 var(--text-xs) / 1.4 var(--sans);
    color: var(--muted);
  }
}
.sf-row.is-bad { background: var(--danger-pale); color: var(--danger); }
.sf-row.is-warn { background: var(--warn-pale); }
/* The time axis of Updates & expiry: a column per day, a row per key, a save as a bar from the day it is made to
   the day something ends it, and "now" as a line across the rows. The days and the slider under them scroll
   together inside the card where a phone leaves the week too little room; what a search finds stays in view. */
.ta-body { display: grid; gap: 20px; padding: 24px; }
.ta-scroll { --key: 112px; display: grid; gap: 20px; min-width: 0; }
.ta-grid {
  position: relative; display: grid; grid-template-columns: var(--key) repeat(7, minmax(0, 1fr)); align-items: center;
  gap: 10px 0; --col: calc((100% - var(--key)) / 7);
}
.ta-corner, .ta-day { font: 400 var(--text-xs) / 1.3 var(--sans); color: var(--muted); }
.ta-day { padding-left: 8px; border-left: 1px solid var(--line); }
.ta-day.is-now { color: var(--accent-ink); }
.ta-key { grid-column: 1; font: 400 var(--text-sm) / 1.3 var(--mono); color: var(--ink); }
.ta-track { grid-column: 2 / -1; height: 40px; border-radius: var(--radius-sm); background: var(--sunken); }
/* A save is opaque and stands over "now", so the line shows on the track between saves and never crosses a word. */
.ta-save {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-width: 0; height: 32px; margin: 0 2px; padding: 0 10px; overflow: hidden; border-radius: var(--radius-sm);
  background: var(--fig-store-pale); white-space: nowrap;
}
.ta-save b {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; font: 400 var(--text-xs) / 1.2 var(--mono); color: var(--ink);
}
.ta-save small { flex: none; font: 400 var(--text-xs) / 1.2 var(--sans); color: var(--muted); }
.ta-save.is-expired small, .ta-save.is-deleted small { color: var(--danger); }
.ta-now {
  position: absolute; top: 22px; bottom: -6px; left: calc(var(--key) + var(--col) * var(--now) + 2px); width: 0;
  border-left: 2px solid var(--accent); transition: left 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
/* The slider's thumb stands on "now": the track runs from the first day's line to the last one's, and reaches past
   each by half the thumb, which a range input keeps inside its ends. */
.ta-slider { display: grid; grid-template-columns: var(--key) minmax(0, 1fr); align-items: center; }
.ta-slider span { font: 400 var(--text-xs) / 1.3 var(--sans); color: var(--muted); }
.ta-slider input {
  width: calc(100% / 7 * 6 + 16px); height: 16px; margin: 0 0 0 -5px; appearance: none; -webkit-appearance: none;
  background: transparent;
}
.ta-slider input::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--accent) var(--fill, 0%), var(--stage) var(--fill, 0%));
}
.ta-slider input::-moz-range-track { height: 6px; border-radius: 3px; background: var(--stage); }
.ta-slider input::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
.ta-slider input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px; border: 1.5px solid var(--accent);
  border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-xs);
}
.ta-slider input::-moz-range-thumb {
  width: 16px; height: 16px; border: 1.5px solid var(--accent); border-radius: 50%; background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.ta-slider input:focus-visible { outline: none; }
.ta-slider input:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
}
.ta-slider input:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
}
.ta-results h3 { margin: 0 0 8px; font: 600 var(--text-sm) / 1.3 var(--sans); }
.ta-results [data-results] { display: grid; gap: 6px; }
.ta-result {
  display: grid; grid-template-columns: 100px 240px minmax(0, 1fr); align-items: baseline; gap: 12px; min-height: 36px;
  padding: 8px 12px; border-radius: var(--radius-sm); background: var(--accent-pale);
}
.ta-result strong { font: 600 var(--text-sm) / 1.3 var(--mono); color: var(--ink); }
.ta-result > span:last-child { font: 400 var(--text-sm) / 1.4 var(--sans); color: var(--muted); }
.ta-result.is-nothing { background: var(--sunken); }
.ta-result.is-nothing strong { font-family: var(--sans); font-weight: 400; color: var(--muted); }
/* Where a day is too narrow for a save's words and its ending side by side, the ending stands under the words: in a
   card narrower than 1020px, whatever the window, since the sidebar's width changes the column's. */
.time-axis { container: time-axis / inline-size; }
@container time-axis (max-width: 1020px) {
  .ta-track { height: 52px; }
  .ta-save { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; height: 46px; }
}
/* On a phone the week keeps a readable width and scrolls under the keys, which stay; a save's state stands under
   its words. A result is its key and what was found on one line, and why under them. */
@media (max-width: 600px) {
  .ta-body { padding: 20px 16px; }
  .ta-scroll { --key: 84px; overflow-x: auto; padding-bottom: 4px; }
  .ta-scroll > * { min-width: 712px; }
  :is(.ta-corner, .ta-grid > .ta-key, .ta-slider > span) {
    position: sticky; left: 0; z-index: 2; align-self: stretch; display: flex; align-items: center;
    background: var(--surface);
  }
  /* A key pinned over the days fades into them, so a save that scrolls under it fades out at its edge rather than
     standing cut as a stray letter. */
  :is(.ta-corner, .ta-grid > .ta-key, .ta-slider > span)::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: 100%; width: 16px; pointer-events: none;
    background: linear-gradient(to right, var(--surface), transparent);
  }
  .ta-save {
    flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; height: 36px; padding: 0 8px;
  }
  .ta-result { grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; }
  .ta-result > span:last-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { .ta-now { transition: none; } }
/* On the first lesson's page the section stands above the workbench: its heading, the two parts, one sentence. */
.request-embedded .lead-in { margin: 0 0 20px; }
.request-embedded .lead-section { padding-bottom: 0; }
/* The picture's card keeps the gap a section leaves over the rule under it. */
.request-embedded .lead-section.is-figure-first { padding-bottom: 28px; }
/* A section may put its figure before its sentence, when the picture is the definition. */
.lead-section.is-figure-first .lead-figure { margin: 4px 0 16px; }
/* A section that ends on the sentence handing over what follows stands close to it. */
.lead-section.is-figure-first { padding-bottom: 20px; }
/* A played figure, then the sentence that hands over to the panel under it: a hairline parts the two, so the
   definition and the part to try are two things. */
.lead-section.is-figure-first > .lead-figure:has(button, input, select, [role="tab"], .sf-trip, .sf-stream, .sf-flowline) { margin-bottom: 0; }
.lead-section.is-figure-first > .lead-figure:has(button, input, select, [role="tab"], .sf-trip, .sf-stream, .sf-flowline) + .lead-text {
  margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line);
}
.sf-compare + .sf-legend { padding-left: 0; }
.sf-doc + .sf-legend { padding-left: 0; }
/* A picture of two or three parts is a small figure: as wide as its parts, not as the page. */
.lead-section.is-figure-first .lead-figure, .lead-figure.is-small { width: fit-content; }
.lead-section.is-figure-first .lead-figure:has(button, input, select, [role="tab"], .sf-trip, .sf-stream, .sf-flowline),
.lead-figure.is-small:has(button, input, select, [role="tab"], .sf-trip, .sf-stream, .sf-flowline) { padding: 16px 20px; }
.lead-figure.is-small { margin: 0 0 18px; }
/* On a phone a small picture's card takes the column's width, as every card under it does, the picture centred. */
@media (max-width: 600px) {
  .lead-section.is-figure-first .lead-figure:has(button, input, select, [role="tab"], .sf-trip, .sf-stream, .sf-flowline),
  .lead-figure.is-small:has(button, input, select, [role="tab"], .sf-trip, .sf-stream, .sf-flowline) {
    width: auto; justify-items: center;
  }
}
.lead-text + .lead-figure.is-small { margin-top: 14px; }
/* A picture that stands on the page with no frame, under the sentence it shows. */
.lead-figure.is-plain { padding: 0; border: 0; border-radius: 0; background: transparent; }
.lead-text + .lead-figure.is-plain { margin-top: 20px; }
/* A sentence after a picture, leading on to the next section. */
.lead-figure + .lead-text.is-then { margin-top: 20px; }
/* Folders and files, a step in for each level; the file the figure opens beside them is marked. */
.sf-tree { display: grid; gap: 4px; align-content: start; min-width: 150px; }
.sf-tree h4 { margin: 0 0 6px; font: 600 var(--text-sm) / 1.3 var(--sans); color: var(--ink); }
.sf-tree span {
  display: flex; align-items: center; gap: 8px; margin-left: calc(var(--depth) * 18px); padding: 2px 8px 2px 4px;
  border-radius: 2px; font: 400 var(--text-xs) / 1.5 var(--mono); color: var(--ink); white-space: nowrap;
}
.sf-tree svg { flex: none; color: var(--muted); }
.sf-tree .is-open { background: var(--accent-pale); }
.sf-tree .is-more { padding-left: 6px; color: var(--faint); }
/* A file the reader can open: it reads as a link, and the one open is marked. */
.sf-tree label {
  display: flex; align-items: center; gap: 8px; margin-left: calc(var(--depth) * 18px); padding: 2px 8px 2px 4px;
  border-radius: 2px; font: 400 var(--text-xs) / 1.5 var(--mono); color: var(--accent-ink); white-space: nowrap;
  text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 3px; cursor: pointer;
}
.sf-tree label svg { color: var(--accent-ink); }
.sf-tree label:hover { background: var(--hover); }
.sf-tree label:has(input:checked) { background: var(--accent-pale); text-decoration-color: transparent; }
.sf-tree label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.sf-tree input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
/* The files that can be opened lie on one another, each as large as the largest, so opening one moves nothing.
   Whatever carries the number of the file that is open shows; up to three files. */
.sf-stack { display: grid; min-width: 0; }
.sf-stack > * { grid-area: 1 / 1; min-width: 0; visibility: hidden; }
.sf-compare:has(input[value="0"]:checked) .sf-stack > [data-pick="0"],
.sf-compare:has(input[value="1"]:checked) .sf-stack > [data-pick="1"],
.sf-compare:has(input[value="2"]:checked) .sf-stack > [data-pick="2"] { visibility: visible; }
/* A request as its messages, with the lines a message is given set inside it. The line of the open file is ringed. */
.sf-group { display: grid; gap: 2px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.sf-group > .sf-row { border-radius: 2px; }
.sf-row.is-listed { background: var(--accent-pale); }
.sf-compare:has(input[value="0"]:checked) .sf-row[data-pick="0"],
.sf-compare:has(input[value="1"]:checked) .sf-row[data-pick="1"],
.sf-compare:has(input[value="2"]:checked) .sf-row[data-pick="2"] { box-shadow: inset 0 0 0 1.5px var(--accent); }
.sf-compare.has-tree { grid-template-columns: auto minmax(0, 1.25fr) 96px minmax(0, 1fr); gap: 16px 24px; align-items: start; }
.sf-compare.has-tree > .sf-arrow, .sf-compare.has-tree > .sf-list { align-self: center; }
/* Where the column is too narrow to set pictures side by side, they stand one under another, at the column's width.
   The arrow between two turns to point down, and its name stands beside it, between the two pictures and over
   neither. */
@media (max-width: 600px) {
  .sf-columns, .sf-columns.is-two { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .sf-compare, .sf-compare.is-right-wide, .sf-compare.has-tree { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .sf-compare > .sf-arrow {
    display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 12px;
    justify-self: start; padding-left: 20px;
  }
  .sf-compare > .sf-arrow svg { width: 32px; margin-block: 11px; transform: rotate(90deg); }
  .sf-compare.has-tree > .sf-tree { min-width: 0; }
}
/* Small pictures side by side, each under a short name and with no frame: one line stands between two. They stand
   side by side while there is room, two of 400 and the gap between them; with less, one stands under the other and
   the line is over the second. A row that wraps needs no query and no size containment, which a browser can resolve
   to no width at all and so lay the pictures over each other: each picture draws a line in the gap before it and
   one in the gap above it, and the box clips the lines that fall outside it, before a first picture or above a first
   row. A picture wider than a phone scrolls inside the box. */
.sf-sides { display: flex; flex-wrap: wrap; gap: 48px; overflow-x: auto; }
.sf-side { position: relative; flex: 1 1 400px; min-width: 0; display: grid; gap: 12px; align-content: start; }
.sf-side::before, .sf-side::after { content: ""; position: absolute; }
.sf-side::before { inset: 0 auto 0 -24.5px; border-left: 1px solid var(--line); }
.sf-side::after { inset: -24.5px 0 auto; border-top: 1px solid var(--line); }
.sf-side > .sf-map { justify-self: start; margin-inline: 0; }
.sf-side > h4 { margin: 0; font: 600 var(--text-sm) / 1.3 var(--sans); color: var(--ink); }
/* Parts stood as the home map stands them, with the arrows between neighbours and a name on each arrow's outer
   side. Every part in such a picture is one width. The margin holds the names over the first row and under the last.
   A block wider than it is tall is turned on a phone, its columns standing as rows, so it keeps its size; whatever
   is still wider than the column is scaled to it (fitStills in lead-ins.mjs). */
.sf-map { position: relative; width: var(--w); height: var(--h); margin: 10px 8px; }
.sf-map > .sf-spot { left: var(--x); top: var(--y); }
.sf-map > .is-tall { display: none; }
@media (max-width: 600px) {
  .sf-map.can-turn { width: var(--tw); height: var(--th); }
  .sf-map.can-turn > .sf-spot { left: var(--tx); top: var(--ty); }
  .sf-map.can-turn > .is-wide { display: none; }
  .sf-map.can-turn > .is-tall { display: revert; }
}
/* A picture of a few parts alone in a section has a frame as wide as the parts and no wider. */
.lead-figure:has(> .sf-map:only-child) { width: fit-content; }
.sf-map > svg { position: absolute; inset: 0; overflow: visible; }
.sf-map > svg path { fill: none; stroke: var(--wire); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sf-spot { position: absolute; display: grid; width: 148px; }
/* A name longer than its part takes a second line inside it, rather than running past the part's edge. */
.sf-spot > .sf-part { padding-inline: 8px; white-space: normal; text-align: center; }
/* The part a picture is about has its class's full colour and a deeper ground, as a part in use has in a flow
   figure, and a few words under it for what it does there. A part the picture does without is faded. */
.sf-map > .sf-spot.is-idle { opacity: 0.4; }
.sf-spot.is-on > .sf-part.c-runs { border-color: var(--fig-model); background: var(--fig-model-active); }
.sf-spot.is-on > .sf-part.c-data { border-color: var(--fig-store); background: var(--fig-store-active); }
.sf-spot.is-on > .sf-part.c-reach { border-color: var(--fig-tool); background: var(--fig-tool-active); }
.sf-spot.is-on > .sf-part.c-yours { border-color: var(--fig-you); background: var(--fig-you-active); }
.sf-spot.is-on > .sf-part.is-outside { border-color: var(--ink); }
.sf-spot > small { margin-top: 6px; text-align: center; white-space: nowrap; font: 400 var(--text-xs) / 1.2 var(--sans); color: var(--ink); }
.sf-map > small { position: absolute; white-space: nowrap; font: 400 var(--text-xs) / 1.2 var(--sans); color: var(--muted); }
/* What a part holds, inside that part: the part's mark and name, on its own ground. The things in it stand on
   the page's surface, as cards on a table. A picture that is one such part needs no frame round it. */
.sf-held {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; min-width: 0; max-width: 100%;
  padding: 12px 14px 14px; border-radius: var(--radius);
}
.sf-held > h4 { display: flex; align-items: center; gap: 6px; margin: 0; font: 600 var(--text-sm) / 1.3 var(--sans); color: var(--ink); }
.sf-held.c-reach { background: var(--fig-tool-pale); }
.sf-held.c-reach > h4 .part-mark { color: var(--fig-tool); }
.sf-held.c-data { background: var(--fig-store-pale); }
.sf-held.c-data > h4 .part-mark { color: var(--fig-store); }
.sf-held.c-runs { background: var(--fig-model-pale); }
.sf-held.c-runs > h4 .part-mark { color: var(--fig-model); }
.sf-held.c-yours { background: var(--fig-you-pale); }
.sf-held.c-yours > h4 .part-mark { color: var(--fig-you); }
.sf-held .sf-card, .sf-held .sf-row, .sf-held .sf-doc { background: var(--surface); }
.sf-held .sf-list h4 { font-weight: 400; color: var(--muted); }
.lead-figure:has(> .sf-held:only-child) { width: fit-content; max-width: 100%; }
.lead-figure > .sf-held:only-child:has(.sf-list) { min-width: min(640px, 100%); }
/* One picture in several forms. The choices stand over it as one control; the form chosen shows. */
.sf-switch { display: grid; gap: 18px; justify-items: start; }
/* The choices are a track of tabs, as the Code and Run card's are: a pill of `--stage`, and the chosen one raised on
   it, on the surface. */
.sf-forms { display: inline-flex; padding: 3px; border-radius: var(--radius-pill); background: var(--stage); }
.sf-forms label {
  min-height: 28px; padding: 4px 12px; border-radius: var(--radius-pill);
  font: 500 var(--text-sm) / 1.45 var(--sans); color: var(--muted); cursor: pointer;
}
.sf-forms label:hover { color: var(--ink); }
.sf-forms label:has(input:checked) {
  background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--stage-edge), var(--shadow-xs);
}
.sf-forms label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The card that holds the picture is as wide as the lesson's figure under it; the parts keep their places. */
.lead-figure:has(> .sf-switch .sf-flowline) { width: auto; }
.sf-forms input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sf-switch:has(input[value="0"]:checked) .sf-stack > [data-pick="0"],
.sf-switch:has(input[value="1"]:checked) .sf-stack > [data-pick="1"],
.sf-switch:has(input[value="2"]:checked) .sf-stack > [data-pick="2"] { visibility: visible; }
/* Parts in a row and one stream at a time between them. Nothing joins the parts until a stream does: it draws its
   own line and the heads of its arrows, and runs along the border of every part it meets, which rings the part in
   the accent. A stream is a thin solid line of the accent, uncovered from its first part to its last; nothing
   glows, as in every figure, and nothing along it repeats, so it never reads as a dashed line. Its name comes up
   over it as it sets off. When it has arrived it fades and the stream back begins. One cycle is 7.6 seconds. */
.sf-flowline { position: relative; }
/* On a phone the parts stand in a column at their own size, and the stream runs down it: a row scaled to the column
   would leave its words too small to read. */
.sf-flowline.is-tall { display: none; }
@media (max-width: 600px) {
  .sf-flowline.is-wide { display: none; }
  .sf-flowline.is-tall { display: block; }
  .sf-flowline.is-tall > small, .sf-flowline.is-tall .sf-flow-tools .player-chip { font-size: var(--text-xs); }
}
.sf-flowline > svg { position: absolute; inset: 0; z-index: 2; overflow: visible; fill: none; pointer-events: none; stroke-linecap: round; stroke-linejoin: round; }
.sf-flowline .is-stream, .sf-flowline .is-tip { stroke: var(--accent); stroke-width: 2; }
.sf-flowline .is-reveal { stroke: #fff; stroke-width: 56; stroke-linecap: butt; stroke-dasharray: 100; stroke-dashoffset: 100; }
.sf-flowline .is-reveal.is-out { animation: sf-reveal-out 7.6s linear infinite; }
.sf-flowline .is-reveal.is-back { animation: sf-reveal-back 7.6s linear infinite; }
.sf-flowline .sf-run.is-out { animation: sf-run-out 7.6s linear infinite; }
.sf-flowline .sf-run.is-back { opacity: 0; animation: sf-run-back 7.6s linear infinite; }
.sf-flowline > .sf-spot { z-index: 1; }
.sf-flowline > .sf-spot.is-idle { opacity: 0.4; }
/* A stream's name, large enough to be read at a glance: it rises into place as the stream sets off and goes with it. */
.sf-flowline > small {
  position: absolute; z-index: 3; opacity: 0; transform: translate(-50%, -100%); white-space: nowrap;
  font: 600 var(--text-body) / 1.2 var(--sans); color: var(--accent-ink);
}
.sf-flowline > small.is-out { animation: sf-name-out 7.6s linear infinite; }
.sf-flowline > small.is-back { animation: sf-name-back 7.6s linear infinite; }
/* What Tools holds, a tool a line under it. A tool the stream brings drops into the list as the stream arrives. */
.sf-flow-tools { position: absolute; z-index: 1; display: grid; justify-items: start; gap: 6px; width: 148px; padding-left: 8px; }
.sf-flow-tools .player-chip { padding: 3px 8px; font: 400 var(--text-sm) / 1.2 var(--mono); }
.sf-flow-tools .is-new { opacity: 0; animation: sf-register 7.6s linear infinite; animation-delay: calc(var(--i) * 0.3s); }
/* The line sets off slowly, runs and slows into the last part. */
@keyframes sf-reveal-out {
  0% { stroke-dashoffset: 100; animation-timing-function: cubic-bezier(0.4, 0, 0.5, 1); }
  30.3%, 42.1% { stroke-dashoffset: 0; } 42.2%, 100% { stroke-dashoffset: 100; }
}
@keyframes sf-reveal-back {
  0%, 43.4% { stroke-dashoffset: 100; animation-timing-function: cubic-bezier(0.4, 0, 0.5, 1); }
  73.7%, 99.9% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 100; }
}
@keyframes sf-run-out { 0%, 38.2% { opacity: 1; } 42.1%, 99.9% { opacity: 0; } 100% { opacity: 1; } }
@keyframes sf-run-back { 0%, 43.3% { opacity: 0; } 43.4%, 90.8% { opacity: 1; } 96.1%, 100% { opacity: 0; } }
@keyframes sf-name-out {
  0% { opacity: 0; transform: translate(-50%, calc(-100% + 10px)); }
  5.9%, 38.2% { opacity: 1; transform: translate(-50%, -100%); }
  42.1%, 100% { opacity: 0; transform: translate(-50%, -100%); }
}
@keyframes sf-name-back {
  0%, 43.4% { opacity: 0; transform: translate(-50%, calc(-100% + 10px)); }
  49.3%, 90.8% { opacity: 1; transform: translate(-50%, -100%); }
  96.1%, 100% { opacity: 0; transform: translate(-50%, -100%); }
}
@keyframes sf-register {
  0%, 71.7% { opacity: 0; transform: translateY(-10px); }
  77.0%, 90.8% { opacity: 1; transform: none; }
  95.4%, 100% { opacity: 0; transform: none; }
}
/* Without motion the stream out stands whole under its name, and Tools holds every tool.
   A moving picture rests so too once it has played its cycles on the screen (`data-motion="still"`, restLoops). */
@media (prefers-reduced-motion: reduce) {
  .sf-flowline .is-reveal, .sf-flowline .sf-run, .sf-flowline > small, .sf-flow-tools .is-new { animation: none; }
  .sf-flowline .is-reveal.is-out, .sf-flowline > small.is-out, .sf-flow-tools .is-new { stroke-dashoffset: 0; opacity: 1; }
}
.lead-figure[data-motion="still"]
  :is(.sf-flowline .is-reveal, .sf-flowline .sf-run, .sf-flowline > small, .sf-flow-tools .is-new) {
  animation: none;
}
.lead-figure[data-motion="still"]
  :is(.sf-flowline .is-reveal.is-out, .sf-flowline > small.is-out, .sf-flow-tools .is-new) {
  stroke-dashoffset: 0; opacity: 1;
}
/* A moving picture off the screen holds where it is, and goes on from there when it is back; so does one its reader
   has paused with its control. A rule that sets the `animation` shorthand sets the play state too, back to running,
   so the hold outranks every one of them, as the MCP Client's streams' are (R7-01). */
.lead-figure:is([data-motion="paused"], [data-motion="held"]) * { animation-play-state: paused !important; }
/* The control that pauses a moving picture and plays it on: a circle in its card's top right corner, its icon the
   transport's. It stands only where the picture moves by itself. */
.lead-figure:has(> .lead-motion) { position: relative; }
/* A request's round trip reaches its card's top right corner, so its card keeps a row over it for the control. */
.lead-section .lead-figure:has(> .lead-motion):has(.sf-trip) { padding-top: 52px; }
.lead-motion {
  position: absolute; top: 12px; right: 12px; z-index: 2; display: grid; place-items: center; width: 32px; height: 32px;
  min-height: 0; padding: 0; border: 0; border-radius: var(--radius-pill); background: var(--stage); color: var(--ink);
}
.lead-motion:hover { background: var(--stage-edge); }
.lead-motion svg { grid-area: 1 / 1; }
.lead-motion[aria-pressed="true"] .is-pause, .lead-motion:not([aria-pressed="true"]) .is-play { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .lead-motion { display: none; } }
/* Tools as a request offers them, a card each, under where each comes from. The three boxes of a card are the
   three colours the Tools lesson gives a tool's name, what it is for and its parameters. */
.sf-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 820px; max-width: 100%; }
.lead-figure:has(> .sf-tools) { width: fit-content; }
.sf-tool { display: grid; grid-template-rows: auto 1fr; gap: 6px; min-width: 0; }
.sf-tool > small { font: 400 var(--text-xs) / 1.3 var(--sans); color: var(--muted); }
.sf-card { display: grid; gap: 6px; align-content: start; min-width: 0; padding: 10px; border-radius: var(--radius-sm); background: var(--sunken); }
.sf-card > .tw-part { min-width: 0; padding: 5px 8px; border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.sf-card > code:first-child { font: 600 var(--text-sm) / 1.3 var(--mono); color: var(--ink); }
.sf-card > p { margin: 0; font: 400 var(--text-sm) / 1.4 var(--sans); color: var(--ink); }
.sf-card > code:last-child { display: grid; font: 400 var(--text-xs) / 1.45 var(--mono); color: var(--muted); }
/* Pictures that keep moving. What travels is one kind of box, with no outline, on the ground of a quoted value. It
   rides an arrow: it comes out from under the part it leaves and goes in under the part it reaches, so the parts
   stand over it. */
/* A picture wider than its column scrolls inside its frame. */
.lead-figure { max-width: 100%; overflow-x: auto; }
/* A table's links stand at its edges, in a figure that scrolls sideways and so clips them: the figure keeps 4px round
   its table, its table where it stood, so a focused link's ring stands whole (the layout smoke's ring findings). */
.lead-figure:has(> .sf-table) { max-width: calc(100% + 8px); margin-inline: -4px; padding-inline: 4px; }
.sf-stream > .sf-part, .sf-trip > .sf-part { position: relative; z-index: 2; padding-inline: 8px; }
.sf-lane { position: relative; display: grid; align-items: center; height: 44px; margin-inline: 8px; }
.sf-lane > svg:first-of-type { position: absolute; inset: 50% 0 auto; width: 100%; height: 10px; transform: translateY(-50%); }
.sf-lane .sf-lane-head { position: absolute; left: 0; top: 50%; width: 8px; height: 10px; transform: translateY(-50%); }
.sf-lane.is-there > svg:first-of-type { transform: translateY(-50%) scaleX(-1); }
.sf-lane.is-there .sf-lane-head { left: auto; right: 0; transform: translateY(-50%) scaleX(-1); }
.sf-lane path { fill: none; stroke: var(--wire); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sf-box {
  z-index: 1; padding: 5px 10px; border-radius: var(--radius-sm); background: var(--sunken); white-space: pre;
  font: 400 var(--text-sm) / 1.4 var(--mono); color: var(--ink); opacity: 0;
}
/* A request goes and a response comes back, one cycle every 4.4 seconds. */
.sf-trip { display: grid; grid-template-columns: 148px 190px 148px; grid-template-rows: 28px 28px; align-items: center; gap: 4px 0; margin: 2px 4px; }
/* The parts stand as tall as the two arrows together, so a box under one of them is wholly under it. */
.sf-trip > .sf-part { grid-row: 1 / 3; align-self: stretch; }
.sf-trip > .sf-part:first-child { grid-column: 1; }
.sf-trip > .sf-part:last-child { grid-column: 3; }
.sf-trip > .sf-lane { grid-column: 2; height: 28px; }
.sf-there, .sf-back { position: absolute; top: 50%; padding-block: 3px; font-family: var(--sans); }
.sf-there { left: 0; transform: translate(calc(-100% - 8px), -50%); animation: sf-there 4.4s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.sf-back { right: 0; transform: translate(calc(100% + 8px), -50%); animation: sf-back 4.4s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes sf-there {
  0%, 6.82% { opacity: 1; transform: translate(calc(-100% - 8px), -50%); }
  38.64% { opacity: 1; transform: translate(182px, -50%); }
  39.09%, 100% { opacity: 0; transform: translate(182px, -50%); }
}
@keyframes sf-back {
  0%, 49.55% { opacity: 0; transform: translate(calc(100% + 8px), -50%); }
  50% { opacity: 1; transform: translate(calc(100% + 8px), -50%); }
  81.82% { opacity: 1; transform: translate(-182px, -50%); }
  82.27%, 100% { opacity: 0; transform: translate(-182px, -50%); }
}
/* Streaming, one cycle every 4.2 seconds. Pieces leave the model one after another without waiting for the one
   before. Under the Model Client they are one box; whole, it rises behind the Model Client and rides the arrow to
   the Loop while the next pieces are already on their way. The arrows are `--lane` long, so a narrower column can
   shorten them and keep the motion. */
.sf-stream {
  --lane: 190px; display: grid; grid-template-columns: 148px var(--lane) 148px var(--lane) 148px; align-items: center;
  justify-content: safe center; gap: 12px 0; margin: 2px 4px;
}
/* It stands over the workbench it leads into, so its frame takes the workbench's width. */
.lead-section.is-figure-first .lead-figure:has(> .sf-stream) { width: auto; }
.sf-piece {
  position: absolute; right: 0; top: 50%; padding-inline: 5px; transform: translate(54px, -50%);
  animation: sf-piece 4.2s linear infinite; animation-delay: calc(var(--i) * 0.5s);
}
.sf-joined { grid-column: 3; justify-self: center; animation: sf-joined 4.2s linear infinite; animation-delay: 1.65s; }
.sf-joined i { font-style: normal; opacity: 0; animation: 4.2s linear infinite; }
.sf-joined .sf-seg-0 { animation-name: sf-seg-0; animation-delay: 1.65s; }
.sf-joined .sf-seg-1 { animation-name: sf-seg-1; animation-delay: 2.15s; }
.sf-joined .sf-seg-2 { animation-name: sf-seg-2; animation-delay: 2.65s; }
.sf-joined .sf-seg-3 { animation-name: sf-seg-3; animation-delay: 3.15s; }
.sf-joined .sf-seg-4 { animation-name: sf-seg-4; animation-delay: 3.65s; }
@keyframes sf-piece {
  0% { opacity: 1; transform: translate(54px, -50%); }
  42.86% { opacity: 1; transform: translate(calc(8px - var(--lane)), -50%); }
  43.33%, 100% { opacity: 0; transform: translate(calc(8px - var(--lane)), -50%); }
}
@keyframes sf-joined {
  0% { opacity: 0; transform: translate(0, 0); }
  2% { opacity: 1; transform: translate(0, 0); }
  52.38% { opacity: 1; transform: translate(0, 0); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  60.71% { opacity: 1; transform: translate(0, calc(-50% - 34px)); animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
  89.29% { opacity: 1; transform: translate(calc(-148px - var(--lane)), calc(-50% - 34px)); }
  90.48%, 100% { opacity: 0; transform: translate(calc(-148px - var(--lane)), calc(-50% - 34px)); }
}
@keyframes sf-seg-0 { 0% { opacity: 0; } 2%, 90.71% { opacity: 1; } 91.19%, 100% { opacity: 0; } }
@keyframes sf-seg-1 { 0% { opacity: 0; } 2%, 78.81% { opacity: 1; } 79.29%, 100% { opacity: 0; } }
@keyframes sf-seg-2 { 0% { opacity: 0; } 2%, 66.9% { opacity: 1; } 67.38%, 100% { opacity: 0; } }
@keyframes sf-seg-3 { 0% { opacity: 0; } 2%, 55% { opacity: 1; } 55.48%, 100% { opacity: 0; } }
@keyframes sf-seg-4 { 0% { opacity: 0; } 2%, 43.1% { opacity: 1; } 43.57%, 100% { opacity: 0; } }
/* Without motion each picture rests with its boxes on their arrows: a request and a response between the two
   parts, and the whole reply between the Model Client and the Loop, with the reply's first pieces still on the
   Model's arrow, so the picture shows them arriving apart. */
@media (prefers-reduced-motion: reduce) {
  .sf-piece, .sf-joined, .sf-joined i, .sf-there, .sf-back { animation: none; }
  .sf-joined, .sf-joined i, .sf-there, .sf-back { opacity: 1; }
  .sf-joined { transform: translate(calc(-74px - var(--lane) / 2), calc(-50% - 34px)); }
  .sf-there, .sf-back { left: 50%; right: auto; transform: translate(-50%, -50%); }
  .sf-piece { opacity: 1; transform: translate(calc(66px - var(--lane) + var(--i) * 44px), -50%); }
  .sf-piece:nth-child(n + 4) { display: none; }
}
.lead-figure[data-motion="still"] :is(.sf-piece, .sf-joined, .sf-joined i, .sf-there, .sf-back) { animation: none; }
.lead-figure[data-motion="still"] :is(.sf-joined, .sf-joined i, .sf-there, .sf-back) { opacity: 1; }
.lead-figure[data-motion="still"] .sf-joined { transform: translate(calc(-74px - var(--lane) / 2), calc(-50% - 34px)); }
.lead-figure[data-motion="still"] :is(.sf-there, .sf-back) { left: 50%; right: auto; transform: translate(-50%, -50%); }
.lead-figure[data-motion="still"] .sf-piece {
  opacity: 1; transform: translate(calc(66px - var(--lane) + var(--i) * 44px), -50%);
}
.lead-figure[data-motion="still"] .sf-piece:nth-child(n + 4) { display: none; }
/* The two pictures fit the column they stand in. Where it is narrower than the stream's full width, its arrows
   shorten; where it is narrower still, as on a phone, a picture stands upright: the parts one over another and the
   arrows running down between them, so every part stands whole. What travels keeps its timing and goes up or down
   instead of across. */
.lead-section:has(.sf-trip, .sf-stream) { container: moving / inline-size; }
@container moving (max-width: 920px) {
  .sf-stream { --lane: 130px; }
  @media (prefers-reduced-motion: reduce) { .sf-stream .sf-piece:nth-child(n + 3) { display: none; } }
  .lead-figure[data-motion="still"] .sf-stream .sf-piece:nth-child(n + 3) { display: none; }
}
@container moving (max-width: 760px) {
  .sf-stream {
    --lane: 80px; grid-template-columns: 148px auto; grid-template-rows: 44px var(--lane) 44px var(--lane) 44px;
    justify-content: start; gap: 0 16px;
  }
  .sf-stream > :nth-child(1) { grid-area: 1 / 1; }
  .sf-stream > :nth-child(2) { grid-area: 2 / 1; }
  .sf-stream > :nth-child(3) { grid-area: 3 / 1; }
  .sf-stream > :nth-child(4) { grid-area: 4 / 1; }
  .sf-stream > :nth-child(5) { grid-area: 5 / 1; }
  .sf-stream > .sf-joined { grid-area: 3 / 2; justify-self: start; align-self: center; animation-name: sf-joined-up; }
  .sf-stream .sf-piece { left: 50%; right: auto; top: 0; transform: translate(-50%, calc(var(--lane) + 8px)); animation-name: sf-piece-up; }
  .sf-stream > .sf-lane { align-self: stretch; height: auto; margin: 8px 0; }
  @media (prefers-reduced-motion: reduce) {
    .sf-stream > .sf-joined { transform: translate(calc(-90px - 50%), calc(-22px - var(--lane) / 2)); }
    .sf-stream .sf-piece { transform: translate(-50%, calc(var(--i) * 32px)); }
    .sf-stream .sf-piece:nth-child(n + 3) { display: none; }
  }
  .lead-figure[data-motion="still"] .sf-stream > .sf-joined {
    transform: translate(calc(-90px - 50%), calc(-22px - var(--lane) / 2));
  }
  .lead-figure[data-motion="still"] .sf-stream .sf-piece { transform: translate(-50%, calc(var(--i) * 32px)); }
  .lead-figure[data-motion="still"] .sf-stream .sf-piece:nth-child(n + 3) { display: none; }
}
@container moving (max-width: 540px) {
  .sf-trip { --lane: 80px; grid-template-columns: repeat(2, 124px); grid-template-rows: 44px var(--lane) 44px; gap: 0 16px; }
  .sf-trip > .sf-part:first-child { grid-area: 1 / 1 / 2 / 3; }
  .sf-trip > .sf-part:last-child { grid-area: 3 / 1 / 4 / 3; }
  .sf-trip > .sf-lane { grid-row: 2; align-self: stretch; height: auto; margin: 8px 0; }
  .sf-trip > .sf-lane.is-there { grid-column: 1; }
  .sf-trip > .sf-lane:not(.is-there) { grid-column: 2; }
  .sf-trip .sf-there, .sf-trip .sf-back { left: 50%; right: auto; top: 0; }
  .sf-trip .sf-there { transform: translate(-50%, calc(-100% - 8px)); animation-name: sf-there-down; }
  .sf-trip .sf-back { transform: translate(-50%, calc(var(--lane) + 8px)); animation-name: sf-back-up; }
  @media (prefers-reduced-motion: reduce) {
    .sf-trip .sf-there, .sf-trip .sf-back { transform: translate(-50%, calc(var(--lane) / 2 - 50%)); }
  }
  .lead-figure[data-motion="still"] :is(.sf-trip .sf-there, .sf-trip .sf-back) {
    transform: translate(-50%, calc(var(--lane) / 2 - 50%));
  }
}
/* An upright arrow: its line turned to run down, its head at the end it points to. */
@container moving (max-width: 760px) {
  .sf-stream > .sf-lane.is-upright > svg:first-of-type { inset: 50% auto auto 50%; width: calc(var(--lane) - 16px); transform: translate(-50%, -50%) rotate(90deg); }
  .sf-stream > .sf-lane.is-upright .sf-lane-head { left: 50%; top: 0; transform: translateX(-50%) rotate(90deg); }
}
@container moving (max-width: 540px) {
  .sf-trip > .sf-lane.is-upright > svg:first-of-type { inset: 50% auto auto 50%; width: calc(var(--lane) - 16px); transform: translate(-50%, -50%) rotate(90deg); }
  .sf-trip > .sf-lane.is-upright.is-there > svg:first-of-type { transform: translate(-50%, -50%) rotate(90deg) scaleX(-1); }
  .sf-trip > .sf-lane.is-upright .sf-lane-head { left: 50%; top: 0; transform: translateX(-50%) rotate(90deg); }
  .sf-trip > .sf-lane.is-upright.is-there .sf-lane-head { right: auto; top: auto; bottom: 0; transform: translateX(-50%) rotate(-90deg); }
}
@keyframes sf-there-down {
  0%, 6.82% { opacity: 1; transform: translate(-50%, calc(-100% - 8px)); }
  38.64% { opacity: 1; transform: translate(-50%, calc(var(--lane) + 8px)); }
  39.09%, 100% { opacity: 0; transform: translate(-50%, calc(var(--lane) + 8px)); }
}
@keyframes sf-back-up {
  0%, 49.55% { opacity: 0; transform: translate(-50%, calc(var(--lane) + 8px)); }
  50% { opacity: 1; transform: translate(-50%, calc(var(--lane) + 8px)); }
  81.82% { opacity: 1; transform: translate(-50%, calc(-100% - 8px)); }
  82.27%, 100% { opacity: 0; transform: translate(-50%, calc(-100% - 8px)); }
}
@keyframes sf-piece-up {
  0% { opacity: 1; transform: translate(-50%, calc(var(--lane) + 8px)); }
  42.86% { opacity: 1; transform: translate(-50%, calc(-100% - 8px)); }
  43.33%, 100% { opacity: 0; transform: translate(-50%, calc(-100% - 8px)); }
}
/* Upright, the whole reply waits beside the Model Client, goes in behind it, and rides the arrow up to the Loop. */
@keyframes sf-joined-up {
  0% { opacity: 0; transform: translate(0, 0); }
  2% { opacity: 1; transform: translate(0, 0); }
  52.38% { opacity: 1; transform: translate(0, 0); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  60.71% { opacity: 1; transform: translate(calc(-90px - 50%), 0); animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
  89.29% { opacity: 1; transform: translate(calc(-90px - 50%), calc(-44px - var(--lane))); }
  90.48%, 100% { opacity: 0; transform: translate(calc(-90px - 50%), calc(-44px - var(--lane))); }
}
/* Requests set in groups on one scale, a group under its name, as a lesson compares two ways of doing one task. */
.sf-groups { display: grid; gap: 18px; }
.sf-group { display: grid; gap: 10px; }
.sf-group > h4 { margin: 0; font: 600 var(--text-sm) / 1.3 var(--sans); color: var(--ink); }
.sf-bar-row:has(.sf-bar.is-open) { grid-template-columns: 150px minmax(0, 1fr) 96px; }
/* At a phone's width the name and the count share a line over a bar as wide as the column, so the bars keep their
   scale instead of shrinking beside a fixed name column. */
@media (max-width: 600px) {
  .sf-bar-row, .sf-bar-row:has(.sf-bar.is-open) {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label note" "bar bar"; gap: 4px 12px;
  }
  .sf-bar-row > .sf-bar-label { grid-area: label; }
  .sf-bar-row > .sf-bar { grid-area: bar; }
  .sf-bar-row > .sf-bar-note { grid-area: note; }
  /* With no column of names beside the bars, their key starts where the bars do. */
  .sf-legend { padding-left: 0; }
  /* MCP's tools stand one under another, and its four parts in a row keep their places and scroll in the card. */
  .sf-tools { grid-template-columns: minmax(0, 1fr); width: auto; }
  .sf-switch { grid-template-columns: minmax(0, 1fr); justify-items: stretch; }
  .sf-switch > .sf-forms { justify-self: start; }
  .sf-switch > .sf-stack { overflow-x: auto; padding-bottom: 6px; }
}
/* What a request read from its provider's cache, as Prompt Caching draws it: a bracket under the bar from its start
   to the end of the cached run of parts, in the accent. The parts keep their own colours, so the colour of a part
   says whose it is and only the bracket says what came from the cache. A row with a bracket keeps room under it. */
.sf-bar-row.has-cache { margin-bottom: 12px; }
.sf-bar[style*="--cached"]::after {
  content: ""; position: absolute; left: 0; top: calc(100% + 4px); width: var(--cached); height: 7px;
  border: 1.5px solid var(--accent); border-top: 0; border-radius: 0 0 3px 3px;
}
/* A part too narrow for its name at a tablet's width names itself under the bar, centred under its segment and
   under the bracket where the row has one, so the name stays whole at every width. */
.sf-seg[data-under]::after {
  content: attr(data-under); position: absolute; left: 50%; top: calc(100% + 3px); transform: translateX(-50%);
  white-space: nowrap; font: 400 var(--text-xs) / 1.2 var(--sans); color: var(--muted);
}
.sf-bar-row.has-cache .sf-seg[data-under]::after { top: calc(100% + 13px); }
.sf-bar-row.has-under { margin-bottom: 14px; }
/* A part whose name, measured once drawn, does not fit its segment names itself under it in the same way, where its
   row names nothing else there (lead-ins.mjs `fitStills`). */
.sf-bar > .sf-seg.is-unnamed.is-under::after {
  inset: auto; left: 50%; top: calc(100% + 3px); transform: translateX(-50%); display: block; visibility: visible;
  white-space: nowrap; font: 400 var(--text-xs) / 1.2 var(--sans); color: var(--muted);
}
.sf-bar-row.has-named-under { margin-bottom: 14px; }
.sf-bar-row.has-cache.has-under { margin-bottom: 26px; }
.sf-seg.is-summary { background: var(--actor-session-fill, var(--fig-store-line)); }
.sf-cache-key { width: 22px; height: 7px; border: 1.5px solid var(--accent); border-top: 0; border-radius: 0 0 3px 3px; }
