/* Service pages: the decision band (templates/core/services/decide/, static/js/decide.js). Loaded on
   service pages only, after inner.css. Spec §5.2 "3. The decision"; DESIGN.md "Diagrams".

   The frame (decide/_frame.html), one root per page:
   <div class="decide" data-decide="KIND" data-state="DEFAULT" [data-decide-duration="2s"]>
     <div class="decide-controls" hidden>   decide.js unhides it; segmented .decide-seg buttons
                                            (data-decide-set, aria-pressed), switches
                                            (.decide-switch, role="switch", data-decide-toggle) or
                                            step buttons (.decide-seg, data-decide-step)
     <div class="decide-diagram">           decide/KIND.html: SVGs aria-hidden, focusable="false"
     <p class="decide-readout" aria-live="polite">
     <template data-readout="key">, <template data-readout-tpl="name">
     <div class="decide-cases">             "Every case": hidden once .decide.is-live
     <p class="decide-note">                only when there is one
   DOM order is the narrow order: control, diagram, readout, under 992px in one column capped at
   38rem. From 992px the diagram takes the left 7 of 12 columns and the rest stacks on the right.

   The diagram's moving parts follow the How we work engine (how.css), renamed:
     .decide-line   a solid stroke with pathLength="1" that draws along itself (--at, --len, --ease)
     .decide-fade   anything else that appears in place (dashed strokes, bands, labels): opacity only
     .decide-node   a --node HTML span in a .decide-nodes layer, placed by --x and --y; .is-hollow is
                    a 1px ring on the ground, .is-spark the site sparkle (system.css), one per diagram
   decide.js adds .is-armed, .is-drawn and .is-done as how.js does; with no JS, under reduced motion
   and in print nothing is armed and every change is instant. After the draw, a control change moves
   only what changed, over --decide-move with --ease-out.

   Colours are the --decide-* tokens below, built from the site's tokens: no hex, no tint, no hue.
   "Failed" and "blocked" are shapes and words, never a colour. One commented block per diagram
   follows the frame, in catalogue order (Tasks 6–16). */

/* ---------- Frame ---------- */
.decide {
  /* on black. Strokes that carry meaning are at least 3:1: --decide-line is --color--gray-3 (6.2:1).
     --decide-line-faint (white at 18%) is under 3:1, so it only draws hairlines and tracks. */
  --decide-line: var(--color--gray-3);
  --decide-line-strong: var(--color--white);
  --decide-line-faint: var(--line-dark-strong);
  --decide-ink: var(--color--white);
  --decide-ground: var(--page-bg);
  --decide-move: .35s;
  --draw: 1.6s;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "controls" "diagram" "readout" "cases" "note";
  gap: clamp(1.5rem, 3vw, 2rem);
  max-width: 38rem;
  margin-inline: auto;
}
.decide-controls { grid-area: controls; }
.decide-controls[hidden] { display: none; }
.decide-diagram { grid-area: diagram; position: relative; min-width: 0; }
.decide-readout { grid-area: readout; }
.decide-cases { grid-area: cases; }
.decide-note { grid-area: note; }

@media (min-width: 992px) {
  .decide {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-rows: auto auto auto 1fr;
    grid-template-areas:
      "diagram controls"
      "diagram readout"
      "diagram cases"
      "diagram note";
    column-gap: clamp(3rem, 6vw, 6rem);
    row-gap: 1.5rem;
    max-width: none;
    align-items: start;
  }
}

/* ---------- Control ----------
   The segmented group and step buttons share the nav's pill look, 48px tall: an outline at rest,
   the nav's fill and a white outline when pressed, so the state shows by more than colour. */
