@import url("tokens.css");
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--sf-bg); color: var(--sf-text); font: var(--sf-fs-2)/1.35 var(--sf-font); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }   /* slate 56 T4: no font boost on a phone rotate (all widths) */
a { color: var(--sf-text); text-decoration: none; }
@media (hover: hover) { a:hover { text-decoration: underline; color: var(--sf-fox-2); } }   /* slate 29 orange rule: links read as text */
/* slate 56 T4: EVERY :hover rule in this file sits inside an @media (hover: hover) block (same declarations, same
   place): a touch screen never keeps a stuck hover look after a tap. */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sf-sp-2); padding: var(--sf-sp-2); }
.tile { background: var(--sf-pane); border: 1px solid var(--sf-line); border-radius: var(--sf-r); padding: var(--sf-sp-2) var(--sf-sp-3); min-height: 120px; }
.tile h3 { margin: 0 0 var(--sf-sp-2); font-size: var(--sf-fs-1); color: var(--sf-text-2); text-transform: uppercase; letter-spacing: .06em; display: flex; justify-content: space-between; }
.tile h3 .pop { color: var(--sf-text-2); cursor: pointer; }
@media (hover: hover) { .tile h3 .pop:hover { color: var(--sf-text); } }   /* slate 30 orange rule: the pop-out reads as text */
.num { font-family: var(--sf-mono); }
/* slate 56 T2: figures line up in every numeric place (tabular) and a zero never reads as an O (slashed) */
.num, td.num, .desk-table td, .alert-table td.ts { font-variant-numeric: tabular-nums slashed-zero; }
.chip { display: inline-block; padding: 0 6px; border-radius: 3px; font-size: var(--sf-fs-0); font-weight: 600; line-height: 18px; }
/* slate 56 T3: the legacy chip state classes wear their family's colours (status: ok -> up, down -> down, warn -> warn,
   off -> muted; the token-derived dim fills, no hex) - tests/test_design.py pins each one to its family rule below */
.chip.ok { background: var(--sf-up-dim); color: var(--sf-up); }
.chip.down { background: var(--sf-down-dim); color: var(--sf-down); }
.chip.warn { background: color-mix(in srgb, var(--sf-warn) 12%, transparent); color: var(--sf-warn); }
.chip.off { background: var(--sf-pane-2); color: var(--sf-text-2); }
/* slate 33 (B71) Page L: the login card (login / forgot / reset / offline). The fox mark (icons/fox.svg, 48 px) sits
   centred above the title; the title is text (the mark carries the orange); fields + the one button are .ctl /
   .ctl-primary (shell.css S2), full width in the card; the side links are plain text links. Width unchanged. */
.login { max-width: 320px; margin: 18vh auto; background: var(--sf-pane); border: 1px solid var(--sf-line); border-radius: var(--sf-r); padding: var(--sf-sp-4); }
.login .login-mark { display: flex; flex-direction: column; align-items: center; gap: var(--sf-sp-2); margin: 0 0 var(--sf-sp-3); }
.login .login-mark img { display: block; width: 48px; height: 48px; border-radius: 10px; }
.login h1 { margin: 0; color: var(--sf-text); font-size: var(--sf-fs-4); font-weight: 700; letter-spacing: .04em; text-align: center; }
.login label { display: block; color: var(--sf-text-2); font-size: var(--sf-fs-1); margin-top: var(--sf-sp-2); }
.login label > input.ctl { display: block; width: 100%; margin-top: 2px; }
.login button.ctl { margin-top: var(--sf-sp-3); width: 100%; }
.login .err { color: var(--sf-down); font-size: var(--sf-fs-1); margin-top: var(--sf-sp-2); }
.login .note { color: var(--sf-text); font-size: var(--sf-fs-1); margin-top: var(--sf-sp-2); }
.login .login-alt { font-size: var(--sf-fs-1); margin: var(--sf-sp-3) 0 0; color: var(--sf-text-3); }
.login .login-alt a { color: var(--sf-text-2); }
@media (hover: hover) { .login .login-alt a:hover { color: var(--sf-text); text-decoration: underline; } }
.login .login-msg { margin: var(--sf-sp-2) 0 0; font-size: var(--sf-fs-2); }
.login.login-offline { text-align: center; }
.login.login-offline a.ctl { margin-top: var(--sf-sp-3); }
.frame { width: 100%; height: calc(100vh - var(--sf-nav-h)); border: 0; background: var(--sf-bg); }
.muted { color: var(--sf-text-3); }
/* Home tiles v1 */
.tile .body { font-size: var(--sf-fs-1); }
.tile .na { color: var(--sf-text-3); }
.tile .big { font-size: var(--sf-fs-4); font-weight: 700; font-family: var(--sf-mono); }
.tile .kv { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--sf-sp-3); margin: var(--sf-sp-2) 0 0; }
.tile .kv dt { color: var(--sf-text-3); }
.tile .kv dd { margin: 0; font-family: var(--sf-mono); }
.tile table { width: 100%; border-collapse: collapse; font-family: var(--sf-mono); font-size: var(--sf-fs-1); }
.tile td, .tile th { padding: 1px 4px; text-align: left; border-bottom: 1px solid var(--sf-line); }
.tile th { color: var(--sf-text-3); font-weight: 400; font-family: var(--sf-font); }
.tile td.r, .tile th.r { text-align: right; }
/* slate 56 T3: the control chips = the status family (RED -> down, GREEN -> up); the A+ grade = the grade family
   (orange rule: the A+ grade is orange, dimmed); the A grade = the score family (neutral) */
.chip.ctl-red { background: var(--sf-down-dim); color: var(--sf-down); }
.chip.ctl-green { background: var(--sf-up-dim); color: var(--sf-up); }
.chip.grade-ap { background: var(--sf-fox-dim); color: var(--sf-fox-2); }
.chip.grade-a { background: var(--sf-pane-2); color: var(--sf-text); font-family: var(--sf-mono); }
@media (max-width: 700px) { .grid { grid-template-columns: 1fr; } }
/* Fox Alerts bell + page */
.bell { position: relative; }
.bell-btn { background: none; border: 0; color: var(--sf-text-2); cursor: pointer; font: inherit; position: relative; padding: 0 4px; }
@media (hover: hover) { .bell-btn:hover { color: var(--sf-text); } }
.bell .badge { position: absolute; top: -6px; right: -8px; min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--sf-fox); color: #000; font: 700 var(--sf-fs-0)/16px var(--sf-mono); text-align: center; }
.bell-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 340px; max-width: calc(100vw - 16px); background: var(--sf-pane); border: 1px solid var(--sf-line); border-radius: var(--sf-r); box-shadow: var(--sf-shadow); z-index: 50; color: var(--sf-text); }
.bell-head { display: flex; justify-content: space-between; padding: var(--sf-sp-2) var(--sf-sp-3); border-bottom: 1px solid var(--sf-line); color: var(--sf-text-2); }
.bell-all, .alert-read { background: none; border: 1px solid var(--sf-line); color: var(--sf-text-2); border-radius: var(--sf-r); cursor: pointer; font: inherit; font-size: var(--sf-fs-0); padding: 1px 6px; }
@media (hover: hover) { .bell-all:hover, .alert-read:hover { color: var(--sf-text); border-color: var(--sf-text-3); } }
.bell-list { max-height: 60vh; overflow-y: auto; }
.bell-row { padding: 6px var(--sf-sp-3); border-bottom: 1px solid var(--sf-line); font-size: var(--sf-fs-1); }
.bell-row.unread { background: var(--sf-pane-2); cursor: pointer; box-shadow: inset 2px 0 0 var(--sf-fox); }
.bell-ts { font-size: var(--sf-fs-0); }
.bell-empty { padding: var(--sf-sp-3); }
.bell-more { display: block; padding: var(--sf-sp-2) var(--sf-sp-3); text-align: right; font-size: var(--sf-fs-1); }
/* slate 56 T3: the Fox Alerts levels = the status family (info -> info, warn -> warn, alert -> down) */
.chip.lvl-info { background: color-mix(in srgb, var(--sf-info) 12%, transparent); color: var(--sf-info); }
.chip.lvl-warn { background: color-mix(in srgb, var(--sf-warn) 12%, transparent); color: var(--sf-warn); }
.chip.lvl-alert { background: var(--sf-down-dim); color: var(--sf-down); }
/* slate 31 (B69): /alerts on the shared controls - .page-head (filters = its .ctl-row actions), the alerts + rules
   tables, the rule editor = a .tile with two labelled rows (WHAT / WHEN, label at the left; phone.css stacks them).
   The old per-form input / select / button looks are gone: the controls carry .ctl, except three whose exact markup
   older tests pin (+ column bound, the scanner_row watch-list select, the JS-made bound inputs): the same look here. */
