/* ============================================================================
   shared/components.css — THE ATOMS AND MOLECULES of the editor UI.

   Atomic design, bottom two levels: an ATOM is the smallest thing that still has a
   purpose (a button, a field, a switch, a status dot); a MOLECULE is a handful of
   atoms doing one job together (a property row, a segmented control, a toast). The
   level above — ORGANISMS — already live in their own modules and are composed FROM
   these: shared/scene-panels.css (hierarchy · component inspector),
   shared/stack-list.css (the ordered stack), shared/graph-canvas.css (the node
   canvas), shared/asset-switch.css, shared/color-picker.css, and the shell header in
   shared/global.css.

   Every rule here is the SPEC (docs/design/slate-emerald/SPEC.md §5) written once,
   in tokens only, so a variant cannot drift between workspaces: six button variants
   and no seventh, one switch, one chip family, one focus ring.

   Catalogued and exercised live at workspaces/component-library.html; the tokens are
   authored at workspaces/theme.html.

   FORCED STATES — `.is-hover` / `.is-focus` / `.is-active` / `.is-sel` are declared
   alongside each interactive pseudo-state so a state that normally needs a pointer
   can be reached (and reviewed) without one. Hover/focus rules therefore always name
   the pair; the real pseudo-class stays authoritative.

   Shape reads the SPEC §3 scale through the theme (shared/theme.js) with the SPEC
   value as the standalone fallback, so this file works on its own.
   ========================================================================== */

/* ===== ATOM · Button — six variants, one shape ============================ */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:30px;padding:0 13px;
  border:none;border-radius:var(--r-input,8px);background:var(--accent-soft);color:var(--accent-text);
  font:500 12.5px 'Figtree','Segoe UI',system-ui,sans-serif;cursor:pointer;white-space:nowrap;
  transition:background .12s,color .12s}
.btn:hover,.btn.is-hover{background:rgba(62,207,142,.24)}
.btn:focus-visible,.btn.is-focus{outline:none;box-shadow:0 0 0 1.5px var(--accent)}
.btn.primary{background:var(--accent);color:var(--on-accent);font-weight:600}
.btn.primary:hover,.btn.primary.is-hover{filter:brightness(1.07)}
.btn.neutral{background:var(--control);color:var(--text2)}
.btn.neutral:hover,.btn.neutral.is-hover{background:var(--hover);color:var(--ink)}
.btn.tonal{background:var(--accent-soft);color:var(--accent-text)}
.btn.quiet{background:transparent;color:var(--text2)}
.btn.quiet:hover,.btn.quiet.is-hover{background:var(--hover);color:var(--ink)}
.btn.danger{background:var(--danger-soft);color:var(--danger)}
.btn.danger:hover,.btn.danger.is-hover{background:rgba(239,106,122,.24)}
.btn[disabled],.btn.is-disabled{background:var(--panel);color:var(--faint);cursor:not-allowed;filter:none}
.btn.sm{height:24px;padding:0 9px;font-size:11.5px}
.btn.wide{width:100%}

/* ===== ATOM · Icon button — a glyph-only quiet button ===================== */
.ibtn{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;flex:0 0 26px;
  border:none;border-radius:var(--r-row,6px);background:transparent;color:var(--muted);
  font-size:13px;line-height:1;cursor:pointer}
.ibtn:hover,.ibtn.is-hover{background:var(--hover);color:var(--ink)}
.ibtn:focus-visible,.ibtn.is-focus{outline:none;box-shadow:0 0 0 1.5px var(--accent)}
.ibtn.on{color:var(--accent-text)}
.ibtn.rm:hover{color:var(--danger)}
.ibtn[disabled],.ibtn.is-disabled{color:var(--faint);cursor:not-allowed;background:transparent}

/* ===== MOLECULE · Tooltip + contextual help ===============================
   The tooltip owns optional explanation; `.help-info` names its subject without
   repeating the explanation in the inspector. Hover and keyboard focus reveal it;
   click/tap pins it until the author taps away or presses Escape. */
