/* Switchblade core parts (D159). Every value is a token from tokens/tokens.css; the only literals allowed
   here are 0, 1 and percentages, and check.mjs refuses anything else. Each part offers fixed options as
   data- attributes and nothing else: a screen never styles a part.
   States: real pseudo-classes carry hover, pressed and focus; the matching .is-hover, .is-pressed and
   .is-focus classes exist only so the style page can show those states at rest. */

/* ---------- base ---------- */
.sb, .sb * , .sb *::before, .sb *::after { box-sizing: border-box; }
.sb {
  background: var(--surface-page);
  color: var(--text-main);
  font-family: var(--font-text);
  font-size: var(--type-body);
  font-weight: var(--type-weight-regular);
  line-height: var(--type-line-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.sb :focus-visible { outline: none; box-shadow: var(--elevation-focus); }
.sb a:not([class]) { color: var(--action-base); text-decoration: none; }
.sb a:not([class]):hover { text-decoration: underline; text-underline-offset: calc(var(--size-hair) * 2); }
.sb a[class] { color: inherit; text-decoration: none; }
.sb svg { display: block; }
/* Faint (#808080, D612 DS-2) reads 4.41:1 on raised and 3.93:1 on pressed, under AA (check.mjs K4 lists both
   as not offered). So wherever a part's surface is raised or pressed, faint text takes the second grey:
   the role is re-pointed inside that box, and no part reads a value. values.mjs holds it on the page. */
.sb-menu, .sb-mark[data-fill],
.sb-row[data-press]:hover, .sb-row.is-hover, .sb-row[data-press]:active, .sb-row.is-pressed,
.sb-card[data-press]:hover, .sb-card.is-hover, .sb-card[data-press]:active, .sb-card.is-pressed,
.sb-tab:hover, .sb-tab.is-hover, .sb-tab:active, .sb-tab.is-pressed, .sb-tab[aria-selected="true"], .sb-table__row[data-press]:hover, .sb-table__row.is-hover, .sb-table__row[data-press]:active,
.sb-btn[data-kind="secondary"], .sb-btn[data-kind="quiet"], .sb-btn[data-kind="quiet"]:hover, .sb-btn[data-kind="quiet"].is-hover, .sb-btn[data-kind="quiet"]:active, .sb-btn[data-kind="quiet"].is-pressed,
.sb-check.is-pressed, .sb-check:active { --text-faint: var(--text-second); }

/* ---------- type roles ---------- */
/* The ladder (P9; the Geist and HIG ladders): every step is one class that carries its size, its own leading,
   its tracking and its weight together, so a screen never sets one without the others. */
.sb-head { font-size: var(--type-head); line-height: var(--type-line-head); font-weight: var(--type-weight-semibold); letter-spacing: var(--type-tracking-display); color: var(--text-main); }
.sb-title { font-size: var(--type-title); line-height: var(--type-line-title); font-weight: var(--type-weight-semibold); letter-spacing: var(--type-tracking-title); color: var(--text-main); }
.sb-lead { font-size: var(--type-lead); line-height: var(--type-line-lead); font-weight: var(--type-weight-medium); color: var(--text-main); }
.sb-body { font-size: var(--type-body); line-height: var(--type-line-row); color: var(--text-main); }
.sb-small { font-size: var(--type-small); line-height: var(--type-line-small); color: var(--text-second); }
.sb-faint { color: var(--text-faint); }
.sb-label { font-size: var(--type-label); line-height: var(--type-line-label); font-weight: var(--type-weight-semibold); letter-spacing: var(--type-tracking-caps); text-transform: uppercase; color: var(--text-faint); }
.sb-num { font-family: var(--font-numeral); font-variant-numeric: tabular-nums; }
.sb-time { font-family: var(--font-time); font-variant-numeric: tabular-nums; }
/* the mono voice (P14): a code, an id, a key. Never a figure. */
.sb-code { font-family: var(--font-code); font-size: var(--type-small); line-height: var(--type-line-small); color: var(--text-second); }
/* Big figures (D619, amending D566): Inter with tabular digits, set tight and a little light. Each piece is
   trimmed to cap height and baseline (text-box), so a raised cent or a centered arrow lines up by rule. */
.sb-reading, .sb-display { font-family: var(--font-figure); font-weight: var(--type-weight-figure); letter-spacing: var(--type-tracking-figure); line-height: 1; font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: flex-start; white-space: nowrap; text-box: trim-both cap alphabetic; }
.sb-reading { font-size: var(--type-reading); }
.sb-display { font-size: var(--type-display); }
.sb-display > *, .sb-reading > * { text-box: trim-both cap alphabetic; }
/* the currency sign and the cents: raised to the cap line at 46 percent, never under the label size */
.sb-minor { font-size: max(calc(100% * var(--type-minor)), var(--type-label)); letter-spacing: 0; color: var(--text-second); }
.sb-minor:first-child { margin-right: calc(var(--type-side-gap) / 4); }
.sb-minor:last-child { margin-left: calc(var(--type-side-gap) / 3); }

/* ---------- 1 Button ---------- */
/* Button B, Lit (D619): every kind is a filled, lit shape with a visible edge (his note 5): a gradient fill,
   a light top edge, its own hairline, a dark outer ring. Pressing flips the light into the button. */
.sb-btn {
  appearance: none; border: var(--size-hair) solid var(--edge-inner); margin: 0; cursor: pointer;
  height: var(--button-height); padding: 0 var(--button-pad); border-radius: var(--button-radius);
  font: inherit; font-weight: var(--type-weight-medium); line-height: 1; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  position: relative; user-select: none; color: var(--text-main);
  background-color: var(--surface-lift); background-image: linear-gradient(var(--surface-lift-top), var(--surface-lift));
  box-shadow: inset 0 var(--size-hair) 0 var(--edge-light), 0 0 0 var(--size-hair) var(--edge-dark), 0 var(--size-hair) calc(var(--size-hair) * 2) var(--edge-shadow);
  transition: background-color var(--motion-fade) var(--motion-out), color var(--motion-fade) var(--motion-out), border-color var(--motion-fade) var(--motion-out), box-shadow var(--motion-fade) var(--motion-out);
}
.sb-btn[data-size="small"] { height: var(--button-height-small); padding: 0 var(--space-2); font-size: var(--type-small); border-radius: var(--button-radius-small); }
.sb-btn[data-kind="primary"] { color: var(--text-on-action); border-color: var(--action-top); background-color: var(--action-fill); background-image: linear-gradient(var(--action-top), var(--action-fill));
  box-shadow: inset 0 var(--size-hair) 0 var(--edge-light), 0 0 0 var(--size-hair) var(--action-night), 0 var(--size-hair) calc(var(--size-hair) * 3) var(--action-glow); }
.sb-btn[data-kind="primary"]:hover, .sb-btn[data-kind="primary"].is-hover { background-image: linear-gradient(var(--action-top-hover), var(--action-fill)); }
.sb-btn[data-kind="primary"]:active, .sb-btn[data-kind="primary"].is-pressed { background-color: var(--action-fill-pressed); background-image: linear-gradient(var(--action-fill-pressed), var(--action-fill));
  box-shadow: inset 0 var(--size-hair) calc(var(--size-hair) * 3) var(--edge-dark), 0 0 0 var(--size-hair) var(--action-night); }
.sb-btn[data-kind="secondary"]:hover, .sb-btn[data-kind="secondary"].is-hover { background-image: linear-gradient(var(--surface-lift-hover-top), var(--surface-lift-hover)); }
.sb-btn[data-kind="quiet"] { color: var(--text-second); background-color: var(--surface-quiet); background-image: linear-gradient(var(--surface-raised), var(--surface-quiet));
  box-shadow: inset 0 var(--size-hair) 0 var(--edge-inner), 0 0 0 var(--size-hair) var(--edge-dark); }
.sb-btn[data-kind="quiet"]:hover, .sb-btn[data-kind="quiet"].is-hover { color: var(--text-main); background-image: linear-gradient(var(--surface-lift), var(--surface-raised)); }
.sb-btn[data-kind="secondary"]:active, .sb-btn[data-kind="secondary"].is-pressed,
.sb-btn[data-kind="quiet"]:active, .sb-btn[data-kind="quiet"].is-pressed { color: var(--text-main); background-color: var(--surface-sunk); background-image: linear-gradient(var(--surface-lit), var(--surface-sunk));
  box-shadow: inset 0 var(--size-hair) calc(var(--size-hair) * 2) var(--edge-dark), 0 0 0 var(--size-hair) var(--edge-dark); }
.sb-btn[data-kind="wrong"] { color: var(--state-wrong); border-color: var(--state-wrong-edge); background-color: var(--state-wrong-low); background-image: linear-gradient(var(--state-wrong-top), var(--state-wrong-low)); }
.sb-btn[data-kind="wrong"]:hover, .sb-btn[data-kind="wrong"].is-hover { color: var(--text-on-action); border-color: var(--state-wrong-bright); background-color: var(--state-wrong-deep); background-image: linear-gradient(var(--state-wrong-bright), var(--state-wrong-deep));
  box-shadow: inset 0 var(--size-hair) 0 var(--edge-light), 0 0 0 var(--size-hair) var(--state-wrong-night), 0 var(--size-hair) calc(var(--size-hair) * 3) var(--edge-shadow); }
.sb-btn[data-kind="wrong"]:active, .sb-btn[data-kind="wrong"].is-pressed { color: var(--text-on-action); border-color: var(--state-wrong-deep); background-color: var(--state-wrong-deep); background-image: none;
  box-shadow: inset 0 var(--size-hair) calc(var(--size-hair) * 3) var(--edge-dark), 0 0 0 var(--size-hair) var(--state-wrong-night); }
.sb-btn.is-focus, .sb-btn:focus-visible { box-shadow: inset 0 var(--size-hair) 0 var(--edge-light), 0 0 0 var(--size-hair) var(--edge-dark), 0 0 0 calc(var(--size-hair) * 3) var(--action-base), 0 0 var(--space-4) var(--action-glow); }
.sb-btn:disabled, .sb-btn[aria-disabled="true"] { background-color: var(--surface-card); background-image: none; color: var(--text-faint); border-color: var(--line-hair); box-shadow: 0 0 0 var(--size-hair) var(--edge-dark); cursor: not-allowed; }
.sb-btn[aria-busy="true"] { color: transparent; pointer-events: none; }
.sb-btn[aria-busy="true"]::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: var(--icon-size-small); height: var(--icon-size-small);
  border-radius: var(--radius-round); border: calc(var(--size-hair) * 2) solid currentColor; border-right-color: transparent;
  color: var(--text-on-action); animation: sb-spin var(--motion-pulse) linear infinite;
}
.sb-btn[data-kind="secondary"][aria-busy="true"]::after, .sb-btn[data-kind="quiet"][aria-busy="true"]::after { color: var(--text-second); }
.sb-btn[data-kind="wrong"][aria-busy="true"]::after { color: var(--state-wrong); }
@keyframes sb-spin { to { transform: rotate(360deg); } }

/* Ruled (his yes to the queue uplift, direction B, 10:56pm 11-17; board os/web/queue/uplift/board.html): a touch-height
   size for the phone's one main move, in a dock at the foot; and a Key may sit inside a Button, quieter than a lone Key,
   taking the button's own ink, so every move on the Mac shows its key. */
/* a button drawn as the field it opens (the workbench's search opener, queue uplift B): sunk, faint words, its key at the end */
.sb-btn[data-shape="field"] { justify-content: flex-start; width: 100%; height: var(--button-height-small); padding: 0 var(--space-2); border-radius: var(--radius-control); border-color: var(--line-hair); background: var(--surface-page); color: var(--text-faint); font-size: var(--type-small); font-weight: inherit; box-shadow: var(--elevation-sunk); }
.sb-btn[data-shape="field"]:hover, .sb-btn[data-shape="field"].is-hover { color: var(--text-second); border-color: var(--line-strong); background: var(--surface-page); }
.sb-btn[data-shape="field"] > .sb-key { margin-left: auto; }
.sb-btn[data-size="large"] { height: var(--size-touch); padding: 0 var(--space-4); font-size: var(--type-lead); border-radius: var(--radius-panel); }
.sb-btn .sb-key { background: var(--edge-light); background-image: none; border-color: transparent; box-shadow: none; color: inherit; }

/* ---------- 2 Field, 3 Select ---------- */
/* The one rule of light (D619, Button B): what he presses is lit from above; what he types into is a well, the
   light flipped in. So a field is sunk and a select, which is pressed, is a lit face with a chevron. Both stand
   the button's height, so a field beside a button shares its top and bottom edge. */
.sb-field { display: flex; flex-direction: column; gap: var(--space-1); width: var(--field-width); max-width: 100%; }
.sb-field__label { font-size: var(--type-small); line-height: var(--type-line-small); font-weight: var(--type-weight-medium); color: var(--text-second); }
.sb-field__help { display: flex; align-items: baseline; gap: var(--space-1); font-size: var(--type-small); line-height: var(--type-line-small); color: var(--text-faint); }
.sb-input {
  appearance: none; margin: 0; width: 100%; height: var(--field-height); padding: 0 var(--field-pad);
  background: var(--surface-page); color: var(--text-main); border: var(--size-hair) solid var(--line-field); border-radius: var(--field-radius);
  box-shadow: var(--elevation-sunk);
  font: inherit; line-height: 1;
  transition: border-color var(--motion-fade) var(--motion-out), background-color var(--motion-fade) var(--motion-out), box-shadow var(--motion-fade) var(--motion-out);
}
.sb-input::placeholder { color: var(--text-faint); }
.sb-input:hover, .sb-input.is-hover { border-color: var(--text-second); }
.sb-input:focus-visible, .sb-input.is-focus { border-color: var(--action-base); box-shadow: var(--elevation-sunk), var(--elevation-focus); }
.sb-input[data-kind="numeral"] { font-family: var(--font-numeral); font-variant-numeric: tabular-nums; }
.sb-input:disabled { background: var(--surface-card); color: var(--text-faint); border-color: var(--line-hair); box-shadow: none; cursor: not-allowed; }
.sb-field[data-state="error"] .sb-input { border-color: var(--state-wrong); }
.sb-field[data-state="error"] .sb-field__help { color: var(--state-wrong); }
/* an error says itself with a mark and words, never by color alone (P6) */
.sb-field[data-state="error"] .sb-field__help::before { content: ""; flex: none; width: var(--mark-dot); height: var(--mark-dot); border-radius: var(--radius-round); background: currentColor; transform: translateY(calc(var(--size-hair) * -1)); }
.sb-field[aria-busy="true"] .sb-input { color: var(--text-second); background-image: linear-gradient(90deg, transparent, var(--edge-sheen), transparent); background-size: 200% 100%; background-repeat: no-repeat; animation: sb-sweep var(--motion-sweep) linear infinite; }
textarea.sb-input { height: auto; min-height: calc(var(--field-height) * 2); padding: var(--space-2) var(--field-pad); line-height: var(--type-line-row); resize: vertical; }
.sb-select { position: relative; }
.sb-select .sb-input { padding-right: calc(var(--field-pad) + var(--icon-size) + var(--space-1)); cursor: pointer; font-weight: var(--type-weight-medium);
  border-color: var(--edge-inner); background-color: var(--surface-lift); background-image: linear-gradient(var(--surface-lift-top), var(--surface-lift));
  box-shadow: inset 0 var(--size-hair) 0 var(--edge-light), 0 0 0 var(--size-hair) var(--edge-dark), 0 var(--size-hair) calc(var(--size-hair) * 2) var(--edge-shadow); }
.sb-select .sb-input:hover, .sb-select .sb-input.is-hover { border-color: var(--edge-inner); background-image: linear-gradient(var(--surface-lift-hover-top), var(--surface-lift-hover)); }
.sb-select .sb-input:focus-visible, .sb-select .sb-input.is-focus { border-color: var(--edge-inner); box-shadow: inset 0 var(--size-hair) 0 var(--edge-light), var(--elevation-focus); }
.sb-select .sb-input:disabled { background-color: var(--surface-card); background-image: none; border-color: var(--line-hair); box-shadow: 0 0 0 var(--size-hair) var(--edge-dark); font-weight: var(--type-weight-regular); }
.sb-field[data-state="error"] .sb-select .sb-input { border-color: var(--state-wrong); }
.sb-select__chev { position: absolute; right: var(--space-2); top: 0; bottom: 0; margin: auto; width: var(--icon-size); height: var(--icon-size); color: var(--text-second); pointer-events: none; }

/* ---------- 4 Check ---------- */
/* An empty box is a well; a checked box is lit in the action color, the primary button's fill in small. */
.sb-check { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; min-height: var(--row-height); color: var(--text-main); }
.sb-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.sb-check__box {
  width: var(--check-size); height: var(--check-size); border-radius: var(--radius-corner); flex: none;
  border: var(--size-hair) solid var(--line-field); background: var(--surface-page); color: var(--text-on-action); box-shadow: var(--elevation-sunk);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color var(--motion-fade) var(--motion-out), border-color var(--motion-fade) var(--motion-out), box-shadow var(--motion-fade) var(--motion-out), transform var(--motion-quick) var(--motion-out);
}
.sb-check__box svg { width: calc(var(--check-size) - var(--space-1)); height: calc(var(--check-size) - var(--space-1)); stroke-width: var(--icon-stroke-bold); opacity: 0; }
.sb-check:hover .sb-check__box, .sb-check.is-hover .sb-check__box { border-color: var(--text-second); }
.sb-check.is-pressed .sb-check__box, .sb-check:active .sb-check__box { background: var(--surface-raised); transform: scale(var(--motion-press)); }
.sb-check input:focus-visible + .sb-check__box, .sb-check.is-focus .sb-check__box { box-shadow: var(--elevation-sunk), var(--elevation-focus); }
.sb-check input:checked + .sb-check__box { border-color: var(--action-top); background-color: var(--action-fill); background-image: linear-gradient(var(--action-top), var(--action-fill)); box-shadow: inset 0 var(--size-hair) 0 var(--edge-light), 0 0 0 var(--size-hair) var(--action-night); }
.sb-check input:checked:focus-visible + .sb-check__box { box-shadow: inset 0 var(--size-hair) 0 var(--edge-light), var(--elevation-focus); }
.sb-check input:checked + .sb-check__box svg { opacity: 1; }
.sb-check input:checked ~ span[data-done] { color: var(--text-second); text-decoration: line-through; text-decoration-color: var(--text-faint); }
.sb-check input:disabled + .sb-check__box { background: var(--surface-card); background-image: none; border-color: var(--line-hair); box-shadow: none; }
.sb-check input:disabled ~ span { color: var(--text-faint); }
.sb-check[data-disabled] { cursor: not-allowed; }
/* Checks in a card are ledger rows (D636, round checks-1 option B; the family of Row A and Table A): inside
   sb-checks each check is a row that lights as an 8 px block, the hairline starts after the box, the title wraps and
   may carry a second line, the due has its own column, and a done row steps back. The card's head counts what is
   done and a thin meter shows it. The card takes data-pad none. */
.sb-checks { display: flex; flex-direction: column; padding: 0 var(--space-1) var(--space-1); }
.sb-checks__count { font-size: var(--type-small); line-height: var(--type-line-small); color: var(--text-second); font-variant-numeric: tabular-nums; }
.sb-checks__count b { font-weight: var(--type-weight-medium); color: var(--text-main); }
.sb-checks__meter { margin: 0 var(--space-3) var(--space-2); }
.sb-checks > .sb-check { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-1) var(--space-3); min-height: calc(var(--row-height) + var(--space-2)); padding: var(--space-2) var(--space-3); border-radius: var(--radius-inner); position: relative; transition: background-color var(--motion-fade) var(--motion-out); }
.sb-checks > .sb-check + .sb-check::before { content: ""; position: absolute; left: calc(var(--space-3) * 2 + var(--check-size)); right: var(--space-3); top: 0; height: var(--size-hair); background: var(--line-hair); }
.sb-checks > .sb-check:not([data-disabled]):hover, .sb-checks > .sb-check.is-hover { background: var(--surface-raised); --text-faint: var(--text-second); }
.sb-checks > .sb-check:not([data-disabled]):hover::before, .sb-checks > .sb-check:not([data-disabled]):hover + .sb-check::before, .sb-checks > .sb-check.is-hover::before, .sb-checks > .sb-check.is-hover + .sb-check::before { background: none; }
.sb-check__title { font-weight: var(--type-weight-medium); line-height: var(--type-line-row); overflow-wrap: anywhere; }
.sb-check__title small { display: inline-block; width: 100%; font-size: var(--type-small); line-height: var(--type-line-small); font-weight: var(--type-weight-regular); color: var(--text-faint); }
.sb-check__meta { font-size: var(--type-small); color: var(--text-second); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-check input:checked ~ .sb-check__meta, .sb-check input:disabled ~ .sb-check__meta { color: var(--text-faint); }

/* Ruled (queue uplift B, 10:56pm 11-17): an act's check is round and one step larger, so an act reads apart from a
   setting (data-shape act, 20 px: the large icon size); data-size large a step more, for the act's own title in a pane. */
.sb-check[data-shape="act"] { min-height: 0; }
.sb-check[data-shape="act"] .sb-check__box { width: var(--icon-size-large); height: var(--icon-size-large); border-radius: var(--radius-round); }
.sb-check[data-shape="act"][data-size="large"] .sb-check__box { width: calc(var(--icon-size-large) + var(--space-1)); height: calc(var(--icon-size-large) + var(--space-1)); }

/* ---------- 5 Mark ---------- */
/* Mark B, Glyph (D632): every state has its own shape as well as its color (a ring with a dot, a half disc, a
   check, a live dot, a cross, a clock, a dashed ring, a diamond), so a state reads without color and at a glance
   down a column. The glyph carries the color; the word is in the text ink. The shapes are drawn as a mask from
   inline pictures (a page opened from a file cannot load a mask from another file), so a mark is still one element with a data-state and its word. With no word it leads a row. */
.sb-mark { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--type-small); font-weight: var(--type-weight-medium); color: var(--text-main); white-space: nowrap; line-height: 1; }
.sb-mark::before { content: ""; flex: none; width: var(--icon-size-small); height: var(--icon-size-small); background: var(--text-second); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9' stroke-dasharray='3.6 3.47'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9' stroke-dasharray='3.6 3.47'/%3E%3C/svg%3E") center / contain no-repeat; }
.sb-mark[data-state="live"]::before { background: var(--state-live); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9' opacity='.45'/%3E%3Ccircle cx='12' cy='12' r='4.5' fill='black' stroke='none'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9' opacity='.45'/%3E%3Ccircle cx='12' cy='12' r='4.5' fill='black' stroke='none'/%3E%3C/svg%3E"); }
.sb-mark[data-state="running"]::before { background: var(--state-live); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 5a7 7 0 0 1 0 14z' fill='black' stroke='none'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 5a7 7 0 0 1 0 14z' fill='black' stroke='none'/%3E%3C/svg%3E"); }
.sb-mark[data-state="done"]::before { background: var(--state-live); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12.5 2.7 2.7L16 9.5'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12.5 2.7 2.7L16 9.5'/%3E%3C/svg%3E"); }
.sb-mark[data-state="wait"]::before { background: var(--state-wait); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='3.5' fill='black' stroke='none'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='3.5' fill='black' stroke='none'/%3E%3C/svg%3E"); }
.sb-mark[data-state="wrong"]::before { background: var(--state-wrong); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m15 9-6 6'/%3E%3Cpath d='m9 9 6 6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m15 9-6 6'/%3E%3Cpath d='m9 9 6 6'/%3E%3C/svg%3E"); }
.sb-mark[data-state="old"]::before { background: var(--state-old); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E"); }
.sb-mark[data-state="info"]::before { background: var(--action-base); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 21 12 12 21 3 12z'/%3E%3Ccircle cx='12' cy='12' r='1.6' fill='black' stroke='none'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 21 12 12 21 3 12z'/%3E%3Ccircle cx='12' cy='12' r='1.6' fill='black' stroke='none'/%3E%3C/svg%3E"); }
.sb-mark[data-state="old"], .sb-mark[data-state="off"] { color: var(--text-second); }
.sb-mark[data-state="running"]::before { animation: sb-breathe var(--motion-pulse) ease-in-out infinite; }
/* filled, for a column of them: a 4 px tinted tag (D566), the word in the state's color */
.sb-mark[data-fill] { height: var(--mark-height); padding: 0 var(--space-2) 0 calc(var(--space-1) + var(--space-0)); border-radius: var(--mark-radius); background: var(--line-hair); color: var(--text-second); }
.sb-mark[data-fill][data-state="live"], .sb-mark[data-fill][data-state="done"], .sb-mark[data-fill][data-state="running"] { background: var(--state-live-tint); color: var(--state-live); }
.sb-mark[data-fill][data-state="wait"] { background: var(--state-wait-tint); color: var(--state-wait); }
.sb-mark[data-fill][data-state="wrong"] { background: var(--state-wrong-tint); color: var(--state-wrong); }
.sb-mark[data-fill][data-state="old"] { background: var(--state-old-tint); color: var(--state-old); }
.sb-mark[data-fill][data-state="info"] { background: var(--action-tint); color: var(--action-base); }
@keyframes sb-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- 6 Row ---------- */
.sb-list { display: flex; flex-direction: column; container-type: inline-size; }
.sb-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--row-gap);
  min-height: var(--row-height); padding: var(--space-2) var(--row-pad); border-bottom: var(--size-hair) solid var(--line-hair);
  color: var(--text-main); text-decoration: none; cursor: default;
  transition: background-color var(--motion-fade) var(--motion-out);
}
.sb-row[data-press] { cursor: pointer; }
.sb-row[data-press]:hover, .sb-row.is-hover { background: var(--surface-raised); }
.sb-row[data-press]:active, .sb-row.is-pressed { background: var(--surface-pressed); }
.sb-row:focus-visible, .sb-row.is-focus { box-shadow: var(--elevation-focus-inset); border-radius: var(--radius-control); }
.sb-row[aria-selected="true"] { background: var(--action-tint); }
.sb-row__title { min-width: 0; overflow-wrap: anywhere; line-height: var(--type-line-row); font-weight: var(--type-weight-medium); }
.sb-row__sub { font-size: var(--type-small); color: var(--text-faint); overflow-wrap: anywhere; }
.sb-row__meta { display: flex; align-items: center; gap: var(--row-gap); font-size: var(--type-small); color: var(--text-second); white-space: nowrap; }
/* who and when (D639, round queue-meta-1): the who is a fixed column and the when a fixed, right-aligned column, so
   both stand in line down a list; the when takes the main ink at the UI weight, a step under the title, and the who
   stays second; a date keeps tabular digits and a tight hyphen (fonts.css, Inter Figures). */
.sb-row__who { min-width: calc(var(--space-6) * 2); color: var(--text-second); }
.sb-row__when { min-width: calc(var(--space-6) * 2 + var(--space-1)); text-align: right; font-family: "Inter Figures", var(--font-numeral); font-variant-numeric: normal; font-weight: var(--type-weight-medium); color: var(--text-main); }
.sb-row__when[data-tone="wait"] { color: var(--state-wait); }
.sb-row__when[data-tone="wrong"] { color: var(--state-wrong); }
.sb-row[data-stale] .sb-row__when { color: var(--state-old); font-weight: var(--type-weight-regular); }
.sb-row__lead { display: inline-flex; align-items: center; min-width: var(--icon-size); }
.sb-row[data-stale] .sb-row__title { color: var(--text-second); }
.sb-row[data-stale] .sb-row__meta { color: var(--state-old); }
.sb-row[aria-busy="true"] > * { visibility: hidden; }
.sb-row[aria-busy="true"] { position: relative; }
.sb-row[aria-busy="true"]::after { content: ""; position: absolute; left: var(--row-pad); right: 40%; top: 50%; height: var(--type-small); margin-top: calc(var(--type-small) / -2); border-radius: var(--radius-corner); background-color: var(--surface-pressed); background-image: linear-gradient(90deg, transparent, var(--edge-sheen), transparent); background-size: 200% 100%; background-repeat: no-repeat; animation: sb-sweep var(--motion-sweep) linear infinite; }

/* Row A (D619): under 560 px wide a list's row puts its meta under the title, so the title keeps the width
   and wraps instead of being cut (his note 1). A breakpoint is literal: CSS cannot read a token there. */
@container (max-width: 560px) {
  .sb-list > .sb-row { grid-template-columns: auto minmax(0, 1fr); row-gap: var(--space-1); }
  .sb-list > .sb-row > .sb-row__meta { grid-column: 2; flex-wrap: wrap; white-space: normal; row-gap: var(--space-1); }
  .sb-list > .sb-row .sb-row__who, .sb-list > .sb-row .sb-row__when { min-width: 0; text-align: left; }
}

/* Ruled (queue uplift B, 10:56pm 11-17): the work row. data-cols work gives a list fixed columns (lead, title, meta,
   and a when column of one width) so dates stand in one line down the list; a dense height; a hairline between rows in
   place of the row's own rule; a selected row carries the action rule on its left edge. data-size large is a step
   taller with the title at Lead; data-tone done steps an ended row back. */
.sb-row[data-cols="work"] { grid-template-columns: var(--icon-size-large) minmax(0, 1fr) auto calc(var(--space-8) + var(--space-7)); min-height: calc(var(--row-height) + var(--space-1)); padding-top: 0; padding-bottom: 0; border-bottom-color: transparent; border-radius: var(--radius-inner); }
.sb-row[data-cols="work"] + .sb-row[data-cols="work"] { box-shadow: 0 calc(var(--size-hair) * -1) 0 var(--line-hair); }
.sb-row[data-cols="work"][aria-selected="true"] { background: var(--action-tint); box-shadow: inset calc(var(--size-hair) * 2) 0 0 var(--action-base); }
.sb-row[data-cols="work"][aria-selected="true"] + .sb-row { box-shadow: none; }
.sb-row[data-cols="work"] > .sb-row__when { min-width: 0; font-size: var(--type-small); white-space: nowrap; }
.sb-row[data-cols="work"] .sb-row__sub { margin-left: var(--space-2); }
.sb-row[data-cols="work"] > .sb-icon, .sb-row[data-cols="work"] > .sb-row__lead > .sb-icon { width: var(--icon-size-large); height: var(--icon-size-large); stroke-width: var(--icon-stroke-large); }
.sb-row[data-size="large"] { min-height: calc(var(--size-touch) + var(--space-1)); }
.sb-row[data-size="large"] .sb-row__title { font-size: var(--type-lead); line-height: var(--type-line-lead); }
.sb-row[data-tone="done"] .sb-row__title { color: var(--text-second); font-weight: var(--type-weight-regular); }
.sb-row[data-tone="done"] .sb-row__when { color: var(--text-faint); font-weight: var(--type-weight-regular); }

/* Ruled (queue uplift B, 10:56pm 11-17): List data-kind history, a timeline. Each item is a dot on a rail with its
   line (who in bold, what was done) and its time under it; the newest dot is in the action colour; an Undo sits on the
   line it undoes, never in a column of its own. */
.sb-list[data-kind="history"] { gap: 0; margin: 0; padding: 0; }
.sb-list[data-kind="history"] > li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-0) var(--space-3); align-items: baseline; padding: 0 0 var(--space-3) var(--space-5); list-style: none; }
.sb-list[data-kind="history"] > li::before { content: ""; position: absolute; left: var(--space-1); top: calc(var(--space-1) + var(--size-hair)); width: var(--mark-dot); height: var(--mark-dot); border-radius: var(--radius-round); background: var(--surface-card); border: calc(var(--size-hair) * 2) solid var(--text-faint); box-sizing: border-box; }
.sb-list[data-kind="history"] > li:first-child::before { border-color: var(--action-base); }
.sb-list[data-kind="history"] > li:not(:last-child)::after { content: ""; position: absolute; left: calc(var(--space-1) + var(--mark-dot) / 2 - var(--size-hair) / 2); top: calc(var(--space-3) + var(--space-1)); bottom: calc(var(--space-0) * -1); width: var(--size-hair); background: var(--line-strong); }
.sb-list[data-kind="history"] b { font-weight: var(--type-weight-medium); }
.sb-list[data-kind="history"] .sb-small { grid-column: 1; color: var(--text-faint); }
.sb-list[data-kind="history"] .sb-btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

/* ---------- 7 Card ---------- */
/* Card B, Widget (D619): the label carries the state in caps, the figure fills the width, the history fills the
   floor. Nothing overlaps (D619): head, figure, sub line and floor are each their own band in the flow, the head
   wraps before it crowds, and the floor is never drawn under text (check.mjs K8). */
.sb-card {
  background-color: var(--surface-card); background-image: radial-gradient(120% 90% at 0% 0%, var(--surface-lift) 0%, var(--surface-card) 60%);
  border: var(--card-edge) solid var(--line-hair); border-radius: var(--card-radius); padding: var(--card-pad);
  box-shadow: inset 0 var(--size-hair) 0 var(--edge-inner);
  color: var(--text-main); position: relative; display: flex; flex-direction: column; gap: var(--space-2); box-sizing: border-box; overflow: hidden;
  container-type: inline-size;
  transition: background-color var(--motion-fade) var(--motion-out), border-color var(--motion-fade) var(--motion-out), box-shadow var(--motion-fade) var(--motion-out), transform var(--motion-fade) var(--motion-out);
}
.sb-card[data-pad="none"] { padding: 0; }
.sb-card[data-press] { cursor: pointer; }
.sb-card[data-press]:hover, .sb-card.is-hover { border-color: var(--line-strong); background-image: radial-gradient(120% 90% at 0% 0%, var(--surface-lift-hover) 0%, var(--surface-card) 65%); box-shadow: inset 0 var(--size-hair) 0 var(--edge-light), 0 var(--space-2) var(--space-5) var(--edge-shadow); }
.sb-card[data-press]:active, .sb-card.is-pressed { background-image: none; background-color: var(--surface-card); border-color: var(--line-hair); box-shadow: inset 0 var(--size-hair) calc(var(--size-hair) * 3) var(--edge-dark); transform: scale(var(--motion-press)); }
.sb-card:focus-visible, .sb-card.is-focus { box-shadow: var(--elevation-focus); }
.sb-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-3); }
.sb-card__title { font-size: var(--type-label); font-weight: var(--type-weight-semibold); letter-spacing: var(--type-tracking-caps); text-transform: uppercase; color: var(--text-second); }
.sb-card[data-pad="none"] .sb-card__head { padding: var(--space-3) var(--card-pad) 0; }
.sb-card[data-state="error"] { border-color: var(--state-wrong-edge); background-image: radial-gradient(120% 90% at 0% 0%, var(--state-wrong-low) 0%, var(--surface-card) 60%); }
.sb-card[data-state="error"] .sb-card__title { color: var(--state-wrong); }
.sb-card[data-state="stale"] .sb-card__title { color: var(--state-wait); }
.sb-card[data-state="offline"] .sb-card__title { color: var(--text-second); }
.sb-card[data-state="stale"] .sb-asof, .sb-card[data-state="offline"] .sb-asof { color: var(--state-old); }
/* a figure in a card is sized by the card (cqi), so one card is right on the phone, the Mac and the TV */
.sb-card .sb-readout__value { font-size: clamp(var(--type-figure-min), calc(var(--type-figure-scale) * 1cqi), var(--type-figure-max)); }
.sb-card .sb-readout__value > .sb-display, .sb-card .sb-readout__value > .sb-reading { font-size: 100%; }
/* the floor: the history band at the foot, edge to edge, its own space under everything else */
.sb-card__floor { flex: none; margin: auto calc(var(--card-pad) * -1) calc(var(--card-pad) * -1); height: var(--card-floor); }
.sb-card__floor svg { display: block; width: 100%; height: 100%; }
.sb-spark__line { fill: none; stroke: var(--state-live); stroke-width: calc(var(--size-hair) * 2); stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sb-spark__area { fill: var(--state-live-tint); stroke: none; }
.sb-spark__since { fill: none; stroke: var(--state-old); stroke-width: calc(var(--size-hair) * 2); stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.sb-card[data-state="stale"] .sb-spark__line, .sb-card[data-state="offline"] .sb-spark__line { stroke: var(--state-old); }
.sb-card[data-state="stale"] .sb-spark__area, .sb-card[data-state="offline"] .sb-spark__area { fill: var(--state-old-tint); }
/* loading: the skeleton stands where the figure, its line and its floor will land, and the block takes the rest */
.sb-card[data-state="loading"] > .sb-skel[data-shape="block"] { flex: 1; min-height: var(--card-floor); }
/* empty and error: the words center in the card, both ways (his note, 7:06pm 11-10) */
.sb-card > .sb-empty { flex: 1; padding: var(--space-3) 0; }
.sb-card__say { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: var(--space-2); }
.sb-card__say-title { font-size: var(--type-title); font-weight: var(--type-weight-semibold); letter-spacing: var(--type-tracking-title); line-height: var(--type-line-tight); }

/* a card a pane holds (the workbench's selected hero, queue uplift B): the action ring */
.sb-card[aria-selected="true"] { border-color: var(--action-ring); }
/* Ruled (queue uplift B, 10:56pm 11-17): a card that needs him carries the action colour on its top edge. */
.sb-card[data-tone="ask"] { border-color: var(--action-ring); background-image: radial-gradient(120% 90% at 0% 0%, var(--action-tint) 0%, var(--surface-card) 55%); box-shadow: inset 0 calc(var(--size-hair) * 2) 0 var(--action-base); }

/* ---------- 8 Table ---------- */
/* Table A, Ledger (D632): one card; quiet sentence-case heads; the first cell is the name (with a second line if it
   has one), the last cell is the figure, in Inter with tabular digits, at the right; hairlines start after the
   row's inset; a row lights as an 8 px block inside the 16 px card (P11). Under 560 px a row folds to two lines:
   name and figure, then the cells between; nothing is cut and nothing scrolls sideways (his note 1). It is a
   grid of divs with table roles, so it can fold; four columns, or three with data-cols. */
.sb-table { container-type: inline-size; background-color: var(--surface-card); background-image: radial-gradient(120% 90% at 0% 0%, var(--surface-lift) 0%, var(--surface-card) 60%); border: var(--card-edge) solid var(--line-hair); border-radius: var(--card-radius); box-shadow: var(--elevation-card); padding: var(--space-1); color: var(--text-main); }
.sb-table__cap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-3); padding: var(--space-3) var(--space-3) var(--space-2); }
.sb-table__head, .sb-table__row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(calc(var(--space-6) * 3), auto); align-items: center; gap: var(--space-1) var(--space-4); padding: 0 var(--space-3); }
.sb-table[data-cols="3"] .sb-table__head, .sb-table[data-cols="3"] .sb-table__row { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) minmax(calc(var(--space-6) * 3), auto); }
.sb-table__head { min-height: var(--space-6); font-size: var(--type-small); font-weight: var(--type-weight-medium); color: var(--text-faint); }
.sb-table__head > :last-child, .sb-table__row > :last-child { text-align: right; justify-self: end; }
.sb-table__head [aria-sort] { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--text-second); }
.sb-table__row { position: relative; min-height: calc(var(--row-height) + var(--space-1)); padding-top: var(--space-2); padding-bottom: var(--space-2); border-radius: var(--radius-inner); color: inherit; text-decoration: none; transition: background-color var(--motion-fade) var(--motion-out); }
.sb-table__row::before { content: ""; position: absolute; left: var(--space-3); right: var(--space-3); top: 0; height: var(--size-hair); background: var(--line-hair); }
.sb-table__row[data-press] { cursor: pointer; }
.sb-table__row[data-press]:hover, .sb-table__row.is-hover { background: var(--surface-raised); }
.sb-table__row[data-press]:active, .sb-table__row.is-pressed { background: var(--surface-pressed); }
.sb-table__row:focus-visible, .sb-table__row.is-focus { box-shadow: var(--elevation-focus-inset); outline: none; }
.sb-table__row[aria-selected="true"] { background: var(--action-tint); }
.sb-table__row.is-hover::before, .sb-table__row.is-hover + .sb-table__row::before, .sb-table__row[data-press]:hover::before, .sb-table__row[data-press]:hover + .sb-table__row::before,
.sb-table__row[aria-selected="true"]::before, .sb-table__row[aria-selected="true"] + .sb-table__row::before { background: none; }
.sb-table__row > * { font-size: var(--type-small); color: var(--text-second); font-variant-numeric: tabular-nums; min-width: 0; }
.sb-table__row > :first-child { font-size: var(--type-body); font-weight: var(--type-weight-medium); line-height: var(--type-line-row); color: var(--text-main); overflow-wrap: anywhere; }
.sb-table__row > :first-child small { display: block; font-size: var(--type-small); line-height: var(--type-line-small); font-weight: var(--type-weight-regular); color: var(--text-faint); }
.sb-table__row > :last-child { font-family: var(--font-figure); font-size: var(--type-body); font-weight: var(--type-weight-medium); letter-spacing: var(--type-tracking-title); color: var(--text-main); }
.sb-table__row[data-stale] > :first-child, .sb-table__row[data-stale] > :last-child { color: var(--text-second); }
.sb-table__row[aria-busy="true"] .sb-skel { margin: 0; }
.sb-table__foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-4); min-height: calc(var(--row-height) + var(--space-2)); margin-top: var(--space-1); padding: 0 var(--space-3); border-top: var(--size-hair) solid var(--line-strong); color: var(--text-second); }
.sb-table__foot > :last-child { font-family: var(--font-figure); font-size: var(--type-lead); font-weight: var(--type-weight-semibold); font-variant-numeric: tabular-nums; letter-spacing: var(--type-tracking-title); color: var(--text-main); }
@container (max-width: 560px) {
  .sb-table__head { display: none; }
  .sb-table .sb-table__row { grid-template-columns: minmax(0, 1fr) auto; }
  .sb-table__row > :first-child { grid-column: 1; grid-row: 1; }
  .sb-table__row > :last-child { grid-column: 2; grid-row: 1; }
  .sb-table__row > :nth-child(2) { grid-column: 1; grid-row: 2; }
  .sb-table__row > :nth-child(3):not(:last-child) { grid-column: 2; grid-row: 2; text-align: right; }
}

