/* Seller Admin: components (plan section 5). Every shared primitive, styled
   once, its class name unchanged (core.js and the tests name them). Page
   files set geometry and page-specific detail on top; they never restate a
   property a rule here already sets for the same selector. */

/* == Type helpers ============================================================ */
.subtitle{margin:0;color:var(--ink-muted);font-size:var(--text-sm);line-height:var(--leading-sm);font-weight:var(--weight-regular)}
.hint,.section-note,.optional-label,.panel-note,.kpi-delta,.dropdown-empty,.preview-state{color:var(--ink-muted);font-size:var(--text-xs);line-height:var(--leading-xs);font-weight:var(--weight-regular)}
.hint{margin:var(--space-2) 0 0}
.hint.bad{color:var(--danger-ink)}
.section-note{margin:var(--space-1) 0 0;max-width:var(--measure)}
.panel-note{margin:0 0 var(--space-3)}
.optional-label{margin-left:var(--space-1)}
.number,.pager-range,.stat b,.kpi b,.metric b{font-variant-numeric:tabular-nums}
.number{font-weight:var(--weight-medium)}
.number.spent,.number.credit{color:var(--ok-ink)}
.number.debit{color:var(--danger-ink)}
.drift{font-weight:var(--weight-medium)}
.section-title{display:flex;align-items:center;gap:var(--space-2);min-width:0;margin:0;color:var(--ink);font-size:var(--text-md);line-height:var(--leading-md);font-weight:var(--weight-semibold)}
.section-title>.icon{flex:none;color:var(--ink-muted)}
.section-title>.section-actions{display:flex;align-items:center;gap:var(--space-2);margin-left:auto}
.section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:var(--space-3);margin-bottom:var(--space-3)}
.section-head>div{min-width:0}
.section-head>.table-link{flex:none;white-space:nowrap}
.section-head h2,.section-head h3{margin:0;font-size:var(--text-md);line-height:var(--leading-md)}

/* == Buttons ==================================================================
   32px, radius 6, 13/500, a 16px icon 6px from its label. The primary is the
   default <button>; .secondary, .quiet and .danger-button are the variants.
   :where() keeps the hover exclusion at the specificity of a plain hover, so
   a quiet control's own hover rule is never outranked by the primary fill. */
button{display:inline-flex;align-items:center;justify-content:center;gap:var(--gap-icon);height:var(--control-h);--btn-pad-x:var(--space-3);padding:0 var(--btn-pad-x);border:var(--border-w) solid transparent;border-radius:var(--radius-sm);background:var(--accent);color:var(--ink-on-accent);font:inherit;font-size:var(--text-sm);line-height:var(--leading-sm);font-weight:var(--weight-medium);white-space:nowrap;cursor:pointer;transition:background-color var(--dur-fast) var(--ease),border-color var(--dur-fast) var(--ease),color var(--dur-fast) var(--ease)}
button:hover:where(:not(:disabled)){background:var(--accent-hover)}
button:disabled{background:var(--bg-selected);border-color:transparent;color:var(--ink-disabled);cursor:not-allowed}
/* A filled button's focus stroke is the accent on its own edge; the 1px inset
   of surface between the stroke and the fill is what makes it read on a fill
   of the same hue. */
button:not(.secondary,.quiet,.icon-btn,.nav,.tab,.table-link,.danger-link,.sort-head,.menu-item,.stat,.status-button,.logout,.sidebar-search,.toast-action):focus-visible{box-shadow:inset 0 0 0 var(--border-w) var(--bg-surface)}
button.secondary{background:var(--bg-surface);border-color:var(--border);color:var(--ink)}
button.secondary:hover:not(:disabled){background:var(--bg-hover);border-color:var(--border-control)}
button.secondary:disabled{background:var(--bg-surface);border-color:var(--border);color:var(--ink-disabled)}
button.quiet{background:transparent;border-color:transparent;color:var(--ink-secondary)}
button.quiet:hover:not(:disabled){background:var(--bg-hover);color:var(--ink)}
button.small{height:var(--control-h-sm);--btn-pad-x:var(--space-2);padding:0 var(--btn-pad-x)}
.danger-button{background:var(--danger-solid);color:var(--ink-on-danger)}
.danger-button:hover:not(:disabled){background:var(--danger-solid-hover)}
/* Busy: the label stays, a 12px spinner takes the leading icon's place (or
   sits over a text-only label, which keeps the button's width and stays its
   accessible name), and the width never moves. A busy button is working, not
   unavailable: it keeps its own fill and ink although core.js also disables
   it (guardSubmit), so the spinner is never drawn on the disabled grey. The
   one looping animation in the system (test_design_system.py names it). */
button[aria-busy=true]{position:relative;cursor:progress}
button[aria-busy=true]:disabled{background:var(--accent);border-color:transparent;color:var(--ink-on-accent)}
button.secondary[aria-busy=true]:disabled{background:var(--bg-surface);border-color:var(--border);color:var(--ink)}
button.quiet[aria-busy=true]:disabled{background:transparent;color:var(--ink-secondary)}
button.danger-button[aria-busy=true]:disabled{background:var(--danger-solid);color:var(--ink-on-danger)}
button[aria-busy=true]>.icon:first-child{visibility:hidden}
button[aria-busy=true]:not(:has(>.icon:first-child)){color:transparent}
button[aria-busy=true]:before{content:"";position:absolute;top:50%;left:50%;width:var(--spinner);height:var(--spinner);margin:calc(var(--spinner) / -2) 0 0 calc(var(--spinner) / -2);border:var(--rail-w) solid currentColor;border-right-color:transparent;border-radius:var(--radius-round);color:var(--ink-on-accent);animation:busy-spin 600ms linear infinite}
button[aria-busy=true]:has(>.icon:first-child):before{left:calc(var(--btn-pad-x) + var(--icon) / 2)}
button.secondary[aria-busy=true]:before,button.quiet[aria-busy=true]:before{color:var(--ink-secondary)}
button.danger-button[aria-busy=true]:before{color:var(--ink-on-danger)}
@keyframes busy-spin{to{transform:rotate(1turn)}}

/* Text buttons: a record's name that opens it (ink, underline on hover) and
   the quiet inline actions that share its shape. Never accent blue. */
.table-link,.danger-link{height:auto;padding:0;border:0;border-radius:var(--radius-xs);background:transparent;font-size:inherit;line-height:inherit;font-weight:var(--weight-medium);text-align:left}
.table-link{color:var(--ink)}
.table-link:hover:not(:disabled),.danger-link:hover:not(:disabled){background:transparent;text-decoration:underline;text-underline-offset:var(--space-1)}
.table-link:hover:not(:disabled){color:var(--ink)}
.table-link:disabled,.danger-link:disabled{background:transparent;color:var(--ink-disabled)}
.danger-link,.danger-link:hover:not(:disabled){color:var(--danger-ink)}
.table-link.mono,.copy-open.mono{font-size:var(--text-xs);font-weight:var(--weight-regular)}
.table-link.row-link{display:block;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--text-sm);line-height:var(--leading-sm)}

/* Compact buttons inside a row or a bar. */
.row-actions button,.selection-bar button{height:var(--control-h-sm);--btn-pad-x:var(--space-2);padding:0 var(--btn-pad-x)}
.row-actions{display:flex;align-items:center;justify-content:flex-end;gap:var(--space-1)}

/* Icon buttons: quiet squares. 32px on their own, 28px in a table row, 24px
   for the in-line helpers (copy, hint, drag, collapse, toast dismiss). */
.icon-btn,.copy-button,.collapse-button,.drag-handle,.toast-dismiss{display:grid;place-items:center;gap:0;padding:0;border-color:transparent;border-radius:var(--radius-sm);background:transparent;color:var(--ink-muted)}
.icon-btn{width:var(--control-h);height:var(--control-h)}
.copy-button,.collapse-button,.drag-handle,.toast-dismiss{width:var(--hit);height:var(--hit)}
/* The hint trigger sits IN a line of text (a label, a fact, a title, a
   sentence): inline, on the text's middle, and taking no more height than
   the line it sits in (24px in a 20px line, so 4px is given back above and
   below). One shape wherever it is; a holder only sets the space before it. */