.decide-control-label {
  margin: 0 0 .875rem;
  color: var(--color--gray-3);
  font-family: var(--_typography---font-family--body-alt);
  font-size: .75rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.decide-seg-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.decide-seg {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: .5rem 1.125rem;
  border: 1px solid var(--line-dark-strong);
  border-radius: 999px;
  background: none;
  color: var(--color--gray-5);
  font: inherit;
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.decide-seg[aria-pressed="true"] { border-color: var(--color--white); background: var(--color--gray-2); color: var(--color--white); }
.decide-seg[aria-disabled="true"] { border-color: var(--line-dark); color: var(--color--gray-3); cursor: default; } /* aria-disabled, not disabled: focus stays on it */
@media (hover: hover) {
  .decide-seg:not([aria-disabled="true"]):hover { background: var(--color--gray-2); color: var(--color--white); }
}

/* a switch: the native checkbox (role="switch") beside its visible label, in a 48px row */
.decide-switches { display: grid; gap: .25rem; margin: 0; padding: 0; border: 0; }
.decide-switch {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 3rem;
  color: var(--color--gray-5);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}
.decide-switch input { flex: none; width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--color--white); cursor: pointer; }

/* ---------- Readout, every case, note ---------- */
.decide-readout {
  min-height: calc(3 * 1.55em); /* room for two sentences, so a change rarely moves what is under it */
  margin: 0;
  color: var(--color--white);
  font-size: 1.125rem;
  line-height: 1.55;
  text-wrap: pretty;
}
.decide-cases-title {
  margin: 0 0 1rem;
  color: var(--color--gray-3);
  font-family: var(--_typography---font-family--body-alt);
  font-size: .75rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.decide-cases dl { margin: 0; border-top: 1px solid var(--line-dark-strong); }
.decide-cases dt { margin: 0; padding-top: 1rem; color: var(--color--white); font-size: 1rem; font-weight: 500; line-height: 1.4; }
.decide-cases dd {
  margin: .25rem 0 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line-dark-strong);
  color: var(--color--gray-5);
  font-size: 1rem;
  line-height: 1.55;
  text-wrap: pretty;
}
.decide.is-live .decide-cases { display: none; }
.decide-note { margin: 0; color: var(--color--gray-3); font-size: .875rem; line-height: 1.5; text-wrap: pretty; }
/* a fact note (note_fact): its figure in ink, then the claim, then the source and year, linked like .fact-source */
.decide-note-figure { color: var(--color--white); font-weight: 500; }
.decide-note a {
  color: var(--color--gray-5);
  text-decoration: underline;
  text-decoration-color: var(--line-dark-strong);
  text-underline-offset: .25em;
}
.decide-note a:hover { color: var(--color--white); text-decoration-color: currentColor; }

/* ---------- Diagram parts (the How we work engine, renamed) ---------- */
.decide-svg { display: block; width: 100%; height: auto; overflow: visible; pointer-events: none; }
.decide-line {
  fill: none;
  stroke: var(--decide-line);
  stroke-width: var(--line);
  vector-effect: non-scaling-stroke;
  transition: stroke var(--decide-move) var(--ease-out), opacity var(--decide-move) var(--ease-out);
}
.decide-fade { transition: opacity var(--decide-move) var(--ease-out); }
.decide-nodes { position: absolute; inset: 0; pointer-events: none; }
.decide-node {
  position: absolute;
  left: var(--x, 0%);
  top: var(--y, 0%);
  box-sizing: border-box;
  width: var(--node);
  height: var(--node);
  margin: calc(var(--node) / -2) 0 0 calc(var(--node) / -2);
  border-radius: 50%;
  background: var(--decide-ink);
  transition: opacity var(--decide-move) var(--ease-out), translate var(--decide-move) var(--ease-out);
}
.decide-node.is-hollow { border: 1px solid var(--decide-ink); background: var(--decide-ground); }

/* armed by decide.js, on screen only, so print and no-JS keep the finished frame. As in how.css, the
   dash that draws a line exists only from .is-armed to .is-done, sized per line (--dash). */
@media screen {
  .decide.is-armed .decide-line { stroke-dasharray: var(--dash, 1) calc(var(--dash, 1) * 2); stroke-dashoffset: 0; }
  .decide.is-armed.is-done .decide-line { stroke-dasharray: none; }
  .decide.is-armed:not(.is-drawn) :is(.decide-line, .decide-fade, .decide-node) { transition: none; }
  .decide.is-armed:not(.is-drawn) .decide-line { stroke-dashoffset: var(--dash, 1); }
  .decide.is-armed:not(.is-drawn) :is(.decide-fade, .decide-node) { opacity: 0; }

  .decide.is-drawn:not(.is-done) .decide-line {
    transition: stroke-dashoffset calc(var(--len, 1) * var(--draw)) var(--ease, var(--ease-out)) calc(var(--at, 0) * var(--draw));
  }
  .decide.is-drawn:not(.is-done) .decide-fade { transition: opacity .5s ease-out calc(var(--at, 0) * var(--draw)); }
  .decide.is-drawn:not(.is-done) .decide-node { transition: opacity .3s ease-out calc(var(--at, 0) * var(--draw)); }
}

/* reduced motion and print: every change is instant */
@media (prefers-reduced-motion: reduce) {
  .decide * { transition: none !important; }
}
@media print {
  .decide * { transition: none !important; }
  .decide-controls { display: none; } /* paper can't press a button; "Every case" prints instead */
  .decide.is-live .decide-cases { display: block; }
}

/* Windows High Contrast: painted nodes opt out and take the system ink; strokes take it too */
@media (forced-colors: active) {
  .decide {
    --decide-line: CanvasText;
    --decide-line-strong: CanvasText;
    --decide-line-faint: GrayText;
    --decide-ink: CanvasText;
    --decide-ground: Canvas;
  }
  .decide-node { forced-color-adjust: none; background: CanvasText; }
  .decide-node.is-hollow { background: Canvas; border-color: CanvasText; }
  .decide-seg[aria-pressed="true"] { forced-color-adjust: none; border: 2px solid Highlight; background: Canvas; color: CanvasText; }
}

/* ---------- Diagrams: one commented block each, in catalogue order (Tasks 6–16) ---------- */

/* ---------- follow-question (AI Agents & RAG, decide/follow-question.html, spec §6.1) ----------
   A question splits into two search lanes, their passages sit as cards, Rerank picks one and the
   answer cites it. .fq is a size container: from 34rem wide it runs left to right, under that the
   question tops a column, the lanes stack (meaning over keyword) and Rerank and the answer sit below.
   The three candidate rows are equal (1fr, no row gap, the cards pad by margin), so a card's middle is
   at 50, 150 or 250 of the 300-unit viewBoxes that span them; the SVGs stretch to their cell.
   States, from data-state on the root (decide.js ragState maps the two switches to one):
     both-on     the refund rule (keyword search, third) is lifted by Rerank: its join line is the
                 strong one, the out line carries the sweep and the answer cites it, with the spark
     no-keyword  the keyword lane is dashed and its node hollow; the refund card is dashed, "Missed";
                 the out line is dashed and the answer, dashed, says "No source found"
     no-rerank   Rerank's node is hollow; the top card (the cancellation FAQ) takes the strong line and
                 the answer, dashed, cites it under "Wrong source"
     both-off    both of the above failures: missed, then no source
   Failure is a dashed stroke or border, a hollow node and a word, never a colour. The spark goes
   with the cited answer. */
.fq { container-type: inline-size; container-name: fq; }
.fq-grid {
  --fq-pad: .375rem; /* half the gap between two cards, and a card's margin in its row */
  display: grid;
  grid-template-columns: minmax(0, 28fr) minmax(0, 58fr) minmax(0, 14fr);
  grid-template-rows: auto repeat(3, 1fr) minmax(3rem, auto) auto;
  grid-template-areas:
    "q     q   q"
    "lanes c1  join"
    "lanes c2  join"
    "lanes c3  join"
    "rr    rr  rr"
    "ans   ans ans";
}
:where(.fq-grid) p { margin: 0; }
.fq-lanes, .fq-join, .fq-out, .fq-rerank { position: relative; }
.fq-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.fq-svg--wide { display: none; }
.fq-lanes { grid-area: lanes; }
.fq-join { grid-area: join; }
.fq-out { grid-area: rr; }

/* the words: the question, the passages and the answer sit over the lines on their own ground */
.fq-question, .fq-card, .fq-answer { position: relative; z-index: 1; border: var(--line-hair) solid var(--decide-line-faint); border-radius: 12px; }
.fq-question {
  grid-area: q;
  margin-bottom: 1.25rem;
  padding: .75rem .875rem;
  border-color: var(--decide-line-strong);
  background: var(--decide-ground);
  color: var(--decide-ink);
  font-size: .9375rem;
  line-height: 1.4;
  text-wrap: pretty;
}
.fq-cards { display: contents; }
.fq-card {
  list-style: none;
  margin: var(--fq-pad) 0;
  padding: .625rem .75rem;
  background: var(--color--gray-1);
  color: var(--color--gray-5);
  font-size: .8125rem;
  line-height: 1.45;
  text-wrap: pretty;
  transition: opacity var(--decide-move) var(--ease-out), color var(--decide-move) var(--ease-out), background-color var(--decide-move) var(--ease-out);
}
.fq-card:nth-child(1) { grid-area: c1; }
.fq-card:nth-child(2) { grid-area: c2; }
.fq-card:nth-child(3) { grid-area: c3; }

.fq-lane-label, .fq-rerank-label, .fq-answer-label, .fq-tag {
  font-family: var(--_typography---font-family--body-alt);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.fq-lane-label, .fq-rerank-label, .fq-answer-label { color: var(--decide-line); font-size: .6875rem; line-height: 1.25; }
/* a lane's name sits above its line, its left edge on the lane's node */
.fq-lane-label { position: absolute; left: calc(20% - var(--node) / 2); right: 0; }
.fq-lane-label[data-lane="meaning"] { bottom: calc(83.333% + .5rem); }
.fq-lane-label[data-lane="keyword"] { bottom: calc(16.667% + .5rem); }

/* Rerank: narrow, its node on the join's middle line (93.7% across) and its name to the left */
.fq-rerank { grid-area: rr; }
.fq-rerank-node { --x: 93.7%; --y: 50%; }
.fq-rerank-label { position: absolute; top: 50%; right: calc(6.3% + .875rem); transform: translateY(-50%); }

.fq-answer {
  grid-area: ans;
  padding: .75rem .875rem;
  border-color: var(--decide-line-strong);
  background: var(--decide-ground);
  transition: opacity var(--decide-move) var(--ease-out), border-color var(--decide-move) var(--ease-out);
}
.fq-answer-node { --x: 93.7%; --y: 0%; } /* where the out line lands on its top edge */
.fq-cite { display: grid; margin-top: .25rem; color: var(--decide-ink); font-size: .9375rem; font-weight: 500; line-height: 1.3; }
.fq-cite > [data-cite] { grid-area: 1 / 1; }

/* the state words: every variant holds its place, so nothing moves when one is swapped in */
.fq-cite > [data-cite], .fq-tag {
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--decide-move) var(--ease-out), visibility var(--decide-move);
}
.fq-cite > [data-cite="right"] { opacity: 1; visibility: visible; }
.fq-tag {
  position: absolute;
  right: .75rem;
  bottom: 0;
  transform: translateY(50%);
  padding: .125rem .5rem;
  border: var(--line-hair) solid var(--decide-line);
  border-radius: 999px;
  background: var(--decide-ground);
  color: var(--decide-ink);
  font-size: .625rem;
  line-height: 1.3;
  white-space: nowrap;
}

/* strokes: the lanes and the out line at --line, the candidates' lines at --line-hair until one wins */
.fq-dashed {
  fill: none;
  stroke: var(--decide-line);
  stroke-width: var(--line-hair);
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
}
.fq-k-off, .fq-out-off { opacity: 0; }
.fq-j { stroke-width: var(--line-hair); }

/* both-on: the refund rule's line wins and the out line takes the sweep (stops in colour.css) */
.decide[data-state="both-on"] .fq-j[data-passage="0"],
.decide[data-state="no-rerank"] .fq-j[data-passage="1"] { stroke: var(--decide-line-strong); stroke-width: var(--line); }
.decide[data-state="both-on"] .fq-out-on { stroke: url(#fq-sweep); }
.decide[data-state="both-on"] .fq-svg--narrow .fq-out-on { stroke: url(#fq-sweep-narrow); }
.decide[data-state="no-rerank"] .fq-out-on { stroke: var(--decide-line-strong); }

/* keyword search off: its lane dashed, its node hollow, the refund rule missed */
.decide:is([data-state="no-keyword"], [data-state="both-off"]) .fq-k-on,
.decide:is([data-state="no-keyword"], [data-state="both-off"]) .fq-j[data-passage="0"] { opacity: 0; }
.decide:is([data-state="no-keyword"], [data-state="both-off"]) .fq-k-off { opacity: 1; }
.decide:is([data-state="no-keyword"], [data-state="both-off"]) .fq-k-node,
.decide:is([data-state="no-rerank"], [data-state="both-off"]) .fq-rerank-node {
  border: 1px solid var(--decide-ink);
  background: var(--decide-ground);
}
.decide:is([data-state="no-keyword"], [data-state="both-off"]) .fq-card[data-passage="0"] {
  border-style: dashed;
  border-color: var(--decide-line);
  background: var(--decide-ground);
  color: var(--color--gray-3);
}
.decide:is([data-state="no-keyword"], [data-state="both-off"]) [data-tag="missed"],
.decide[data-state="no-rerank"] [data-tag="wrong"] { opacity: 1; visibility: visible; }

/* no source reached the model: the out line breaks and the answer says so */
.decide:is([data-state="no-keyword"], [data-state="both-off"]) .fq-out-on { opacity: 0; }
.decide:is([data-state="no-keyword"], [data-state="both-off"]) .fq-out-off { opacity: 1; }

/* any failure: the answer card goes dashed, its node hollow and without the spark */
.decide:is([data-state="no-keyword"], [data-state="no-rerank"], [data-state="both-off"]) .fq-answer { border-style: dashed; border-color: var(--decide-line); }
.decide:is([data-state="no-keyword"], [data-state="no-rerank"], [data-state="both-off"]) .fq-answer-node.is-spark {
  border: 1px solid var(--decide-ink);
  background: var(--decide-ground);
  box-shadow: none;
  animation: none;
}
.decide:is([data-state="no-keyword"], [data-state="no-rerank"], [data-state="both-off"]) .fq-cite > [data-cite="right"] { opacity: 0; visibility: hidden; }
.decide[data-state="no-rerank"] .fq-cite > [data-cite="wrong"],
.decide:is([data-state="no-keyword"], [data-state="both-off"]) .fq-cite > [data-cite="none"] { opacity: 1; visibility: visible; }

/* wide: left to right. Rerank sits level with the first card, the answer under it in the last column */
@container fq (min-width: 34rem) {
  .fq-grid {
    grid-template-columns: minmax(0, 19fr) minmax(0, 20fr) minmax(0, 33fr) minmax(0, 7fr) minmax(0, 21fr);
    grid-template-rows: repeat(3, 1fr);
    grid-template-areas:
      "q lanes c1 join rr"
      "q lanes c2 join ans"
      "q lanes c3 join ans";
  }
  .fq-svg--wide { display: block; }
  .fq-svg--narrow { display: none; }
  .fq-question { align-self: center; margin-bottom: 0; padding: .625rem .75rem; font-size: .875rem; }
  .fq-out { grid-area: auto; grid-column: 5; grid-row: 1 / 4; }
  .fq-rerank-node { --x: 0%; }
  .fq-rerank-label { top: auto; right: auto; bottom: calc(50% + .375rem); left: .875rem; transform: none; }
  .fq-answer { align-self: start; margin-top: var(--fq-pad); padding: .625rem .75rem; }
  .fq-answer-node { --x: 18%; } /* the out line's 18 of 100 */
  .fq-answer .fq-tag { right: auto; left: 50%; transform: translate(-50%, 50%); } /* the card is barely wider than "Wrong source" */
  .fq-cite { font-size: .875rem; }
}

@media (forced-colors: active) {
  .decide[data-state] .fq-out-on { stroke: var(--decide-line-strong); }
}

/* ---------- promotion-gate (AI Pilot to Production, decide/promotion-gate.html, spec §6.2) ----------
   A release walks down one line through seven gates to Everyone, which carries the spark. The rows are
   equal (3rem), so a gate's middle is at 50, 150 ... 650 of the 700-unit viewBox the track SVG stretches to;
   its nodes sit 0.75rem in, on the line (x 5 of 10 in a 1.5rem column).
   States, from data-state on the root (decide.js's generic path sets it, one button per state):
     passes      every segment solid, every gate lit, Everyone has the spark
     the others  the line is solid down to the stopped gate and dashed from it on; the stopped gate and every
                 gate after it go hollow, and the stopped gate gets a dashed border and the word "Stopped"
   The stop for each state is the gate named by stops_at in decide.data (test_promotion_gate_css_stops_match_the_data
   keeps these nth-child numbers in step). Failure is a broken line, a hollow node and a word, never a colour. */
.pg-gates { position: relative; }
.pg-svg { position: absolute; left: 0; top: 0; width: 1.5rem; height: 100%; }
.pg-list { margin: 0; padding: 0; list-style: none; }
.pg-gate {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  box-sizing: border-box;
  height: 3rem;
  margin: 0;
  padding: 0 .75rem 0 2.25rem;
  border: var(--line-hair) solid transparent;
  border-radius: 12px;
  color: var(--decide-ink);
  font-size: .9375rem;
  line-height: 1.25;
  transition: border-color var(--decide-move) var(--ease-out), color var(--decide-move) var(--ease-out);
}
.pg-gate .decide-node { left: .75rem; }
.pg-name { min-width: 0; }
.pg-dashed {
  fill: none;
  stroke: var(--decide-line);
  stroke-width: var(--line-hair);
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
}
.pg-off > .pg-dashed { opacity: 0; }
.pg-tag {
  margin-left: auto;
  padding: .125rem .5rem;
  border: var(--line-hair) solid var(--decide-line);
  border-radius: 999px;
  background: var(--decide-ground);
  color: var(--decide-ink);
  font-family: var(--_typography---font-family--body-alt);
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: .12em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--decide-move) var(--ease-out), visibility var(--decide-move);
}

/* a stop: solid down to gate k, dashed from it, the gates from k on hollow and dim, gate k named */
.decide:is([data-state="accuracy"], [data-state="attack"], [data-state="cost"], [data-state="shadow"]) .pg-gate .decide-node.is-spark {
  box-shadow: none;
  animation: none;
}
.decide[data-state="accuracy"] .pg-on > :nth-child(n+1),
.decide[data-state="attack"] .pg-on > :nth-child(n+2),
.decide[data-state="cost"] .pg-on > :nth-child(n+3),
.decide[data-state="shadow"] .pg-on > :nth-child(n+5) { opacity: 0; }
.decide[data-state="accuracy"] .pg-off > :nth-child(n+1),
.decide[data-state="attack"] .pg-off > :nth-child(n+2),
.decide[data-state="cost"] .pg-off > :nth-child(n+3),
.decide[data-state="shadow"] .pg-off > :nth-child(n+5) { opacity: 1; }
.decide[data-state="accuracy"] .pg-gate:nth-child(n+1) .decide-node,
.decide[data-state="attack"] .pg-gate:nth-child(n+2) .decide-node,
.decide[data-state="cost"] .pg-gate:nth-child(n+3) .decide-node,
.decide[data-state="shadow"] .pg-gate:nth-child(n+5) .decide-node {
  border: 1px solid var(--decide-ink);
  background: var(--decide-ground);
}
.decide[data-state="accuracy"] .pg-gate:nth-child(n+2),
.decide[data-state="attack"] .pg-gate:nth-child(n+3),
.decide[data-state="cost"] .pg-gate:nth-child(n+4),
.decide[data-state="shadow"] .pg-gate:nth-child(n+6) { color: var(--color--gray-3); }
.decide[data-state="accuracy"] .pg-gate:nth-child(1),
.decide[data-state="attack"] .pg-gate:nth-child(2),
.decide[data-state="cost"] .pg-gate:nth-child(3),
.decide[data-state="shadow"] .pg-gate:nth-child(5) { border-style: dashed; border-color: var(--decide-line); }
.decide[data-state="accuracy"] .pg-gate:nth-child(1) .pg-tag,
.decide[data-state="attack"] .pg-gate:nth-child(2) .pg-tag,
.decide[data-state="cost"] .pg-gate:nth-child(3) .pg-tag,
.decide[data-state="shadow"] .pg-gate:nth-child(5) .pg-tag { opacity: 1; visibility: visible; }

/* the release marker (spec §6.2): one --node dot with a ring that rests on the stopped gate, or on Everyone
   when the release passes. --pg-stop is that gate's index; it moves only when the state does (--decide-move),
   and decide.css's reduced-motion rule makes the move instant. Tied to data["stops_at"] by a test. */
.pg-marker {
  --pg-stop: 6;
  --x: .75rem;
  --y: calc((var(--pg-stop) + .5) / 7 * 100%);
  z-index: 1;
  box-shadow: 0 0 0 3px var(--decide-ground), 0 0 0 calc(3px + var(--line)) var(--decide-ink);
  transition: opacity var(--decide-move) var(--ease-out), left var(--decide-move) var(--ease-out), top var(--decide-move) var(--ease-out);
}
.decide[data-state="accuracy"] .pg-marker { --pg-stop: 0; }
.decide[data-state="attack"] .pg-marker { --pg-stop: 1; }
.decide[data-state="cost"] .pg-marker { --pg-stop: 2; }
.decide[data-state="shadow"] .pg-marker { --pg-stop: 4; }

/* wide: left to right, the names wrap under their nodes */
.pg-svg--wide { display: none; }
.pg { container-type: inline-size; container-name: pg; }
@container pg (min-width: 34rem) {
  .pg-svg--narrow { display: none; }
  .pg-svg--wide { display: block; width: 100%; height: 1.5rem; }
  .pg-list { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .pg-gate {
    flex-direction: column;
    align-items: center;
    height: auto;
    padding: 2rem .25rem .5rem;
    gap: .5rem;
    font-size: .8125rem;
    text-align: center;
    overflow-wrap: anywhere;
  }
  .pg-gate .decide-node { left: 50%; top: .75rem; }
  .pg-tag { margin-left: 0; padding: .125rem .375rem; letter-spacing: .08em; }
  .pg-marker { --x: calc((var(--pg-stop) + .5) / 7 * 100%); --y: .75rem; }
}

/* ---------- cut-line (Discovery & MVP, decide/cut-line.html, spec §6.3) ----------
   A story map: four columns (the steps of the journey), the stories of each under it, and one cut line.
   A pressed story (aria-pressed="true") sits above the line, in release 1; the others sit below. decide.js
   moves a story's <li> between the column's two lists (each kept in the story's own order), so a column
   re-flows and the line never moves. The stories are the control: the frame's own control is hidden (the
   override renders nothing), and without JS they are disabled in the default cut.
   .cl is a size container. From 34rem wide the four columns share four rows by subgrid (head, above, line,
   below), so every column's line piece is level and the pieces meet (each rule reaches over its column's
   side padding) as one straight line; the lists reserve --cl-rows slots (decide.data["rows"], the longest
   column) so the map keeps its height as stories move; above sits against the line from over it, below
   hangs from under it. Narrower, the columns stack and each has its own line.
   States, from data-state (decide.js journeyState):
     complete  the default: the line is solid and its start carries the spark
     overfull  the same drawing; only the readout changes
     broken    a column with nothing above the line: its above list shows a dashed empty slot, and every
               line goes dashed, its start hollow and without the spark. Shape, never colour. */
.cl { container-type: inline-size; container-name: cl; --cl-btn: 3rem; --cl-gap: .375rem; }
.decide[data-decide="cut-line"] .decide-controls { display: none; } /* the stories are the control */
.cl-map { display: grid; gap: 1.5rem; }
.cl-col { display: flex; flex-direction: column; min-width: 0; }
.cl-head {
  margin: 0 0 .75rem;
  color: var(--decide-ink);
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.3;
  text-wrap: balance;
}
.cl-above, .cl-below {
  display: flex;
  flex-direction: column;
  gap: var(--cl-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.cl-above { justify-content: flex-end; padding-bottom: .5rem; }
.cl-below { justify-content: flex-start; padding-top: .5rem; }
.cl-above > li, .cl-below > li { margin: 0; }
/* a column with nothing above the line keeps one dashed slot, so the hole shows */
.cl-above:not(:has(li))::after {
  content: "";
  display: block;
  height: var(--cl-btn);
  border: var(--line-hair) dashed var(--decide-line);
  border-radius: 10px;
}

.cl-story {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  min-height: var(--cl-btn);
  padding: .375rem .75rem;
  border: var(--line-hair) dashed var(--decide-line);
  border-radius: 10px;
  background: none;
  color: var(--color--gray-3);
  font: inherit;
  font-size: .875rem;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.cl-story[aria-pressed="true"] { border-style: solid; border-color: var(--decide-ink); background: var(--color--gray-2); color: var(--decide-ink); }
.cl-story[disabled] { cursor: default; } /* no script yet: the default cut, nothing to press */
@media (hover: hover) {
  .cl-story:not([disabled]):hover { background: var(--color--gray-2); color: var(--decide-ink); border-color: var(--decide-ink); }
}

/* the cut line: this column's piece, its label and the spark at the first column's start */
.cl-rule { position: relative; height: 1.75rem; }
.cl-svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
.cl-svg .decide-line { stroke: var(--decide-line-strong); }
.cl-dashed {
  fill: none;
  stroke: var(--decide-line);
  stroke-width: var(--line-hair);
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
  opacity: 0;
}
.cl-rule-label {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  padding: .125rem .5rem;
  border: var(--line-hair) solid var(--decide-line);
  border-radius: 999px;
  background: var(--decide-ground);
  color: var(--decide-ink);
  font-family: var(--_typography---font-family--body-alt);
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: .12em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateY(-50%);
}
.cl-rule .decide-node { z-index: 1; }

/* broken: every piece of the line goes dashed, its start hollow and spark-less */
.decide[data-state="broken"] .cl-svg .decide-line { opacity: 0; }
.decide[data-state="broken"] .cl-svg .cl-dashed { opacity: 1; }
.decide[data-state="broken"] .cl-rule .decide-node { border: var(--line-hair) solid var(--decide-ink); background: var(--decide-ground); }
.decide[data-state="broken"] .cl-rule .decide-node.is-spark { box-shadow: none; animation: none; }

/* wide: the columns share the map's rows by subgrid, so the cut is one straight line */
@container cl (min-width: 34rem) {
  .cl-map {
    --cl-btn: 3.25rem; /* set here, not on .cl: a container query can't style its own container */
    --cl-slot: calc(var(--cl-btn) + var(--cl-gap)); /* + .125rem below: the list's .5rem padding less one gap */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: auto minmax(calc(var(--cl-rows) * var(--cl-slot) + .125rem), auto) 1.75rem minmax(calc(var(--cl-rows) * var(--cl-slot) + .125rem), auto);
    gap: 0;
  }
  .cl-col { padding-inline: .5rem; grid-column: var(--c); grid-row: 1 / span 4; }
  .cl-story { padding: .25rem .625rem; font-size: .8125rem; }
  .cl-rule { margin-inline: -.5rem; }
  .cl-col + .cl-col .cl-rule-label { display: none; } /* one label, on the line's start */
}
@supports (grid-template-rows: subgrid) {
  @container cl (min-width: 34rem) {
    .cl-col { display: grid; grid-template-rows: subgrid; row-gap: 0; }
  }
}

@media (forced-colors: active) {
  .cl-story[aria-pressed="true"] { forced-color-adjust: none; border: 2px solid Highlight; background: Canvas; color: CanvasText; }
}

/* ---------- tenants (SaaS Products, decide/tenants.html, spec §6.4) ----------
   Two customers, Acme and Beta, and six paths from Acme toward Beta's data, one per surface, each crossing a
   check node. A path is blocked (data-open="false", the default) or open (data-open="true", set by decide.js
   when its switch is off). Blocked: the line runs from Acme to the check and ends there, the check a solid
   node. Open: the check goes hollow and the line runs on to Beta, dashed, with the Leak tag on it. Shape and
   a word, never colour. A Database rule line runs under all six as the backstop.
   The spark is Beta's data end: it stays only while no path is open (data-state "all-on"), hollow otherwise.
   .tn is a size container. From 34rem wide the customers stand either side of the six horizontal paths (one
   grid, no gap, so the lines meet the boxes). Narrower, Acme and Beta sit above, one at each end, and the
   six paths stack full width beneath them. */
.tn { container-type: inline-size; container-name: tn; }
.tn-map {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "acme beta" "paths paths" "back back";
  row-gap: 1.25rem;
}
:where(.tn-map) p, :where(.tn-map) ol { margin: 0; padding: 0; }
.tn-party {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .5rem 1rem;
  border: var(--line-hair) solid var(--decide-line-strong);
  border-radius: 12px;
  background: var(--decide-ground);
  color: var(--decide-ink);
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.3;
}
.tn-acme { grid-area: acme; justify-self: start; }
.tn-beta { grid-area: beta; justify-self: end; }
.tn-beta .decide-node { --x: 50%; --y: 100%; }
.tn-paths { grid-area: paths; display: grid; gap: .875rem; list-style: none; }
.tn-path { margin: 0; }
.tn-name {
  display: block;
  margin-bottom: .125rem;
  color: var(--decide-line);
  font-family: var(--_typography---font-family--body-alt);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .12em;
  line-height: 1.3;
  text-align: center;
  text-transform: uppercase;
}
.tn-track { position: relative; height: 1.25rem; }
.tn-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tn-svg .decide-line { stroke: var(--decide-line-strong); }
.tn-run {
  fill: none;
  stroke: var(--decide-line);
  stroke-width: var(--line);
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
  opacity: 0;
}
.tn-tag {
  position: absolute;
  left: 75%;
  top: 50%;
  padding: .125rem .5rem;
  border: var(--line-hair) solid var(--decide-line);
  border-radius: 999px;
  background: var(--decide-ground);
  color: var(--decide-ink);
  font-family: var(--_typography---font-family--body-alt);
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: .12em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%);
  transition: opacity var(--decide-move) var(--ease-out), visibility var(--decide-move);
}

/* the backstop: one line under all six, its label on it */
.tn-backstop { grid-area: back; position: relative; height: 1.25rem; }
.tn-backstop path { fill: none; stroke: var(--decide-line); stroke-width: var(--line-hair); vector-effect: non-scaling-stroke; }
.tn-backstop-label {
  position: absolute;
  left: 50%;
  top: 50%;
  padding: .125rem .5rem;
  border: var(--line-hair) solid var(--decide-line);
  border-radius: 999px;
  background: var(--decide-ground);
  color: var(--decide-ink);
  font-family: var(--_typography---font-family--body-alt);
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: .12em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

/* open: the check goes hollow, the line runs on to Beta, dashed, with its tag */
.tn-path[data-open="true"] .tn-run,
.tn-path[data-open="true"] .tn-tag { opacity: 1; visibility: visible; }
.tn-path[data-open="true"] .decide-node { border: 1px solid var(--decide-ink); background: var(--decide-ground); }
.tn-path[data-open="true"] .tn-name { color: var(--decide-ink); }

/* any leak: Beta's data is no longer protected, so the spark goes hollow */
.decide:not([data-state="all-on"]) .tn-beta .decide-node.is-spark {
  border: 1px solid var(--decide-ink);
  background: var(--decide-ground);
  box-shadow: none;
  animation: none;
}

/* wide: the customers either side of the six paths */
@container tn (min-width: 34rem) {
  .tn-map {
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr) minmax(0, 1fr);
    grid-template-areas: "acme paths beta" "back back back";
    row-gap: 1.5rem;
  }
  .tn-party { align-self: stretch; justify-self: stretch; font-size: 1rem; }
  .tn-beta .decide-node { --x: 0%; --y: 50%; }
  .tn-paths { gap: 1.125rem; padding-block: .75rem; }
}

@media (forced-colors: active) {
  .tn-path[data-open="true"] .tn-run { stroke: CanvasText; }
}

/* ---------- release-lanes (Web & Mobile, decide/release-lanes.html, spec §6.5) ----------
   One build splits into three lanes (Web, iPhone, Android), each a row of gate steps, and the lanes land together
   at Live. A step is reached (data-flow="on", the default: solid node, solid line), the first held step
   (data-flow="stop": hollow node, its line out dashed, its word shown: Waiting, Halted, Paused or Held) or never
   reached (data-flow="after": hollow, dashed). decide.js sets data-held on a step whose switch is on, and
   data-stopped on a lane that has one; a stopped lane's line to Live goes dashed too. Shape and a word, never colour.
   The spark is Live: it stays only while no lane is stopped (data-state "idle"), hollow otherwise.
   .rl is a size container. From 34rem wide the lanes are stacked rows, steps left to right between the build
   (left rail) and Live (right rail). Narrower, the build is on top and the lanes follow one after another, their
   steps stacked, along one rail that ends at Live. */
.rl { container-type: inline-size; container-name: rl; --rl-y: .875rem; --rl-rail: 1.5rem; }
.rl-map { display: grid; }
:where(.rl-map) p, :where(.rl-map) ol { margin: 0; padding: 0; list-style: none; }
.rl-lanes, .rl-steps { display: block; }
.rl-lanes > li, .rl-steps > li { margin: 0; }
.rl-rail { position: relative; display: block; }
.rl-trunk { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; height: 100%; }
.rl-elbow { position: absolute; left: 50%; right: 0; top: calc(var(--rl-y) - .5px); width: auto; height: 1px; }
.rl-trunk .decide-line, .rl-elbow .decide-line, .rl-link .decide-line { stroke: var(--decide-line-strong); }
.rl-dash {
  fill: none;
  stroke: var(--decide-line);
  stroke-width: var(--line);
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
  opacity: 0;
}
.rl-out { display: none; }

/* the build and Live: a node on the rail and a label, a stem joining the rail to the lanes */
.rl-build, .rl-live { display: grid; grid-template-columns: var(--rl-rail) minmax(0, 1fr); align-items: start; }
.rl-build .rl-rail, .rl-live .rl-rail { height: 1.25rem; }
.rl-build .rl-rail::after, .rl-live .rl-rail::after {
  content: "";
  position: absolute;
  left: 50%;
  border-left: var(--line) solid var(--decide-line-strong);
}
.rl-build .rl-rail::after { top: .625rem; bottom: 0; }
.rl-live .rl-rail::after { top: 0; height: .625rem; }
.rl-live { grid-template-areas: "rail label"; }
.rl-live .rl-rail { grid-area: rail; }
.rl-live-label { grid-area: label; }
.rl-build .decide-node, .rl-live .decide-node { --x: 50%; --y: .625rem; z-index: 1; }
.rl-build-label, .rl-live-label {
  color: var(--decide-ink);
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.25rem;
}

/* a lane */
.rl-lane { display: grid; grid-template-columns: var(--rl-rail) minmax(0, 1fr); grid-template-areas: "in name" "in steps"; }
.rl-in { grid-area: in; }
.rl-name {
  grid-area: name;
  justify-self: start;
  align-self: start;
  box-sizing: border-box;
  min-width: 4rem;
  padding: .125rem .75rem;
  border: var(--line-hair) solid var(--decide-line);
  border-radius: 999px;
  background: var(--decide-ground);
  color: var(--decide-ink);
  font-family: var(--_typography---font-family--body-alt);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .12em;
  line-height: 1.25rem;
  text-align: center;
  text-transform: uppercase;
}
.rl-steps { grid-area: steps; }
.rl-step { position: relative; display: grid; grid-template-columns: var(--rl-rail) minmax(0, 1fr); }
.rl-track { position: relative; display: block; align-self: stretch; }
.rl-link { position: absolute; inset: 0; width: 100%; height: 100%; }
.rl-h { display: none; }
.rl-step:last-child .rl-v { display: none; } /* narrow: nothing under the last step of a lane */
.rl-step .decide-node { --x: 50%; --y: var(--rl-y); }
.rl-text { display: block; min-width: 0; padding: .25rem 0 .75rem; }
.rl-label { display: block; color: var(--decide-ink); font-size: .875rem; line-height: 1.3; overflow-wrap: anywhere; }
.rl-check { display: block; margin-top: .125rem; color: var(--color--gray-3); font-size: .75rem; line-height: 1.35; }
.rl-word {
  display: inline-block;
  margin-top: .25rem;
  padding: .125rem .5rem;
  border: var(--line-hair) solid var(--decide-line);
  border-radius: 999px;
  background: var(--decide-ground);
  color: var(--decide-ink);
  font-family: var(--_typography---font-family--body-alt);
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: .12em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--decide-move) var(--ease-out), visibility var(--decide-move);
}

/* a held step: its word shows */
.rl-step[data-held="true"] .rl-word { opacity: 1; visibility: visible; }
/* the first held step and everything after it: hollow, and the line leaving it dashed */
.rl-step:is([data-flow="stop"], [data-flow="after"]) .decide-node { border: 1px solid var(--decide-ink); background: var(--decide-ground); }
.rl-step:is([data-flow="stop"], [data-flow="after"]) .rl-link .decide-line { opacity: 0; }
.rl-step:is([data-flow="stop"], [data-flow="after"]) .rl-link .rl-dash { opacity: 1; }
.rl-step[data-flow="stop"] .rl-link .rl-dash { stroke: var(--decide-line-strong); }
.rl-step[data-flow="after"] .rl-label { color: var(--decide-line); }
/* a stopped lane never reaches Live */
.rl-lane[data-stopped="true"] .rl-out .decide-line { opacity: 0; }
.rl-lane[data-stopped="true"] .rl-out .rl-dash { opacity: 1; }
/* any stop: the three lanes don't land together, so the spark goes hollow */
.decide:not([data-state="idle"]) .rl-live .decide-node.is-spark {
  border: 1px solid var(--decide-ink);
  background: var(--decide-ground);
  box-shadow: none;
  animation: none;
}

/* wide: three lanes stacked, steps left to right */
@container rl (min-width: 34rem) {
  .rl { --rl-y: 1.25rem; --rl-rail: 2.5rem; }
  .rl-build { grid-template-columns: var(--rl-rail) minmax(0, 1fr); }
  .rl-build-label { padding-left: .25rem; }
  .rl-live { grid-template-columns: var(--rl-rail) 6.5rem minmax(0, 1fr) var(--rl-rail); grid-template-areas: "label label label rail"; }
  .rl-live-label { justify-self: end; padding-right: .25rem; }
  .rl-lane { grid-template-columns: var(--rl-rail) 6.5rem minmax(0, 1fr) var(--rl-rail); grid-template-areas: "in name steps out"; }
  .rl-name { align-self: start; justify-self: stretch; margin: .5rem .75rem 0; min-width: 0; }
  .rl-name::before, .rl-name::after {
    content: "";
    position: absolute;
    top: 50%;
    width: .75rem;
    border-top: var(--line) solid var(--decide-line-strong);
  }
  .rl-name { position: relative; }
  .rl-name::before { right: 100%; }
  .rl-name::after { left: 100%; }
  .rl-out { display: block; grid-area: out; }
  .rl-in .rl-elbow { left: 50%; right: 0; }
  .rl-out .rl-elbow { left: 0; right: 50%; }
  .rl-lane.is-last .rl-in .rl-trunk { bottom: auto; height: var(--rl-y); }
  .rl-lane.is-first .rl-out .rl-trunk { top: var(--rl-y); height: auto; bottom: 0; }
  .rl-steps { display: flex; }
  .rl-step { display: block; flex: 1 1 0; min-width: 0; padding-top: .75rem; }
  .rl-track { height: 1rem; }
  .rl-step .decide-node { --x: 0%; --y: 50%; }
  .rl-h { display: inline; }
  .rl-v, .rl-step:last-child .rl-v { display: none; }
  .rl-text { padding: .5rem .75rem 1rem 0; }
}

@media (forced-colors: active) {
  .rl-step[data-flow="stop"] .rl-link .rl-dash { stroke: CanvasText; }
}

/* ---------- six-errors (UI/UX & Product Design, decide/six-errors.html, spec §6.6) ----------
   A sample sign-up card in real HTML, and beside it the hears, effect and rule lines of the chosen state. The card is
   a demo and inert; each of its five elements is a pair, the fixed version (.se-ok) and the broken one (.se-bad, aria-hidden).
   States, from data-state on the root (decide.js's generic path sets it, one button per state):
     fixed      the working card; Create account carries the one spark
     contrast   the helper text takes --se-demo-low
     alt        the logo is outlined as the broken part (the card looks the same; a screen reader reads the filename)
     label      the field loses its label, outlined
     link       the Learn more link loses its name, an icon alone, outlined
     button     the close button, an icon with no label, outlined
     lang       no change on the card; only its hears line differs
   A broken part is outlined with a dashed border and nothing else: shape, never colour.
   The lines are the visible readout; the frame's own readout is visually hidden for this kind so the words aren't doubled. */
.se { container-type: inline-size; container-name: se; }
.se-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
.se-card {
  /* DEMO ONLY: the one deliberately failing colour on the site, 2.8:1 on the card's --color--gray-1.
     It is the contrast state's helper text and nothing else, and it exists to show the error. */
  --se-demo-low: #565d68;
  box-sizing: border-box;
  max-width: 20rem;
  padding: 1.5rem;
  border: var(--line-hair) solid var(--decide-line);
  border-radius: 16px;
  background: var(--color--gray-1);
  color: var(--decide-ink);
  font-size: .9375rem;
  line-height: 1.4;
  user-select: none;
}
.se-card p { margin: 0; }
.se-card img { display: block; height: 2rem; width: auto; }
.se-ok, .se-bad { display: block; }
.se-bad { display: none; }
.se-card .se-heading { margin-top: 1rem; color: var(--decide-ink); font-size: 1.25rem; font-weight: 500; line-height: 1.25; }
.se-field { margin-top: 1.25rem; }
.se-label { display: block; margin-bottom: .375rem; color: var(--decide-ink); font-size: .8125rem; }
.se-label--none { visibility: hidden; }
.se-input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 2.5rem;
  padding: 0 .75rem;
  border: var(--line-hair) solid var(--decide-line);
  border-radius: 8px;
  background: var(--decide-ground);
  color: var(--decide-ink);
  font: inherit;
}
.se-card .se-helper { margin-top: .5rem; color: var(--color--gray-3); font-size: .8125rem; }
.se-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; }
.se-submit { position: relative; display: inline-block; }
.se-btn {
  height: 2.5rem;
  padding: 0 1.25rem;
  border: var(--line-hair) solid var(--decide-ink);
  border-radius: 999px;
  background: var(--color--gray-2);
  color: var(--decide-ink);
  font: inherit;
  font-weight: 500;
}
.se-icon, .se-link { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.se-icon { box-sizing: border-box; width: 2.5rem; height: 2.5rem; padding: 0; border: var(--line-hair) solid var(--decide-line); border-radius: 50%; background: transparent; }
.se-link { box-sizing: border-box; min-height: 2rem; padding: 0 .25rem; color: var(--decide-ink); text-decoration: underline; text-underline-offset: 3px; }
.se-more { margin-top: 1rem; }
.se-glyph { width: .875rem; height: .875rem; fill: none; stroke: var(--decide-ink); stroke-width: var(--line); stroke-linecap: round; stroke-linejoin: round; }

/* a broken variant replaces its fixed one, outlined by a dashed border */
.decide[data-state="alt"] .se-logo > .se-ok,
.decide[data-state="label"] .se-field > .se-ok,
.decide[data-state="link"] .se-more > .se-ok,
.decide[data-state="button"] .se-icon-wrap > .se-ok { display: none; }
.decide[data-state="alt"] .se-logo > .se-bad,
.decide[data-state="label"] .se-field > .se-bad,
.decide[data-state="link"] .se-more > .se-bad,
.decide[data-state="button"] .se-icon-wrap > .se-bad { display: block; }
.decide[data-state="alt"] .se-logo > .se-bad,
.decide[data-state="label"] .se-field > .se-bad,
.decide[data-state="link"] .se-more > .se-bad,
.decide[data-state="button"] .se-icon-wrap > .se-bad {
  padding: .25rem;
  margin: -.25rem;
  border: var(--line-hair) dashed var(--decide-ink);
  border-radius: 10px;
}
.decide[data-state="alt"] .se-logo > .se-bad { display: inline-block; }
.decide[data-state="link"] .se-more > .se-bad { display: inline-block; }
.decide[data-state="button"] .se-icon-wrap > .se-bad { border-radius: 50%; }
.decide[data-state="contrast"] .se-helper { color: var(--se-demo-low); }
.decide:not([data-state="fixed"]) .se-spark { display: none; }

/* the lines: the shown state's hears (and effect) and rule */
.se-says { display: none; }
.decide[data-state="fixed"] .se-says[data-for="fixed"],
.decide[data-state="contrast"] .se-says[data-for="contrast"],
.decide[data-state="alt"] .se-says[data-for="alt"],
.decide[data-state="label"] .se-says[data-for="label"],
.decide[data-state="link"] .se-says[data-for="link"],
.decide[data-state="button"] .se-says[data-for="button"],
.decide[data-state="lang"] .se-says[data-for="lang"] { display: grid; gap: 1rem; }
.se-line { margin: 0; color: var(--decide-ink); font-size: 1.0625rem; line-height: 1.5; text-wrap: pretty; }
.se-line--effect { color: var(--color--gray-3); }
.se-line-label {
  display: block;
  margin-bottom: .375rem;
  color: var(--color--gray-3);
  font-family: var(--_typography---font-family--body-alt);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .12em;
  line-height: 1.3;
  text-transform: uppercase;
}
.decide[data-decide="six-errors"] .decide-readout {
  position: absolute !important; width: 1px; height: 1px; min-height: 0; margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
@container se (min-width: 34rem) {
  .se-grid { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); align-items: start; gap: 2rem; }
}
@media (forced-colors: active) {
  .se-card { border-color: CanvasText; }
  .decide[data-state="contrast"] .se-helper { color: GrayText; }
}

/* ---------- follow-order (Custom Software & Integrations, decide/follow-order.html, spec §6.7) ----------
   Nine cards on one grid, the SVG behind them running centre to centre so the opaque cards cut it into the
   gaps. Wide (from 34rem): four columns by three equal rows in a 400 by 300 box. Shop, Integration and Count
   span the two flow rows (middle at y 100), Accounting is at y 50 and Warehouse at y 150, the recovery chain
   (Retry, Holding queue, Alert, Replay) fills the third row at y 250. Narrow: two columns by eight equal rows
   in a 200 by 800 box, the chain stacked under Count; the links to and from the chain run down side rails (e1 left x 5, e2 right x 195).
   A card is dim by default: a hairline border, grey text and a hollow dot. A lit card has a solid border, white
   text and a filled dot. A failed card (the Warehouse when it is down) takes a dashed border, a hollow dot and
   its word. Each line (.fo-l) has a hairline track always, a solid stroke or a dashed one by state.
   States, from data-state on the root (decide.js's generic path sets it, one button per state):
     ok       lit: Shop, Integration, Accounting, Warehouse, Count; lines a, b1, b2, c1, c2; Count has the spark
     down     lit: Shop, Integration, Accounting, the chain; the Warehouse is failed; b2 is dashed, e1, r1 to r3
              and e2 (back to the Warehouse) are solid; Count and its lines are dim
     twice    lit: Shop, Integration, both systems; the second order chip shows, dashed; Integration says Dropped
     renamed  lit: Shop and Integration only; Integration says Contract test; b1 and b2 are dashed
   Failure and blocked are a dashed stroke or border, a hollow dot and a word, never a colour. */
.fo { container-type: inline-size; container-name: fo; }
.fo-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(8, 4.25rem);
  max-width: 44rem;
  margin-inline: auto;
  padding-inline: 1.25rem; /* room for the two side rails (e1 left, e2 right) */
}
.fo-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.fo-svg--wide { display: none; }
.fo-track {
  fill: none;
  stroke: var(--decide-line-faint);
  stroke-width: var(--line-hair);
  vector-effect: non-scaling-stroke;
}
.fo-dashed {
  fill: none;
  stroke: var(--decide-line);
  stroke-width: var(--line-hair);
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
}
.fo-solid, .fo-dashed { opacity: 0; }

.fo-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  align-self: center;
  box-sizing: border-box;
  min-height: 2.75rem;
  margin: 0 .375rem;
  padding: .375rem .75rem .375rem 1.75rem;
  border: var(--line-hair) solid var(--decide-line-faint);
  border-radius: 12px;
  background: var(--decide-ground);
  color: var(--color--gray-3);
  font-size: .9375rem;
  line-height: 1.25;
  transition: border-color var(--decide-move) var(--ease-out), color var(--decide-move) var(--ease-out);
}
.fo-card .decide-node {
  left: .75rem;
  top: 50%;
  border: 1px solid var(--decide-ink);
  background: var(--decide-ground);
}
.fo-name { min-width: 0; overflow-wrap: anywhere; }
.fo-shop, .fo-hub, .fo-count { grid-column: 1 / -1; margin-inline: .375rem; }
.fo-shop { grid-row: 1; }
.fo-hub { grid-row: 2; }
.fo-acc { grid-column: 1; grid-row: 3; }
.fo-wh { grid-column: 2; grid-row: 3; }
.fo-count { grid-row: 4; }
.fo-retry, .fo-hold, .fo-alert, .fo-replay { grid-column: 1 / -1; }
.fo-retry { grid-row: 5; }
.fo-hold { grid-row: 6; }
.fo-alert { grid-row: 7; }
.fo-replay { grid-row: 8; }

/* the words and the second order: out of sight until their state, in the layout's own place */
.fo-tag, .fo-chip {
  padding: .125rem .5rem;
  border: var(--line-hair) solid var(--decide-line);
  border-radius: 999px;
  background: var(--decide-ground);
  color: var(--decide-ink);
  font-family: var(--_typography---font-family--body-alt);
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: .12em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity var(--decide-move) var(--ease-out), visibility var(--decide-move);
}
.fo-tag { position: absolute; z-index: 2; opacity: 0; visibility: hidden; }
.fo-hub .fo-tag { right: .625rem; top: 50%; translate: 0 -50%; }
.fo-wh .fo-tag { left: 50%; bottom: calc(100% + .125rem); translate: -50% 0; }
.fo-chips { position: absolute; right: .625rem; top: 50%; display: flex; gap: .25rem; translate: 0 -50%; }
.fo-chip { letter-spacing: .06em; text-transform: none; font-size: .6875rem; }
.fo-chip--second { border-style: dashed; opacity: 0; visibility: hidden; }

/* lit cards: a solid border, white text, a filled dot */
.decide[data-state="ok"] :is(.fo-shop, .fo-hub, .fo-acc, .fo-wh, .fo-count),
.decide[data-state="down"] :is(.fo-shop, .fo-hub, .fo-acc, .fo-retry, .fo-hold, .fo-alert, .fo-replay),
.decide[data-state="twice"] :is(.fo-shop, .fo-hub, .fo-acc, .fo-wh),
.decide[data-state="renamed"] :is(.fo-shop, .fo-hub) { border-color: var(--decide-line); color: var(--decide-ink); }
.decide[data-state="ok"] :is(.fo-shop, .fo-hub, .fo-acc, .fo-wh, .fo-count) .decide-node,
.decide[data-state="down"] :is(.fo-shop, .fo-hub, .fo-acc, .fo-retry, .fo-hold, .fo-alert, .fo-replay) .decide-node,
.decide[data-state="twice"] :is(.fo-shop, .fo-hub, .fo-acc, .fo-wh) .decide-node,
.decide[data-state="renamed"] :is(.fo-shop, .fo-hub) .decide-node { background: var(--decide-ink); }
/* the sparkle only where the story lands, in ok */
.decide[data-state]:not([data-state="ok"]) .fo-count .decide-node.is-spark { box-shadow: none; animation: none; }

/* down: the Warehouse is failed, by a dashed border, its hollow dot and the word */
.decide[data-state="down"] .fo-wh { border-style: dashed; border-color: var(--decide-line); color: var(--decide-ink); }
.decide[data-state="down"] .fo-wh .fo-tag--down { opacity: 1; visibility: visible; }
/* twice: the second copy enters (dashed) and the Integration says Dropped */
.decide[data-state="twice"] .fo-chip--second { opacity: 1; visibility: visible; }
.decide[data-state="twice"] .fo-hub .fo-tag--drop { opacity: 1; visibility: visible; }
/* renamed: the contract test stops it at the Integration */
.decide[data-state="renamed"] .fo-hub .fo-tag--contract { opacity: 1; visibility: visible; }

/* lines: solid where the state runs, dashed where it is cut, only the track elsewhere */
.decide[data-state="ok"] :is(.fo-l-a, .fo-l-b1, .fo-l-b2, .fo-l-c1, .fo-l-c2) .fo-solid,
.decide[data-state="down"] :is(.fo-l-a, .fo-l-b1, .fo-l-e1, .fo-l-r1, .fo-l-r2, .fo-l-r3, .fo-l-e2) .fo-solid,
.decide[data-state="twice"] :is(.fo-l-a, .fo-l-b1, .fo-l-b2) .fo-solid,
.decide[data-state="renamed"] .fo-l-a .fo-solid { opacity: 1; }
.decide[data-state="down"] .fo-l-b2 .fo-dashed,
.decide[data-state="renamed"] :is(.fo-l-b1, .fo-l-b2) .fo-dashed { opacity: 1; }

/* wide: left to right */
@container fo (min-width: 34rem) {
  .fo-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(3, 1fr);
    aspect-ratio: 4 / 3;
    padding-inline: 0;
  }
  .fo-svg--narrow { display: none; }
  .fo-svg--wide { display: block; }
  .fo-card {
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    margin: 0 .5rem;
    padding: 1.75rem .25rem .5rem;
    font-size: .8125rem;
    text-align: center;
  }
  .fo-card .decide-node { left: 50%; top: .75rem; }
  .fo-shop, .fo-hub, .fo-count { grid-column: auto; grid-row: 1 / 3; margin-inline: .5rem; }
  .fo-shop { grid-column: 1; }
  .fo-hub { grid-column: 2; }
  .fo-acc { grid-column: 3; grid-row: 1; }
  .fo-wh { grid-column: 3; grid-row: 2; }
  .fo-count { grid-column: 4; }
  .fo-retry, .fo-hold, .fo-alert, .fo-replay { grid-row: 3; }
  .fo-retry { grid-column: 1; }
  .fo-hold { grid-column: 2; }
  .fo-alert { grid-column: 3; }
  .fo-replay { grid-column: 4; }
  .fo-hub .fo-tag { right: auto; left: 50%; top: auto; bottom: calc(100% + .25rem); translate: -50% 0; }
  .fo-chips { right: auto; left: 50%; top: calc(100% + .25rem); flex-direction: column; align-items: center; translate: -50% 0; }
}

@media (forced-colors: active) {
  .decide[data-state] .fo-solid { stroke: var(--decide-line-strong); }
}

/* ---------- megabytes (3D & WebGL, decide/megabytes.html, spec §6.8) ----------
   Two bars and a line of steps. Each bar is on its own fixed scale, so raw (80 MB, 340 MB) is the full width and the
   other states are their share of it; --dl and --mem are those widths per state (value over raw's value, tested
   against decide.data), and the fill's width follows them over --decide-move, so the change is a CSS transition.
   Each bar shows every state's value as text, only the one for data-state visible. The dashed budget mark stands at
   4 MB over 80 MB of the download bar (5%): the fill reaches past it until the textures step and stops short of it
   in done. The steps are a line of nodes, filled up to the state shown (raw fills the first only); the last node and
   its words, Inside the budget, light in done only, and it carries the one spark. Wide (from 34rem): the steps run
   in a row, each node over its label, a hairline through them; narrow: they stack, node left of label, the hairline
   running down through the nodes. Nothing here is a hue: a fill is
   --decide-line, the budget mark is --decide-line-strong. */
.mb { container-type: inline-size; container-name: mb; display: grid; gap: 2.5rem; }
.decide[data-state="raw"] .mb { --dl: 100%; --mem: 100%; }
.decide[data-state="reduce"] .mb { --dl: 22.5%; --mem: 88.235%; }
.decide[data-state="geometry"] .mb { --dl: 7.5%; --mem: 82.353%; }
.decide[data-state="textures"] .mb { --dl: 4%; --mem: 25%; }
.decide[data-state="lod"] .mb { --dl: 4.25%; --mem: 25%; }
.decide[data-state="done"] .mb { --dl: 4.25%; --mem: 25%; }
.mb-bars { display: grid; gap: 2.75rem; }
.mb-bar--dl { --w: var(--dl, 4.25%); }
.mb-bar--mem { --w: var(--mem, 25%); }
.mb-bar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0 .625rem; }
.mb-bar-name { color: var(--color--gray-5); font-size: .9375rem; font-weight: 500; line-height: 1.3; }
.mb-vals { display: grid; justify-items: end; }
.mb-val {
  grid-area: 1 / 1;
  color: var(--decide-ink);
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--decide-move) var(--ease-out), visibility var(--decide-move);
}
.decide[data-state="raw"] .mb-val[data-for="raw"],
.decide[data-state="reduce"] .mb-val[data-for="reduce"],
.decide[data-state="geometry"] .mb-val[data-for="geometry"],
.decide[data-state="textures"] .mb-val[data-for="textures"],
.decide[data-state="lod"] .mb-val[data-for="lod"],
.decide[data-state="done"] .mb-val[data-for="done"] { opacity: 1; visibility: visible; }