/* ---------- 9 Tabs ---------- */
/* Tabs B, Segmented (D632): the bar is a well and the selected segment a lit key sitting in it, in the Button B
   light, so every choice is a fully visible shape (his note 5). A 36 px bar (D566), segments at 6 px corners inside
   its 8 px corner (P11). Each segment is as wide as its words and they share what is left; data-fill makes them
   equal. Words wrap before they are cut. A count follows its word in the mono voice. */
.sb-tabs { display: inline-flex; gap: var(--space-0); max-width: 100%; min-height: var(--row-height); padding: calc(var(--space-1) - var(--size-hair)); border-radius: var(--radius-inner); background: var(--surface-page); border: var(--size-hair) solid var(--line-strong); box-shadow: var(--elevation-sunk); }
.sb-tabs[data-fill] { display: flex; }
.sb-tabs[data-fill] > .sb-tab { flex: 1 1 0; }
.sb-tab {
  appearance: none; border: var(--size-hair) solid transparent; margin: 0; cursor: pointer; font: inherit; font-weight: var(--type-weight-medium); line-height: var(--type-line-small); color: var(--text-second); background: none;
  flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: calc(var(--row-height) - var(--space-2)); padding: var(--space-1) calc(var(--space-2) + var(--space-0)); border-radius: var(--radius-control); text-align: center;
  transition: color var(--motion-fade) var(--motion-out), background-color var(--motion-fade) var(--motion-out), box-shadow var(--motion-quick) var(--motion-out);
}
.sb-tab:hover, .sb-tab.is-hover { color: var(--text-main); background: var(--line-hair); }
.sb-tab:active, .sb-tab.is-pressed { color: var(--text-main); background: var(--surface-sunk); box-shadow: inset 0 var(--size-hair) calc(var(--size-hair) * 2) var(--edge-dark); }
/* a move that ends things (Drop) says so in the wrong ink (queue uplift B) */
.sb-tab[data-tone="wrong"] { color: var(--state-wrong); }
.sb-tab[aria-selected="true"] { color: var(--text-main); border-color: var(--edge-inner); background-color: var(--surface-lift); background-image: linear-gradient(var(--surface-lift-top), var(--surface-lift)); box-shadow: inset 0 var(--size-hair) 0 var(--edge-light), 0 0 0 var(--size-hair) var(--edge-dark), 0 var(--size-hair) calc(var(--size-hair) * 2) var(--edge-shadow); }
.sb-tab:focus-visible, .sb-tab.is-focus { box-shadow: var(--elevation-focus-inset); }
.sb-tab[data-count]::after { content: attr(data-count); font-family: var(--font-code); font-size: var(--type-label); color: var(--text-faint); font-variant-numeric: tabular-nums; }