.alerts-page { padding: 0 var(--sf-sp-3) var(--sf-sp-3); }
.alerts-page > .page-head { padding-left: 0; padding-right: 0; }
.alerts-page > .page-head .sub a { text-decoration: underline; }
.alerts-page .rules-how { cursor: help; margin-left: var(--sf-sp-1); }
.alert-filters { display: flex; flex-wrap: wrap; gap: var(--sf-sp-2); align-items: center; margin-bottom: var(--sf-sp-3); color: var(--sf-text-2); }
.alerts-page > .page-head .alert-filters { margin-bottom: 0; }
.alert-filters label { display: inline-flex; align-items: center; gap: var(--sf-sp-1); }
.alert-table { width: 100%; border-collapse: collapse; }
.alert-table th { text-align: left; color: var(--sf-text-3); font-weight: 400; font-size: var(--sf-fs-1); border-bottom: 1px solid var(--sf-line); padding: 4px 6px; }
.alert-table td { border-bottom: 1px solid var(--sf-line); padding: 6px; vertical-align: top; }
.alert-table tr.unread td { background: var(--sf-pane); }
.alert-table tr.unread td:first-child { box-shadow: inset 2px 0 0 var(--sf-text-2); }
.alerts-page div.empty { margin: var(--sf-sp-2) 0; }
.alert-rules { margin-top: var(--sf-sp-4); }
.alert-rules > .pane-head { margin: 0 0 var(--sf-sp-2); }
.rule-form.tile { min-height: 0; margin-top: var(--sf-sp-3); padding: var(--sf-sp-3); display: flex; flex-direction: column; gap: var(--sf-sp-3); }
.rule-form .rule-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: var(--sf-sp-2) var(--sf-sp-3); align-items: start; }
.rule-form .rule-lab { height: var(--sf-control-h); }
.rule-form .rule-ctls { min-width: 0; }
.rule-form .rule-grp { gap: var(--sf-sp-2); }
.rule-form label, .rule-form .rule-ch { display: inline-flex; align-items: center; gap: var(--sf-sp-1); color: var(--sf-text-2); }
.rule-form .rule-ch { gap: var(--sf-sp-3); flex-wrap: wrap; }
.rule-form .scan-add, .rule-form .scan-bound input, .rule-form select:not(.ctl) { box-sizing: border-box; height: var(--sf-control-h); padding: 0 var(--sf-sp-2); background: var(--sf-pane-2);
  color: var(--sf-text); border: 1px solid var(--sf-line); border-radius: var(--sf-r); font: inherit; }
/* slate 97 F3i: the fields only (the list picker, the bound inputs) take the field edge; "add bound" keeps the hairline */
.rule-form .scan-bound input, .rule-form select:not(.ctl) { border-color: var(--sf-field-line); }
.rule-form .scan-add { cursor: pointer; }
@media (hover: hover) { .rule-form .scan-add:hover { border-color: var(--sf-text-3); } }
.rule-form .scan-add:disabled { color: var(--sf-text-3); cursor: default; }
.rule-form .scan-add:focus-visible, .rule-form .scan-bound input:focus-visible, .rule-form select:not(.ctl):focus-visible { outline: 2px solid var(--sf-fox); outline-offset: 0; }
.rule-form [hidden] { display: none; }
.rules-note { font-size: var(--sf-fs-1); margin: 0 0 6px; }
/* B39 scanner_row editor + scanner alert rows */
.scan-panels { display: inline-flex; flex-wrap: wrap; gap: 2px var(--sf-sp-2); }
.scan-panels:empty { display: none; }
.scan-bounds { display: inline-flex; flex-direction: column; gap: 2px; }
.scan-bounds:empty { display: none; }
.scan-bound { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.chip.scan-panel { background: var(--sf-pane-2); color: var(--sf-text-2); font-weight: 400; }
#sf-alerts .chip.scan-panel { background: none; color: var(--sf-text-2); border: 1px solid var(--sf-line); line-height: 16px; border-radius: var(--sf-r); }   /* slate 31: the tag family */
a.scan-desk { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--sf-text-3); }
@media (hover: hover) { a.scan-desk:hover { color: var(--sf-text); } }   /* slate 31 orange rule */
.scan-state { color: var(--sf-text-2); }
/* B40 rule templates row, the crew "scanner alerts: on / off" word, the rule row a SCAN chip links to (#rule-N) */
.rule-tpls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sf-sp-1) var(--sf-sp-2); margin: var(--sf-sp-2) 0 0; }
.scan-on { color: var(--sf-text-2); }
.rule-table tr:target td { background: var(--sf-pane-2); box-shadow: inset 0 0 0 1px var(--sf-fox); }
/* ==== slate 57 (B95) the frame: the rail (left, desktop) + the top bar (every page) + the Desk pop-out bar. Markup in
   base.html; phone.css swaps in the phone shell (tab bar + #sf-main the one scroller) under the phone query. On the
   desktop the BODY stays the scroller (every page's sticky element keeps its old scroller): the rail is fixed, the top
   bar sticks at the top, the page sits after them in #sf-main. --sf-nav-h now names the top bar's height (the pages size
   their full-height layouts with calc(100vh - var(--sf-nav-h))). Pages without the frame (login family) are untouched:
   every rule here sits under html.sf-frame or a frame-only class. ==== */
:root { --sf-rail-w: 56px; --sf-top-h: 44px; --sf-nav-h: var(--sf-top-h); }
html[data-rail="wide"] { --sf-rail-w: 240px; }
html.sf-frame body { padding-left: var(--sf-rail-w); }
/* the rail: --sf-pane + a right hairline; captions 9 px text-3 uppercase (hidden while collapsed: the hairline only);
   collapsed rows = the icon + a 10 px label under it (title = the tooltip), wide rows = icon + label + the g-letter */
.rail { position: fixed; z-index: 45; left: 0; top: 0; bottom: 0; width: var(--sf-rail-w); display: flex; flex-direction: column;
  background: var(--sf-pane); border-right: 1px solid var(--sf-line); }
.rail-mark { flex: none; display: flex; align-items: center; justify-content: center; width: 100%; height: var(--sf-top-h); padding: 0;
  background: none; border: 0; cursor: pointer; }   /* slate 121 B: a button now (the rail toggle), drawn as the link was */
.rail-mark img { display: block; width: 32px; height: 32px; padding: 3px; border-radius: 7px; background: var(--sf-fox); }
.rail-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--sf-line-2) transparent; }   /* slate 82 fix round 2 (R129 S1, ruled): a thin bar only when the rows overflow; no reserved gutter */
.rail-group { border-top: 1px solid var(--sf-line); padding: 2px 0; }
.rail-cap { display: none; padding: 6px 16px 2px; color: var(--sf-text-3); font-size: 9px; font-weight: 600; line-height: 12px;
  text-transform: uppercase; letter-spacing: .08em; }
