/* shared/ds/components.css: every component of the spec (section 3), built only from tokens.
   Each component has default, hover, active, focus-visible, disabled and loading. Pages never restyle these. */
@import url("/shared/layers.css");   /* P3937: the one stacking order (rule R-29); the few stacking values below are layers, and a page that loads this file gets them with no head edit */

/* 3.1 Button */
.ds-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--ds-s-2); height: var(--ds-h-md); padding: 0 var(--ds-s-3);
  border: 1px solid transparent; border-radius: var(--ds-r-md); font: inherit; font-size: var(--ds-fs-body); line-height: var(--ds-lh-body); font-weight: 500;
  color: var(--ds-text); background: transparent; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color var(--ds-t-hover) var(--ds-ease-out), border-color var(--ds-t-hover) var(--ds-ease-out), transform var(--ds-t-press) var(--ds-ease-out); }
.ds-btn:active:not(:disabled) { transform: scale(.97); }
.ds-btn--sm { height: var(--ds-h-sm); padding: 0 var(--ds-s-2-5); }
.ds-btn--lg { height: var(--ds-h-lg); padding: 0 var(--ds-s-4); }
.ds-btn--primary { background: var(--ds-accent); color: var(--ds-accent-on); }
.ds-btn--primary:hover:not(:disabled) { background: var(--ds-accent-hover); }
.ds-btn--secondary { background: var(--ds-surface-1); border-color: var(--ds-border-control); }
.ds-btn--secondary:hover:not(:disabled) { background: var(--ds-surface-2); }
.ds-btn--ghost:hover:not(:disabled) { background: var(--ds-surface-2); }
.ds-btn--ghost:active:not(:disabled) { background: var(--ds-surface-3); }
.ds-btn--danger { background: var(--ds-surface-1); border-color: var(--ds-danger); color: var(--ds-danger); }
.ds-btn--danger:hover:not(:disabled) { background: var(--ds-danger-soft); color: var(--ds-danger-ink); }
.ds-btn--icon { width: var(--ds-h-md); padding: 0; color: var(--ds-text-2); }
.ds-btn--icon.ds-btn--sm { width: var(--ds-h-sm); }
.ds-btn--icon.ds-btn--lg { width: var(--ds-h-lg); }
.ds-btn--icon:hover:not(:disabled) { background: var(--ds-surface-2); color: var(--ds-text); }
.ds-btn[aria-pressed="true"]:not(.ds-btn--primary), .ds-btn[aria-expanded="true"]:not(.ds-btn--primary) { background: var(--ds-surface-3); color: var(--ds-text); }
.ds-btn[aria-expanded="true"] > .ds-i--chev { transform: rotate(180deg); }
.ds-i--chev { transition: transform var(--ds-t-hover) var(--ds-ease-out); }
.ds-btn:disabled, .ds-btn[aria-disabled="true"] { background: var(--ds-surface-2); border-color: transparent; color: var(--ds-text-disabled); cursor: not-allowed; }
.ds-btn[aria-busy="true"] { cursor: progress; }
.ds-spin { animation: ds-spin 800ms linear infinite; }
@keyframes ds-spin { to { transform: rotate(360deg); } }

/* 3.2 Input, textarea, checkbox, radio, switch */
.ds-input, .ds-textarea { display: block; width: 100%; height: var(--ds-h-md); padding: 0 var(--ds-s-3); background: var(--ds-surface-1); color: var(--ds-text);
  border: 1px solid var(--ds-border-control); border-radius: var(--ds-r-md); font: inherit; font-size: var(--ds-fs-body); line-height: var(--ds-lh-body);
  transition: border-color var(--ds-t-hover) var(--ds-ease-out), background-color var(--ds-t-hover) var(--ds-ease-out); }
.ds-textarea { height: auto; min-height: 72px; padding: var(--ds-s-2) var(--ds-s-3); resize: vertical; }
.ds-input--sm { height: var(--ds-h-sm); }
.ds-input--lg { height: var(--ds-h-lg); }
.ds-input:hover:not(:disabled), .ds-textarea:hover:not(:disabled) { border-color: var(--ds-text-2); }
.ds-input:focus-visible, .ds-textarea:focus-visible, .ds-input:focus, .ds-textarea:focus { outline: none; border-color: var(--ds-focus); box-shadow: var(--ds-halo-focus); }
.ds-input::placeholder { color: var(--ds-text-2); }
.ds-input:disabled, .ds-textarea:disabled { background: var(--ds-surface-2); color: var(--ds-text-disabled); border-color: transparent; cursor: not-allowed; }
.ds-input[aria-invalid="true"] { border-color: var(--ds-danger); }
.ds-field { display: flex; flex-direction: column; gap: var(--ds-s-1); }
.ds-label { font-size: var(--ds-fs-caption); line-height: var(--ds-lh-caption); font-weight: 500; color: var(--ds-text-2); }
.ds-error { font-size: var(--ds-fs-caption); line-height: var(--ds-lh-caption); color: var(--ds-danger); }
.ds-dim { position: relative; display: block; }
.ds-dim > .ds-input { text-align: right; font-variant-numeric: tabular-nums; padding-right: var(--ds-s-10); }
.ds-dim > .ds-dim-unit { position: absolute; right: var(--ds-s-3); top: 50%; transform: translateY(-50%); color: var(--ds-text-2); font-size: var(--ds-fs-caption); pointer-events: none; }
.ds-check, .ds-radio, .ds-switch { display: inline-flex; align-items: center; gap: var(--ds-s-2); min-height: var(--ds-h-md); cursor: pointer; font-size: var(--ds-fs-body); }
.ds-check > input, .ds-radio > input { appearance: none; margin: 0; flex: none; width: 16px; height: 16px; border: 1px solid var(--ds-border-control); background: var(--ds-surface-1); cursor: pointer;
  border-radius: var(--ds-r-sm); display: grid; place-content: center; transition: background-color var(--ds-t-hover) var(--ds-ease-out), border-color var(--ds-t-hover) var(--ds-ease-out); }
.ds-radio > input { border-radius: var(--ds-r-pill); }
.ds-check > input::after { content: ""; width: 8px; height: 4px; border-left: 2px solid var(--ds-accent-on); border-bottom: 2px solid var(--ds-accent-on); transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.ds-radio > input::after { content: ""; width: 6px; height: 6px; border-radius: var(--ds-r-pill); background: var(--ds-accent-on); opacity: 0; }
.ds-check > input:checked, .ds-radio > input:checked { background: var(--ds-accent); border-color: var(--ds-accent); }
.ds-check > input:checked::after, .ds-radio > input:checked::after { opacity: 1; }
.ds-check > input:indeterminate { background: var(--ds-accent); border-color: var(--ds-accent); }
.ds-check > input:indeterminate::after { width: 8px; height: 0; border-left: 0; transform: none; opacity: 1; }
.ds-check > input:focus-visible, .ds-radio > input:focus-visible, .ds-switch > input:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; }
.ds-check > input:disabled, .ds-radio > input:disabled, .ds-switch > input:disabled { background: var(--ds-surface-2); border-color: var(--ds-surface-3); cursor: not-allowed; }
.ds-switch > input { appearance: none; margin: 0; flex: none; width: 32px; height: 18px; border-radius: var(--ds-r-pill); background: var(--ds-surface-3); border: 1px solid var(--ds-border-control); position: relative; cursor: pointer;
  transition: background-color var(--ds-t-hover) var(--ds-ease-out), border-color var(--ds-t-hover) var(--ds-ease-out); }