.hint-trigger{display:inline-grid;place-items:center;flex:none;width:var(--hit);height:var(--hit);margin-block:calc(var(--space-1) * -1);padding:0;vertical-align:middle;border-color:transparent;border-radius:var(--radius-sm);background:transparent;color:var(--ink-muted);cursor:help}
.icon-btn:hover:not(:disabled),.copy-button:hover:not(:disabled),.collapse-button:hover,.drag-handle:hover,.toast-dismiss:hover,.hint-trigger:hover{background:var(--bg-selected);color:var(--ink)}
.icon-btn:disabled,.copy-button:disabled{background:transparent;border-color:transparent;color:var(--ink-disabled)}
td .icon-btn.menu-trigger{width:var(--control-h-sm);height:var(--control-h-sm)}
.icon-btn.menu-trigger[aria-expanded="true"]{background:var(--bg-selected);color:var(--ink)}
tbody tr:hover .menu-trigger,tbody tr:focus-within .menu-trigger{color:var(--ink-secondary)}
.drag-handle{flex:0 0 auto;cursor:grab;user-select:none}
.drag-handle:active{cursor:grabbing}
.drag-handle .icon{color:var(--ink-muted)}
tr:hover .drag-handle .icon,tr:focus-within .drag-handle .icon{color:var(--ink-secondary)}
tr .drag-handle:hover .icon{color:var(--ink)}

/* == Fields ===================================================================
   32px, radius 6, surface fill, the control border (3:1), 13px. Focus turns
   the border to the accent and adds 1px inside it: one 2px stroke on the
   field's own edge. Forced colors (Windows High Contrast) replace the border
   colour and drop the shadow, so the same 2px edge also carries a transparent
   outline: nothing is drawn as it stands, and the system paints it there. */
input:not(:where([type=checkbox],[type=radio],[type=file])),[role=combobox]{width:100%;height:var(--control-h);padding:0 var(--input-pad-x);border:var(--border-w) solid var(--border-control);border-radius:var(--radius-sm);background:var(--bg-surface);color:var(--ink);font:inherit;font-size:var(--text-sm);line-height:var(--leading-sm);font-weight:var(--weight-regular);transition:border-color var(--dur-fast) var(--ease)}
textarea{display:block;width:100%;padding:var(--space-2) var(--input-pad-x);border:var(--border-w) solid var(--border-control);border-radius:var(--radius-sm);background:var(--bg-surface);color:var(--ink);font:inherit;font-size:var(--text-sm);line-height:var(--leading-sm);font-weight:var(--weight-regular);resize:vertical;transition:border-color var(--dur-fast) var(--ease)}
input:not(:where([type=checkbox],[type=radio],[type=file])):hover,textarea:hover,[role=combobox]:hover{border-color:var(--border-control-hover)}
input:where(:not([type=checkbox],[type=radio],[type=file])):focus,textarea:focus,[role=combobox]:focus{border-color:var(--focus);box-shadow:inset 0 0 0 var(--border-w) var(--focus);outline:var(--focus-w) solid transparent;outline-offset:calc(var(--focus-w) * -1)}
input:disabled,textarea:disabled{background:var(--bg-subtle);border-color:var(--border);color:var(--ink-disabled);cursor:not-allowed}
input[readonly]{background:var(--bg-subtle)}
input::placeholder,textarea::placeholder{color:var(--ink-muted);opacity:1}
input[type=search]::-webkit-search-cancel-button{cursor:pointer}
/* Invalid: the danger edge at rest. Focus is the accent stroke whatever the
   field's state (one focus treatment, plan 4.3); the problem text under the
   field keeps saying what is wrong while it is being fixed. */
[aria-invalid="true"],[aria-invalid="true"]:hover{border-color:var(--danger-ink)}
[aria-invalid="true"]:focus,[aria-invalid="true"]:focus:hover{border-color:var(--focus);box-shadow:inset 0 0 0 var(--border-w) var(--focus)}
.field-problem{margin:var(--space-1) 0 0;color:var(--danger-ink);font-size:var(--text-xs);line-height:var(--leading-xs);font-weight:var(--weight-regular)}
input[type=checkbox],input[type=radio]{width:var(--icon);height:var(--icon);flex:0 0 auto;margin:0;vertical-align:middle;accent-color:var(--accent);cursor:pointer}
input[type=checkbox]:disabled,input[type=radio]:disabled{cursor:not-allowed}

/* The enhanced select (core.js enhanceSelect): the native <select> stays the
   value store, hidden by class; the face is a combobox, the list a popover. */
.dropdown{display:flex;align-items:center;gap:var(--space-2);cursor:pointer;user-select:none}
.dropdown-native{display:none}
.dropdown-value{flex:1 1 auto;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.dropdown .icon{color:var(--ink-muted)}
.dropdown[aria-disabled="true"]{background:var(--bg-subtle);border-color:var(--border);color:var(--ink-disabled);cursor:not-allowed}
.dropdown-group-label{display:block;padding:var(--space-2) var(--space-2) var(--space-1);white-space:normal;color:var(--ink-muted);font-size:var(--text-xs);line-height:var(--leading-xs);font-weight:var(--weight-medium)}
.dropdown-empty{display:block;padding:var(--space-1) var(--space-2);white-space:normal}
/* The list is mounted inside its control, so it inherits that control's text
   rules: a filter pill's nowrap clipped "Awaiting activation" and scrolled the
   list sideways. Its rows wrap whatever holds them (placeList sizes the list
   to the trigger and measures the wrapped height). */
.dropdown-option{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2);white-space:normal;min-height:var(--control-h);padding:var(--space-1) var(--space-2);border-radius:var(--radius-sm);color:var(--ink);font-size:var(--text-sm);line-height:var(--leading-sm);cursor:pointer}
.dropdown-option-label{flex:1 1 auto;min-width:0}
.dropdown-option.is-current{background:var(--bg-selected)}
.dropdown-option[aria-selected="true"]{font-weight:var(--weight-medium)}
/* The chosen row's one mark is core.js's moving tick (dropdownTick), at the
   row's far end; no second mark is drawn here. */
.dropdown-option>.icon{flex:none;color:var(--accent-ink)}
.dropdown-option[aria-disabled="true"]{color:var(--ink-disabled);cursor:not-allowed}

/* Form layout: label (13/500 ink) over its control, the hint under it. The
   label-to-control gap is --label-gap, on every field: a <label> wrapping its
   control here, and the field wrappers that pair a caption with a control
   (page files use the same token). */
label{display:grid;gap:var(--label-gap);color:var(--ink);font-size:var(--text-sm);line-height:var(--leading-sm);font-weight:var(--weight-medium)}
label .hint,label .optional-label{font-weight:var(--weight-regular)}
.field-label{display:block;color:var(--ink);font-size:var(--text-sm);line-height:var(--leading-sm);font-weight:var(--weight-medium)}
.label-row{display:flex;align-items:center;gap:var(--space-2)}
.content-label{margin:var(--space-4) 0 var(--space-2)}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-4);margin-bottom:var(--space-4)}
.form-grid:last-child{margin-bottom:0}
.form-grid>label{align-content:start}
.full-field,.form-grid>.hint{grid-column:1/-1}
.schedule-field{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--space-3);align-items:end}
.checks{display:flex;flex-wrap:wrap;gap:var(--space-3) var(--space-6);margin-top:var(--space-4)}
.inline-check{display:flex;align-items:center;gap:var(--space-2);font-weight:var(--weight-regular)}
.inline-check.is-disabled{color:var(--ink-disabled)}
.subform-label{display:block;margin-bottom:var(--space-2);color:var(--ink);font-size:var(--text-sm);line-height:var(--leading-sm);font-weight:var(--weight-semibold)}
.permit-set,.kind-picker{margin:var(--space-4) 0 var(--space-1);padding:0;border:0}
.permit-set legend,.kind-picker legend{padding:0 0 var(--space-2);color:var(--ink);font-size:var(--text-sm);line-height:var(--leading-sm);font-weight:var(--weight-medium)}
.form-grid>.kind-picker{margin:0}
.kind-picker{display:grid;gap:var(--space-2);min-width:0}
.lookup-search{font-family:var(--font-sans)}
.permit-options,.preview-list{display:grid;gap:var(--space-2)}