.rail-row { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 36px; padding: 3px; color: var(--sf-text-3); text-decoration: none; }
.rail-row .ic { flex: none; width: 18px; height: 18px; }
.ic { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rail-lab { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; line-height: 12px; }
.rail-key { display: none; margin-left: auto; color: var(--sf-text-3); font: 500 var(--sf-fs-0) var(--sf-mono); }
.rail-row:focus-visible, .rail-mark:focus-visible { outline: 2px solid var(--sf-fox); outline-offset: -2px; }   /* slate 97 F4e: + the fox mark (the rail's width x the bar's height) */
html[data-rail="wide"] .rail-cap { display: block; }
html[data-rail="wide"] .rail-row { flex-direction: row; justify-content: flex-start; gap: 10px; min-height: 32px; padding: 0 14px; }
html[data-rail="wide"] .rail-lab { font-size: var(--sf-fs-1); line-height: 16px; color: var(--sf-text-2); }
html[data-rail="wide"] .rail-key { display: inline; }
/* the active row = the slate 56 active-state rule: fox-dim fill, fox-2 icon + label, the 2 px fox bar on the left edge */
.rail .rail-row.on { background: var(--sf-fox-dim); color: var(--sf-fox-2); box-shadow: inset 2px 0 0 var(--sf-fox); }
.rail .rail-row.on .rail-lab { color: var(--sf-fox-2); }
@media (hover: hover) { .rail .rail-row:hover { color: var(--sf-text-2); text-decoration: none; } }
@media (hover: hover) { .rail .rail-row:hover .rail-lab { color: var(--sf-text-2); } }
/* slate 58b (R95 S1): the owner's collapsed rail (22 rows) fits a 900 px tall window - shorter collapsed rows when short */
@media (max-height: 960px) { html:not([data-rail="wide"]) .rail-row { min-height: 32px; padding: 1px 3px; gap: 1px; } }
/* slate 84 F1 (R129 N20, ruled 13:3x): while the collapsed rail scrolls, the thin bar takes ~10 px and the rows kept
   their side padding, so four labels were cut ("Fox T..."). R129's what-if (the rows drop their side padding), applied
   only while the rail CAN scroll: the scroller is a scroll-state container (no size containment, nothing else about
   it changes), so a rail that fits keeps master's pixels and the wide rail is untouched (the html:not() guard).
   Row heights do not move (top / bottom padding untouched); the foot's rows sit outside the container. A browser
   without scroll-state queries (Firefox, Safari today) keeps master's rows exactly; Safari's bars are overlay. */
.rail-scroll { container: sf-rail / scroll-state; }
@container sf-rail scroll-state(scrollable: y) { html:not([data-rail="wide"]) .rail-row { padding-left: 0; padding-right: 0; } }
.rail-foot { flex: none; border-top: 1px solid var(--sf-line); padding: 2px 0; }
.rail-foot .avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px;
  border-radius: 50%; background: var(--sf-pane-3); color: var(--sf-text); font: 600 var(--sf-fs-0)/1 var(--sf-font); }
.rail-out-form { margin: 0; }
.rail-out { width: 100%; background: none; border: 0; font: inherit; cursor: pointer; }
/* the top bar: breadcrumb (group . page) | the page's block (the Desk's tabs + finder) | slots for 58 | bell, "?", clock,
   the user name (slate 121 B: the rail toggle moved to the fox mark) */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: var(--sf-sp-3); min-width: 0;
  height: var(--sf-top-h); padding: 0 var(--sf-sp-3); background: var(--sf-pane); border-bottom: 1px solid var(--sf-line); }
.crumb { display: flex; align-items: center; gap: 6px; flex: none; white-space: nowrap; color: var(--sf-text-2); font-size: var(--sf-fs-2); }
.crumb-page { color: var(--sf-text); font-weight: 600; }
.crumb-sep { color: var(--sf-text-3); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: var(--sf-sp-3); flex: none; color: var(--sf-text-3);
  font-size: var(--sf-fs-1); }
/* slate 121 A: the clock = a lit status chip, the Desk's CONTROL GREEN look (shell.css .chip[data-kind="status"].ctl-green:
   --sf-up on --sf-up-dim, no border, the --sf-r radius, 600), taller (the bar's 44 px less 4 px a side) and bigger; the
   digits mono (.num: tabular) so the width holds each second, the " ET" smaller (.top-clock-tz) so the chip fits the
   slot the chevron button left - nothing else in the bar moves */
.top-clock { flex: none; height: calc(var(--sf-top-h) - 8px); padding: 0 4px; white-space: nowrap; background: var(--sf-up-dim);
  color: var(--sf-up); border: 0; border-radius: var(--sf-r); font-size: var(--sf-fs-3); font-weight: 600; line-height: calc(var(--sf-top-h) - 8px); }
.top-clock-tz { font: 600 var(--sf-fs-0) var(--sf-font); }
.top-user { white-space: nowrap; }
.top-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 6px;
  background: none; color: var(--sf-text-2); border: 1px solid var(--sf-line); border-radius: var(--sf-r); font: inherit;
  font-size: var(--sf-fs-3); line-height: 1; cursor: pointer; text-decoration: none; }
.top-btn:focus-visible { outline: 2px solid var(--sf-fox); outline-offset: 0; }
@media (hover: hover) { .top-btn:hover { color: var(--sf-text); border-color: var(--sf-text-3); text-decoration: none; } }
/* slate 84 F2: one icon family and ONE button look in the top bar - the bell (button.top-btn.bell-btn, the sprite's bell)
   and the "?" are the same bordered 28 px square (slate 121 B: the rail toggle, Lucide chevrons-right, went); phone.css makes them 44 px
   with no outline. The badge keeps its place on the bell's corner. */
.top-btn .ic { flex: none; width: 16px; height: 16px; }
.top-btn:has(> svg.ic) { padding: 0; }   /* an icon button = the 28 px square itself (the "?" keeps its text padding) */
.top-back, .tabbar { display: none; }
.more-sheet[hidden] { display: none; }
/* slate 122 A: the feedback box - the word "Feedback" on the bar's one button look (the sprite's message-circle shows
   only on the phone, phone.css); its panel = the bell menu's look (.bell-menu, .bell-head) holding one line + Send */
.fb { position: relative; flex: none; }
.fb-btn { font-size: var(--sf-fs-1); }
.fb-btn .ic { display: none; }
.top-btn.fb-btn:has(> svg.ic) { padding: 0 6px; }
.fb-pop { width: 360px; }
.fb-x { background: none; border: 1px solid var(--sf-line); color: var(--sf-text-2); border-radius: var(--sf-r); cursor: pointer; font: inherit;
  font-size: var(--sf-fs-0); padding: 1px 6px; }
@media (hover: hover) { .fb-x:hover { color: var(--sf-text); border-color: var(--sf-text-3); } }
.fb-x:focus-visible { outline: 2px solid var(--sf-fox); outline-offset: 0; }
.fb-form { display: flex; gap: var(--sf-sp-2); padding: var(--sf-sp-3); margin: 0; }
.fb-q { flex: 1 1 auto; min-width: 0; }
.fb-send { flex: none; }
.fb-st { padding: 0 var(--sf-sp-3) var(--sf-sp-3); color: var(--sf-text-2); font-size: var(--sf-fs-1); }
.fb-st:empty { display: none; }
.fb-st a { color: var(--sf-text); text-decoration: underline; }
/* slate 122 C: the owner's Feedback row carries the open lines' count - a small badge on the collapsed row's icon, the
   number at the right of the wide row (where a g-letter sits on other rows) */
.rail-count { position: absolute; top: 2px; right: 6px; min-width: 14px; padding: 0 3px; border-radius: 7px; background: var(--sf-pane-3);
  color: var(--sf-text); font: 600 var(--sf-fs-0)/14px var(--sf-mono); text-align: center; }
html[data-rail="wide"] .rail-count { position: static; margin-left: auto; font-size: var(--sf-fs-0); line-height: 16px; }
/* slate 84 F6: the skip link (base.html, the first focusable thing): off screen until it has the focus, then a pane-
   coloured chip over the top bar's left end; it moves the focus to #sf-main (the page) */
.skip-link { position: fixed; z-index: 90; left: var(--sf-sp-2); top: var(--sf-sp-2); padding: var(--sf-sp-2) var(--sf-sp-3);
  background: var(--sf-pane); color: var(--sf-text); border: 1px solid var(--sf-line-2); border-radius: var(--sf-r); }
.skip-link:not(:focus) { width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; white-space: nowrap; clip-path: inset(50%); }
.skip-link:focus { outline: 2px solid var(--sf-fox); outline-offset: 0; text-decoration: none; }
/* slate 85 P4: the clock is short now ("14:02 ET", about 60 px), so it no longer hides between 901 and 1150 px (the long
   form did; was `@media (min-width: 901px) and (max-width: 1150px) { .top-clock { display: none; } }`) */
/* Desk pop-outs (?pane=, body.desk-pop): no rail, no top bar, no tab bar - the 28 px bar back to the Desk + the bell count */
html.sf-frame body.desk-pop { padding-left: 0; }
body.desk-pop :is(.rail, .topbar, .tabbar, .more-sheet) { display: none !important; }
.popbar { display: flex; align-items: center; gap: var(--sf-sp-3); height: 28px; padding: 0 var(--sf-sp-2); background: var(--sf-pane);
  border-bottom: 1px solid var(--sf-line); font-size: var(--sf-fs-1); color: var(--sf-text-2); }