.ds-switch > input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: var(--ds-r-pill); background: var(--ds-text-2); transition: transform var(--ds-t-hover) var(--ds-ease-out), background-color var(--ds-t-hover) var(--ds-ease-out); }
.ds-switch > input:checked { background: var(--ds-accent); border-color: var(--ds-accent); }
.ds-switch > input:checked::after { transform: translateX(14px); background: var(--ds-accent-on); }
/* R-24 hit area (P4262, card P3890; the pattern of .help-q::before below): the painted pill is 32 by 18, so the input's own box was under 24 high. This ::before is a transparent
   32 by 24 box centered on the pill (3 px above and below it, the same width), so the control is at least 24 by 24 at every density band. It paints nothing, takes no room in the
   row (absolutely positioned), and leaves the pill, the knob, the focus ring (the input's own outline) and the checked and disabled looks exactly as they were. */
.ds-switch > input::before { content: ""; position: absolute; inset: -4px -1px; }

/* 3.3 Select (trigger looks like the input, opens ds-menu)
   The chosen value is a material or a supplier name, so it is never cut (his rule: never truncate; card P3937). The select keeps its 36 px, or the height a page sets
   (Materials' drawer at 28, the floating shelf at 42), for a value on one line, and min-height: max-content lets it grow when its value wraps. A browser that does
   not know max-content keeps the fixed height and the wrapped value stays whole and centered. */
.ds-select { display: inline-flex; align-items: center; justify-content: space-between; gap: var(--ds-s-2); width: 100%; height: var(--ds-h-md); min-height: max-content; padding: 0 var(--ds-s-3);
  background: var(--ds-surface-1); color: var(--ds-text); border: 1px solid var(--ds-border-control); border-radius: var(--ds-r-md); font: inherit; font-size: var(--ds-fs-body); cursor: pointer; text-align: left;
  transition: border-color var(--ds-t-hover) var(--ds-ease-out); }
.ds-select:hover:not(:disabled) { border-color: var(--ds-text-2); }
.ds-select[aria-expanded="true"] { border-color: var(--ds-focus); box-shadow: var(--ds-halo-focus); }
.ds-select:disabled { background: var(--ds-surface-2); color: var(--ds-text-disabled); border-color: transparent; cursor: not-allowed; }

.ds-select-wrap { position: relative; display: block; min-width: 0; flex: 1 1 auto; }
/* the value wraps whole: 2 px above and below its 20 px line make a one-line value 26 px with the borders, under every height a page sets, so no select changes size until its value wraps */
.ds-select-wrap > .ds-select > .ds-select-value { flex: 1; min-width: 0; padding-block: calc(var(--ds-s-1) / 2); line-height: var(--ds-lh-body); white-space: normal; overflow-wrap: anywhere; text-align: left; }
.ds-select-wrap > .ds-select > .ds-i { flex: none; color: var(--ds-text-2); }
.ds-select-native { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; margin: 0; padding: 0; border: 0; opacity: 0; overflow: hidden; pointer-events: none; }
.ds-menu.ds-menu--select { max-height: 280px; overflow-y: auto; z-index: var(--layer-menu); }   /* above a detail drawer (--layer-panel-drawer in layers.css), where most selects live */

/* 3.4 Search */
.ds-search { position: relative; display: block; width: 100%; }
.ds-search > .ds-i { position: absolute; left: var(--ds-s-3); top: 50%; transform: translateY(-50%); color: var(--ds-text-2); pointer-events: none; }
.ds-search > .ds-input { padding-left: var(--ds-s-search-seat); padding-right: var(--ds-s-search-seat); }
.ds-search > .ds-search-clear { position: absolute; right: var(--ds-s-1); top: 50%; transform: translateY(-50%); }
.ds-search > .ds-search-clear[hidden] { display: none; }
/* Large search (card P3902 on the system): the one search that is the way into a long list, on a row of its own, so it is the largest control in view and cannot be mistaken for a button.
   It takes the command palette's input size (3.10): 48 px high, 16/24 text, with the leading icon moved in to match. Border, focus ring and halo stay the .ds-input ones (3.4: a search never
   has a border style of its own); nothing here paints a color. */
.ds-search--lg > .ds-input { height: var(--ds-s-12); padding-left: var(--ds-s-10); padding-right: var(--ds-s-10); font-size: var(--ds-fs-section); line-height: var(--ds-lh-section); }
.ds-search--lg > .ds-i { left: var(--ds-s-4); }

/* 3.5 Segmented control */
.ds-seg { position: relative; display: inline-flex; align-items: stretch; height: 32px; padding: var(--ds-s-0-5); gap: 0; background: var(--ds-surface-2); border-radius: var(--ds-r-md); }
.ds-seg--sm { height: var(--ds-h-sm); }
.ds-seg > button, .ds-seg > label { position: relative; z-index: var(--layer-step-1); display: inline-flex; align-items: center; justify-content: center; gap: var(--ds-s-1); padding: 0 var(--ds-s-3); min-width: 40px;
  border: 0; background: transparent; border-radius: var(--ds-r-sm); font: inherit; font-size: var(--ds-fs-dense); line-height: var(--ds-lh-dense); font-weight: 500; color: var(--ds-text-2); cursor: pointer; white-space: nowrap;
  transition: color var(--ds-t-hover) var(--ds-ease-out); }
.ds-seg > button:hover:not([aria-checked="true"]) { color: var(--ds-text); }
.ds-seg > button[aria-checked="true"] { color: var(--ds-accent); }
.ds-seg-thumb { position: absolute; z-index: var(--layer-base); top: 2px; bottom: 2px; left: 0; width: 0; background: var(--ds-surface-1); border: 1px solid var(--ds-hairline); border-radius: var(--ds-r-sm); box-shadow: var(--ds-e-0);
  transition: transform 160ms var(--ds-ease-out), width 160ms var(--ds-ease-out); pointer-events: none; }
.ds-seg--instant .ds-seg-thumb { transition: none; }
.ds-seg > button:disabled { color: var(--ds-text-disabled); cursor: not-allowed; }

/* 3.6 Tabs */
.ds-tabs { display: flex; gap: var(--ds-s-4); border-bottom: 1px solid var(--ds-hairline); }
.ds-tabs > button { position: relative; display: inline-flex; align-items: center; gap: var(--ds-s-2); height: 40px; padding: 0 var(--ds-s-1); margin-bottom: calc(-1 * var(--ds-s-hairline)); border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--ds-text-2); font: inherit; font-size: var(--ds-fs-body); font-weight: 500; cursor: pointer; transition: color var(--ds-t-hover) var(--ds-ease-out), border-color var(--ds-t-hover) var(--ds-ease-out); }
.ds-tabs > button:hover { color: var(--ds-text); }
.ds-tabs > button[aria-selected="true"], .ds-tabs > button[aria-pressed="true"] { color: var(--ds-text); border-bottom-color: var(--ds-accent); }
.ds-tabs > button:disabled { color: var(--ds-text-disabled); cursor: not-allowed; }

/* 3.7 Menu and dropdown
   P4227 (W7-02, tests/math-audit/w7-02-panel-state-never-feeds-layout.audit.cjs): an open state never sets a layout property (transform included), so the menu's, the
   toast's and the drawer's pose is one custom property that the state changes. The property itself is read once, in the panel's own base rule, as its transform:
   the computed transform in each state, the transition and the animation are exactly what the state rules wrote before. Every panel names its own pose in its base rule, so a
   menu inside a menu never inherits the outer one's. */
.ds-menu { position: fixed; z-index: var(--layer-menu); min-width: 200px; max-width: 320px; padding: var(--ds-s-1-5); background: var(--ds-surface-1); border: 1px solid var(--ds-hairline); border-radius: var(--ds-r-lg);
  box-shadow: var(--ds-e-1); opacity: 0; --ds-menu-pose: translateY(-4px); transform: var(--ds-menu-pose); transform-origin: var(--ds-origin, top left); pointer-events: none; visibility: hidden;
  transition: opacity var(--ds-t-menu-out) var(--ds-ease-out), transform var(--ds-t-menu-out) var(--ds-ease-out), visibility 0s linear var(--ds-t-menu-out); }