.help-info{display:flex;align-items:center;justify-content:flex-end;gap:5px;min-height:18px;margin:-2px 0 6px}
.help-info.help-info-icon{display:inline-flex;min-height:0;margin:0}
.help-info-label{color:var(--faint);font-size:10.5px;line-height:1.3}
.tooltip{position:relative;display:inline-flex;flex:0 0 auto}
.tooltip-trigger{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;padding:0;
  border:0;border-radius:50%;background:var(--control);color:var(--muted);font:600 11px/1 'Figtree','Segoe UI',system-ui,sans-serif;cursor:help}
.tooltip-trigger:hover,.tooltip-trigger.is-hover{background:var(--hover);color:var(--ink)}
.tooltip-trigger:focus-visible,.tooltip-trigger.is-focus{outline:none;box-shadow:0 0 0 1.5px var(--accent)}
.tooltip-overlay{position:fixed;inset:0;z-index:10000;pointer-events:none}
.tooltip-popover{position:absolute;z-index:80;top:calc(100% + 6px);right:0;width:max-content;max-width:min(340px,calc(100vw - 32px));
  padding:9px 10px;border-radius:var(--r-input,8px);background:var(--card);color:var(--text2);font:12px/1.45 'Figtree','Segoe UI',system-ui,sans-serif;
  border:1px solid var(--line);box-shadow:none;opacity:0;transform:translateY(-3px);pointer-events:none;transition:opacity .12s,transform .12s}
.tooltip-overlay .tooltip-popover{position:fixed;z-index:1;top:0;right:auto}
.tooltip:hover .tooltip-popover,.tooltip:focus-within .tooltip-popover,.tooltip.is-open .tooltip-popover,.tooltip-popover.is-visible{opacity:1;transform:translateY(0)}

/* ===== ATOM · Text field — a well, no border, accent focus ring =========== */
.inp{height:30px;min-width:0;background:var(--well);border:none;border-radius:var(--r-input,8px);
  color:var(--ink);font:12.5px 'Figtree','Segoe UI',system-ui,sans-serif;padding:0 10px;
  box-shadow:inset 0 0 0 1px transparent}
.inp::placeholder{color:var(--faint)}
.inp:focus,.inp.is-focus{outline:none;box-shadow:inset 0 0 0 1.5px var(--accent)}
.inp.mono{font-family:Consolas,'Cascadia Mono',monospace;font-size:11.5px;font-variant-numeric:tabular-nums}
.inp.sm{height:24px;padding:0 8px;font-size:11.5px}
.inp.err{box-shadow:inset 0 0 0 1.5px var(--danger)}
.inp[disabled],.inp.is-disabled{color:var(--faint);cursor:not-allowed}
.inp[readonly]{color:var(--muted)}
/* the validation message that always accompanies .err — never a silent rejection */
.fmsg{display:block;color:var(--danger);font-size:11px;margin-top:4px}
.fmsg.ok{color:var(--ok)}

/* ===== ATOM · Numeric input — the − / value / + pill ===================== */
.num{display:inline-flex;align-items:stretch;height:30px;border-radius:var(--r-input,8px);
  background:var(--well);overflow:hidden;font-variant-numeric:tabular-nums;color-scheme:dark}
.num b{display:flex;align-items:center;justify-content:center;width:24px;color:var(--muted);
  font:400 13px 'Figtree',system-ui,sans-serif;cursor:pointer;user-select:none}
.num b:hover,.num b.is-hover{background:var(--hover);color:var(--ink)}
.num input{flex:1;min-width:0;width:56px;background:transparent;border:none;text-align:center;
  color:var(--ink);-webkit-text-fill-color:var(--ink);caret-color:var(--ink);
  font:11.5px Consolas,monospace;font-variant-numeric:tabular-nums}
.num input:focus{outline:none}
.num:focus-within,.num.is-focus{box-shadow:inset 0 0 0 1.5px var(--accent)}
.num input::-webkit-outer-spin-button,.num input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.num input{-moz-appearance:textfield;appearance:textfield}
.num.sm{height:24px}.num.sm b{width:20px;font-size:12px}
.num.is-disabled{opacity:.5}.num.is-disabled input{color:var(--faint)}

/* ===== ATOM · Select — the field; its popup is the menu molecule ==========
   Named `.selin` after SelectInput.qml, NOT `.sel`: across this codebase `.sel` is
   the SELECTED-state modifier (.tree .row.sel, .gc-node.sel, .ds-ent.sel). One name,
   one meaning — a control class that shadowed a state class would collide on any
   element that is both. */