.popbar a { color: var(--sf-text-2); }
.popbar-bell { margin-left: auto; }
.popbar-bell .num { color: var(--sf-text); font-weight: 700; }
/* B45 the way back: the "Desk" chip in the head of /research, /replay, /foxwire (-> /?symbol=SYM). slate 58b (R94 S4): the
   tag family (no fill, text-2, the hairline; hover / focus = text + the text-3 edge), not a sixth chip look */
a.chip.desk-back { background: none; color: var(--sf-text-2); border: 1px solid var(--sf-line); line-height: 16px; font-weight: 400; text-decoration: none; }
a.chip.desk-back:focus-visible { color: var(--sf-text); border-color: var(--sf-text-3); }
@media (hover: hover) { a.chip.desk-back:hover { color: var(--sf-text); border-color: var(--sf-text-3); } }
a.chip.desk-back[hidden] { display: none; }
@media (max-width: 700px) {
  a.chip.desk-back { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; min-width: 36px; }
  a.chip.desk-back[hidden] { display: none; }
}
/* ==== slate 58a (B96) the shared ticker chip + the palette + the sheet (docs/design/palette.md). Markup in base.html
   (#sf-ticker, #sf-palette in the top bar); behaviour in palette.js and sheet.js; the phone forms in phone.css. The
   depth rule holds: no drop shadow, borders carry the floating box (an inset edge marks the highlighted result). ==== */
.tick { margin-left: auto; display: inline-flex; align-items: center; flex: none; height: 28px; background: var(--sf-pane-2);
  border: 1px solid var(--sf-line); border-radius: var(--sf-r); }
.tick-btn { display: inline-flex; align-items: center; height: 100%; min-width: 72px; padding: 0 var(--sf-sp-2); background: none; border: 0;
  color: var(--sf-text); font: 600 var(--sf-fs-2) var(--sf-mono); cursor: pointer; }
.tick-ph { color: var(--sf-text-3); font: 400 var(--sf-fs-1) var(--sf-font); }
.tick[data-on="1"] .tick-ph, .tick-sym:empty { display: none; }
.tick-x { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 100%; padding: 0; background: none; border: 0;
  border-left: 1px solid var(--sf-line); color: var(--sf-text-3); font-size: var(--sf-fs-3); line-height: 1; cursor: pointer; }
.tick-x[hidden] { display: none; }
.tick-btn:focus-visible, .tick-x:focus-visible, .pal-box:focus-visible, .pal-chip:focus-visible { outline: 2px solid var(--sf-fox); outline-offset: -1px; }
@media (hover: hover) { .tick-x:hover, .tick-btn:hover .tick-ph { color: var(--sf-text); } }
.pal { position: relative; flex: none; }
.pal-box { display: inline-flex; align-items: center; gap: 8px; width: 320px; height: 28px; padding: 0 var(--sf-sp-2); background: var(--sf-pane-2);
  border: 1px solid var(--sf-line); border-radius: var(--sf-r); color: var(--sf-text-3); font: inherit; font-size: var(--sf-fs-1); cursor: text; }
.pal-box .ic { flex: none; width: 14px; height: 14px; }
.pal-ph { flex: 1 1 auto; text-align: left; }
.pal-kbd { padding: 0 4px; color: var(--sf-text-3); border: 1px solid var(--sf-line); border-radius: 4px; font: 500 var(--sf-fs-0) var(--sf-mono); }
@media (hover: hover) { .pal-box:hover { border-color: var(--sf-text-3); } }
@media (min-width: 901px) and (max-width: 1280px) { .pal-box { width: 200px; } }
@media (min-width: 901px) and (max-width: 1060px) { .pal-box { width: auto; } .pal-ph { display: none; } }
/* the desktop dropdown under the box (ruled 17:4x): 420 px, the results scroll inside it */
.pal-pop { position: absolute; z-index: 60; top: calc(100% + 4px); right: 0; width: 420px; max-height: min(70vh, 560px); display: flex;
  flex-direction: column; background: var(--sf-pane); border: 1px solid var(--sf-line-2); border-radius: var(--sf-r); }
.pal-pop[hidden] { display: none; }
.pal-q { flex: none; height: 36px; margin: var(--sf-sp-2); padding: 0 var(--sf-sp-2); background: var(--sf-pane-2); color: var(--sf-text);
  border: 1px solid var(--sf-field-line); border-radius: var(--sf-r); font: inherit; font-size: var(--sf-fs-2); }   /* slate 97 F3f: the field edge */
.pal-q:focus { outline: 2px solid var(--sf-fox); outline-offset: -1px; }
.pal-st { flex: none; padding: 0 var(--sf-sp-3) var(--sf-sp-1); color: var(--sf-text-2); font-size: var(--sf-fs-1); }
.pal-st:empty { display: none; }
.pal-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: var(--sf-sp-1); }
.pal-sec + .pal-sec { border-top: 1px solid var(--sf-line); }
.pal-cap { padding: var(--sf-sp-2) var(--sf-sp-3) 2px; color: var(--sf-text-3); font-size: var(--sf-fs-0); font-weight: 500; text-transform: uppercase;
  letter-spacing: .06em; }
.pal-it { display: flex; align-items: center; gap: var(--sf-sp-2); min-height: 30px; padding: 0 var(--sf-sp-3); color: var(--sf-text-2); cursor: pointer; }
.pal-it .pal-lab { color: var(--sf-text); white-space: nowrap; }
.pal-lab.sym { font: 600 var(--sf-fs-2) var(--sf-mono); }
.pal-sub { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sf-text-3); font-size: var(--sf-fs-1); }
.pal-key { margin-left: auto; color: var(--sf-text-3); font: 500 var(--sf-fs-0) var(--sf-mono); }
.pal-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px var(--sf-sp-3) var(--sf-sp-2); }
.pal-chip { display: inline-flex; align-items: center; justify-content: center; height: 26px; padding: 0 var(--sf-sp-2); background: var(--sf-pane-2);
  border: 1px solid var(--sf-line); border-radius: var(--sf-r); color: var(--sf-text); cursor: pointer; }