.ds-menu[data-open="true"] { opacity: 1; --ds-menu-pose: none; pointer-events: auto; visibility: visible; transition: opacity var(--ds-t-menu-in) var(--ds-ease-out), transform var(--ds-t-menu-in) var(--ds-ease-out), visibility 0s; }
.ds-menu--up { --ds-menu-pose: translateY(4px); }
.ds-menu--wide { width: 320px; max-width: 320px; }
.ds-menu--account { width: 260px; }
.ds-menu--info { width: 280px; padding: var(--ds-s-3); font-size: var(--ds-fs-dense); line-height: var(--ds-lh-dense); }
/* 6 px above and below the 20 px line ((32 - 20) / 2): a one-line row keeps its min-height (36, compact 32), and a label that wraps (a long project name in the switcher's Recents) gets the same room above and below */
.ds-menu-item { display: flex; align-items: center; gap: var(--ds-s-2); width: 100%; min-height: var(--ds-row-menu); padding: calc((var(--ds-row-compact) - var(--ds-lh-body)) / 2) var(--ds-s-3); border: 0; background: transparent; border-radius: var(--ds-r-sm);
  font: inherit; font-size: var(--ds-fs-body); line-height: var(--ds-lh-body); color: var(--ds-text); text-align: left; cursor: pointer; text-decoration: none; }
.ds-menu--compact .ds-menu-item { min-height: var(--ds-row-compact); }
.ds-menu-item > .ds-i { color: var(--ds-text-2); }
.ds-menu-item > .ds-menu-label { flex: 1; min-width: 0; }
.ds-menu-item > .ds-menu-hint { margin-left: auto; color: var(--ds-text-2); font-size: var(--ds-fs-caption); }
.ds-menu-item:hover, .ds-menu-item[data-active="true"] { background: var(--ds-surface-2); text-decoration: none; }
.ds-menu-item:active { background: var(--ds-surface-3); }
/* The tick of a checked item (P4227, the same audit): its size and place are the item's own, written once here and never by the checked state; a pseudo-element with no content makes no box, so an item that is not checked draws nothing and takes no room. The checked state below only gives it content. */
.ds-menu-item::after { flex: none; width: 10px; height: 5px; margin: 0 var(--ds-s-0-5) var(--ds-s-1-in) 0; border-left: 2px solid var(--ds-text); border-bottom: 2px solid var(--ds-text); transform: rotate(-45deg); }
.ds-menu-item[aria-checked="true"]::after, .ds-menu-item[data-checked="true"]::after { content: ""; }
.ds-menu-item--danger, .ds-menu-item--danger > .ds-i { color: var(--ds-danger); }
.ds-menu-item--primary { background: var(--ds-accent); color: var(--ds-accent-on); }
.ds-menu-item--primary > .ds-i { color: var(--ds-accent-on); }
.ds-menu-item--primary:hover, .ds-menu-item--primary[data-active="true"] { background: var(--ds-accent-hover); }
.ds-menu-item[aria-disabled="true"], .ds-menu-item:disabled { color: var(--ds-text-disabled); cursor: not-allowed; background: transparent; }
.ds-menu-item[aria-disabled="true"] > .ds-i { color: var(--ds-text-disabled); }
.ds-menu-group { padding: var(--ds-s-2) var(--ds-s-3) var(--ds-s-1); font-size: var(--ds-fs-caption); line-height: var(--ds-lh-caption); font-weight: 500; color: var(--ds-text-2); }
.ds-menu-sep { height: 1px; margin: var(--ds-s-1-5) 0; background: var(--ds-hairline); border: 0; }
.ds-menu-static { padding: var(--ds-s-2) var(--ds-s-3); overflow-wrap: anywhere; }   /* the account's name and email wrap inside the card, never clipped by its overflow-x */
.ds-menu-static strong { display: block; font-weight: 500; }
.ds-menu-row { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-s-2); padding: var(--ds-s-1) var(--ds-s-3); font-size: var(--ds-fs-dense); color: var(--ds-text-2); }
/* The account menu's Theme and Units tracks end on one right edge (judge round 3): the track never shrinks or grows with its row, and its buttons are tight enough that the longest list (Light, Dark, System) fits the 260 px card with the same inset as the Units row. */
.ds-menu-row > .ds-seg { flex: none; margin-left: auto; }
.ds-menu-row > .ds-seg > button { min-width: 0; padding: 0 var(--ds-s-2); }

/* 3.9 Project switcher chip. The whole name, always (his rule: never truncate). A name that fits reads on one line in the 32 px chip with its client beside it, as before.
   A longer one grows the chip up to its cap; past the cap the client drops under the name and the name wraps (balanced), in a 40 px chip inside the 48 px bar. The cap is
   560 px, less on a narrower window, so the chip always stops at least 16 px short of the centered command bar (416 = half of the 480 px command bar, the bar's 16 px side,
   the brand and its gaps, and the clear space; measured by the design seat 42 px clear with CabDesign and 31 with StackDesign). The chevron is pinned at the right, so it
   stays centered however many lines the name takes. The bar never changes height and nothing else in it moves.
   The sizes: no fixed height (min-height 32 keeps today's chip for a name that fits; 3 + 3 px padding, 1 + 1 px border and two 16 px lines make 40). The 3 px is the
   4 px step less the 1 px border, written as three quarters of --ds-s-1 so this file keeps no raw size in a padding (tests/ds-one-off-style.audit.cjs). flex-wrap puts the
   client on its own line only when name and client do not fit side by side; baseline sets them on one baseline when they share a line. The right padding (32 = 8 + the
   16 px chevron + 8) keeps today's text-to-chevron and chevron-to-edge spacing exactly. margin-block 4 keeps a chip that outgrows the bar 4 px below the window's top
   (shell.css centers the bar's left side safely). A name that needs a third line at the cap grows the chip down past the bar, 16 px a line, whole (card P3937 E1). */
.ds-switcher { position: relative; display: inline-flex; flex: 0 1 auto; flex-wrap: wrap; align-items: baseline; align-content: center; column-gap: var(--ds-s-2); row-gap: 0;
  min-width: 0; min-height: 32px; max-width: clamp(224px, calc(50vw - 416px), 560px); margin-block: var(--ds-s-1);
  padding: calc(var(--ds-s-1) * 3 / 4) var(--ds-s-8) calc(var(--ds-s-1) * 3 / 4) var(--ds-s-3);
  border: 1px solid var(--ds-hairline); border-radius: var(--ds-r-md); background: var(--ds-surface-1); color: var(--ds-text); font: inherit; font-size: var(--ds-fs-body);
  line-height: var(--ds-lh-caption); font-weight: 500; text-align: left; cursor: pointer; transition: background-color var(--ds-t-hover) var(--ds-ease-out); }
.ds-switcher:hover { background: var(--ds-surface-2); }
.ds-switcher[aria-expanded="true"] { background: var(--ds-surface-3); }
.ds-switcher > .ds-switcher-name { flex: 0 1 auto; min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-wrap: balance; }
.ds-switcher > .ds-switcher-client { flex: 0 1 auto; min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; color: var(--ds-text-2); font-size: var(--ds-fs-caption); font-weight: 400; }
.ds-switcher > .ds-i { position: absolute; right: var(--ds-s-2); top: calc(50% - var(--ds-s-2)); }