.mb-track {
  position: relative;
  box-sizing: border-box;
  height: 1.125rem;
  border: var(--line-hair) solid var(--decide-line-faint);
  border-radius: 999px;
}
.mb-fill {
  display: block;
  box-sizing: border-box;
  width: var(--w);
  min-width: .375rem;
  max-width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--decide-line);
  transition: width var(--decide-move) var(--ease-out);
}
.mb-budget {
  position: absolute;
  top: -.5rem;
  bottom: -.5rem;
  z-index: 1;
  border-left: var(--line) dashed var(--decide-line-strong);
}
.mb-budget-label {
  position: absolute;
  top: 100%;
  left: .5rem;
  margin-top: .125rem;
  color: var(--color--gray-5);
  font-family: var(--_typography---font-family--body-alt);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .12em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
}

/* the steps: a line of nodes, hollow until applied */
.mb-steps { position: relative; display: grid; gap: .25rem; margin: 0; padding: 0; list-style: none; }
/* narrow: a hairline down through the stacked nodes, first node to last (each row is at least 3rem, node centred) */
.mb-steps::before {
  content: "";
  position: absolute;
  top: 1.5rem;
  bottom: 1.5rem;
  left: calc(.5rem + var(--node) / 2 - var(--line-hair) / 2);
  border-left: var(--line-hair) solid var(--decide-line-faint);
}
.mb-item { position: relative; min-width: 0; }
.mb-step {
  display: flex;
  align-items: center;
  gap: .75rem;
  box-sizing: border-box;
  width: 100%;
  min-height: 3rem;
  margin: 0;
  padding: .25rem .5rem;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--color--gray-3);
  font: inherit;
  font-size: .9375rem;
  line-height: 1.25;
  text-align: left;
  transition: color var(--decide-move) var(--ease-out), box-shadow var(--decide-move) var(--ease-out);
}
button.mb-step { cursor: pointer; }
button.mb-step[disabled] { cursor: default; }
.mb-step .decide-node {
  position: relative;
  z-index: 1;
  left: auto;
  top: auto;
  flex: none;
  margin: 0;
  border: 1px solid var(--decide-ink);
  background: var(--decide-ground);
}
.mb-step-label { min-width: 0; overflow-wrap: anywhere; }
.mb-step[aria-pressed="true"] { color: var(--decide-ink); box-shadow: inset 0 0 0 var(--line-hair) var(--decide-line); }
@media (hover: hover) {
  button.mb-step:not([disabled]):hover { color: var(--decide-ink); }
}