/* Ruled (queue uplift B, 10:56pm 11-17): data-fit-here fits a bar to its line at any width, not only under the phone
   breakpoint (data-fit), so a group of quiet moves reads as one control: the move bar. */
.sb-tabs[data-fit-here] { display: flex; width: 100%; }
.sb-tabs[data-fit-here] > .sb-tab { flex: 1 1 auto; white-space: nowrap; padding-left: var(--space-1); padding-right: var(--space-1); }

/* ---------- 10 Reading ---------- */
/* Reading B (D619): the label says in range, high or low in its color; the trend sits in a toned disc with the
   unit under it, the pair centered on the figure's cap height (his note 3); a range bar shows where he sits. */
.sb-readout { display: flex; flex-direction: column; gap: var(--space-2); }
.sb-readout__label { font-size: var(--type-label); font-weight: var(--type-weight-semibold); letter-spacing: var(--type-tracking-caps); text-transform: uppercase; color: var(--text-second); }
.sb-readout__value { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--type-side-gap); font-size: var(--type-display); line-height: 1; padding-bottom: var(--type-descent); }
.sb-readout__value > .sb-display, .sb-readout__value > .sb-reading { font-size: 100%; }
.sb-readout__side { display: flex; flex-direction: column; align-items: center; gap: calc(var(--type-side-gap) / 3); }
.sb-readout__trend { display: grid; place-items: center; width: max(var(--type-disc), var(--readout-disc-min)); height: max(var(--type-disc), var(--readout-disc-min)); border-radius: var(--radius-round); background: var(--line-strong); color: var(--text-main); }
.sb-readout__trend .sb-icon { width: 65%; height: 65%; stroke-width: 2.6; }
.sb-readout__unit { font-family: var(--font-text); font-size: max(calc(100% * var(--type-unit)), var(--type-label)); font-weight: var(--type-weight-semibold); letter-spacing: 0; line-height: 1; color: var(--text-second); white-space: nowrap; }
.sb-readout__sub { font-size: var(--type-body); color: var(--text-second); font-variant-numeric: tabular-nums; }
.sb-readout__sub .up { color: var(--state-live); font-weight: var(--type-weight-medium); }
.sb-readout__sub .down { color: var(--state-wrong); font-weight: var(--type-weight-medium); }
.sb-readout__word { font-size: var(--type-lead); color: var(--text-second); }
.sb-readout[data-state="empty"] .sb-readout__value, .sb-readout[data-state="hidden"] .sb-readout__value { display: none; }
.sb-readout[data-state="stale"] .sb-readout__label { color: var(--state-wait); }
.sb-readout[data-state="stale"] .sb-asof { color: var(--state-old); }
.sb-readout[data-state="error"] .sb-readout__word { color: var(--state-wrong); }
.sb-readout[data-state="error"] .sb-readout__label { color: var(--state-wrong); }
.sb-readout[data-state="loading"] .sb-readout__value { display: none; }
.sb-readout[data-tone="live"] .sb-readout__label { color: var(--state-live); }
.sb-readout[data-tone="live"] .sb-readout__trend { background: var(--state-live-tint); color: var(--state-live); }
.sb-readout[data-tone="wait"] .sb-readout__label, .sb-readout[data-tone="wait"] .sb-display, .sb-readout[data-tone="wait"] .sb-reading { color: var(--state-wait); }
.sb-readout[data-tone="wait"] .sb-readout__trend { background: var(--state-wait); color: var(--surface-page); }
.sb-readout[data-tone="wrong"] .sb-readout__label, .sb-readout[data-tone="wrong"] .sb-display, .sb-readout[data-tone="wrong"] .sb-reading { color: var(--state-wrong); }
.sb-readout[data-tone="wrong"] .sb-readout__trend { background: var(--state-wrong); color: var(--surface-page); }
/* the range bar: his target band and where the reading sits; the screen sets left and width in percent */
.sb-readout__range { position: relative; height: var(--readout-range); border-radius: var(--radius-round); background: var(--line-hair); margin-top: var(--space-2); }
.sb-readout__band { position: absolute; top: 0; bottom: 0; border-radius: var(--radius-round); background: var(--state-live-tint); }
.sb-readout__mark { position: absolute; top: 50%; width: calc(var(--size-hair) * 4); height: var(--readout-range-mark); transform: translate(-50%, -50%); border-radius: calc(var(--size-hair) * 2); background: var(--text-main); box-shadow: 0 0 0 calc(var(--size-hair) * 2) var(--surface-card); }
.sb-readout__ends { display: flex; justify-content: space-between; font-size: var(--type-small); color: var(--text-faint); font-variant-numeric: tabular-nums; }