/* 3.10 Command palette */
.ds-scrim { position: fixed; inset: 0; z-index: var(--layer-dialog); background: var(--ds-scrim); }
.ds-scrim[hidden] { display: none; }
.ds-cmd-wrap { position: fixed; inset: 0; z-index: var(--layer-dialog-system); background: var(--ds-scrim); display: flex; justify-content: center; align-items: flex-start; padding-top: 15vh; }
.ds-cmd-wrap[hidden] { display: none; }
.ds-cmd { width: 640px; max-width: calc(100vw - var(--ds-s-8)); background: var(--ds-surface-1); border: 1px solid var(--ds-hairline); border-radius: var(--ds-r-xl); box-shadow: var(--ds-e-2); overflow: hidden; }
.ds-cmd-input { display: flex; align-items: center; gap: var(--ds-s-3); height: 48px; padding: 0 var(--ds-s-4); border-bottom: 1px solid var(--ds-hairline); color: var(--ds-text-2); }
.ds-cmd-input > input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--ds-text); font: inherit; font-size: var(--ds-fs-section); line-height: var(--ds-lh-section); outline: none; }
.ds-cmd-input > input:focus-visible { outline: none; }
/* the room kept above the row the keys move to is one group name tall (its padding and its line, .ds-cmd-list > .ds-menu-group below), so the name over a
   group's first row is never cut as the list scrolls up to it (P3938 round 2, C3: the name grew from 28 to 32) */
.ds-cmd-list { max-height: 56vh; overflow-y: auto; padding: var(--ds-s-1-5) var(--ds-s-1-5) var(--ds-s-2-5); scroll-padding-block: calc(var(--ds-s-2) + var(--ds-lh-body) + var(--ds-s-1)) 10px; }
/* SEARCH'S GROUP NAMES ARE HEADINGS (card P3938 round 2, C3 of docs/research/ui-menus-mobbin-study-2026-11-20.md, his FD1277 B of 11/28/2026: "this changes
   the jump to the actions and the recent to stand out more, and that is important"; his P4331 rule, docs/design-system/hierarchy-and-layers.md section 1: a
   section name is never smaller, lighter or fainter than the rows under it). Jump To, Actions, Recent and Sections take the body size of their rows (14/20), at
   600, in the main text colour. ONLY in the Search panel (round 4, his words: "I like the menu as it stands right now on the left side of the screen"): the
   base .ds-menu-group above, which the switcher's Recents and every DS.menu list draw, stays as it is. The padding stays. */
.ds-cmd-list > .ds-menu-group { font-size: var(--ds-fs-body); line-height: var(--ds-lh-body); font-weight: var(--ds-fw-section); color: var(--ds-text); }
/* a one-line row keeps its 40 px min-height; a Recent row whose project name wraps gets 6 px above and below ((32 - 20) / 2), and its label is never clipped by the palette's overflow */
.ds-cmd-item { display: flex; align-items: center; gap: var(--ds-s-3); width: 100%; min-height: var(--ds-row); padding: calc((var(--ds-row-compact) - var(--ds-lh-body)) / 2) var(--ds-s-3); border: 0; background: transparent; border-radius: var(--ds-r-sm); font: inherit; font-size: var(--ds-fs-body); color: var(--ds-text); text-align: left; cursor: pointer; }
.ds-cmd-item > .ds-i { color: var(--ds-text-2); }
.ds-cmd-item > .ds-cmd-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ds-cmd-item[data-active="true"] { background: var(--ds-surface-2); }
.ds-cmd-item[data-active="true"] > .ds-i { color: var(--ds-accent); }
.ds-cmd-foot { display: flex; align-items: center; gap: var(--ds-s-4); height: 32px; padding: 0 var(--ds-s-4); border-top: 1px solid var(--ds-hairline); background: var(--ds-surface-2); color: var(--ds-text-2); font-size: var(--ds-fs-caption); }
.ds-cmd-empty { padding: var(--ds-s-6) var(--ds-s-4); text-align: center; color: var(--ds-text-2); }
.ds-kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 var(--ds-s-1-5); border: 1px solid var(--ds-hairline); border-radius: var(--ds-r-sm); background: var(--ds-surface-1);
  font: inherit; font-size: var(--ds-fs-caption); line-height: var(--ds-lh-caption); color: var(--ds-text-2); }

/* 3.11 Table */
.ds-table-wrap { background: var(--ds-surface-1); border: 1px solid var(--ds-hairline); border-radius: var(--ds-r-lg); overflow: hidden; }
.ds-table-scroll { overflow: auto; max-height: 100%; }
.ds-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--ds-fs-dense); line-height: var(--ds-lh-dense); font-variant-numeric: tabular-nums; }
.ds-table th { position: sticky; top: 0; z-index: var(--layer-step-1); height: 36px; padding: 0 var(--ds-s-3); background: var(--ds-surface-2); border-bottom: 1px solid var(--ds-hairline); text-align: left;
  font-size: var(--ds-fs-caption); line-height: var(--ds-lh-caption); font-weight: 500; color: var(--ds-text-2); white-space: nowrap; }
.ds-table th[data-sort] { cursor: pointer; user-select: none; }
.ds-table th[data-sort] .ds-i { width: 12px; height: 12px; margin-left: var(--ds-s-1); vertical-align: -2px; opacity: 0; transition: opacity var(--ds-t-hover) var(--ds-ease-out); }
.ds-table th[data-sort]:hover .ds-i, .ds-table th[aria-sort="ascending"] .ds-i, .ds-table th[aria-sort="descending"] .ds-i { opacity: 1; }
.ds-table td { height: var(--ds-row); padding: 0 var(--ds-s-3); border-bottom: 1px solid var(--ds-hairline); vertical-align: middle; }
.ds-table--compact td { height: var(--ds-row-compact); }
.ds-table tbody tr:last-child td { border-bottom: 0; }
.ds-table tbody tr:hover { background: var(--ds-surface-2); }
.ds-table tbody tr[aria-selected="true"] { background: var(--ds-accent-soft); }
.ds-table .ds-col-check { width: 40px; padding-right: 0; }
.ds-table .ds-col-num, .ds-table th.ds-col-num { text-align: right; }
.ds-table .ds-col-actions { width: 44px; text-align: right; }
.ds-table .ds-row-actions { opacity: 0; transition: opacity var(--ds-t-hover) var(--ds-ease-out); }
.ds-table tr:hover .ds-row-actions, .ds-table tr:focus-within .ds-row-actions, .ds-row-actions[aria-expanded="true"] { opacity: 1; }
.ds-cell-main { display: flex; align-items: center; gap: var(--ds-s-2); min-width: 0; }
.ds-cell-main strong { font-weight: 500; }
.ds-swatch { flex: none; width: 16px; height: 16px; border-radius: var(--ds-r-sm); border: 1px solid var(--ds-hairline); }
.ds-skel { display: block; height: 12px; border-radius: var(--ds-r-sm); background: var(--ds-surface-3); animation: ds-pulse 1400ms ease-in-out infinite; }
@keyframes ds-pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .ds-skel { animation: none; } }