/* applied: every node up to the state shown is filled and its label white (raw fills the first only) */
.decide[data-state="raw"] .mb-item:nth-child(-n+1) .mb-step,
.decide[data-state="reduce"] .mb-item:nth-child(-n+2) .mb-step,
.decide[data-state="geometry"] .mb-item:nth-child(-n+3) .mb-step,
.decide[data-state="textures"] .mb-item:nth-child(-n+4) .mb-step,
.decide[data-state="lod"] .mb-item:nth-child(-n+5) .mb-step,
.decide[data-state="done"] .mb-item .mb-step { color: var(--decide-ink); }
.decide[data-state="raw"] .mb-item:nth-child(-n+1) .decide-node,
.decide[data-state="reduce"] .mb-item:nth-child(-n+2) .decide-node,
.decide[data-state="geometry"] .mb-item:nth-child(-n+3) .decide-node,
.decide[data-state="textures"] .mb-item:nth-child(-n+4) .decide-node,
.decide[data-state="lod"] .mb-item:nth-child(-n+5) .decide-node,
.decide[data-state="done"] .mb-item .decide-node { background: var(--decide-ink); }

/* the end node: its words and the sparkle only where the story lands, in done */
.mb-end .mb-step-label { opacity: 0; visibility: hidden; transition: opacity var(--decide-move) var(--ease-out), visibility var(--decide-move); }
.decide[data-state="done"] .mb-end .mb-step-label { opacity: 1; visibility: visible; }
.decide[data-state]:not([data-state="done"]) .mb-end .decide-node.is-spark { box-shadow: none; animation: none; }