/* A form section is quiet: a 14/600 title and air, a hairline between two. */
.form-section{min-width:0}
.form-section+.form-section{margin-top:var(--space-6);padding-top:var(--space-6);border-top:var(--border-w) solid var(--border)}
.form-section-head{display:flex;align-items:flex-start;justify-content:flex-start;gap:var(--space-3);margin-bottom:var(--space-4)}
.form-section-head>div{min-width:0}
.form-section-head h3{margin:0;font-size:var(--text-md);line-height:var(--leading-md)}
.form-section-head p{margin:var(--space-1) 0 0;color:var(--ink-muted);font-size:var(--text-sm);line-height:var(--leading-sm)}
.form-section-step{display:grid;place-items:center;width:var(--hit);height:var(--hit);flex:0 0 auto;border-radius:var(--radius-round);background:var(--bg-selected);color:var(--ink-secondary);font-size:var(--text-xs);line-height:var(--leading-xs);font-weight:var(--weight-semibold);font-variant-numeric:tabular-nums}
.form-section-lead{margin:0 0 var(--space-4);color:var(--ink-muted);font-size:var(--text-sm);line-height:var(--leading-sm)}

/* A selectable row: a radio or checkbox choice with a title and a line. */
.permit-option{display:flex;align-items:flex-start;gap:var(--space-3);width:100%;padding:var(--space-3);border:var(--border-w) solid var(--border);border-radius:var(--radius-md);background:var(--bg-surface);color:var(--ink);font-weight:var(--weight-regular);text-align:left;cursor:pointer;transition:border-color var(--dur-fast) var(--ease),background-color var(--dur-fast) var(--ease)}
.permit-option:hover{border-color:var(--border-control);background:var(--bg-hover)}
.permit-option:has(input:checked){border-color:var(--accent);background:var(--accent-subtle)}
/* The whole row is the control: it carries the one focus stroke, and the
   checkbox or radio inside it draws none of its own. */
.permit-option:has(input:focus-visible){outline:var(--focus-w) solid var(--focus);outline-offset:var(--focus-offset)}
.permit-option input{margin-top:var(--rail-w)}
.permit-option input:focus-visible{outline:none}
.permit-option strong{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--ink);font-size:var(--text-sm);font-weight:var(--weight-medium)}
.permit-option small{display:block;color:var(--ink-muted);font-size:var(--text-xs);line-height:var(--leading-xs);font-weight:var(--weight-regular)}
.permit-option.compact{align-items:center;padding:var(--space-1) var(--space-3)}
.permit-option.compact input{margin-top:0}
.permit-option.bad:has(input:checked){border-color:var(--danger-ink);background:var(--danger-subtle)}
.permit-option.bad small{color:var(--danger-ink)}

/* A file chooser that looks like a secondary button. */
.file-button{display:inline-flex;align-items:center;gap:var(--gap-icon);height:var(--control-h);padding:0 var(--space-3);border:var(--border-w) solid var(--border);border-radius:var(--radius-sm);background:var(--bg-surface);color:var(--ink);font-size:var(--text-sm);line-height:var(--leading-sm);font-weight:var(--weight-medium);cursor:pointer}
.file-button:hover{background:var(--bg-hover);border-color:var(--border-control)}
.file-button:has(input:focus-visible){outline:var(--focus-w) solid var(--focus);outline-offset:var(--focus-offset)}
.file-button[aria-disabled=true]{border-color:var(--border);color:var(--ink-disabled);cursor:not-allowed}

/* A picture field: the tile opens the chooser, the column beside it says what
   is there (product and group editors). */
.picture-field{--picture-tile:112px;display:flex;align-items:flex-start;gap:var(--space-4);min-width:0}
.picture-tile{display:grid;place-items:center;flex:none;width:var(--picture-tile);height:var(--picture-tile);padding:0;overflow:hidden;border:var(--border-w) dashed var(--border-control);border-radius:var(--radius-md);background:var(--bg-subtle);color:var(--ink-muted)}
.picture-tile:hover:not(:disabled){border-color:var(--border-control-hover);background:var(--bg-selected);color:var(--ink)}
.picture-tile.has-picture{border-style:solid;border-color:var(--border-control)}
.picture-field.is-dragover .picture-tile{border-style:solid;border-color:var(--accent);background:var(--accent-subtle)}
.picture-tile-art{display:grid;place-items:center;width:100%;height:100%}
.picture-tile-art img{width:100%;height:100%;object-fit:cover}
.picture-tile-art.is-empty{align-content:center;gap:var(--space-1);padding:var(--space-2);font-size:var(--text-xs);line-height:var(--leading-xs);font-weight:var(--weight-medium);white-space:normal}
.picture-info{display:grid;gap:var(--space-1);align-content:start;min-width:0}
.picture-state{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--ink);font-size:var(--text-sm);line-height:var(--leading-sm)}
.picture-field:not(:has(.picture-tile.has-picture)) .picture-state{color:var(--ink-muted)}
.picture-meta{color:var(--ink-muted);font-size:var(--text-xs);line-height:var(--leading-xs)}
.picture-actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-2);margin-top:var(--space-1)}
.picture-actions .file-button,.picture-actions .table-link{height:var(--control-h-sm);padding:0 var(--space-2);border-color:var(--border);border-radius:var(--radius-sm);background:var(--bg-surface);color:var(--ink);font-size:var(--text-sm);line-height:var(--leading-sm);font-weight:var(--weight-medium)}
.picture-actions .file-button:hover,.picture-actions .table-link:hover:not(:disabled){background:var(--bg-hover);border-color:var(--border-control);color:var(--ink);text-decoration:none}
.picture-actions .file-button[aria-disabled=true]{color:var(--ink-disabled)}
.picture-group .field-problem{margin:0}

/* == Toolbar, search, filters ================================================
   Search first (at most 320px), then the filter pills, then a flexible gap,
   then the record count. */
.toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-2);margin-bottom:var(--space-3)}
.toolbar-tight{margin-bottom:var(--space-2)}
.toolbar>.record-count{margin-left:auto}
.search{position:relative;flex:1 1 var(--search-min);min-width:0;max-width:var(--search-w)}
.search>.icon{position:absolute;left:var(--input-pad-x);top:50%;margin-top:calc(var(--icon) / -2);color:var(--ink-muted)}
.search input{padding-left:calc(var(--input-pad-x) + var(--icon) + var(--gap-icon))}
/* The filter pill: the label (muted) and the value (ink) in ONE 32px control.
   The pill's edge IS the combobox's boundary (the select inside draws none),
   so it is the control border (3:1, WCAG 1.4.11), never the hairline. */
.filter-control{display:inline-flex;align-items:center;gap:0;height:var(--control-h);min-width:0;padding-left:var(--input-pad-x);border:var(--border-w) solid var(--border-control);border-radius:var(--radius-sm);background:var(--bg-surface);color:var(--ink);font-weight:var(--weight-regular);white-space:nowrap;transition:border-color var(--dur-fast) var(--ease)}
.filter-control:hover{border-color:var(--border-control-hover)}
/* One focus owner per composite: the pill rings for the select inside it; a
   date range's two inputs each ring themselves (the pill cannot say which). */