/* 3.12 Filter toolbar, applied chips, filter panel */
.ds-toolbar { display: flex; align-items: center; gap: var(--ds-s-2); min-height: var(--ds-s-12); padding: var(--ds-s-1) 0; }
.ds-toolbar > .ds-search { width: 320px; flex: none; }
.ds-toolbar-spacer { flex: 1; }
.ds-bulk { display: flex; align-items: center; gap: var(--ds-s-2); min-height: var(--ds-s-12); padding: 0 var(--ds-s-3); background: var(--ds-accent-soft); border-radius: var(--ds-r-md); }
.ds-bulk[hidden] { display: none; }
.ds-bulk strong { font-weight: 500; margin-right: var(--ds-s-2); }
.ds-applied { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-s-2); min-height: 32px; padding-bottom: var(--ds-s-2); }
.ds-applied[hidden] { display: none; }
.ds-filter { width: 280px; flex: none; background: var(--ds-surface-1); border: 1px solid var(--ds-hairline); border-radius: var(--ds-r-lg); overflow: hidden; align-self: start; display: flex; flex-direction: column; }
.ds-filter[hidden] { display: none; }
.ds-filter details { border-bottom: 1px solid var(--ds-hairline); }
.ds-filter summary { display: flex; align-items: center; justify-content: space-between; min-height: 36px; padding: 0 var(--ds-s-3); font-size: var(--ds-fs-body); font-weight: 500; cursor: pointer; list-style: none; }
.ds-filter summary::-webkit-details-marker { display: none; }
.ds-filter summary > .ds-i { transition: transform var(--ds-t-hover) var(--ds-ease-out); color: var(--ds-text-2); }
.ds-filter details[open] > summary > .ds-i { transform: rotate(180deg); }
.ds-filter summary:hover { background: var(--ds-surface-2); }
.ds-filter summary:hover > .ds-i { color: var(--ds-text); }
.ds-filter-body { padding: 0 var(--ds-s-3) var(--ds-s-2); max-height: 240px; overflow-y: auto; }
.ds-filter-row { display: flex; align-items: center; min-height: var(--ds-row-compact); gap: var(--ds-s-2); font-size: var(--ds-fs-dense); }
.ds-filter-row > .ds-check { flex: 1; min-height: var(--ds-row-compact); min-width: 0; }
.ds-filter-row > .ds-count { color: var(--ds-text-2); font-size: var(--ds-fs-caption); font-variant-numeric: tabular-nums; }
.ds-filter-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-s-2); padding: var(--ds-s-3); border-top: 1px solid var(--ds-hairline); }
.ds-filter-head { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 0 var(--ds-s-3); border-bottom: 1px solid var(--ds-hairline); font-weight: 500; }

/* 3.13 Chip */
.ds-chip { display: inline-flex; align-items: center; gap: var(--ds-s-1-5); height: 24px; padding: 0 var(--ds-s-2); border-radius: var(--ds-r-sm); background: var(--ds-surface-3); color: var(--ds-text);
  font-size: var(--ds-fs-caption); line-height: var(--ds-lh-caption); font-weight: 500; white-space: nowrap; border: 0; font-family: inherit; }
/* Status text reads the ink tokens (AA 4.5 to 1 on the soft fill in both themes, tokens.css); the status color stays on the dot. */
.ds-chip--success { background: var(--ds-success-soft); color: var(--ds-success-ink); }
.ds-chip--warning { background: var(--ds-warning-soft); color: var(--ds-warning-ink); }
.ds-chip--danger { background: var(--ds-danger-soft); color: var(--ds-danger-ink); }
.ds-chip--success > .ds-chip-dot { background: var(--ds-success); }
.ds-chip--warning > .ds-chip-dot { background: var(--ds-warning); }
.ds-chip--danger > .ds-chip-dot { background: var(--ds-danger); }
.ds-chip--cab { background: var(--ds-accent-soft); color: var(--ds-accent); }
.ds-chip-dot { width: 6px; height: 6px; border-radius: var(--ds-r-pill); background: currentColor; }
.ds-chip > button { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: calc(-1 * var(--ds-s-1)); padding: 0; border: 0; border-radius: var(--ds-r-sm); background: transparent; color: inherit; cursor: pointer; }
.ds-chip > button:hover { background: var(--ds-surface-2); }
.ds-chip > button .ds-i { width: 12px; height: 12px; }
.ds-count-chip { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 var(--ds-s-1-5-in); border-radius: var(--ds-r-sm); background: var(--ds-accent); color: var(--ds-accent-on); font-size: var(--ds-fs-caption); line-height: 1; font-weight: 600; }

/* 3.14 Inspector */
.ds-inspector { display: flex; flex-direction: column; padding: var(--ds-s-4); gap: var(--ds-s-2); }
.ds-inspector-head { display: flex; align-items: center; min-height: 32px; border-top: 1px solid var(--ds-hairline); font-size: var(--ds-fs-caption); font-weight: 500; color: var(--ds-text-2); }
.ds-inspector-row { display: grid; grid-template-columns: 112px 1fr; align-items: center; min-height: 32px; gap: var(--ds-s-2); font-size: var(--ds-fs-dense); }
.ds-inspector-row > label { color: var(--ds-text-2); }
/* The label and its info icon side by side, the icon a sibling of the label and never inside it (R-32, 3.19): the label column keeps its 112 px and the icon sits right after the words. */
.ds-inspector-label { display: flex; align-items: center; gap: var(--ds-s-1); min-width: 0; color: var(--ds-text-2); }

/* 3.15 Toast */
.ds-toast-host { position: fixed; right: var(--ds-s-4); bottom: var(--ds-s-4); z-index: var(--layer-toast); display: flex; flex-direction: column; gap: var(--ds-s-2); align-items: flex-end; pointer-events: none; }
.ds-toast { display: flex; align-items: flex-start; gap: var(--ds-s-3); width: 360px; padding: var(--ds-s-3); background: var(--ds-surface-1); border: 1px solid var(--ds-hairline); border-radius: var(--ds-r-lg); box-shadow: var(--ds-e-1); pointer-events: auto;
  --ds-toast-pose: none; transform: var(--ds-toast-pose); animation: ds-toast-in var(--ds-t-toast) var(--ds-ease-out); }
.ds-toast[data-leaving="true"] { opacity: 0; --ds-toast-pose: translateX(24px); transition: opacity 120ms var(--ds-ease-out), transform 120ms var(--ds-ease-out); }
@keyframes ds-toast-in { from { opacity: 0; transform: translateX(24px); } }
.ds-toast-icon--success { color: var(--ds-success); } .ds-toast-icon--warning { color: var(--ds-warning); } .ds-toast-icon--danger { color: var(--ds-danger); }
.ds-toast-body { flex: 1; min-width: 0; }
.ds-toast-title { font-weight: 500; }
.ds-toast-text { font-size: var(--ds-fs-dense); color: var(--ds-text-2); }

/* 3.16 Modal and drawer */
.ds-modal-wrap { position: fixed; inset: 0; z-index: var(--layer-dialog); display: grid; place-items: center; background: var(--ds-scrim); }
.ds-modal-wrap[hidden] { display: none; }
.ds-modal { width: 440px; max-width: calc(100vw - var(--ds-s-8)); padding: var(--ds-s-6); background: var(--ds-surface-1); border-radius: var(--ds-r-xl); box-shadow: var(--ds-e-2); animation: ds-modal-in var(--ds-t-modal) var(--ds-ease-out); }
.ds-modal--form { width: 560px; } .ds-modal--wide { width: 720px; }
@keyframes ds-modal-in { from { opacity: 0; transform: scale(.98); } }
.ds-modal-title { margin: 0 0 var(--ds-s-2); font-size: var(--ds-fs-section); line-height: var(--ds-lh-section); font-weight: var(--ds-fw-section); letter-spacing: var(--ds-ls-section); }
.ds-modal-foot { display: flex; justify-content: flex-end; gap: var(--ds-s-2); margin-top: var(--ds-s-6); }
.ds-drawer { position: fixed; top: var(--ds-topbar-h); right: 0; bottom: 0; z-index: var(--layer-panel-drawer); width: var(--ds-drawer-w); max-width: 100vw; display: flex; flex-direction: column; background: var(--ds-surface-1); border-left: 1px solid var(--ds-hairline);
  box-shadow: none; --ds-drawer-pose: translateX(100%); transform: var(--ds-drawer-pose); transition: transform var(--ds-t-dock) var(--ds-ease-drawer); visibility: hidden; }