.selin{height:30px;min-width:0;background:var(--well);border:none;border-radius:var(--r-input,8px);
  color:var(--ink);font:12.5px 'Figtree','Segoe UI',system-ui,sans-serif;padding:0 8px;cursor:pointer;
  box-shadow:inset 0 0 0 1px transparent}
.selin:focus,.selin.is-focus{outline:none;box-shadow:inset 0 0 0 1.5px var(--accent)}
.selin:hover,.selin.is-hover{background:var(--hover)}
.selin[disabled],.selin.is-disabled{color:var(--faint);cursor:not-allowed}
.selin.sm{height:24px;font-size:11.5px}

/* ===== ATOM · Checkbox — 16px, accent fill when checked ================== */
.chk{display:inline-flex;align-items:center;gap:7px;color:var(--text2);font-size:12.5px;cursor:pointer;user-select:none}
.chk input{position:absolute;opacity:0;width:0;height:0}
.chk i{flex:0 0 16px;width:16px;height:16px;border-radius:5px;background:var(--well);
  box-shadow:inset 0 0 0 1.5px var(--border-subtle);display:inline-flex;align-items:center;justify-content:center;
  color:transparent;font-size:10px;font-style:normal;line-height:1;transition:background .12s}
.chk i::before{content:"✓"}
.chk input:checked+i{background:var(--accent);color:var(--on-accent);box-shadow:none}
.chk input:focus-visible+i,.chk.is-focus i{box-shadow:0 0 0 1.5px var(--accent)}
.chk input:indeterminate+i{background:var(--accent-soft);box-shadow:inset 0 0 0 1.5px var(--accent)}
.chk input:indeterminate+i::before{content:"–";color:var(--accent-text)}
.chk.is-disabled,.chk input[disabled]+i{opacity:.5;cursor:not-allowed}

/* ===== ATOM · Switch — an on/off flag (34×19, the shipped size) ========== */
.swt{position:relative;display:inline-flex;align-items:center;gap:8px;cursor:pointer;color:var(--text2);font-size:12.5px}
.swt input{position:absolute;opacity:0;width:0;height:0}
.swt s{flex:0 0 34px;width:34px;height:19px;border-radius:11px;background:var(--well);
  box-shadow:inset 0 0 0 1px var(--line);position:relative;text-decoration:none;transition:background .15s}
.swt s::after{content:"";position:absolute;top:3px;left:3px;width:13px;height:13px;border-radius:50%;
  background:var(--muted);transition:transform .15s,background .15s}
.swt input:checked+s{background:var(--accent-sel);box-shadow:inset 0 0 0 1px var(--accent)}
.swt input:checked+s::after{transform:translateX(15px);background:var(--accent)}
.swt input:focus-visible+s,.swt.is-focus s{box-shadow:0 0 0 1.5px var(--accent)}
.swt.is-disabled{opacity:.5;cursor:not-allowed}

/* ===== ATOM · Range slider ============================================== */
.rng{flex:1;min-width:0;accent-color:var(--accent);height:18px;background:transparent}
.rng:focus-visible,.rng.is-focus{outline:none;box-shadow:0 0 0 1.5px var(--accent);border-radius:9px}
.rng[disabled],.rng.is-disabled{opacity:.45}

/* ===== ATOM · File field ================================================
   A native `<input type=file>` renders the host OS's own button and "No file chosen" text —
   the one control the browser paints for us, and therefore the one that silently sits outside
   the theme on every surface that imports something. The atom is a LABEL wrapping the real
   input (visually hidden the way `.chk` hides its box, so it stays keyboard-focusable), the
   `.btn` face that opens the picker, and the chosen name beside it. */
.filein{display:inline-flex;align-items:center;gap:8px;min-width:0;cursor:pointer}
.filein input{position:absolute;opacity:0;width:0;height:0}
.filein .fname{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  color:var(--faint);font:11.5px Consolas,'Cascadia Mono',monospace}
.filein .fname.set{color:var(--ink)}
.filein input:focus-visible+.btn,.filein.is-focus .btn{box-shadow:0 0 0 1.5px var(--accent)}
.filein.is-disabled,.filein input[disabled]~.btn{opacity:.5;cursor:not-allowed}