.pal-it[aria-selected="true"], .pal-chip[aria-selected="true"] { background: var(--sf-pane-3); box-shadow: inset 2px 0 0 var(--sf-fox); }
@media (hover: hover) { .pal-it:hover, .pal-chip:hover { background: var(--sf-pane-2); } }
.pal-note { padding: 4px var(--sf-sp-3) var(--sf-sp-2); color: var(--sf-text-3); font-size: var(--sf-fs-1); }
/* Watch: the row of the shared ticker (watch.js marks it) */
:is(#wl-house-rows, #wl-mine-rows, #wl-crew-rows) li.it.sel { background: var(--sf-fox-dim); box-shadow: inset 2px 0 0 var(--sf-fox); }
/* the sheet (sheet.js): phone = a bottom sheet over a scrim, three detents; its bottom and height follow the visual
   viewport (--sf-vv-kb / --sf-vv-h, set by sheet.js while a sheet is open); desktop = .sheet-panel, 400 px on the right */
.sheet-scrim { position: fixed; inset: 0; background: color-mix(in srgb, var(--sf-bg) 60%, transparent); }
.sheet { position: fixed; left: 0; right: 0; bottom: var(--sf-vv-kb, 0px); display: flex; flex-direction: column;
  height: calc(var(--sf-vv-h, 100dvh) * .5); max-height: var(--sf-vv-h, 100dvh); background: var(--sf-pane); color: var(--sf-text);
  border-top: 1px solid var(--sf-line-2); border-radius: 12px 12px 0 0; padding-bottom: var(--sf-sheet-pb, env(safe-area-inset-bottom, 0px));
  transition: height .2s ease, transform .2s ease; animation: sf-sheet-in .2s ease; }
.sheet[data-detent="large"] { height: calc(var(--sf-vv-h, 100dvh) * .92); }
.sheet[data-detent="full"] { height: calc(var(--sf-vv-h, 100dvh) - env(safe-area-inset-top, 0px)); border-radius: 0; }
.sheet.sheet-drag { transition: none; }
@keyframes sf-sheet-in { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grip { flex: none; display: flex; justify-content: center; padding: 6px 0 2px; touch-action: none; cursor: grab; }
.sheet-grip-bar { width: 36px; height: 5px; border-radius: 3px; background: var(--sf-line-2); }
.sheet-head { flex: none; display: flex; align-items: center; gap: var(--sf-sp-2); min-height: 44px; padding: 0 var(--sf-sp-1) 0 var(--sf-sp-4); }
.sheet-title { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.sheet-x { flex: none; width: 44px; height: 44px; padding: 0; background: none; border: 0; color: var(--sf-text-2); font-size: 24px; line-height: 1; cursor: pointer; }
.sheet-x:focus-visible { outline: 2px solid var(--sf-fox); outline-offset: -2px; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.sheet.sheet-panel { top: var(--sf-top-h); bottom: 0; left: auto; width: 400px; height: auto; max-height: none; border-top: 0;
  border-left: 1px solid var(--sf-line-2); border-radius: 0; padding-bottom: 0; animation: none; }
.sheet-panel .sheet-grip { display: none; }
@media (prefers-reduced-motion: reduce) { .sheet { transition: none; animation: none; } }
/* the palette inside its sheet (phone): the sheet body is the results' one scroller */
.sheet .pal-pop { position: static; width: auto; max-height: none; border: 0; border-radius: 0; background: none; }
.sheet .pal-list { overflow: visible; }
/* ==== slate 58b (B97) the symbol card (card.js; docs/design/symbol-card.md). Every ticker is a .sym[data-sym]; the
   desktop popover (320 px; borders, no shadow - the depth rule) and the phone sheet's body share one markup. ==== */
.sym[data-sym] { cursor: pointer; }
.sym[data-sym]:focus-visible { outline: 2px solid var(--sf-fox); outline-offset: 1px; border-radius: 2px; }
@media (hover: hover) { .sym[data-sym]:hover { text-decoration: underline dotted var(--sf-text-3); text-underline-offset: 3px; } }
.sf-card { position: fixed; z-index: 70; width: 320px; max-width: calc(100vw - 16px); background: var(--sf-pane); color: var(--sf-text);
  border: 1px solid var(--sf-line-2); border-radius: var(--sf-r); font-size: var(--sf-fs-1); text-align: left; }
.sf-card-body { display: flex; flex-direction: column; gap: var(--sf-sp-2); padding: var(--sf-sp-2) var(--sf-sp-3) var(--sf-sp-3); }
.card-head { display: flex; align-items: baseline; gap: var(--sf-sp-2); min-width: 0; }
.card-sym { flex: none; font: 600 var(--sf-fs-3) var(--sf-mono); color: var(--sf-text); }
.card-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sf-text-2); }
.card-ex { flex: none; color: var(--sf-text-3); font-size: var(--sf-fs-0); text-transform: uppercase; }
.card-dot { flex: none; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--sf-up); }
.card-quote { display: flex; align-items: center; gap: var(--sf-sp-2); font-family: var(--sf-mono); font-variant-numeric: tabular-nums; }
.card-last { font-size: var(--sf-fs-3); font-weight: 600; }
.card-chg.up, .card-pct.up { color: var(--sf-up); }
.card-chg.down, .card-pct.down { color: var(--sf-down); }
.card-spark { flex: none; margin-left: auto; }
.card-spark polyline { fill: none; stroke: var(--sf-up); stroke-width: 1.5; }
.card-spark.down polyline { stroke: var(--sf-down); }
.card-spark line.card-base { stroke: var(--sf-text-3); stroke-width: 1; stroke-dasharray: 1 2; opacity: .7; }   /* slate 86 S6: the start, dotted */
.card-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.5fr); gap: 4px; }   /* range = the widest value */
.card-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 4px 6px; background: var(--sf-pane-2); border-radius: var(--sf-r); }
.card-tk { color: var(--sf-text-3); font-size: var(--sf-fs-0); text-transform: uppercase; letter-spacing: .04em; }
.card-tv { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 var(--sf-fs-1) var(--sf-mono); font-variant-numeric: tabular-nums; }
.card-rows { display: flex; flex-direction: column; border-top: 1px solid var(--sf-line); }
.card-row { display: flex; align-items: center; gap: var(--sf-sp-2); min-height: 28px; border-bottom: 1px solid var(--sf-line); color: var(--sf-text-2); text-decoration: none; }
.card-rk { flex: none; width: 56px; color: var(--sf-text-3); }
.card-rv { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sf-text); }
@media (hover: hover) { a.card-row:hover { background: var(--sf-pane-2); text-decoration: none; } }
.card-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.card-act { display: inline-flex; align-items: center; height: 28px; padding: 0 var(--sf-sp-2); background: var(--sf-pane-2); border: 1px solid var(--sf-line);
  border-radius: var(--sf-r); color: var(--sf-text); font: inherit; text-decoration: none; cursor: pointer; }
@media (hover: hover) { .card-act:hover { border-color: var(--sf-text-3); text-decoration: none; } }
.card-act:focus-visible, a.card-row:focus-visible { outline: 2px solid var(--sf-fox); outline-offset: -1px; }
.card-note, .card-st { color: var(--sf-text-3); font-size: var(--sf-fs-1); }
.card-st:empty { display: none; }
/* the phone sheet: the card is the sheet's body (no box of its own); dragged to large = the rows are 44 px list rows */
.sf-card.sf-card-sheet { position: static; width: auto; max-width: none; background: none; border: 0; border-radius: 0; }
.sheet .card-act { height: auto; min-height: 44px; }
.sheet .card-row { min-height: 36px; }
.sheet:is([data-detent="large"], [data-detent="full"]) .card-row { min-height: 44px; font-size: var(--sf-fs-2); }
/* slate 58b (R94 S3): heat cells = the dim pair. desk.js paints the scanner's ramp inline (backgroundColor + a black /
   white color for the full-strength fill; those lines are pinned); every inline-filled cell gets a wash of the pane over
   the fill (about 20 % of the hue shows, as --sf-up-dim / --sf-down-dim do) and its text goes back to --sf-text */
:is(#desk-grid, .desk-pop) :is(td, .scan-d-v)[style*="background-color"] { color: var(--sf-text) !important;
  background-image: linear-gradient(color-mix(in srgb, var(--sf-pane) 80%, transparent), color-mix(in srgb, var(--sf-pane) 80%, transparent)); }
/* ==== slate 29 S2: the shared components (additive). Used by the Desk strip + /research this slate; available to all.
   Low-specificity selectors (:where) where a page's own later <style> / desk.css must be able to refine them. ==== */
/* Orange rule (Ryan 06:4x): orange = the mark, ONE primary button per page, the active tab / chip, the A+ grade.
   Links read as text; hover underlines. The rail keeps its own text-3 / text-2 colours and never underlines. */
@media (hover: hover) { a.chip:hover { text-decoration: none; } }

/* .page-head - one page header: .title (fs-5) + .sub (one muted line) + .actions (right; a .ctl-row) */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sf-sp-1) var(--sf-sp-3);
  padding: var(--sf-sp-3) var(--sf-sp-3) var(--sf-sp-2); }
.page-head .title { margin: 0; font-size: var(--sf-fs-5); font-weight: 600; line-height: 1.2; color: var(--sf-text); }
.page-head .sub { font-size: var(--sf-fs-1); color: var(--sf-text-2); min-width: 0; }
.page-head .actions { margin-left: auto; }

/* .pane-head - the Desk pane header made global: a section title in grey uppercase, actions at the right.
   desk.css keeps its own .pane-head (bar background, border, mixed-case subs) on top of this. */
.pane-head { display: flex; align-items: center; gap: var(--sf-sp-2); font-size: var(--sf-fs-1); font-weight: 600;
  color: var(--sf-text-2); text-transform: uppercase; letter-spacing: .06em; }
.pane-head .actions, .pane-head .pane-acts { margin-left: auto; text-transform: none; letter-spacing: normal; }

/* .chip families by data-kind (the base .chip above is unchanged). Five families: status / grade / count / tag /
   score. status = uppercase, the dim fill of its state (up / down / warn / info / muted; the old state classes map:
   ok + ctl-green -> up, ctl-red -> down, off -> muted). slate 56: the legacy .chip.ok / .down / .warn / .off / .lvl-* /
   .ctl-* / .grade-* rules above carry the SAME colours as their family state here (no third look). .chips-status = a
   row whose plain chips are all status chips (a chip built by JS without a data-kind, e.g. the Desk's SCAN chip,
   joins the family by sitting in that row). */