/* A closed drawer casts nothing (judge round 3, B1): the elevation is on the open state only and is never in the transition list, so no 60 px blur rides the panel out across the window's right edge. */
.ds-drawer[data-open="true"] { --ds-drawer-pose: none; visibility: visible; box-shadow: var(--ds-e-2); }
.ds-drawer-head { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 0 var(--ds-s-4); border-bottom: 1px solid var(--ds-hairline); }

/* 3.17 Empty state */
.ds-empty { display: flex; flex-direction: column; align-items: center; gap: var(--ds-s-2); max-width: 360px; margin: var(--ds-s-12) auto; text-align: center; }
.ds-empty-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--ds-r-pill); background: var(--ds-surface-2); color: var(--ds-text-2); margin-bottom: var(--ds-s-2); }
.ds-empty-title { margin: 0; font-size: var(--ds-fs-section); line-height: var(--ds-lh-section); font-weight: var(--ds-fw-section); }
.ds-empty p { margin: 0; color: var(--ds-text-2); }
.ds-empty-actions { display: flex; gap: var(--ds-s-2); margin-top: var(--ds-s-3); }

/* 3.18 Tooltip */
.ds-tip { position: fixed; z-index: var(--layer-teaching-tip); max-width: 240px; padding: var(--ds-s-1-5) var(--ds-s-2); border-radius: var(--ds-r-sm); background: var(--ds-tip-bg); color: var(--ds-tip-text); box-shadow: var(--ds-e-1);
  font-size: var(--ds-fs-caption); line-height: var(--ds-lh-caption); pointer-events: none; opacity: 0; transition: opacity var(--ds-t-hover) var(--ds-ease-out); }
.ds-tip[data-open="true"] { opacity: 1; }
.ds-tip[data-instant="true"] { transition: none; }

/* 3.19 Info icon */
.ds-info { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--ds-r-md); background: transparent; color: var(--ds-text-2); cursor: pointer; vertical-align: middle; }
.ds-info:hover { background: var(--ds-surface-2); color: var(--ds-text); }
.ds-info[aria-expanded="true"] { background: var(--ds-surface-3); color: var(--ds-text); }
/* Never on paper (card P4257, rule R-32): the icon does nothing in print, and its note (.ds-menu--info, ds.js) opened before printing is not drawn. */
@media print { .ds-info, .ds-menu--info { display: none !important; } }
/* ONE info icon on a screen (3.19, judge round 3). The shared R-32 button (BWS.helpQ, shared/bws-help.js, behavior in shared/tooltip.js) keeps its class, its note and its name; on a ds page it is painted as this system's
   info icon, the 16 px Lucide "i" with no ring, and ds.js swaps its "?" text for the sprite glyph. The ::before keeps bws-help.css's enlarged press area (28 px here). */
.ds-body .help-q { box-sizing: border-box; width: 20px; height: 20px; min-width: 20px; margin-inline-start: var(--ds-s-1); padding: 0; border: 0; border-radius: var(--ds-r-md); background: transparent; color: var(--ds-text-2); font-size: 0; }
.ds-body .help-q::before { top: -4px; right: -4px; bottom: -4px; left: -4px; }
/* P4484 round 4 (the Opus triage of 11/28/2026, the cabinet head at 1920 in inches, both themes): the glyph drew 24 px wide inside this 20 px box, so the
   icon ran 4 px past its own box and past the row that holds it. The glyph is the 16 px "i" this rule names, centred in the 20 px box, never wider. */
.ds-body .help-q > svg, .ds-body .help-q > .ds-i { display: block; flex: none; width: 16px; height: 16px; min-width: 0; max-width: 100%; margin: auto; }
.ds-body .help-q:hover, .ds-body .help-q[aria-expanded="true"] { background: var(--ds-surface-2); border-color: transparent; color: var(--ds-text); }
.ds-body .help-q[aria-expanded="true"] { background: var(--ds-surface-3); }
.ds-body .help-q:focus-visible { background: var(--ds-surface-2); border-color: transparent; color: var(--ds-text); outline: 2px solid var(--ds-focus); outline-offset: 2px; }

/* Avatar */
.ds-avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--ds-r-pill); background: var(--ds-surface-3); color: var(--ds-text);
  font: inherit; font-size: var(--ds-fs-caption); font-weight: 600; cursor: pointer; }
.ds-avatar:hover { background: var(--ds-accent-soft); }
.ds-avatar[aria-expanded="true"] { background: var(--ds-accent-soft); }

/* Status text with dot (Saved) */
.ds-status { display: inline-flex; align-items: center; gap: var(--ds-s-1-5); font-size: var(--ds-fs-caption); line-height: var(--ds-lh-caption); color: var(--ds-text-2); }
.ds-status::before { content: ""; width: 6px; height: 6px; border-radius: var(--ds-r-pill); background: var(--ds-success); }
.ds-status[data-state="dirty"]::before, .ds-status[data-state="saving"]::before { background: var(--ds-warning); }
.ds-status[data-state="error"]::before { background: var(--ds-danger); }

/* Popover card for page-owned panels (the Columns panel): the menu card look, positioned by the page. */
.ds-popover { background: var(--ds-surface-1); border: 1px solid var(--ds-hairline); border-radius: var(--ds-r-lg); box-shadow: var(--ds-e-1); }

/* P3938 menu family: begin */
/* The menu family (card P3938): one card look for the dropdown, the app menu, the row actions menu, the context menu and the submenu. Every color, radius, shadow and time below is a token; the card itself is the
   3.7 rule above (radius --ds-r-lg, padding 6 px, shadow --ds-e-1, 120 ms ease-out enter, 80 ms leave). Nothing here paints a raw color. Behavior is shared/ds/ds.js. */
.ds-menu { max-height: calc(100vh - var(--ds-s-4)); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
/* width fits the longest label, 200 to 320 px (the 3.7 min and max); a longer label wraps to the next line inside the 320 px card and is never cut (his rule: never truncate, card P3937), and its row grows with it */
.ds-menu--context, .ds-menu--row, .ds-menu--sub { width: max-content; }
.ds-menu-item > .ds-menu-label { white-space: normal; overflow-wrap: anywhere; }
/* one icon size at the left (16 px, --ds-i), the hint or the key chips at the right, quiet */
.ds-menu-item:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: -2px; }
.ds-menu-item[aria-disabled="true"] > .ds-menu-hint { color: var(--ds-text-2); }
.ds-menu-keys { display: inline-flex; align-items: center; gap: var(--ds-s-1); margin-left: auto; }
.ds-menu-keys > .ds-kbd { min-width: 18px; height: 18px; padding: 0 var(--ds-s-1); border-color: transparent; background: var(--ds-surface-2); }
.ds-menu-item:hover .ds-menu-keys > .ds-kbd, .ds-menu-item[data-active="true"] .ds-menu-keys > .ds-kbd { background: var(--ds-surface-3); }
/* a row with a submenu: a chevron at the right, a soft fill while its submenu is open */
.ds-menu-chev { color: var(--ds-text-2); }
.ds-menu-item[aria-haspopup="menu"] { padding-right: var(--ds-s-2); }
.ds-menu-item[aria-haspopup="menu"][aria-expanded="true"] { background: var(--ds-surface-2); }
/* the danger row sits last and apart: its color at rest, its own soft fill and ink on hover and under the keyboard (the ink reads AA on that fill in both themes) */
.ds-menu-item--danger:hover, .ds-menu-item--danger[data-active="true"], .ds-menu-item--danger:active { background: var(--ds-danger-soft); color: var(--ds-danger-ink); }
.ds-menu-item--danger:hover > .ds-i, .ds-menu-item--danger[data-active="true"] > .ds-i { color: var(--ds-danger-ink); }
/* the Cmd K palette takes the same key chips at the right of a row */
.ds-cmd-item > .ds-menu-keys { margin-left: auto; }
/* row actions: the icon-only ellipsis is quiet until its row is hovered or focused; it is always there on a screen with no hover, while it has the keyboard, while its menu is open and while a right click holds its row */
.ds-row-actions:focus-visible, .ds-table .ds-row-actions:focus-visible, .ds-row-actions[aria-expanded="true"], [data-ds-row-active="true"] .ds-row-actions { opacity: 1; }
@media (hover: none) { .ds-row-actions, .ds-table .ds-row-actions { opacity: 1; } }
/* the row a menu belongs to keeps the soft surface fill while the menu is open */
[data-ds-row-active="true"] { background: var(--ds-surface-2); }
/* P3938 menu family: end */