.filter-control:has(>.dropdown:focus-visible){outline:var(--focus-w) solid var(--focus);outline-offset:var(--focus-offset)}
.filter-control>span{flex:0 0 auto;color:var(--ink-muted);font-size:var(--text-sm);line-height:var(--leading-sm);font-weight:var(--weight-regular)}
.filter-control .dropdown{width:auto;min-width:0;height:calc(var(--control-h) - var(--border-w) * 2);padding:0 var(--space-2) 0 var(--gap-icon);border:0;border-radius:0 var(--radius-sm) var(--radius-sm) 0;background:transparent;font-weight:var(--weight-medium)}
.filter-control .dropdown:hover{background:transparent}
.filter-control .dropdown:focus{box-shadow:none;outline:none}
.date-range{gap:var(--space-1);padding-right:var(--space-1)}
.date-range>input{width:auto;height:calc(var(--control-h) - var(--space-2));flex:0 1 auto;padding:0 var(--space-1);border:0;border-radius:var(--radius-xs);background:transparent;font-variant-numeric:tabular-nums}
.date-range>input:focus{box-shadow:none}
.date-range>input:focus-visible{outline:var(--focus-w) solid var(--focus);outline-offset:var(--focus-offset)}
.date-range>span+input{margin-left:var(--space-1)}
.date-range>input+span{margin-left:var(--space-1)}
.toolbar>.inline-check{height:var(--control-h);padding:0 var(--space-2)}
.record-count{display:inline-flex;align-items:center;gap:var(--space-1);color:var(--ink-muted);font-size:var(--text-sm);line-height:var(--leading-sm);font-weight:var(--weight-regular);font-variant-numeric:tabular-nums;white-space:nowrap}
.selection-bar{display:flex;align-items:center;flex:1 1 auto;gap:var(--space-3);min-height:var(--control-h)}
.selection-summary{color:var(--ink);font-size:var(--text-sm);line-height:var(--leading-sm);font-weight:var(--weight-medium);white-space:nowrap}

/* == The list card (plan 5): one bordered container holding, in order, a view
   bar, a filter row, the table and the pager as its foot. A page wraps its
   existing toolbar + table-wrap + pager in <div class="list-card">. Space
   between two cards comes only after a card that is showing: a hidden
   sibling (a pane switched off) adds nothing, so the visible card never moves
   with the pane beside it. (:where keeps it at the plain pair's weight, so a
   page that lays its cards out on a grid gap zeroes it as before.) */
.list-card{min-width:0;border:var(--border-w) solid var(--border);border-radius:var(--radius-md);background:var(--bg-surface)}
.list-card:where(:not([hidden]))+.list-card,.list-card:where(:not([hidden]))+.list-card[hidden]+.list-card{margin-top:var(--space-6)}
.list-card>.toolbar{margin:0;padding:var(--space-3) var(--cell-pad-edge);border-bottom:var(--border-w) solid var(--border)}
.list-card>.table-wrap{border:0;border-radius:0;background:transparent}
.list-card>.table-wrap:first-child thead th:first-child{border-top-left-radius:var(--radius-md)}
.list-card>.table-wrap:first-child thead th:last-child{border-top-right-radius:var(--radius-md)}
.list-card>.pager{margin:0;padding:var(--space-2) var(--cell-pad-edge);border-top:var(--border-w) solid var(--border)}
.list-card>.empty-state{border:0}
/* The view bar (plan 5): the card's first row, a .tabs strip of the list's
   views with their counts. Every list card with views wears this one class
   (Catalog, a product's Stock, Orders, Broadcasts, Automation's Library and
   Channels): flush with the card's top edge, its hairline the card's first
   divider, the first label on the cells' 16px edge (a tab's own 8px of ring
   room plus 8px here). */
.list-card>.view-bar{margin:0;padding:0 calc(var(--cell-pad-edge) - var(--tab-pad-x))}

/* == Tables ===================================================================
   Head 32px on the subtle fill, 12/500 muted; rows 36px with hairline
   dividers; the first and last cell 16px from the edge; numbers right. */
.table-wrap{min-width:0;border:var(--border-w) solid var(--border);border-radius:var(--radius-md);background:var(--bg-surface);overflow:auto}
table{width:100%;border-collapse:collapse;border-spacing:0}
thead th{position:sticky;top:0;z-index:var(--z-sticky);height:var(--row-h-head);padding:0 var(--cell-pad-x);background:var(--bg-subtle);color:var(--ink-muted);font-size:var(--text-xs);line-height:var(--leading-xs);font-weight:var(--weight-medium);text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:inset 0 calc(var(--border-w) * -1) 0 var(--border)}
tbody td{height:var(--row-h);padding:var(--cell-pad-y) var(--cell-pad-x);box-shadow:inset 0 calc(var(--border-w) * -1) 0 var(--border-subtle);color:var(--ink);font-size:var(--text-sm);line-height:var(--leading-sm);text-align:left;vertical-align:middle}
thead th:first-child,tbody td:first-child{padding-left:var(--cell-pad-edge)}
thead th:last-child,tbody td:last-child{padding-right:var(--cell-pad-edge)}
tbody tr{transition:background-color var(--dur-fast) var(--ease)}
tbody tr:hover{background:var(--bg-hover)}
tbody tr.selected,tbody tr.selected:hover{background:var(--bg-selected)}
tbody tr:last-child td{box-shadow:none}
tbody tr.is-archived{color:var(--ink-muted)}
/* A day separator (core.js withDays): a quiet 32px band in the head's voice. */
.day-row td{height:var(--row-h-head);padding:0 var(--cell-pad-x);background:var(--bg-subtle);color:var(--ink-muted);font-size:var(--text-xs);line-height:var(--leading-xs);font-weight:var(--weight-medium)}
tbody tr:focus-visible,tbody td:focus-visible{scroll-margin-top:var(--row-h-head);outline-offset:calc(var(--focus-w) * -1)}
.actions-col{width:1%;text-align:right;white-space:nowrap}
.check-col{width:var(--space-10);text-align:center}
thead th.check-col,tbody td.check-col{padding-left:var(--space-3);padding-right:var(--space-1)}
.selection-placeholder{display:block;width:var(--icon);height:var(--icon);margin:auto}
.row-index{color:var(--ink-muted);font-size:var(--text-xs);font-variant-numeric:tabular-nums}
.id-cell,.number-col,.price-cell{text-align:right}
.sort-head{width:100%;height:100%;gap:var(--space-1);padding:0;justify-content:flex-start;border-color:transparent;border-radius:0;background:transparent;color:inherit;font-size:inherit;line-height:inherit;font-weight:inherit}
.sort-head:hover:not(:disabled){background:transparent;color:var(--ink)}
/* The head cell clips (overflow:hidden) and has no block padding, so the
   ring is laid inside the button's own edge, where nothing can cut it. */
.sort-head:focus-visible{outline-offset:calc(var(--focus-w) * -1)}
.price-cell .sort-head{justify-content:flex-end}
th[aria-sort=ascending] .sort-head:not(.is-idle),th[aria-sort=descending] .sort-head:not(.is-idle){color:var(--ink)}
.sort-head-fold{display:none}

/* Cells: the primary line 13/500 ink, the secondary line 12 muted. A
   schedule's or a broadcast's name cell (.notification-name: Automation's
   messages and senders, Broadcasts' titles and failures) is the same pair. */