/* wide: one row, node over label, a hairline through the nodes */
@container mb (min-width: 34rem) {
  .mb-steps { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; }
  .mb-steps::before { content: none; }
  .mb-item::before {
    content: "";
    position: absolute;
    top: calc(.5rem + var(--node) / 2);
    left: 0;
    right: 0;
    border-top: var(--line-hair) solid var(--decide-line-faint);
  }
  .mb-item:first-child::before { left: 50%; }
  .mb-item:last-child::before { right: 50%; }
  .mb-step { flex-direction: column; align-items: center; gap: .5rem; height: 100%; padding: .5rem .25rem; font-size: .8125rem; text-align: center; }
}

@media (forced-colors: active) {
  .mb-fill { forced-color-adjust: none; background: CanvasText; }
  .mb-budget { border-left-color: CanvasText; }
}

/* ---------- error-budget (DevOps & Cloud, decide/error-budget.html, spec §6.9) ----------
   One bar for the month. The remaining budget is a solid fill from the left, --left of the width; the outages are
   hatched, outlined segments packed against the right edge, --used of the width, one .eb-seg each with its minutes in
   --m (flex-grow), so the bar empties from the right and each outage is a shape of its own. decide.js sets --left and
   --used on .eb and the width change is a CSS transition. The dashed marker stands --eb-mark (20%) in from the right edge: a
   segment that reaches left of it is an outage over a fifth of the budget, which needs a postmortem; in
   data-state="postmortem" the marker and its label turn to the strong line and ink. In data-state="spent" the whole
   track is hatched, the spark is off and the box "Budget spent" appears, dashed, so spent is a shape and a word. The
   spark sits at the end of the remaining budget. Wide (from 34rem): the name and the spent word share a row; narrow:
   they stack. Nothing is a hue: the fill is --decide-line, the marker --decide-line-strong. */