/* ---- Added for the Connect An Assistant page (card P3937): a card, an option list and a notice. Tokens only, no raw size and no raw color (tests/ds-one-off-style.audit.cjs holds this file to that). ---- */

/* 3.20 Card: one surface for a short, self-contained decision. Hairline edge and no shadow (elevation 0), 12 radius, 24 padding. */
.ds-card { background: var(--ds-surface-1); border: 1px solid var(--ds-hairline); border-radius: var(--ds-r-lg); padding: var(--ds-s-6); box-shadow: var(--ds-e-0); }
.ds-card-head { display: flex; align-items: center; gap: var(--ds-s-4); margin-bottom: var(--ds-s-6); }
.ds-card-head-text { display: flex; flex-direction: column; gap: var(--ds-s-1); min-width: 0; }
.ds-card-icon { display: grid; place-items: center; flex: none; width: var(--ds-h-lg); height: var(--ds-h-lg); border-radius: var(--ds-r-md); background: var(--ds-accent-soft); color: var(--ds-accent); }
/* The title is the card's one headline: 20 over 28, the name in it strong, the rest of the sentence quiet. */
.ds-card-title { margin: 0; font-size: var(--ds-fs-kpi); line-height: var(--ds-lh-kpi); font-weight: var(--ds-fw-kpi); letter-spacing: var(--ds-ls-kpi); overflow-wrap: anywhere; }
.ds-card-title > .ds-muted { font-weight: var(--ds-fw-body); }
.ds-card-sub { margin: 0; overflow-wrap: anywhere; }
.ds-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-s-2); margin-top: var(--ds-s-6); }
.ds-card-foot--fill > .ds-btn { flex: 1 1 0; }

/* 3.21 Option list: groups of labelled choices. A group is a fieldset with a legend; a choice is a label that holds a checkbox and its sentence. The whole row is the hit area (44 high at least). A chosen row takes the
   accent soft fill and the accent edge and its box shows a check, so the state is never color alone; a switched-off row says so in its box and its words. It styles the structure, so a script may fill the list without a class.
   THE BOX (his FD1193 B of 11/21/2026, the three faults of the Opus review). Three rules, from the makers' own published source (shadcn/ui Checkbox, GitHub Primer
   Checkbox, Material 3 checkbox tokens): (1) the corner is --ds-r-xs, 4 of 16, a quarter of the side or less as all three keep it (6 of 16 read as a round option
   button); (2) the row sets the box at the top and the box drops (line height minus box side) / 2, so it sits beside the FIRST line of a sentence of several lines,
   as Primer, shadcn forms and Material lists do, and a one-line row keeps its 44 px and its place; (3) a switched-off box keeps a visible edge: a surface-3 fill
   with the control edge, about 2.7 to 1 on its surface-2 row in Linen and 3.6 to 1 in Midnight Oak, the level of Material 3's disabled outline, still quieter than a
   live box because its row keeps the surface-2 ground, the text-2 words, the not-allowed cursor and the group note. A ticked switched-off box draws its check in text-2. */
.ds-options { display: flex; flex-direction: column; gap: var(--ds-s-6); }
.ds-options fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.ds-options legend { padding: 0; margin: 0 0 var(--ds-s-2); font-size: var(--ds-fs-body); line-height: var(--ds-lh-body); font-weight: var(--ds-fw-section); text-transform: capitalize; }
.ds-options label { display: flex; align-items: flex-start; gap: var(--ds-s-3); min-height: var(--ds-h-lg); padding: var(--ds-s-3) var(--ds-s-4); background: var(--ds-surface-1); border: 1px solid var(--ds-hairline); border-radius: var(--ds-r-md);
  font-size: var(--ds-fs-body); line-height: var(--ds-lh-body); cursor: pointer; overflow-wrap: anywhere;
  transition: background-color var(--ds-t-hover) var(--ds-ease-out), border-color var(--ds-t-hover) var(--ds-ease-out); }
.ds-options label + label { margin-top: var(--ds-s-2); }
.ds-options label:hover:not(:has(input:checked, input:disabled)) { background: var(--ds-surface-2); }
.ds-options label:has(input:checked) { background: var(--ds-accent-soft); border-color: var(--ds-accent); }
.ds-options label:has(input:disabled) { background: var(--ds-surface-2); color: var(--ds-text-2); cursor: not-allowed; }
.ds-options label:has(input:focus-visible) { outline: 2px solid var(--ds-focus); outline-offset: 2px; }
.ds-options input[type="checkbox"] { appearance: none; margin: 0; margin-top: calc((var(--ds-lh-body) - var(--ds-s-4)) / 2); flex: none; width: var(--ds-s-4); height: var(--ds-s-4); border: 1px solid var(--ds-border-control); border-radius: var(--ds-r-xs); background: var(--ds-surface-1); cursor: inherit; display: grid; place-content: center;
  transition: background-color var(--ds-t-hover) var(--ds-ease-out), border-color var(--ds-t-hover) var(--ds-ease-out); }