.chip[data-kind], .chips-status > .chip:not([data-kind]) { line-height: 18px; border-radius: var(--sf-r); padding: 0 6px; border: 0; }
.chip[data-kind="status"], .chips-status > .chip:not([data-kind]) { background: var(--sf-pane-2); color: var(--sf-text-2); text-transform: uppercase; }
:is(.chip[data-kind="status"], .chips-status > .chip:not([data-kind])):is(.up, .ok, .ctl-green) { background: var(--sf-up-dim); color: var(--sf-up); }
:is(.chip[data-kind="status"], .chips-status > .chip:not([data-kind])):is(.down, .ctl-red) { background: var(--sf-down-dim); color: var(--sf-down); }
:is(.chip[data-kind="status"], .chips-status > .chip:not([data-kind])).warn { background: color-mix(in srgb, var(--sf-warn) 12%, transparent); color: var(--sf-warn); }
:is(.chip[data-kind="status"], .chips-status > .chip:not([data-kind])).info { background: color-mix(in srgb, var(--sf-info) 12%, transparent); color: var(--sf-info); }
:is(.chip[data-kind="status"], .chips-status > .chip:not([data-kind])):is(.off, .muted) { background: var(--sf-pane-2); color: var(--sf-text-2); }
.chip[data-kind="grade"] { background: var(--sf-fox-dim); color: var(--sf-fox-2); text-transform: uppercase; }
.chip[data-kind="count"] { background: var(--sf-pane-2); color: var(--sf-text-2); font-weight: 400; }
.chip[data-kind="count"].on { background: var(--sf-fox-dim); color: var(--sf-fox-2); }   /* the active filter chip */
.chip[data-kind="tag"] { background: none; color: var(--sf-text-2); border: 1px solid var(--sf-line); line-height: 16px; font-weight: 400; }
.chip[data-kind="score"] { background: var(--sf-pane-2); color: var(--sf-text); font-family: var(--sf-mono); }
a.chip[data-kind]:focus-visible { box-shadow: inset 0 0 0 1px var(--sf-text-3); }
@media (hover: hover) { a.chip[data-kind]:hover { box-shadow: inset 0 0 0 1px var(--sf-text-3); } }

/* .ctl - one form control look: input / select / textarea / button carry class="ctl" (a <div class="ctl"> elsewhere
   is untouched). Native select keeps its native popup. .ctl-primary = THE one orange button of a page. */
:where(input, select, textarea, button, a).ctl { box-sizing: border-box; height: var(--sf-control-h); padding: 0 var(--sf-sp-2);
  background: var(--sf-pane-2); color: var(--sf-text); border: 1px solid var(--sf-line); border-radius: var(--sf-r);
  font: inherit; vertical-align: middle; }
:where(textarea).ctl { height: auto; min-height: var(--sf-control-h); padding: var(--sf-sp-1) var(--sf-sp-2); }
/* slate 84 F7 (audit Q16, WCAG 1.4.11): a field's edge you can see - the shared fields (input / select / textarea .ctl)
   take --sf-field-line (3:1 and up on every surface, tokens-v2.md); buttons, panes and tables keep the quiet hairline */
:where(input, select, textarea).ctl { border-color: var(--sf-field-line); }
:where(button, a).ctl { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; white-space: nowrap; text-decoration: none; }
@media (hover: hover) { :where(button, a).ctl:hover { border-color: var(--sf-text-3); } }
:where(input, select, textarea, button, a).ctl:focus-visible { outline: 2px solid var(--sf-fox); outline-offset: 0; }
:where(button, input, select, textarea).ctl:disabled { color: var(--sf-text-3); cursor: default; }
:where(button, a).ctl-primary { background: var(--sf-fox); border-color: var(--sf-fox); color: #000; font-weight: 600; }
@media (hover: hover) { :where(button, a).ctl-primary:hover { background: var(--sf-fox-2); border-color: var(--sf-fox-2); } }
/* slate 81 G7 (audit Q4): a disabled primary button reads as disabled on every page (no orange) - Fox Run's own rule
   (R116 N9, was foxrun.css:59), moved here; after the hover rule, so a hovered disabled button stays grey */
:where(button).ctl-primary:disabled { background: var(--sf-pane-2); border-color: var(--sf-line); color: var(--sf-text-3); }
.ctl-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sf-sp-2); }

/* .empty - the one empty state: a dashed pane, one muted line, an optional <a> action inside */
div.empty, p.empty { margin: var(--sf-sp-2); padding: var(--sf-sp-4); background: var(--sf-pane); border: 1px dashed var(--sf-line);
  border-radius: var(--sf-r); color: var(--sf-text-2); font-size: var(--sf-fs-2); text-align: center; }
div.empty a, p.empty a { color: var(--sf-text); text-decoration: underline; }
/* slate 63: the table-row variant (a one-cell row across a wide table in a .scroll): the pane stays in view */
td > div.empty { position: sticky; left: 0; box-sizing: border-box; max-width: calc(100vw - 4 * var(--sf-sp-4)); }

/* .chips-cap - a chip row capped at two rows on a phone (phone.css), CSS only: markup =
   <div class="chips-cap"><input type="checkbox" class="chips-cap-x" id="X" hidden><div class="chips-cap-row">chips</div>
   <label class="chip chips-cap-more" data-kind="count" for="X">+N</label></div> (N written by the page). Off the phone
   the row is uncapped and the "+N" chip hides. Not applied to any page in slate 29. */
.chips-cap-row { display: flex; flex-wrap: wrap; gap: var(--sf-sp-1); }
.chips-cap-more { display: none; cursor: pointer; }

/* ==== slate 30 (B68): the Status page (/tiles; home.html #home-grid). Control + Healthz weigh two columns from 900 px
   (the auto-fill grid stays for the rest; dense packing fills a hole a span leaves at 3 columns); under 900 px every
   tile is one column again (phone.css stacks the grid at <= 700 px). ==== */
@media (min-width: 900px) {
  #home-grid { grid-auto-flow: row dense; }
  #home-grid > .tile:is([data-tile="control"], [data-tile="healthz"]) { grid-column: span 2; }
}
/* The tile chips join the families by CSS only (shell.js writes the same classes as before): every plain chip is a
   status chip (ok / ctl-green -> up, down / ctl-red -> down, warn -> warn, off -> muted); the A+ grade = the grade
   family (orange rule: the A+ grade is orange, dimmed), the A grade = neutral. No tile writes a number chip today. */
#home-grid .chip:not([data-kind]) { line-height: 18px; border-radius: var(--sf-r); padding: 0 6px; border: 0;
  background: var(--sf-pane-2); color: var(--sf-text-2); text-transform: uppercase; }
#home-grid .chip:is(.ok, .ctl-green) { background: var(--sf-up-dim); color: var(--sf-up); }
#home-grid .chip:is(.down, .ctl-red) { background: var(--sf-down-dim); color: var(--sf-down); }
#home-grid .chip.warn { background: color-mix(in srgb, var(--sf-warn) 12%, transparent); color: var(--sf-warn); }
#home-grid .chip.off { background: var(--sf-pane-2); color: var(--sf-text-2); }
#home-grid .chip.grade-ap { background: var(--sf-fox-dim); color: var(--sf-fox-2); }
#home-grid .chip.grade-a { background: var(--sf-pane-2); color: var(--sf-text); font-family: var(--sf-mono); }
#home-grid .chip.big { line-height: 26px; padding: 0 var(--sf-sp-2); }
/* Card of the day: one muted sub, the card's first rule (verbatim), a "whole card" link */
#home-grid .card-sub { color: var(--sf-text-3); font-size: var(--sf-fs-1); }
#home-grid .card-rule { margin: var(--sf-sp-2) 0; font-size: var(--sf-fs-3); font-weight: 600; color: var(--sf-text); overflow-wrap: anywhere; }
#home-grid .card-more { font-size: var(--sf-fs-1); }
#home-grid .card-body div.empty { margin: 0; padding: var(--sf-sp-3); font-size: var(--sf-fs-1); }
/* ==== slate 31 (B69): Watch / Alerts / Account on the shared controls. Small additions to the S2 components. ==== */
/* a .ctl the page hides (hidden attribute) stays hidden: the .ctl display (inline-flex) must never beat [hidden] */
:where(input, select, textarea, button, a).ctl[hidden] { display: none; }
/* .ctl-sm - the small control (table row actions: read / edit / delete): 24 px tall (phone.css raises it to 36 px) */
:where(button, a).ctl.ctl-sm { height: 24px; padding: 0 6px; font-size: var(--sf-fs-1); }
/* the Fox Alerts levels join the status family: alert -> down (red), warn -> warn (amber), info -> info (blue);
   the bell menu's chips carry no data-kind and wear the same colours (the legacy .lvl-* rules above) */