/* ---------- 11 Clock ---------- */
/* Clock A, Inter (D632; the face round D612 DS-3 promised): the same hand as his figures, tabular, weight 480, set
   tight. The colon is lifted to the middle of the digits (D247); am or pm is a small unit raised to the cap line,
   never a word at full size (P2). */
.sb-clock { display: flex; flex-direction: column; gap: var(--space-2); }
.sb-clock__time { font-family: var(--font-time); font-size: var(--type-display); font-weight: var(--type-weight-figure); letter-spacing: var(--type-tracking-figure); line-height: 1; font-variant-numeric: tabular-nums; color: var(--text-main);
  display: inline-flex; align-items: flex-start; white-space: nowrap; text-box: trim-both cap alphabetic; }
.sb-clock__time > * { text-box: trim-both cap alphabetic; }
.sb-clock__time .colon, .sb-display .colon { display: inline-block; transform: translateY(calc(var(--type-descent) / -2.5)); }
.sb-clock__time .ampm { font-family: var(--font-text); font-size: max(calc(100% * var(--type-unit) * 1.5), var(--type-label)); font-weight: var(--type-weight-semibold); letter-spacing: var(--type-tracking-label); text-transform: uppercase; color: var(--text-second); margin-left: var(--space-1); }
.sb-clock__date { font-family: var(--font-time); font-size: var(--type-small); line-height: var(--type-line-small); color: var(--text-second); font-variant-numeric: tabular-nums; }
.sb-clock[data-state="dim"] { opacity: var(--opacity-dim); }
.sb-clock[data-state="off"] .sb-clock__time { color: var(--text-second); }
.sb-clock[data-state="off"] .sb-clock__note { color: var(--state-old); }
.sb-clock__note { font-size: var(--type-small); line-height: var(--type-line-small); color: var(--text-faint); }