.ds-options input[type="checkbox"]::after { content: ""; width: 8px; height: 4px; border-left: 2px solid var(--ds-accent-on); border-bottom: 2px solid var(--ds-accent-on); transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.ds-options input[type="checkbox"]:checked { background: var(--ds-accent); border-color: var(--ds-accent); }
.ds-options input[type="checkbox"]:checked::after { opacity: 1; }
.ds-options input[type="checkbox"]:disabled { background: var(--ds-surface-3); border-color: var(--ds-border-control); }
.ds-options input[type="checkbox"]:disabled::after { border-color: var(--ds-text-2); }
.ds-options input[type="checkbox"]:focus-visible { outline: none; }
.ds-options fieldset > p { margin: var(--ds-s-2) 0 0; font-size: var(--ds-fs-caption); line-height: var(--ds-lh-caption); letter-spacing: var(--ds-ls-caption); color: var(--ds-text-2); }

/* 3.22 Notice: one status line, its words first and an icon with them. It holds one line of height before it has any words, so nothing moves when they arrive. The markup carries both icons (a check and an alert);
   the one that shows follows the live-region role of the line: a status line reads success, an alert reads danger. Text reads the status ink, the icon the status color (tokens.css). */
.ds-notice { display: flex; align-items: flex-start; gap: var(--ds-s-2); min-height: var(--ds-s-6); font-size: var(--ds-fs-dense); line-height: var(--ds-lh-dense); }
.ds-notice > p { flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.ds-notice > .ds-i { display: none; margin-top: calc((var(--ds-lh-dense) - var(--ds-s-4)) / 2); }
.ds-notice > p[role="status"] { color: var(--ds-success-ink); }
.ds-notice > p[role="alert"] { color: var(--ds-danger-ink); }
.ds-notice:has(> p[role="status"]:not(:empty)) > .ds-notice-ok { display: block; color: var(--ds-success); }
.ds-notice:has(> p[role="alert"]:not(:empty)) > .ds-notice-err { display: block; color: var(--ds-danger); }

/* 3.23 Key (card P3937, his FD1193 B): one line that says what a list's icons mean, so no icon needs a hover to be understood. A title, then one item per icon, each the
   SAME icon the list draws and its words in Title Case; an item may hold words alone (what an empty cell means). The page places it (its padding lines it up with the
   list's first column); the system paints it. Text is --ds-text-2 on surface-1, which reads 5.5 to 1 or better in both themes; no new color. */
.ds-key { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-s-1) var(--ds-s-4); margin: 0; font: var(--ds-t-caption); letter-spacing: var(--ds-ls-caption); color: var(--ds-text-2); }
.ds-key-title { font-weight: var(--ds-fw-emphasis); color: var(--ds-text); }
.ds-key-item { display: inline-flex; align-items: center; gap: var(--ds-s-1); white-space: nowrap; }
.ds-key-item > .ds-i { flex: none; width: var(--ds-s-4); height: var(--ds-s-4); color: var(--ds-text-2); }

/* 3.24 Side panel (card P3937, his FD1220 Finding 1 and FD1221; rule R-33; docs/plans/2026-11-22-p3937-collapsible-rail/DESIGN.md). ONE side panel for every page:
   shared/ds/ds.js binds a page's [data-ds-sidepanel] and this block draws it. OPEN: a head row (the name and the collapse control) over the page's own content.
   COLLAPSED: a 56 px column (--ds-rail-w-collapsed) of the expand control, a hairline and one named icon per section; the page's grid reads the state on the
   panel's parent (data-ds-sidepanel-state="collapsed") for its thin track. FLYOUT: the panel widens over the next column by its open width, which ds.js reads at
   run time into --ds-sidepanel-open-w (as it writes --ds-origin for a menu; with no reading, the open rail's width stands in), its column stays at the left, and
   only the chosen section shows. A panel whose own
   ground is see-through (the Cut List's, a column of cards) draws its column as a card and its flyout as a tray on the page ground; a panel with a ground of
   its own (the Floating Shelf Designer's) keeps it. Screen only: a printed page shows the panel as the page drew it. Tokens only.
   AN ACTION SECTION (Opus review round 1, F3): data-ds-sidepanel-sections="...;Name|icon|selector|action" draws one more icon in the column, the same
   .ds-sidepanel-icon with data-ds-action, that clicks the page's own control the selector names: no flyout, no copy, so it has no expanded look of its own.
   NO JUMP ON LOAD (Opus review round 2, R2 and R3). A panel carries its OWN id in the page's markup (<aside id="fsd-shelf-panel" data-ds-sidepanel=...>): its
   saved choice is bws:ds-panel:<path>:<that id>, and shared/ds/shell-head.js (in the page's head) reads it before the first paint and puts
   data-ds-sidepanel-state="collapsed" on the panel and its parent as the parser places the panel, so these rules and the page's host rule draw the 56 px
   column in the first frame, before ds.js runs. (ds.js names a panel with no id ds-sidepanel-1, 2, ... only as a fallback: such a panel cannot be read before
   paint, and a second panel bound earlier would swap the saved choices.) THE ONE PAGE-SIDE RULE an adopting page copies, its grid's thin track, read from
   the host's state (screen only where the page prints the panel as drawn):
       @media screen { .my-host[data-ds-sidepanel-state="collapsed"] { grid-template-columns: var(--ds-rail-w-collapsed) minmax(0, 1fr); } }
   and the page's head carries <script src="/shared/ds/shell-head.js"></script> after shared/ds/shell.css. Nothing else. */
:where([data-ds-sidepanel]) { position: relative; }   /* zero specificity: a page that places its panel itself (the Cut List's sticky aside) keeps its own */
.ds-sidepanel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-s-2); min-height: var(--ds-h-sm); margin-bottom: var(--ds-s-2); }
.ds-sidepanel-title { font: var(--ds-t-caption); font-weight: var(--ds-fw-emphasis); letter-spacing: var(--ds-ls-caption); color: var(--ds-text-2); }
.ds-sidepanel-headhost { column-gap: var(--ds-s-2); }
.ds-sidepanel-headhost > .ds-sidepanel-toggle { margin-left: auto; }
.ds-btn.ds-sidepanel-toggle[aria-expanded="true"]:not(:hover) { background: transparent; color: var(--ds-text-2); }   /* a disclosure at rest, never drawn held down */
.ds-sidepanel-col { display: none; }
.ds-sidepanel-sep { display: block; flex: none; width: var(--ds-s-6); height: 1px; margin: var(--ds-s-1) 0; background: var(--ds-hairline); }
[data-ds-sidepanel][data-ds-sidepanel-off] > .ds-sidepanel-head, [data-ds-sidepanel][data-ds-sidepanel-off] .ds-sidepanel-toggle { display: none; }
@media screen {
  [data-ds-sidepanel][data-ds-sidepanel-state="collapsed"] { width: var(--ds-rail-w-collapsed); min-width: 0; padding: 0; }
  [data-ds-sidepanel][data-ds-sidepanel-state="collapsed"]:not([data-ds-flyout]) > :not(.ds-sidepanel-col) { display: none; }
  [data-ds-sidepanel][data-ds-sidepanel-state="collapsed"] > .ds-sidepanel-col { display: flex; flex-direction: column; align-items: center; gap: var(--ds-s-1); padding: var(--ds-s-2) 0; }
  [data-ds-sidepanel][data-ds-sidepanel-state="collapsed"] > .ds-sidepanel-col > .ds-sidepanel-toggle { width: var(--ds-h-md); height: var(--ds-h-md); }
  .ds-sidepanel-col--card { background: var(--ds-surface-1); border: 1px solid var(--ds-hairline); border-radius: var(--ds-r-lg); }
  .ds-sidepanel-icon[aria-expanded="true"] { background: var(--ds-surface-3); color: var(--ds-accent); }
  /* the flyout: over the next column, the column kept at the left, the chosen section alone */
  [data-ds-sidepanel][data-ds-flyout] { width: calc(var(--ds-rail-w-collapsed) + var(--ds-sidepanel-open-w, var(--ds-rail-w))); min-height: var(--ds-sidepanel-col-h, auto); padding-left: var(--ds-rail-w-collapsed);
    z-index: var(--layer-panel-flyout); box-shadow: var(--ds-e-2); }
  [data-ds-sidepanel][data-ds-flyout] > .ds-sidepanel-col { position: absolute; top: 0; left: 0; bottom: 0; width: var(--ds-rail-w-collapsed); }
  [data-ds-sidepanel][data-ds-flyout] > .ds-sidepanel-col:not(.ds-sidepanel-col--card) { border-right: 1px solid var(--ds-hairline); }
  [data-ds-sidepanel][data-ds-flyout]:has(> .ds-sidepanel-col--card) { width: calc(var(--ds-rail-w-collapsed) + var(--ds-sidepanel-open-w, var(--ds-rail-w)) + var(--ds-s-4));
    padding: var(--ds-s-2) var(--ds-s-2) var(--ds-s-2) calc(var(--ds-rail-w-collapsed) + var(--ds-s-2)); background: var(--ds-bg); border-radius: var(--ds-r-lg); }
  [data-ds-sidepanel][data-ds-flyout] [data-ds-section]:not([data-ds-section-open]) { display: none; }
}
@media print { .ds-sidepanel-head, .ds-sidepanel-col, .ds-sidepanel-toggle { display: none; } }

/* 3.25 Running text (card P3937, the Opus review round 2, R4; rule R-33's reading line). Words are read at --ds-prose-max (tokens.css) however wide the page
   is; data keeps the page's full width. shell.css gives it to a page's plain paragraphs and its intro lines; .ds-prose gives it to any other element that
   holds running words (a hint under a field, an empty note, a lede). A line shorter than the measure is untouched. */
.ds-prose { max-width: var(--ds-prose-max); }