.eb { container-type: inline-size; container-name: eb; display: grid; gap: .875rem; }
.eb-head { display: grid; justify-items: start; gap: .5rem; }
.eb-label { margin: 0; color: var(--color--gray-5); font-size: .9375rem; font-weight: 500; line-height: 1.3; }
.eb-spent {
  box-sizing: border-box;
  padding: .25rem .75rem;
  border: var(--line) dashed var(--decide-line-strong);
  border-radius: 999px;
  color: var(--decide-ink);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.3;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--decide-move) var(--ease-out), visibility var(--decide-move);
}
.decide[data-state="spent"] .eb-spent { opacity: 1; visibility: visible; }
.eb-bar { position: relative; margin-bottom: 1.75rem; --x: min(var(--left, 100%), calc(100% - var(--node))); }
.eb-track {
  position: relative;
  box-sizing: border-box;
  height: 1.75rem;
  overflow: hidden;
  border: var(--line-hair) solid var(--decide-line-faint);
  border-radius: 999px;
}
.eb-left {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--left);
  background: var(--decide-line);
  transition: width var(--decide-move) var(--ease-out);
}
.eb-used {
  position: absolute;
  inset: 0 0 0 auto;
  display: flex;
  width: var(--used);
  transition: width var(--decide-move) var(--ease-out);
}
.eb-seg {
  flex: var(--m, 1) 1 0;
  min-width: 0;
  box-sizing: border-box;
  border: var(--line) solid var(--decide-line);
  background: repeating-linear-gradient(135deg, var(--decide-line) 0 var(--line), transparent var(--line) .3125rem);
}
.eb-seg + .eb-seg { border-left-color: var(--decide-ink); }
.decide[data-state="spent"] .eb-track { border-color: var(--decide-line); }
.eb-mark {
  position: absolute;
  top: -.5rem;
  bottom: -.5rem;
  right: var(--eb-mark);
  z-index: 1;
  border-left: var(--line) dashed var(--decide-line-strong);
}
.eb-mark-label {
  position: absolute;
  top: 100%;
  right: .5rem;
  margin-top: .125rem;
  color: var(--color--gray-5);
  font-family: var(--_typography---font-family--body-alt);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .12em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
}
.decide[data-state="postmortem"] .eb-mark-label { color: var(--decide-ink); }
.eb-bar .decide-node { --y: 50%; left: var(--x); transition: left var(--decide-move) var(--ease-out), opacity var(--decide-move) var(--ease-out); }
.decide[data-state="spent"] .eb-bar .decide-node.is-spark { opacity: 0; box-shadow: none; animation: none; }
.decide .eb-actions { margin-top: .75rem; }