.notification-name,.notification-name strong{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--ink)}
.notification-name small{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--ink-muted);font-size:var(--text-xs);line-height:var(--leading-xs);font-weight:var(--weight-regular)}
.cell-sub,.entity small,.user-cell small,.price-mod{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--ink-muted);font-size:var(--text-xs);line-height:var(--leading-xs);font-weight:var(--weight-regular)}
.cell-sub.warn{color:var(--warn-ink)}
.cell-line{display:flex;align-items:center;gap:var(--space-1);height:var(--chip-h);white-space:nowrap}
.date-cell,.time-cell{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-variant-numeric:tabular-nums}
.entity,.copyable{display:flex;align-items:center;gap:var(--space-2);min-width:0;white-space:nowrap}
.entity{overflow:hidden;text-overflow:ellipsis}
.entity>div{min-width:0}
.entity>div,.entity strong,.user-cell strong{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--ink);font-size:var(--text-sm);font-weight:var(--weight-medium)}
.entity strong.with-chip{display:flex;align-items:center;gap:var(--space-2)}
.entity strong.with-chip>span:first-child{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.entity-icon{display:grid;place-items:center;flex:0 0 auto;width:var(--avatar);height:var(--avatar);border-radius:var(--radius-sm);font-size:var(--text-xs);font-weight:var(--weight-semibold)}
.entity-icon{background:var(--bg-selected);color:var(--ink-secondary)}
.neutral-icon{color:var(--ink-muted)}
.user-cell .user-link{display:block;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--text-sm);line-height:var(--leading-sm)}
/* The customer cell (core.js customerCell / customerInline): Customers,
   Orders, Activity, Home and the product page all draw it, so its rules live
   here, not in a page sheet (sol-final-pages 5). The name, and on one line
   the name then its muted handle, which gives way first. */
.customer-name{display:flex;align-items:center;gap:var(--space-1);min-width:0}
.customer-name>strong,.customer-name>.user-link{min-width:0}
.customer-inline{display:flex;align-items:baseline;gap:var(--space-2);min-width:0}
.customer-inline .customer-name{flex:0 1 auto}
.customer-handle{flex:0 100 auto;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--ink-muted)}
.custom-emoji{position:relative;overflow:hidden}
.custom-emoji img{position:relative;z-index:1;display:block;width:100%;height:100%;padding:var(--space-1);object-fit:contain}
.emoji-loading{position:absolute;inset:0;background:var(--bg-selected)}
.custom-emoji.loaded .emoji-loading,.custom-emoji.failed .emoji-loading,.custom-emoji.failed img{display:none}

/* A product's picture (core.js productThumb), and the hidden product's soft
   picture with its eye-off corner (catalog redesign X1: no pill). */
.product-thumb{position:relative;display:inline-grid;place-items:center;flex:0 0 auto;overflow:hidden;width:var(--control-h-sm);height:var(--control-h-sm);border:var(--border-w) solid var(--border-subtle);border-radius:var(--radius-sm);background:var(--bg-selected);color:var(--ink-secondary);font-size:var(--text-xs);font-weight:var(--weight-semibold)}
.product-thumb img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.product-thumb.failed img{display:none}
.product-thumb-lg{width:var(--avatar-lg);height:var(--avatar-lg);border-radius:var(--radius-md)}
.thumb-off img,.thumb-off .thumb-initials{filter:var(--picture-off)}
.thumb-off-mark{position:absolute;right:0;bottom:0;display:grid;place-items:center;width:var(--thumb-mark);height:var(--thumb-mark);border-top-left-radius:var(--radius-xs);background:var(--bg-surface);color:var(--ink-muted)}
.thumb-off-mark .icon{width:calc(var(--thumb-mark) - var(--space-1));height:calc(var(--thumb-mark) - var(--space-1))}

/* Money (core.js price()): the figure, the unit muted after it. */
.price{display:block;white-space:nowrap}
.price-unit{color:var(--ink-muted);font-size:var(--text-xs);line-height:var(--leading-xs);font-weight:var(--weight-regular)}
.price-was{margin-right:var(--space-1);color:var(--ink-muted);text-decoration:line-through}

/* Copy affordance: the value, and a copy button that shows on hover/focus.
   The value clips itself (.copy-value); the pair never does, so the button's
   focus ring (2px outside a 24px button on a 20px line) is never cut. */
.copyable{max-width:100%;overflow:visible}
/* In a table cell the line is the text's: the 24px copy button may not make a
   two-line row 48px where every other one is 44. */
td .copyable:not(.multiline){height:var(--leading-sm)}
.copy-value{display:block;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.copyable>.copy-button{flex:none}
.copyable.multiline{align-items:flex-start}
.copyable.multiline .copy-value{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal;line-height:var(--leading-xs)}
.copy-open{font-size:var(--text-sm);line-height:var(--leading-sm)}
.copy-button{opacity:0;transition:opacity var(--dur-fast) var(--ease)}
.copyable:hover .copy-button,tbody tr:hover .copy-button,.copy-button:focus-visible,.copy-button.copied{opacity:1}
.copy-button.copied{background:var(--ok-subtle);color:var(--ok-ink)}

/* == Badge, chip ==============================================================
   20px, 12/500, radius 4, the tone's fill and ink, no border. One tone table:
   .badge.X and .chip.X share each rule; pre/off are the old names of warn and
   neutral. Colour and the word tell states apart: nothing leads the word (no
   dot, no glyph). Only a channel badge keeps its channel's icon. */
.badge,.chip{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-1);flex:none;max-width:100%;height:var(--chip-h);padding:0 var(--gap-icon);border-radius:var(--radius-xs);background:var(--neutral-subtle);color:var(--neutral-ink);font-size:var(--text-xs);line-height:var(--leading-xs);font-weight:var(--weight-medium);white-space:nowrap;vertical-align:middle}
.badge .icon,.chip .icon{width:var(--icon-sm);height:var(--icon-sm)}
.badge.channel-mark{padding:0 var(--space-1);background:transparent;color:var(--ink-muted)}
.chip.mini{flex:none}
.badge.ok,.chip.ok{background:var(--ok-subtle);color:var(--ok-ink)}
.badge.info,.chip.info,.chip.source{background:var(--info-subtle);color:var(--info-ink)}
.badge.warn,.chip.warn,.badge.pre,.chip.pre,.chip.drift{background:var(--warn-subtle);color:var(--warn-ink)}
.badge.danger,.chip.danger{background:var(--danger-subtle);color:var(--danger-ink)}
.badge.neutral,.chip.neutral,.badge.off,.chip.off,.chip.muted{background:var(--neutral-subtle);color:var(--neutral-ink)}
/* A tag on a selected fill keeps its shape (R5). The neutral tag's own fill IS
   --bg-selected and the info tag's IS --accent-subtle, the two fills a selected
   table row, a picked channel, a checked option, a chosen level and the current
   palette or menu option wear, so there a grey or blue tag lost its edge and
   read as loose text. Inside those fills the two tones take the surface, as far
   from the selected fill as a tag at rest is from the surface, in both schemes;
   the other tones already differ from both fills in hue. Hover paints the
   lighter --bg-hover, which no tag's fill matches, and focus only a ring. */
:is(tbody tr.selected,.picker-row.selected,.permit-option:has(input:checked),.perf-row.is-selected,.level-tab[aria-selected="true"],.palette-option[aria-selected="true"],.dropdown-option.is-current,.menu-item.is-current){--neutral-subtle:var(--bg-surface);--info-subtle:var(--bg-surface)}
.number.depleted,.drift{color:var(--warn-ink)}
/* A count after a tab or label: a plain muted figure, no box. */
.tab-count{margin-left:var(--gap-icon);color:var(--ink-muted);font-size:var(--text-sm);line-height:var(--leading-sm);font-weight:var(--weight-regular);font-variant-numeric:tabular-nums}
.tab.active .tab-count{color:var(--ink-secondary)}

/* A language code: ONE tag wherever a code is shown (core.js languageTag,
   R4 V11), a .badge in its state's tone with the code in the mono face: the
   locales a creative or a channel list carries, a channel's language, the
   message editors' language tabs and the product page's language toggles.
   And as plain muted text beside one (.language-code). */
.badge.locale-chip{font-family:var(--font-mono)}
.language-code{color:var(--ink-muted);font-size:var(--text-xs);line-height:var(--leading-xs)}