/* ===== MOLECULE · Action row — the buttons that close a card ============
   Buttons emitted as bare siblings touch: nothing in `.btn` carries an outside margin, because
   spacing between peers is the ROW's job and not the control's. This is that row — the 8px
   gutter used everywhere else, and the same 8px above it so the actions read as belonging to
   the card rather than to the paragraph they sit under. `.wide` splits the width evenly when
   the actions are the card's whole point. */
.acts{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:8px}
.acts.wide>.btn{flex:1 1 0;min-width:0}
.acts.end{justify-content:flex-end}

/* ===== ATOM · Chip — an inline state / filter carrier =================== */
.chip{display:inline-flex;align-items:center;gap:5px;background:var(--chip);box-shadow:inset 0 0 0 1px var(--line);
  border-radius:var(--r-row,6px);padding:2px 9px;color:var(--text2);font-size:11.5px;
  font-variant-numeric:tabular-nums;cursor:default}
.chip.act{cursor:pointer}
.chip.act:hover,.chip.is-hover{background:var(--hover);color:var(--ink)}
.chip.on{background:var(--accent-soft);box-shadow:inset 0 0 0 1px var(--accent);color:var(--accent-text)}
.chip.ok{box-shadow:inset 0 0 0 1px rgba(62,207,142,.4);color:var(--accent-text)}
.chip.warn{background:var(--warn-soft);box-shadow:inset 0 0 0 1px rgba(224,179,80,.45);color:var(--warn)}
.chip.err{background:var(--danger-soft);box-shadow:inset 0 0 0 1px rgba(239,106,122,.45);color:var(--danger)}
.chip.mono{font-family:Consolas,monospace;font-size:11px}
/* A chip is also a <button> (symmetry, deselect). UA button chrome is not a second look. */
button.chip{border:none;font:inherit;color:inherit}
.chip:disabled,.chip.is-disabled{color:var(--faint);box-shadow:inset 0 0 0 1px var(--divider);cursor:not-allowed}
.chip.act:disabled:hover,.chip.is-disabled:hover,.chip.is-disabled.is-hover{background:var(--chip);color:var(--faint)}
/* `hidden` is a UA rule; `.chip{display:inline-flex}` outranks it (same trap as `.empty`). */
.chip[hidden]{display:none}

/* ===== ATOM · Badge — a count pill ====================================== */
.badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 6px;
  border-radius:10px;background:var(--accent-soft);color:var(--accent-text);font-size:10.5px;font-weight:600;
  font-variant-numeric:tabular-nums}
.badge.err{background:var(--danger-soft);color:var(--danger)}
.badge.warn{background:var(--warn-soft);color:var(--warn)}
.badge.neutral{background:var(--chip);color:var(--muted)}

/* ===== ATOM · Status dot / port dot ==================================== */
.dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--faint);flex:0 0 8px}
.dot.ok{background:var(--ok)}.dot.warn{background:var(--warn)}.dot.err{background:var(--danger)}
.dot.acc{background:var(--accent)}
.dot.live{box-shadow:0 0 0 3px var(--accent-soft)}
.pdot{display:inline-block;width:9px;height:9px;border-radius:50%;background:var(--faint);flex:0 0 9px;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.35)}
.pdot.on{background:var(--accent)}
.pdot.depth{background:var(--z)}
.pdot.mask{background:var(--warn)}

/* ===== ATOM · Key cap ================================================== */
.kbd{display:inline-flex;align-items:center;height:18px;padding:0 5px;border-radius:4px;background:var(--well);
  box-shadow:inset 0 0 0 1px var(--line);color:var(--text2);font:11px Consolas,monospace}

/* ===== ATOM · Colour swatch — opens the shared picker =================== */
/* the outer 1px --line edge is load-bearing on a dark UI: without it a dark surface
   swatch (#15161B on a #23252E card) reads as an empty hole rather than a colour */
/* `border:none` and the padding reset are not decoration: a swatch is sometimes a real
   `<input type="color">` (the texture workspace's brush colour), and the UA stylesheet gives
   that element its own 1px border and inner padding. Without these the same swatch reads
   bordered in one workspace and borderless in every other — the atom owns its own edge. */