/* ---------- 12 As-of ---------- */
.sb-asof { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--type-small); line-height: var(--type-line-small); color: var(--text-faint); }
.sb-asof .sb-num, .sb-asof .sb-time { color: inherit; }
.sb-asof[data-state="stale"], .sb-asof[data-state="offline"] { color: var(--state-old); }
.sb-asof[data-state="live"]::before { content: ""; width: var(--mark-dot); height: var(--mark-dot); border-radius: var(--radius-round); background: var(--state-live); margin-right: var(--space-1); }

/* ---------- 13 Note ---------- */
/* Note A, Sentence (D632): a lit block in the card color, an icon that names the kind in its color, the fact in
   words with the number bold, at most one button. The kind never fills the block (he disliked the solid toast in
   pieces-1) and nothing here could pass for an alarm (D603). When there is no room beside the words the button
   drops under them, in line with them. */
.sb-note {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3);
  min-height: calc(var(--row-height) + var(--space-2)); padding: var(--space-2) var(--space-2) var(--space-2) calc(var(--space-3) * 2 + var(--icon-size));
  background-color: var(--surface-card); background-image: linear-gradient(var(--surface-lit), var(--surface-card)); border: var(--size-hair) solid var(--line-hair); border-radius: var(--radius-panel); box-shadow: var(--elevation-card);
}
.sb-note::before { content: ""; position: absolute; left: var(--space-3); top: calc(var(--space-2) + (var(--row-height) - var(--icon-size)) / 2 - var(--size-hair)); width: var(--icon-size); height: var(--icon-size); background: var(--text-second); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat; }
.sb-note[data-kind="info"]::before { background: var(--action-base); }
.sb-note[data-kind="wait"]::before { background: var(--state-wait); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E"); }
.sb-note[data-kind="wrong"] { border-color: var(--state-wrong-edge); }
.sb-note[data-kind="wrong"]::before { background: var(--state-wrong); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E"); }
.sb-note[data-kind="old"]::before { background: var(--state-old); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E"); }
.sb-note__text { flex: 1 1 calc(var(--menu-width) / 2); min-width: 0; color: var(--text-main); line-height: var(--type-line-row); padding: var(--space-1) 0; }
.sb-note__text b { font-weight: var(--type-weight-semibold); }
.sb-note__text .sb-small { display: block; margin-top: var(--space-0); }
.sb-note > .sb-btn { margin: var(--space-0) 0; }

/* ---------- 14 Empty ---------- */
/* Centered both ways (his note, 7:06pm 11-10). An icon in a quiet disc, a title, one line that says what would
   fill it, the as-of, one way in. The words keep to a measure so they never run the width of a wide card. */
.sb-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); text-align: center; padding: var(--space-6) var(--space-4); color: var(--text-second); }
.sb-empty > * { max-width: calc(var(--menu-width) + var(--space-7)); }
.sb-empty__icon { display: grid; place-items: center; width: calc(var(--space-6) + var(--space-2)); height: calc(var(--space-6) + var(--space-2)); border-radius: var(--radius-round); background: var(--line-hair); color: var(--text-second); box-shadow: var(--elevation-card); margin-bottom: var(--space-1); }
.sb-empty__title { font-size: var(--type-lead); line-height: var(--type-line-lead); font-weight: var(--type-weight-medium); color: var(--text-main); }
.sb-empty .sb-asof { margin-top: var(--space-1); }
.sb-empty .sb-btn { margin-top: var(--space-2); }

/* ---------- 15 Skeleton ---------- */
/* The shape of what is coming, in the place it will land. A light sweeps across it once every 1.6 s (P13); with
   motion off it is still. Shapes match the parts: a text line, a figure, a block, a card floor, a disc. */
.sb-skel { display: block; border-radius: var(--radius-corner); background-color: var(--surface-pressed);
  background-image: linear-gradient(90deg, transparent, var(--edge-sheen), transparent); background-size: 200% 100%; background-repeat: no-repeat;
  animation: sb-sweep var(--motion-sweep) linear infinite; }
.sb-skel[data-shape="line"] { height: var(--type-small); width: 60%; }
.sb-skel[data-shape="line"][data-w="short"] { width: 30%; }
.sb-skel[data-shape="line"][data-w="full"] { width: 100%; }
.sb-skel[data-shape="num"] { height: var(--type-figure-min); width: 55%; border-radius: var(--radius-control); }
.sb-skel[data-shape="block"] { height: calc(var(--row-height) * 2); width: 100%; border-radius: var(--radius-inner); }
.sb-skel[data-shape="disc"] { width: var(--mark-height); height: var(--mark-height); border-radius: var(--radius-round); }
.sb-skel + .sb-skel { margin-top: var(--space-2); }
@keyframes sb-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes sb-sweep { from { background-position: 150% 0; } to { background-position: -150% 0; } }

/* ---------- 16 Menu ---------- */
/* Menu A, Launcher (D632; Raycast, measured: rows at 10 px corners in a panel, a 10 percent white fill on the
   active row, key caps in the action bar): a 12 px panel that floats, a 15 px search line, each row an 8 px block
   with its icon in a tile, and a foot that is an action bar saying what Enter does. Rows keep the 36 px height
   (D566) and grow when a title wraps; a title is never cut. */
.sb-menu {
  width: var(--menu-width); max-width: 100%; background: var(--surface-raised); border-radius: var(--radius-panel); box-shadow: var(--elevation-pop);
  padding: var(--space-1) 0; color: var(--text-main);
}
.sb-menu__search { display: flex; align-items: center; gap: var(--space-3); min-height: var(--space-7); padding: 0 var(--space-4); border-bottom: var(--size-hair) solid var(--line-hair); margin: calc(var(--space-1) * -1) 0 var(--space-1); font-size: var(--type-lead); color: var(--text-main); }
.sb-menu__search input { appearance: none; border: 0; background: none; color: inherit; font: inherit; flex: 1; min-width: 0; outline: none; }
.sb-menu__search input::placeholder { color: var(--text-second); }
.sb-menu__search .sb-key { font-size: var(--type-label); }
.sb-menu__group { font-size: var(--type-small); line-height: var(--type-line-small); font-weight: var(--type-weight-medium); color: var(--text-second); padding: var(--space-3) var(--space-4) var(--space-1); }
.sb-menu__row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-3);
  min-height: var(--menu-row); margin: 0 var(--space-1); padding: 0 var(--space-3); border-radius: var(--radius-inner); cursor: pointer; color: var(--text-main); font-weight: var(--type-weight-medium); line-height: var(--type-line-row); text-decoration: none;
  transition: background-color var(--motion-fade) var(--motion-out);
}
.sb-menu__row > :nth-child(3):not(.sb-key) { font-size: var(--type-small); font-weight: var(--type-weight-regular); color: var(--text-second); }
/* the row's icon sits in a tile */
.sb-menu__row > .sb-icon:first-child { box-sizing: content-box; width: var(--icon-size-small); height: var(--icon-size-small); padding: var(--space-1); stroke-width: var(--icon-stroke-small); border-radius: var(--radius-control); background: var(--line-strong); box-shadow: var(--elevation-card); }
.sb-menu__row:hover, .sb-menu__row.is-hover { background: var(--line-hair); }
.sb-menu__row[data-active] { background: var(--line-strong); }
.sb-menu__row:active, .sb-menu__row.is-pressed { background: var(--surface-card); }
.sb-menu__row:focus-visible, .sb-menu__row.is-focus { box-shadow: var(--elevation-focus-inset); }
.sb-menu__row[aria-selected="true"] { background: var(--action-tint); }
.sb-menu__row[aria-disabled="true"] { color: var(--text-second); font-weight: var(--type-weight-regular); cursor: not-allowed; }
.sb-menu__row .sb-key { margin-left: auto; }
.sb-menu__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); min-height: calc(var(--row-height) + var(--space-1)); padding: var(--space-1) var(--space-4); margin: var(--space-1) 0 calc(var(--space-1) * -1); border-top: var(--size-hair) solid var(--line-hair); border-radius: 0 0 var(--radius-panel) var(--radius-panel); background: var(--surface-quiet); font-size: var(--type-small); color: var(--text-second); }
.sb-menu__foot > span { display: inline-flex; align-items: center; gap: var(--space-2); }
.sb-menu__foot > :last-child:not(:first-child) { margin-left: auto; }
.sb-menu[data-state="empty"] .sb-menu__row, .sb-menu[data-state="loading"] .sb-menu__row, .sb-menu[data-state="empty"] .sb-menu__group, .sb-menu[data-state="loading"] .sb-menu__group { display: none; }
.sb-menu__empty { display: none; padding: var(--space-5) var(--space-4); text-align: center; color: var(--text-second); font-size: var(--type-small); }
.sb-menu[data-state="empty"] .sb-menu__empty { display: block; }
.sb-menu__loading { display: none; padding: var(--space-3) var(--space-4); }
.sb-menu[data-state="loading"] .sb-menu__loading { display: block; }
.sb-menu[data-state="error"] .sb-menu__row { display: none; }
.sb-menu__error { display: none; padding: var(--space-5) var(--space-4); text-align: center; color: var(--state-wrong); font-size: var(--type-small); }
.sb-menu[data-state="error"] .sb-menu__error { display: block; }