/* == Coverage meter: a 4px bar of who got it, and its legend of tone dots
   (an Automation campaign's channels, a broadcast's audience). A key that
   opens the detail is a text button. Every segment and key wears the TONE of
   the state it counts, from core.js STATUS_TONES (R4: a route that is
   sending is ok wherever it is drawn, its tag, this bar, its legend and the
   Campaigns list's mini-bar alike), so the bar can never disagree with the
   tags it sums. */
.coverage{display:grid;grid-column:1/-1;gap:var(--space-2)}
.coverage-bar{display:flex;height:var(--meter-h);width:100%;border-radius:var(--radius-xs);background:var(--border);overflow:hidden}
.coverage-bar>span{display:block;height:100%;background:var(--accent)}
.coverage-bar>.ok,.mini-bar>.ok{background:var(--ok-ink)}
.coverage-bar>.warn{background:var(--warn-ink)}
.coverage-bar>.danger{background:var(--danger-ink)}
.coverage-bar>.neutral{background:var(--neutral-ink)}
.coverage-legend{display:flex;flex-wrap:wrap;gap:var(--space-1) var(--space-4);color:var(--ink-muted);font-size:var(--text-xs)}
.coverage-legend b{color:var(--ink);font-weight:var(--weight-semibold);font-variant-numeric:tabular-nums}
.coverage-legend .cov-key{display:inline-flex;align-items:center;gap:var(--space-2)}
.coverage-legend .cov-key:before{content:"";width:var(--dot);height:var(--dot);border-radius:var(--radius-round);background:currentColor}
.coverage-legend .cov-key.ok{color:var(--ok-ink)}
.coverage-legend .cov-key.warn{color:var(--warn-ink)}
.coverage-legend .cov-key.danger{color:var(--danger-ink)}
.coverage-legend .cov-key.neutral{color:var(--neutral-ink)}
.coverage-legend .cov-key.audience{color:var(--ink-secondary)}
/* A key whose count is zero ("0 of 12 sending") says so in the muted ink,
   its dot too: a green key over nothing reads as good news. */
.coverage-legend .cov-key.is-zero{color:var(--ink-muted)}
.cov-key.audience:before{display:none}
.coverage-legend button.cov-key{height:auto;padding:0;background:transparent;border-color:transparent;font-size:var(--text-xs);line-height:var(--leading-xs);font-weight:var(--weight-medium);color:var(--accent-ink)}
.coverage-legend button.cov-key:hover{background:transparent;text-decoration:underline}

/* == Tabs =====================================================================
   36px, 13/500 muted; the active tab is ink with a 2px ink underline flush
   with the strip's hairline. A tab carries --tab-pad-x of air each side of
   its label, so its focus ring (drawn inside its edge, where no scroller can
   cut it) never touches the text; the labels stay 20px apart (8 + 4 + 8).
   A strip that does not fit its box wraps onto a second row rather than
   scrolling a tab out of sight (catalog redesign D6 as amended: no tab cut at
   the edge). It is the one rule for every strip at every width, so it only
   ever acts where the labels do not fit (a phone, in practice). */
.tabs{display:flex;flex-wrap:wrap;align-items:stretch;gap:0 var(--space-1);max-width:100%;margin-bottom:var(--space-4);border-bottom:var(--border-w) solid var(--border)}
.tab{position:relative;flex:none;height:calc(var(--row-h) + var(--border-w));gap:0;padding:0 var(--tab-pad-x);margin-bottom:calc(var(--border-w) * -1);border:0;border-bottom:var(--rail-w) solid transparent;border-radius:0;background:transparent;color:var(--ink-muted);font-size:var(--text-sm);line-height:var(--leading-sm);font-weight:var(--weight-medium)}
.tab:hover:not(:disabled){background:transparent;color:var(--ink)}
.tab.active{border-bottom-color:var(--ink);color:var(--ink)}
.tab .icon{margin-right:var(--gap-icon);color:var(--ink-muted)}
.tab.active .icon{color:var(--ink-secondary)}
.tab:focus-visible{outline-offset:calc(var(--focus-w) * -1);border-radius:var(--radius-xs)}
.tab-short{display:none}
/* The segmented control: a 28px track, the chosen segment a surface chip. */
.tabs-choice{display:inline-flex;flex-wrap:nowrap;align-items:center;gap:var(--rail-w);width:fit-content;max-width:100%;height:var(--control-h-sm);margin-bottom:0;padding:var(--rail-w);border:0;border-radius:var(--radius-sm);background:var(--bg-selected)}
.tabs-choice .tab{height:calc(var(--control-h-sm) - var(--space-1));margin:0;padding:0 var(--space-3);border:var(--border-w) solid transparent;border-radius:var(--radius-xs);font-size:var(--text-sm)}
.tabs-choice .tab:hover:not(:disabled){color:var(--ink)}
.tabs-choice .tab.active{border-color:var(--border);background:var(--bg-surface);color:var(--ink)}
.tabs-choice .tab:focus-visible{outline-offset:0}
.tabs-choice .tab-count{margin-left:var(--space-1)}

/* == Pager: the list's foot. The range at the left, Previous/Next quiet at
   the right; cursor paging shows no total. */
.pager{display:flex;align-items:center;justify-content:flex-end;gap:var(--space-1);margin-top:var(--space-3)}
.pager-range{order:-1;margin-right:auto;color:var(--ink-muted);font-size:var(--text-sm);line-height:var(--leading-sm);font-weight:var(--weight-regular)}
.pager button,.pager button.secondary{height:var(--control-h-sm);--btn-pad-x:var(--space-2);padding:0 var(--btn-pad-x);border-color:transparent;background:transparent;color:var(--ink-secondary)}
.pager button:hover:not(:disabled),.pager button.secondary:hover:not(:disabled){background:var(--bg-hover);border-color:transparent;color:var(--ink)}
.pager button:disabled,.pager button.secondary:disabled{background:transparent;color:var(--ink-disabled)}

/* == Meters: a 4px track, the share in the accent. */
.mini-bar{display:flex;width:100%;height:var(--meter-h);overflow:hidden;border-radius:var(--radius-xs);background:var(--border)}
.mini-bar>span{display:block;height:100%;background:var(--accent)}

/* == Metric strip (plan 5): ONE bordered card, cells divided by hairlines.
   Label (12/500 muted) over the figure (20/600 tabular, its unit muted),
   an optional one-line foot. A tone colours the figure only. A clickable
   cell is a <button>. No icons, no rails. Each cell draws its right and
   bottom hairline inside itself and the card's frame is painted over the
   outer ones, so the strip wraps without a doubled line. */
/* Columns: as many as fit at --stat-min, but a long strip wraps into even
   rows (seven or eight cells: four a row; nine or ten: five) instead of
   squeezing every figure into an ellipsis. */
.stats,.metric-strip,.kpi-grid{--stat-cols:8;position:relative;display:grid;grid-template-columns:repeat(auto-fit,minmax(max(var(--stat-min,152px),calc(100% / var(--stat-cols) - var(--border-w))),1fr));overflow:hidden;border-radius:var(--radius-md);background:var(--bg-surface)}
.stats:has(>:nth-child(7)),.kpi-grid:has(>:nth-child(7)){--stat-cols:4}
.stats:has(>:nth-child(9)),.metric-strip:has(>:nth-child(9)),.kpi-grid:has(>:nth-child(9)){--stat-cols:5}
/* Five cells are always one row of five on a desktop (a figure never
   wraps to a lone fifth), three over two on a tablet, and two, two and the
   fifth across on a phone (the media blocks below): the product page's
   strip, Analytics' headline strip, and any other strip of five. */