.chip[data-kind="status"].lvl-alert { background: var(--sf-down-dim); color: var(--sf-down); }
.chip[data-kind="status"].lvl-warn { background: color-mix(in srgb, var(--sf-warn) 12%, transparent); color: var(--sf-warn); }
.chip[data-kind="status"].lvl-info { background: color-mix(in srgb, var(--sf-info) 12%, transparent); color: var(--sf-info); }
/* a <button class="chip"> (the Alerts rule templates) looks like a chip, with a pointer */
button.chip { font-family: inherit; cursor: pointer; vertical-align: middle; }
@media (hover: hover) { button.chip[data-kind="tag"]:hover { color: var(--sf-text); border-color: var(--sf-text-3); } }
button.chip:focus-visible, span.chip[tabindex]:focus-visible { outline: 2px solid var(--sf-fox); outline-offset: 0; }

/* ==== slate 60b (B103): the Research reading layout + section rail, the Alerts template cards, the human alert line
   (docs/design/d3-pages.md sections 3 + 4). Markup: research.html (#rs-cols = #rs-rail + #rs-grid) and alerts.html
   (.tpl-card around each template button; .alert-human + details.alert-machine on a known machine row); the rail's
   links come from research_rail.js; the phone forms sit in phone.css's slate 60b block. ==== */
/* Research under 1024 px: the rail is a chip row above the tiles (phone.css: ONE sideways line under 700 px) */
.rs-rail { display: flex; flex-wrap: wrap; gap: var(--sf-sp-1); padding: var(--sf-sp-2) var(--sf-sp-2) 0; }
.rs-rail[hidden], .rs-rail .rs-link[hidden] { display: none; }
.rs-rail .rs-link { display: inline-flex; align-items: center; min-height: 28px; padding: 0 var(--sf-sp-2); border: 1px solid var(--sf-line);
  border-radius: var(--sf-r); color: var(--sf-text-2); font-size: var(--sf-fs-1); white-space: nowrap; text-decoration: none; }
.rs-rail .rs-link.on { background: var(--sf-fox-dim); color: var(--sf-fox-2); border-color: transparent; }   /* the one active rule */
@media (hover: hover) { .rs-rail .rs-link:hover { color: var(--sf-text); border-color: var(--sf-text-3); text-decoration: none; } }
.rs-rail .rs-link:focus-visible { outline: 2px solid var(--sf-fox); outline-offset: 0; }
#rs-grid > .tile { scroll-margin-top: calc(var(--sf-nav-h) + var(--sf-sp-3)); }
/* F24: a tile holding only the inline script's empty writes (research_rail.js sets .rs-none) = its head + one muted line:
   na()'s own line when it wrote one, else "none yet"; the Catalyst tile keeps its way to the wire on that line */
#rs-grid > .tile.rs-none { min-height: 0; }
#rs-grid > .tile.rs-none > .body > :not(span.muted:first-child):not(.fw-wire) { display: none; }
#rs-grid > .tile.rs-none > .body:not(:has(> span.muted:first-child))::before { content: "none yet"; color: var(--sf-text-3); }
#rs-grid > .tile.rs-none > .body > .fw-wire { display: inline; margin: 0 0 0 var(--sf-sp-2); }
/* Research from 1024 px (F28): a 1200 px centred column - the 200 px sticky rail on the left, ONE column of reading
   cards on the right (the .wide tiles are just tiles now) */
@media (min-width: 1024px) {
  #rs-form, #rs-empty, #rs-cols { max-width: 1200px; margin-left: auto; margin-right: auto; }
  #rs-cols { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--sf-sp-4); align-items: start; padding: 0 var(--sf-sp-2); }
  #rs-cols > .rs-rail { position: sticky; top: calc(var(--sf-nav-h) + var(--sf-sp-3)); flex-direction: column; flex-wrap: nowrap; gap: 2px;
    padding: var(--sf-sp-2) 0; max-height: calc(100vh - var(--sf-nav-h) - 2 * var(--sf-sp-3)); overflow-y: auto; }
  #rs-cols > .rs-rail .rs-link { border: 0; min-height: 30px; padding: 0 var(--sf-sp-3); white-space: normal; }
  #rs-cols > .rs-rail .rs-link.on { box-shadow: inset 2px 0 0 var(--sf-fox); }   /* a side nav: + the 2 px edge (the rail's rule) */
  #rs-cols > #rs-grid { grid-template-columns: minmax(0, 1fr); padding: var(--sf-sp-2) 0; }
}
/* Alerts: the six templates = six cards, 3-up (1-up on the phone); the pinned button is the card's whole face (its
   ::after covers the card), the "what it watches" line + the kind chip sit under it */
#sf-rule-tpls.rule-tpls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sf-sp-2); align-items: stretch; }
#sf-rule-tpls > .muted { grid-column: 1 / -1; }
#sf-rule-tpls .tpl-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sf-sp-1); min-width: 0;
  padding: var(--sf-sp-2) var(--sf-sp-3); background: var(--sf-pane); border: 1px solid var(--sf-line); border-radius: var(--sf-r); }
#sf-rule-tpls .tpl-card > .rule-tpl { background: none; border: 0; padding: 0; color: var(--sf-text); font-size: var(--sf-fs-2); font-weight: 600;
  line-height: 1.3; text-align: left; white-space: normal; }