.sb-menu[data-closable][hidden] { display: none; }

/* ---------- 17 Key ---------- */
/* A key cap, not a boxed letter: a lit face with a 1 px skirt under it (Raycast's action bar; Teenage Engineering
   keys). The mono voice is right here (P14). Keys sit in a row with a hair gap. */
.sb-key { display: inline-flex; align-items: center; justify-content: center; height: var(--key-height); min-width: var(--key-height); padding: 0 calc(var(--space-1) + var(--space-0));
  font-family: var(--font-code); font-size: var(--type-label); font-weight: var(--type-weight-medium); line-height: 1; white-space: nowrap; color: var(--text-second);
  border-radius: var(--radius-corner); background-color: var(--surface-lift); background-image: linear-gradient(var(--surface-lift-top), var(--surface-lift)); box-shadow: var(--elevation-key); }
.sb-key + .sb-key { margin-left: var(--space-0); }
.sb-key .sb-icon { width: var(--type-small); height: var(--type-small); stroke-width: var(--icon-stroke-small); }

/* ---------- 18 Icon ---------- */
/* Lucide (D612, DS-6; ISC, icons/LICENSE-lucide.txt) draws on a 24 unit box. The line is 1.5 px at every size, so
   the stroke width in units changes with the size: 2.57 at 14 px, 2.25 at 16 px, 1.8 at 20 px. */