.stats:has(>:nth-child(5):last-child),.metric-strip:has(>:nth-child(5):last-child),.kpi-grid:has(>:nth-child(5):last-child){grid-template-columns:repeat(5,minmax(0,1fr))}
.stats:after,.metric-strip:after,.kpi-grid:after{content:"";position:absolute;inset:0;border:var(--border-w) solid var(--border);border-radius:inherit;pointer-events:none}
.stats{margin-bottom:var(--space-6)}
.stats:empty,.metric-strip:empty,.kpi-grid:empty{display:none}
.metric-strip,.kpi-grid{margin-bottom:var(--space-4)}
.kpi-grid{--stat-min:184px}
.stat,.metric,.kpi{position:relative;display:flex;flex-direction:column;min-width:0;padding:var(--space-3) var(--space-4);box-shadow:inset calc(var(--border-w) * -1) 0 0 var(--border),inset 0 calc(var(--border-w) * -1) 0 var(--border)}
.stat>span,.metric>span,.kpi>span{order:-1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--ink-muted);font-size:var(--text-xs);line-height:var(--leading-xs);font-weight:var(--weight-medium)}
.stat b,.kpi b,.metric b{display:block;margin-top:var(--space-1);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--ink);font-size:var(--text-xl);line-height:var(--leading-xl);font-weight:var(--weight-semibold);letter-spacing:var(--track-tight)}
.stat-unit{margin-left:var(--space-1);color:var(--ink-muted);font-size:var(--text-xs);line-height:var(--leading-xs);font-weight:var(--weight-medium);letter-spacing:normal}
.stat small,.kpi small,.metric small{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--ink-muted);font-size:var(--text-xs);line-height:var(--leading-xs)}
.stat-warn b{color:var(--warn-ink)}
.stat-danger b{color:var(--danger-ink)}
button.stat,a.stat{display:flex;align-items:stretch;gap:0;width:auto;height:auto;border:0;border-radius:0;background:transparent;color:var(--ink);font-weight:var(--weight-regular);text-align:left;white-space:normal;cursor:pointer}
a.stat{text-decoration:none}
button.stat:hover:not(:disabled),a.stat:hover{background:var(--bg-hover);color:var(--ink)}
button.stat:focus-visible,a.stat:focus-visible{outline-offset:calc(var(--focus-w) * -1)}
.stat-skeleton .skeleton{width:40%;height:var(--space-3);margin:var(--space-1) 0 0}
.stat-skeleton .skeleton+.skeleton{width:64%;height:var(--space-5);margin:var(--space-2) 0 0}
.kpi-delta{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-2);margin:var(--space-2) 0 0}

/* == Facts and field grids ====================================================
   dl.facts: a 160px muted label column and the value in ink; hairlines
   between rows only once the list is longer than four. */
.facts{margin:0;min-width:0}
.facts-body{margin:0}
.facts-title{margin:0 0 var(--space-2);color:var(--ink);font-size:var(--text-md);line-height:var(--leading-md);font-weight:var(--weight-semibold)}
.facts-row{display:grid;grid-template-columns:var(--facts-label-w) minmax(0,1fr) auto;align-items:baseline;column-gap:var(--space-4);padding:var(--space-2) 0}
.facts:has(>.facts-row:nth-child(5)) .facts-row+.facts-row,.facts-body:has(>.facts-row:nth-child(5)) .facts-row+.facts-row{box-shadow:inset 0 var(--border-w) 0 var(--border-subtle)}
.facts-row dt{display:flex;align-items:center;gap:var(--space-1);min-width:0;color:var(--ink-muted);overflow-wrap:anywhere;font-size:var(--text-sm);line-height:var(--leading-sm);font-weight:var(--weight-regular)}
.facts-row dd{min-width:0;margin:0;color:var(--ink);overflow-wrap:anywhere;font-size:var(--text-sm);line-height:var(--leading-sm);font-weight:var(--weight-regular)}
.facts-row .cell-sub{overflow:visible;white-space:normal}
.facts-go{display:inline-flex;align-items:center;gap:var(--space-1);justify-self:end;white-space:nowrap;text-decoration:none}
.facts-ok dd,.field-ok .field-value{color:var(--ok-ink)}
.facts-info dd,.field-info .field-value{color:var(--info-ink)}
.facts-warn dd,.field-warn .field-value{color:var(--warn-ink)}
.facts-danger dd,.field-danger .field-value{color:var(--danger-ink)}
.facts-neutral dd,.field-neutral .field-value{color:var(--ink-secondary)}
/* .field-grid: one framed grid of cells, label over value, 3 then 2 then 1. */
.field-grid{position:relative;display:flex;flex-wrap:wrap;overflow:hidden;border-radius:var(--radius-md);background:var(--bg-surface)}
.field-grid:after{content:"";position:absolute;inset:0;pointer-events:none;border:var(--border-w) solid var(--border);border-radius:inherit}
.field-cell{flex:1 1 max(var(--field-cell-min),calc(100% / 3 - var(--border-w)));min-width:0;padding:var(--space-3) var(--space-4);box-shadow:inset calc(var(--border-w) * -1) 0 0 var(--border),inset 0 calc(var(--border-w) * -1) 0 var(--border)}
.field-grid .field-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--ink-muted);font-size:var(--text-xs);line-height:var(--leading-xs);font-weight:var(--weight-medium)}
.field-value{display:block;min-width:0;margin-top:var(--space-1);color:var(--ink);overflow-wrap:anywhere;font-size:var(--text-sm);line-height:var(--leading-sm);font-weight:var(--weight-medium)}
.field-value .cell-sub{overflow:visible;white-space:normal}

/* == Surfaces =================================================================
   One level of containment per object. A panel is a card; anything inside it
   is unboxed (a table inside runs to the card's edges). */
.panel{min-width:0;padding:var(--space-4) var(--space-5);border:var(--border-w) solid var(--border);border-radius:var(--radius-md);background:var(--bg-surface)}
.panel+.panel{margin-top:var(--space-4)}
.panel>h3{margin:0 0 var(--space-3);font-size:var(--text-md);line-height:var(--leading-md)}
.panel .table-wrap{margin-inline:calc(var(--space-5) * -1);border-width:var(--border-w) 0 0;border-radius:0}
.panel>.table-wrap:last-child,.panel>.pager:last-child{margin-bottom:calc(var(--space-4) * -1)}
.panel>.pager{margin-inline:calc(var(--space-5) * -1);padding:var(--space-2) var(--space-5);border-top:var(--border-w) solid var(--border)}
.panel>.table-wrap+*{margin-top:var(--space-5)}

/* == Notices ==================================================================
   A callout is a quiet inline notice for an actual exception: the tone's
   fill, a tone icon, one or two sentences (a title over a line), and an
   optional action at its end. Info is the default; .warn (a person has to
   act, or it cannot be undone), .danger (it failed) and .ok (it is done) are
   the tones that differ. Its tone icon sits on the first line. A band
   (.is-band) runs across a list card, between its view bar and filter row. */
.callout,.schedule-hint{display:flex;gap:var(--space-3);padding:var(--space-3) var(--space-4);border-radius:var(--radius-md);font-size:var(--text-sm);line-height:var(--leading-sm)}
.callout{align-items:flex-start;margin-bottom:var(--space-4);background:var(--info-subtle);color:var(--ink)}
.callout>.icon,.schedule-hint>.icon{flex:none;margin-top:var(--rail-w);color:var(--info-ink)}
.callout.ok{background:var(--ok-subtle)}
.callout.ok>.icon{color:var(--ok-ink)}
.callout.warn{background:var(--warn-subtle)}
.callout.warn>.icon{color:var(--warn-ink)}
.callout.danger{background:var(--danger-subtle)}
.callout.danger>.icon{color:var(--danger-ink)}
.callout strong{display:block;color:var(--ink);font-size:var(--text-sm);font-weight:var(--weight-semibold)}
.callout p{margin:var(--space-1) 0 0;color:var(--ink-secondary)}
.callout>div{flex:1;min-width:0}
.callout.is-band{margin:0;padding-inline:var(--cell-pad-edge);border-radius:0;border-bottom:var(--border-w) solid var(--border)}
.callout .inline-check{flex:0 0 auto;align-self:center;height:var(--control-h);padding:0 var(--space-3);border:var(--border-w) solid var(--border);border-radius:var(--radius-sm);background:var(--bg-surface);white-space:nowrap}
.callout>.callout-action,.callout>.callout-actions{display:flex;flex:0 0 auto;align-self:center;gap:var(--space-2);white-space:nowrap}
.schedule-hint{align-items:center;margin:var(--space-3) 0 0;background:var(--bg-subtle);color:var(--ink-secondary)}
.schedule-hint:empty{display:none}
.error-text{color:var(--danger-ink)}