@container eb (min-width: 34rem) {
  .eb-head { grid-auto-flow: column; justify-content: space-between; align-items: center; }
}

@media (forced-colors: active) {
  .eb-left { forced-color-adjust: none; background: CanvasText; }
  .eb-seg { border-color: CanvasText; }
  .eb-mark { border-left-color: CanvasText; }
}

/* ---------- strangler (Legacy Modernization, decide/strangler.html, spec §6.10) ----------
   A router, the Old system and the New system, four slice chips (li.st-chip) in whichever box handles them, and a
   counter, Old system handles: the value for data-moved (.st-val[data-for], set by decide.js on .st). The router and
   the bridge code are temporary, so they are drawn dashed at --line-hair (data-temporary); the boxes are solid
   hairlines. The markup is the switched-off frame: data-state="off" hides the Old system box, the router and the
   bridge (they keep their place, so nothing jumps), and the one spark, on the New system's name, is lit only there.
   Chips in the New system are outlined in ink, in the Old system in the dim line; moving one is a translate from where
   it was (.is-flying, set by decide.js). The router has two dashed connectors, one into each system (spec §6.10: it
   sends each part to the old system or the new one): ::after into the Old system, and .st-route, which goes round the
   Old system into the New one. Wide (container query, 34rem): router, Old system, New system side by side, the
   bridge between the boxes, the route a dashed U under the row from the router's centre to the New system's (the
   column maths below follows the grid's fr split); chips stacked so the boxes hold four. Narrow: stacked, router then
   old then new, connectors running down, the Old system and bridge leaving a 1.5rem gutter on the right for the route.
   Nothing is a hue. */