.sb-icon { width: var(--icon-size); height: var(--icon-size); flex: none; fill: none; stroke: currentColor; stroke-width: var(--icon-stroke); stroke-linecap: round; stroke-linejoin: round; }
.sb-icon[data-size="small"] { width: var(--icon-size-small); height: var(--icon-size-small); stroke-width: var(--icon-stroke-small); }
.sb-icon[data-size="large"] { width: var(--icon-size-large); height: var(--icon-size-large); stroke-width: var(--icon-stroke-large); }

/* ---------- 19 Facts ---------- */
/* Ruled (queue uplift B, 10:56pm 11-17), a new part: a two-column list of the fields that are set, a quiet label at
   Small and the value at the UI weight, a hairline under each pair. It replaces the caps table of a detail. An item is
   one pair (sb-facts__item: its label, then its value), so a list can be drawn, filtered and counted by item.
   data-tone wrong on an item puts its value in the wrong colour (a lapse, a late day). */
.sb-facts { display: grid; grid-template-columns: calc(var(--space-8) + var(--space-7)) minmax(0, 1fr); margin: 0; border-top: var(--size-hair) solid var(--line-hair); }
.sb-facts__item { display: contents; }
.sb-facts__item > * { margin: 0; padding: var(--space-2) 0; border-bottom: var(--size-hair) solid var(--line-hair); line-height: var(--type-line-row); min-width: 0; overflow-wrap: anywhere; }
.sb-facts__item > :first-child { font-size: var(--type-small); color: var(--text-faint); padding-right: var(--space-3); }
.sb-facts__item > :last-child { font-weight: var(--type-weight-medium); color: var(--text-main); }
.sb-facts__item > .sb-faint:last-child { color: var(--text-faint); font-weight: var(--type-weight-regular); }
.sb-facts__item[data-tone="wrong"] > :last-child { color: var(--state-wrong); }