#sf-rule-tpls .tpl-card > .rule-tpl::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
#sf-rule-tpls .tpl-card > .rule-tpl:focus-visible { outline: none; }
#sf-rule-tpls .tpl-card:has(> .rule-tpl:focus-visible) { outline: 2px solid var(--sf-fox); outline-offset: -1px; }
#sf-rule-tpls .tpl-what { color: var(--sf-text-2); font-size: var(--sf-fs-1); }
#sf-rule-tpls .tpl-kind { margin-top: auto; font-family: var(--sf-mono); }
@media (hover: hover) { #sf-rule-tpls .tpl-card:hover { border-color: var(--sf-text-3); } }
@media (hover: hover) { #sf-rule-tpls .tpl-card > .rule-tpl:hover { color: var(--sf-text); } }
.alerts-page .rules-how { cursor: pointer; }   /* R103 NOTE: the chip opens the sheet now (was cursor: help, above) */
.how-fires { padding: 0 var(--sf-sp-4) var(--sf-sp-4); }
.how-fires p { margin: 0 0 var(--sf-sp-3); color: var(--sf-text-2); font-size: var(--sf-fs-2); line-height: 1.5; }
/* F23: a known machine row reads as its human line; the machine text = the line's title= + the "..." disclosure */
#sf-alerts details.alert-machine { display: inline; }
#sf-alerts details.alert-machine > summary { display: inline-block; list-style: none; cursor: pointer; padding: 0 5px; border: 1px solid var(--sf-line);
  border-radius: 3px; color: var(--sf-text-3); font-size: var(--sf-fs-0); line-height: 14px; vertical-align: middle; }
#sf-alerts details.alert-machine > summary::-webkit-details-marker { display: none; }
#sf-alerts details.alert-machine > summary:focus-visible { outline: 2px solid var(--sf-fox); outline-offset: 0; }
#sf-alerts details.alert-machine[open] { display: block; margin-top: 2px; }
#sf-alerts details.alert-machine[open] > summary { color: var(--sf-text-2); }
#sf-alerts details.alert-machine > :not(summary) { color: var(--sf-text-2); font-family: var(--sf-mono); font-size: var(--sf-fs-1); overflow-wrap: anywhere; }
@media (hover: hover) { #sf-alerts details.alert-machine > summary:hover { color: var(--sf-text); border-color: var(--sf-text-3); } }

/* ==== slate 60c (B104): the readers + the reading column (docs/design/d3-pages.md sections 5 + 6). ONE list-and-reader
   layout for Reports / Playbook / Studies (ux-review D3: the same side column, the same reader). A page joins with ONE
   class: .sf-reader on its row (reports.html .rp, studies.html .st) or .sf-reader-main on its reader (playbook.html
   .pb-main - the #pb root and its .pb-nav are pinned as they are); the side column = the row's first child, the reader
   = its last. Every rule is :where()-wrapped (specificity 0): the page's own <style> (later in the page) and the phone
   rules still win wherever they speak - the pages no longer say the side column's width / fill / edge / scroller or the
   reader's scroller; their heights (calc(100vh - nav-h)) and phone stacks stay theirs. .sf-column = the 1200 px centred
   reading column (F28: Watch, Account, Users; Studies' reader by its own rule below). ==== */
:where(.sf-reader, :has(> .sf-reader-main)) { display: flex; min-height: 0; }
/* the side column: 320-360 px (25 vw between the two), its own scroller, the pane fill + the hairline edge */
:where(.sf-reader > :first-child, :has(+ .sf-reader-main)) { box-sizing: border-box; width: clamp(320px, 25vw, 360px); flex: none;
  min-height: 0; overflow-y: auto; background: var(--sf-pane); border-right: 1px solid var(--sf-line); }
/* its groups: each .pane-head = a group row on the column's hairline (Studies' four, Playbook's House / Yours), on the
   rows' 8 px left edge */
:where(.sf-reader > :first-child > .pane-head, :has(+ .sf-reader-main) > .pane-head) { margin: 0;
  padding: var(--sf-sp-3) var(--sf-sp-2) var(--sf-sp-1); border-bottom: 1px solid var(--sf-line); }
/* the reader: the rest of the row, its own scroller */
:where(.sf-reader > :last-child, .sf-reader-main) { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; }
/* F25 the kind chip on a Reports row (the script writes no kind on the row and RULED 5 keeps the script as it is): the
   row's own fox line (its first .m span) wears the tag chip, and the pinned Desk recap row leads with a "recap" chip */
:where(.sf-reader .rp-row .m > span:first-child), :where(.sf-reader .rp-recap-open)::before { display: inline-block; flex: none;
  padding: 0 6px; border: 1px solid var(--sf-line); border-radius: 3px; color: var(--sf-text-2); font-size: var(--sf-fs-0);
  font-weight: 400; line-height: 16px; white-space: nowrap; }
:where(.sf-reader .rp-recap-open)::before { content: "recap"; margin-right: var(--sf-sp-2); vertical-align: 1px; }
:where(.sf-reader .rp-row.on .m > span:first-child) { color: inherit; border-color: currentColor; }
/* the reading column (F28) */
:where(.sf-column) { box-sizing: border-box; width: 100%; max-width: 1200px; margin-left: auto; margin-right: auto; }
/* Studies' reader (.st-main, pinned as it is): its cards sit in the same 1200 px column on a wide window */
@media (min-width: 701px) { :where(.st.sf-reader > .st-main > *) { max-width: 1200px; margin-left: auto; margin-right: auto; } }

/* ==== slate 56 (B94) T3: the component set, additive. Every rule is :where()-wrapped (specificity 0), so a page's own
   rule - its later <style>, desk.css, an earlier rule in this file - still wins; these are the look of whatever a page
   leaves unsaid. No markup changes: each family reaches the existing classes by CSS mapping. ==== */

/* .ctl sizes: .ctl-sm 24 px (above) / .ctl 32 px (the token) / NEW .ctl-lg 36 px */
:where(input, select, button, a).ctl.ctl-lg { height: 36px; padding: 0 var(--sf-sp-3); }
/* NEW .ctl-danger - a destructive action: down text + a 1px down edge, no fill (never orange, never primary). Mapped
   by CSS to the existing classes: Users' disable / drop sessions / drop (.ctl.danger) and Ops' Restart. */
:where(button, a).ctl-danger, :where(button.ctl.danger, button.act[data-act="restart"]) { background: none; color: var(--sf-down); border-color: var(--sf-down); }
@media (hover: hover) { :where(button, a).ctl-danger:hover, :where(button.ctl.danger, button.act[data-act="restart"]):hover { background: var(--sf-down-dim); border-color: var(--sf-down); } }

/* NEW .status-line - one muted line with a leading dot (ok / warn / down / info colour the dot; the default dot takes
   the line's own colour). The nine status / n-a containers of F11 wear it by mapping: .na, .msg, .err and the
   #lf-status / #board-status / #scan-status / #rs-st / #fw-st / #wl-msg lines (a page's own colour still wins, the dot
   follows it). An empty container shows no dot. */
:where(.status-line, .na, .msg, .err, #lf-status, #board-status, #scan-status, #rs-st, #fw-st, #wl-msg) { color: var(--sf-text-2); font-size: var(--sf-fs-1); }
:where(.status-line, .na, .msg, .err, #lf-status, #board-status, #scan-status, #rs-st, #fw-st, #wl-msg):not(:empty)::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor;
  vertical-align: middle; }
:where(.status-line.ok)::before { background: var(--sf-up); }
:where(.status-line.warn)::before { background: var(--sf-warn); }
:where(.status-line.down, .status-line.err)::before { background: var(--sf-down); }
:where(.status-line.info)::before { background: var(--sf-info); }

/* NEW table base table.t - the look every page table gets by mapping (the Desk tables, the alerts + rules tables, the
   tile tables, the Den / Little Fox / Big Fox / Foxtrot / Shadow / financials / Ops tables): rows --sf-row-h tall,
   11 px text-3 weight 500 heads (NOT sticky here - R94 M1: an offset counted from a page's scroll wrapper slid the
   head over the first row; desk.css keeps its own top 0 sticky heads in its scroll boxes), cells 0 8px, numeric cells right + tabular, a --sf-line hairline, hover --sf-pane-2, selected = fox-dim +
   the inset 2px fox edge. (A span with class "t" elsewhere is untouched: the base is table.t only.) */
:where(table.t, .desk-table, .alert-table, .tile table, #den table, .lf table, .bf table, .ft table, .sh-tbl, .fin-t, .ops table) { border-collapse: collapse; }
:where(table.t, .desk-table, .alert-table, .tile table, #den table, .lf table, .bf table, .ft table, .sh-tbl, .fin-t, .ops table) :where(th) {
  height: var(--sf-row-h); padding: 0 8px; background: var(--sf-pane);
  color: var(--sf-text-3); font-size: var(--sf-fs-0); font-weight: 500; text-align: left; border-bottom: 1px solid var(--sf-line); }
:where(table.t, .desk-table, .alert-table, .tile table, #den table, .lf table, .bf table, .ft table, .sh-tbl, .fin-t, .ops table) :where(td) {
  height: var(--sf-row-h); padding: 0 8px; border-bottom: 1px solid var(--sf-line); }
:where(table.t, .desk-table, .alert-table, .tile table, #den table, .lf table, .bf table, .ft table, .sh-tbl, .fin-t, .ops table) :where(td.num, th.num, td.r, th.r) {
  text-align: right; font-variant-numeric: tabular-nums slashed-zero; }
@media (hover: hover) { :where(table.t, .desk-table, .alert-table, .tile table, #den table, .lf table, .bf table, .ft table, .sh-tbl, .fin-t, .ops table) :where(tbody tr:hover > td) { background-color: var(--sf-pane-2); } }
:where(table.t, .desk-table, .alert-table, .tile table, #den table, .lf table, .bf table, .ft table, .sh-tbl, .fin-t, .ops table) :where(tr.sel > td, tr[aria-selected="true"] > td) { background-color: var(--sf-fox-dim); }
:where(table.t, .desk-table, .alert-table, .tile table, #den table, .lf table, .bf table, .ft table, .sh-tbl, .fin-t, .ops table) :where(tr.sel > td:first-child, tr[aria-selected="true"] > td:first-child) { box-shadow: inset 2px 0 0 var(--sf-fox); }

/* Active-state rule (F5 -> one): every tab / segment / side nav / chip "on" = background --sf-fox-dim + colour
   --sf-fox-2 (+ the inset 2px fox edge on a side nav: the rail above, the More sheet in phone.css). desk.css moves the
   Desk tabs / scanner panel tabs / chart chips off solid orange. */

/* Depth rule: no box-shadow on panes / tiles / cards - borders carry depth (--sf-pane / -2 / -3). ONE shadow token,
   --sf-shadow, on the floating things only: the bell menu, the phone More sheet (phone.css), the Desk layout menu
   (desk.css) and the Fox Wire settings pane (#fw-cfg, its own page). Inset edges (a selected / unread row,
   a focus ring) are not depth and stay. */

/* slate 56 T4: a tap is a tap - no double-tap-zoom wait on the controls, tab rows, table rows and nav links */
:where(.ctl, .tabs > *, .desk-tab, .scan-tab, .watch-tab, .chart-chip, .dn-tab, tr, .rail a, .tabbar .tab, .top-btn, .bell-btn) { touch-action: manipulation; }