.swatch{width:22px;height:22px;flex:0 0 22px;border:none;padding:0;border-radius:var(--r-row,6px);cursor:pointer;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.35),0 0 0 1px var(--line)}
.swatch::-webkit-color-swatch-wrapper{padding:0}
.swatch::-webkit-color-swatch{border:none;border-radius:calc(var(--r-row,6px) - 1px)}
.swatch:hover,.swatch.is-hover{box-shadow:inset 0 0 0 1px rgba(0,0,0,.35),0 0 0 1.5px var(--accent-text)}
.swatch.sel,.swatch.is-sel{box-shadow:inset 0 0 0 1px rgba(0,0,0,.35),0 0 0 2px var(--accent)}
.swatch.wide{width:auto;flex:1}
.swatch.is-disabled{cursor:not-allowed;opacity:.5}

/* ===== ATOM · Label · value · meter ==================================== */
.lbl{color:var(--text2);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lbl.micro{font-size:10px;font-weight:500;letter-spacing:.07em;text-transform:uppercase;color:var(--muted)}
.val{background:var(--chip);border-radius:var(--r-row,6px);padding:2px 7px;color:var(--ink);
  font:11.5px Consolas,monospace;font-variant-numeric:tabular-nums;text-align:right;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.val.ro{color:var(--muted);background:transparent}
/* A READ-OUT THAT IS ALSO A WARNING, in the read-out's own footprint. The alternative — swapping the
   `.val` for a `.chip.warn` when the news is bad — changes the cell's WIDTH, so every sibling control
   in the row shifts and a column of rows reads ragged for a reason that is about one row's content
   (`design-pattern-consistency.md`: only the content may vary between peers). Same tokens the chip
   uses, so the two say the same thing in the same colour. */
.val.warn{color:var(--warn);background:var(--warn-soft)}
.mono{font-family:Consolas,'Cascadia Mono',monospace;font-variant-numeric:tabular-nums}
.meter{height:6px;border-radius:3px;background:var(--well);overflow:hidden;flex:1;min-width:40px}
.meter i{display:block;height:100%;background:var(--accent);border-radius:3px}
.meter.warn i{background:var(--warn)}.meter.err i{background:var(--danger)}

/* ===== MOLECULE · Property row — label + typed control ================== */
.prow{display:flex;align-items:center;gap:8px;margin:6px 0}
/* a bare <label> IS the row's label — the element already says so, and requiring `.lbl` on it
   was the only thing standing between four hand-rolled row classes and this one. */
.prow>.lbl,.prow>label{flex:0 0 76px;color:var(--text2);font-size:12px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.prow>.inp,.prow>.selin,.prow>.num,.prow>.val{flex:1;min-width:0}
.prow>.val{flex:0 0 84px}
.prow .unit{flex:0 0 26px;color:var(--faint);font-size:11px}
.prow.tight{margin:3px 0}
/* Stat row — read-only label + value; value fills the control column, text flush right */
.prow.stat>.val{flex:1 1 auto;min-width:0;text-align:right}
.prow.stat>.chip{margin-left:auto;flex:0 0 auto}

/* ===== MOLECULE · Vector row — axis-coloured wells ===================== */
.vec{display:flex;gap:4px;flex:1;min-width:0}
.vec .ax{display:flex;align-items:center;gap:3px;flex:1;min-width:0;background:var(--well);
  border-radius:var(--r-row,6px);padding:0 6px;height:26px}
.vec .ax .dot{width:6px;height:6px;flex:0 0 6px}
.vec .ax.x .dot{background:var(--x)}.vec .ax.y .dot{background:var(--y)}.vec .ax.z .dot{background:var(--z)}
.vec .ax input{flex:1;min-width:0;background:transparent;border:none;color:var(--ink);
  font:11px Consolas,monospace;font-variant-numeric:tabular-nums;text-align:right}
.vec .ax input:focus{outline:none}
.vec .ax:focus-within{box-shadow:inset 0 0 0 1.5px var(--accent)}

/* ===== MOLECULE · Segmented control ==================================== */
/* Segments may be <span> OR <button>. A segment is a thing you press, so `<button>` is the more
   honest element (it is focusable and reachable by keyboard for free — §8 of the UI standard); the
   catalogue's specimen uses <span> and several workspaces already used <button>, which is the whole
   reason two `.seg` implementations existed. The atom accepts both rather than forcing a markup
   rewrite to adopt it — and the `button` reset is what stops the UA's own border and font from
   reintroducing the bordered look the forks had. */
.seg{display:inline-flex;background:var(--well);border-radius:var(--r-input,8px);padding:3px;gap:2px}
.seg span,.seg button{padding:3px 10px;border-radius:var(--r-row,6px);color:var(--text2);font-size:11.5px;cursor:pointer;white-space:nowrap}
.seg button{border:none;background:transparent;font-family:inherit}
.seg span:hover,.seg span.is-hover,.seg button:hover{background:var(--hover)}
.seg span.on,.seg button.on{background:var(--hover);color:var(--ink);font-weight:500}
.seg.acc span.on,.seg.acc button.on{background:var(--accent);color:var(--on-accent);font-weight:600}
.seg span.is-disabled,.seg button:disabled{color:var(--faint);cursor:not-allowed;background:transparent}

/* ===== MOLECULE · Underline tabs ====================================== */
.tabs{display:flex;gap:2px;box-shadow:inset 0 -1px 0 var(--divider)}
.tabs span{padding:6px 11px;color:var(--muted);font-size:12.5px;cursor:pointer;white-space:nowrap}
.tabs span:hover,.tabs span.is-hover{color:var(--text2)}
.tabs span.on{color:var(--ink);font-weight:600;box-shadow:inset 0 -2px 0 var(--accent)}

/* ===== MOLECULE · Search field ======================================== */
.srch{display:flex;align-items:center;gap:7px;background:var(--well);border-radius:var(--r-input,8px);
  padding:0 10px;height:30px}
.srch:focus-within{box-shadow:inset 0 0 0 1.5px var(--accent)}
.srch i{color:var(--faint);font-style:normal;font-size:12px}
.srch input{flex:1;min-width:0;background:transparent;border:none;color:var(--ink);
  font:12.5px 'Figtree','Segoe UI',system-ui,sans-serif}
.srch input:focus{outline:none}
.srch input::placeholder{color:var(--faint)}
.srch .clr{color:var(--faint);cursor:pointer;font-size:12px}
.srch .clr:hover{color:var(--ink)}

/* ===== MOLECULE · Menu — the SelectInput popup / context menu ========== */
.menu{background:var(--card);border-radius:var(--r-card,9px);padding:4px;
  box-shadow:0 14px 36px rgba(0,0,0,.55);min-width:184px}
.mhead{padding:5px 9px 4px;color:var(--muted);font-size:10px;font-weight:500;letter-spacing:.07em;text-transform:uppercase}
.mrow{display:flex;align-items:center;gap:9px;padding:6px 9px;border-radius:var(--r-row,6px);
  color:var(--text2);font-size:12.5px;cursor:pointer}
.mrow:hover,.mrow.is-hover{background:var(--hover);color:var(--ink)}
.mrow.on{background:var(--accent-soft);color:var(--accent-text)}
.mrow.on::after{content:"✓";margin-left:auto;font-size:11px}
.mrow.acc{color:var(--accent-text)}
.mrow.danger{color:var(--danger)}
.mrow.is-disabled{color:var(--faint);cursor:not-allowed;background:transparent}
.mrow .ico{flex:0 0 14px;text-align:center;color:var(--accent-text);font-size:12px}
.mrow .kbd{margin-left:auto}
.msep{height:1px;background:var(--divider);margin:4px 6px}

/* ===== MOLECULE · Toast =============================================== */
.tst{display:inline-flex;align-items:center;gap:9px;background:var(--card);border-radius:var(--r-input,8px);
  padding:9px 14px;color:var(--text2);font-size:12.5px;box-shadow:0 10px 30px rgba(0,0,0,.5)}
.tst .dot{background:var(--ok)}
.tst.warn .dot{background:var(--warn)}.tst.err .dot{background:var(--danger)}
/* `.tst-float` — the floating placement, a SEPARATE element wrapping the chip rather than a
   modifier on it. That split is load-bearing, not tidiness: the kind modifier is applied by
   rewriting the chip's className (`'tst' + kind`), so placement and visibility living on the
   same element would be wiped every time a toast turned out to be a warning. Two surfaces had
   already discovered this independently and solved it this way; the rest were carrying a
   single-element copy that only worked because nothing rewrote its class. */
.tst-float{position:fixed;left:50%;bottom:22px;transform:translateX(-50%) translateY(20px);
  opacity:0;pointer-events:none;transition:opacity .25s,transform .25s;z-index:9999}
.tst-float.on{opacity:1;transform:translateX(-50%) translateY(0)}

/* ===== MOLECULE · Stat tile =========================================== */
.tile{background:var(--card);border-radius:var(--r-card,9px);padding:8px 10px;min-width:84px}
.tile .k{color:var(--muted);font-size:10px;font-weight:500;letter-spacing:.06em;text-transform:uppercase}
.tile .n{color:var(--ink);font:600 16px Consolas,monospace;font-variant-numeric:tabular-nums;margin-top:2px}
.tile .n.acc{color:var(--accent-text)}
.tile .n.err{color:var(--danger)}

/* ===== MOLECULE · Empty state ========================================= */
.empty{display:flex;flex-direction:column;align-items:center;gap:7px;padding:22px 16px;text-align:center;
  color:var(--muted);font-size:12px;line-height:1.6}
/* `hidden` is a UA rule; any author `display` outranks it (same trap as `.rail-h`). */
.empty[hidden]{display:none}
.empty .g{font-size:20px;color:var(--faint)}
.empty b{color:var(--text2)}

/* ===== MOLECULE · Status strip — the compile/apply pill ================ */
.strip{display:inline-flex;align-items:center;gap:8px;background:var(--card);border-radius:20px;
  padding:5px 12px;font-size:11.5px;color:var(--text2);font-variant-numeric:tabular-nums;
  box-shadow:0 6px 20px rgba(0,0,0,.4)}
.strip.err{background:var(--danger-soft);color:var(--danger)}
.strip.err .dot{background:var(--danger)}
.strip.work .dot{background:var(--warn);animation:strip-pulse 1s ease-in-out infinite}
@keyframes strip-pulse{0%,100%{opacity:1}50%{opacity:.35}}

/* ===== MOLECULE · Banner — a deliberate lock / read-only view ========== */
.banner{display:flex;align-items:center;gap:9px;background:var(--warn-soft);border-radius:var(--r-row,6px);
  padding:8px 11px;color:var(--warn);font-size:12px}
.banner .g{font-style:normal}
.banner .btn{margin-left:auto}
/* The banner had one severity — warn — which is the right default (it exists for a lock, a
   read-only view, a caution). But the state it is most needed for is the one that says NO RESULT
   EXISTS: a refused bake, a failed compile. That has to read as danger, not as caution, because the
   two mean opposite things about whether the author is looking at their work. Added to the atom
   rather than to the one panel that first wanted it, so the second panel cannot invent a different
   red (theme-and-component-library §2). */
.banner.err{background:var(--danger-soft);color:var(--danger)}

/* ===== MOLECULE · Modal dialog — a confirm the user must answer ========= */
/* `.modal-mask`, not `.mask`: `.mask` is already a KIND modifier in this vocabulary
   (a mask-kind port dot, a mask pipeline cell), and a bare backdrop rule would have
   turned every one of them into a fullscreen overlay. */
.modal-mask{position:fixed;inset:0;background:rgba(0,0,0,.58);display:flex;align-items:center;justify-content:center;z-index:120}
.modal{width:352px;max-width:calc(100vw - 32px);background:var(--card);border-radius:14px;padding:16px;
  box-shadow:0 26px 70px rgba(0,0,0,.66)}
.modal h4{margin:0 0 7px;font-size:14px;font-weight:600;color:var(--ink)}
.modal p{margin:0;color:var(--text2);font-size:12.5px;line-height:1.6}
.modal p b{color:var(--ink)}
.modal .foot{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
.modal-mask .modal{animation:modal-in .12s ease-out}
@keyframes modal-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

/* ===== MOLECULE · Spinner — work in flight ============================ */
.spin{display:inline-block;width:14px;height:14px;border-radius:50%;
  border:2px solid var(--line);border-top-color:var(--accent);animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