.st { container-type: inline-size; container-name: st; display: grid; gap: 1.5rem; min-width: 0; }
.st-counter { margin: 0; color: var(--color--gray-5); font-size: .9375rem; font-weight: 500; line-height: 1.3; }
.st-vals { display: inline-grid; justify-items: start; }
.st-val {
  grid-area: 1 / 1;
  color: var(--decide-ink);
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--decide-move) var(--ease-out), visibility var(--decide-move);
}
.st[data-moved="0"] .st-val[data-for="0"],
.st[data-moved="1"] .st-val[data-for="1"],
.st[data-moved="2"] .st-val[data-for="2"],
.st[data-moved="3"] .st-val[data-for="3"],
.st[data-moved="4"] .st-val[data-for="4"] { opacity: 1; visibility: visible; }
.st-map { display: grid; grid-template-columns: minmax(0, 1fr) 1.5rem; min-width: 0; }
.st-router, .st-new { grid-column: 1 / -1; }
.st-old, .st-bridge { grid-column: 1; }
.st-route { grid-column: 2; grid-row: 2 / 4; justify-self: center; width: 0; margin-top: -1.5rem; border-left: var(--line-hair) dashed var(--decide-line); transition: opacity var(--decide-move) var(--ease-out), visibility var(--decide-move); }
.st-name { margin: 0; display: flex; align-items: center; gap: .625rem; color: var(--color--gray-5); font-size: .9375rem; font-weight: 500; line-height: 1.3; }
.st-router, .st-box {
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  padding: 1rem;
  border-radius: 12px;
  transition: opacity var(--decide-move) var(--ease-out), visibility var(--decide-move);
}
.st-box { border: var(--line-hair) solid var(--decide-line-faint); }
.st-router { display: flex; align-items: center; margin-bottom: 1.5rem; }
[data-temporary] { border: var(--line-hair) dashed var(--decide-line); }
.st-router::after { content: ""; position: absolute; top: 100%; left: 50%; height: 1.5rem; border-left: var(--line-hair) dashed var(--decide-line); }
.st-bridge { position: relative; display: flex; align-items: center; justify-content: center; min-height: 3rem; border: 0; }
.st-bridge::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: var(--line-hair) dashed var(--decide-line); }
.st-bridge-label {
  position: relative;
  padding: .125rem .5rem;
  background: var(--decide-ground);
  color: var(--color--gray-5);
  font-family: var(--_typography---font-family--body-alt);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .12em;
  line-height: 1.3;
  text-align: center;
  text-transform: uppercase;
}
.st-chips { display: flex; flex-wrap: wrap; align-content: flex-start; gap: .5rem; min-height: 5.5rem; margin: .75rem 0 0; padding: 0; list-style: none; }
.st-chip {
  box-sizing: border-box;
  max-width: 100%;
  padding: .375rem .75rem;
  border: var(--line-hair) solid var(--decide-line);
  border-radius: 999px;
  color: var(--color--gray-5);
  font-size: .8125rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.st-new .st-chip { border-color: var(--decide-line-strong); color: var(--decide-ink); }
.st-chip.is-flying { transition: translate var(--decide-move) var(--ease-out); }
.st-new .st-name .decide-node { position: relative; left: auto; top: auto; flex: none; margin: 0; }
.decide[data-state]:not([data-state="off"]) .st-new .decide-node.is-spark { box-shadow: none; animation: none; opacity: 0; }

/* off: the old system, the router and the bridge code are gone */
.decide[data-state="off"] .st-old,
.decide[data-state="off"] .st-router,
.decide[data-state="off"] .st-bridge,
.decide[data-state="off"] .st-route { opacity: 0; visibility: hidden; }

/* wide: left to right, the boxes holding four chips each */
@container st (min-width: 34rem) {
  .st-map { --st-free: calc(100cqi - 5.5rem); grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) 5.5rem minmax(0, 1.2fr); align-items: stretch; }
  .st-router, .st-old, .st-bridge, .st-new { grid-row: 1; grid-column: auto; }
  /* the U from the router's centre to the New system's: .8 of 3.2 fr is the router's column (less its 1.5rem gap),
     1.2 of 3.2 the New system's */
  .st-route {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: stretch;
    width: auto;
    height: 1.5rem;
    margin: 0 calc(var(--st-free) * .1875) 0 calc(var(--st-free) * .125 - .75rem);
    border: var(--line-hair) dashed var(--decide-line);
    border-top: 0;
  }
  .st-router { margin: 0 1.5rem 0 0; }
  .st-router::after { top: 50%; left: 100%; width: 1.5rem; height: 0; border-left: 0; border-top: var(--line-hair) dashed var(--decide-line); }
  .st-bridge { min-height: 0; }
  .st-bridge::before { top: 50%; bottom: auto; left: 0; right: 0; border-left: 0; border-top: var(--line-hair) dashed var(--decide-line); }
  .st-bridge-label { position: absolute; bottom: calc(50% + .25rem); background: none; }
  .st-chips { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; min-height: 11.5rem; }
}

@media (forced-colors: active) {
  [data-temporary], .st-route, .st-chip { border-color: CanvasText; }
  .st-box { border-color: GrayText; }
}

/* ---------- severity (Support & Maintenance, decide/severity.html, spec §6.11) ----------
   A 3 x 3 grid: rows are how many people are affected, columns whether there is a workaround, and each cell is a
   button (role="gridcell" around it, arrow keys move between cells) showing its severity, S1 to S4, all the time. The
   grid is the control, so the frame's own control is hidden (the override renders nothing). The selected cell
   (aria-pressed="true") is marked by shape, never colour: a ring at the main --line weight on top of the hairline
   every cell has, and a filled ground. Without JS the buttons are disabled in the default cell. The one spark sits
   in the S1 cell and is lit only while that cell is the selected one (data-state="r0c0", set by decide.js).
   .sv is a size container. Wide (34rem and up) and narrow are both the 3 x 3 grid: narrow trims the headers and
   cells and lets the labels wrap, so nothing scrolls sideways at 320px. */
.sv { container-type: inline-size; container-name: sv; --sv-head: 4.25rem; --sv-gap: .375rem; min-width: 0; }
.decide[data-decide="severity"] .decide-controls { display: none; } /* the cells are the control */
.sv-grid { display: grid; gap: var(--sv-gap); min-width: 0; }
.sv-row { display: grid; grid-template-columns: var(--sv-head) repeat(3, minmax(0, 1fr)); gap: var(--sv-gap); align-items: stretch; min-width: 0; }
.sv-colhead, .sv-rowhead {
  display: flex;
  min-width: 0;
  color: var(--color--gray-5);
  font-size: .75rem;
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.sv-colhead { align-items: flex-end; padding-bottom: .125rem; }
.sv-rowhead { align-items: center; }
.sv-cell { display: flex; min-width: 0; }
.sv-btn {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 0;
  min-height: 3.5rem;
  padding: .5rem;
  border: var(--line-hair) solid var(--decide-line);
  border-radius: 10px;
  background: none;
  color: var(--color--gray-3);
  font: inherit;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s;
}
.sv-sev { font-size: 1.125rem; font-variant-numeric: tabular-nums; font-weight: 500; line-height: 1; }
.sv-btn[aria-pressed="true"] {
  border-color: var(--decide-ink);
  background: var(--color--gray-2);
  box-shadow: inset 0 0 0 calc(var(--line) - var(--line-hair)) var(--decide-ink), 0 0 0 calc(var(--line) - var(--line-hair)) var(--decide-ink);
  color: var(--decide-ink);
}
.sv-btn[disabled] { cursor: default; } /* no script yet: the default cell, nothing to press */
@media (hover: hover) {
  .sv-btn:not([disabled]):hover { background: var(--color--gray-2); border-color: var(--decide-ink); color: var(--decide-ink); }
}
.sv-btn .decide-node { --x: calc(100% - .75rem); --y: .75rem; }
.decide[data-state]:not([data-state="r0c0"]) .sv-btn .decide-node.is-spark { box-shadow: none; animation: none; opacity: 0; }

@container sv (min-width: 34rem) {
  .sv { --sv-head: 7.5rem; --sv-gap: .5rem; }
  .sv-btn { min-height: 4.75rem; }
  .sv-sev { font-size: 1.5rem; }
  .sv-colhead, .sv-rowhead { font-size: .875rem; }
}

@media (forced-colors: active) {
  .sv-btn { border-color: GrayText; }
  .sv-btn[aria-pressed="true"] { border-color: CanvasText; border-width: var(--line); box-shadow: none; }
}