/* == Empty, loading ===========================================================
   An empty state is centred in its region: a 32px muted icon, a 14/600 title,
   a 13px muted line, at most one action (a secondary button, core.js
   emptyBlock). A table inside a sheet or a card may say it in one muted line
   (core.js empty(): .empty-line). Skeletons are static. */
.empty-state{display:grid;justify-items:center;align-content:center;gap:var(--space-2);padding:var(--space-12) var(--space-6);text-align:center}
.empty-state.boxed{border:var(--border-w) solid var(--border);border-radius:var(--radius-md);background:var(--bg-surface)}
.empty-state h2{margin:var(--space-1) 0 0;color:var(--ink);font-size:var(--text-md);line-height:var(--leading-md);font-weight:var(--weight-semibold)}
.empty-state p{max-width:var(--measure);margin:0;color:var(--ink-muted);font-size:var(--text-sm);line-height:var(--leading-sm)}
.empty-state button{margin-top:var(--space-3)}
.empty-glyph{display:grid;place-items:center;width:var(--space-8);height:var(--space-8);color:var(--ink-muted)}
.empty-glyph .icon{width:var(--space-8);height:var(--space-8);stroke-width:1}
tbody td.empty-row{padding:var(--space-10) var(--space-6);text-align:center;color:var(--ink-muted);font-size:var(--text-sm)}
tbody td.empty-row-rich{padding:var(--space-2) var(--space-6) var(--space-6)}
.empty-line{display:block}
.preview-none{color:var(--ink-muted)}
.skeleton{display:block;height:var(--space-3);border-radius:var(--radius-xs);background:var(--bg-selected)}
.skeleton-row{pointer-events:none}
.skeleton-row td .skeleton{width:min(100%,var(--scroll-region))}
/* A two-line list's skeleton is that list's own 44px row (core.js
   skeletonRows, r2 V10): a name bar over a shorter sub-line bar. */
.skeleton-row.is-two-line td{height:calc(var(--row-h) + var(--space-2))}
.skeleton-row td .skeleton.is-sub{width:min(40%,var(--search-w));height:var(--space-2);margin-top:var(--space-1)}
.skeleton-stack{display:grid;gap:var(--space-3);padding:var(--space-4)}
.skeleton-stack .skeleton{height:var(--space-8)}

/* == Message previews (automation, broadcasts, the product editor): the card
   a customer receives, framed as the message it is. */
.preview-card{display:flex;flex-direction:column;overflow:hidden;border:var(--border-w) solid var(--border);border-radius:var(--radius-md);background:var(--bg-surface)}
.preview-card-head{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);padding:var(--space-2) var(--space-3);border-bottom:var(--border-w) solid var(--border);background:var(--bg-subtle)}
.preview-card-head strong{color:var(--ink-secondary);font-size:var(--text-xs);line-height:var(--leading-xs);font-weight:var(--weight-medium)}
.preview-list .preview-card-head{background:var(--bg-surface)}
.preview-body{flex:1;min-height:var(--space-16);max-height:var(--preview-h);margin:0;padding:var(--space-3);overflow:auto;font-family:var(--font-sans);color:var(--ink);font-size:var(--text-sm);line-height:var(--leading-sm);white-space:pre-wrap;overflow-wrap:anywhere}
.preview-body b,.preview-body strong{color:var(--ink);font-weight:var(--weight-semibold)}
.preview-body code,.preview-body pre{font-family:var(--font-mono);font-size:var(--text-xs)}
.preview-body blockquote{margin:var(--space-1) 0;padding-left:var(--space-2);border-left:var(--rail-w) solid var(--border-strong);color:var(--ink-secondary)}
.preview-list .preview-body{background:var(--bg-subtle)}
.preview-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:var(--space-3)}
.product-preview{margin-top:var(--space-3)}
.preview-keyboard{display:grid;gap:var(--space-2);padding:var(--space-2) var(--space-3);border-top:var(--border-w) solid var(--border);background:var(--bg-subtle)}
.preview-key-row{display:flex;flex-wrap:wrap;gap:var(--space-2)}
.preview-key{display:inline-flex;align-items:center;height:var(--hit);padding:0 var(--space-3);border:var(--border-w) solid var(--border);border-radius:var(--radius-sm);background:var(--bg-surface);color:var(--ink-secondary);font-size:var(--text-xs);line-height:var(--leading-xs)}
.preview-verdict{display:block;margin:0;padding:var(--space-2) var(--space-3);border-top:var(--border-w) solid var(--border);background:var(--bg-subtle);color:var(--ink-secondary);font-size:var(--text-xs);line-height:var(--leading-xs);font-weight:var(--weight-medium)}
.preview-verdict.ok{color:var(--ok-ink)}
.preview-verdict.bad{color:var(--danger-ink)}

@media(min-width:1400px){
  .sort-head-fold-wide{display:none}
}
@media(max-width:1180px){
  .sort-head-fold{display:flex}
}
@media(max-width:1024px){
  .section-head{align-items:flex-start;flex-direction:column}
  .selection-bar{margin-left:0;width:100%}
  .stats:has(>:nth-child(5):last-child),.metric-strip:has(>:nth-child(5):last-child),.kpi-grid:has(>:nth-child(5):last-child){grid-template-columns:repeat(6,minmax(0,1fr))}
  :is(.stats,.metric-strip,.kpi-grid):has(>:nth-child(5):last-child)>*{grid-column:span 2}
  :is(.stats,.metric-strip,.kpi-grid):has(>:nth-child(5):last-child)>:nth-child(n+4){grid-column:span 3}
}
@media(max-width:760px){
  .form-grid,.schedule-field{grid-template-columns:minmax(0,1fr)}
  .checks{display:grid}
  .search{flex:1 1 100%;max-width:none}
  .tabs{width:100%}
  .tabs-choice .tab{flex:1 1 auto}
  .tab-long{display:none}
  .tab-short{display:inline}
  /* A phone takes every strip two-up, and an odd last cell runs across the
     row: a strip of three is two over one, never two over one and an empty
     fourth cell (FX V19). Five keep their own two, two and one (below). */
  .stats,.metric-strip,.kpi-grid{--stat-min:136px;grid-template-columns:repeat(2,minmax(0,1fr))}
  :is(.stats,.metric-strip,.kpi-grid)>:last-child:nth-child(odd){grid-column:1/-1}
  :is(.stats,.metric-strip,.kpi-grid):has(>:nth-child(5):last-child)>*{grid-column:span 3}
  :is(.stats,.metric-strip,.kpi-grid):has(>:nth-child(5):last-child)>:nth-child(5){grid-column:1/-1}
  .copy-button{opacity:1}
  /* A table wider than the phone scrolls sideways; its empty, no-match or
     failure state does not ride along. It is as wide as the wrap the
     operator sees (100cqi, the wrap is the size container) and stays put
     while the table scrolls, so its title and button are never cut off. */
  .table-wrap{container-type:inline-size}
  tbody td.empty-row>:is(.empty-state,.empty-line){position:sticky;left:var(--space-6);width:calc(100cqi - var(--space-6) * 2)}
  .callout:has(>.inline-check,>.callout-action,>.callout-actions){flex-wrap:wrap}
  .callout .inline-check{width:100%;justify-content:center}
  .callout>.callout-action,.callout>.callout-actions{width:100%}
  .preview-card.product-preview .preview-card-head{flex-wrap:wrap}
}