/* ---------- data marks (a foundation, not a part: D612 DS-5 adds no parts) ---------- */
/* How a number over time is drawn (P5, P6, P12). Lines and bars are grey until they carry a state; the target
   band is the live tint; a window that went wrong is shaded with a dashed edge (Vercel's alert chart); the axis
   speaks in the mono voice (P14) and lives outside the drawing, so no label is ever stretched or sits on a line.
   The svg is 100 by 100 units, stretched to its box; strokes do not scale. */
.sb-viz { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
/* in a card the drawing takes the room the figure leaves (P5): it grows, the words do not drift apart */
.sb-card > .sb-viz { flex: 1; }
.sb-viz__body, .sb-viz > .sb-bars { flex: 1; }
.sb-viz__body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); }
.sb-viz__plot { position: relative; min-height: var(--viz-chart); min-width: 0; }
.sb-viz__plot svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; }
.sb-viz__grid { fill: none; stroke: var(--line-hair); stroke-width: var(--size-hair); vector-effect: non-scaling-stroke; }
.sb-viz__band { fill: var(--state-live-tint); stroke: none; }
.sb-viz__window { fill: var(--state-wrong-tint); stroke: none; }
.sb-viz__window[data-tone="wait"] { fill: var(--state-wait-tint); }
.sb-viz__edge { fill: none; stroke: var(--state-wrong); stroke-width: var(--size-hair); stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.sb-viz__edge[data-tone="wait"] { stroke: var(--state-wait); }
.sb-viz__line { fill: none; stroke: var(--text-main); stroke-width: calc(var(--size-hair) * 2); stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sb-viz__line[data-tone="live"] { stroke: var(--state-live); }
.sb-viz__line[data-tone="wait"] { stroke: var(--state-wait); }
.sb-viz__line[data-tone="wrong"] { stroke: var(--state-wrong); }
.sb-viz__line[data-tone="old"] { stroke: var(--state-old); }
.sb-viz__line[data-tone="quiet"] { stroke: var(--text-faint); stroke-width: var(--size-hair); }
.sb-viz__area { fill: var(--line-hair); stroke: none; }
.sb-viz__area[data-tone="live"] { fill: var(--state-live-tint); }
.sb-viz__since { fill: none; stroke: var(--state-old); stroke-width: calc(var(--size-hair) * 2); stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
/* the newest point: a dot the screen places in percent, ringed in the card so it never smears into the line */
.sb-viz__now { position: absolute; width: var(--mark-dot); height: var(--mark-dot); margin: calc(var(--mark-dot) / -2) 0 0 calc(var(--mark-dot) / -2); border-radius: var(--radius-round); background: var(--text-main); box-shadow: 0 0 0 calc(var(--size-hair) * 3) var(--surface-card); }
.sb-viz__now[data-tone="live"] { background: var(--state-live); }
.sb-viz__now[data-tone="wait"] { background: var(--state-wait); }
.sb-viz__now[data-tone="wrong"] { background: var(--state-wrong); }
/* the scale: each label sits on its own grid line, placed in percent by the screen and centered on the line */
.sb-viz__scale { position: relative; min-width: calc(var(--space-5) + var(--space-0)); }
.sb-viz__scale > * { position: absolute; left: 0; transform: translateY(-50%); }
.sb-viz__scale, .sb-viz__axis, .sb-bars__labels { font-family: var(--font-code); font-size: var(--type-label); line-height: 1; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.sb-viz__axis { display: flex; justify-content: space-between; gap: var(--space-2); }
/* bars: a week, a month. Heights are set in percent by the screen; the bar that is now is the bright one. */
.sb-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end; gap: var(--space-1); min-height: var(--viz-bars); }
.sb-bars__bar { min-height: calc(var(--size-hair) * 2); border-radius: calc(var(--size-hair) * 2) calc(var(--size-hair) * 2) 0 0; background: var(--line-strong); }
.sb-bars__bar[data-now] { background: var(--text-main); }
.sb-bars__bar[data-tone="live"] { background: var(--state-live); }
.sb-bars__bar[data-tone="wait"] { background: var(--state-wait); }
.sb-bars__bar[data-tone="wrong"] { background: var(--state-wrong); }
.sb-bars__bar[data-tone="none"] { background: none; box-shadow: inset 0 0 0 var(--size-hair) var(--line-strong); }
.sb-bars__labels { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-1); text-align: center; }
.sb-bars__labels [data-now] { color: var(--text-main); }
/* meter: shares of a whole, each part a pill, with the words under it */
.sb-meter { display: flex; gap: var(--space-0); height: var(--viz-track); }
.sb-meter__part { min-width: var(--viz-track); border-radius: var(--radius-round); background: var(--line-strong); }
.sb-meter__part[data-tone="live"] { background: var(--state-live); }
.sb-meter__part[data-tone="wait"] { background: var(--state-wait); }
.sb-meter__part[data-tone="wrong"] { background: var(--state-wrong); }
.sb-meter__part[data-tone="old"] { background: var(--state-old); }
/* split: the same meter by part of the day, a name, a track, a figure, in one grid so every track lines up */
.sb-split { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-2) var(--space-3); font-size: var(--type-small); line-height: var(--type-line-small); padding-top: var(--space-3); border-top: var(--size-hair) solid var(--line-hair); }
.sb-split__name { color: var(--text-second); }
.sb-split__val { font-weight: var(--type-weight-medium); color: var(--text-main); font-variant-numeric: tabular-nums; text-align: right; }
.sb-legend { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); font-size: var(--type-small); line-height: var(--type-line-small); color: var(--text-second); }
.sb-legend__item { display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; }
.sb-legend__item::before { content: ""; width: var(--mark-dot); height: var(--mark-dot); border-radius: var(--radius-round); background: var(--line-strong); }
.sb-legend__item[data-tone="live"]::before { background: var(--state-live); }
.sb-legend__item[data-tone="wait"]::before { background: var(--state-wait); }
.sb-legend__item[data-tone="wrong"]::before { background: var(--state-wrong); }
.sb-legend__item[data-tone="old"]::before { background: var(--state-old); }
.sb-legend__item b { font-weight: var(--type-weight-medium); color: var(--text-main); font-variant-numeric: tabular-nums; }

/* ---------- motion off ---------- */
@media (prefers-reduced-motion: reduce) {
  .sb *, .sb *::before, .sb *::after { animation: none !important; transition: none !important; }
}
