/* Flosell Farms — operations dashboard
   Tokens follow the data-viz reference instance: series slots are the validated
   four (green, blue, orange, violet), chrome and ink are separate roles, and the
   dark mode is its own set of steps rather than an inverted light mode. */

:root {
  color-scheme: light;
  /* #45: the 4 px spacing scale, as tokens. Every value below equals what was
     hard-coded before, so this is systematisation with zero visual change —
     future spacing decisions pick a token instead of inventing a number. */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 28px;
  --sp-8: 32px;
  --sp-9: 36px;
  --sp-10: 40px;
  --sp-11: 44px;
  --sp-12: 48px;
  --sp-13: 52px;
  --sp-14: 56px;
  --sp-15: 60px;
  --sp-16: 64px;

  /* surfaces */
  --surface-1: #fcfcfb;          /* card / chart surface — palette validated against this */
  --surface-2: #f4f6f3;          /* page plane */
  --surface-sunken: #eef1ed;
  --surface-hover: #f0f3ef;

  /* ink */
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, .10);
  --border-strong: rgba(11, 11, 11, .16);

  /* brand — chrome only, never a data colour */
  --brand-dark: #2b4d2c;
  --brand-mid: #3d6b3e;
  --brand-light: #4e8a50;
  --brand-pale: #eaf2ea;

  /* categorical series slots (validated, fixed order) */
  --series-1: #008300;
  --series-2: #2a78d6;
  --series-3: #eb6834;
  --series-4: #4a3aa7;

  /* status — reserved meaning, always with an icon or label */
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --good-text: #006300;
  /* --warning on a light surface fails contrast as text; this is its ink. */
  --warning-text: #8a5a00;

  --shadow-sm: 0 1px 2px rgba(11, 11, 11, .04), 0 1px 1px rgba(11, 11, 11, .03);
  --shadow-md: 0 4px 16px rgba(11, 11, 11, .06), 0 1px 3px rgba(11, 11, 11, .04);
  --shadow-lg: 0 18px 48px rgba(11, 11, 11, .16), 0 2px 8px rgba(11, 11, 11, .08);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --sidebar: 232px;
  /* The legacy name now resolves to the named stack below, so every screen in
     this file inherits the optical pair without a single call site changing. */
  --font: var(--ff-text);

  /* spacing — one scale, so density is a decision and not an accident */
  --s1: 4px; --s2: 6px; --s3: 8px; --s4: 12px; --s5: 16px; --s6: 22px; --s7: 32px;

  /* type — fixed steps, ~1.15 apart. Product UI is read at a consistent distance. */
  --fs-micro: 10.5px; --fs-meta: 11.5px; --fs-small: 12.5px; --fs-body: 13.5px;
  --fs-lead: 15px; --fs-title: 17px; --fs-figure: 25px; --fs-hero: 52px;

  /* motion — one authored moment per screen, and it is always interruptible */
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --ease-out: cubic-bezier(.2, .8, .3, 1);
  --dur-tip: 140ms;
  --dur-hover: 120ms;
  --dur-ui: 200ms;
  --dur-drawer: 280ms;

  --focus-ring: 0 0 0 2px var(--surface-1), 0 0 0 4px var(--brand-light);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1: #191b19;
  --surface-2: #101210;
  --surface-sunken: #202320;
  --surface-hover: #232623;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, .10);
  --border-strong: rgba(255, 255, 255, .18);
  --brand-dark: #12210f;
  --brand-pale: #1d2a1d;
  --series-1: #008300;
  --series-2: #3987e5;
  --series-3: #d95926;
  --series-4: #9085e9;
  --good-text: #0ca30c;
  --warning-text: var(--warning);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .45);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

/* Keyboard focus is visible everywhere, once, from one token — and instantly. A ring
   that fades in delays the one signal a keyboard user is waiting for, and in a tab
   that is not compositing a fading ring never arrives at all. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-xs);
  transition: none;
}

body {
  margin: 0;
  background: var(--surface-2);
  color: var(--text-primary);
  font: var(--fw-reg) 14px/var(--lh-body) var(--font);
  /* Optical sizing wherever the face carries the axis, and figures that never
     move. Tabular is the right default for the WHOLE product, not just tables:
     this surface refreshes every few seconds, and proportional digits change
     the width of a value between renders — the eye reads that twitch as a
     change in the reading itself. Lining figures because a couple of the
     fallback faces default to old-style in some contexts, and an oldstyle 3
     next to a lining 3 in the same column is the loudest possible tell. */
  font-optical-sizing: auto;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  -webkit-font-smoothing: antialiased;
}

/* Headings are landmarks, so they step WIDER than the body ratio (1.37 · 1.27)
   and each one carries its own tracking. A single blanket letter-spacing across
   three heading sizes is the most common single tell that a type scale was
   never actually set: it is right at exactly one of the three sizes. */
h1, h2, h3 { margin: 0; font-family: var(--ff-display); font-weight: var(--fw-semi); }
h1 { font-size: 26px; line-height: 1.12; letter-spacing: -.022em; }
h2 { font-size: var(--fz-xl); line-height: var(--lh-snug); letter-spacing: var(--tk-xl); }
h3 { font-size: var(--fz-md); line-height: 1.25; letter-spacing: -.006em; }

button, input, select { font: inherit; color: inherit; }

/* ───────────────────────────────────────────── login */
#login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: var(--sp-6);
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--brand-pale), transparent 70%),
    var(--surface-2);
}
.login-card {
  width: 100%; max-width: 360px; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-md); padding: var(--sp-8) var(--sp-7); text-align: center;
}
.login-card img { width: 76px; height: 76px; object-fit: contain; }
.login-card h1 { font-size: 19px; margin-top: 10px; }
.login-card p { color: var(--text-secondary); font-size: 13px; margin: var(--sp-1) 0 var(--sp-5); }
.field { position: relative; }
.field input {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-1);
  outline: none;
  transition: border-color var(--dur-hover) var(--ease-out),
              box-shadow var(--dur-hover) var(--ease-out);
}
.field input:focus { border-color: var(--brand-mid); box-shadow: 0 0 0 3px var(--brand-pale); }
.btn {
  border: 1px solid transparent; border-radius: var(--radius-sm); padding: 10px var(--sp-4);
  background: var(--brand-mid); color: #fff; font-weight: 550; cursor: pointer;
  /* Named easing, not the browser default. This is the most-touched element in the
     product, and `ease` reads sluggish on the way out where --ease-out does not. */
  transition: background var(--dur-hover) var(--ease-out),
              transform 60ms var(--ease-out),
              box-shadow var(--dur-hover) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { background: var(--surface-sunken); color: var(--text-muted); cursor: not-allowed; }
.btn.full { width: 100%; margin-top: var(--sp-3); }
.btn.ghost {
  background: var(--surface-1); color: var(--text-primary); border-color: var(--border-strong);
}
.btn.icon { padding: var(--sp-2) 10px; line-height: 1; }
.btn.icon svg { width: 16px; height: 16px; display: block; }
.form-error { color: var(--critical); font-size: 13px; min-height: 18px; margin-top: 10px; }

/* ───────────────────────────────────────────── shell */
#app { display: none; min-height: 100vh; }
#app.on { display: grid; grid-template-columns: var(--sidebar) 1fr; }

/* The sidebar owns its own scroll context. It had height:100vh with no overflow rule, so
   on any viewport shorter than the nav list the items below the fold were unreachable —
   the page was the only scroller and the sticky sidebar stayed pinned, clipping the rest.
   The brand stays at the top, the sign-out foot stays at the bottom, and the nav between
   them is what moves. dvh so mobile browser chrome does not steal the last item. */
aside {
  background: var(--surface-1); border-right: 1px solid var(--border);
  padding: 18px 14px var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-1);
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  overflow: hidden; min-height: 0;
}
aside nav {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  overscroll-behavior: contain;
  /* room for the fade, and a scrollbar that does not crowd the labels */
  margin-right: -6px; padding-right: 6px;
  scrollbar-width: thin;
}
aside .brand { flex: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: var(--sp-1) var(--sp-2) 18px; }
.brand img {
  width: 38px; height: 38px; object-fit: contain; border-radius: 9px;
  background: #fff; padding: 3px; border: 1px solid var(--border);
}
.brand .name { font-weight: var(--fw-semi); font-size: var(--fz-md); letter-spacing: -.006em; }
.brand .sub { font-size: var(--fz-lbl); font-weight: var(--fw-med); letter-spacing: var(--tk-lbl); color: var(--text-muted); }

nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border-radius: var(--radius-sm); color: var(--text-secondary);
  text-decoration: none; font-size: var(--fz-sm); font-weight: var(--fw-med);
  letter-spacing: var(--tk-sm); cursor: pointer;
  transition: background var(--dur-hover) var(--ease-out);
}
/* Two channels on the active item, not one. A pale fill on a light sidebar is
   about a 4% luminance step and it is gone in daylight on a phone; the inset
   rail survives glare, and it is also what tells a colour-blind reader which
   item is current without asking them to compare two greens. */
nav a.on {
  background: var(--brand-pale); color: var(--brand-dark);
  font-weight: var(--fw-semi); box-shadow: inset 2px 0 0 var(--brand-mid);
}
:root[data-theme="dark"] nav a.on { color: #cfe6cf; }
/* Icons carry the same weight ladder the type does: a resting nav icon is
   secondary furniture, the current one is not. */
nav a svg { width: 17px; height: 17px; flex: none; opacity: .68; }
nav a:hover svg { opacity: .85; }
nav a.on svg { opacity: 1; }
nav .group {
  font-size: var(--fz-cap); text-transform: uppercase; letter-spacing: var(--tk-caps);
  color: var(--tx-3); padding: var(--sp-4) 11px 6px; font-weight: var(--fw-med);
}
aside .foot {
  flex: none; display: flex; gap: 6px; padding-top: var(--sp-3); margin-top: var(--sp-1);
  border-top: 1px solid var(--border);
}

main { min-width: 0; }

header.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  padding: 14px var(--sp-6); background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
header.top h2 { font-size: var(--fz-xl); }
header.top .as-of { font-size: var(--fz-lbl); font-weight: var(--fw-med); letter-spacing: var(--tk-lbl); color: var(--text-muted); }
header.top .spacer { flex: 1; }

/* one filter row, above everything it scopes */
.segmented {
  display: inline-flex; background: var(--surface-sunken); border-radius: 9px;
  padding: 3px; gap: 2px; border: 1px solid var(--border);
}
.segmented button {
  border: 0; background: transparent; color: var(--text-secondary);
  padding: 5px 11px; border-radius: 7px; font-size: var(--fz-sm);
  font-weight: var(--fw-med); letter-spacing: var(--tk-sm); cursor: pointer;
}
.segmented button.on {
  background: var(--surface-1); color: var(--text-primary);
  font-weight: var(--fw-semi); box-shadow: var(--shadow-sm);
}

.content { padding: 22px var(--sp-6) var(--sp-15); max-width: 1560px; }
.view { display: none; }
/* No entrance animation. Every render is a data refresh as often as it is a
   navigation, and a critical alert must arrive at full contrast in the first frame. */
.view.on { display: block; }

/* ───────────────────────────────────────────── cards */
.card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: baseline; gap: 10px;
  padding: 15px 18px 0;
}
.card-head h3 { font-size: 14px; }
.card-head .hint { font-size: 12px; color: var(--text-muted); }
.card-head .spacer { flex: 1; }
.card-body { padding: 14px 18px 18px; }

.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

/* hero + stat tiles */
.hero {
  display: flex; align-items: flex-end; gap: var(--sp-7); flex-wrap: wrap;
  padding: var(--sp-5) 22px; margin-bottom: 14px;
}
.hero .label { font-size: 12px; color: var(--text-muted); letter-spacing: .02em; }
.hero .figure { font-size: 52px; line-height: 1.05; font-weight: 620; letter-spacing: -.025em; }
.hero .figure small { font-size: 20px; font-weight: 500; color: var(--text-secondary); }
.hero .note { font-size: 13px; color: var(--text-secondary); max-width: 34ch; }

.tiles { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.tile { padding: 14px var(--sp-4); }
.tile .label { font-size: 11.5px; color: var(--text-muted); font-weight: 500; }
.tile .value { font-size: 25px; font-weight: 600; letter-spacing: -.02em; margin-top: 3px; }
.tile .value small { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.tile .delta { font-size: 12px; margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.delta.up { color: var(--good-text); }
.delta.down { color: var(--critical); }
.delta.flat { color: var(--text-muted); }
.tile .spark { margin-top: var(--sp-2); height: 30px; }

/* ───────────────────────────────────────────── tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px var(--sp-3); text-align: left; white-space: nowrap; }
th {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border);
}
td { border-bottom: 1px solid var(--grid); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.name { font-weight: 550; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { color: var(--good-text); background: color-mix(in srgb, var(--good) 14%, transparent); }
.pill.warn { color: var(--warning-text); background: color-mix(in srgb, var(--warning) 22%, transparent); }
.pill.bad { color: var(--critical); background: color-mix(in srgb, var(--critical) 15%, transparent); }
.pill.idle { color: var(--text-muted); background: var(--surface-sunken); }
.pill.plain::before { display: none; }

.empty { padding: 34px var(--sp-4); text-align: center; color: var(--text-muted); font-size: 13px; }
.muted { color: var(--text-muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ───────────────────────────────────────────── charts */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { font-family: var(--font); }
.chart .tick {
  font-size: 11px; fill: var(--text-muted); font-variant-numeric: tabular-nums;
}
.chart .grid-line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis-line { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .ref-line { stroke: var(--axis); stroke-width: 1; }
.chart .ref-label { font-size: 10.5px; fill: var(--text-muted); }
.chart .end-label { font-size: 11.5px; font-weight: 600; fill: var(--text-primary); }
.chart .val-label {
  font-size: 11.5px; font-weight: 600; fill: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.chart .crosshair { stroke: var(--axis); stroke-width: 1; pointer-events: none; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .mark-hit { fill: transparent; cursor: pointer; }
.chart .bar { transition: opacity var(--dur-hover) var(--ease-out); }
.chart .bar.lift { opacity: .78; }
/* threshold zones — status hues, always carrying their own label */
.chart .band.good { fill: var(--good); fill-opacity: .07; }
.chart .band.warning { fill: var(--warning); fill-opacity: .12; }
.chart .band.serious { fill: var(--serious); fill-opacity: .12; }
.chart .band.critical { fill: var(--critical); fill-opacity: .09; }
.chart .band-label { font-size: var(--fs-micro); fill: var(--text-muted); }

.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 2px 0 10px; }
.legend .item {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: 12.5px; color: var(--text-secondary);
}
.legend .key { width: 14px; height: 3px; border-radius: 2px; flex: none; }
.legend .key.rect { height: 10px; width: 10px; border-radius: 3px; }

#tooltip {
  position: fixed; z-index: 90; pointer-events: none; opacity: 0;
  transition: opacity var(--dur-tip); background: var(--surface-1);
  border: 1px solid var(--border-strong); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 9px 11px; font-size: 12.5px; min-width: 130px;
}
#tooltip.on { opacity: 1; }
#tooltip .tt-title {
  font-size: 11px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
}
#tooltip .tt-row { display: flex; align-items: center; gap: var(--sp-2); margin-top: 3px; }
#tooltip .tt-key { width: 12px; height: 3px; border-radius: 2px; flex: none; }
#tooltip .tt-val {
  font-weight: 650; font-variant-numeric: tabular-nums; margin-left: auto;
  color: var(--text-primary);
}
#tooltip .tt-name { color: var(--text-secondary); }

/* meter */
.meter { height: 8px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 999px; }

/* ───────────────────────────────────────────── assistant */
/* Docked in the header. It used to be a fixed pill floating bottom-right, which meant
   its footprint was always content somebody could not read — on the cage view, a chart.
   Nothing about opening a side panel needs a floating trigger. */
#chat-fab { place-items: center; }
#chat {
  position: fixed; right: 22px; bottom: 22px; z-index: 50;
  width: min(400px, calc(100vw - 32px)); height: min(600px, 82vh);
  background: var(--surface-1); border: 1px solid var(--border-strong);
  border-radius: 16px; box-shadow: var(--shadow-lg);
  display: none; flex-direction: column; overflow: hidden;
}
#chat.on { display: flex; }
#chat .head {
  display: flex; align-items: center; gap: 9px; padding: var(--sp-3) 14px;
  border-bottom: 1px solid var(--border);
}
#chat .head .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
#chat .head strong { font-size: 13.5px; flex: 1; }
#log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 9px var(--sp-3); border-radius: 13px; white-space: pre-wrap; font-size: 13.5px; }
.msg.me { align-self: flex-end; background: var(--brand-mid); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--surface-sunken); border-bottom-left-radius: 4px; }
.msg.err { align-self: flex-start; background: color-mix(in srgb, var(--critical) 12%, transparent); color: var(--critical); }
.msg.think { color: var(--text-muted); }
#composer { display: flex; gap: var(--sp-2); padding: 11px; border-top: 1px solid var(--border); }
#composer input {
  flex: 1; padding: 10px var(--sp-3); border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface-1); outline: none;
}
#composer input:focus { border-color: var(--brand-mid); box-shadow: 0 0 0 3px var(--brand-pale); }
.suggests { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.suggests button {
  border: 1px solid var(--border-strong); background: var(--surface-1);
  border-radius: 999px; padding: 5px 11px; font-size: 12px; cursor: pointer;
  color: var(--text-secondary);
}
/* Hover is an enhancement for a mouse, never a way to reach information. Half this
   farm runs the dashboard from a phone on a boat, where :hover latches on tap. */
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { background: var(--brand-light); }
  .btn.ghost:hover:not(:disabled) { background: var(--surface-hover); }
  .btn.danger:hover:not(:disabled) { background: #b93030; }
  nav a:hover { background: var(--surface-hover); color: var(--text-primary); }
  tbody tr:hover td { background: var(--surface-hover); }
  .suggests button:hover { background: var(--surface-hover); color: var(--text-primary); }
  .chart .bar:hover { opacity: .78; }
  .cage:hover { border-color: var(--border-strong); background: var(--surface-hover); }
  .crumb:hover { color: var(--text-primary); }
}

/* refetch holds the frame instead of flashing a skeleton */
.reloading .content { opacity: .55; transition: opacity var(--dur-hover) var(--ease-out); }

@media (max-width: 1100px) { .cols-3 { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: span 2; } }
@media (max-width: 900px) {
  #app.on { grid-template-columns: 1fr; }
  aside {
    position: static; height: auto; flex-direction: row; align-items: center;
    overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 10px;
  }
  aside .brand { padding: 0 10px 0 var(--sp-1); }
  aside nav { display: flex; gap: var(--sp-1); }
  aside nav .group, aside .foot { display: none; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .hero .figure { font-size: 40px; }
}
/* Reduced motion means gentler, not dead. Opacity still carries state — losing the
   tint on a changed value or the fade on a sheet would cost information, not comfort.
   What goes is everything that moves or scales. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 120ms !important;
  }
  /* Never widen transition-property here. Adding one where an element declared none
     means a focus ring or an alarm now fades in — and in a tab that is not
     compositing it never finishes fading, so it never appears at all. */
  .sheet, .drawer { transform: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) {
    animation-duration: 1ms !important;
  }
}

/* ───────────────────────────────────────── record editing */
.btn.small { padding: 6px 11px; font-size: 12.5px; border-radius: 7px; }
.btn.danger { background: var(--critical); }

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(11, 11, 11, .46); padding: var(--sp-5);
  animation: fade .14s var(--ease-out) both;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: min(640px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  background: var(--surface-1); border: 1px solid var(--border-strong);
  border-radius: 16px; box-shadow: var(--shadow-lg); animation: pop .16s var(--ease-out) both;
}
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: 0; } }
.sheet-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px; border-bottom: 1px solid var(--border);
}
.sheet-head h3 { font-size: 15px; }
.sheet-body {
  padding: var(--sp-4) 18px; overflow-y: auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 13px;
}
.sheet-foot {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 13px 18px; border-top: 1px solid var(--border);
}
.form-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form-field.wide { grid-column: span 2; }
.form-field.checkbox { flex-direction: row; align-items: center; gap: 9px; }
.form-field.checkbox input { width: 17px; height: 17px; accent-color: var(--brand-mid); }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.form-field input, .form-field select, .form-field textarea {
  padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface-1); color: var(--text-primary); outline: none; width: 100%;
  font-variant-numeric: tabular-nums;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--brand-mid); box-shadow: 0 0 0 3px var(--brand-pale);
}
.form-field input:disabled { background: var(--surface-sunken); color: var(--text-muted); }
.form-hint { font-size: 11.5px; color: var(--text-muted); line-height: 1.35; }
.sheet .form-error { padding: 0 18px; }

/* ───────────────────────────────────────── alerts
   Severity is carried by a drawn icon and a written word, so it survives a
   colourblind reader, a greyscale print and a sunlit phone screen. The hue tints the
   border and, for critical only, the surface — no coloured rail standing in for a
   label. Nothing here transitions: an alarm is at full contrast in its first frame. */
.alert-strip { display: grid; gap: var(--s3); margin-bottom: var(--s5); }
.alert {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--s4);
  align-items: start; padding: var(--sp-3) 15px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-1);
}
.alert .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert .sev {
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; display: block; margin-bottom: 1px;
}
.alert .title { font-weight: 620; font-size: var(--fs-body); }
.alert .detail { font-size: var(--fs-small); color: var(--text-secondary); margin-top: 3px; }
.alert .where {
  font-size: var(--fs-meta); color: var(--text-muted); white-space: nowrap; text-align: right;
}
.alert.critical {
  border-color: color-mix(in srgb, var(--critical) 45%, var(--border));
  background: color-mix(in srgb, var(--critical) 5%, var(--surface-1));
}
.alert.critical .icon { color: var(--critical); }
.alert.critical .sev { color: var(--critical); }
.alert.serious { border-color: color-mix(in srgb, var(--serious) 45%, var(--border)); }
.alert.serious .icon, .alert.serious .sev { color: var(--serious); }
.alert.warning { border-color: color-mix(in srgb, var(--warning) 50%, var(--border)); }
.alert.warning .icon, .alert.warning .sev { color: var(--warning-text); }
.alert-none {
  display: flex; align-items: center; gap: var(--s3);
  padding: 14px 15px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-1); color: var(--good-text); font-weight: 550; font-size: var(--fs-body);
}
.alert-none svg { width: 17px; height: 17px; flex: none; }

.wq-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.wq { padding: 14px var(--sp-4); }
.wq .unit { font-weight: 640; font-size: 14px; }
.wq .when { font-size: var(--fs-meta); color: var(--text-muted); margin-bottom: 9px; }
.wq .row { display: flex; align-items: baseline; gap: var(--sp-2); padding: 3px 0; font-size: 13px; }
.wq .row .k { color: var(--text-secondary); }
.wq .row .v { margin-left: auto; font-weight: 620; font-variant-numeric: tabular-nums; }
.wq.aged .row .v { color: var(--text-secondary); font-weight: 550; }

/* a value that opens its own record — text, not a button costume */
.as-link {
  appearance: none; background: none; border: 0; padding: 0; font: inherit;
  color: inherit; cursor: pointer; text-align: left;
  text-decoration: underline; text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}
@media (hover: hover) and (pointer: fine) {
  .as-link:hover { text-decoration-color: var(--brand-light); }
}

@media (max-width: 620px) {
  .sheet-body { grid-template-columns: 1fr; }
  .form-field.wide { grid-column: span 1; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Honest values
   A number on this screen has to say how old it is and whether anyone should
   believe it. These four classes are the only way a reading is allowed to render.
   ═══════════════════════════════════════════════════════════════════════════ */

.status-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block;
}
.status-dot.good { background: var(--good); }
.status-dot.warning { background: var(--warning); }
.status-dot.serious { background: var(--serious); }
.status-dot.critical { background: var(--critical); }
.status-dot.unknown { background: transparent; border: 1.5px solid var(--axis); }
/* A hollow dot means the status is real but the reading behind it has aged out. */
.aged .status-dot:not(.unknown) {
  background: transparent; box-shadow: inset 0 0 0 1.5px currentColor;
}
.aged .status-dot.good { color: var(--good); }
.aged .status-dot.warning { color: var(--warning); }
.aged .status-dot.serious { color: var(--serious); }
.aged .status-dot.critical { color: var(--critical); }

.age {
  font-size: var(--fs-meta); color: var(--text-muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.age.stale { color: var(--text-secondary); font-weight: 600; }

/* suspect and bad readings are shown, never hidden, and never as a live value */
.q-flag {
  display: inline-flex; align-items: center; gap: var(--s1);
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted);
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 1px 6px;
}
.q-reason { font-size: var(--fs-meta); color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   Cage grid — the instrument, not a wall of cards
   One hairline matrix inside one panel: no per-cell shadow, no nested card.
   ═══════════════════════════════════════════════════════════════════════════ */

.zone { margin-bottom: var(--s5); }
.zone-head {
  display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap;
  padding: 0 0 var(--s3);
}
.zone-head h3 { font-size: var(--fs-body); }
.zone-head .count { font-size: var(--fs-meta); color: var(--text-muted); }
.zone-head .spacer { flex: 1; }
.zone-head .roll {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-size: var(--fs-meta); color: var(--text-secondary);
}
.zone-head .roll svg { width: 13px; height: 13px; }

/* Hairlines are drawn by the cells, not by gaps over a coloured backing: a part-filled
   last row must read as empty water, not as a grey block. The track count is set
   inline per group — `repeat()` cannot take a custom property as its count. */
.cage-matrix {
  display: grid; gap: 0; background: var(--surface-1);
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.cage {
  appearance: none; -webkit-appearance: none; text-align: left; font: inherit;
  background: var(--surface-1); color: inherit; cursor: pointer;
  border: 0; border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid);
  padding: 11px var(--sp-3) 10px; display: flex; flex-direction: column; gap: var(--s3);
  min-height: 134px; min-width: 0; position: relative;
  transition: background var(--dur-hover) var(--ease-out);
}
.cage:focus-visible { box-shadow: inset 0 0 0 2px var(--brand-light); border-radius: 0; }
.cage.attention { background: color-mix(in srgb, var(--critical) 6%, var(--surface-1)); }
.cage.empty-unit { background: var(--surface-2); }

.cage-top { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.cage-name {
  font-weight: 640; font-size: var(--fs-body); letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.cage-top .spacer { flex: 1 1 auto; min-width: 0; }
.cage-flag {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; white-space: nowrap;
}
.cage-flag.critical { color: var(--critical); }
.cage-flag.serious { color: var(--serious); }
.cage-flag.warning { color: var(--warning-text); }
.cage-flag.good { color: var(--good-text); }
.cage-flag.unknown { color: var(--text-muted); }
.cage-flag svg { width: 13px; height: 13px; }

.cage-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2) var(--s3); }
.cage-metric { display: flex; align-items: baseline; gap: var(--sp-1); min-width: 0; }
.cage-metric .status-dot { align-self: center; }
.cage-metric .k {
  font-size: var(--fs-micro); color: var(--text-muted); font-weight: 600;
  letter-spacing: .02em; flex: none; white-space: nowrap;
}
.cage-metric .v {
  font-size: var(--fs-body); font-weight: 620; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: auto;
}
.cage.aged .cage-metric .v { color: var(--text-secondary); font-weight: 550; }
.cage-metric.is-critical .v { color: var(--critical); }
.cage-foot {
  margin-top: auto; display: flex; align-items: center; gap: var(--s2);
  font-size: var(--fs-meta); color: var(--text-muted); white-space: nowrap; min-width: 0;
}
.cage-foot > * { flex: none; }
.cage-foot .spacer { flex: 1 1 auto; }
.cage-foot .stock { overflow: hidden; text-overflow: ellipsis; }
.cage-foot .no-sensor { display: inline-flex; align-items: center; color: var(--text-muted); }
.cage-foot .no-sensor svg { width: 13px; height: 13px; }
.cage-none { font-size: var(--fs-small); color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   Cage deep view
   ═══════════════════════════════════════════════════════════════════════════ */

.crumbs {
  display: flex; align-items: center; gap: var(--s2);
  font-size: var(--fs-small); color: var(--text-muted); margin-bottom: var(--s4);
}
.crumb {
  appearance: none; background: none; border: 0; padding: 2px 0; font: inherit;
  color: var(--text-secondary); cursor: pointer; display: inline-flex;
  align-items: center; gap: var(--s1);
  transition: color var(--dur-hover) var(--ease-out);
}
.crumb svg { width: 14px; height: 14px; }

.cage-hero {
  display: flex; align-items: flex-start; gap: var(--s6); flex-wrap: wrap;
  padding: var(--s5) var(--s6); margin-bottom: var(--s5);
}
.cage-hero h2 { font-size: 24px; letter-spacing: -.02em; }
.cage-hero .where { font-size: var(--fs-small); color: var(--text-muted); margin-top: 3px; }
.cage-hero .facts {
  display: flex; gap: var(--s6); flex-wrap: wrap; margin-left: auto;
}
.cage-hero .fact .k {
  font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); font-weight: 600;
}
.cage-hero .fact .v {
  font-size: 19px; font-weight: 620; font-variant-numeric: tabular-nums; margin-top: 2px;
}
.cage-hero .fact .v small { font-size: 12px; font-weight: 500; color: var(--text-secondary); }

.readouts {
  display: grid; gap: var(--s4);
  grid-template-columns: repeat(auto-fit, minmax(184px, 1fr));
}
.readout {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: var(--sp-3) 14px; background: var(--surface-1);
  display: flex; flex-direction: column; gap: var(--s2);
}
.readout.critical { border-color: color-mix(in srgb, var(--critical) 45%, var(--border)); }
.readout .top { display: flex; align-items: center; gap: var(--s2); }
/* No text-transform on a data label: uppercasing "pH" spells it wrong. */
.readout .k {
  font-size: var(--fs-meta); letter-spacing: .01em;
  color: var(--text-secondary); font-weight: 600;
}
.readout .top .spacer { flex: 1; }
.readout .v {
  font-size: 27px; font-weight: 620; line-height: 1.1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.readout .v small { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.readout.aged .v { color: var(--text-secondary); }
.readout .guide { font-size: var(--fs-meta); color: var(--text-muted); }
.readout .v.absent {
  font-size: var(--fs-body); font-weight: 550; color: var(--text-muted);
  letter-spacing: 0; padding: 5px 0;
}
.readout .sev {
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.readout .sev.critical { color: var(--critical); }
.readout .sev.serious { color: var(--serious); }
.readout .sev.warning { color: var(--warning-text); }
.readout .sev.good { color: var(--good-text); }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s4) var(--s5); }
.kv .k {
  font-size: var(--fs-meta); letter-spacing: .01em;
  color: var(--text-secondary); font-weight: 600;
}
.kv .v { font-size: var(--fs-lead); font-weight: 620; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kv .v small { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.kv .n { font-size: var(--fs-meta); color: var(--text-muted); margin-top: 1px; }

.provenance {
  font-size: var(--fs-meta); color: var(--text-muted); line-height: 1.5;
  max-width: 84ch;
  padding-top: var(--s3); margin-top: var(--s3); border-top: 1px solid var(--grid);
}

.notice {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--sp-3) 14px; border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong); background: var(--surface-2);
  font-size: var(--fs-small); color: var(--text-secondary);
}
.notice svg { width: 16px; height: 16px; flex: none; color: var(--text-muted); margin-top: 1px; }
.notice strong { color: var(--text-primary); font-weight: 620; }

/* ═══════════════════════════════════════════════════════════════════════════
   The one authored moment: a cage cell becoming the cage.
   Native view transitions, so the shared element is the browser's job and the
   whole thing is skippable. Everything else on this screen renders instantly.
   ═══════════════════════════════════════════════════════════════════════════ */
::view-transition-group(cage-card) {
  animation-duration: var(--dur-drawer);
  animation-timing-function: var(--ease-drawer);
}
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; }

@media (max-width: 900px) {
  .cage-hero { padding: var(--s5); }
  .cage-hero .facts { margin-left: 0; gap: var(--s5); }
  .cage-hero h2 { font-size: 21px; }
}
@media (max-width: 620px) {
  .cage-matrix { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); }
  .cage { min-height: 124px; padding: 10px 11px; }
  .readouts { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .readout .v { font-size: 23px; }
  .content { padding: var(--s5) var(--s4) var(--sp-12); }
  .alert { grid-template-columns: auto 1fr; }
  .alert .where { grid-column: 2; text-align: left; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   THE OS CONTRACT — hierarchy, alarms, incidents
   Same locked tokens. Status is never colour alone; every state carries an icon or a
   word, and nothing here transitions on a value update.
   ═══════════════════════════════════════════════════════════════════════════ */

/* A contract that exists but is not deployed. Dashed, because it is a hole in the system
   and should look like one — not an alarm, and not a tidy empty state either. */
.gap, .no-analog {
  display: flex; gap: var(--s4); align-items: flex-start;
  padding: var(--sp-4) 18px; margin-bottom: var(--s5);
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-1);
}
.gap svg, .no-analog svg { width: 20px; height: 20px; flex: none; color: var(--text-muted); margin-top: 1px; }
.gap-head, .na-head { font-size: var(--fs-lead); font-weight: 620; }
.gap-why, .na-why {
  font-size: var(--fs-small); color: var(--text-secondary); margin-top: var(--sp-1); max-width: 84ch;
  line-height: 1.5;
}
.gap-eps { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.gap-eps code {
  font-size: var(--fs-meta); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface-sunken); border: 1px solid var(--border);
  border-radius: var(--radius-xs); padding: 2px 7px; color: var(--text-secondary);
}

/* ───────────────────────────── zones */
.zones-head { margin-bottom: var(--s5); }
.farm-id h3 { font-size: 21px; }
.farm-id .sub { font-size: var(--fs-small); color: var(--text-muted); margin-top: 2px; }

.zone-card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: var(--s5) var(--s6); margin-bottom: var(--s5);
}
/* An UNMAPPED zone is the absence of a zone, so it does not get a zone's presence. */
.zone-card.unmapped { background: var(--surface-2); box-shadow: none; border-style: dashed; }

.zone-top { display: flex; align-items: flex-start; gap: var(--s6); flex-wrap: wrap; }
.zone-ident { min-width: 0; }
.zcode { font-size: 27px; font-weight: 700; letter-spacing: -.02em; line-height: 1.05; }
.zcode.unmapped {
  font-size: var(--fs-lead); font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted);
}
.zname { font-size: var(--fs-body); font-weight: 600; color: var(--text-secondary); margin-top: 2px; }
.zband { font-size: var(--fs-small); color: var(--text-muted); margin-top: 3px; }
.zone-facts { display: flex; gap: var(--s6); flex-wrap: wrap; }
.zfact .k { font-size: var(--fs-meta); font-weight: 600; color: var(--text-secondary); }
.zfact .v { font-size: var(--fs-lead); font-weight: 620; font-variant-numeric: tabular-nums; margin-top: 2px; }

.zone-roll {
  display: inline-flex; align-items: center; gap: var(--s2); white-space: nowrap;
  font-size: var(--fs-small); font-weight: 700;
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 6px 13px;
}
.zone-roll svg { width: 16px; height: 16px; }
.zone-roll.critical { color: var(--critical); border-color: var(--critical); }
.zone-roll.bad, .zone-roll.suspect { color: var(--serious); border-color: color-mix(in srgb, var(--serious) 55%, var(--border)); }
.zone-roll.warning { color: var(--warning-text); border-color: color-mix(in srgb, var(--warning) 55%, var(--border)); }
.zone-roll.good { color: var(--good-text); border-color: color-mix(in srgb, var(--good) 45%, var(--border)); }
.zone-roll.not_reporting, .zone-roll.none { color: var(--text-muted); }

.zone-counts { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s4) 0; }
.zcount {
  display: inline-flex; align-items: baseline; gap: 5px;
  font-size: var(--fs-meta); font-weight: 600;
  border-radius: 999px; padding: 3px 10px; background: var(--surface-sunken); color: var(--text-secondary);
}
.zcount .n { font-weight: 700; font-variant-numeric: tabular-nums; }
.zcount.critical { color: var(--critical); background: color-mix(in srgb, var(--critical) 10%, transparent); }
.zcount.bad, .zcount.suspect { color: var(--serious); background: color-mix(in srgb, var(--serious) 12%, transparent); }
.zcount.warning { color: var(--warning-text); background: color-mix(in srgb, var(--warning) 18%, transparent); }
.zcount.good { color: var(--good-text); background: color-mix(in srgb, var(--good) 10%, transparent); }

.cage-stock { display: flex; flex-direction: column; gap: 1px; }
.cage-stock .line { font-size: var(--fs-meta); color: var(--text-secondary); }
.cage-stock .line.muted { color: var(--text-muted); }

/* ───────────────────────────── alarm rate, ISA-18.2 */
.alarm-rate {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-1); padding: var(--s5) var(--s6); margin-bottom: var(--s4);
}
.alarm-rate .rn { display: flex; align-items: baseline; gap: var(--s2); }
.alarm-rate .big { font-size: 40px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.alarm-rate .unit { font-size: var(--fs-body); color: var(--text-secondary); font-weight: 600; }
.alarm-rate .rmeter {
  height: 8px; border-radius: 999px; background: var(--surface-sunken);
  overflow: hidden; margin: var(--s4) 0 var(--s3);
}
.alarm-rate .rmeter span { display: block; height: 100%; border-radius: 999px; background: var(--good); }
.alarm-rate .rnote { font-size: var(--fs-small); color: var(--text-secondary); max-width: 84ch; }
.alarm-rate.over { border-color: color-mix(in srgb, var(--warning) 55%, var(--border)); }
.alarm-rate.over .rmeter span { background: var(--warning); }
.alarm-rate.flood { border-color: var(--critical); background: color-mix(in srgb, var(--critical) 5%, var(--surface-1)); }
.alarm-rate.flood .rmeter span { background: var(--critical); }
.alarm-rate.flood .big { color: var(--critical); }

/* ───────────────────────────── one incident, many alerts */
.incident-group {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: var(--s5) var(--s6); margin-bottom: var(--s4);
}
.incident-group.critical {
  border-color: color-mix(in srgb, var(--critical) 45%, var(--border));
  background: color-mix(in srgb, var(--critical) 4%, var(--surface-1));
}
.incident-group.warning { border-color: color-mix(in srgb, var(--warning) 50%, var(--border)); }
.incident-group.closed { background: var(--surface-2); box-shadow: none; }

.ig-top { display: flex; align-items: flex-start; gap: var(--s4); }
.ig-sev {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
}
.ig-sev svg { width: 15px; height: 15px; }
.ig-sev.critical { color: var(--critical); }
.ig-sev.warning { color: var(--warning-text); }
.ig-sev.info { color: var(--text-secondary); }
.ig-text { min-width: 0; }
.ig-title { font-size: var(--fs-lead); font-weight: 620; }
.ig-meta { font-size: var(--fs-small); color: var(--text-secondary); margin-top: 3px; }
.ig-state {
  flex: none; font-size: var(--fs-micro); font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--text-secondary);
}
.ig-state.raised { color: var(--critical); border-color: var(--critical); }
.ig-state.acknowledged { color: var(--warning-text); border-color: color-mix(in srgb, var(--warning) 55%, var(--border)); }
.ig-state.resolved { color: var(--good-text); border-color: color-mix(in srgb, var(--good) 45%, var(--border)); }

.ig-when {
  display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap;
  font-size: var(--fs-meta); color: var(--text-muted); margin-top: var(--s3);
}
.ig-when .dot-sep { color: var(--axis); }
.episode-line { margin: var(--s4) 0; max-width: 88ch; }

.ig-alerts { margin-top: var(--s4); border-top: 1px solid var(--grid); }
.alarm-row {
  display: flex; align-items: flex-start; gap: var(--s4);
  padding: var(--s4) 0; border-bottom: 1px solid var(--grid);
}
.alarm-row:last-child { border-bottom: 0; }
.alarm-row.resolved { opacity: .72; }
.ar-state {
  flex: none; min-width: 96px; font-size: var(--fs-micro); font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); padding-top: 2px;
}
.ar-state.raised { color: var(--critical); }
.ar-state.acknowledged { color: var(--warning-text); }
.ar-state.resolved { color: var(--good-text); }
.ar-what { min-width: 0; }
.ar-type { font-size: var(--fs-small); font-weight: 700; letter-spacing: .02em; }
.ar-msg { font-size: var(--fs-small); color: var(--text-secondary); margin-top: 2px; }
.ar-actor { font-size: var(--fs-meta); color: var(--text-muted); margin-top: 3px; }
.ig-acts { display: flex; gap: var(--s3); margin-top: var(--s4); }

.resolution {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--sp-3) 15px; border-radius: var(--radius); margin-bottom: var(--s4);
  background: color-mix(in srgb, var(--good) 8%, var(--surface-1));
  border: 1px solid color-mix(in srgb, var(--good) 35%, var(--border));
  font-size: var(--fs-small); color: var(--good-text); font-weight: 600;
}
.resolution svg { width: 17px; height: 17px; flex: none; }

.incident-hero {
  display: flex; align-items: flex-start; gap: var(--s7); flex-wrap: wrap;
  padding: var(--s6); margin-bottom: var(--s4);
}
.incident-hero h2 { font-size: 24px; letter-spacing: -.02em; margin-top: var(--sp-1); }
.incident-hero .where { font-size: var(--fs-small); color: var(--text-muted); margin-top: 3px; }
.incident-hero .facts { display: flex; gap: var(--s6); flex-wrap: wrap; margin-left: auto; }
.incident-hero .fact .k { font-size: var(--fs-meta); font-weight: 600; color: var(--text-secondary); }
.incident-hero .fact .v { font-size: var(--fs-lead); font-weight: 620; margin-top: 2px; }
.incident-hero .fact .n { font-size: var(--fs-meta); color: var(--text-muted); margin-top: 1px; }

/* ───────────────────────────── chain of custody */
.timeline { display: flex; flex-direction: column; }
.tl-band {
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-muted); padding: var(--s5) 0 var(--s2);
  border-bottom: 1px solid var(--grid); margin-bottom: var(--s2);
}
.tl-band:first-child { padding-top: 0; }
.tl-row { display: grid; grid-template-columns: 76px 18px 1fr; gap: var(--s3); padding: var(--s3) 0; }
.tl-when { text-align: right; }
.tl-when .time { font-size: var(--fs-small); font-weight: 700; font-variant-numeric: tabular-nums; }
.tl-when .date { font-size: var(--fs-micro); color: var(--text-muted); }
.tl-dot { position: relative; }
.tl-dot::before {
  content: ""; position: absolute; left: 50%; top: 5px; width: 9px; height: 9px;
  border-radius: 50%; transform: translateX(-50%); background: var(--axis);
}
.tl-dot::after {
  content: ""; position: absolute; left: 50%; top: var(--sp-4); bottom: -14px; width: 2px;
  transform: translateX(-50%); background: var(--grid);
}
.tl-row:last-child .tl-dot::after { display: none; }
.tl-row.evidence .tl-dot::before { background: var(--series-2); }
.tl-row.understand .tl-dot::before { background: var(--series-4); }
.tl-row.action .tl-dot::before { background: var(--series-3); }
.tl-row.verify .tl-dot::before { background: var(--series-1); }
.tl-row.escalate .tl-dot::before { background: var(--critical); }
.tl-row.alarm .tl-dot::before { background: var(--warning); }

.tl-head { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.tl-phase { font-size: var(--fs-micro); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tl-phase.evidence { color: var(--series-2); }
.tl-phase.understand { color: var(--series-4); }
.tl-phase.action { color: var(--series-3); }
.tl-phase.verify { color: var(--good-text); }
.tl-phase.escalate { color: var(--critical); }
.tl-phase.alarm { color: var(--warning-text); }
.tl-type { font-size: var(--fs-small); font-weight: 620; }
.tl-actor {
  font-size: var(--fs-meta); color: var(--text-muted); margin-top: 1px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.tl-ev { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: var(--s2); }
.tl-ev .ev { display: inline-flex; align-items: baseline; gap: 5px; font-size: var(--fs-meta); }
.tl-ev .ek { color: var(--text-muted); }
.tl-ev .evv { font-weight: 620; font-variant-numeric: tabular-nums; }

/* ───────────────────────────── command states
   Thirteen states, and the three that get confused for each other are the three that
   carry their meaning on the chip: heard, actuator ran, verified. */
.cmd-state {
  display: inline-flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap;
  font-size: var(--fs-meta); border-radius: var(--radius-xs); padding: 2px var(--sp-2);
  border: 1px solid var(--border-strong); background: var(--surface-sunken);
}
.cs-name { font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: var(--fs-micro); }
.cs-mean { color: var(--text-secondary); }
.cmd-state.recommended, .cmd-state.pending_approval { border-style: dashed; }
.cmd-state.acked { border-color: color-mix(in srgb, var(--warning) 55%, var(--border)); }
.cmd-state.acked .cs-name { color: var(--warning-text); }
.cmd-state.executing, .cmd-state.executed {
  border-color: color-mix(in srgb, var(--serious) 60%, var(--border));
  background: color-mix(in srgb, var(--serious) 8%, var(--surface-1));
}
.cmd-state.executing .cs-name, .cmd-state.executed .cs-name { color: var(--serious); }
.cmd-state.verified {
  border-color: color-mix(in srgb, var(--good) 55%, var(--border));
  background: color-mix(in srgb, var(--good) 9%, var(--surface-1));
}
.cmd-state.verified .cs-name { color: var(--good-text); }
.cmd-state.failed, .cmd-state.expired, .cmd-state.escalated {
  border-color: var(--critical); background: color-mix(in srgb, var(--critical) 7%, var(--surface-1));
}
.cmd-state.failed .cs-name, .cmd-state.expired .cs-name, .cmd-state.escalated .cs-name { color: var(--critical); }
.cmd-state.cancelled { opacity: .7; }

@media (max-width: 620px) {
  .zone-card { padding: var(--s5) var(--s4); }
  .zone-facts { gap: var(--s5); }
  .incident-hero .facts { margin-left: 0; }
  .tl-row { grid-template-columns: 60px 16px 1fr; }
  .ar-state { min-width: 0; }
  .alarm-row { flex-wrap: wrap; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   THE CRAFT PASS — dashboard only. The wall panel's austerity is deliberate and
   untouched; nothing in this block is loaded by wall.html.

   Four things carry the impression, none of them effects:
     1. A real modular scale, used at its extremes. Focal numbers are genuinely large and
        labels are genuinely small; nothing in the middle tries to do both jobs.
     2. Tabular figures on every numeral in a data context, so columns align and digits do
        not jitter when the value changes on refresh.
     3. Restraint. The locked palette carries meaning only. A colour that is not a status
        or a series has no business on the screen.
     4. One focal point per screen, and everything else demoted beneath it.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Modular scale, ~1.25 through the display sizes and ~1.12 through the text sizes, on a
     4px rhythm. The gap between --fs-lead and --fs-focal is deliberate: there is nothing
     in the middle to reach for, so a focal number cannot be timidly under-sized. */
  --fs-focal: 64px;
  --fs-display: 40px;
  --fs-figure-lg: 31px;
  --fs-figure: 25px;
  --fs-title: 17px;
  --fs-lead: 15px;
  --fs-body: 13.5px;
  --fs-small: 12.5px;
  --fs-meta: 11.5px;
  --fs-micro: 10.5px;

  /* Tracking follows size: tighten as it grows, open up small caps so they stay readable. */
  --track-focal: -.035em;
  --track-display: -.025em;
  --track-figure: -.02em;
  --track-caps: .085em;
}

/* Every numeral in a data context. This one change reads as engineered more than any
   animation, and it stops a refresh from making the layout twitch. */
.num, td.num, th.num,
.tile .value, .hero .figure, .kv .v, .readout .v, .metric .m-v, .focal-number,
.zfact .v, .numfact .nf-v, .incident-hero .fact .v, .cage-hero .fact .v,
.alarm-rate .big, .cd-id, .tl-when .time, .tl-ev .evv, .m-v small {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Small caps labels: small, open, and quiet. They name a thing; they never compete with it. */
.focal-label, .m-k, .zfact .k, .kv .k, .req-k, .lh-name, .de-head,
.card-head h3, .tl-band, .nf-k {
  letter-spacing: var(--track-caps);
}
.card-head h3 { font-size: var(--fs-small); text-transform: uppercase; color: var(--text-secondary); }
.card-head .hint { letter-spacing: 0; }

/* ───────────────────────────── the focal element
   One per screen. Generous space around it and tight everywhere else — uniform padding is
   what makes a layout look generic. */
.focal {
  padding: var(--s7) var(--s6) var(--s6);
  margin-bottom: var(--s6);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.focal-label {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  color: var(--text-muted);
}
.focal-number {
  font-size: var(--fs-focal); font-weight: 680; line-height: 1;
  letter-spacing: var(--track-focal); margin: var(--s4) 0 var(--s3);
}
.focal-number small {
  font-size: var(--fs-lead); font-weight: 550; letter-spacing: 0;
  color: var(--text-secondary);
}
.focal-sub {
  font-size: var(--fs-small); color: var(--text-secondary);
  max-width: 76ch; line-height: 1.55;
}
.focal.idle .focal-number { color: var(--text-secondary); }

/* The one focal element that is a claim rather than a number. */
.focal-claim {
  display: flex; align-items: baseline; gap: var(--s4); flex-wrap: wrap;
  font-size: var(--fs-display); font-weight: 680; letter-spacing: var(--track-display);
  margin: var(--s4) 0 var(--s3);
}
.focal-claim .c-op { color: var(--axis); font-weight: 500; }
.focal-claim .c-a { color: var(--warning-text); }
.focal-claim .c-b { color: var(--serious); }
.focal-claim .c-c { color: var(--good-text); }

/* ───────────────────────────── command lifecycle board
   Four columns because there are four questions, not thirteen. Deliberately not a uniform
   grid of equal cards: the groups are different sizes because the states are. */
.life-board {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s5); margin-bottom: var(--s6);
}
.life-col { display: flex; flex-direction: column; gap: var(--s2); }
.life-head { padding-bottom: var(--s2); border-bottom: 1px solid var(--border); margin-bottom: var(--s2); }
.lh-name {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase; color: var(--text-muted);
}
.lh-why { font-size: var(--fs-meta); color: var(--text-secondary); margin-top: 3px; }
.state-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-1); padding: 10px var(--sp-3);
}
.sc-name {
  font-size: var(--fs-small); font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.sc-mean { font-size: var(--fs-meta); color: var(--text-secondary); margin-top: 2px; line-height: 1.4; }
/* Only the three that get confused for each other are coloured. The rest stay neutral,
   because colouring thirteen states would mean none of them said anything. */
.state-card.acked { border-color: color-mix(in srgb, var(--warning) 55%, var(--border)); }
.state-card.acked .sc-name { color: var(--warning-text); }
.state-card.executed { border-color: color-mix(in srgb, var(--serious) 60%, var(--border)); }
.state-card.executed .sc-name { color: var(--serious); }
.state-card.verified {
  border-color: color-mix(in srgb, var(--good) 55%, var(--border));
  background: color-mix(in srgb, var(--good) 5%, var(--surface-1));
}
.state-card.verified .sc-name { color: var(--good-text); }

.lookup { display: flex; gap: var(--s3); margin-bottom: var(--s4); }
.lookup input {
  flex: 0 1 280px; padding: 9px var(--sp-3); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface-1); color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-small);
}
.lookup input:focus { outline: none; border-color: var(--brand-mid); }

.cmd-detail {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--s5); margin-bottom: var(--s4); background: var(--surface-1);
}
.cd-top { display: flex; align-items: flex-start; gap: var(--s4); margin-bottom: var(--s4); }
.cd-id {
  font-size: var(--fs-lead); font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.cd-what { font-size: var(--fs-small); color: var(--text-secondary); margin-top: 2px; }
.cd-sub {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
  margin: var(--s5) 0 var(--s2); padding-bottom: var(--s2); border-bottom: 1px solid var(--grid);
}
.esc-row {
  display: flex; align-items: center; gap: var(--s3); margin-top: var(--s3);
  font-size: var(--fs-small); font-weight: 600; color: var(--critical);
}
.esc-row svg { width: 16px; height: 16px; flex: none; }

.policy-row {
  display: flex; align-items: center; gap: var(--s5); flex-wrap: wrap;
  padding: var(--s4) 0; border-top: 1px solid var(--grid);
}
.pr-name { font-size: var(--fs-body); font-weight: 620; }
.pr-key {
  font-size: var(--fs-meta); color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.pr-facts { display: flex; gap: var(--s6); flex-wrap: wrap; }
.numfact .nf-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase; color: var(--text-muted);
}
.numfact .nf-v { font-size: var(--fs-figure); font-weight: 650; letter-spacing: var(--track-figure); }
.numfact .nf-n { font-size: var(--fs-meta); color: var(--text-muted); }

/* ───────────────────────────── metric tiles
   Not a uniform grid: they size to their content and the ones carrying trouble are the only
   ones with a border colour. */
.metric-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(184px, 1fr));
  gap: var(--s4);
}
.metric {
  padding: var(--s4) var(--s5); border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-1);
}
.metric .m-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase; color: var(--text-muted);
}
.metric .m-v {
  font-size: var(--fs-figure-lg); font-weight: 660; line-height: 1.05;
  letter-spacing: var(--track-figure); margin-top: var(--s2);
}
.metric .m-v small { font-size: var(--fs-small); font-weight: 550; color: var(--text-secondary); letter-spacing: 0; }
.metric .m-v.absent {
  font-size: var(--fs-body); font-weight: 550; color: var(--text-muted); letter-spacing: 0;
  padding: 6px 0 5px;
}
.metric .m-n { font-size: var(--fs-meta); color: var(--text-muted); margin-top: 3px; }
.metric.good { border-color: color-mix(in srgb, var(--good) 32%, var(--border)); }
.metric.warning { border-color: color-mix(in srgb, var(--warning) 55%, var(--border)); }
.metric.warning .m-v { color: var(--warning-text); }
.metric.critical {
  border-color: var(--critical); background: color-mix(in srgb, var(--critical) 5%, var(--surface-1));
}
.metric.critical .m-v { color: var(--critical); }

.sys-node {
  display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap;
  padding: var(--s3) var(--s5); margin-bottom: var(--s5);
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-1);
  font-size: var(--fs-meta);
}
.sys-node .sn-k { color: var(--text-muted); text-transform: uppercase; letter-spacing: var(--track-caps); font-weight: 700; }
.sys-node .sn-v { font-weight: 650; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sys-node .sn-role {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  padding: 2px var(--sp-2); border-radius: 999px; background: var(--surface-sunken); color: var(--text-secondary);
}
.sys-node .spacer { flex: 1; }

.forecast-note {
  font-size: var(--fs-meta); color: var(--text-muted); margin-top: var(--s4);
  padding-top: var(--s3); border-top: 1px solid var(--grid); max-width: 84ch;
}

/* ───────────────────────────── commissioning requirements */
.req-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s4); }
.req { display: flex; gap: var(--s3); align-items: flex-start; }
.req svg { width: 16px; height: 16px; flex: none; color: var(--good); margin-top: 2px; }
.req-k { font-size: var(--fs-small); font-weight: 700; text-transform: uppercase; color: var(--text-secondary); }
.req-v { font-size: var(--fs-small); color: var(--text-secondary); margin-top: 2px; line-height: 1.45; }
.assign-holder { margin-top: var(--s4); }

/* ───────────────────────────── designed empty states
   Where a cheap product gives itself away. A headline that names what is empty, a reason,
   and the thing that would change it. */
.designed-empty {
  padding: var(--s7) var(--s6);
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-1); margin-bottom: var(--s5);
}
.de-head {
  font-size: var(--fs-lead); font-weight: 680; text-transform: none;
  letter-spacing: -.01em;
}
.de-why {
  font-size: var(--fs-small); color: var(--text-secondary);
  margin-top: var(--s3); max-width: 78ch; line-height: 1.6;
}
.de-next {
  font-size: var(--fs-small); font-weight: 620; color: var(--good-text);
  margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--grid);
}

@media (max-width: 1100px) {
  .life-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  :root { --fs-focal: 44px; --fs-display: 28px; --fs-figure-lg: 25px; }
  .life-board { grid-template-columns: 1fr; }
  .focal { padding: var(--s6) var(--s5) var(--s5); }
  .lookup { flex-direction: column; }
  .lookup input { flex: 1 1 auto; }
}

/* The focal element's supporting facts: present, tabular, and clearly subordinate. They are
   demoted by size and weight rather than hidden — a person still needs them. */
.focal-facts { display: flex; gap: var(--s6); flex-wrap: wrap; margin: 0 0 var(--s4); }
.focal-facts .ff { display: flex; align-items: baseline; gap: var(--s2); }
.focal-facts .ff-v {
  font-size: var(--fs-figure); font-weight: 650; letter-spacing: var(--track-figure);
  font-variant-numeric: tabular-nums;
}
.focal-facts .ff-l { font-size: var(--fs-small); color: var(--text-secondary); }

/* Tiles are supporting evidence under a focal number, so they get quieter: hairline, tighter,
   and a figure a step down the scale. Uniform emphasis everywhere is the template look. */
.tile .value { font-size: var(--fs-figure); letter-spacing: var(--track-figure); }
.tile .label { letter-spacing: var(--track-caps); text-transform: uppercase; font-size: var(--fs-micro); }
.tile .spark { opacity: .8; }

/* ═══════════════════════════════════════════════════════════════════════════
   LEVEL 1 — whole-farm situational awareness

   ISA-101 Level 1: everything fits one screen and nothing scrolls, because a screen
   an operator must scroll to trust is not a glance. The layout is deliberately
   asymmetric — the verdict and the exception list take the wide column, context takes
   the narrow one — since a uniform grid of equal cards is what makes a layout look
   generic and hides which panel matters.
   ═══════════════════════════════════════════════════════════════════════════ */

.content:has(.l1) { padding-bottom: 22px; }

.l1 { display: grid; gap: var(--s5); align-content: start; }


/* ── the verdict ─────────────────────────────────────────────────────────── */
.l1-verdict {
  margin: 0; padding: var(--s6) var(--s6) var(--s5);
  display: flex; flex-direction: column; gap: var(--s2);
  border-left: 3px solid var(--border);
}
.l1-verdict.watch { border-left-color: var(--warning); }
.l1-verdict.attention { border-left-color: var(--critical); }

.l1-claim {
  display: flex; align-items: baseline; gap: var(--s3);
  font-size: var(--fs-display); font-weight: 680; line-height: 1.05;
  letter-spacing: var(--track-display); color: var(--text-primary);
}
.l1-claim .n {
  font-size: var(--fs-focal); font-weight: 700; line-height: 1;
  letter-spacing: var(--track-focal);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.l1-verdict.attention .l1-claim .n { color: var(--critical); }
.l1-verdict.watch .l1-claim .n { color: var(--warning-text); }
.l1-claim svg { width: 34px; height: 34px; flex: none; align-self: center; color: var(--text-muted); }

.l1-stamp {
  display: flex; align-items: center; gap: var(--s2); margin-top: var(--s1);
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}

/* ── the exception list — the only thing on screen when the farm is fine ─── */
.l1-exceptions .card-body { padding-top: var(--s1); }

.exc-row {
  width: 100%; display: grid; align-items: center; gap: 2px var(--s4);
  /* Two lines below 1620px. Five fields on one line left the validator's reason 54px wide,
     which truncated "below the 5 lower limit" to "b …" — worse than not showing it. */
  grid-template-columns: 104px minmax(0, 1fr) auto;
  grid-template-areas: "cage status age" "what what what";
  padding: var(--s3) var(--s4) var(--s3) var(--s3);
  background: none; border: 0; border-left: 3px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: left; cursor: pointer; color: inherit; font: inherit;
}
.exc-row:last-child { border-bottom: 0; }
.exc-row.warning { border-left-color: var(--warning); }
.exc-row.critical { border-left-color: var(--critical); }
.exc-row.suspect, .exc-row.bad { border-left-color: var(--serious); }
.exc-row.not_reporting { border-left-color: var(--text-muted); }
@media (hover: hover) and (pointer: fine) {
  .exc-row:hover { background: var(--surface-2); }
}
.exc-row:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }

.exc-cage {
  font-size: var(--fs-lead); font-weight: 660; letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.exc-status { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-small); font-weight: 620; }
.exc-status svg { width: 16px; height: 16px; flex: none; }
.exc-status.warning { color: var(--warning-text); }
.exc-status.critical { color: var(--critical); }
.exc-status.suspect, .exc-status.bad { color: var(--serious); }
.exc-status.not_reporting { color: var(--text-secondary); }

.exc-what { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.exc-metric {
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: var(--track-caps);
  color: var(--text-muted); min-width: 86px;
}
.exc-v {
  font-size: var(--fs-figure); font-weight: 640; letter-spacing: var(--track-figure); line-height: 1.15;
  white-space: nowrap;                     /* or the unit wraps below the figure and doubles the row */
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
  min-width: 78px; text-align: right;
}
.exc-v small { font-size: var(--fs-small); font-weight: 600; color: var(--text-secondary); }
.exc-v.none {
  font-size: var(--fs-small); font-weight: 660; text-align: left;
  color: var(--text-secondary); letter-spacing: 0;
}
.exc-vs {
  font-size: var(--fs-small); color: var(--text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto;
}
.exc-what .env { flex: none; }
.exc-cage { grid-area: cage; }
.exc-status { grid-area: status; }
.exc-what { grid-area: what; }
.exc-row > .a { grid-area: age; justify-self: end; }

.l1-note {
  margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--border);
  font-size: var(--fs-meta); color: var(--text-secondary); line-height: 1.5;
}
/* The collapsed Attention line — the one rule app.js says is owed here. Its
   layout arrives as inline styles from the caller; the only thing missing was
   the icon's size, and an icon svg with a viewBox and no intrinsic width fills
   whatever box it is handed. Sized in ems, so it tracks the sentence it sits in. */
.farm-clear svg { width: 1.4em; height: 1.4em; flex: none; }
/* Supporting facts, not a second focal point: figure size, one short note, and the oxygen
   figure carries its envelope because a number without its bound is the defect. */
.l1-facts {
  display: grid; gap: var(--s3);
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}
/* In the top band the four sit in one row. auto-fit inside an auto-width grid column
   collapsed them into a 574px-tall stack, which swallowed the exception list. */
@media (min-width: 1180px) { .l1-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.l1-facts .metric {
  display: flex; flex-direction: column; gap: 1px;
  padding: var(--s3) var(--s4); background: var(--surface-2);
}
.l1-facts .m-v { font-size: var(--fs-figure); }
.l1-facts .m-n { font-size: var(--fs-micro); line-height: 1.35; }
.l1-facts .metric svg { margin-top: var(--s1); }
.l1-facts .m-k, .l1-facts .m-n { white-space: normal; }
.l1-facts .l1-note { grid-column: 1 / -1; margin-top: 0; }

/* ── what the automation will do ─────────────────────────────────────────── */
.auto-row { padding: var(--s4) 0; border-bottom: 1px solid var(--border); }
.auto-row:first-child { padding-top: var(--s1); }
.auto-row.off { opacity: .72; }
.auto-head { display: flex; align-items: center; gap: var(--s3); }
.auto-name { font-size: var(--fs-lead); font-weight: 640; }
.auto-will { margin-top: var(--s2); font-size: var(--fs-body); line-height: 1.5; color: var(--text-primary); }
.auto-meta {
  margin-top: var(--s2); font-size: var(--fs-meta); color: var(--text-muted);
  line-height: 1.5; font-variant-numeric: tabular-nums;
}
.auto-did { padding-top: var(--s4); }
.auto-did-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.auto-counts { display: flex; gap: var(--s5); margin-top: var(--s3); flex-wrap: wrap; }
.auto-count { display: flex; align-items: baseline; gap: var(--s2); font-size: var(--fs-small); color: var(--text-secondary); }
.auto-count .n {
  font-size: var(--fs-figure); font-weight: 660; color: var(--text-primary);
  letter-spacing: var(--track-figure);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.auto-count.warning .n { color: var(--warning-text); }
.auto-count.critical .n { color: var(--critical); }

/* ── trends ─────────────────────────────────────────────────────────────── */
.l1-trends .card { margin: 0; }
.trend-row { display: grid; gap: var(--s5); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.trend-cell { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.trend-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
/* The band is as tall as its tallest cell, and this one is prose. Held to the height of the
   two charts beside it, or the hole in the contract costs the exception list a row. */
.trend-cell .gap { margin: 0; align-items: flex-start; padding: var(--s3) var(--s4); }
.trend-cell .gap-why { font-size: var(--fs-meta); line-height: 1.45; }
.trend-cell .gap-eps code { font-size: var(--fs-micro); }

/* Wide enough for one line: the reason gets the space the second line was buying it. */
@media (min-width: 1620px) {
  .exc-row {
    grid-template-columns: 104px 116px minmax(0, 1fr) auto;
    grid-template-areas: "cage status what age";
  }
}

/* A CSS display rule outranks the UA sheet's [hidden] { display: none }, so hiding a flex
   component by setting .hidden did nothing and the range control stayed on screen. */
.segmented[hidden] { display: none; }

/* ── the level the operator is on, named in the header ───────────────────── */
.title-row { display: flex; align-items: center; gap: var(--s3); }
.lvl-chip {
  padding: 2px var(--s2); border-radius: var(--radius-xs);
  border: 1px solid var(--border); background: var(--surface-2);
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: var(--track-caps);
  text-transform: uppercase; color: var(--text-muted); white-space: nowrap;
}

/* ── the sidebar carries the same hierarchy ──────────────────────────────── */
aside nav .group.lvl { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
aside nav .group .lvl-n { font-variant-numeric: tabular-nums; opacity: .55; font-weight: 800; }
aside nav .group .lvl-name { font-weight: 700; }
aside nav .group .lvl-why {
  flex: 1 0 100%; text-transform: none; letter-spacing: 0;
  font-size: var(--fs-meta); font-weight: 500; opacity: .6;
}
aside nav a .ext {
  margin-left: auto; flex: none; font-size: var(--fs-micro); font-weight: 600;
  letter-spacing: var(--track-caps); text-transform: uppercase; opacity: .6;
}
aside nav a { white-space: nowrap; }

/* The wide layout comes AFTER the base rules: it was declared before them and the base
   .l1-verdict { display: flex } silently overrode its display: grid, so the focal block
   stacked its supporting facts instead of setting them beside the claim. */
@media (min-width: 1180px) {
  .l1 {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    grid-template-areas: "verdict verdict" "exc auto" "trends trends";
    /* The exception list is the only track allowed to grow. The other two are auto, and their
       cards flex internally so auto can resolve small when the viewport is short. */
    grid-template-rows: auto minmax(96px, 1fr) auto;
    /* --l1-top is measured by viewFarm: whatever sits above this screen, plus the padding
       below it. A guessed constant left the page scrolling 38px. */
    max-height: calc(100dvh - var(--l1-top, 124px));
  }
  .l1-verdict { grid-area: verdict; }
  .l1-exceptions { grid-area: exc; }
  .l1-automation { grid-area: auto; }
  .l1-trends { grid-area: trends; }
  /* A block card lets its body overflow the grid row instead of shrinking with it, which
     put 926px of exception rows inside a 316px row and scrolled the page. Flex, so the
     body is the part that gives. */
  .l1-exceptions, .l1-automation {
    min-height: 0; display: flex; flex-direction: column;
  }
  .l1-exceptions .card-head, .l1-automation .card-head { flex: none; }
  /* Same treatment for the trend band: a block card cannot give height back to the grid, so
     on a short viewport the page scrolled instead of the panel. */
  .l1-trendcard { display: flex; flex-direction: column; min-height: 0; }
  .l1-trendcard .card-head { flex: none; }
  .l1-trendcard .card-body { flex: 1 1 auto; min-height: 0; overflow: hidden; }
  /* Only the two list panels scroll, and only when the farm is broken enough to
     overflow them. The screen itself never does. */
  .l1-exceptions .card-body, .l1-automation .card-body {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
  }
  /* The verdict and its four supporting facts share the top band: the claim reads left, the
     facts sit beside it. Stacked below 1180px, where there is no room for both. */
  .l1-verdict {
    display: grid; gap: var(--s2) var(--s6); align-items: start;
    /* Half and half. Capping the facts column left a band of dead space between the claim
       and the facts that read as a mistake. */
    grid-template-columns: minmax(0, 1fr) minmax(400px, 1fr);
    grid-template-areas: "label facts" "claim facts" "sub facts" "stamp facts";
  }
  .l1-verdict .focal-label { grid-area: label; }
  .l1-verdict .l1-claim { grid-area: claim; }
  .l1-verdict .focal-sub { grid-area: sub; }
  .l1-verdict .l1-stamp { grid-area: stamp; }
  .l1-facts { grid-area: facts; align-self: center; }
}

/* A laptop is 150-300px shorter than the office monitor. The difference comes out of the
   focal element and the trend band, never out of the exception list. */
@media (min-width: 1180px) and (max-height: 1000px) {
  .l1-verdict { padding: var(--s4) var(--s5); gap: var(--s1) var(--s5); }
  .l1-claim { font-size: var(--fs-figure-lg); }
  .l1-claim .n { font-size: var(--fs-display); }
  .l1-claim svg { width: 28px; height: 28px; }
  .l1-facts .metric { padding: var(--s2) var(--s3); }
  .l1-trendcard .card-body { padding-top: var(--s2); padding-bottom: var(--s3); }
  /* The gap cell is prose and sets the floor for the whole band. The reason folds away to its
     tooltip; the capability, the endpoint and the blocker number never do. */
  .l1-trendcard .gap-why { display: none; }
  .l1-trendcard .gap { padding: var(--s2) var(--s3); }
}

/* The envelope object is drawn by charts.js and used by both surfaces, so it is styled here,
   in the sheet both documents load. It lived in wall.css and the dashboard rendered the band
   rect with the SVG default fill, which is black — a solid black bar where the indicator
   should be. Wall-specific sizing stays in wall.css.
   ANSI/ISA-101 report-by-exception: grey while in bounds, colour only on deviation. The band
   is the faintest thing on the tile and the limits are hairlines, because at 20px tall any
   more chrome than that is noise competing with the reading. */
.env { flex: none; display: block; overflow: visible; }
.env-band { fill: var(--text-primary); fill-opacity: .05; }
.env-limit { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.env-level { stroke: var(--text-secondary); stroke-width: 1.5; stroke-linecap: round; }
.env-trace { fill: none; stroke: var(--text-secondary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
/* A stretch the validator doubted is drawn, but not with the same authority as a good one. */
.env-trace.doubted { stroke-opacity: .42; }
.env-now { fill: var(--text-secondary); }
/* Deviation is the only thing that earns colour on this surface. */
.env.dev.warning .env-now, .env.dev.warning .env-level, .env.dev.warning .env-trace { fill: var(--warning); stroke: var(--warning); }
.env.dev.critical .env-now, .env.dev.critical .env-level, .env.dev.critical .env-trace { fill: var(--critical); stroke: var(--critical); }
.env.dev .env-now { r: 3.1; }

/* ═══════════════════════════════════════════════════════════════════════════
   ON CALL

   The one screen where the empty state is the emergency. Everywhere else in this control
   room an absent list is neutral and is styled neutral; here "no rota" means the farm is
   uncovered, so the focal element takes the critical treatment when it is empty and the
   neutral one when it is full. That inversion is deliberate and it is the point.
   ═══════════════════════════════════════════════════════════════════════════ */

.oncall { display: flex; flex-direction: column; gap: var(--s5); }

.oc-verdict { margin: 0; border-left: 3px solid var(--border); }
.oc-verdict.ok { border-left-color: var(--border); }
.oc-verdict.attention { border-left-color: var(--critical); }

.oc-claim {
  display: flex; align-items: center; gap: var(--s3);
  margin-top: var(--s2);
  font-size: var(--fs-display); font-weight: 700; line-height: 1.1;
  letter-spacing: var(--track-display);
}
.oc-claim svg { width: 36px; height: 36px; flex: none; }
.oc-verdict.attention .oc-claim { color: var(--critical); }
.oc-verdict.ok .oc-claim svg { color: var(--text-muted); }

/* What is missing, and the endpoint that fixes it. */
.oc-because {
  margin-top: var(--s5); padding-top: var(--s4);
  border-top: 1px solid var(--border);
}
.oc-because-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.oc-steps { margin: var(--s3) 0 0; padding-left: var(--s5); }
.oc-steps li {
  margin-bottom: var(--s2); font-size: var(--fs-body); line-height: 1.5;
  color: var(--text-primary);
}
.oc-steps li.done { color: var(--text-secondary); }
.oc-steps li.done::marker { content: "✓ "; }
.oc-step-t { display: block; }
.oc-steps code {
  display: inline-block; margin-top: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-meta); padding: 2px 6px; border-radius: var(--radius-xs);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary);
}
.oc-because-n {
  margin-top: var(--s3); font-size: var(--fs-meta); line-height: 1.5;
  color: var(--text-secondary); max-width: 84ch;
}

/* ── the escalation ladder ───────────────────────────────────────────────── */
.ladder { list-style: none; margin: 0; padding: 0; position: relative; }
.rung {
  position: relative; padding: var(--s3) 0 var(--s3) var(--s6);
  border-bottom: 1px solid var(--border);
}
.rung:last-child { border-bottom: 0; }
/* The connector is the causality: each rung follows from the one above it. */
.rung::before {
  content: ""; position: absolute; left: 7px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.rung:first-child::before { top: 50%; }
.rung:last-child::before { bottom: 50%; }
.rung::after {
  content: ""; position: absolute; left: 3px; top: calc(50% - 5px);
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface-1); border: 2px solid var(--text-muted);
}
.rung.window::after { border-style: dashed; border-color: var(--warning); }
.rung.secondary::after { border-color: var(--critical); }
.rung-h { font-size: var(--fs-lead); font-weight: 640; }
.rung-n {
  margin-top: 2px; font-size: var(--fs-small); line-height: 1.45;
  color: var(--text-secondary);
}

/* ── outstanding deliveries ──────────────────────────────────────────────── */
.oc-row {
  width: 100%; display: block; text-align: left;
  padding: var(--s4) var(--s4) var(--s4) var(--s3);
  background: none; border: 0; border-left: 3px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: inherit; font: inherit; cursor: pointer;
}
.oc-row:last-child { border-bottom: 0; }
.oc-row.warning { border-left-color: var(--warning); }
.oc-row.critical { border-left-color: var(--critical); }
@media (hover: hover) and (pointer: fine) {
  .oc-row:hover { background: var(--surface-2); }
}
.oc-row:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }

.oc-row-h { display: flex; align-items: center; gap: var(--s3); }
.oc-row-id {
  font-size: var(--fs-lead); font-weight: 660;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.oc-state { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-small); font-weight: 640; }
.oc-state svg { width: 16px; height: 16px; flex: none; }
.oc-state.warning { color: var(--warning-text); }
.oc-state.critical { color: var(--critical); }
.oc-row-w { margin-top: 3px; font-size: var(--fs-body); }
.oc-row-m, .oc-row-r {
  margin-top: 2px; font-size: var(--fs-meta); line-height: 1.45; color: var(--text-secondary);
}
.oc-row-r { color: var(--warning-text); }

/* ── the delivery log ────────────────────────────────────────────────────────
   Its own classes rather than the incident timeline's: that one is a three-column grid
   keyed on phase, this one is a flat chronological list, and sharing the names would mean
   each inherits half of the other's layout. */
.dlog { display: flex; flex-direction: column; }
.dlog-item {
  padding: var(--s3) var(--s4); border-left: 3px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.dlog-item:last-child { border-bottom: 0; }
.dlog-item.warning { border-left-color: var(--warning); }
.dlog-item.critical { border-left-color: var(--critical); }
.dlog-head { display: flex; align-items: center; gap: var(--s2); }
/* The icon needs a size. Without one an inline SVG takes its default 300x150 box and the
   card ends in a black blob — which is exactly what shipped into the first screenshot. */
.dlog-head svg { width: 18px; height: 18px; flex: none; color: var(--text-muted); }
.dlog-item.warning .dlog-head svg { color: var(--warning); }
.dlog-item.critical .dlog-head svg { color: var(--critical); }
.dlog-what { font-size: var(--fs-body); font-weight: 640; }
.dlog-meta { margin-top: 2px; font-size: var(--fs-meta); color: var(--text-secondary); }
.dlog-ev { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); margin-top: var(--sp-1); }
.dlog-kv { font-size: var(--fs-meta); color: var(--text-secondary); }
.dlog-kv b {
  font-weight: 700; text-transform: uppercase; letter-spacing: var(--track-caps);
  font-size: var(--fs-micro); color: var(--text-muted); margin-right: var(--sp-1);
}

/* ── contacts and rota, side by side where there is room ─────────────────── */
.oc-split { display: grid; gap: var(--s5); }
@media (min-width: 1100px) {
  .oc-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
}
.oc-split .card { margin: 0; }

.oc-person, .oc-shift {
  padding: var(--s3) 0; border-bottom: 1px solid var(--border);
}
.oc-person:last-child, .oc-shift:last-child { border-bottom: 0; }
.oc-person.off { opacity: .65; }
.oc-person-n { font-size: var(--fs-lead); font-weight: 640; }
.oc-person-d { margin-top: 2px; font-size: var(--fs-body); color: var(--text-secondary); }
.oc-person-m, .oc-shift-m, .oc-shift-r {
  margin-top: 2px; font-size: var(--fs-meta); color: var(--text-muted); line-height: 1.45;
}
.oc-shift-h { display: flex; align-items: baseline; gap: var(--s3); }
.oc-shift-w { font-size: var(--fs-lead); font-weight: 640; }
.oc-shift-s {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
/* Only the shift that is actually in effect is marked. A rota where every row looks the same
   is a rota nobody can read at 3am. */
.oc-shift.live { border-left: 3px solid var(--good); padding-left: var(--s3); }
.oc-shift.live .oc-shift-s { color: var(--good); }
.oc-shift.past { opacity: .62; }
.oc-shift-r { color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════════════════════
   ALARM RATIONALISATION (ISA-18.2)

   The expected operator action is the point of the whole record, so it is the largest thing
   in the block and it is set as a sentence. Cause and consequence sit under it as a pair —
   "because this" and "otherwise that" — which is the order a person reasons in when they
   have been woken up. The setpoint and deadband are metadata and are chips.

   No colour except the priority, and the priority is the only place a number earns a tone:
   P1 is the one that means stop what you are doing.
   ═══════════════════════════════════════════════════════════════════════════ */

.rat {
  margin: var(--s4) 0 0;
  padding: var(--s4);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.rat-head { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.rat-head > span {
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: var(--track-caps);
  padding: 2px 7px; border-radius: var(--radius-xs);
  background: var(--surface-1); border: 1px solid var(--border); color: var(--text-secondary);
}
.rat-p { font-variant-numeric: tabular-nums; }
/* Priority 1 is the only one that takes the critical colour. Colouring all four would make
   the ranking decorative, which is the failure the ranking exists to prevent. */
.rat-p.p1 { color: var(--critical); border-color: var(--critical); font-weight: 800; }
.rat-c { text-transform: uppercase; }
.rat-sp, .rat-db {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0; text-transform: none;
}

.rat-act { margin-top: var(--s3); }
.rat-act-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.rat-act-v {
  margin-top: 2px; max-width: 84ch;
  font-size: var(--fs-lead); font-weight: 620; line-height: 1.45;
  color: var(--text-primary);
}

.rat-pair { display: grid; gap: var(--s3) var(--s5); margin-top: var(--s3); }
@media (min-width: 860px) { .rat-pair { grid-template-columns: 1fr 1fr; } }
.rat-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.rat-v {
  margin-top: 2px; font-size: var(--fs-small); line-height: 1.5; color: var(--text-secondary);
}
.rat-by {
  margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--border);
  font-size: var(--fs-meta); color: var(--text-muted);
}

/* ── the other three rate figures ────────────────────────────────────────── */
.rate-facts {
  display: grid; gap: var(--s4);
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-top: var(--s4); padding-top: var(--s4);
  border-top: 1px solid var(--border);
}
.rate-fact .rf-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.rate-fact .rf-v {
  margin-top: 2px; font-size: var(--fs-figure); font-weight: 660;
  letter-spacing: var(--track-figure);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.rate-fact.bad .rf-v { color: var(--critical); }
.rate-fact .rf-n { margin-top: 2px; font-size: var(--fs-micro); color: var(--text-muted); }
.rnote.quiet { color: var(--text-muted); font-size: var(--fs-meta); }

/* ═══════════════════════════════════════════════════════════════════════════
   OXYGEN

   The one rule this stylesheet enforces above all others: a forecast does not look like a
   measurement. The measured reading at the top is solid-surfaced, full-contrast, at focal
   size. Every derived figure below sits on a hatched surface, in a card with a dashed rule
   above it, and never reaches focal size. An operator scanning the page can tell which
   numbers came from the water and which came from a model without reading a word.
   ═══════════════════════════════════════════════════════════════════════════ */

.o2 { display: flex; flex-direction: column; gap: var(--s5); }

/* ── the cage picker ─────────────────────────────────────────────────────── */
.o2-pick {
  display: grid; grid-template-columns: auto minmax(0, 320px); gap: var(--s2) var(--s3);
  align-items: center;
}
.o2-pick-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.o2-select {
  font: inherit; font-size: var(--fs-body); font-weight: 620;
  padding: var(--s2) var(--s3); min-height: 38px;
  color: var(--text-primary); background: var(--surface-1);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.o2-select:focus-visible { outline: var(--focus-ring); outline-offset: 1px; }
.o2-pick-n {
  grid-column: 1 / -1; font-size: var(--fs-meta); color: var(--text-muted);
  line-height: 1.45; max-width: 84ch;
}

/* ── the measurement ─────────────────────────────────────────────────────── */
.o2-now { margin: 0; }
.o2-claim {
  display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap;
  margin: var(--s2) 0 var(--s3);
}
.o2-claim .n {
  font-size: var(--fs-focal); font-weight: 700; line-height: 1;
  letter-spacing: var(--track-focal);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.o2-claim .n.doubted { color: var(--text-muted); }
.o2-claim .u { font-size: var(--fs-figure); font-weight: 620; color: var(--text-secondary); }
.o2-claim .env { align-self: center; }
.o2-vs { font-size: var(--fs-body); font-weight: 620; color: var(--text-secondary); }
.o2-claim.none {
  font-size: var(--fs-display); font-weight: 680; color: var(--critical);
  letter-spacing: var(--track-display);
}

/* ── demand against capacity ─────────────────────────────────────────────── */
.o2-verdict {
  font-size: var(--fs-lead); font-weight: 620; line-height: 1.5;
  max-width: 84ch; margin-bottom: var(--s4);
  padding-left: var(--s4); border-left: 3px solid var(--border);
}
.o2-verdict.bad { border-left-color: var(--critical); color: var(--critical); }
.o2-verdict.warn { border-left-color: var(--warning); color: var(--warning-text); }
.o2-verdict.unknown { border-left-color: var(--border); color: var(--text-secondary); }

.o2-iv {
  margin: var(--s3) 0 var(--s4); padding-top: var(--s3);
  border-top: 1px solid var(--border);
  font-size: var(--fs-small); line-height: 1.5; color: var(--text-secondary); max-width: 84ch;
}

/* ── every derived figure sits on a different surface ────────────────────── */
.o2-dawn, .o2-destrat, .o2-fouling {
  /* A hatch, not a tint. A tint reads as a status colour; a hatch reads as "this is not a
     direct reading" and survives greyscale and forced-colors. */
  background-image: repeating-linear-gradient(135deg,
    var(--surface-2) 0 6px, transparent 6px 12px);
  border-top: 2px dashed var(--border);
}
.o2-dawn .card-body, .o2-destrat .card-body, .o2-fouling .card-body {
  background: var(--surface-1);
  margin: var(--s3); border-radius: var(--radius-sm); border: 1px solid var(--border);
  padding: var(--s4);
}

.o2-split { display: grid; gap: var(--s5); }
@media (min-width: 1100px) { .o2-split { grid-template-columns: 1fr 1fr; } }
.o2-split .card, .o2-body > .card { margin: 0; }
.o2-body { display: flex; flex-direction: column; gap: var(--s5); }

/* The forecast figure. Deliberately smaller than the measured one at the top of the page:
   a prediction that is the biggest number on the screen will be read as a reading. */
.fc-value { display: flex; align-items: baseline; gap: 2px; }
.fc-value .n {
  font-size: var(--fs-figure-lg); font-weight: 660; letter-spacing: var(--track-figure);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
  color: var(--text-primary);
}
.fc-value .u { font-size: var(--fs-lead); font-weight: 620; color: var(--text-secondary); }

.fc-iv {
  margin-top: var(--s2); font-size: var(--fs-body); font-weight: 620;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.fc-iv.none { font-weight: 600; color: var(--warning-text); line-height: 1.45; }
.fc-read {
  margin-top: var(--s3); padding: var(--s3);
  border-radius: var(--radius-xs); background: var(--surface-2);
  font-size: var(--fs-small); line-height: 1.5; color: var(--text-primary);
}

.fc-prov {
  margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 3px;
}
.fc-prov-r { display: flex; gap: var(--s3); align-items: baseline; }
.fc-prov-k {
  flex: 0 0 108px; font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.fc-prov-v {
  font-size: var(--fs-meta); color: var(--text-secondary); line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
.fc-reason {
  margin-top: var(--s2); font-size: var(--fs-meta); line-height: 1.5;
  color: var(--text-secondary); font-style: normal;
}

/* ── model states ────────────────────────────────────────────────────────── */
.o2-state {
  display: flex; align-items: center; gap: var(--s2);
  font-size: var(--fs-lead); font-weight: 660;
}
.o2-state svg { width: 20px; height: 20px; flex: none; }
.o2-state.critical { color: var(--critical); }
.o2-state.warn { color: var(--warning-text); }
.o2-state.ok, .o2-state.unknown { color: var(--text-secondary); }
.o2-reason {
  margin-top: var(--s2); font-size: var(--fs-body); line-height: 1.5;
  color: var(--text-primary); max-width: 80ch;
}
.o2-hedge {
  margin-top: var(--s3); padding: var(--s3);
  border-left: 3px solid var(--warning); background: var(--surface-2);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  font-size: var(--fs-small); line-height: 1.5; color: var(--text-secondary);
}

/* ── what the model looked at ────────────────────────────────────────────── */
.o2-inputs { margin-top: var(--s4); }
.o2-inputs-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.o2-inputs-g {
  display: grid; gap: var(--s2) var(--s4); margin-top: var(--s2);
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.o2-input { display: flex; justify-content: space-between; gap: var(--s3); align-items: baseline;
  border-bottom: 1px solid var(--border); padding-bottom: 3px; }
.o2-input-k { font-size: var(--fs-meta); color: var(--text-muted); }
.o2-input-v {
  font-size: var(--fs-small); font-weight: 640; color: var(--text-primary);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; text-align: right;
}

/* The interval whisker and the reference marker on the demand chart. */
.iv-bar, .iv-cap { shape-rendering: crispEdges; }
.ref-line { shape-rendering: crispEdges; }

@media (prefers-contrast: more) {
  /* The hatch is the only signal separating derived from measured, so it must not be the
     thing that disappears when a reader turns contrast up. */
  .o2-dawn, .o2-destrat, .o2-fouling { background-image: none; border-top-width: 3px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SHIFT HANDOVER

   Read in a hurry, standing up, by somebody who has just arrived. So: numbered headings in a
   fixed order every time, the answer before the evidence in each section, and no section that
   can be skipped without noticing. The numbers are not decoration — they are the order of the
   five questions, and an operator who learns the order can jump straight to the one they need.
   ═══════════════════════════════════════════════════════════════════════════ */

.ho { display: flex; flex-direction: column; gap: var(--s5); }

/* ── the window ──────────────────────────────────────────────────────────── */
.ho-bar {
  display: flex; align-items: flex-start; gap: var(--s5); flex-wrap: wrap;
  padding: var(--s4); border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-1);
}
.ho-bar-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted); margin-bottom: var(--s2);
}
.ho-bar-n {
  flex: 1 1 320px; font-size: var(--fs-meta); line-height: 1.5;
  color: var(--text-secondary); max-width: 84ch;
}

/* ── the completeness check ──────────────────────────────────────────────── */
.ho-checks {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--s3);
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.ho-checkitem { display: flex; gap: var(--s2); align-items: flex-start; }
.ho-mark svg { width: 18px; height: 18px; margin-top: 1px; }
.ho-checkitem.yes .ho-mark { color: var(--text-muted); }
.ho-checkitem.no .ho-mark { color: var(--warning); }
.ho-q { font-size: var(--fs-body); font-weight: 640; }
.ho-a { font-size: var(--fs-meta); color: var(--text-secondary); margin-top: 1px; }

/* ── the numbered questions ──────────────────────────────────────────────── */
.ho-q-card { margin: 0; }
.ho-n {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  margin-right: var(--s2);
  font-size: var(--fs-small); font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: var(--surface-3, var(--surface-2)); color: var(--text-secondary);
  border: 1px solid var(--border);
}

.ho-claim {
  display: flex; align-items: center; gap: var(--s2);
  font-size: var(--fs-lead); font-weight: 640;
}
.ho-claim svg { width: 20px; height: 20px; flex: none; color: var(--text-muted); }
.ho-claim.bad { color: var(--warning-text); }
.ho-claim.bad svg { color: var(--warning); }

.ho-cages { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.ho-cage {
  display: inline-flex; align-items: baseline; gap: var(--s2);
  padding: var(--s2) var(--s3); border-radius: var(--radius-xs);
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  font: inherit; cursor: pointer; color: inherit;
}
.ho-cage.warning { border-left-color: var(--warning); }
.ho-cage.critical { border-left-color: var(--critical); }
.ho-cage.suspect, .ho-cage.bad { border-left-color: var(--serious); }
.ho-cage.not_reporting { border-left-color: var(--text-muted); }
@media (hover: hover) and (pointer: fine) { .ho-cage:hover { background: var(--surface-1); } }
.ho-cage:focus-visible { outline: var(--focus-ring); outline-offset: 1px; }
.ho-cage-n {
  font-size: var(--fs-body); font-weight: 700;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.ho-cage-s { font-size: var(--fs-meta); color: var(--text-secondary); }

.ho-note {
  margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--border);
  font-size: var(--fs-small); line-height: 1.5; color: var(--text-secondary);
}
.ho-note.bad { color: var(--critical); font-weight: 620; }

/* ── the answer rows ─────────────────────────────────────────────────────── */
.ho-list { display: flex; flex-direction: column; }
.ho-row {
  width: 100%; display: block; text-align: left;
  padding: var(--s3) var(--s3) var(--s3) var(--s4);
  border-left: 3px solid var(--border); border-bottom: 1px solid var(--border);
  background: none; color: inherit; font: inherit;
}
.ho-row:last-child { border-bottom: 0; }
button.ho-row { cursor: pointer; }
.ho-row.warning { border-left-color: var(--warning); }
.ho-row.critical { border-left-color: var(--critical); }
.ho-row.serious { border-left-color: var(--serious); }
@media (hover: hover) and (pointer: fine) { button.ho-row:hover { background: var(--surface-2); } }
button.ho-row:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }

.ho-row-h { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.ho-row-w { font-size: var(--fs-body); font-weight: 640; }
.ho-row-p {
  font-size: var(--fs-micro); font-weight: 800; letter-spacing: var(--track-caps);
  padding: 1px 5px; border-radius: var(--radius-xs);
  border: 1px solid var(--border); color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.ho-row.critical .ho-row-p { color: var(--critical); border-color: var(--critical); }
.ho-row-t {
  font-size: var(--fs-meta); font-weight: 650; color: var(--text-muted);
  white-space: nowrap;
}
/* The documented action, which is the part a person is meant to carry out. */
.ho-row-y {
  margin-top: 2px; font-size: var(--fs-small); line-height: 1.5;
  color: var(--text-secondary); max-width: 96ch;
}

/* ── the log ─────────────────────────────────────────────────────────────── */
.ho-log { margin: 0; }
.ho-ev { border-left-color: var(--border); width: 100%; text-align: left; background: none;
  font: inherit; color: inherit; }
button.ho-ev { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { button.ho-ev:hover { background: var(--surface-2); } }
button.ho-ev:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }
/* Only the two kinds a person has to notice carry a colour. Colouring six event kinds would
   make the log a rainbow and the alarm indistinguishable from the feed entry. */
.ho-ev.alarm { border-left-color: var(--warning); }
.ho-ev.mort { border-left-color: var(--serious); }

.ho-gap { margin: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   SUPPRESSION VISIBILITY

   Deliberately not styled as an empty state. An empty state says "nothing here yet"; this
   section says "nothing can be hidden from you, and here is the mechanism that guarantees it".
   Those are different claims and the second one is load-bearing.
   ═══════════════════════════════════════════════════════════════════════════ */

.sup { margin: 0 0 var(--s5); }
.sup-state {
  display: flex; align-items: center; gap: var(--s2);
  font-size: var(--fs-lead); font-weight: 640;
}
.sup-state svg { width: 20px; height: 20px; flex: none; color: var(--text-muted); }
.sup-why {
  margin-top: var(--s2); font-size: var(--fs-small); line-height: 1.55;
  color: var(--text-secondary); max-width: 84ch;
}

.sup-safety {
  margin-top: var(--s4); padding: var(--s3) var(--s4);
  border-left: 3px solid var(--critical); background: var(--surface-2);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}
.sup-safety-k { font-size: var(--fs-body); font-weight: 680; color: var(--critical); }
.sup-types { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.sup-types code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-meta); padding: 2px 6px; border-radius: var(--radius-xs);
  background: var(--surface-1); border: 1px solid var(--border); color: var(--text-secondary);
}
.sup-safety-n {
  margin-top: var(--s2); font-size: var(--fs-meta); line-height: 1.5; color: var(--text-secondary);
}

.sup-mech { margin-top: var(--s5); display: grid; gap: var(--s4); }
@media (min-width: 1000px) { .sup-mech { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sup-row { padding-top: var(--s3); border-top: 2px solid var(--border); }
.sup-row-n { font-size: var(--fs-lead); font-weight: 660; }
.sup-row-m {
  margin-top: 2px; display: flex; gap: var(--s2); flex-wrap: wrap;
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.sup-row-y {
  margin-top: var(--s2); font-size: var(--fs-small); line-height: 1.55; color: var(--text-secondary);
}
.sup .gap { margin-top: var(--s5); }

/* ═══════════════════════════════════════════════════════════════════════════
   THE WATER COLUMN

   Three treatments carrying three different claims, and the whole panel depends on a reader
   being able to tell them apart without being told twice:

     measured   solid marker, full contrast, a 2px surface ring so it survives the hatch
     inferred   135 degree hatch — a texture, not a tint, because a tint reads as a status
     no probe   a flat neutral fill with the words on it. Nothing is claimed, so nothing is
                patterned; an operator must not read "unknown" as "bracketed".

   No gradient anywhere in here. A gradient between two readings asserts a continuous field that
   two probes cannot support, and it is the single most tempting wrong answer on this screen.
   ═══════════════════════════════════════════════════════════════════════════ */

.wc { margin: 0; }
.wc-plot { margin-top: var(--s4); }

/* ── the verdict, before the drawing ─────────────────────────────────────── */
.wc-verdict {
  display: grid; gap: var(--s4);
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 900px) { .wc-verdict { grid-template-columns: 1fr; } }

.wc-strat {
  padding: var(--s3) var(--s4);
  border-left: 3px solid var(--border); background: var(--surface-2);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}
/* An inverted column is the precursor, so it is the one state here that earns a colour. */
.wc-strat.inverted { border-left-color: var(--critical); }
.wc-strat-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.wc-strat-v { display: flex; align-items: baseline; gap: 1px; margin-top: 2px; }
.wc-strat-v .n {
  font-size: var(--fs-figure-lg); font-weight: 680; letter-spacing: var(--track-figure);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.wc-strat.inverted .wc-strat-v .n { color: var(--critical); }
.wc-strat-v .u { font-size: var(--fs-lead); font-weight: 620; color: var(--text-secondary); }
.wc-strat-n { margin-top: 1px; font-size: var(--fs-micro); color: var(--text-muted); }

.wc-say {
  font-size: var(--fs-body); line-height: 1.55; color: var(--text-primary); max-width: 84ch;
}

.wc-facts {
  grid-column: 1 / -1;
  display: grid; gap: var(--s3) var(--s5); margin-top: var(--s2);
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  padding-top: var(--s3); border-top: 1px solid var(--border);
}
.wc-facts > div .k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.wc-facts > div .v {
  margin-top: 1px; font-size: var(--fs-body); font-weight: 640;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.wc-facts > div .n {
  margin-top: 1px; font-size: var(--fs-micro); color: var(--text-secondary); line-height: 1.45;
}

/* ── the drawing ─────────────────────────────────────────────────────────── */
.dp-col { fill: var(--surface-1); stroke: var(--border-strong); stroke-width: 1.5; }
.dp-grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
/* The surface is a real boundary. Zero metres is not an arbitrary axis origin. */
.dp-surface { stroke: var(--text-secondary); stroke-width: 2; shape-rendering: crispEdges; }
.dp-band { fill: var(--text-primary); fill-opacity: .04; }
.dp-limit { stroke: var(--axis); stroke-width: 1; stroke-dasharray: 3 2; shape-rendering: crispEdges; }

.dp-infer { stroke: none; }
/* The interpolation between two readings: dashed, because it is a line nobody measured. */
.dp-link {
  fill: none; stroke: var(--text-secondary); stroke-width: 2;
  stroke-dasharray: 5 4; stroke-linecap: round; stroke-linejoin: round;
}
/* No pattern and no colour: nothing is being claimed about this water. */
.dp-dark { fill: var(--surface-3, var(--surface-2)); }

.dp-ring { fill: var(--surface-1); }
.dp-dot { fill: var(--text-primary); }
.dp-dot.doubted { fill: var(--text-muted); }
.dp-dot.warning { fill: var(--warning); }
.dp-dot.critical { fill: var(--critical); }
.dp-at { stroke: var(--text-primary); stroke-width: 2; shape-rendering: crispEdges; }

.dp-val {
  font-size: var(--fs-small); font-weight: 700; fill: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.dp-depth { font-size: var(--fs-micro); fill: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ── what the three treatments mean ──────────────────────────────────────── */
.wc-legend {
  display: grid; gap: var(--s3) var(--s5); margin-top: var(--s4);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  padding-top: var(--s3); border-top: 1px solid var(--border);
}
.wc-leg { display: flex; gap: var(--s3); align-items: flex-start; }
.wc-swatch {
  flex: none; width: 26px; height: 18px; border-radius: 3px;
  border: 1px solid var(--border-strong); margin-top: 1px;
}
.wc-swatch.measured {
  background: var(--surface-1); position: relative;
}
.wc-swatch.measured::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border-radius: 50%; background: var(--text-primary);
  box-shadow: 0 0 0 2px var(--surface-1);
}
.wc-swatch.inferred {
  background-image: repeating-linear-gradient(135deg,
    var(--surface-2) 0 3px, var(--border-strong) 3px 4px, var(--surface-2) 4px 7px);
}
.wc-swatch.unknown { background: var(--surface-3, var(--surface-2)); }
.wc-leg-n { font-size: var(--fs-small); font-weight: 700; }
.wc-leg-w { font-size: var(--fs-micro); color: var(--text-secondary); line-height: 1.45; margin-top: 1px; }

/* ── the table twin, folded because the drawing is the primary ───────────── */
.wc-twin { margin-top: var(--s4); }
.wc-twin summary {
  cursor: pointer; font-size: var(--fs-small); font-weight: 640; color: var(--text-secondary);
  padding: var(--s2) 0;
}
.wc-twin summary:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.wc-twin[open] summary { margin-bottom: var(--s2); }
.wc .gap { margin-top: var(--s5); }

/* ═══════════════════════════════════════════════════════════════════════════
   THE SITE PLAN

   Big-board discipline: the canvas is a fixed region and never reflows, the side column holds
   three panels in a fixed order, and nothing re-sorts while somebody is looking at it. The
   colour budget goes entirely to state — the water is neutral, an occupied berth is neutral, and
   the only chromatic ink on the drawing is a cage outside its limits.
   ═══════════════════════════════════════════════════════════════════════════ */

.plan { display: flex; flex-direction: column; gap: var(--s5); }

.plan-pick { display: flex; align-items: flex-start; gap: var(--s5); flex-wrap: wrap; }
.plan-pick-n {
  flex: 1 1 340px; font-size: var(--fs-small); line-height: 1.5;
  color: var(--text-secondary); max-width: 84ch;
}

.plan-grid { display: grid; gap: var(--s5); }
@media (min-width: 1240px) {
  /* Fixed regions. The plan keeps the same share of the canvas at every width above this, so
     an operator's muscle memory for where a fact lives survives a window resize. */
  .plan-grid { grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); align-items: start; }
}
.plan-grid .card { margin: 0; }
.plan-side { display: flex; flex-direction: column; gap: var(--s5); }
.plan-plot { margin-top: var(--s2); }
.plan-note {
  margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--border);
  font-size: var(--fs-meta); line-height: 1.5; color: var(--text-secondary); max-width: 88ch;
}

/* ── the drawing ─────────────────────────────────────────────────────────── */
.sp-water { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.5; }
.sp-berth { fill: none; stroke: var(--grid); stroke-width: 1.5; }
.sp-berth.empty { stroke-dasharray: 3 3; }
.sp-cage { fill: var(--surface-1); stroke: var(--text-secondary); stroke-width: 1.8; }
.sp-cage.warning { stroke: var(--warning); stroke-width: 2.6; }
.sp-cage.critical { stroke: var(--critical); stroke-width: 2.6; fill: var(--critical-fill, #fdeaea); }
.sp-cage.suspect, .sp-cage.bad { stroke: var(--serious); stroke-width: 2.6; }
.sp-cage.not_reporting { stroke: var(--text-muted); stroke-dasharray: 4 3; }
.sp-cage.unknown { stroke: var(--grid); stroke-dasharray: 2 3; }
.sp-label {
  font-size: 11.5px; font-weight: 700; fill: var(--text-primary);
  font-variant-numeric: tabular-nums; pointer-events: none;
}
.sp-mark { font-size: 13px; fill: var(--grid); pointer-events: none; }
.sp-scale { stroke: var(--text-secondary); stroke-width: 1.5; shape-rendering: crispEdges; }
/* Under the cages, and the only line on the plan that carries a status colour. */
.sp-spread { stroke: var(--critical); stroke-width: 3; stroke-opacity: .32; stroke-linecap: round; }

/* ── is it spreading ─────────────────────────────────────────────────────── */
.sp-verdict {
  font-size: var(--fs-body); line-height: 1.55; max-width: 80ch;
  padding-left: var(--s4); border-left: 3px solid var(--border);
}
.sp-verdict.cluster { border-left-color: var(--critical); color: var(--critical); font-weight: 620; }
.sp-clusters { margin-top: var(--s4); display: flex; flex-direction: column; }
.sp-cluster { padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.sp-cluster:last-child { border-bottom: 0; }
.sp-cluster-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.sp-cluster.many .sp-cluster-k { color: var(--critical); }
.sp-cluster-v {
  margin-top: 1px; font-size: var(--fs-small); line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

/* ── legend ──────────────────────────────────────────────────────────────── */
.sp-legend { display: flex; flex-direction: column; gap: var(--s3); }
.sp-leg { display: flex; gap: var(--s3); align-items: flex-start; }
.sp-swatch {
  flex: none; width: 20px; height: 20px; border-radius: 50%; margin-top: 1px;
  background: var(--surface-1);
}
.sp-swatch.occupied { border: 1.8px solid var(--text-secondary); }
.sp-swatch.empty { border: 1.5px dashed var(--grid); background: none; }
.sp-swatch.critical { border: 2.6px solid var(--critical); background: var(--critical-fill, #fdeaea); }
.sp-swatch.link {
  border: 0; border-radius: 2px; height: 4px; margin-top: 9px;
  background: var(--critical); opacity: .32;
}

/* ── the cages the array could not place ─────────────────────────────────── */
.plan-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.plan-chip {
  display: inline-flex; flex-direction: column; gap: 1px;
  padding: var(--s2) var(--s3); min-width: 92px;
  background: var(--surface-1); border: 1px solid var(--border);
  border-left: 3px solid var(--border); border-radius: var(--radius-xs);
  font: inherit; text-align: left; cursor: pointer; color: inherit;
}
.plan-chip.warning { border-left-color: var(--warning); }
.plan-chip.critical { border-left-color: var(--critical); }
.plan-chip.suspect, .plan-chip.bad { border-left-color: var(--serious); }
.plan-chip.not_reporting { border-left-color: var(--text-muted); }
@media (hover: hover) and (pointer: fine) { .plan-chip:hover { background: var(--surface-2); } }
.plan-chip:focus-visible { outline: var(--focus-ring); outline-offset: 1px; }
.plan-chip-n {
  font-size: var(--fs-body); font-weight: 700;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.plan-chip-s { font-size: var(--fs-micro); color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════════════════════
   TIME TRAVEL

   Replay is a mode and the chrome says so without being read: a band across the top that is not
   the demo band and not an alarm, a permanent timestamp, and every write control gone from the
   DOM. The one thing that must never happen here is a person believing a past reading is now.

   The handle follows the pointer one-to-one. No transition on the cages recolouring either — a
   value updating is not an event that earns motion, and on a 30-cage array it would smear.
   ═══════════════════════════════════════════════════════════════════════════ */

.tt { margin: 0; }
.tt.on { border-color: var(--brand-mid); }

/* Where the night went wrong, above the handle, before it is touched. */
.tt-ribbon {
  position: relative; height: 12px; margin-bottom: var(--s2);
  background: var(--surface-2); border-radius: 3px; overflow: hidden;
}
.tt-alarm { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.tt-alarm.warning { background: var(--warning); }
.tt-alarm.critical { background: var(--critical); }

.tt-row { display: flex; align-items: center; gap: var(--s4); }
.tt-range {
  flex: 1 1 auto; min-width: 0; height: 28px; margin: 0;
  accent-color: var(--brand-mid); cursor: grab;
}
.tt-range:active { cursor: grabbing; }
.tt-range:focus-visible { outline: var(--focus-ring); outline-offset: 3px; }
.tt-live { flex: none; }

.tt-stamp {
  display: flex; align-items: baseline; gap: var(--s3); margin-top: var(--s3);
  flex-wrap: wrap;
}
.tt-word {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.tt-when {
  font-size: var(--fs-figure); font-weight: 660; letter-spacing: var(--track-figure);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.tt-behind { font-size: var(--fs-small); color: var(--text-secondary); }
.tt-note {
  margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--border);
  font-size: var(--fs-meta); line-height: 1.5; color: var(--text-secondary); max-width: 88ch;
}

/* ── the mode band ───────────────────────────────────────────────────────── */
.replay-banner {
  position: sticky; top: 0; z-index: 220;
  display: flex; align-items: center; gap: var(--s3);
  padding: 9px var(--s5);
  /* Brand chrome, deliberately: this is a statement about what you are looking at, not an alarm,
     and taking an alarm colour for it would compete with the alarm layer. */
  background: var(--brand-dark); color: #fff;
  font-size: var(--fs-small);
}
.replay-banner svg { width: 18px; height: 18px; flex: none; }
.replay-banner strong { font-weight: 800; letter-spacing: .1em; }
.replay-banner .tt-banner-when {
  font-weight: 700; font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.replay-why { opacity: .85; }
.replay-banner .btn { margin-left: auto; background: #fff; color: var(--brand-dark); border: 0; }

/* While replaying, the plan states its own mode at the drawing. */
body.replaying .plan-card { border-color: var(--brand-mid); }
body.replaying .sp-water { fill: var(--surface-3, var(--surface-2)); }

.sp-live {
  font-size: 11px; font-weight: 750; fill: var(--text-secondary);
  font-variant-numeric: tabular-nums; pointer-events: none;
}
.sp-replay-note {
  font-size: var(--fs-meta); font-weight: 650; color: var(--brand-dark);
  margin-bottom: var(--s3);
}

/* ── the live transport, stated ──────────────────────────────────────────────
   A silent fallback from a stream to a timer looks exactly like a live screen, which is the same
   lie as a stale reading rendered as current. So the mode is always on the header, and it never
   says "live" unless a socket is delivering. */
.as-of-row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.tp {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: var(--track-caps);
  text-transform: uppercase; padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-muted); cursor: help;
}
.tp i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tp.streaming { color: var(--good); border-color: var(--good); }
/* Polling is the normal condition today and is not an error, so it is neutral and legible
   rather than coloured — but it is never absent. */
.tp.polling { color: var(--text-secondary); }
.tp.offline { color: var(--critical); border-color: var(--critical); }

/* ═══════════════════════════════════════════════════════════════════════════
   OXYGEN — the hierarchy fix

   The page graded itself a marginal fail: five panels all passing, and a page that needed
   scrolling to answer anything. The problem was that every contributing fact was presented as a
   peer of every other. So there is now one verdict, a fixed row of the four signals it is built
   from, and the detail below under its own heading — reference rather than answer.
   ═══════════════════════════════════════════════════════════════════════════ */

.o2-answer { margin: 0; border-left: 3px solid var(--border); }
.o2-answer.now { border-left-color: var(--critical); }
.o2-answer.dawn, .o2-answer.capacity, .o2-answer.turnover { border-left-color: var(--warning); }
.o2-answer.unknown { border-left-color: var(--text-muted); }

.o2-vclaim {
  display: flex; align-items: center; gap: var(--s3); margin: var(--s2) 0 var(--s2);
  font-size: var(--fs-display); font-weight: 700; line-height: 1.1;
  letter-spacing: var(--track-display);
}
.o2-vclaim svg { width: 34px; height: 34px; flex: none; color: var(--text-muted); }
.o2-answer.now .o2-vclaim { color: var(--critical); }
.o2-answer.dawn .o2-vclaim, .o2-answer.capacity .o2-vclaim,
.o2-answer.turnover .o2-vclaim { color: var(--warning-text); }
.o2-answer.now .o2-vclaim svg { color: var(--critical); }
.o2-answer.dawn .o2-vclaim svg, .o2-answer.capacity .o2-vclaim svg,
.o2-answer.turnover .o2-vclaim svg { color: var(--warning); }

.o2-vwhen { display: flex; align-items: baseline; gap: var(--s2); margin-bottom: var(--s3); }
.o2-vwhen-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.o2-vwhen-v {
  font-size: var(--fs-lead); font-weight: 640;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}

/* ── the four signals, in a fixed order that never re-sorts ──────────────── */
.o2-signals {
  display: grid; gap: var(--s4);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.o2-sig {
  padding: var(--s3) var(--s4); border-radius: var(--radius-sm);
  background: var(--surface-1); border: 1px solid var(--border);
  border-left: 3px solid var(--border);
}
.o2-sig.bad { border-left-color: var(--critical); }
.o2-sig.warn { border-left-color: var(--warning); }
.o2-sig.unknown { border-left-color: var(--text-muted); }
.o2-sig-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.o2-sig-v {
  margin-top: 2px; font-size: var(--fs-figure); font-weight: 660;
  letter-spacing: var(--track-figure);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.o2-sig.bad .o2-sig-v { color: var(--critical); }
.o2-sig.warn .o2-sig-v { color: var(--warning-text); }
.o2-sig.unknown .o2-sig-v { font-size: var(--fs-lead); color: var(--text-secondary); }
.o2-sig-n { margin-top: 1px; font-size: var(--fs-micro); color: var(--text-secondary); line-height: 1.4; }
/* Which kind of thing this is. A forecast never looks like a measurement, including here. */
.o2-sig-kind {
  margin-top: var(--s2); font-size: 9.5px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted);
}
.o2-sig-kind::before { content: ""; display: inline-block; width: 14px; height: 1px;
  background: currentColor; vertical-align: middle; margin-right: 5px; }

/* ── the detail, demoted ─────────────────────────────────────────────────── */
.o2-detail { display: flex; flex-direction: column; gap: var(--s5); margin-top: var(--s6); }
.o2-detail-h {
  margin: 0; font-size: var(--fs-lead); font-weight: 700;
  letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: var(--s2); border-bottom: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTOMATION

   The most dangerous screen in the product, so the restraint is heaviest here. Autonomy is the
   only thing that earns chrome: a policy that ACTS on live water gets a filled badge and a solid
   bar down its edge, one that ASKS gets an outline and a hairline. Those two must be
   distinguishable from across a desk without reading the word, because they differ in kind and not
   in degree.

   Region order is fixed — may / about to / rules / who changed — and never reflows.
   ═══════════════════════════════════════════════════════════════════════════ */

.auto { display: flex; flex-direction: column; gap: var(--s5); }
.auto .card { margin: 0; }
.auto-note, .auto-law {
  margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--border);
  font-size: var(--fs-meta); line-height: 1.55; color: var(--text-secondary); max-width: 92ch;
}

/* ── policies: the spine ─────────────────────────────────────────────────── */
.pol { padding: var(--s4) 0; border-bottom: 1px solid var(--border); }
.pol:last-of-type { border-bottom: 0; }
.pol.off { opacity: .68; }
.pol-head { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }

/* Filled when it acts, outlined when it asks. Not a colour difference alone. */
.pol-level {
  display: inline-flex; align-items: baseline; gap: var(--s2);
  padding: 3px var(--s3); border-radius: var(--radius-xs);
  border: 1.5px solid var(--text-secondary); color: var(--text-secondary);
}
.pol-level-n { font-size: var(--fs-small); font-weight: 800; font-variant-numeric: tabular-nums; }
.pol-level-w {
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: var(--track-caps);
  text-transform: uppercase;
}
.pol-level.acts { background: var(--critical); border-color: var(--critical); color: #fff; }
.pol-level.silent { border-style: dashed; color: var(--text-muted); border-color: var(--grid); }

.pol-name { font-size: var(--fs-lead); font-weight: 660; }
.pol-says {
  margin-top: var(--s2); font-size: var(--fs-body); line-height: 1.55;
  color: var(--text-primary); max-width: 88ch;
}
/* The standing intent, on screen while the system is idle. */
.pol-will {
  margin-top: var(--s3); padding: var(--s3) var(--s4);
  background: var(--surface-2); border-left: 3px solid var(--text-secondary);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  font-size: var(--fs-body); line-height: 1.5;
}
.pol.acts .pol-will { border-left-color: var(--critical); }

.pol-gov { margin-top: var(--s3); display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.pol-gov-k, .auth-kind {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.pol-gov-r {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-meta); padding: 2px 6px; border-radius: var(--radius-xs);
  background: var(--surface-2); border: 1px solid var(--border);
}
.pol-gov-r.off { opacity: .6; text-decoration: line-through; }
.pol-gov-none { font-size: var(--fs-meta); color: var(--warning-text); font-weight: 620; }

/* ── who changed it ──────────────────────────────────────────────────────── */
.auth {
  margin-top: var(--s3); display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap;
  font-size: var(--fs-meta); color: var(--text-secondary);
}
.auth-kind.policy { color: var(--warning-text); }
.auth-kind.unknown { color: var(--critical); }
.auth-who { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.auth-v, .auth-when { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.auth-why { flex: 1 0 100%; margin-top: 2px; line-height: 1.5; max-width: 88ch; }

/* ── pending ─────────────────────────────────────────────────────────────── */
.pend {
  padding: var(--s4); border-radius: var(--radius-sm); margin-bottom: var(--s3);
  border: 1px solid var(--border); border-left: 3px solid var(--border);
  background: var(--surface-1);
}
.pend.waiting { border-left-color: var(--warning); }
.pend-head { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.pend-what { font-size: var(--fs-lead); font-weight: 640; }
.pend-until { font-size: var(--fs-meta); color: var(--warning-text); font-weight: 620; }
.pend-meta, .pend-note {
  margin-top: 3px; font-size: var(--fs-meta); color: var(--text-muted); line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.pend-why { margin-top: var(--s2); font-size: var(--fs-small); line-height: 1.5; }
.pend-acts { margin-top: var(--s4); display: flex; gap: var(--s3); }

/* ── rules ───────────────────────────────────────────────────────────────── */
.rule { padding: var(--s4) 0; border-bottom: 1px solid var(--border); }
.rule:last-child { border-bottom: 0; }
.rule.off { opacity: .68; }
/* A rule that acts on its own carries a solid bar down its edge; nothing else here does. */
.rule.acts { border-left: 3px solid var(--critical); padding-left: var(--s4); }
.rule-head { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.rule-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-body); font-weight: 640;
}
.rule-lvl {
  font-size: var(--fs-micro); font-weight: 800; letter-spacing: var(--track-caps);
  text-transform: uppercase; padding: 2px 7px; border-radius: var(--radius-xs);
  border: 1px solid var(--border); color: var(--text-secondary);
}
.rule-lvl.acts { background: var(--critical); border-color: var(--critical); color: #fff; }

.rule-says {
  margin-top: var(--s3); font-size: var(--fs-lead); line-height: 1.5;
  display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap;
}
.rule-watch, .rule-does {
  font-weight: 700; padding: 1px 6px; border-radius: var(--radius-xs);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: var(--fs-body);
}
.rule-at { font-weight: 720; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.rule-src { margin-top: var(--s2); font-size: var(--fs-micro); color: var(--text-muted); }
.rule-stats {
  display: grid; gap: var(--s3) var(--s5); margin-top: var(--s3);
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.rule-stats .k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.rule-stats .v { margin-top: 1px; font-size: var(--fs-body); font-weight: 640; }
.rule-stats .n { margin-top: 1px; font-size: var(--fs-micro); color: var(--text-secondary); }
.rule .btn { margin-top: var(--s4); }

/* ── change history ──────────────────────────────────────────────────────── */
.chg { padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.chg:last-child { border-bottom: 0; }
.chg-head { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.chg-kind {
  font-size: var(--fs-micro); font-weight: 800; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.chg-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-small); }
.chg-v { font-size: var(--fs-micro); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.chg-diffs { margin-top: var(--s2); display: flex; flex-direction: column; gap: 2px; }
.chg-diff { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; font-size: var(--fs-small); }
.chg-f {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted); min-width: 118px;
}
.chg-before { color: var(--text-muted); text-decoration: line-through; }
.chg-arrow { color: var(--text-muted); }
.chg-after { font-weight: 640; }

/* ── the sheet used by the decision and backtest flows ───────────────────── */
.sheet-hint2 {
  padding: 0 18px var(--s3); font-size: var(--fs-small); line-height: 1.5;
  color: var(--text-secondary);
}
.ffield2 { display: flex; flex-direction: column; gap: var(--sp-1); margin-top: var(--s4); }
.ffield2-k { font-size: var(--fs-small); font-weight: 700; }
.ffield2-h { font-size: var(--fs-meta); color: var(--text-secondary); line-height: 1.5; }
.finput2 {
  font: inherit; font-size: var(--fs-body); padding: var(--s3);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-1); color: var(--text-primary); resize: vertical;
}
.finput2:focus-visible { outline: var(--focus-ring); outline-offset: 1px; }
.sheet-body > .btn.primary { margin-top: var(--s4); }

/* `.sheet-body` is a two-column grid, which is right for the records forms it was written for and
   wrong for a single argument read top to bottom. The backtest sheet opts out. */
.sheet.one-col .sheet-body { display: block; }
.sheet.one-col .sheet-body > * + * { margin-top: var(--s4); }
.sheet.wide { width: min(860px, 100%); }

/* ═══════════════════════════════════════════════════════════════════════════
   BACKTEST — a configuration screen that argues back

   The threshold control is the one place on the desk surface where a gesture earns its keep: a
   range for direct manipulation, and a number field beside it because a threshold is usually a
   value somebody was told to set. Both drive one state.

   The firings use the same axis idiom as the scrubber's alarm ribbon, so the two read alike.
   ═══════════════════════════════════════════════════════════════════════════ */

.bt-what {
  font-size: var(--fs-small); line-height: 1.55; color: var(--text-secondary);
  padding-bottom: var(--s3); border-bottom: 1px solid var(--border);
}
.bt-controls { display: flex; flex-direction: column; gap: var(--s3); margin: var(--s4) 0; }
.bt-row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.bt-range {
  flex: 1 1 240px; min-width: 0; height: 28px; margin: 0; accent-color: var(--brand-mid);
  cursor: grab;
}
.bt-range:active { cursor: grabbing; }
.bt-range:focus-visible { outline: var(--focus-ring); outline-offset: 3px; }
.bt-num {
  width: 108px; font: inherit; font-size: var(--fs-figure); font-weight: 660;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
  padding: var(--s2) var(--s3); text-align: right;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-1); color: var(--text-primary);
}
.bt-num:focus-visible { outline: var(--focus-ring); outline-offset: 1px; }
.bt-uom { font-size: var(--fs-small); color: var(--text-secondary); }
.bt-cmp { font-size: var(--fs-meta); color: var(--text-muted); font-variant-numeric: tabular-nums; }

.bt-verdict {
  padding: var(--s4); border-radius: var(--radius-sm);
  border: 1px solid var(--border); border-left: 3px solid var(--border);
  background: var(--surface-2);
}
.bt-verdict.bad { border-left-color: var(--warning); }
.bt-verdict.deficient { border-left-color: var(--critical); }
.bt-headline {
  display: flex; align-items: baseline; gap: var(--s2);
  font-size: var(--fs-lead); font-weight: 640;
}
.bt-headline .n {
  font-size: var(--fs-figure-lg); font-weight: 700; letter-spacing: var(--track-figure);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.bt-verdict.bad .bt-headline .n { color: var(--warning-text); }
.bt-verdict.deficient .bt-headline .n { color: var(--critical); }
.bt-says {
  margin-top: var(--s2); font-size: var(--fs-body); line-height: 1.55; max-width: 86ch;
}
.bt-facts {
  display: grid; gap: var(--s3) var(--s5); margin-top: var(--s4);
  padding-top: var(--s3); border-top: 1px solid var(--border);
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.bt-facts .k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.bt-facts .v {
  margin-top: 1px; font-size: var(--fs-figure); font-weight: 660;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.bt-facts .n { margin-top: 1px; font-size: var(--fs-micro); color: var(--text-secondary); line-height: 1.4; }

/* ── the firings, on the scrubber's axis idiom ────────────────────────────── */
.bt-tl { margin-top: var(--s5); }
.bt-tl-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.bt-strip {
  position: relative; height: 44px; margin-top: var(--s2);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 3px;
  overflow: hidden;
}
.bt-tick {
  position: absolute; top: 6px; bottom: 6px; width: 2px;
  background: var(--text-primary); opacity: .62;
}
/* Above a few hundred firings individual ticks saturate the strip to solid black, which says
   nothing. Past that threshold the strip becomes a density: one column per time bin, height
   proportional to the count in it. Same axis, same idiom, and it never fills in. */
.bt-bin {
  position: absolute; bottom: var(--sp-1); background: var(--text-primary); opacity: .55;
  border-radius: 1px 1px 0 0;
}
.bt-bin.hot { background: var(--critical); opacity: .8; }
.bt-scale {
  position: absolute; top: 3px; right: 5px;
  font-size: 9.5px; font-weight: 700; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
/* A flood is the one thing here that takes a status colour. */
.bt-flood { position: absolute; top: 0; bottom: 0; background: var(--critical); opacity: .16; }
.bt-axis {
  display: flex; margin-top: 3px; font-size: var(--fs-micro); color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.bt-twin { margin-top: var(--s3); }
.bt-twin summary {
  cursor: pointer; font-size: var(--fs-small); font-weight: 640; color: var(--text-secondary);
  padding: var(--s2) 0;
}
.bt-twin summary:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

/* ── the caveats, in full, every time ────────────────────────────────────── */
.bt-caveats {
  margin-top: var(--s5); padding-top: var(--s3); border-top: 1px solid var(--border);
}
.bt-caveats-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.bt-list { margin: var(--s2) 0 0; padding-left: var(--s5); }
.bt-list li {
  font-size: var(--fs-small); line-height: 1.55; color: var(--text-secondary);
  margin-bottom: var(--s2); max-width: 86ch;
}
.bt-blocked, .bt-nosave {
  margin-top: var(--s3); font-size: var(--fs-meta); line-height: 1.5; color: var(--text-secondary);
  padding: var(--s3); border-radius: var(--radius-xs);
  background: var(--surface-2); border: 1px dashed var(--border);
}
.bt-nosave { font-weight: 620; }

/* ═══════════════════════════════════════════════════════════════════════════
   CERTIFICATION EVIDENCE

   Read by somebody preparing for an audit, so it is a checklist rather than a dashboard: scope,
   what is in the window, the pack, what each standard asks for. An empty section is styled as a
   finding rather than as a blank, because at audit that is exactly what it is.
   ═══════════════════════════════════════════════════════════════════════════ */

.cert { display: flex; flex-direction: column; gap: var(--s5); }
.cert .card { margin: 0; }
.cert-note, .cert-warn {
  margin-top: var(--s3); font-size: var(--fs-meta); line-height: 1.55;
  color: var(--text-secondary); max-width: 92ch;
}
.cert-warn {
  margin-top: var(--s3); padding: var(--s3); border-radius: var(--radius-xs);
  background: var(--surface-2); border-left: 3px solid var(--warning);
}

/* ── scope ───────────────────────────────────────────────────────────────── */
.cert-fields {
  display: grid; gap: var(--s4);
  grid-template-columns: minmax(0, 2fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(0, auto);
  align-items: end;
}
@media (max-width: 1100px) { .cert-fields { grid-template-columns: 1fr 1fr; } }
.cert-f { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.cert-f-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.cert-batch {
  margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--border);
  font-size: var(--fs-small); line-height: 1.55; color: var(--text-secondary); max-width: 92ch;
}

/* ── what is in the window ───────────────────────────────────────────────── */
.cert-sections {
  display: grid; gap: var(--s3);
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.cert-sec {
  padding: var(--s3) var(--s4); border-radius: var(--radius-sm);
  background: var(--surface-1); border: 1px solid var(--border);
  border-left: 3px solid var(--border);
}
/* An empty section is a finding, not a blank. */
.cert-sec.none { border-left-color: var(--warning); background: var(--surface-2); }
.cert-sec-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.cert-sec-v {
  margin-top: 2px; font-size: var(--fs-figure); font-weight: 660;
  letter-spacing: var(--track-figure);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.cert-sec.none .cert-sec-v { font-size: var(--fs-lead); color: var(--warning-text); }
.cert-sec-n { margin-top: 2px; font-size: var(--fs-micro); color: var(--text-secondary); line-height: 1.4; }

.cert-verdict {
  margin-top: var(--s4); padding-left: var(--s4);
  border-left: 3px solid var(--border);
  font-size: var(--fs-body); line-height: 1.55; max-width: 88ch;
}
.cert-verdict.gap { border-left-color: var(--warning); color: var(--warning-text); }
.cert-pre .btn.primary { margin-top: var(--s4); }

/* ── the pack ────────────────────────────────────────────────────────────── */
.cert-hash {
  padding: var(--s4); border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  margin-bottom: var(--s4);
}
.cert-hash-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.cert-hash-v {
  display: block; margin-top: var(--s2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-small); line-height: 1.5; word-break: break-all;
  color: var(--text-primary);
}
.cert-hash-n { margin-top: var(--s2); font-size: var(--fs-meta); color: var(--text-secondary); line-height: 1.5; }

.cert-claim {
  margin-top: var(--s4); padding: var(--s4);
  border-radius: var(--radius-sm); background: var(--surface-2);
  border-left: 3px solid var(--good);
}
.cert-claim.breach { border-left-color: var(--warning); }
.cert-claim-k {
  font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--text-muted);
}
.cert-claim-v {
  margin-top: 2px; font-size: var(--fs-body); font-weight: 620; line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
.cert-claim-n {
  margin-top: var(--s2); font-size: var(--fs-small); line-height: 1.55;
  color: var(--text-secondary); max-width: 88ch;
}
.cert-result .btn.primary { margin-top: var(--s4); }

/* ── the standards ───────────────────────────────────────────────────────── */
.cert-stds { display: flex; flex-direction: column; }
.cert-std-row {
  display: grid; gap: var(--s2) var(--s4); padding: var(--s3) 0;
  grid-template-columns: 68px minmax(0, 1fr) minmax(0, 1.4fr);
  border-bottom: 1px solid var(--border);
}
.cert-std-row:last-child { border-bottom: 0; }
@media (max-width: 900px) { .cert-std-row { grid-template-columns: 1fr; } }
.cert-std-n {
  font-size: var(--fs-lead); font-weight: 760; letter-spacing: var(--track-caps);
}
.cert-std-a { font-size: var(--fs-small); line-height: 1.55; }
.cert-std-h { font-size: var(--fs-small); line-height: 1.55; color: var(--text-secondary); }

/* ══════════════════════════════════════════════════════════════════════════
   THE PRODUCTION AND ECONOMICS LAYER

   Every number on these screens descends from biomass, and biomass is a hand sample
   carrying 15-25% error whose bias can exceed its own interval. So the interval is
   drawn wherever the number is, and it is drawn as INK rather than as colour: an
   interval is not a status and must not compete with one. The whole layer is
   near-monochrome by construction, which is what leaves the four status colours
   meaning something.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── a band, in words ────────────────────────────────────────────────────── */
.band {
  display: inline-flex; align-items: baseline; gap: 1px;
  font-size: var(--fs-meta); color: var(--text-secondary);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
  white-space: nowrap;
}
.band-dash { color: var(--text-muted); padding: 0 1px; }
.band.absent { color: var(--text-muted); font-style: italic; }

/* A figure and the interval it carries, as one object. The interval sits directly
   under the number rather than in a tooltip: a band behind a hover is a band nobody
   reads, and this one changes the decision. */
.bandfig { padding: var(--s4) 0; }
.bf-k {
  font-size: var(--fs-micro); letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--text-muted); font-weight: 640;
}
.bf-v {
  font-size: var(--fs-figure); font-weight: 660; letter-spacing: var(--track-figure);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
  color: var(--text-primary); margin-top: var(--s1);
}
.bf-v small { font-size: var(--fs-lead); font-weight: 620; color: var(--text-secondary); }
.bf-v.absent { font-size: var(--fs-lead); font-weight: 600; color: var(--text-muted); font-style: italic; }
.bf-band { margin-top: var(--s2); display: flex; align-items: baseline; gap: var(--s2); }
.bf-band-k {
  font-size: var(--fs-micro); letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--text-muted);
}
.bf-n { margin-top: var(--s2); font-size: var(--fs-meta); color: var(--text-secondary); }
.bf-n.warn { color: var(--warning-text); }
.bf-n.absent { color: var(--text-muted); font-style: italic; }

/* A value and its band inside a table cell. Stacked, because side by side they read as
   two columns and the eye stops pairing them. */
.cellband { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; }

/* The bias line. Bias exceeds the interval, so it gets words rather than a whisker —
   a symmetric band around a biased estimate is the most confident kind of wrong. */
.biasline {
  display: flex; align-items: flex-start; gap: var(--s2);
  margin-top: var(--s3); font-size: var(--fs-meta); color: var(--warning-text);
  line-height: 1.5;
}
.biasline svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }

/* ── one finding per row ─────────────────────────────────────────────────── */
.feedrow {
  display: grid; grid-template-columns: minmax(84px, auto) auto 1fr;
  align-items: baseline; gap: var(--s4);
  padding: var(--s3) 0; border-bottom: 1px solid var(--border);
  font-size: var(--fs-body);
}
.feedrow:last-child { border-bottom: 0; }
.fr-u { font-weight: 640; color: var(--text-primary); }
.fr-w { color: var(--text-secondary); line-height: 1.5; }
.feedrow.idle .fr-w { color: var(--text-muted); }

/* ── a note that is prose, not a value ───────────────────────────────────── */
.notecard {
  margin: var(--s5) 0; padding: var(--s5);
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
}
.nc-k {
  font-size: var(--fs-micro); letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--text-muted); font-weight: 640; margin-bottom: var(--s3);
}
.nc-b {
  font-size: var(--fs-small); line-height: 1.6; color: var(--text-secondary);
  max-width: 84ch;
}
.nc-b + .nc-b { margin-top: var(--s3); }
.nc-b.absent { color: var(--text-muted); }

/* ── derived is not measured ─────────────────────────────────────────────── */
/* Same treatment as the oxygen screen's forecast cards, and for the same reason: a
   hatch rather than a tint, because a tint reads as a status colour. Nothing in here
   reaches focal size — a prediction that is the largest number on screen gets read as
   a reading. */
.derived {
  margin: var(--s4) 0; padding: var(--s5);
  border-top: 2px dashed var(--border-strong); border-radius: var(--radius-sm);
  background-image: repeating-linear-gradient(135deg,
    var(--surface-2) 0 6px, transparent 6px 12px);
}
.dv-k {
  font-size: var(--fs-micro); letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--text-muted); font-weight: 640;
}
.dv-v {
  font-size: var(--fs-figure); font-weight: 640; letter-spacing: var(--track-figure);
  color: var(--text-primary); margin-top: var(--s2);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.dv-band {
  margin-top: var(--s2); font-size: var(--fs-small); color: var(--text-secondary);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px;
}
.dv-n { margin-top: var(--s3); font-size: var(--fs-meta); color: var(--text-secondary); }
.dv-n.absent { color: var(--text-muted); font-style: italic; }
.dv-score {
  margin-top: var(--s3); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2);
  font-size: var(--fs-meta); color: var(--text-secondary);
}

/* ── a signal, which is not a diagnosis ──────────────────────────────────── */
/* Same treatment as .derived above, and for the same reason: a health signal is an
   INFERENCE, not a reading. It first shipped with a --warning left rule, matching
   .o2-hedge. Wrong here: --warning is a reserved status token with a defined operator
   action (outside the good band, inside the warn band - reduce feed, raise aeration,
   watch), and a firing appetite signal is none of those. Dressing it in the alarm
   palette is the exact overstatement the consistent with / confidence / evidence
   wording exists to prevent. The style guide already answers this: a texture rather
   than a tint, because a tint reads as a status colour. */
.signal {
  margin: var(--s4) 0; padding: var(--s5);
  border-top: 2px dashed var(--border-strong); border-radius: var(--radius-sm);
  background-image: repeating-linear-gradient(135deg,
    var(--surface-2) 0 6px, transparent 6px 12px);
}
.sg-k {
  font-size: var(--fs-micro); letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--text-muted); font-weight: 640;
}
/* "Consistent with" is the claim, and it is the largest thing in the card, because the
   wording is the guard against reading a signal as a diagnosis. */
.sg-claim {
  font-size: var(--fs-lead); font-weight: 640; color: var(--text-primary);
  margin-top: var(--s2); line-height: 1.4;
}
.sg-b {
  margin-top: var(--s2); font-size: var(--fs-small); color: var(--text-secondary);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.sg-n { margin-top: var(--s2); font-size: var(--fs-meta); color: var(--text-muted); line-height: 1.5; }

/* ── chart footnote and loading ──────────────────────────────────────────── */
.chart-note {
  margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--border);
  font-size: var(--fs-meta); line-height: 1.6; color: var(--text-secondary); max-width: 84ch;
}
/* No spinner. A spinner claims progress it cannot observe; a sentence says what is
   happening and disappears when it has. */
.loading { padding: var(--s6) 0; font-size: var(--fs-small); color: var(--text-muted); }

@media (prefers-contrast: more) {
  /* The hatch becomes a heavier rule rather than being dropped: the "this is derived"
     signal has to survive, and a texture is the first thing a contrast mode loses. */
  .derived, .signal { background-image: none; border-top-width: 4px; border-top-style: double; }
  .band { color: var(--text-primary); }
}

/* ══════════════════════════════════════════════════════════════════════════
   WEATHER — exogenous, and drawn so it can never be mistaken for a reading.

   Every figure on the weather screen comes from outside the farm. The hatch and dashed
   rule that mark a forecast elsewhere apply here too, and NOTHING on this screen takes a
   status colour: weather never gates a decision, so painting it in the alarm palette
   would make it read as equivalent to a reading that does. The sentence is the finding
   and it carries its own weight in words and size, not in hue.
   ══════════════════════════════════════════════════════════════════════════ */

.wx-bar {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s4);
  padding-bottom: var(--s4); border-bottom: 1px solid var(--border);
}
.wx-bar-k {
  font-size: var(--fs-micro); letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--text-muted); font-weight: 640;
}
.wx-bar-v {
  font-size: var(--fs-small); color: var(--text-secondary);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}

/* The sentence. It is the answer, so it is the largest thing on the screen — and it is
   prose rather than a figure, because "tomorrow is overcast so oxygen will run lower
   tonight" is a claim a number cannot make. */
.wx-say {
  margin: var(--s5) 0; padding: var(--s5) var(--s6);
  border-left: 3px solid var(--border); border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-2);
}
/* NO STATUS COLOUR HERE, and .dim / .front are deliberately left inert.
   They first shipped as --warning and --serious, which was wrong twice over. --serious
   means "the instrument cannot be trusted; inspect or recalibrate the device", and a
   weather front is not that. --warning means "outside the good band; reduce feed, raise
   aeration, watch" - and weather has no band and NEVER GATES A DECISION, which is the
   architectural rule this whole feature is built around. Painting it in the alarm palette
   makes it read as equivalent to the oxygen screen's genuine warnings, and one of the two
   is explicitly non-actionable.
   The concern is carried by the words: the heading already reads "A front is coming" /
   "Less light coming" / "Nothing in the sky to act on". Anyone wanting to mark severity
   here should sharpen the sentence, not reach for the palette. */
.wx-say-k {
  font-size: var(--fs-micro); letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--text-muted); font-weight: 640;
}
.wx-say-b {
  margin-top: var(--s3); font-size: var(--fs-lead); line-height: 1.5;
  color: var(--text-primary); max-width: 72ch;
}
.wx-say-n {
  margin-top: var(--s3); font-size: var(--fs-meta); line-height: 1.55;
  color: var(--text-secondary); max-width: 84ch;
}

/* Current conditions. Deliberately small: they are context for the sentence, not the
   point of the screen, and a big number here would compete with it. */
.wx-now {
  margin-top: var(--s5); display: grid; gap: var(--s4);
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}
.wx-cell-k {
  font-size: var(--fs-micro); letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--text-muted); font-weight: 640;
}
.wx-cell-v {
  margin-top: var(--s1); font-size: var(--fs-figure); font-weight: 640;
  letter-spacing: var(--track-figure); color: var(--text-primary);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.wx-cell-v small { font-size: var(--fs-small); font-weight: 620; color: var(--text-secondary); }
.wx-cell-v.absent { color: var(--text-muted); font-weight: 600; }

.wx-credit {
  margin: var(--s5) 0 0; font-size: var(--fs-meta); color: var(--text-muted);
}

/* The strip, for screens that are about the farm. One line, and it disappears entirely
   rather than sitting there empty when the feed has nothing to say. */
.wx-strip {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s3);
  margin: var(--s5) 0 0; padding: var(--s4) var(--s5);
  border-top: 2px dashed var(--border-strong);
  background-image: repeating-linear-gradient(135deg,
    var(--surface-2) 0 6px, transparent 6px 12px);
  border-radius: var(--radius-sm);
}
.wx-strip-k {
  font-size: var(--fs-micro); letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--text-muted); font-weight: 640; flex: none;
}
.wx-strip-b { font-size: var(--fs-small); line-height: 1.5; color: var(--text-primary); flex: 1 1 320px; }
.wx-strip-n { font-size: var(--fs-meta); color: var(--text-muted); }
.wx-strip.quiet .wx-strip-b { color: var(--text-muted); }
/* .wx-strip.calm / .dim / .front carry no colour, for the same reason .wx-say does not.
   The strip states the concern in words and links to the screen that explains it. */
.wx-strip-more { font-size: var(--fs-meta); color: var(--brand-mid); text-decoration: none; flex: none; }
.wx-strip-more:hover { text-decoration: underline; }

@media (prefers-contrast: more) {
  .wx-strip { background-image: none; border-top-width: 4px; border-top-style: double; }
}


/* ── weather round 2 ──────────────────────────────────────────────────────
   No alarm colours anywhere below. Intensity is a neutral ramp; the severity is
   carried by the words, exactly as in the round-1 sentence block above. A
   forecast painted in --warning would read as equivalent to a probe reading, and
   only one of the two can be acted on. */
.wx-nights {
  margin-top: var(--s5); display: grid; gap: var(--s4);
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.wx-night {
  padding: var(--s4) var(--s5); border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface-2);
}
.wx-night.up { border-left-width: 3px; }
.wx-night.peak { border-left-width: 3px; background: var(--surface-3, var(--surface-2)); }
.wx-night-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.wx-night-d {
  font-size: var(--fs-micro); letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--text-muted); font-weight: 640;
}
.wx-night-s { margin-top: var(--s2); display: flex; align-items: baseline; gap: var(--s2); }
.wx-night-n {
  font-size: var(--fs-figure); font-weight: 640; letter-spacing: var(--track-figure);
  color: var(--text-primary); font-variant-numeric: tabular-nums;
}
.wx-night-o { font-size: var(--fs-small); color: var(--text-muted); }
.wx-night-l { margin-top: var(--s1); font-size: var(--fs-meta); color: var(--text-secondary); }
.wx-night-w {
  margin-top: var(--s3); font-size: var(--fs-meta); line-height: 1.5;
  color: var(--text-secondary);
}
.wx-drvs { margin-top: var(--s4); display: grid; gap: var(--s2); }
.wx-drv { display: grid; grid-template-columns: 8.5em 1fr 2.4em; align-items: center; gap: var(--s3); }
.wx-drv-k { font-size: var(--fs-micro); color: var(--text-muted); }
.wx-drv-t { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.wx-drv-f { height: 100%; background: var(--text-secondary); }
.wx-drv-v {
  font-size: var(--fs-micro); color: var(--text-secondary); text-align: right;
  font-variant-numeric: tabular-nums;
}

.wx-jobs {
  margin-top: var(--s4); display: grid; gap: var(--s4);
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.wx-job {
  padding: var(--s4) var(--s5); border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface-2);
}
.wx-job.shut { opacity: 0.72; }
.wx-job-k {
  font-size: var(--fs-micro); letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--text-muted); font-weight: 640;
}
.wx-job-v {
  margin-top: var(--s2); font-size: var(--fs-lead); font-weight: 620;
  color: var(--text-primary); font-variant-numeric: tabular-nums;
}
.wx-job-v.absent { color: var(--text-muted); font-weight: 600; }
.wx-job-n { margin-top: var(--s2); font-size: var(--fs-meta); color: var(--text-secondary); }
.wx-job-c { margin-top: var(--s3); font-size: var(--fs-micro); color: var(--text-muted); }

/* ── certification readiness ─────────────────────────────────────────────── */
.cert-sum {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--s4); padding-bottom: var(--s4); border-bottom: 1px solid var(--border);
}
.cert-fig { display: flex; align-items: baseline; gap: var(--s3); }
.cert-fig-n {
  font-size: var(--fs-figure); font-weight: 640; letter-spacing: var(--track-figure);
  color: var(--text-primary); font-variant-numeric: tabular-nums;
}
.cert-fig-o { font-size: var(--fs-meta); color: var(--text-secondary); }
.cert-counts { display: flex; flex-wrap: wrap; gap: var(--s2); }
.cert-sub {
  margin: var(--s5) 0 var(--s3); font-size: var(--fs-micro); font-weight: 640;
  letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-muted);
}


/* ── trace exercise ───────────────────────────────────────────────────────
   Status colour IS used on this screen, unlike the weather ones: an expired
   permit or an untraceable feed lot is an operational state with an owner and an
   action, not a forecast. */
.trace-bar { display: flex; gap: var(--s3); margin: var(--s4) 0; flex-wrap: wrap; }
.trace-bar input {
  flex: 1 1 16rem; min-width: 0; padding: var(--s3) var(--s4);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text-primary); font: inherit;
  font-variant-numeric: tabular-nums;
}
.trace-bar input:focus-visible { outline: 2px solid var(--focus, var(--text-secondary)); outline-offset: 1px; }
.trace-bar button {
  padding: var(--s3) var(--s5); border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface-2);
  color: var(--text-primary); font: inherit; font-weight: 620; cursor: pointer;
}
.trace-bar button:hover { background: var(--surface-3, var(--surface-2)); }
.trace-out { margin-top: var(--s4); }

/* A reading that cannot resolve its own threshold. Not an error state — the instrument is
   working and is being honest about its limits — so it takes the serious hue rather than
   the critical one, and it is never green. */
.unres {
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--serious); border: 1px solid var(--serious); border-radius: 999px;
  padding: 1px 6px; white-space: nowrap; margin-left: var(--s2);
}
/* Depth is not a footnote: it decides whether an oxygen reading means anything at all. */
.o2-depth {
  font-size: var(--fs-meta); font-weight: 650; color: var(--text-secondary);
  margin-left: var(--s3); white-space: nowrap;
}

/* An uninstrumented cage on the exception list: calm, legible, never a warning colour. It
   is on the list because it is unmeasured, not because it is wrong. */
.exc-status.not_instrumented { color: var(--text-muted); }

/* "computed" is provenance, not severity: grey, so it explains the number without competing
   with the threshold word beside it. */
.unres.derived { color: var(--text-secondary); border-color: var(--border-strong); }

/* Provenance, set small and grey beside the metric name. It is not a warning; it is the
   answer to "where did this number come from", which for half of this card is not a probe. */
.wq .from {
  margin-left: 6px; font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 0 5px;
}
.wq .wq-band {
  margin: -2px 0 var(--sp-1); padding-left: 18px;
  font-size: 11.5px; color: var(--text-secondary); font-variant-numeric: tabular-nums;
}

/* ── v4 · the pictorial marks ──────────────────────────────────────────────────────────
   Layout only. The drawing comes from marks.geometry.js and the colours from the text
   tokens already defined above — §31: one set of tokens, not a second for the dashboard. */

.mark-row { display: flex; flex-direction: column; gap: 3px; }
.mark-row-marks { display: flex; align-items: flex-end; gap: 3px; }
.mark-row-times { font-size: var(--fs-meta); color: var(--text-secondary); margin-left: var(--sp-1); }
.mark-row-value { font-size: var(--fs-meta); color: var(--text-primary); margin-left: auto; }
.mark-row-unit { font-size: var(--fs-micro); color: var(--text-muted); }
.mark-row-absent { font-size: var(--fs-meta); color: var(--text-secondary); }

/* The reference sheet. Every mark at every size, plus the datum drawn over the marks that
   claim to touch it — the fastest way to catch a horizon that drifted. */
.mark-sheet { display: flex; flex-direction: column; gap: 22px; }
.mark-sheet-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.mark-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 78px; }
.mark-cell-name { font-size: var(--fs-micro); color: var(--text-muted); }
.mark-waterline-proof { position: relative; display: flex; flex-wrap: wrap; gap: 10px; }
.mark-waterline-rule {
  position: absolute; left: 0; right: 0; height: 1px;
  background: var(--warning, #8F6400); opacity: 0.9; pointer-events: none;
}
.mark-16-strip { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* A mark used as a widget face sits above its figure, not beside a label (§34). */
.mark-face { display: flex; align-items: center; gap: 10px; }
.mark-face-fig { display: flex; flex-direction: column; gap: 1px; }

/* Greyscale audit: applied by the verification renderer to prove no state depends on hue. */
.grayscale-audit, .grayscale-audit * { filter: grayscale(1) !important; }

/* §30: a card that owns a domain wears its mark. Sized to the h3 it precedes,
   never larger — the drawing introduces the card, it does not compete with it. */
.card-head .card-mark { flex:0 0 auto; margin-right:var(--sp-2); opacity:.85 }

/* ── v6 · the command console, level indicators ────────────────────────────────────────
   Layout only. Shapes come from the shared geometry; colours from the text tokens already
   defined above — §31: one set of tokens, never a second for the dashboard. */

/* the state track (§50). The rail is a row of nodes; the filled ones are behind the dot. */
.ctrack { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 14px; }
.ctrack-rail { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; }
.ctrack-node { flex: 1 0 auto; min-width: 62px; display: flex; flex-direction: column;
  align-items: center; gap: 3px; position: relative; }
.ctrack-node::before { content: ''; position: absolute; top: 5px; left: 0; right: 50%;
  height: 1.6px; background: var(--border); }
.ctrack-node::after { content: ''; position: absolute; top: 5px; left: 50%; right: 0;
  height: 1.6px; background: var(--border); }
.ctrack-node:first-child::before, .ctrack-node:last-child::after { display: none; }
.ctrack-node.past::before, .ctrack-node.past::after,
.ctrack-node.here::before { background: var(--text-secondary); }
.ctn-dot { width: 11px; height: 11px; border-radius: 50%; border: 1.8px solid var(--border);
  background: var(--card, #101A30); position: relative; z-index: 1; }
.ctrack-node.past .ctn-dot { border-color: var(--text-secondary); background: var(--text-secondary); }
/* THE DOT: where this command actually is. Larger, so the eye lands on it first. */
.ctrack-node.here .ctn-dot { width: 15px; height: 15px; border-color: var(--text-primary);
  background: var(--text-primary); margin-top: -2px; }
/* verified is the ONLY terminal drawn as success — a double ring, earned, not given. */
.ctrack-node.success .ctn-dot { border-width: 1.8px; border-color: var(--text-secondary);
  box-shadow: 0 0 0 2.4px var(--card, #101A30), 0 0 0 4px var(--text-muted); }
.ctrack-node.success.here .ctn-dot { border-color: var(--good, #0A8A0A);
  background: var(--good, #0A8A0A);
  box-shadow: 0 0 0 2.4px var(--card, #101A30), 0 0 0 4px var(--good, #0A8A0A); }
.ctn-name { font-size: var(--fs-micro); color: var(--text-muted); text-align: center;
  line-height: 1.15; }
.ctrack-node.here .ctn-name { color: var(--text-primary); font-weight: 600; }
.ctn-gloss { font-size: var(--fs-micro); color: var(--text-secondary); text-align: center;
  font-style: italic; line-height: 1.1; }
/* exits drop BELOW the track — they are exits, not progress (§50) */
.ctrack-exit { display: flex; align-items: center; gap: var(--sp-2); margin-left: var(--sp-1);
  padding-top: var(--sp-1); }
.ctx-name { font-size: var(--fs-meta); color: var(--text-primary); font-weight: 600; }
.ctx-why { font-size: var(--fs-micro); color: var(--text-muted); }
.ctrack-note { font-size: var(--fs-micro); color: var(--text-secondary); }

/* the machinery list (§51) */
.act-summary { font-size: var(--fs-meta); color: var(--text-primary); margin-bottom: 10px; }
.act-row { border: 1px solid var(--border); border-radius: 10px; padding: var(--sp-3) 14px;
  margin-bottom: 10px; display: flex; flex-direction: column; gap: 10px; }
.act-row.planned { opacity: 0.72; }
.act-head { display: flex; align-items: center; gap: 10px; }
.act-ident { display: flex; flex-direction: column; gap: 1px; }
.act-kind { font-size: var(--fs-body); color: var(--text-primary); text-transform: capitalize; }
.act-where { font-size: var(--fs-micro); color: var(--text-secondary); }
.act-id { font-size: var(--fs-micro); color: var(--text-muted); }
.act-planned { font-size: var(--fs-micro); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 99px; padding: 2px var(--sp-2); }
/* FOUR GATES, FIXED POSITIONS, always all four */
.act-gates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); }
.act-gate { display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; }
.ag-label { font-size: var(--fs-micro); color: var(--text-secondary); }
.ag-verdict { font-size: var(--fs-micro); color: var(--text-muted); }
.act-gate.pass .ag-verdict { color: var(--text-primary); }
.act-controls { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.act-trigger[disabled] { opacity: 0.45; cursor: not-allowed; }
.act-blocked { display: flex; align-items: center; gap: 6px; font-size: var(--fs-micro);
  color: var(--text-secondary); }
.act-startonly { font-size: var(--fs-micro); color: var(--text-muted); }
.act-out:empty { display: none; }
.act-result { font-size: var(--fs-micro); color: var(--text-secondary); padding-top: var(--sp-1); }

/* level bar and band marker (§52) */
.lbar, .bmk { display: flex; flex-direction: column; gap: 3px; margin: var(--sp-2) 0; }
.lbar-head, .bmk-head { display: flex; align-items: baseline; gap: var(--sp-2); }
.lbar-label, .bmk-label { font-size: var(--fs-micro); color: var(--text-secondary); }
.lbar-value, .bmk-value { font-size: var(--fs-meta); color: var(--text-primary);
  margin-left: auto; font-variant-numeric: tabular-nums; }
.lbar-note, .bmk-note { font-size: var(--fs-micro); color: var(--text-secondary); }
.bmk-edge-label, .bmk-domain-label { font-size: 8.5px; fill: var(--text-muted); }

/* v6 §53 — the rundown row: mark · label · value · state shape, in FIXED columns.
   grid-template-columns is the whole design: 20px of mark, a label that may wrap, a
   right-aligned tabular figure, 15px of shape. Nothing moves when a metric is absent,
   which is what makes the shape column scannable down a card and across a grid. */
.wq .rundown {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) 78px 15px;
  align-items: center; gap: var(--sp-2); padding: 3px 0; font-size: 13px;
}
.wq .rundown .k { color: var(--text-secondary); min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.wq .rundown .v { font-weight: 620; font-variant-numeric: tabular-nums; text-align: right; }
.wq .rundown .s { display: inline-flex; align-items: center; justify-content: center; }
/* An absent metric keeps its row and its columns; only the ink drops. */
.wq .rundown.absent { opacity: .58; }
.wq .rundown.absent .v { font-weight: 500; color: var(--text-muted); }
.wq.aged .rundown .v { color: var(--text-secondary); font-weight: 550; }

/* The band markers sit at card width and are allowed to scroll rather than shrink —
   rescaling a fixed domain is the exact failure §52 exists to stop. */
.band-stack {
  display: flex; flex-direction: column; gap: 2px; margin-top: 10px;
  padding-top: var(--sp-2); border-top: 1px solid var(--border); overflow-x: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   v7 §57 — THE POLL LEDGER

   `grid-template-columns` is the design. §42: "DO, then temperature, then pH, always, in
   the same pixel positions." The three metric columns are equal fractions and the two
   ends are fixed, so a faulted metric keeps its slot and the ⊘ column reads as one
   unbroken vertical stripe. Nothing here may become `auto`.
   ═══════════════════════════════════════════════════════════════════════════ */
.plg { display: flex; flex-direction: column; gap: var(--s3); }

/* ── tone: the one colour job on this board. Never colour alone: every dot carries its word. ── */
.plg-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none;
  box-shadow: 0 0 0 2px var(--surface-1);
}
.plg-dot.good { background: var(--good); }
.plg-dot.warn { background: var(--warning, var(--serious)); }
.plg-dot.bad { background: var(--critical); }
.plg-dot.off { background: transparent; border: 1.5px dashed var(--text-muted); box-shadow: none; }

.plg-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px;
  font-size: var(--fs-micro); line-height: 1.5; color: var(--text-secondary);
  background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.plg-chip.mono { font-family: var(--mono, ui-monospace, monospace); font-size: 10.5px; }
.plg-chip.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.plg-chip.warn { color: var(--warning-text, var(--serious)); border-color: color-mix(in srgb, var(--warning, var(--serious)) 55%, transparent); font-weight: 620; }
.plg-chip.bad { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 55%, transparent); font-weight: 620; }
.plg-chip.off { color: var(--text-muted); border-style: dashed; }
.plg-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ── the tiles ───────────────────────────────────────────────────────────────────────── */
.plg-top { display: flex; flex-direction: column; gap: var(--s3); }
.plg-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.plg-tile {
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
  padding: var(--s3) var(--s4); border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
/* Tone lives in the dot, the word chip and the bar marker — never in a coloured card edge. */
.plg-tile-h { display: flex; align-items: center; gap: 6px; font-size: var(--fs-micro); color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; }
.plg-tile-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plg-tile-v { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.plg-tile-v .plg-dot { align-self: center; }
.plg-tile-v .num { font-size: 28px; font-weight: 700; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.plg-tile-v .num.muted, .plg-v.muted, .plg-d-v.muted { color: var(--text-muted); font-weight: 500; }
.plg-tile-v .uom { font-size: var(--fs-small); color: var(--text-secondary); }
.plg-tile-f { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-micro); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.plg-age-word.stale { color: var(--warning-text, var(--serious)); }

/* level bar: axis = the chart's fixed domain; zones = tolerated (light) and comfort (stronger) */
.plg-lvl { display: block; width: 100%; height: 8px; overflow: visible; }
.plg-lvl .track { fill: var(--grid); }
.plg-lvl .warnzone { fill: color-mix(in srgb, var(--warning, var(--serious)) 28%, transparent); }
.plg-lvl .goodzone { fill: color-mix(in srgb, var(--good) 38%, transparent); }
.plg-lvl .interval { fill: color-mix(in srgb, currentColor 22%, transparent); }
.plg-lvl .interval.good { fill: color-mix(in srgb, var(--good) 28%, transparent); }
.plg-lvl .interval.warn { fill: color-mix(in srgb, var(--warning, var(--serious)) 30%, transparent); }
.plg-lvl .interval.bad { fill: color-mix(in srgb, var(--critical) 30%, transparent); }
.plg-lvl .marker rect, .plg-lvl .marker path { fill: var(--text-primary); }
.plg-lvl .marker.good rect, .plg-lvl .marker.good path { fill: var(--good); }
.plg-lvl .marker.warn rect, .plg-lvl .marker.warn path { fill: var(--warning, var(--serious)); }
.plg-lvl .marker.bad rect, .plg-lvl .marker.bad path { fill: var(--critical); }

/* sparkline: fixed axis, gaps drawn, newest point ringed */
.plg-spark { display: block; width: 100%; height: 30px; }
.plg-spark .line { stroke: var(--text-secondary); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.plg-spark .gap { fill: color-mix(in srgb, var(--text-muted) 35%, transparent); }
.plg-spark .last { fill: var(--text-primary); stroke: var(--surface-2); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.plg-spark .last.good { fill: var(--good); }
.plg-spark .last.warn { fill: var(--warning, var(--serious)); }
.plg-spark .last.bad { fill: var(--critical); }

/* ── the days ────────────────────────────────────────────────────────────────────────── */
.plg-days { display: flex; flex-direction: column; gap: var(--s2); }
.plg-day { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-1); overflow: hidden; }
.plg-day-h {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; list-style: none;
  padding: 9px var(--s3); font-size: var(--fs-small); color: var(--text-primary); user-select: none;
}
.plg-day-h::-webkit-details-marker { display: none; }
.plg-day-h:hover { background: var(--surface-2); }
.plg-chev { width: 0; height: 0; border-left: 6px solid var(--text-secondary); border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; transition: transform .15s ease; flex: none; }
.plg-day[open] .plg-chev { transform: rotate(90deg); }
.plg-day-name { font-weight: 700; }
.plg-day-span { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.plg-day-mini { display: inline-flex; gap: 12px; margin-left: auto; flex-wrap: wrap; }
.plg-mini { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-micro); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.plg-mini-r { font-weight: 620; color: var(--text-primary); }
.plg-mini-r.muted { color: var(--text-muted); font-weight: 500; }
.plg-mini-f { color: var(--text-muted); }
.plg-day[open] .plg-day-h { border-bottom: 1px solid var(--border); }

/* ── the rows ────────────────────────────────────────────────────────────────────────── */
.plg-table { display: flex; flex-direction: column; }
.plg-row {
  display: grid;
  grid-template-columns: 64px repeat(3, minmax(0, 1fr)) 64px;
  align-items: center; gap: var(--s3);
  padding: 7px var(--s3); width: 100%;
  border: 0; border-bottom: 1px solid var(--grid); border-radius: 0;
  background: none; color: inherit; font: inherit; text-align: left;
}
button.plg-row { cursor: pointer; }
button.plg-row:hover, button.plg-row.open { background: var(--surface-2); }
.plg-table > .plg-row:last-of-type { border-bottom: 0; }
.plg-head {
  border-bottom: 1px solid var(--border-strong);
  font-size: var(--fs-micro); color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em; padding-top: 5px; padding-bottom: 5px;
}
.plg-head .plg-cell { gap: 5px; }
.plg-colname { font-weight: 700; }
.plg-when { font-size: var(--fs-meta); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.plg-age { font-size: var(--fs-micro); color: var(--text-muted); font-variant-numeric: tabular-nums; text-align: right; }
.plg-cell { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.plg-v { font-variant-numeric: tabular-nums; font-weight: 640; }
.plg-cell.tone-bad .plg-v { color: var(--critical); }
.plg-cell.tone-warn .plg-v { color: var(--warning-text, var(--serious)); }
.plg-uom { color: var(--text-muted); font-size: var(--fs-micro); }
/* A faulted or absent metric keeps every pixel of its slot; only the ink drops. */
.plg-silent .plg-v, .plg-none .plg-v { color: var(--text-muted); font-weight: 500; }
.plg-none { opacity: .62; }
/* A poll that produced no reading at all is compact but still a row: the gateway reported,
   and everything it had to say was an error. */
.plg-row.readingless { padding-top: 3px; padding-bottom: 3px; background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.plg-row.readingless .plg-when { font-size: var(--fs-micro); }
/* The gateway heartbeat: one thin line across the three metric slots. */
.plg-row.report { padding-top: 3px; padding-bottom: 3px; }
.plg-row.report .plg-when { font-size: var(--fs-micro); color: var(--text-muted); }
.plg-rep { grid-column: 2 / span 3; display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: var(--fs-micro); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.plg-rep-k { text-transform: uppercase; letter-spacing: .05em; }
.plg-rep-v { color: var(--text-secondary); }
.plg-d-report { grid-column: 1 / -1; }

/* ── the detail, opened in place so the board never jumps (§42) ─────────────────────── */
.plg-holder:empty { display: none; }
.plg-detail {
  padding: var(--s3) var(--s3) var(--s4); margin: 0 0 var(--s2);
  background: var(--surface-2); border-left: 2px solid var(--border-strong);
  display: flex; flex-direction: column; gap: var(--s3);
}
.plg-d-ident { display: flex; flex-wrap: wrap; gap: 6px; }
.plg-d-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.plg-d-card {
  display: flex; flex-direction: column; gap: 7px; min-width: 0;
  padding: var(--s3); border-radius: var(--radius-sm); background: var(--surface-1);
  border: 1px solid var(--border);
}
.plg-d-h { display: flex; align-items: baseline; gap: 7px; font-size: var(--fs-small); flex-wrap: wrap; }
.plg-d-h .plg-dot { align-self: center; }
.plg-d-v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; margin-left: auto; }
.plg-d-uom { color: var(--text-secondary); font-size: var(--fs-micro); }
.plg-d-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.plg-d-int { display: flex; flex-direction: column; gap: 3px; }
.plg-d-int-t { font-size: var(--fs-micro); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.plg-d-why { font-size: var(--fs-micro); color: var(--text-secondary); line-height: 1.45; }
.plg-d-topic { font-family: var(--mono, ui-monospace, monospace); font-size: 10px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plg-d-rawbox summary { font-size: var(--fs-micro); color: var(--text-muted); cursor: pointer; }
.plg-d-raw {
  font-family: var(--mono, ui-monospace, monospace); font-size: 10.5px;
  color: var(--text-secondary); background: var(--surface-2);
  padding: 6px var(--sp-2); border-radius: var(--radius-sm);
  overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 4px 0 0;
}

@media (max-width: 860px) {
  .plg-tiles, .plg-d-grid { grid-template-columns: 1fr; }
  .plg-day-mini { margin-left: 0; width: 100%; }
}
@media (max-width: 720px) {
  /* The columns stay; the ends shrink. Dropping a column would destroy the scan. */
  .plg-row { grid-template-columns: 50px repeat(3, minmax(0, 1fr)) 0; gap: var(--s2); }
  .plg-age { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   v7 §58/§59 — the device surface's bars and band markers
   ═══════════════════════════════════════════════════════════════════════════ */
.dev-bar, .dev-band {
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--s3) 0; border-bottom: 1px solid var(--grid);
}
.dev-bar:last-of-type, .dev-band:last-of-type { border-bottom: 0; }
.dev-bar-k {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-small); color: var(--text-primary);
}
.dev-bar-id {
  font-size: var(--fs-micro); color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.dev-bar-field {
  font-family: var(--mono, ui-monospace, monospace); font-size: 10.5px;
  color: var(--text-muted); background: var(--surface-2);
  padding: 1px 5px; border-radius: 4px;
}
.dev-bar-why {
  font-size: var(--fs-micro); color: var(--text-secondary);
  max-width: 74ch; line-height: 1.5;
}
/* Overdue is the second lap; the row says so in words as well, because the lap is a
   drawing and a drawing is not a sentence. */
.dev-bar.overdue .dev-bar-why { color: var(--warning-text); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════════
   v8 §62/§63 — the live-readings lead and the bench caveat
   ═══════════════════════════════════════════════════════════════════════════ */
.section-title { font-size: var(--fs-lead); font-weight: 680; margin: var(--sp-1) 0 2px; }
.section-sub {
  font-size: var(--fs-small); color: var(--text-secondary);
  max-width: 78ch; line-height: 1.5; margin-bottom: 10px;
}
/* §63's heading. Warning ink WITH the words — never colour alone — because "these are
   real values from no cage" is the one fact this screen must not let slide past. */
.bench-caveat {
  font-size: var(--fs-small); font-weight: 640; color: var(--warning-text);
  padding: var(--sp-2) var(--sp-3); border-left: 3px solid var(--warning);
  background: var(--surface-2); border-radius: var(--radius-sm);
  margin-bottom: var(--sp-2); max-width: 78ch;
}
.plg-open { margin-top: 10px; font-size: var(--fs-small); }

/* ═══════════════════════════════════════════════════════════════════════════
   v8 §67 — probe health rows
   ═══════════════════════════════════════════════════════════════════════════ */
.ph-armed {
  display: flex; align-items: flex-start; gap: var(--sp-2);
  font-size: var(--fs-small); font-weight: 620;
  padding-bottom: var(--sp-2); border-bottom: 1px solid var(--grid); margin-bottom: var(--sp-1);
}
.ph-armed.warn { color: var(--warning-text); }
.ph-row, .ph-alert {
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--sp-2) 0; border-bottom: 1px solid var(--grid);
}
.ph-row:last-of-type { border-bottom: 0; }
.ph-head { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-small); }
.ph-id {
  font-size: var(--fs-micro); color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.ph-state { margin-left: auto; font-size: var(--fs-micro); color: var(--text-secondary);
  font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }
.ph-facts { font-size: var(--fs-micro); color: var(--text-secondary); max-width: 80ch; }
/* Overdue-or-never-done gets its own ink; it is a different fact from "ok" and from
   "unknown", and merging the three is the failure §67 names. */
.ph-overdue { font-size: var(--fs-micro); color: var(--warning-text); font-weight: 620; }
.ph-stale {
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: .05em;
  color: var(--warning-text);
}

/* audit P1 #1 — the evidence-hold control on the incident and alarm surfaces */
.hold-box {
  display: flex; flex-direction: column; gap: 6px;
  padding: var(--s4); margin-bottom: var(--s4);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-1);
}
.hold-head { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-small); }
.hold-status { font-size: var(--fs-micro); color: var(--text-secondary); max-width: 80ch; }
.hold-btn {
  align-self: flex-start; font: inherit; font-size: var(--fs-small); font-weight: 620;
  padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-sm); cursor: pointer;
  border: 1.5px solid var(--border-strong); background: var(--surface-2);
  color: var(--text-primary);
}
.hold-btn:disabled { opacity: .5; cursor: default; }

/* 2026-08-27 — the sign-in guidance that was missing when the owner stood locked out */
.login-hint {
  font-size: var(--fs-micro); color: var(--text-secondary);
  margin-top: 10px; line-height: 1.5; text-align: left; max-width: 34ch;
}

/* ═══════════════════════════════════════════════════════════════════════════
   v9 §70-72 — the board reads, it does not lecture
   ═══════════════════════════════════════════════════════════════════════════ */

/* rings — first stylesheet appearance, because these are their first consumers */
.ring { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.ring-caption {
  font-size: var(--fs-micro); color: var(--text-secondary); font-weight: 620;
  font-variant-numeric: tabular-nums;
}
.ring-denominator { font-size: 9px; color: var(--text-muted); max-width: 14ch; text-align: center; }
.ring-row { display: flex; gap: var(--s5); flex-wrap: wrap; padding: 6px 0; }
.ring-overfilled .ring-caption { color: var(--warning-text); }

/* the sensor row's bar rack: quality mix, calibration, cleaning — same widths, aligned */
.ph-bars { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-1) 0 2px 22px; }
.qmix { display: flex; align-items: center; gap: var(--sp-2); }
.qmix-caption {
  font-size: var(--fs-micro); color: var(--text-secondary);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* the tap-through: the row is a control, the why unfolds under it */
.ph-tappable { cursor: pointer; }
.ph-tappable:hover { background: var(--surface-2); }
.ph-tappable.open { background: var(--surface-2); }
.ph-holder:empty { display: none; }
.ph-detail {
  padding: var(--sp-2) var(--sp-3) 10px 22px; border-left: 2px solid var(--border-strong);
  margin: 0 0 6px; background: var(--surface-2);
  display: flex; flex-direction: column; gap: var(--sp-1);
}
.ph-detail-line { font-size: var(--fs-micro); color: var(--text-secondary); max-width: 80ch; }

/* the group footnote — one explanation, once */
.ph-foot {
  font-size: var(--fs-micro); color: var(--text-muted);
  padding-top: 6px; border-top: 1px solid var(--grid); max-width: 80ch;
}

/* ═══════════════════════════════════════════════════════════════════════════
   v10 §76/§77/§81 — loading without lying, and calm arrivals
   ═══════════════════════════════════════════════════════════════════════════ */
/* The skeleton appears only after 250 ms — data that arrives fast simply appears as
   data. Pure CSS, so no timer can leak. Static neutral blocks, never shimmer. */
/* The reveal is a plain class flip with NO transition: a transition that starts in
   a non-compositing tab strands at its first frame and the skeleton never appears —
   the same trap this stylesheet already documents for focus rings. */
.skel-wrap { opacity: 0; transition: none; }
.skel-wrap.show { opacity: 1; }
.skel-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4); padding: var(--sp-2) 0;
}
.skel {
  display: inline-block; background: var(--surface-2);
  border-radius: var(--radius-xs); height: 12px;
}
.skel-label { width: 38%; }
/* THE RULE THAT OUTRANKS THE REST (§77): the value position of a measurement is never
   a grey block. It is the §28 unknown — an em dash — distinct from any real value at a
   glance and in greyscale. */
.skel-value { color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* §81: new data crossfades — opacity only, nothing slides, nothing counts. Alarm
   state changes are untouched by this: it runs once on arrival of a whole container,
   and the reduced-motion block already clamps animation to 1 ms. */
.fade-in { animation: swap-fade 150ms ease-out; }
@keyframes swap-fade { from { opacity: 0.25; } to { opacity: 1; } }

/* ── v3 §25/§29 + v5 §44 — the night arc, small multiples, the farm strip ── */
.na-svg, .sm-svg { display: block; width: 100%; height: auto; }
.na-note { color: var(--text-muted); font-size: 12.5px; padding: 2px 0; }
.na-caption { color: var(--text-muted); font-size: 11.5px; padding-top: var(--sp-1); }
.na-limit { font-size: 10.5px; fill: var(--text-muted); font-variant-numeric: tabular-nums; }
.na-axis { font-size: 10.5px; fill: var(--text-secondary); }
.sm-head { display: flex; align-items: baseline; justify-content: space-between; margin-top: var(--sp-2); }
.sm-label { font-size: 12.5px; color: var(--text-secondary); font-weight: 600; }
.sm-domain { font-size: 10.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sm-legend { color: var(--text-muted); font-size: 11.5px; padding-top: var(--sp-1); }
.fs { display: flex; align-items: center; gap: var(--sp-1); flex-wrap: wrap; padding: var(--sp-1) 0 var(--sp-2); }
.fs-none { color: var(--text-muted); font-size: 12.5px; }
.fs-tick { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 28px; padding: 2px var(--sp-2);
  border: 1px solid transparent; border-radius: 6px; background: none; cursor: pointer; }
.fs-tick:hover { background: var(--surface-hover); }
.fs-tick:focus-visible { outline: 2px solid var(--brand-mid); outline-offset: 1px; }
.fs-name { font-size: 11.5px; color: var(--text-secondary); }

/* Gap #48. Loud enough to stop someone trusting a half-drawn board, quiet enough that
   it is not mistaken for an alarm about the water. */
.client-error-bar { position:fixed; left:0; right:0; bottom:0; z-index:9999;
  background:#5C2B3A; color:#FCA5A5; font-size:13px; padding:10px var(--sp-4);
  border-top:1px solid #7F3F52 }


/* ── #50: a shift report printed from the board gets the data, not the chrome ──── */
@media print {
  nav, .tabs, #chat, #chat-fab, #transport, .btn, button, .fs-tick:hover,
  #login, .replay-banner { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .card { break-inside: avoid; box-shadow: none !important; border: 1px solid #999; }
  a { color: #000; text-decoration: none; }
}

/* ── #55: long farm and cage names truncate with an ellipsis instead of breaking
      the row. The full name stays reachable — every such element carries title=. ── */
.fs-name, .o2-pick, .card-head h3, .crumb, .plg-gw {
  max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}


/* ═══════════════════════════════════════════════════════════════════════════
   V11 — THE FLUID LAYER (2026-08-28)
   Design and motion only. Every rule here is additive: it changes how the same
   truth arrives, never what it says. Attribution per decision lives in
   docs/DESIGN_V11.md. Three standing exemptions run through everything:
   1. Critical, stale or silent state appears instantly, opaque, no entrance.
   2. Data (readings, alarms, status colour, chart plots) sits on solid ground —
      glass is for chrome only.
   3. prefers-reduced-motion and prefers-reduced-transparency both get a full
      static, opaque equivalent (the reduce block above already neuters
      animation; the @supports/@media fallbacks below solidify the glass).
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* strong in-out for on-screen movement (emil: built-ins are too weak) */
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  /* the fill settle: spring-family, critically damped ON PURPOSE — a level bar
     that overshoots states a value the water never had (apple: damping 1.0 is
     the default; bounce is earned by momentum, and data has none). */
  --ease-settle: cubic-bezier(.23, 1, .32, 1);
  --dur-fill: 350ms;
  --dur-enter: 240ms;
  --dur-exit: 160ms;      /* exits are faster than entrances, always */

  /* glass — chrome only. Alpha values are MEASURED, not eyeballed: composite
     contrast against worst-case underlays is computed in ops/glass-contrast.mjs
     and recorded in DESIGN_V11.md. */
  --glass-bg: rgba(252, 252, 251, .80);
  --glass-blur: 14px;
  --glass-sat: 160%;
  --glass-edge: rgba(255, 255, 255, .55);
}
:root[data-theme="dark"] {
  --glass-bg: rgba(16, 18, 16, .78);
  --glass-edge: rgba(255, 255, 255, .07);
}

/* ─── glass chrome ─────────────────────────────────────────────────────────
   Cap: at most three live layers can coexist (header + tooltip + open chat);
   the sidebar and every card stay solid — nothing scrolls beneath them, so
   blur there would be decoration billed to a low-end GPU. */
header.top {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border-bottom-color: transparent;
  transition: border-color var(--dur-ui) var(--ease-out),
              box-shadow var(--dur-ui) var(--ease-out);
}
/* the scroll edge: appears only once content actually passes underneath —
   a hard divider on an unscrolled page is a claim about nothing (apple §12) */
body.scrolled header.top {
  border-bottom-color: var(--border);
  box-shadow: 0 1px 0 var(--glass-edge) inset, var(--shadow-sm);
}
/* vibrancy: flat grey meta text loses on a live blurred surface — one step up */
header.top .as-of { color: var(--text-secondary); }

#tooltip {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(10px) saturate(var(--glass-sat));
  backdrop-filter: blur(10px) saturate(var(--glass-sat));
  transform: scale(.98);
  transition: opacity var(--dur-tip) var(--ease-out),
              transform var(--dur-tip) var(--ease-out);
}
#tooltip.on { transform: scale(1); }

#chat {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
}
/* messages are content, not chrome — they keep their solid ground */
#chat .msg.bot { background: var(--surface-sunken); }
#chat .msg.me { background: var(--brand-mid); }
#chat #composer input { background: var(--surface-1); }

.tp {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(8px) saturate(var(--glass-sat));
  backdrop-filter: blur(8px) saturate(var(--glass-sat));
}

.sheet-backdrop {
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  backdrop-filter: blur(6px) saturate(120%);
}

/* solid equivalents: no capability or no consent means no glass, same hierarchy */
@supports not (backdrop-filter: blur(1px)) {
  header.top, #tooltip, #chat, .tp { background: var(--surface-1); }
}
@media (prefers-reduced-transparency: reduce) {
  header.top, #tooltip, #chat, .tp, .sheet-backdrop {
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  header.top, #tooltip, #chat, .tp { background: var(--surface-1); }
}

/* ─── entrance choreography ────────────────────────────────────────────────
   Applied by render() on NAVIGATION only, never on a data refresh, and never
   on the state boards (farm, alerts, alarms, incident, on-call, system,
   devices, polls) — those carry alarm and silence state, and critical state
   does not make an entrance. Delay is clamped so the ninth card onward
   arrives with the eighth: choreography, not a queue. */
.view.enter > * {
  animation: v11-rise var(--dur-enter) var(--ease-settle) both;
  animation-delay: calc(min(var(--i, 0), 8) * 30ms);
}
.view.enter > .notice, .view.enter > .gap, .view.enter > .no-analog {
  animation: none;   /* advisories are state, and state is already on screen */
}
@keyframes v11-rise {
  from { opacity: 0; transform: translateY(6px); }
}
/* the big numerals settle a beat after their card — value, then context */
.view.enter .hero .figure, .view.enter .readout .v {
  animation: v11-value 300ms var(--ease-settle) both;
  animation-delay: calc(min(var(--i, 0), 8) * 30ms + 60ms);
}
@keyframes v11-value {
  from { opacity: 0; transform: translateY(.3em); }
}

/* ─── fills that settle ────────────────────────────────────────────────────
   Level bars and meters fill from zero to the value on first paint, spring
   curve, no overshoot, interruptible (CSS transitions retarget). Powered by
   @starting-style so a browser without it — or a background tab — simply
   shows the correct final value: the data can never be wrong, only still. */
.lbar-fill { transition: width var(--dur-fill) var(--ease-settle); }
.meter span { transition: width var(--dur-fill) var(--ease-settle); }
@starting-style {
  .lbar-fill { width: 0; }
  .meter span { width: 0; }
}

/* ─── freshness is felt before it is read ──────────────────────────────────
   The live dot breathes while a stream is actually delivering; polling and
   offline hold still. Opacity only, and the reduce block stops it entirely. */
.tp.streaming i { animation: v11-breathe 2.6s var(--ease-in-out) infinite; }
@keyframes v11-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

/* ─── skeletons shimmer, content crossfades in ─────────────────────────────
   A sweep of light says "working" without a spinner. The existing swap-fade
   keyframe already crossfades the arriving content over it. */
.skel { position: relative; overflow: hidden; }
.skel::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 32%,
    color-mix(in srgb, var(--text-primary) 7%, transparent) 50%, transparent 68%);
  animation: v11-shimmer 1.4s linear infinite;
}
@keyframes v11-shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* ─── offline: the pill arrives, the ledgers dim, the state boards do not ──
   Dim is opacity on the container, measured against AA for the critical ink
   before the value was chosen (ops/glass-contrast.mjs). The farm and alarm
   boards are exempted by the same render() rule that exempts entrances. */
.tp { transition: opacity var(--dur-ui) var(--ease-out), transform var(--dur-ui) var(--ease-out); }
@starting-style { .tp { opacity: 0; transform: translateY(-4px); } }
body.tp-offline:not(.calm-view) .content { opacity: .9; }

/* ─── the assistant panel materialises from its corner ─────────────────────
   Origin-aware (it lives bottom-right, it grows from bottom-right), enter
   240ms, exit 160ms, and where allow-discrete is unsupported it simply
   appears — the old behaviour, kept as the fallback. */
#chat {
  transform-origin: 100% 100%;
  transition: opacity var(--dur-enter) var(--ease-drawer),
              transform var(--dur-enter) var(--ease-drawer),
              display var(--dur-enter) allow-discrete;
}
#chat.on { opacity: 1; transform: none; }
@starting-style { #chat.on { opacity: 0; transform: translateY(10px) scale(.98); } }
#chat:not(.on) {
  opacity: 0; transform: translateY(8px) scale(.99);
  transition-duration: var(--dur-exit);
}

/* ─── press states: the interface heard you ────────────────────────────────
   Scale is subtle (.985) because this is a dense operations surface, not a
   consumer app; the finger still gets its answer on pointer-down. */
.btn:active { transform: translateY(1px) scale(.985); }
nav a {
  transition: background var(--dur-hover) var(--ease-out),
              color var(--dur-hover) var(--ease-out),
              transform 60ms var(--ease-out);
}
nav a:active { transform: scale(.985); }
.suggests button { transition: background var(--dur-hover) var(--ease-out),
                               color var(--dur-hover) var(--ease-out),
                               transform 60ms var(--ease-out); }
.suggests button:active { transform: scale(.97); }
.segmented button { transition: background var(--dur-hover) var(--ease-out),
                                color var(--dur-hover) var(--ease-out); }

/* focus arrives softly but unmistakably */
.btn:focus-visible, nav a:focus-visible, .segmented button:focus-visible,
.suggests button:focus-visible {
  outline: none; box-shadow: var(--focus-ring);
  transition: box-shadow 120ms var(--ease-out);
}

/* ─── sign-in: the one rare-tier delight in the product ────────────────────
   Seen once a session at most — the card settles in over a quiet brand wash.
   (emil: the delight budget lives on rare surfaces, nowhere else.) */
#login-screen {
  background:
    radial-gradient(1200px 600px at 70% -10%,
      color-mix(in srgb, var(--brand-pale) 60%, transparent), transparent 70%),
    var(--surface-2);
}
.login-card {
  transition: opacity 300ms var(--ease-settle), transform 300ms var(--ease-settle);
}
@starting-style { .login-card { opacity: 0; transform: translateY(10px) scale(.99); } }

/* ─── print: motion and glass do not exist on paper ────────────────────────*/
@media print {
  header.top, #tooltip, #chat, .tp {
    -webkit-backdrop-filter: none; backdrop-filter: none;
    background: #fff;
  }
  .view.enter > *, .view.enter .hero .figure, .view.enter .readout .v { animation: none; }
  .skel::after { animation: none; content: none; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   V12 — ATMOSPHERE & THE WORD DIET (2026-08-28)
   Photography is atmosphere, never data ground. Sentences move into symbols
   whose tooltips carry the exact words removed. The v11 exemptions still bind.
   ═══════════════════════════════════════════════════════════════════════════ */

/* symbols: the words live in the tooltip and the accessible name */
.sym { display: inline-flex; align-items: center; color: var(--text-muted); cursor: help; }
.sym svg { width: 15px; height: 15px; flex: none; }
.sym:hover { color: var(--text-secondary); }
.de-head .sym { margin-right: 7px; }
.card-head .sym { margin-left: 2px; }

/* the fix for the screen-filling info glyph: this head never sized its icon */
.hold-head svg { width: 16px; height: 16px; flex: none; }

/* provenance folds — the paragraph is one tap away */
.prov-fold { margin-top: var(--s3); }
.prov-fold summary {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  font-size: var(--fs-meta); color: var(--text-muted); list-style: none;
}
.prov-fold summary::-webkit-details-marker { display: none; }
.prov-fold summary svg { width: 13px; height: 13px; }
.prov-fold[open] summary { color: var(--text-secondary); }
.prov-fold .provenance { border-top: 0; margin-top: 2px; padding-top: 4px; }

/* ─── the weather scene ────────────────────────────────────────────────────
   The photograph is scenery; the condition word and every number are derived
   from the observation. Chips are solid dark panels (not glass): white ink on
   rgba(10,12,10,.72) composites to 5.6:1 over even a pure-white photo region. */
.wx-scene {
  position: relative; height: 320px; border-radius: var(--radius);
  overflow: hidden; margin-bottom: var(--s5); background: #101210;
}
.wx-photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.wx-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .18) 0%,
    transparent 34%, transparent 52%, rgba(0, 0, 0, .58) 100%);
}
.wx-ovl {
  position: absolute; inset: auto 0 0 0; padding: var(--sp-4) var(--sp-5);
  display: flex; flex-direction: column; gap: 10px;
}
.wx-wordrow { display: flex; align-items: center; gap: 9px; }
.wx-word {
  color: #fff; font-size: 26px; font-weight: 650; letter-spacing: -.02em;
  text-shadow: 0 1px 14px rgba(0, 0, 0, .45);
}
.wx-wordrow .sym { color: rgba(255, 255, 255, .8); }
.wx-wordrow .sym:hover { color: #fff; }
.wx-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.wx-chip {
  display: inline-flex; align-items: baseline; gap: 5px;
  background: rgba(10, 12, 10, .72); color: #fff;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px; padding: 5px 11px;
  font-variant-numeric: tabular-nums;
}
.wx-chip i { font-style: normal; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .06em; color: rgba(255, 255, 255, .72); }
.wx-chip b { font-weight: 650; font-size: 14px; }
.wx-chip small { font-size: 10.5px; color: rgba(255, 255, 255, .72); }
.wx-agechip .tp-age, .wx-agechip .wx-agev { color: rgba(255, 255, 255, .85); font-size: 11.5px; }
.wx-none { display: grid; place-items: center; }
.wx-none .wx-word { position: static; }

/* animated layers — transform/opacity only; the global reduce block stops all */
.wx-layer { position: absolute; inset: -20% -30%; pointer-events: none; opacity: 0; }

.wxl-rain {
  background:
    repeating-linear-gradient(105deg, transparent 0 9px,
      rgba(255, 255, 255, .16) 9px 10px),
    repeating-linear-gradient(100deg, transparent 0 17px,
      rgba(255, 255, 255, .10) 17px 18px);
  animation: wx-rainfall .8s linear infinite;
}
.wx--rain .wxl-rain { opacity: .7; }
.wx--storm .wxl-rain { opacity: .9; animation-duration: .5s; }
@keyframes wx-rainfall {
  from { transform: translate3d(0, -12%, 0); }
  to { transform: translate3d(-4%, 12%, 0); }
}

.wxl-cloud {
  background:
    radial-gradient(42% 34% at 22% 22%, rgba(255, 255, 255, .30), transparent 70%),
    radial-gradient(50% 38% at 74% 12%, rgba(255, 255, 255, .22), transparent 70%);
  animation: wx-drift 70s linear infinite alternate;
}
.wx--partly .wxl-cloud { opacity: .5; }
.wx--gloomy .wxl-cloud, .wx--rain .wxl-cloud { opacity: .65;
  filter: brightness(.75) saturate(.8); }
.wx--storm .wxl-cloud { opacity: .8; filter: brightness(.5); }
@keyframes wx-drift {
  from { transform: translate3d(-6%, 0, 0); }
  to { transform: translate3d(6%, 0, 0); }
}

.wxl-sun {
  background: radial-gradient(38% 52% at 76% 4%,
    rgba(255, 236, 170, .5), transparent 72%);
  animation: wx-shimmer 6s var(--ease-in-out) infinite;
}
.wx--sunny .wxl-sun { opacity: 1; }
.wx--partly .wxl-sun { opacity: .6; }
@keyframes wx-shimmer {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}
.wx--sunny .wxl-sun, .wx--partly .wxl-sun { /* shimmer drives opacity */ }

.wxl-flash { background: rgba(255, 255, 255, .9); }
.wx--storm .wxl-flash { animation: wx-flash 9s linear infinite; opacity: 0; }
@keyframes wx-flash {
  0%, 91%, 100% { opacity: 0; }
  92% { opacity: .5; }
  93% { opacity: 0; }
  94.5% { opacity: .28; }
  96% { opacity: 0; }
}

.wx--night .wx-scrim {
  background: linear-gradient(180deg, rgba(4, 8, 14, .35) 0%,
    rgba(4, 8, 14, .1) 40%, rgba(0, 0, 0, .62) 100%);
}

@media (max-width: 700px) { .wx-scene { height: 230px; } .wx-word { font-size: 21px; } }
@media (prefers-reduced-transparency: reduce) {
  .wx-chip { background: #14170f; }
}
@media print {
  .wx-layer { display: none; }
  .wx-scene { height: 180px; }
}

/* ─── People ───────────────────────────────────────────────────────────────*/
.pager-strip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px var(--sp-4); margin-bottom: var(--s5);
  border: 1px solid var(--border-strong); border-left: 3px solid var(--good);
  border-radius: var(--radius);
  background: var(--surface-1); font-size: var(--fs-body);
}
.pager-strip svg { width: 16px; height: 16px; flex: none; color: var(--good); }
.pager-strip.crit { border-color: var(--critical); border-left-color: var(--critical); }
.pager-strip.crit svg { color: var(--critical); }
.pager-strip .sym svg { color: var(--warning-text); }
.pager-strip .pg-k { color: var(--text-muted); font-size: var(--fs-meta); }
.pager-strip .pg-ch, .pager-strip .pg-ack {
  font-size: var(--fs-meta); color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px;
}
.pager-strip .pg-next { color: var(--text-secondary); }

.people-board .pb-head {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: var(--s4);
}
.people-board .pb-head h3 { font-size: var(--fs-title); }
.people-board .pb-n { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.people-board .pb-reach {
  color: var(--text-secondary); font-size: var(--fs-meta); white-space: nowrap;
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px;
}
.people-board .pb-reach.none { color: var(--warning-text); border-color: var(--warning); }
.people-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: var(--s4);
}
.person {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px;
  padding: var(--sp-4); border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface-1);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-hover) var(--ease-out),
    border-color var(--dur-hover) var(--ease-out);
}
.person:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.person.off { opacity: .62; }
.p-ava-wrap { position: relative; grid-row: span 2; width: 52px; height: 52px; }
.p-ava {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-mid), var(--brand-light));
  color: #fff; font-weight: 650; font-size: 16px; letter-spacing: .02em;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .28);
  overflow: hidden;
}
.p-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-ava-edit {
  position: absolute; right: -3px; bottom: -3px; width: 22px; height: 22px;
  padding: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--surface-1); border: 1px solid var(--border-strong);
  color: var(--text-secondary); box-shadow: var(--shadow-sm);
}
.p-ava-edit svg { width: 12px; height: 12px; }
.p-ava-edit:hover { color: var(--brand-mid); border-color: var(--brand-mid); }
.p-ava-edit:disabled { opacity: .5; cursor: progress; }
.p-ava-edit.err { color: var(--critical); border-color: var(--critical); }
.p-name { font-weight: 620; font-size: var(--fs-lead); }
.p-meta {
  color: var(--text-muted); font-size: var(--fs-meta);
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.p-role {
  background: var(--brand-pale); color: var(--brand-dark); border-radius: 999px;
  padding: 1px 9px; font-weight: 600;
}
:root[data-theme="dark"] .p-role { color: #a0aec0; }
.p-off { color: var(--warning-text); }
.p-act { grid-column: 2; display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.p-act .btn.small { text-decoration: none; display: inline-flex; align-items: center; }
.p-act a.p-call { background: var(--brand-mid); color: #fff; }
.p-act a.p-wa, .p-act a.p-tg {
  background: var(--surface-1); color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

/* sign-in over the lake at dusk — the one full-photo surface, dimmed for the card */
#login-screen {
  background: linear-gradient(rgba(8, 12, 8, .38), rgba(8, 12, 8, .55)),
    url('img/login.webp') center / cover no-repeat, var(--surface-2);
}
.login-card { box-shadow: var(--shadow-lg); }
@media (prefers-reduced-transparency: no-preference) {
  .login-card { background: rgba(252, 252, 251, .94); }
  :root[data-theme="dark"] .login-card { background: rgba(25, 27, 25, .94); }
}
@media print { #login-screen { background: #fff; } }


/* ═══════════════════════════════════════════════════════════════════════════
   V13 — THE VISION WORLD (2026-08-28, owner-directed with reference imagery)
   The dark theme becomes a Vision-UI world: deep navy body with ambient glow,
   translucent navy card gradients, pill sidebar, one blue accent. Tokens taken
   from the Vision UI Dashboard React theme source (creative-tim, MIT) and
   re-measured for AA here (ops/v13-contrast.mjs): white 19.0:1 and secondary
   8.4:1 on the card composite; the accent is #0069e8 because Vision's #0075ff
   holds only 4.2:1 under white button text — 5.02:1 measured here.
   The light theme is deliberately untouched: sunlight on a boat needs it.
   Status and series colours are OURS, not Vision's — reserved meaning outranks
   any aesthetic (ISA-101), and the series set stays ≥3.8:1 on the new card.
   ═══════════════════════════════════════════════════════════════════════════ */

:root[data-theme="dark"] {
  --surface-1: #0a0e27;
  --surface-2: #030c1d;
  --surface-sunken: #0f1535;
  --surface-hover: #141b3f;
  --text-secondary: #a0aec0;
  --text-muted: #7b849e;
  --grid: #1e2447;
  --axis: #343b66;
  --border: rgba(226, 232, 240, .10);
  --border-strong: rgba(226, 232, 240, .19);
  --brand-dark: #0f1535;
  --brand-mid: #0069e8;
  --brand-light: #4318ff;
  --brand-pale: #1a1f37;
  --glass-bg: rgba(6, 11, 40, .80);
  --glass-edge: rgba(255, 255, 255, .09);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, .35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .40);
  --shadow-lg: 0 22px 54px rgba(0, 0, 0, .55);
  --radius: 16px;
}

/* the world: deep navy with two quiet ambient glows, fixed so content floats over it */
:root[data-theme="dark"] body {
  background:
    radial-gradient(52% 38% at 88% -8%, rgba(67, 24, 255, .22), transparent 62%),
    radial-gradient(44% 34% at -6% 104%, rgba(0, 105, 232, .16), transparent 60%),
    var(--surface-2);
  background-attachment: fixed;
}

/* sidenav: the Vision gradient panel; the active item is a pill with a lit icon tile */
:root[data-theme="dark"] aside {
  background: linear-gradient(127deg, rgba(6, 11, 40, .94) 19%, rgba(10, 14, 35, .55) 77%);
  border-right: 1px solid rgba(226, 232, 240, .06);
}
:root[data-theme="dark"] nav a { border-radius: 12px; }
:root[data-theme="dark"] nav a.on {
  background: #1a1f37; color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}
:root[data-theme="dark"] nav a svg {
  width: 26px; height: 26px; padding: 5px; border-radius: 9px;
  background: rgba(226, 232, 240, .06);
  transition: background var(--dur-hover) var(--ease-out);
}
:root[data-theme="dark"] nav a.on svg { background: var(--brand-mid); color: #fff; opacity: 1; }

/* cards: the Vision translucent-navy gradient over the ambient body. This is alpha
   over a FIXED backdrop, not backdrop-filter — zero per-frame cost, and a chart
   still sits on stable, near-solid ground. */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .focal,
:root[data-theme="dark"] .notice,
:root[data-theme="dark"] .person,
:root[data-theme="dark"] .pager-strip {
  background: linear-gradient(127deg, rgba(6, 11, 40, .86) 20%, rgba(10, 14, 35, .68) 91%);
  border-color: rgba(226, 232, 240, .10);
}
:root[data-theme="dark"] .card { border-radius: 20px; }

/* the one accent: buttons, focus, active states ride the measured blue */
:root[data-theme="dark"] .btn.ghost { border-color: rgba(226, 232, 240, .16); }
:root[data-theme="dark"] .segmented { background: #0f1535; }
:root[data-theme="dark"] .segmented button.on { background: #1a1f37; color: #fff; }
:root[data-theme="dark"] #chat .msg.me { background: var(--brand-mid); }
:root[data-theme="dark"] .login-card { background: rgba(10, 14, 35, .92); }

/* ─── the weather hero, from the reference imagery ─────────────────────────
   Big numeral, chance of rain, one 3D icon (Fluent Emoji, MIT) floating gently.
   The photograph scene retired from this view; the icon IS the condition, and
   the condition is still derived from the observation, never guessed. */
.wx13-hero {
  position: relative; display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: var(--sp-4);
  padding: var(--sp-6) var(--sp-7); margin-bottom: var(--s5);
  border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface-1);
  overflow: hidden;
}
:root[data-theme="dark"] .wx13-hero {
  background: linear-gradient(127deg, rgba(6, 11, 40, .92) 10%, rgba(16, 22, 54, .78) 70%,
    rgba(67, 24, 255, .16) 110%);
  border-color: rgba(226, 232, 240, .10);
}
.wx13-place { font-size: var(--fs-meta); color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .07em; }
.wx13-cond { display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-lead); font-weight: 620; color: var(--text-secondary); margin-top: 2px; }
.wx13-temp { font-size: 64px; font-weight: 650; letter-spacing: -.03em;
  line-height: 1; margin-top: 6px; color: var(--text-primary);
  font-variant-numeric: tabular-nums; }
.wx13-temp small { font-size: 22px; font-weight: 550; color: var(--text-secondary); }
.wx13-sub { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-size: var(--fs-small); color: var(--text-secondary);
  font-variant-numeric: tabular-nums; }
.wx13-sub b { color: var(--text-primary); font-weight: 620; }
.wx13-icon { width: 148px; height: 148px; object-fit: contain;
  animation: wx13-float 4.2s var(--ease-in-out) infinite; }
@keyframes wx13-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* hourly strip: the next hours as columns — time, icon, temperature */
.wx13-hours { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: var(--sp-2); overflow-x: auto; padding-bottom: 2px; }
.wx13-hour { display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 6px; border-radius: 14px; min-width: 74px; }
.wx13-hour + .wx13-hour { border-left: 1px solid var(--border); border-radius: 0; }
.wx13-hour .h { font-size: var(--fs-meta); color: var(--text-muted);
  font-variant-numeric: tabular-nums; }
.wx13-hour img { width: 44px; height: 44px; object-fit: contain; }
.wx13-hour .t { font-size: var(--fs-lead); font-weight: 650;
  font-variant-numeric: tabular-nums; }
.wx13-hour .p { font-size: var(--fs-micro); color: var(--series-2);
  font-variant-numeric: tabular-nums; }

/* day rows: Today / weekday · icon · word · hi/lo */
.wx13-days { display: flex; flex-direction: column; }
.wx13-day { display: grid; grid-template-columns: 86px 40px 1fr auto;
  align-items: center; gap: var(--sp-3); padding: 9px 2px;
  font-size: var(--fs-body); }
.wx13-day + .wx13-day { border-top: 1px solid var(--grid); }
.wx13-day .d { color: var(--text-secondary); }
.wx13-day img { width: 34px; height: 34px; object-fit: contain; }
.wx13-day .w { color: var(--text-secondary); }
.wx13-day .hl { font-variant-numeric: tabular-nums; }
.wx13-day .hl b { font-weight: 650; }
.wx13-day .hl span { color: var(--text-muted); }

@media (max-width: 700px) {
  .wx13-hero { grid-template-columns: 1fr auto; padding: var(--sp-5); }
  .wx13-temp { font-size: 48px; }
  .wx13-icon { width: 104px; height: 104px; }
}
@media print {
  .wx13-icon { animation: none; }
  :root[data-theme="dark"] body { background: #fff; }
}

/* v13.1 — folds and night-card symbols (the overlap fix lives in nightarc.render.js) */
.wx-fold { margin-top: var(--s3); }
.wx-fold summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: var(--fs-meta); color: var(--text-muted); list-style: none;
}
.wx-fold summary::-webkit-details-marker { display: none; }
.wx-fold summary svg { width: 13px; height: 13px; }
.wx-fold[open] summary { color: var(--text-secondary); }
.wx-night-w { margin-top: 6px; }
.wx-job-k { display: flex; align-items: center; gap: 6px; }


/* ═══════════════════════════════════════════════════════════════════════════
   V14 — THE WIDGET BOARD (2026-08-28, owner-directed with the Vision reference)
   The farm board reads as a grid of self-contained widgets: the verdict is the
   hero, every farm-wide number is a tile with an identity glyph, and cards
   everywhere carry a tinted domain tile on their mark. Identity tints come from
   a blue–violet–cyan–teal–slate family and NEVER borrow the four reserved
   status colours — a tile says what a widget is about, tone still says how it
   is doing (ISA-101). Loading crossfades (opacity only, no delay): the CALM
   exemption forbids entrances on state, not smooth arrival.
   ═══════════════════════════════════════════════════════════════════════════ */

/* smooth arrival: content fades over the skeleton it replaces */
.swapped > * { animation: swap-fade 300ms var(--ease-out) both; }
@media print { .swapped > * { animation: none; } }

/* ─── the hero verdict ─────────────────────────────────────────────────────*/
.l1-verdict { border-radius: 20px; }
:root[data-theme="dark"] .l1-verdict {
  background: linear-gradient(127deg, rgba(6, 11, 40, .92) 12%, rgba(16, 22, 54, .8) 64%,
    rgba(0, 105, 232, .14) 108%);
  border: 1px solid rgba(226, 232, 240, .10);
}
:root[data-theme="dark"] .l1-verdict.attention {
  background: linear-gradient(127deg, rgba(40, 8, 14, .5) 0%, rgba(6, 11, 40, .92) 46%);
}

/* ─── the fact tiles become widgets ────────────────────────────────────────*/
.l1-facts { gap: var(--s4); }
.l1-facts .metric {
  position: relative;
  padding: 14px 16px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-1);
  box-shadow: var(--shadow-sm);
}
:root[data-theme="dark"] .l1-facts .metric {
  background: linear-gradient(127deg, rgba(6, 11, 40, .88) 20%, rgba(10, 14, 35, .62) 94%);
  border-color: rgba(226, 232, 240, .10);
}
.l1-facts .m-k { padding-right: 40px; }
.l1-facts .m-v { font-size: 30px; font-weight: 650; letter-spacing: -.02em; }

/* identity glyph tiles — what the number is about, never how it is doing */
.m-ic {
  position: absolute; top: 11px; right: 11px;
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; color: #fff;
}
.m-ic svg { width: 17px; height: 17px; }
.m-ic-sensor { background: linear-gradient(135deg, #0075ff, #4318ff); }
.m-ic-silent { background: linear-gradient(135deg, #21d4fd, #2152ff); }
.m-ic-nosensor { background: linear-gradient(135deg, #6b7394, #454c6d); }
.m-ic-clock { background: linear-gradient(135deg, #7551ff, #4318ff); }
.m-ic-warning { background: linear-gradient(135deg, #3f8cff, #7551ff); }

/* ─── every card's domain mark is a tinted tile, product-wide ──────────────*/
.card-head .card-mark {
  width: 32px; height: 32px; padding: 6px; box-sizing: border-box;
  border-radius: 10px;
  background: color-mix(in srgb, var(--mkt, #6b7394) 20%, transparent);
  color: var(--mkt, var(--text-secondary));
}
:root[data-theme="dark"] .card-head .card-mark {
  background: color-mix(in srgb, var(--mkt, #6b7394) 26%, transparent);
}
.card-mark[data-mark="probe"] { --mkt: #0075ff; }
.card-mark[data-mark="droplet"] { --mkt: #21d4fd; }
.card-mark[data-mark="buoy"] { --mkt: #5b8cff; }
.card-mark[data-mark="battery"] { --mkt: #7551ff; }
.card-mark[data-mark="tilapia"] { --mkt: #17c1a3; }
.card-mark[data-mark="pellet"] { --mkt: #e879a6; }
.card-mark[data-mark="command"] { --mkt: #3f8cff; }
.card-mark[data-mark="dawn"] { --mkt: #9085e9; }
.card-mark[data-mark="crate"] { --mkt: #8b93b8; }
.card-mark[data-mark="calibration"] { --mkt: #21d4fd; }

/* ─── the direction row separates into columns, per widget ─────────────────*/
.trend-cell + .trend-cell { border-left: 1px solid var(--grid); padding-left: var(--s5); }

/* farm strip chips read as pills on the navy */
:root[data-theme="dark"] .fs-cage, :root[data-theme="dark"] .fs-chip {
  background: #0f1535; border-color: rgba(226, 232, 240, .12);
}

/* ── v14.1: the widget GRID (reference layout) ────────────────────────────── */
.l1-grid {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: var(--s4); align-items: stretch;
}
.l1-grid > * { margin: 0; min-width: 0; }
.l1-grid .l1-verdict { grid-column: span 6; }
.l1-grid .w-ring { grid-column: span 3; }
.l1-grid .l1-trends { grid-column: span 7; }
.l1-grid .l1-trends > .card { height: 100%; }
.l1-grid .l1-exceptions { grid-column: span 5; }
.l1-grid .l1-automation { grid-column: span 12; }
@media (max-width: 1240px) {
  .l1-grid .l1-verdict { grid-column: span 12; }
  .l1-grid .w-ring { grid-column: span 6; }
  .l1-grid .l1-trends, .l1-grid .l1-exceptions { grid-column: span 12; }
}

/* gauge widgets */
.w-ring .card-body { display: flex; flex-direction: column; align-items: center; }
.ring-face { position: relative; width: 128px; margin: 6px auto 2px; }
.ringw { width: 128px; height: 128px; display: block; transform: rotate(-90deg); }
.ringw circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.ringw-track { stroke: var(--surface-sunken); }
:root[data-theme="dark"] .ringw-track { stroke: #141b3f; }
.ringw-track.dashed { stroke: var(--axis); stroke-dasharray: 2 8; }
.ringw-fill {
  color: var(--series-2);
  stroke: currentColor;
  transition: stroke-dashoffset 700ms var(--ease-settle);
}
:root[data-theme="dark"] .ringw-fill {
  filter: drop-shadow(0 0 6px color-mix(in srgb, currentColor 40%, transparent));
}
@starting-style { .ringw-fill { stroke-dashoffset: 327; } }
.ringw-fill.warning { color: var(--warning); }
.ringw-fill.serious { color: var(--serious); }
.ringw-fill.critical { color: var(--critical); }
.ringw-mid {
  position: absolute; inset: 0; display: grid; place-items: center;
  pointer-events: none;
}
.ringw-v { font-size: 24px; font-weight: 650; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; }
.ringw-v.absent { color: var(--text-muted); font-size: 18px; font-weight: 500; }
.ringw-v small { font-size: 11px; font-weight: 500; color: var(--text-secondary); }
.ringw-sub { text-align: center; font-size: var(--fs-meta); color: var(--text-muted);
  margin-top: 4px; max-width: 24ch; }
.w-ring .envelope, .w-ring .env { margin-top: 8px; }

/* the fact strip keeps its 4-up rhythm as the top row */
.l1-factrow { width: 100%; }
@media print { .ringw-fill { transition: none; } }

/* v14.1b: the legacy two-pane L1 layout (verdict/exc/auto named areas, viewport
   cap) yields to the widget grid — its grid-areas were reaching into .l1-grid
   and exploding placement. The glance function the old cap protected now lives
   in the fact strip at the top of the board. */
@media (min-width: 1180px) {
  .l1 {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: none;
    grid-template-rows: none;
    max-height: none;
  }
  .l1-verdict, .l1-exceptions, .l1-automation, .l1-trends { grid-area: auto; }
  .l1-verdict { display: flex; flex-direction: column; }
}

/* v14.1c: the facts strip no longer lives inside the verdict - its old grid-area
   was manufacturing implicit columns on .l1 */
@media (min-width: 1180px) {
  .l1-facts { grid-area: auto; align-self: stretch; }
}

/* v14.2: the solo ring widget centers itself; requirement checks are a row of
   labelled glyphs whose meaning rides the tooltip */
.w-ring-solo { max-width: 380px; }
.req { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  border: 1px solid var(--border); border-radius: 999px; cursor: help; }
.req svg { width: 15px; height: 15px; color: var(--good); flex: none; }
.req .req-k { font-weight: 600; font-size: var(--fs-small); white-space: nowrap; }
.req-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.ringw-sub .sym { margin-left: 5px; vertical-align: -2px; }

/* v14.5: absence drawn as absence — every empty state carries the dashed-circle
   glyph the probe nodes and gauge tracks already speak */
.de-glyph { width: 44px; height: 44px; display: block; margin: 2px auto 8px; }
.de-glyph circle {
  fill: none; stroke: var(--text-muted); stroke-width: 2;
  stroke-dasharray: 4 6; stroke-linecap: round; opacity: .55;
}
.designed-empty { text-align: center; }
.designed-empty .de-head { justify-content: center; }

/* v14.6: the widget tile is the product-wide language for metricTile — System,
   Oxygen and every other caller inherit what the farm board proved */
.metric {
  position: relative;
  padding: 14px 16px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-1);
  box-shadow: var(--shadow-sm);
}
:root[data-theme="dark"] .metric {
  background: linear-gradient(127deg, rgba(6, 11, 40, .88) 20%, rgba(10, 14, 35, .62) 94%);
  border-color: rgba(226, 232, 240, .10);
}
.metric .m-k { padding-right: 40px; }

/* KPI sparkline: ink follows the tile, single series, no axes — a trend cue */
.kpi-spark { width: 84px; height: 20px; margin-top: 6px; display: block; }
.kpi-spark path { fill: none; stroke: var(--series-2); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--s4); margin-top: var(--s4); }
.ho-row-i { width: 15px; height: 15px; flex: none; }
.ho-row .ho-row-i { color: var(--text-muted); }
.ho-row.watch .ho-row-i { color: var(--warning-text); }
.ho-row.attention .ho-row-i { color: var(--critical); }

/* ═══════════════════════════════════════════════════════════════════════════
   V14 — THE DESIGN LANGUAGE (Sol)
   The shared contract every lane builds against. Nothing below is decoration:
   data-status is the single source of truth for colour, so no widget, chart or
   ring downstream ever hand-picks a hue. Status hexes are the reserved,
   CVD-validated set already in this file — they are not re-derived here.
   Standing constraints honoured: critical and stale are OPAQUE and instant
   (never behind blur, never behind a stagger delay); glass is chrome only;
   alarm colour is reserved for alarms; transform/opacity only, with a
   reduced-motion equivalent for every effect.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Space ── the board steps up: 24 and 32 where §1 has 20 and 24.
     These were --sp-5/--sp-6, re-pointed. That is not a scale, it is a token
     collision: this block sits after §1, so it won last, and every v1 screen in
     this sheet has been padding itself with the board's numbers ever since.
     Both values are right for their own surface, so neither one moves — the
     board takes its own names and §1 keeps the globals. --sp-1..--sp-4 were
     declared here a second time with identical values and are gone; they
     resolve to §1. Nothing in this block may re-point a global token again. */
  --fb-sp-5: 24px;
  --fb-sp-6: 32px;
  /* The 2px step. Carbon spacing-01, Atlassian space-025 and Polaris space-050
     all carry one, and this scale did not: hairline offsets, icon nudges and the
     concentric inset of a small component all had to round to 4 or to nothing. */
  --sp-0: 2px;

  /* ── Radius ── a ladder, plus the nesting rule that turns it into a system.
     Steps are ~1.45 apart (8 · 12 · 18 · 26) because two radii closer than
     ~1.3 read as the same value rendered twice rather than as two decisions.
     CONCENTRIC CORNERS: an element that spans the inner width of a rounded card
     must use OUTER − PADDING, or its corner and the card's corner describe two
     different circles and the eye reads the inner one as a mistake. --r-in is
     that arithmetic, and each tier re-points it when it changes its padding:
       secondary  --r-lg 18 − --sp-3 12 = 6
       primary    --r-xl 26 − --sp-5 24 = 2
       quiet      --r-md 12 − --sp-3 12 = 0, floored to 2 (a 0 radius inside a
                  rounded card reads as a bug, not as a decision) */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-full: 999px;
  --r-in: 6px;

  /* ── Text ── three levels, no more. Primary reads, secondary labels,
     tertiary is units and furniture. */
  --tx-1: #0b0b0b;
  --tx-2: #55544f;
  --tx-3: #8b8a84;

  /* ── Status ── reserved, and now DERIVED rather than re-declared. These were
     the same four hexes as --good/--warning/--critical typed a second time, and
     that duplication is exactly how one product grows two design languages:
     field.css and wall.css spend the legacy names, the widgets spend these, and
     an edit to the palette would have moved only half the product. One
     definition point (§1, --good et al.) now feeds both vocabularies.
     The hexes themselves were CVD- and contrast-validated. Do not re-pick. */
  --st-ok: var(--good);
  --st-warn: var(--warning);
  --st-crit: var(--critical);
  --st-serious: var(--serious);
  --st-unknown: #8e8d87;
  /* CALM ── the canonical definition. charts.js WG_CSS carries a copy for exactly the
     reason it copies --st-ok: a widget on a page where this sheet has not landed yet
     must not render invisible. This one is authoritative; the two must stay identical.
     Calm is not a hue. It is the ink a value is drawn in when there is nothing to say
     about it: secondary text, one step below the number it belongs to and one step
     above --st-unknown, so "normal", "stale" and "never reported" stay three distinct
     greys separated by WEIGHT and PRESENCE rather than by hue.
     THE WITHHOLDING RULE, IN THREE CLAUSES. It was one sentence -- "no colour until
     abnormal" -- and one sentence was too few. Read literally it forbids the repo's own
     CVD-validated series palette from ever appearing on a healthy chart, and it leaves
     UNTRUSTWORTHY with no vocabulary of its own. Restated, it says what it always meant:
       1  CHROME IS ACHROMATIC. No hue in surfaces, borders, veils, chrome text or icons.
          This is the half that was always right and it is enforced harder, not softer.
       2  DATA MARKS spend --series-1..4 and carry NO status meaning. Series colour is
          IDENTITY -- which line is which -- never health. Never give a series a status hue.
       3  STATUS COLOUR is reserved to --st-ok / --st-warn / --st-crit and never lands on
          a series. And DATA QUALITY IS NOT A STATUS: stale, silent, failed calibration and
          sensor fault are encoded achromatically -- dashed edge, dropped ink, grayscale
          body, an explicit age -- exactly as they already are here.
     Clause 3 is the one that earns the rule. "This number is old" and "this number is
     dangerous" have to be separable at a glance and both true at once, which on Volta Lake
     they routinely are. Withholding is what keeps them apart: give staleness a hue and it
     starts competing with the alarm palette for the same channel. The rule was mis-stated,
     not wrong.
     A HEALTHY FARM RENDERS WITH ZERO SATURATED PIXELS. --st-ok survives only for chrome
     that states a verdict in words — a legend, a pill, a written outcome — and never for
     the resting state of a tile, a dot, a trend or a pip. A channel that is always on
     carries nothing, and a board where every healthy tile is green cannot make the one
     sick tile stand out.
     --st-calm-dim stays at 14% in dark as well, unlike the *-dim ladder below: those rise
     because an alarm halo must survive a dark ground, and a calm track is meant to recede. */
  --st-calm: var(--tx-2);
  --st-calm-dim: color-mix(in srgb, var(--st-calm) 14%, transparent);
  /* dim = fills, ring tracks, halos. Never used for a stroke that carries meaning.
     Derived from the hue for the same reason — a dim that outlives its hue is a
     wrong colour waiting to happen. Same composite as the rgba() it replaces. */
  --st-ok-dim: color-mix(in srgb, var(--st-ok) 14%, transparent);
  --st-warn-dim: color-mix(in srgb, var(--st-warn) 18%, transparent);
  --st-crit-dim: color-mix(in srgb, var(--st-crit) 14%, transparent);
  --st-unknown-dim: color-mix(in srgb, var(--st-unknown) 16%, transparent);

  /* ── Status spent as TEXT and as GROUND ── the three jobs a status hue has to do
     that one hex cannot. field.css and wall.css carried these as literals
     (#8a5a00, #3a2600, #fff8e6, #fdeaea) and open-coded literals are the same
     duplication the --st-* aliases above exist to end: an edit to the palette
     would have moved the widgets and left the phone and the wall behind.

     ink   the hue as READING TEXT. --st-warn at 12px on white is 1.9:1, which is
           not text; the ink is the darkened cut that clears AA, already validated
           as --warning-text. It inverts with the theme. The hue does not.
     on    the ink that goes ON a filled status ground. One value in both themes,
           because the ground is the same amber in both.
     pale  a status GROUND at reading alpha, mixed toward --plate and not toward
           white. #fff8e6 hard-coded was a light panel that stayed light on the
           dark theme; mixed toward --plate it darkens with the page, and the ink
           that sits on it is --st-*-ink, which inverts to meet it. */
  --st-ok-ink: var(--good-text);
  --st-warn-ink: var(--warning-text);
  --st-warn-on: #3a2600;
  --st-warn-pale: color-mix(in srgb, var(--st-warn) 14%, var(--plate));
  --st-crit-pale: color-mix(in srgb, var(--st-crit) 12%, var(--plate));

  /* ── Zones ── REFERENCE, NOT STATUS, and that distinction is the whole rule.
     The track teaches where safe IS — a fact about the fish, true whether or not a
     probe ever reported. It is not a claim that the current reading is fine. So a
     green ok band would have this widget assert health it has never measured, which
     on 254 ponds with zero readings is actively false: the same error class as a
     null DO rendering as ok.
     ONE HUE, THREE INTENSITIES. Few's colour-blind rule is a single-hue intensity
     ramp, and severity is already carried on three channels — lightness, hatch
     density, height — so dropping chroma costs the ladder nothing it was using.
     The steps widen (18/30/44 against the old 20/30/38) because same-hue greys
     separate by lightness alone and need the room the hue used to give them.
     Chroma is withheld here so it can land in exactly one place: THE MARKER. A card
     with no reading then has no coloured pixel at all, which is the honest picture
     of a pond nothing has measured. */
  --zn-ok:   color-mix(in oklab, var(--st-calm) 18%, transparent);
  --zn-warn: color-mix(in oklab, var(--st-calm) 30%, transparent);
  --zn-crit: color-mix(in oklab, var(--st-calm) 44%, transparent);
  /* The hatch cannot be the zone colour painted over itself. On light the zones mix
     toward transparent, so that stacked into a darker stripe and looked deliberate;
     on dark they mix toward --plate and are OPAQUE, so the same layer painted the
     base colour onto the base colour and the texture channel silently disappeared.
     Drawn in calm ink at a fixed alpha it darkens a light band and lightens a dark
     one, so the hatch survives both themes — which matters more now than it did:
     with hue gone, texture is one of only three channels left carrying severity. */
  --zn-hatch: color-mix(in srgb, var(--st-calm) 24%, transparent);

  /* ── THE MARKER INK ── the alarm hue mixed toward ink and never used neat:
     neat --st-warn on the halo is under 2:1, so the marker would trade being the
     darkest object on the track for a hue nobody can find in Volta glare.
     These two live here because they were being authored TWICE — once in
     .band-mk and once as a literal in levels.render.js, whose comment reads
     "Same mix as .band-mk in styles.css". A comment is not a link. Two copies of
     one decision in two languages is the fork this system's seventh
     non-negotiable exists to forbid, and it is a fork that has simply not
     diverged yet. The renderer should read var(--mk-warn) / var(--mk-crit) and
     hold no percentage of its own. */
  --mk-ink:  var(--tx-1);
  --mk-warn: color-mix(in oklab, var(--st-warn) 72%, var(--tx-1));
  --mk-crit: color-mix(in oklab, var(--st-crit) 78%, var(--tx-1));

  /* STATUS AS TEXT IS A THIRD JOB, AND IT HAS ITS OWN PAIR. --st-* is surface,
     --mk-* is a mark; neither was chosen to be read as a 14px figure. Measured
     against the plate a crit panel forces: raw --st-crit is 3.79:1 on dark and
     raw --st-warn is 1.83:1 on light, both under AA, and a value that is the
     sole carrier of its own severity may not be the least legible thing on the
     panel. Both names below delegate to a colour this file already validated -
     nothing new is picked here:
       --st-crit-ink  = --mk-crit      7.01:1 light · 5.68:1 dark
       --st-warn-ink  = --warning-text 5.93:1 light · 9.93:1 dark
     The 72% mark mix is right for a stroke and lands warn at 3.62:1 as text,
     which is why warn takes the text token and not the mark one. */
  --st-crit-ink: var(--mk-crit);
  --st-warn-ink: var(--warning-text);

  /* ── Glass ── saturate() is what makes it read as glass and not as fog.
     THREE WEIGHTS, NOT ONE. A bigger surface must read as a thicker material.
     Round 2 gave sixteen tiles one 66% fill and one 20px blur, so sixteen tiles
     sat on exactly one plane and the eye had nowhere to land — that is the
     hierarchy complaint, stated in tokens. Fill and blur now step with tier.
     .42 / .66 / .80 is a ~1.5x ladder: against --surface-2 that is roughly two
     perceptual steps of surface lightness, visible at a glance without any of
     the three ceasing to be glass. Blur steps with it because a thicker
     material diffuses more, and because the hero is the only tile large enough
     for a 28px blur to be worth its compositing cost. */
  --glass-a-quiet: rgba(255, 255, 255, .42);
  --glass-a-mid:   rgba(255, 255, 255, .66);
  --glass-a-hero:  rgba(255, 255, 255, .80);
  --glass-b-quiet: 12px;
  --glass-b-mid:   20px;
  --glass-b-hero:  28px;
  /* --glass-bg / --glass-blur / --glass-sat are deliberately NOT re-pointed
     here. They were, and that moved chrome this board does not own: the header,
     the tooltip, the chat panel and the sheet backdrop all read the globals, so
     the widget's mid tier was quietly overwriting a MEASURED contrast decision
     (ops/glass-contrast.mjs, DESIGN_V11.md) on four surfaces it never touches.
     The mid tier is the widget's own default, so it lives on .w. */
  --glass-brd: rgba(11, 11, 11, .09);
  --glass-hi: rgba(255, 255, 255, .92);
  --glass-shd:
    0 1px 1px rgba(11, 11, 11, .03),
    0 8px 24px -8px rgba(11, 11, 11, .10),
    0 28px 56px -18px rgba(11, 11, 11, .12);
  /* the opaque twin: critical, stale, reduced-transparency and no-backdrop-filter */
  --plate: #ffffff;

  /* ── Elevation ── large, soft, low-opacity. Never a hard drop shadow. */
  --el-0: none;
  --el-1: 0 1px 2px rgba(11, 11, 11, .05);
  --el-2: 0 2px 4px -2px rgba(11, 11, 11, .06), 0 8px 20px -8px rgba(11, 11, 11, .10);
  --el-3: 0 4px 10px -6px rgba(11, 11, 11, .08), 0 24px 56px -20px rgba(11, 11, 11, .18);

  /* ── Motion ── --ease-out is already defined above as cubic-bezier(.2,.8,.3,1)
     and is deliberately left alone; it is the same family. */
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --dur-fast: 140ms;
  --dur-med: 240ms;

  /* ── Type ────────────────────────────────────────────────────────────────
     THE STACK, and why there is no webfont. This dashboard has to render on a
     farm with a dead cellular link. A face that arrives 400 ms late is a screen
     that shows the wrong numerals at the wrong size for 400 ms, and on an alarm
     tile that is a safety defect, not a flash of unstyled text. So: system
     faces — but NAMED, which is the part that was missing. macOS resolves
     -apple-system optically on its own (SF Text below ~20px, SF Display above).
     Windows does not: Chrome maps system-ui to the static "Segoe UI" and never
     reaches the variable family at all. Naming "Segoe UI Variable Text" and
     "Segoe UI Variable Display" ahead of system-ui buys Windows the same
     optical pair macOS gets for free — the difference between a 55px numeral
     DRAWN for 55px and a 12px label scaled up. --ff-display is for numerals and
     headings only; below ~20px the Text cut is the correct face and Display
     would be too tight and too light.

     THE SCALE IS HAND-TUNED INTEGERS, NOT A RATIO: 11 · 12 · 14 · 16 · 18 · 22.
     It was 1.125 off 12, which produced 13.5 · 15.19 · 17.09 · 19.22 — not one
     integer past the first step. Every value was rounded at render anyway, so the
     ratio was decorative: it named the sizes and then did not set them.
     Worse, it SKIPPED 14px, and 14 is the single most-used size in every reference
     system — Carbon body-compact-01 14/18 and heading-compact-01 14/18 semibold
     (both are its data-table defaults), Radix size-2 14/20, M3 label-large 14/20,
     Polaris font-size-350. Not one mature system uses a geometric ratio. Carbon,
     Radix, M3 and Polaris all hand-tune an integer ladder and pack the small end
     tight, because that is where relative differences are largest and where a
     half-pixel is the difference between a hinted stem and a grey smear.
     The footprint is deliberately almost unchanged — every step moves by 0.5 to 1px
     except the top — because this is a density fix, not a redesign: the ladder still
     has to fit inside a 152px tile at 380px wide.

     THE DELIBERATE BREAK. Numerals are NOT on the text ratio. They step 1.4.
     Text is the frame, numerals are the content, and a 1.125 step between a
     quiet tile's number and the hero's reads as a mis-set value rather than as
     a rank. 1.4 is the smallest ratio at which two numerals in one viewport
     read as different TIERS. 20 · 28 · 39 · 55.

     TRACKING IS A FUNCTION OF SIZE, never a constant. Optical letter-fit
     tightens as type grows: the gaps that keep 10px legible are chasms at 55px.
     The curve runs +.09em at 10.5px to −.038em at 55px — the same shape as SF's
     own tracking table (+26/1000em at 11pt to about −40/1000em past 60pt).
     Uppercase takes the largest positive value in the set because uppercase has
     no ascender/descender silhouette: the reader is parsing letters rather than
     word shapes, and the browser default of 0 makes a 10.5px caps label a smear.

     WEIGHT is a four-step ladder so that bold can mean something. 500 is the
     new step and it does most of the work: on a translucent surface 400 loses
     optical weight against whatever is moving behind it, and 500 restores it
     without shouting. 700 is spent on exactly one thing — the row in a group
     that is wrong. If everything is 600, nothing is emphasis.

     LEADING falls as size rises, for the same reason tracking does. 1.45 and
     not 1.5 on body: 1.5 pushes a two-line note 3px past the 54px band row it
     has to share with a 39px numeral. 1.0 on numerals because a numeral's
     optical box IS its cap height — there are no descenders to leave room for,
     and any leading above 1 pushes a value off its own baseline. */
  --ff-text: -apple-system, "Segoe UI Variable Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ff-display: -apple-system, "Segoe UI Variable Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --fz-cap: 11px;     /* caps only, and uppercase at 11 next to lowercase at 12 is
                         told apart by CASE, not by size. M3 does the same:
                         label-small 11, label-medium 12. */
  --fz-lbl: 12px;     /* base */
  --fz-sm: 14px;      /* THE one that was missing. See the note below. */
  --fz-md: 16px;      /* Carbon body-01, Radix size-3, M3 body-large */
  --fz-lg: 18px;      /* Carbon / Radix / Polaris all carry 18 */
  --fz-xl: 22px;      /* M3 title-large, and where M3's tracking crosses zero.
                         19 -> 22 because 19 collided with --fz-num-s 20: two
                         steps a reader cannot tell apart are one step. */
  --fz-num-s: 20px;
  --fz-num-m: 28px;   /* 20 × 1.4           */
  --fz-num-l: 39px;   /* 28 × 1.4 = 39.2    */
  --fz-num-xl: 55px;  /* 39 × 1.4 = 54.6    */

  --tk-caps: .085em;     /* 11px uppercase   */
  --tk-lbl: .005em;      /* 12px             */
  --tk-sm: 0;            /* 14px — the size these faces are drawn for */
  --tk-md: 0;            /* 16px             */
  --tk-lg: -.010em;      /* 18px             */
  --tk-xl: -.018em;      /* 22px             */
  --tk-num-s: -.016em;   /* 20px             */
  --tk-num-m: -.022em;   /* 28px             */
  --tk-num-l: -.030em;   /* 39px             */
  --tk-num-xl: -.038em;  /* 55px             */
  /* legacy aliases, re-pointed onto the curve instead of left as constants */
  --tk-tight: var(--tk-lg);
  --tk-tighter: var(--tk-num-m);

  --fw-reg: 400;    /* prose, and nothing else */
  --fw-med: 500;    /* labels, units, nav, chrome — the default for non-prose */
  --fw-semi: 600;   /* values, active states, primary card titles */
  --fw-bold: 700;   /* the exception: the one thing in a group that is wrong */

  --lh-tight: 1;    /* numerals — the optical box is the cap height */
  --lh-snug: 1.2;   /* labels and headings */
  --lh-body: 1.45;  /* prose */

  /* ── Interaction ── the four states the five-plane ladder never had.
     THE MECHANISM IS LUMINANCE, NOT HUE. Every state is one achromatic veil at a
     different opacity — white on dark, near-black on light — so a hovered healthy
     tile gains no chroma (chroma still means abnormal, and only abnormal) and a
     hovered crit tile loses none. Material's alpha state layers are the right idea
     and the wrong material here: our crit, stale and silent tiles are OPAQUE by
     contract, so the layer has to composite identically over the --plate face and
     over all three glass weights. A veil does; a background swap does not.
     It is painted as ::after OPACITY, which keeps it compositor-only and inside
     the transform/opacity constraint, and it sits above the status tint so
     selection can never be mistaken for a status change.
     The ladder, re-measured on the real composited dark planes (L* step vs rest):
       hover   +4.0 to +5.1    active  +10.5 to +13.4
       select  +5.8 to +7.3    sel+hover +9.3/+11.6  sel+active +13.1/+16.4
     ~4 L* is the smallest step that survives a phone screen in daylight; the
     five are monotonic on every plane, so no state ever reads as another one.

     PRESSED WAS THE DEFECT, and it was a defect of ABSOLUTE size, not of ratio.
     At .085 the pressed step was +7.6..+9.5 L*, which is roughly what M3 (+9) and
     Carbon (+9.3) spend on HOVER. Hover does not exist on a touchscreen, so on the
     phone and the wall the only tactile confirmation a wet glove ever got was one
     hover-sized step. .12 is M3's pressed token exactly, and it puts press at 2.7x
     hover -- inside the field's range (M3 1.5x, Carbon 2.4x, Atlassian 3.9x) instead
     of below it at 1.9x. sel+active follows it to .15 so the ladder stays ordered. */
  --w-veil: #0b0b0b;
  --w-st-hover:      .045;
  --w-st-select:     .065;
  --w-st-active:     .12;
  --w-st-sel-hover:  .105;
  --w-st-sel-active: .15;
  /* Focus is STATUS-INDEPENDENT, which the old ring was not: it drew
     `0 0 0 2px var(--plate), 0 0 0 4px var(--st)`, so the 2px gap was --plate —
     near-black on a near-black ground, a dark moat rather than a ring — and the
     ring itself was the status hue, making keyboard focus spend the one channel
     reserved for abnormality. One solid ring in theme ink: nothing left to
     disappear, and it says "you are here", not "something is wrong". */
  --w-focus: #14213d;
  --w-sel-ink: color-mix(in srgb, var(--w-focus) 55%, transparent);

  /* ── Loading ── one number, because the threshold is a decision and not a
     per-component taste. Under 250 ms nothing is drawn: data that arrives fast
     simply appears as data, and a skeleton that flashes for 120 ms is a flicker
     the eye reads as a fault. 250 ms is where an empty frame stops reading as
     "fast" and starts reading as "broken". Spent as an animation-delay so it is
     pure CSS and no timer can leak it. */
  --w-skel-delay: 250ms;
}

/* Dark. Written twice on purpose: once for the attribute the app hard-sets in
   index.html, once for the OS preference so the language survives without it.
   Values are identical — edit both or neither. */
:root[data-theme="dark"] {
  --tx-1: #ffffff;
  --tx-2: #dde1ea;
  --tx-3: #bcc2d1;
  --st-ok-dim: color-mix(in srgb, var(--st-ok) 22%, transparent);
  --st-warn-dim: color-mix(in srgb, var(--st-warn) 24%, transparent);
  --st-crit-dim: color-mix(in srgb, var(--st-crit) 24%, transparent);
  --st-unknown-dim: color-mix(in srgb, var(--st-unknown) 20%, transparent);
  /* Dark glass carries its own weight: on a near-black ground a 5.5% fill is a
     4-point luminance step and the card disappears. Fill doubled, sides raised,
     and the top hairline taken to a real bevel (~3:1 against the navy canvas) so
     the EDGE draws the card — status tint must never be what makes a tile visible. */
  /* Zones on dark mix toward --plate, not toward transparent: calm ink at an alpha
     over near-black reads as a light source, the same ink mixed INTO the navy reads
     as a painted band. Percentages rise because a given step over a dark ground is
     a smaller luminance step than over white. Same single hue, same widened ladder;
     --zn-hatch needs no override, since calm inverts with the theme and the stripe
     simply goes from darker-than-band to lighter-than-band. */
  --zn-ok:   color-mix(in oklab, var(--st-calm) 22%, var(--plate));
  --zn-warn: color-mix(in oklab, var(--st-calm) 36%, var(--plate));
  --zn-crit: color-mix(in oklab, var(--st-calm) 52%, var(--plate));
  --glass-a-quiet: rgba(255, 255, 255, .20);
  --glass-a-mid:   rgba(255, 255, 255, .28);
  --glass-a-hero:  rgba(255, 255, 255, .36);
  --glass-brd: rgba(255, 255, 255, .44);
  --glass-hi: rgba(255, 255, 255, .68);
  --glass-shd:
    0 1px 2px rgba(0, 0, 0, .55),
    0 12px 32px -12px rgba(0, 0, 0, .65),
    0 32px 64px -22px rgba(0, 0, 0, .55);
  --plate: #232c55;
  /* The veil inverts; the alphas do not need to. Measured, the same five numbers
     give +4.0..+5.1 L* of hover on dark and -3.8 L* on light — one ladder, both
     themes. Focus ink is a near-white that clears 11:1 against every plane. */
  --w-veil: #ffffff;
  --w-focus: #f2f5ff;
  --el-1: 0 1px 2px rgba(0, 0, 0, .40);
  --el-2: 0 2px 4px -2px rgba(0, 0, 0, .40), 0 8px 20px -8px rgba(0, 0, 0, .50);
  --el-3: 0 4px 10px -6px rgba(0, 0, 0, .45), 0 24px 56px -20px rgba(0, 0, 0, .60);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tx-1: #ffffff;
    --tx-2: #dde1ea;
    --tx-3: #bcc2d1;
    --st-ok-dim: color-mix(in srgb, var(--st-ok) 22%, transparent);
    --st-warn-dim: color-mix(in srgb, var(--st-warn) 24%, transparent);
    --st-crit-dim: color-mix(in srgb, var(--st-crit) 24%, transparent);
    --st-unknown-dim: color-mix(in srgb, var(--st-unknown) 20%, transparent);
    --zn-ok:   color-mix(in oklab, var(--st-calm) 22%, var(--plate));
    --zn-warn: color-mix(in oklab, var(--st-calm) 36%, var(--plate));
    --zn-crit: color-mix(in oklab, var(--st-calm) 52%, var(--plate));
    --glass-a-quiet: rgba(255, 255, 255, .20);
    --glass-a-mid:   rgba(255, 255, 255, .28);
    --glass-a-hero:  rgba(255, 255, 255, .36);
    --glass-brd: rgba(255, 255, 255, .44);
    --glass-hi: rgba(255, 255, 255, .68);
    --glass-shd:
      0 1px 2px rgba(0, 0, 0, .55),
      0 12px 32px -12px rgba(0, 0, 0, .65),
      0 32px 64px -22px rgba(0, 0, 0, .55);
    --plate: #232c55;
    --w-veil: #ffffff;
    --w-focus: #f2f5ff;
    --el-1: 0 1px 2px rgba(0, 0, 0, .40);
    --el-2: 0 2px 4px -2px rgba(0, 0, 0, .40), 0 8px 20px -8px rgba(0, 0, 0, .50);
    --el-3: 0 4px 10px -6px rgba(0, 0, 0, .45), 0 24px 56px -20px rgba(0, 0, 0, .60);
  }
}

/* ───────────────────────── THE GRID ─────────────────────────
   12 desktop / 6 tablet / 2 phone. The widget unit is 3 columns, so four
   1x1 tiles fit a desktop row and a 4x2 spans it exactly. */
.farm-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  /* auto, not 152px. A fixed track carries no content term, so a span-2 tile
     claimed 2x152 + 24 = 328px whatever it held: Weather put an 84px strip in
     it, Water 102px of band rows, Farm a 128px ring, and .w-bd's flex:1 then
     pushed the value slot to the bottom of the leftover void. That is the whole
     reason the board looked like it was reserving space for data it does not
     have. 152 is a FLOOR, not a height, so it belongs on the tiles that need a
     floor - a tile two rows tall is tall because of what is inside it, and it
     may not claim room it is not using. */
  grid-auto-rows: auto;
  /* TWO gaps, 2:1, because one gap groups nothing. Tiles side by side in a row
     share a scan line and are read as a set; the row break is where the set
     ends, so the vertical gap is the one that has to separate. 12px holds a row
     together without letting tiles touch; 24px is the smallest value at which
     the row above stops reading as part of the row below — under about 1.8x the
     intra-group gap the eye keeps merging them (Gestalt proximity is a ratio
     judgement, not an absolute one, which is why a single 12px gap everywhere
     produced sixteen tiles and zero groups). */
  column-gap: var(--sp-3);
  row-gap: var(--fb-sp-5);
  align-items: stretch;
}
.w-1x1 { grid-column: span 3; grid-row: span 1; }
.w-2x1 { grid-column: span 6; grid-row: span 1; }
.w-2x2 { grid-column: span 6; grid-row: span 2; }
.w-4x2 { grid-column: span 12; grid-row: span 2; }
/* v14.8 — three spans the ops wall needs and the seven-tile board did not.
   All three are the SAME 12-column module. Nothing here is a second grid, which
   is the whole point: every panel edge on the page lands on one of thirteen
   verticals, so a board of eleven panels still reads as one ruled surface
   rather than as eleven independently placed cards.
     .w-4x1  the 24h timeline. Full bleed, one row. A time axis has to span the
             board, or NOW sits at an arbitrary x and stops being a page-wide
             reference line that the panels above and below can be read against.
     .w-3x2  the fleet matrix. Nine of twelve, two rows: 254 cells want width
             far more than they want height, and nine leaves exactly one .w-1x2
             beside it — so matrix and feed occupy one band and are read as the
             pair they actually are ("what is wrong" next to "what just
             happened") instead of as two unrelated panels.
     .w-1x2  the tall narrow column. Event feed, monitoring health. One quiet
             width, two rows, so a list can be long without its panel being
             wide, and two of them stack beside a 2x2 without a ragged edge. */
.w-4x1 { grid-column: span 12; grid-row: span 1; }
.w-3x2 { grid-column: span 9;  grid-row: span 2; }
.w-1x2 { grid-column: span 3;  grid-row: span 2; }
/* THE FLOOR IS ON THE DRAWING, NOT ON THE CELL.
   min-height on a grid ITEM pins the implicit row that item sits in. A 2x2 spans
   two implicit rows, so one floored 1x1 sharing either of them dragged the 2x2 to
   2 x 152 + 24 = 328px however little it held. Nothing is biting today — Weather
   measures 310 and Water 275, and no band currently mixes the spans — but that is
   an accident of composition, not a property of the CSS, and it stops being true
   the first time anyone drops a 1x1 into the Weather or Water band.
   Moving the floor onto .w-bd removes the mechanism instead of the symptom: no
   item pins a track any more, so a spanning tile is always sized by what is
   inside it, and the interaction cannot be reintroduced by markup.
   The property the floor was actually bought for survives — three quiet tiles in
   a row still agree about their height, because they all reserve the same drawing
   box, and grid stretches a row to its tallest item anyway.
   44px is what the quiet drawings actually draw at. The old 152 wrapped a 44px
   mark in a 79px body: 44% of the tile paying rent on nothing, which on a board
   whose whole argument is restraint reads as reserved space for data we do not
   have. */
.w-1x1 .w-bd, .w-2x1 .w-bd { min-height: 44px; }
/* ...but a floor is for a drawing, and widget() builds .w-bd whether or not a
   `kind` was passed. Farm passes none: measured on the live board it is a 117px
   tile holding a 44px box with nothing in it — the exact "reserved space for data
   we do not have" the paragraph above says it removed. It removed it for the
   tiles that draw something small and left it on the one tile that draws nothing.
   :empty is the whole mechanism: a body with no child cannot claim a floor, so
   Farm falls to 73px and stops implying a mark is loading. */
.w-bd:empty { display: none; }
.w-1x1, .w-2x1, .w-2x2, .w-4x2,
.w-4x1, .w-3x2, .w-1x2 { min-height: 0; }

@media (max-width: 1100px) {
  .farm-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .w-1x1 { grid-column: span 3; }
  .w-2x1, .w-2x2, .w-4x2 { grid-column: span 6; }
  /* At six columns the matrix gives up its neighbour rather than its width: a
     254-cell field narrowed to four columns of six stops being scannable long
     before the feed beside it stops being readable. */
  /* THE ROW SPANS GO HERE, not only at 700. .w-1x2 and .w-3x2 are the first
     pair on this board designed to sit BESIDE each other while both spanning
     two rows, and that is exactly where a grid-auto-rows: auto grid goes
     ragged: two items sharing a pair of implicit tracks are both sized by
     whichever is taller, so a matrix that wants a third row drags the feed
     beside it into ~100px of empty tile — the "reserved space for data we do
     not have" the grid comment above spends a page removing everywhere else.
     The fix is not a floor and not a fixed height, both of which reintroduce
     the mechanism. It is to STOP SHARING. At six columns the timeline and the
     matrix are already full width and have no neighbour left to align with, so
     the row span buys nothing and costs that. */
  .w-4x1, .w-3x2 { grid-column: span 6; grid-row: span 1; }
  .w-1x2 { grid-column: span 3; grid-row: span 1; }
}
@media (max-width: 700px) {
  .farm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--sp-2); row-gap: var(--sp-4); }
  /* No phone floor. A tile is now sized by the drawing it holds, and a 44px mark
     is 44px at every viewport — the 136px counterpart to 152 had nothing left to
     do. */
  .w-1x1 { grid-column: span 1; }
  .w-2x1, .w-2x2, .w-4x2 { grid-column: span 2; }
  /* .w-1x2 goes to the FULL two columns and not one. At 380px one column is
     ~178px, and a three-column event row in 178px is a time, four characters of
     cage and an ellipsis — a panel that renders without telling you anything,
     which is the failure mode this whole round exists to remove. A tall narrow
     panel on a wall is a tall WIDE panel on a phone; only the row count gives. */
  .w-4x1, .w-3x2, .w-1x2 { grid-column: span 2; grid-row: span 1; }
}

/* The overview is a plane, not a card. Widgets are the only thing that floats. */
.farm-overview { display: block; padding: 0 0 var(--fb-sp-5); }

/* ───────────────────────── THE WIDGET ─────────────────────────
   data-status sets --st and --st-fill. Everything inside — dot, ring stroke,
   level fill, pip, glass tint — reads those two. Nothing hand-colours. */
.w {
  /* The mid tier is the widget's default: .w-1x1 drops to quiet, .w-2x2/.w-4x2
     rise to hero. It is set here and not on :root because :root also feeds the
     V11 chrome, which has its own measured alphas and must not move with a
     widget decision. Dark inherits correctly: --glass-a-mid is re-declared per
     theme, so this one line is right in both. */
  --glass-bg: var(--glass-a-mid);
  --glass-blur: var(--glass-b-mid);
  --glass-sat: 180%;
  --st: var(--st-unknown);
  --st-fill: var(--st-unknown-dim);
  --tint: .04;
  /* HOW FAR THE WASH REACHES - A LENGTH, NOT A PERCENTAGE. The rule below has
     always said it is a wash off the top edge and never a filled card, and on a
     1x1 that was true. The stop was a percentage, so the alarm surface scaled
     with the panel instead of with the finding: one crit painted about 24k
     square px on a 1x1 and about 96k on the 2x2 Monitoring and Activity panels.
     Measured on the live board, that is 19 percent of the entire panel surface
     spent on two numbers whose own ink covers less than a fifth of one percent.
     Area is not severity. Worse, it laid crit ink on a crit ground, which is the
     lowest-contrast placement available for the one figure that must be found.
     A fixed band marks the header and stops above the reading, so every value on
     this board sits on plate. Panel-level severity moves to the top rule and the
     border: both constant cost, neither growing with the rectangle. */
  --tint-reach: 44px;

  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--glass-brd);
  border-top-color: var(--glass-hi);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow: var(--glass-shd), inset 0 1px 0 var(--glass-hi);
  color: var(--tx-1);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  overflow: hidden;
}
/* ok resolves to CALM, and this single line is what keeps a quiet tile quiet: --st and
   --st-fill feed the top-edge wash, the status dot and its halo, .st-ink/.st-face, the
   level fill and the focus ring at once, so none of them can disagree about withholding.
   warn/crit/unknown are untouched and are now the only chroma on a healthy board — which
   is the point: withholding here is what makes the one bad reading unmissable. */
.w[data-status="ok"]      { --st: var(--st-calm);    --st-fill: var(--st-calm-dim);    --tint: .05; }
.w[data-status="warn"]    { --st: var(--st-warn);    --st-fill: var(--st-warn-dim);    --tint: .11; }
/* CRIT SPENDS NO WASH. Every other status keeps its top-edge gradient because
   the gradient is the only surface channel it has. Crit has the 3px annunciator
   band below, which is a stronger signal and a cheaper one: the band costs the
   same on a 1x1 and on a 4x2, and a 44px wash costs whatever the panel is wide.
   Running both meant a critical 4x2 spent about eight times the alarm surface of
   a critical 1x1 to report the same one fact, and two of them side by side read
   as two red rectangles rather than as two findings. --st-fill is untouched: it
   feeds the dot halo, .st-face and the level fills, which are marks and not
   fields, and a mark does not grow with its panel. */
.w[data-status="crit"]    { --st: var(--st-crit);    --st-fill: var(--st-crit-dim);    --tint: 0; }
.w[data-status="unknown"] { --st: var(--st-unknown); --st-fill: var(--st-unknown-dim); --tint: .04; }

/* the status tint — a wash off the top edge, never a filled card */
.w::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, var(--st) 0, transparent var(--tint-reach));
  opacity: var(--tint);
}

/* Critical is opaque and immediate. Blur delays comprehension; an alarm may
   not be softened, may not be staggered, may not fade in. */
.w[data-status="crit"],
.w[data-stale],
.w[data-silent] {
  background: var(--plate);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: none !important;
  animation-delay: 0ms !important;
  opacity: 1 !important;
  transform: none !important;
}
/* THE ANNUNCIATOR RULE. Panel-level crit is a 3px line at the top edge, not a
   filled card. A line costs the same on a 1x1 and on a 4x2, so two adjacent
   critical panels annunciate twice rather than eight times - the count the
   operator needs is of findings, not of rectangles. It is a border and not a
   shadow because selection, hover and focus all rewrite box-shadow and would
   quietly demote it. It is drawn as a background band rather than as a wider
   border because the padding scale is set further down this file by [data-dense]
   and [data-tier], which would win the cascade and let a 3px border push a
   panel's contents down 2px at the moment it turned crit - a tile that moves
   while somebody is reading it. A background band costs no layout at all.
   The background shorthand two rules up resets background-image, so the longhand
   has to be re-stated here, after it.

   THE RULE BOUGHT ONE CHANNEL AND NOBODY TOOK THE OTHERS AWAY. Alongside the
   band, crit was also painting a full perimeter border, a 1px outer ring and a
   44px top wash -- four channels, three of them area-proportional, on a panel
   whose finding is one number. The perimeter is the worst of them: it is the
   only one that traces the whole rectangle, so it is exactly the "count of
   rectangles" the paragraph above rejects. All three are gone. Panel-level crit
   is now the band, the status dot and the value's own ink: one shape channel,
   one mark and one figure, none of which grows when the panel does, and none of
   which is hue alone. The opaque plate, the killed blur and the killed animation
   two rules up are untouched -- an alarm may still not be softened or delayed. */
.w[data-status="crit"] {
  background-image: linear-gradient(var(--st-crit), var(--st-crit));
  background-repeat: no-repeat;
  background-position: top center;
  background-size: 100% 3px;
  box-shadow: var(--el-3);
}
.w[data-stale], .w[data-silent] { border-style: dashed; border-color: var(--st-unknown); }
.w[data-stale] .w-val, .w[data-silent] .w-val { color: var(--tx-2); }
.w[data-status="crit"][data-stale] .w-val,
.w[data-status="crit"][data-silent] .w-val { color: var(--tx-1); }
/* The dashed edge and age label carry staleness. Dimming the whole body hides
   the evidence an operator needs to understand why the state is stale. */
.w[data-stale] .w-bd,
.w[data-silent] .w-bd { opacity: 1; filter: none; }

/* header ─ two words, an icon, a state dot. No sentence lives here. */
.w-hd { display: flex; align-items: center; gap: var(--sp-2); min-height: 16px; }
/* The DEFAULT header is the quiet treatment, because the quiet tile is the most
   common tile. Tiers below raise it; nothing lowers it. Set at 500 so the tier
   that matters can reach 600 and still leave 700 free for an actual fault. */
/* The header runs glyph + title + whatever the tile hangs on the right, and none
   of it could shrink: measured at 1700 the Activity and Monitoring headers were
   437 and 445 in 426 and 434px tiles, so the title ran eleven pixels past the
   padding it is supposed to sit inside. Nothing was cut, because .w-hd's overflow
   is visible - which is worse, not better: the label silently left the tile's
   optical edge and took the board's alignment with it. The title is the only part
   of that row that can give, so it is the part that gives, into an ellipsis. */
.w-hd { min-width: 0; }
.w-hd h3 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
  font-family: var(--ff-text);
  font-size: var(--fz-cap);
  font-weight: var(--fw-med);
  line-height: var(--lh-snug);
  letter-spacing: var(--tk-caps);
  text-transform: uppercase;
  color: var(--tx-3);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.w-ico { width: 15px; height: 15px; flex: none; color: var(--tx-3); display: inline-flex; opacity: .8; }
.w-ico svg { width: 100%; height: 100%; display: block; }

.dot {
  position: relative;
  margin-left: auto;
  flex: none;
  width: 8px; height: 8px;
  border-radius: var(--r-full);
  background: var(--st);
  box-shadow: 0 0 0 3px var(--st-fill);
}
.w[data-status="crit"] .dot::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: var(--r-full);
  border: 1px solid var(--st-crit);
  animation: w-pulse 1.7s var(--ease-out) infinite;
}

/* body ─ the visual. A chart, a ring, a bar. Never a paragraph. */
.w-bd {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.w-mount {
  flex: 1 1 auto;
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* An svg that is a DRAWING fills its mount; an svg that is an ICON is sized in
   ems and never scales with its container. An icon carries a viewBox and no
   intrinsic width, so under max-* alone it grows to fill the flex-centred body.
   Every renderer's root is the mount's only child — wgFrame replaces the mount's
   children — so the child combinator IS the discriminator, and nothing deeper
   than one level may fill. */
/* ...and 1.15em of a caption in a dense tile is 13px of a 24-unit drawing, which
   is where a condition glyph stops being a sun and becomes a smudge. The floor is
   in px on purpose: em is the right unit for the relationship and the wrong one
   for legibility, so the icon tracks its type down to the point where it would
   stop reading and no further. 14px is the smallest a 24-grid stroke survives at
   arm's length in daylight, and it is what the board already draws its smallest
   icons at. */
.w-bd svg { width: 1.15em; height: 1.15em; min-width: 14px; min-height: 14px; flex: none; }

/* -- ICONS ON A TEXT ROW ---------------------------------------------------
   The weather conditions sit beside words, not inside a drawing box, and an svg
   is a block: its baseline is its bottom margin edge, so in a baseline-aligned
   row the glyph hangs about a fifth of an em above the letters it belongs to and
   reads as floating. Every text row on a tile gets the same correction rather
   than the weather strip alone - a glyph beside a word is one relationship, and
   it should not depend on which panel it landed in.
   Two channels, because there are two contexts. In .w-ft and the row slot the svg
   is a flex child, display is blockified and vertical-align is inert, so the
   negative bottom margin is what lowers it onto the cap. In .w-note the svg sits
   in an inline run, where inline-block and vertical-align do the same work.
   Neither is a hack the other has to know about, and both land the glyph in the
   same place.
   NOT align-self: center. Weather's footer holds a 55px numeral, and centring an
   18px icon against that line box parks it in the middle of nowhere - the icon
   belongs to the text beside it, not to the tallest thing sharing its row.
   The em size and the px floor are the rule above's, restated here because these
   rows are outside .w-bd: an icon shrinks with its label exactly as far as it can
   still be read, and then stops. */
:is(.w-ft, .w-note, .w-rk, .w-rv, .w-ru) svg[viewBox="0 0 24 24"] {
  width: 1.15em; height: 1.15em;
  min-width: 14px; min-height: 14px;
  flex: none;
  display: inline-block;
  vertical-align: -0.18em;
  margin-bottom: -0.18em;
}
.w-bd > svg, .w-mount > svg, .w-bd canvas {
  display: block; width: auto; height: auto;
  max-width: 100%; max-height: 100%; flex: 0 1 auto;
}

/* The first farm question is a time series, not a paragraph. The current reading
   remains in the widget footer while these compact chips state the evidence basis
   and the plot preserves the full horizontal scale. */
.farm-do {
  width: 100%; min-width: 0; align-self: stretch;
  display: grid; grid-template-rows: auto minmax(210px, 1fr); gap: var(--sp-2);
}
.farm-do-meta { display: flex; flex-wrap: wrap; gap: var(--sp-1); min-width: 0; }
.farm-do-chip {
  display: inline-flex; align-items: center; min-height: 24px;
  padding: 3px var(--sp-2); border: 1px solid var(--glass-brd);
  border-radius: var(--r-full); background: color-mix(in srgb, var(--plate) 86%, var(--tx-1) 5%);
  color: var(--tx-2); font-size: var(--fz-cap); font-weight: var(--fw-med);
  line-height: var(--lh-snug); white-space: nowrap;
}
.farm-do-chip[data-status="warn"] { border-color: var(--st-warn); color: var(--st-warn-ink); }
.farm-do-chip[data-status="crit"] { border-color: var(--st-crit); color: var(--st-crit-ink); }
.farm-do-chart { width: 100%; min-width: 0; min-height: 210px; align-self: stretch; }
.farm-do-chart > svg.chart {
  display: block; width: 100%; height: 230px; max-width: 100%; max-height: none;
  overflow: visible; flex: none;
}
/* Absence is carried by the dashed edge and missing marker, not by a darker card.
   This keeps every Farm widget equally present without painting missing data healthy. */
.farm-overview .w[data-empty="true"] {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow: var(--glass-shd), inset 0 1px 0 var(--glass-hi);
}
/* The track already shows absence through a missing marker and a muted dashed card.
   Repeating "never measured" over every row is prose, not another data channel. */
.farm-overview [data-widget="bands"] text.wg-u.t-cap.wg-halo { display: none; }

/* Monitoring has two comparable availability ratios and three incomparable facts.
   Ratios use common-scale length; lag, quarantine and alarm age remain labelled
   figures so no decorative gauge implies they share a unit. */
.monitor-viz { width: 100%; min-width: 0; align-self: stretch; display: grid; gap: var(--sp-3); }
.monitor-meter { display: grid; gap: var(--sp-1); }
.monitor-meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); }
.monitor-meter-label, .monitor-stat-label {
  color: var(--tx-3); font-size: var(--fz-cap); font-weight: var(--fw-med);
  letter-spacing: var(--tk-caps); text-transform: uppercase;
}
.monitor-meter-value {
  color: var(--tx-1); font-size: var(--fz-sm); font-weight: var(--fw-semi);
  font-variant-numeric: tabular-nums;
}
.monitor-meter-track {
  position: relative; height: 8px; overflow: hidden; border-radius: var(--r-full);
  background: var(--st-unknown-dim); box-shadow: inset 0 0 0 1px var(--glass-brd);
}
.monitor-meter-fill {
  position: absolute; inset: 0 auto 0 0; min-width: 0; border-radius: inherit;
  background: var(--st-calm); transition: width var(--dur-med) var(--ease-out);
}
.monitor-meter[data-status="warn"] .monitor-meter-fill { background: var(--st-warn); }
.monitor-meter[data-status="crit"] .monitor-meter-fill { background: var(--st-crit); }
.monitor-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.monitor-stat {
  min-width: 0; padding: var(--sp-2); border: 1px solid var(--glass-brd);
  border-radius: var(--r-md); background: color-mix(in srgb, var(--plate) 90%, var(--tx-1) 3%);
  display: grid; gap: 2px;
}
.monitor-stat-value {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--tx-1); font-size: var(--fz-sm); font-weight: var(--fw-semi);
  font-variant-numeric: tabular-nums;
}
.monitor-stat-unit { color: var(--tx-3); font-size: var(--fz-cap); }
.monitor-stat[data-status="warn"] .monitor-stat-value { color: var(--st-warn-ink); }
.monitor-stat[data-status="crit"] .monitor-stat-value { color: var(--st-crit-ink); }

@media (max-width: 700px) {
  .farm-do { grid-template-rows: auto minmax(190px, 1fr); }
  .farm-do-chart { min-height: 190px; }
  .farm-do-chart > svg.chart { height: 210px; }
  .monitor-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* footer ─ value, unit, delta */
.w-ft { display: flex; align-items: baseline; gap: var(--sp-1); min-width: 0; }
.w-val {
  font-family: var(--ff-display);
  font-size: var(--fz-num-m);
  font-weight: var(--fw-semi);
  line-height: var(--lh-tight);
  letter-spacing: var(--tk-num-m);
  color: var(--tx-1);
  font-variant-numeric: tabular-nums lining-nums;
}
/* The unit is not the value. It sits a full type step below it and a weight
   step under it, so "4.6" and "mg/L" are never read as one word. */
.w-un { font-size: var(--fz-lbl); font-weight: var(--fw-med); color: var(--tx-3); letter-spacing: var(--tk-lbl); }
.w-dlt {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--fz-lbl);
  font-weight: var(--fw-semi);
  /* POSITIVE tracking at 12px. The old value here was −.02em, inherited from a
     token meant for large numerals — negative tracking on 12px text closes the
     counters and is exactly the mistake the size-specific curve exists to stop. */
  letter-spacing: var(--tk-lbl);
  color: var(--tx-2);
  font-variant-numeric: tabular-nums lining-nums;
}
/* direction draws the chevron; meaning colours it. Up is not automatically good
   on a farm — a rising temperature is not a win. */
.w-dlt::before { content: ""; width: 0; height: 0; border: 4px solid transparent; }
.w-dlt[data-dir="up"]::before   { border-bottom-color: currentColor; margin-bottom: 3px; }
.w-dlt[data-dir="down"]::before { border-top-color: currentColor; margin-top: 3px; }
.w-dlt[data-dir="flat"]::before { border: 0; width: 7px; height: 1.5px; background: currentColor; opacity: .6; }
/* and a good trend is still not news: a move in the right direction is the normal state
   of a working farm, so it is drawn in calm ink. Only "bad" spends the alarm channel. */
.w-dlt[data-trend="good"] { color: var(--st-calm); }
.w-dlt[data-trend="bad"]  { color: var(--st-crit); }

/* ── THE SUPPORTING STACK ── `.w-note` was authored in the markup and never in
   the stylesheet, so three note lines rendered at the body default: 14px, 400,
   and --tx-1 — the same ink as the 55px numeral above them, at prose size,
   three times over. On Weather that is 129px of the tile's 370 (35%) against the
   strip's 90 (24%): the support outweighs the evidence it supports, 1.43 : 1,
   which is precisely why the tile reads as a list instead of as a composition.

   They are not peers and they are not paragraphs. The FIRST note is the causal
   sentence — why the number is what it is — and it is the only one set at
   reading weight. Every note after it is a qualifier or a window summary: an
   annotation on something the drawing above already contains, so it drops to
   caption size and --tx-3 and joins the sentence as one block rather than
   standing up as its own paragraph. The 4px continuation step, against the
   column's own 8/16 gap, is what fuses them into one object; the measure stops
   the sentence running the full width of a 4x2 and turning a tile into a page. */
.w-note {
  font-size: var(--fz-lbl);
  font-weight: var(--fw-reg);
  line-height: var(--lh-body);
  color: var(--tx-2);
  max-width: 68ch;
}
.w-note + .w-note {
  font-size: var(--fz-cap);
  color: var(--tx-3);
  /* the column's gap, cancelled back to --sp-1. Written as the gap's own token
     minus 4 so it can never disagree with the gap it exists to cancel. */
  margin-top: calc(var(--sp-1) - var(--sp-2));
}
.w-1x1 .w-note + .w-note { margin-top: calc(var(--sp-1) - 6px); }
/* --sp-2, not --sp-4: BOTH of these tiles run at the 8px tier gap in practice -
   Water through data-tier and Weather through the board-scale rule above - and
   cancelling a 16px gap that is actually 8 subtracts 12 from 8 and laps the
   second note four pixels over the first. A cancel has to name the gap the tile
   is really set at, so it names the one the board uses. */
.w-2x2 .w-note + .w-note,
.w-4x2 .w-note + .w-note { margin-top: calc(var(--sp-1) - var(--sp-2)); }

/* age chip ─ a reading that stopped updating must never read as current */
.w-age {
  font-size: var(--fz-cap);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tk-caps);
  text-transform: uppercase;
  color: var(--tx-3);
  padding: 2px var(--sp-1);
  border-radius: var(--r-sm);
  background: var(--st-unknown-dim);
}
.w[data-stale] .w-age, .w[data-silent] .w-age { color: var(--st-warn); background: var(--st-warn-dim); }

/* ═══════════ TIERS ─ the fix for sixteen tiles of equal weight ═══════════
   Round 2 differentiated by DIMENSION alone: same fill, same blur, same border,
   same radius, same padding ratio, same label treatment. Sixteen equals average
   to noise and the eye gets no entry point. A tile now declares its rank on
   seven channels at once, of which size is only one:

     channel     quiet (1x1)      secondary (2x1)   primary (2x2 / 4x2)
     fill        42%              66%               80%
     blur        12px             20px              28px
     shadow      --el-1           --el-2            --glass-shd (3 layers)
     radius      12px             18px              26px
     padding     10 / 12          12 / 16           20 / 24
     label       10.5 / 500/tx-3  10.5 / 500/tx-3   12 / 600 / tx-2
     numeral     20px             28px              39 – 55px

   After fill, PADDING is the strongest of the seven: 24 against 12 is a 2:1
   whitespace ratio, and whitespace around a figure is read as importance long
   before the figure itself is read. Radius steps with the tile because a large
   card with a small radius reads as cropped and a small card with a large one
   reads as a button; the ~1.45 radius ladder is the same ladder as the tokens.

   WHAT DOES NOT CHANGE WITH TIER: the value's ink. A quiet tile recedes through
   its surface, its label and its chrome — never by dimming the number. Greying
   data to calm a layout is how a dashboard starts misrepresenting how confident
   it is, and this product's whole claim is that it does not do that. --tx-1 on
   every tier, at every size. */

/* ── quiet ── the count tiles. It has a frame and it holds its cell; it makes
   no claim until the number inside it changes. Top padding is 10 and not 12
   because a 10.5px uppercase label carries ~2px of optical space above its cap
   height, so 10px of box padding equals 12px of seen space on the other sides. */
.w-1x1 {
  --glass-bg: var(--glass-a-quiet);
  --glass-blur: var(--glass-b-quiet);
  --r-in: 2px;
  padding: 10px var(--sp-3) var(--sp-3);
  border-radius: var(--r-md);
  border-color: color-mix(in srgb, var(--glass-brd) 65%, transparent);
  box-shadow: var(--el-1), inset 0 1px 0 color-mix(in srgb, var(--glass-hi) 60%, transparent);
  gap: 6px;
}
.w-1x1 .w-val { font-size: var(--fz-num-s); letter-spacing: var(--tk-num-s); }
.w-1x1 .w-hd h3 { color: var(--tx-2); }
.w-1x1 .w-ico { width: 14px; height: 14px; color: var(--tx-2); opacity: .9; }

/* ── secondary ── the reference tier. Every channel sits at the language's
   middle value, so the other two tiers are read against it rather than against
   an abstraction. */
.w-2x1 { box-shadow: var(--el-2), inset 0 1px 0 var(--glass-hi); }
.w-2x1 .w-ico { width: 16px; height: 16px; opacity: .9; }

/* ── primary ── the Farm hero and the Water card. Thicker material, deeper
   shadow, twice the whitespace, and the only tiles whose title is set as a
   title rather than as a caption. */
.w-2x2, .w-4x2 {
  --glass-bg: var(--glass-a-hero);
  --glass-blur: var(--glass-b-hero);
  --r-in: 2px;
  padding: 20px var(--fb-sp-5) var(--fb-sp-5);
  border-radius: var(--r-xl);
  gap: var(--sp-4);
}
.w-2x2 .w-hd, .w-4x2 .w-hd { min-height: 20px; }
/* 12px uppercase takes LESS tracking than 10.5px uppercase — the size-specific
   rule, demonstrated inside a single component so it cannot be argued with. */
.w-2x2 .w-hd h3, .w-4x2 .w-hd h3 {
  font-size: var(--fz-lbl);
  font-weight: var(--fw-semi);
  letter-spacing: .07em;
  color: var(--tx-2);
}
.w-2x2 .w-ico, .w-4x2 .w-ico { width: 18px; height: 18px; color: var(--tx-2); opacity: 1; }
.w-2x2 .dot, .w-4x2 .dot { width: 9px; height: 9px; box-shadow: 0 0 0 4px var(--st-fill); }
/* The numeral is row three of the tier table above — a TIER channel — but it was
   keyed to the SIZE class, which is the one axis widget() takes care to keep
   separate. The two agree today only because promote() happens to set both. They
   part on exactly the day that matters: when Attention wins the primary slot,
   Weather demotes to secondary and keeps its 4x2 width, and 55px — the largest
   figure in the product — is then spent on an advisory forecast while an incident
   is open. Keyed to the tier, that tile reads 28 and the hero holds the only 55
   on the page, which is what "hero" was supposed to mean. Size still modulates
   WITHIN primary (39 at 2x2, 55 at 4x2); it no longer decides rank. */
.w[data-tier="secondary"] .w-val { font-size: var(--fz-num-m); letter-spacing: var(--tk-num-m); }
.w[data-tier="primary"].w-2x2 .w-val { font-size: var(--fz-num-l); letter-spacing: var(--tk-num-l); }
.w[data-tier="primary"].w-4x2 .w-val { font-size: var(--fz-num-xl); letter-spacing: var(--tk-num-xl); }

/* ── ink hooks ── the only sanctioned way to colour a mark inside a widget.
   Mira: put these classes on the SVG element, never a fill/stroke attribute. */
.w .st-ink   { stroke: var(--st); fill: none; }
.w .st-track { stroke: var(--st-fill); fill: none; }
.w .st-face  { fill: var(--st); stroke: none; }
.w .st-veil  { fill: var(--st-fill); stroke: none; }

/* level bar and pip row — pure CSS, so they inherit --st for free */
.lvl { position: relative; width: 100%; height: 8px; border-radius: var(--r-full); background: var(--st-fill); overflow: hidden; }
.lvl-fill { position: absolute; inset: 0 auto 0 0; width: var(--lvl, 0%); border-radius: inherit; background: var(--st); transition: width var(--dur-med) var(--ease-out); }
.lvl.tall { width: 8px; height: 100%; }
.lvl.tall .lvl-fill { inset: auto 0 0 0; width: 100%; height: var(--lvl, 0%); transition: height var(--dur-med) var(--ease-out); }

/* THE PIP FIELD. Round 2 drew 254 identical 10px rounded squares in a dim grey:
   a loud texture carrying no information, because when every cell looks the same
   the field says nothing at all. Silence has to LOOK like silence. A device that
   has never reported is now a 1px centre dot inside a 6px cell — a faint, even
   weave — and a device with an actual status is the only FILLED cell in that
   weave, so one warn pip among 254 is findable in a single saccade. Two channels
   as always: fill PRESENCE first, hue second. 6px and not 10 because at 10px
   254 pips are a wall; at 6px on a 3px gutter they are one object with
   exceptions in it, which is what a fleet actually is. */
.pips { display: flex; flex-wrap: wrap; gap: 3px; }
.pip { width: 6px; height: 6px; border-radius: 1.5px; background: var(--st-unknown); flex: none; }
.pip[data-status="ok"]      { background: var(--st-calm); }
.pip[data-status="warn"]    { background: var(--st-warn); box-shadow: 0 0 0 1px var(--st-warn-dim); }
.pip[data-status="crit"]    { background: var(--st-crit); box-shadow: 0 0 0 1px var(--st-crit-dim); }
.pip[data-status="unknown"] {
  background: radial-gradient(circle at 50% 50%, var(--st-unknown) 0 .9px, transparent 1.1px);
  box-shadow: none;
  opacity: .6;
}

/* ───────────────────────── MOTION ─────────────────────────
   Transform and opacity only. Interruptible transitions, not keyframes, for
   anything a pointer touches. */
/* THE STATE VEIL. One layer, four states, no hue. z-index -1 puts it under the
   content and — being later in source than ::before — over the status tint, so a
   selected crit tile still reads crit through it. border-radius: inherit because
   a square veil inside an 18px corner is the tell that something was bolted on. */
.w::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  background: var(--w-veil);
  opacity: var(--w-state, 0);
  transition: opacity var(--dur-fast) var(--ease-out);
}

/* SELECTED ─ a state that persists, so it gets a persistent MARK as well as a
   surface step. The mark is achromatic and 1.5px INSIDE the edge: inside, so it
   cannot be confused with the focus ring outside it and both can show at once;
   achromatic, so selecting a crit tile does not add a second colour to an alarm
   and selecting a healthy one does not add a first. The crit line below re-states
   the severity shadow rather than letting selection quietly demote it. */
.w[data-selected], .w[aria-selected="true"] {
  --w-state: var(--w-st-select);
  box-shadow: var(--glass-shd), inset 0 0 0 1.5px var(--w-sel-ink);
}
.w[data-status="crit"][data-selected], .w[data-status="crit"][aria-selected="true"] {
  box-shadow: var(--el-3), inset 0 0 0 1.5px var(--w-sel-ink);
}

@media (hover: hover) and (pointer: fine) {
  .w[tabindex], .w[role="button"], a.w, button.w {
    transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  }
  .w[tabindex]:hover, .w[role="button"]:hover, a.w:hover, button.w:hover {
    --w-state: var(--w-st-hover);
    transform: translateY(-2px); box-shadow: var(--el-3);
  }
  .w[data-selected]:hover, .w[aria-selected="true"]:hover { --w-state: var(--w-st-sel-hover); }
}
/* PRESSED is brighter than hover, not darker. On a dark ground the ink is light,
   so "more energy" is up the ladder in both themes; a pressed tile that darkened
   here would read as disabled. The scale is the confirmation, the step is the
   state — and the step is what a crit or stale tile actually gets, since those
   are pinned to transform: none and until now had no pointer feedback at all. */
.w[tabindex]:active, .w[role="button"]:active, a.w:active, button.w:active {
  --w-state: var(--w-st-active);
  transform: scale(.985);
}
.w[data-selected]:active, .w[aria-selected="true"]:active { --w-state: var(--w-st-sel-active); }

/* FOCUS ─ outline, not box-shadow, so a selected tile keeps its inset mark and a
   crit tile keeps its severity shadow. 1px offset leaves a hairline of ground
   between ring and face; the old rule made that gap 2px of --plate, which on this
   canvas is a near-black band on a near-black tile — the ring existed and could
   not be seen. Contrast of #f2f5ff against all five dark planes:
     canvas #0a0e27 17.4:1 · plate #0d1330 16.7:1 · quiet glass #191c34 15.3:1
     mid glass #25293f 13.2:1 · hero glass #31354a 11.1:1
   and #14213d against the five light planes runs 14.7:1 to 16.0:1. focus-visible,
   so a wet thumb never paints it and a 5am keyboard always does. */
.w:focus-visible { outline: 3px solid var(--w-focus); outline-offset: 1px; }

/* Entrance: a short stagger so the plane assembles rather than blinks in.
   Capped at eight — beyond that the last tile feels late. */
.farm-grid > .w { animation: w-in var(--dur-med) var(--ease-out) both; }
.farm-grid > .w:nth-child(1) { animation-delay: 0ms; }
.farm-grid > .w:nth-child(2) { animation-delay: 35ms; }
.farm-grid > .w:nth-child(3) { animation-delay: 70ms; }
.farm-grid > .w:nth-child(4) { animation-delay: 105ms; }
.farm-grid > .w:nth-child(5) { animation-delay: 140ms; }
.farm-grid > .w:nth-child(6) { animation-delay: 175ms; }
.farm-grid > .w:nth-child(7) { animation-delay: 210ms; }
.farm-grid > .w:nth-child(n+8) { animation-delay: 245ms; }

@keyframes w-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes w-pulse { from { opacity: .85; transform: scale(1); } to { opacity: 0; transform: scale(2.4); } }

@media (prefers-reduced-motion: reduce) {
  .farm-grid > .w { animation: w-fade var(--dur-fast) linear both; animation-delay: 0ms !important; }
  .w[data-status="crit"] .dot::after { animation: none; opacity: .85; }
  .lvl-fill { transition: none; }
  .w[tabindex]:hover, .w[role="button"]:hover, a.w:hover, button.w:hover { transform: none; }
  .w[tabindex]:active, .w[role="button"]:active, a.w:active, button.w:active { transform: none; }
  @keyframes w-fade { from { opacity: 0; } }
}

/* ── fallbacks ── both must still look deliberate, never like a broken card */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .w { background: var(--plate); box-shadow: var(--el-2), inset 0 1px 0 var(--glass-hi); }
}
@media (prefers-reduced-transparency: reduce) {
  .w { background: var(--plate); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .w::before { opacity: calc(var(--tint) * .6); }
}
@media (prefers-contrast: more) {
  .w { background: var(--plate); backdrop-filter: none; -webkit-backdrop-filter: none; border-color: var(--tx-2); }
  .w-un, .w-age { color: var(--tx-2); }
}

/* ═════════ v14.7 — TWO NEW WIDGET BODIES, AND AN HONEST NOTHING ═════════
   Round 2 cut the ammonia tile, merged DO + temperature + pH into one Water
   tile, and added the forecast. That is two new bodies inside the same .w
   shell — BANDS and FORECAST — plus the thing the owner actually sees today,
   which is the empty state, because the sim holds no readings at all.

   Nothing below hand-colours anything. data-status remains the only source of
   colour, and every meaning is carried by at least two channels.

   BANDS is no longer here. The Water body is drawn in SVG by widgetBands() in
   levels.render.js, so its row rhythm, value column and no-reading row live in
   levels.geometry.js, not in this file; its dead CSS was cut 2026-08-30.
   FORECAST is still a pure CSS box: it does not measure itself, so it cannot be
   caught by the zero-width mount bug — do not mount() an SVG into it, and do
   not wrap it in .w-mount.
   ══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────── FORECAST ─ the leading indicator ───────────────────────
   Sogakofe, open ponds. Daytime photosynthesis is where the oxygen comes from,
   so an overcast day is a dangerous dawn; wind is surface re-aeration, and still
   air is what kills. Current conditions are out of the window — the forecast is
   the decision. So this strip reads left to right in hours, and the hour that
   matters is marked rather than left to be counted to.

   THE COLOUR RULE, and it is the one that matters here: weather magnitudes are
   NOT statuses. Cloud, wind and rain are drawn in neutral ink at three different
   densities. A column only takes a status colour when that HOUR is actionable —
   when the water is judged to be at risk then. Painting the sky in the alarm
   palette would spend the alarm on weather, and the alarm belongs to the fish.

   MARKUP CONTRACT
     .fc[data-empty?]                          (ol or div; list styling removed)
       .fc-h[data-status?][data-now?][data-dawn?]
         .fc-t                                 hour label
         .fc-ico                               sky glyph (inline svg)
         .fc-bars
           .fc-b[data-kind="solar|wind|rain"]  style="--h:<pct>"
         .fc-v                                 the value */

.fc {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: 2px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fc-h {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-1);
  padding: var(--sp-2) 0 var(--sp-1);
  border-radius: var(--r-sm);
}
.fc-t {
  font-size: var(--fz-cap);
  font-weight: var(--fw-med);
  letter-spacing: var(--tk-caps);
  color: var(--tx-3);
  font-variant-numeric: tabular-nums lining-nums;
}
.fc-ico { width: 16px; height: 16px; flex: none; color: var(--tx-2); display: inline-flex; }
.fc-ico svg { width: 100%; height: 100%; display: block; }
.fc-v {
  font-family: var(--ff-display);
  font-size: var(--fz-sm);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tk-sm);
  color: var(--tx-1);
  font-variant-numeric: tabular-nums lining-nums;
}

/* the magnitude column. Three neutral bars, told apart by density and not by
   hue, so the strip reads in greyscale and leaves the palette free. */
.fc-bars {
  flex: 1 1 auto;
  min-height: 24px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
}
.fc-b {
  width: 5px;
  height: var(--h, 0%);
  min-height: 2px;
  border-radius: 2px 2px 1px 1px;
  background: var(--tx-3);
}
.fc-b[data-kind="solar"] { opacity: .9; }
.fc-b[data-kind="wind"]  { opacity: .55; }
.fc-b[data-kind="rain"]  {
  opacity: .75;
  background: repeating-linear-gradient(-45deg, var(--tx-3) 0 2px, transparent 2px 4px);
  box-shadow: inset 0 0 0 1px var(--st-unknown-dim);
}

/* an actionable hour. Fill plus a rule across the top — two channels, never
   colour alone, and the rule is what survives a sunlit screen. */
.fc-h[data-status="warn"] { --st: var(--st-warn); --st-fill: var(--st-warn-dim); }
.fc-h[data-status="crit"] { --st: var(--st-crit); --st-fill: var(--st-crit-dim); }
.fc-h[data-status="warn"],
.fc-h[data-status="crit"] { background: var(--st-fill); }
.fc-h[data-status="warn"]::before,
.fc-h[data-status="crit"]::before {
  content: "";
  position: absolute;
  left: 3px; right: 3px; top: 0;
  height: 2px;
  border-radius: 0 0 1px 1px;
  background: var(--st);
}
.fc-h[data-status="crit"] .fc-v { font-weight: 700; }

/* now is a boundary, not a highlight — everything left of it already happened */
.fc-h[data-now] { box-shadow: inset 0 0 0 1px var(--glass-brd); }
.fc-h[data-now] .fc-t { color: var(--tx-1); }
/* dawn is the decision hour; the widget exists to make it findable without counting */
.fc-h[data-dawn]::after {
  content: "";
  position: absolute;
  left: -2px; top: -2px; bottom: -2px;
  border-left: 1px dashed var(--tx-3);
}
.fc-h[data-dawn] .fc-t { color: var(--tx-1); font-weight: 700; }

/* no forecast is not "calm weather". Keep the hour ruler, drop the bars, and let
   the row read as a scale waiting for numbers rather than a flat calm strip. */
.fc[data-empty] .fc-b,
.fc[data-empty] .fc-ico { display: none; }
.fc[data-empty] .fc-h { opacity: .6; }
.fc[data-empty] .fc-bars { border-bottom: 1px dashed var(--st-unknown); min-height: 20px; }
.fc[data-empty] .fc-v { color: var(--tx-3); font-weight: 500; }

/* ───────────── EMPTY ─ what the owner is actually looking at ─────────────────
   254 of 254 sensors have never measured, so nearly every tile renders its empty
   state and that state IS the design under review. "Never measured" is a fact,
   not a failure, and it must look like an instrument waiting rather than a card
   that failed to render. The rule: keep the frame, dash the edge, drop the ink,
   never remove the mark.

   [data-empty] is NOT [data-stale] / [data-silent]. Those mean a reading existed
   and stopped, which is an alarm and keeps its warn chip. This one has nothing to
   raise an alarm about, so it stays neutral — grey, never amber. Confusing the
   two would cry wolf 254 times on first load. */
.w[data-empty] {
  background: var(--plate);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-style: dashed;
  border-color: var(--glass-brd);
  border-top-color: var(--glass-brd);
  box-shadow: var(--el-1);
}
.w[data-empty]::before { opacity: 0; }

/* SYSTEMS ISSUE -- Carbon's third empty-state type, and the one this product cannot
   afford to render as "no data". Carbon separates NO DATA (first use, nothing yet)
   from USER ACTION (no search results) from ERROR MANAGEMENT, whose four sub-cases
   include "systems issue": problems with a RELATED system are preventing the data
   from being supplied, and the copy must say what happened and what you can do.
   That is a dead buoy, described exactly. An empty chart because a healthy cage has
   had no events is INFORMATION; an empty chart because nothing is publishing is a
   FAILURE, and under the eFishery rule a silent device is the thing this system
   exists to surface. Rendered in one component they are indistinguishable, and the
   board quietly tells the operator that a silent sensor is a quiet cage.
   ACHROMATIC, per clause 3 of the withholding rule: this is a data-quality condition,
   not an alarm, so it takes PRESENCE and not hue. The edge stops being a faint dash
   and becomes a stated one, the placeholder rule under the copy goes solid, and the
   age slot promotes -- a systems issue has a duration and the duration is the point.
   The copy itself is the component's job (why + what-you-can-do, one line each).
   SEAM: app.js must emit data-empty="system" for a tile whose emptiness is caused by
   a silent device or a stalled ingest. It does not yet; until it does this block is
   inert and every systems issue still renders as "no data". That is a JS-lane change,
   not a stylesheet one. */
.w[data-empty="system"] {
  border-color: var(--tx-3);
  border-top-color: var(--tx-3);
}
.w[data-empty="system"] .w-empty { color: var(--tx-2); }
.w[data-empty="system"] .w-empty b { color: var(--tx-1); }
.w[data-empty="system"] .w-empty::after {
  border-top-style: solid;
  border-top-color: var(--tx-3);
}
.w[data-empty="system"] .w-age { color: var(--tx-2); }
.w[data-empty] .w-val { color: var(--tx-2); font-weight: var(--fw-med); letter-spacing: var(--tk-num-s); }
.w[data-empty] .w-un { color: var(--tx-3); }
.w[data-empty] .dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--st-unknown); }

/* ═══════════════════════════════════════════════════════════════════════════
   LOADING — pending, and never mistakable for absence

   Between fetch and paint a tile was simply blank. On this product a blank tile
   is already a REAL and very common state: 254 of 254 sensors have never
   measured, so an empty frame means "nothing was ever recorded here". Two
   different facts wearing one face is the same class of error as a stale number
   rendering as a current one — the reader cannot tell whether to wait or to act.

   Loading is TEMPORARY and reads as pending. No data is a FACT and reads as
   settled. They are now separated on every channel that carries meaning:

     channel   loading (temporary)            no data (settled)
     edge      solid — the frame is real      dashed — the outline is open
     surface   the tile's own glass           --plate, opaque
     body      a neutral block that SWEEPS    a written line and a drawn rule
     dot       absent — nothing has a         hollow ring — a state exists,
               status yet                     and it is "never measured"
     motion    yes, and only here             none, ever

   Five channels, of which motion alone would have been enough and none of which
   is colour: a tile that has not loaded has nothing to be coloured about, and
   spending chroma here would break the rule that makes the one bad reading on a
   healthy board unmissable.

   THRESHOLDS. 0–250 ms: draw nothing. 250 ms: the block appears. A REFETCH never
   skeletons at all — .reloading holds the last frame at .55 opacity, because
   replacing a real number with a grey block throws away information the screen
   already had and is a regression, not a loading state.

   §77 IS NOT SUSPENDED. The value position of a measurement is never a grey
   block; it is the em dash, the same unknown mark the rest of the system uses,
   so a loading tile still cannot be misread as carrying a reading. The skeleton
   is for the DRAWING, whose shape is genuinely unknown until the series lands.
   A number's absence is information, and information is not a placeholder.

   Needs one attribute from the renderer — data-loading on the article — and no
   child markup: the block and the sweep are both pseudo-elements on .w-bd, which
   is empty by definition while the tile is loading.
   ═══════════════════════════════════════════════════════════════════════════ */
.w[data-loading]:not([data-empty]) .w-bd { position: relative; overflow: hidden; }
/* The block, in calm ink at the zone-track alpha: neutral on both themes, and it
   takes the tier's inner radius so it reads as part of the card rather than as a
   foreign rectangle dropped into it. */
.w[data-loading]:not([data-empty]) .w-bd::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-in);
  background: var(--st-calm-dim);
  opacity: 0;
  animation: w-skel-in 1ms linear var(--w-skel-delay) both;
}
/* The sweep. Transform and opacity only, so it is compositor work rather than a
   repaint on a surface that already carries a backdrop-filter; it takes the same
   delay so nothing moves before the block it belongs to exists. */
.w[data-loading]:not([data-empty]) .w-bd::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-in);
  background: linear-gradient(100deg, transparent 34%,
    color-mix(in srgb, var(--tx-1) 8%, transparent) 50%, transparent 66%);
  opacity: 0;
  animation: w-skel-in 1ms linear var(--w-skel-delay) both,
             w-skel-sweep 1.4s linear var(--w-skel-delay) infinite;
}
@keyframes w-skel-in { to { opacity: 1; } }
@keyframes w-skel-sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
/* No status yet, so no dot and no tint. A tile that has not loaded may not assert
   health, and the top-edge wash is the one channel that would say it had. The
   crit guard is defensive: an alarm outranks a load, always. */
.w[data-loading] .dot { display: none; }
.w[data-loading]:not([data-status="crit"])::before { opacity: 0; }
.w[data-loading] .w-val:empty::before { content: "\2014"; }
.w[data-loading] .w-val, .w[data-loading] .w-un { color: var(--tx-3); }
@media (prefers-reduced-motion: reduce) {
  /* The block stays; the sweep goes. Dropping the mark as well would put the
     loading tile straight back to being indistinguishable from the empty one,
     which is the entire defect this state exists to fix — so the reduced-motion
     equivalent is a static block, never nothing. */
  .w[data-loading]:not([data-empty]) .w-bd::after { content: none; }
}
@media (prefers-contrast: more) {
  .w[data-loading]:not([data-empty]) .w-bd::before { box-shadow: inset 0 0 0 1px var(--tx-3); }
}

/* the body placeholder. One short line, and a drawn rule under it so the tile
   still contains a mark — a tile with nothing in the body reads as a bug. */
.w-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  gap: var(--sp-2);
  width: 100%;
  min-width: 0;
  padding: var(--sp-2) 0;
  text-align: center;
  color: var(--tx-3);
  font-size: var(--fz-lbl);
  font-weight: 500;
  line-height: 1.3;
}
/* 13.5px is the size these faces are drawn for, so its tracking is 0. The old
   value here was −.02em, borrowed from a numeral token. */
.w-empty b {
  display: block;
  font-size: var(--fz-sm);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tk-sm);
  color: var(--tx-2);
}
.w-empty::after {
  content: "";
  width: 56px;
  border-top: 1px dashed var(--st-unknown);
}

/* ──────────────────────── QUIET WHEN NORMAL ─────────────────────────────────
   A tile that reads "0 open" forever is furniture, and furniture teaches the eye
   to skip that part of the grid — which is exactly the part you need it to
   notice on the morning it is not zero. For any metric that only matters when
   abnormal, put [data-quiet] on the .w while it is normal: same cell, same
   position, but it stops making a visual claim. Dropping data-quiet is then the
   signal by itself. The tile does not shout louder; it stops being quiet, and a
   card materialising where a ruled line was is a far bigger event than a number
   going from 0 to 1. */
.w[data-quiet] {
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  border-color: transparent;
  border-top-color: var(--glass-brd);
  border-radius: 0;
  justify-content: center;
  padding: var(--sp-2) var(--sp-3);
}
.w[data-quiet]::before { opacity: 0; }
.w[data-quiet] .w-bd { display: none; }
.w[data-quiet] .dot { display: none; }
.w[data-quiet] .w-hd h3 { color: var(--tx-3); font-weight: var(--fw-med); }
.w[data-quiet] .w-val { font-size: var(--fz-lg); letter-spacing: var(--tk-lg); color: var(--tx-2); font-weight: var(--fw-semi); }

/* ───────────────── DENSITY ─ the phone is the real screen ────────────────
   The forecast strip tightens on a phone rather than letting its type shrink
   below the sunlight floor. The Water card has no rule here: it is drawn in
   SVG by widgetBands(), so its rows scale with the viewBox, not with a query. */
@media (max-width: 700px) {
  .fc-h { padding: var(--sp-1) 0; gap: 2px; }
  .fc-ico { width: 14px; height: 14px; }
  .fc-bars { min-height: 18px; }
  .fc-b { width: 4px; }
}

/* ───────────────────────── ACCESSIBILITY FALLBACKS ───────────────────────── */
@media (prefers-contrast: more) {
  .w-empty, .fc-t, .fc[data-empty] .fc-v { color: var(--tx-2); }
  .fc-b { opacity: 1; }
  .w[data-empty] { border-color: var(--tx-3); }
}
@media (prefers-reduced-transparency: reduce) {
  .w[data-quiet] { background: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   v14.8 — THE WALL CONTRACT · THE OPERATIONS WALL (Sol)
   Ratified 2026-08-30. The names below ARE the contract — docs/DESIGN_SYSTEM.md
   §"The wall contract" points here, and a lane that emits a different name gets
   no styling at all. That is intended: an unstyled list is loud and is fixed in
   a minute, while a near-miss name that inherits something plausible survives
   review and ships.

   The overview roughly doubles in panel count. Everything below is the answer
   to one question: what has to change so that TWICE AS MANY PANELS reads as
   MORE INFORMATION and not as MORE NOISE.

   The answer is not smaller type and it is not more colour. It is four things:
   a section rhythm carried by spacing alone; density bought from padding that
   was never earning anything; one achromatic highlight legible in three panels
   at once; and columns that do not move when the values inside them do.

   Every rule below still obeys the withholding rule. Nothing here can put
   chroma on the board: a healthy farm renders this wall in greys, and the one
   warn cell among 254 is the only saturated mark on the screen. That property
   gets HARDER to hold as panel count rises, which is why it is restated here
   rather than assumed — a denser board that is also a more colourful one has
   lost the argument the density was for.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── 1. SECTIONING WITHOUT CHROME ─────────────────────────────────────────
   Eleven panels in one undifferentiated field is the sixteen-tiles problem one
   level up: the TIER axis ranks tiles within a set and says nothing at all
   about which set a tile belongs to. So the board needs a second, coarser
   ordering — and it may not be drawn with a box, a rule, a card-inside-a-card
   or a background block, because every one of those adds ink to a surface whose
   entire argument is that ink means something is wrong.

   A band is a full-width label row plus a larger break above it. Grouping is
   done by the two cheapest signals there are, alignment and space, which are
   also the only two that cost nothing on the alarm channel. The label sits on
   the grid's own column 1 and takes the quiet widget-header treatment, so it
   reads as furniture naming a region rather than as a heading outranking the
   panels beneath it. */
/* EVERY RULE IN THIS GROUP IS SCOPED `.farm-grid > .band`, AND THAT IS LOAD-
   BEARING. `.band` was already taken: styles.css:3168 is the confidence-interval
   band, an inline-flex text object that lives INSIDE a widget. A bare `.band`
   block written here carries identical specificity and wins on document order,
   2,700 lines away, in a file nobody was editing — the interval would not throw,
   would not log, and would simply lay out wrong until an operator reading an
   incident noticed. The child combinator closes it structurally instead of by
   renaming: an interval is never a direct child of the grid, a section always
   is, so neither selector can reach the other whatever order they land in. */
.farm-grid > .band {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  min-width: 0;
  /* + the grid's own row-gap below = 28px between the last panel of one band
     and the label of the next, against 12px between rows inside a band. A 2.3x
     ratio, which is comfortably past the ~1.8x at which the eye stops merging
     two rows into one group. */
  margin-top: var(--sp-4);
}
.farm-grid > .band:first-child { margin-top: 0; }
.farm-grid > .band .band-t {
  margin: 0;
  font-family: var(--ff-text);
  font-size: var(--fz-cap);
  font-weight: var(--fw-semi);
  line-height: var(--lh-snug);
  letter-spacing: var(--tk-caps);
  text-transform: uppercase;
  color: var(--tx-2);
  white-space: nowrap;
}
/* The count. Pushed to the grid's last column so every band terminates on the
   same vertical — that shared right edge is most of what makes a stack of bands
   read as one system instead of as three headings that happen to be stacked. */
.farm-grid > .band .band-n {
  margin-left: auto;
  font-size: var(--fz-cap);
  font-weight: var(--fw-med);
  letter-spacing: var(--tk-caps);
  text-transform: uppercase;
  color: var(--tx-3);
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

/* THE ROW GAP HANDS ITS JOB UP ONE LEVEL. The 24px row-gap exists (see THE
   GRID) because at 12px a row of tiles merges into the row below and the board
   becomes sixteen tiles and zero groups. That reasoning is intact — but it was
   solving GROUPING with a GAP because there was nothing else available to solve
   it with. With bands, grouping is carried by a label and a 28px break, and
   inside a band the rows are then SUPPOSED to merge: they are one set, and the
   merge is the statement. Dropping to 12 recovers ~12px per row across the
   whole board, which is most of what the new panels cost vertically.
   :has() so this can never regress: a grid with no bands keeps 24px and keeps
   the old argument, and a browser without :has() does the same. */
.farm-grid:has(> .band) { row-gap: var(--sp-3); }

/* ─── 2. DENSITY WITHOUT SHRINKING ─────────────────────────────────────────
   The instinct when a board fills up is to shrink the type. That is the one
   move this product may not make: the daylight legibility floor is a safety
   constraint and not a taste one, and a 10px numeral read at arm's length in
   Volta sun is not a numeral. So density is bought from padding, and only from
   padding that was never earning anything.

   [data-dense] keeps EVERY tier channel that carries meaning — fill, blur,
   shadow, radius, label treatment, numeral size — and gives up one step of
   padding and one step of internal gap. It is for panels whose content is a
   FIELD rather than a figure: a 254-cell matrix, an event list, a time axis.
   Whitespace around a figure is read as importance; whitespace around a field
   is read as margin the field could have used. Taking it back removes nothing
   from the rank the tier has already stated by five other channels.

   WHAT THIS CUT, measured on a primary panel: 20/24 -> 12/16 is 16px across and
   16px down, and the 16px column gap -> 8px is another 8 in a two-row panel.
   About 40px per dense panel, none of it out of the type. */
/* THE QUIET TIER IS THAT SET. [data-dense] was built for panels whose content
   is a FIELD rather than a figure and was then only ever set by hand, one tile
   at a time. A tile that has already declared secondary rank on fill, blur,
   shadow and numeral size is not the figure the room is reading, so the
   whitespace around its content is margin the content could have used -- which
   is the same sentence as the paragraph above, arrived at from the tier instead
   of from the content. Sharing the rule keeps ONE density decision on this
   board rather than two that can drift. None of it comes out of the type. */
.w[data-dense], .w[data-tier="secondary"] { padding: var(--sp-3) var(--sp-4) var(--sp-4); gap: var(--sp-2); --r-in: 6px; }
.w-1x1[data-dense], .w-1x1[data-tier="secondary"] { padding: var(--sp-2) var(--sp-3) var(--sp-3); gap: var(--sp-1); --r-in: 4px; }

/* THE BOARD SCALE IS THE DEFAULT ON THE BOARD, AND THE CARD SCALE IS NOT.
   Every tile on the farm overview but one declares a tier and runs 12/16 with an
   8px gap. Weather declares none, so it fell through to the base .w - 20/24
   padding and a 16px gap, a scale authored for a card that stands alone on a
   page. Measured on the live board that is 290px of tile around 84px of drawing:
   44px of padding and 52px of gap to carry a strip, two notes and one value. It
   is the widest object on the page and the only one still paying card rent,
   which is exactly the "sized by the grid rather than by what it delivers" the
   owner is looking at. A full-bleed panel needs LESS vertical padding than a
   narrow one, not more - its measure is already generous, and at twelve columns
   the base scale stops reading as padding and starts reading as margin.
   Weather is data-tier="primary", and primary is the reason it was on the base
   scale - so this rule names it. IT DOES NOT DEMOTE IT. The tier's channels are
   all still spent and none of them is padding: it is the only tile that takes all
   twelve columns, it holds the only 55px numeral on the page, it sits first, and
   it keeps primary's fill, blur and border. The stylesheet already says this out
   loud where [data-dense] is defined - "padding is the only channel with no
   meaning attached to it" - and a tile that is twelve columns wide with the
   biggest figure on the board does not need a fourth channel to say so. What the
   44px of padding and 52px of gap were actually communicating was that the panel
   expects more than it has.
   Scoped to .farm-grid, so primary keeps the card scale everywhere it is a card,
   and named positively rather than as :not(secondary) - there is a third tier,
   quiet, and it already runs tighter than this. A negative selector would have
   caught the four quiet 1x1s and made the board taller while claiming to shrink
   it.
   Nothing is receded to buy it: type, ink, material and the status channel are
   untouched. */
.farm-grid > .w[data-tier="primary"] {
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  gap: var(--sp-2);
  --r-in: 6px;
}
/* A dense body gives up its centring. A field starts at the top left of the
   space it is given, always: a list that centres itself moves every row on the
   board every time an event arrives or ages out, and a board that shifts under
   the eye is unreadable however good its numbers are. */
.w[data-dense] > .w-bd,
.w[data-tier="secondary"] > .w-bd {
  align-items: stretch;
  justify-content: flex-start;
  min-height: 0;
  overflow: hidden;
}

/* ─── 3. THE SELECTED STATE, FINALLY SPENT ─────────────────────────────────
   Selection has sat on the achromatic luminance ladder since v14 and nothing
   has used it. It is now the mechanism that turns a page of panels into one
   instrument: choose a cage in the matrix and that cage lights in the timeline,
   the feed and the water card at the same instant.

   THREE RULES, and they are the whole design.

   (a) IT MAY NOT SPEND HUE. Selecting a crit cage must not add a second colour
       to an alarm, and selecting a healthy one must not add a first. The
       highlight is a luminance step off --w-veil plus an achromatic rule in
       --w-sel-ink — the focus ink at 55%, the same ink as the widget-level
       selected state — so cell, row and panel are visibly one gesture at three
       scales rather than three separate inventions.

   (b) NOTHING ABNORMAL IS EVER DE-EMPHASISED. The obvious way to make a
       selection pop is to push everything else back. Here that is a safety
       defect: receding the un-selected cells would hide the one warn cell in
       254 at the exact moment the operator is looking somewhere else. So the
       recessive step applies ONLY to marks and rows whose status is calm or
       never-reported, and never to a warn, never to a crit, never to a value's
       ink. Contrast is bought by lifting the selection, not by suppressing the
       evidence — which is the same rule as "never grey a number to calm a
       layout", applied to a field instead of to a figure.

   (c) A PANEL SAYS WHETHER IT PARTICIPATES. A selection that highlights nothing
       inside a panel is indistinguishable from a panel that has stopped
       working. A widget holding a hit takes [data-correlated]; a widget with
       nothing to say about this cage is left exactly as it was, which is the
       honest reading — it did not fail, it simply does not know this entity. */
:root {
  /* Between hover (.045) and select (.065). A correlated hit is a real state,
     but it is not the thing the operator chose, and the ladder has to say so
     without inventing a channel. */
  --w-st-correl: .055;
  --w-cor-ink: color-mix(in srgb, var(--w-focus) 30%, transparent);
  /* the recessive multiplier — calm and never-reported marks only, see (b) */
  --w-recede: .55;
}

/* the panel level */
.w[data-correlated] {
  --w-state: var(--w-st-correl);
  box-shadow: var(--glass-shd), inset 0 0 0 1px var(--w-cor-ink);
}
.w-1x1[data-correlated] { box-shadow: var(--el-1), inset 0 0 0 1px var(--w-cor-ink); }
/* correlation may not quietly demote a severity shadow, exactly as selection
   may not — the crit tile restates its own ring on top */
.w[data-status="crit"][data-correlated] {
  box-shadow: var(--el-3), inset 0 0 0 1px var(--w-cor-ink);
}

/* ─── 4. THE FLEET MATRIX ──────────────────────────────────────────────────
   254 cages, one cell each, severity first — never alphabetical, because an
   alphabetical fleet view asks the operator to search and a severity-ordered
   one asks them only to look at the top. Mira owns the geometry; Sol owns the
   cell's STATES, and they are attribute selectors so that no fill is ever
   written into the markup and the matrix cannot drift from the widget palette.

   The cell inherits the ink hooks (.st-face / .st-veil / .st-ink) unchanged. */
.wmx { display: block; width: 100%; height: auto; }
.wmx-cell { opacity: var(--wmx-o, 1); }
.wmx-cell[data-status="ok"]   { --st: var(--st-calm);    --st-fill: var(--st-calm-dim); }
.wmx-cell[data-status="warn"] { --st: var(--st-warn);    --st-fill: var(--st-warn-dim); }
.wmx-cell[data-status="crit"] { --st: var(--st-crit);    --st-fill: var(--st-crit-dim); }
.wmx-cell[data-status="unknown"] { --st: var(--st-unknown); --st-fill: var(--st-unknown-dim); }
/* NEVER REPORTED is not a status and may not be drawn as one. It is also the
   commonest cell on this farm — 254 cages, a handful instrumented — and the pip
   field already settled how it has to read: PRESENCE first, hue second. An
   uninstrumented cell carries no fill at all, so 254 of them are an even weave
   and the four that carry a live reading are the only filled marks in it.
   Drawing them as "ok" would be the single worst lie this board could tell:
   a cage nobody is measuring is not a cage that is fine. */
.wmx-cell[data-status="none"],
.wmx-cell:not([data-status]) {
  --st: var(--st-unknown);
  --st-fill: transparent;
  --wmx-o: .5;
}

/* selection at cell scale — an achromatic rule drawn as a STROKE, because SVG
   has no box-shadow. paint-order puts it under the fill so a 1.5px rule on a
   small cell reads as an outline and not as a shrunken cell. */
.wmx-cell[data-selected] :is(.st-face, .st-veil),
.wtl-ev[data-selected] :is(.st-face, .st-veil) {
  stroke: var(--w-sel-ink);
  stroke-width: 1.5px;
  paint-order: stroke;
}
.wmx-cell[data-correlated] :is(.st-face, .st-veil),
.wtl-ev[data-correlated] :is(.st-face, .st-veil) {
  stroke: var(--w-cor-ink);
  stroke-width: 1px;
  paint-order: stroke;
}
/* the recessive step — clause (b). Only calm and never-reported, and only while
   something is actually selected, so the resting board is untouched. */
:is(.farm-overview, .farm-grid)[data-sel] :is(.wmx-cell, .wtl-ev):is([data-status="ok"], [data-status="none"], :not([data-status])):not([data-selected]):not([data-correlated]) {
  opacity: calc(var(--wmx-o, 1) * var(--w-recede));
}

/* ─── 5. THE EVENT FEED ────────────────────────────────────────────────────
   Newest first, timestamped, capped at what fits. Three columns, fixed.

   The reason a row is a GRID and not a flex line: a flex line re-measures on
   every tick, so the entity column steps sideways the moment a four-character
   cage id is replaced by a six-character one, and a board whose columns twitch
   as it updates reads as cheap however good the numbers are. Fixed tracks
   cannot twitch. The track list lives on the LIST as a custom property and is
   spent by each row, so alignment holds without subgrid — which is a floor this
   board should not be raising for three columns of text.

   TIME IS 5ch AND NOT A MONOSPACE FACE. .w already sets tabular figures, so
   every digit is one advance wide; "14:32" is four digits and a colon and can
   therefore never reflow. A fourth typeface would have bought nothing here and
   cost a face that has to arrive before an alarm can render — the same reason
   this sheet carries no webfont at all. */
.wfeed {
  --wfeed-cols: 5ch minmax(0, 8ch) minmax(0, 1fr);
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}
/* No rules between rows and no zebra. A hairline every 18px is 40 hairlines of
   ink on a panel whose neighbours are drawings, and the fixed time column
   already supplies the vertical rhythm a rule would have been drawn for. */
.wfeed-t, .wfeed-e, .wfeed-w {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--fz-lbl);
  line-height: var(--lh-snug);
}
.wfeed-t { color: var(--tx-3); font-weight: var(--fw-med); font-variant-numeric: tabular-nums lining-nums; }
.wfeed-e { color: var(--tx-2); font-weight: var(--fw-semi); font-variant-numeric: tabular-nums lining-nums; }
.wfeed-w { color: var(--tx-1); font-weight: var(--fw-reg); }
/* An event that is itself an alarm colours its VERB, not its row. Colouring the
   row would put a block of chroma on the board for every alarm ever raised,
   including the ones already cleared — history is not an active alarm. */
.wfeed-r[data-status="warn"] .wfeed-w { color: var(--st-warn); font-weight: var(--fw-med); }
.wfeed-r[data-status="crit"] .wfeed-w { color: var(--st-crit); font-weight: var(--fw-semi); }

.wfeed-r[data-selected] {
  background: color-mix(in srgb, var(--w-veil) calc(var(--w-st-select) * 100%), transparent);
  box-shadow: inset 0 0 0 1.5px var(--w-sel-ink);
}
.wfeed-r[data-correlated] {
  background: color-mix(in srgb, var(--w-veil) calc(var(--w-st-correl) * 100%), transparent);
  box-shadow: inset 0 0 0 1px var(--w-cor-ink);
}
/* clause (b) again: an alarm row is never receded by a selection somewhere else */
:is(.farm-overview, .farm-grid)[data-sel] .wfeed-r:not([data-selected]):not([data-correlated]):not([data-status="warn"]):not([data-status="crit"]) {
  opacity: var(--w-recede);
}

/* THE CAP, STATED AS A NUMBER. The feed is capped at what fits, because a
   scrolling region on a wall hides events and a hidden event is one that, to
   the operator, did not happen. What was cut is therefore stated — as a count,
   never as a sentence — aligned to the time column so it reads as the list
   continuing rather than as a control asking to be clicked. */
.wfeed-more {
  display: grid;
  grid-template-columns: var(--wfeed-cols);
  column-gap: var(--sp-3);
  padding: 3px var(--sp-1);
  font-size: var(--fz-cap);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tk-caps);
  text-transform: uppercase;
  color: var(--tx-3);
  font-variant-numeric: tabular-nums lining-nums;
}

/* ─── 6. THE 24H TIMELINE ──────────────────────────────────────────────────
   PAST AND FUTURE, WITHOUT COLOUR. The rule is not decoration. A forecast is
   not a measurement, and if the only thing separating them were a hue we would
   have spent the alarm channel on the difference between "happened" and
   "might" — which is precisely the channel that has to stay empty so that an
   actual alarm can use it. Past is solid; future is the same ink one step
   lighter on a dashed rule. Alpha and dash are two channels, both survive
   greyscale and both survive every CVD type, which is the two-channel test
   every status in this file has to pass. */
.wtl { display: block; width: 100%; height: auto; }
.wtl .wtl-past   { stroke: var(--tx-2); fill: none; }
.wtl .wtl-future { stroke: var(--tx-3); fill: none; stroke-dasharray: 3 3; }
/* NOW is the only full-strength line on the axis. It is the reference every
   other panel is read against, so it gets --tx-1 and 1.5px and nothing else on
   this drawing is allowed either. */
.wtl .wtl-now { stroke: var(--tx-1); stroke-width: 1.5px; fill: none; }
.wtl .wtl-now-f { fill: var(--tx-1); stroke: none; }
/* DAWN. Marked because dawn is when dissolved oxygen bottoms out, which makes
   it the one time of day the operator has to be able to find on this axis
   without counting hours. Dotted and tertiary: a reference, not an event. */
.wtl .wtl-dawn { stroke: var(--tx-3); stroke-dasharray: 2 4; fill: none; }
.wtl .wtl-band { fill: var(--tx-3); opacity: .05; stroke: none; }
.wtl .wtl-ax { stroke: var(--glass-brd); fill: none; }
.wtl .wtl-lbl {
  fill: var(--tx-3);
  font-family: var(--ff-text);
  font-size: var(--fz-cap);
  font-weight: var(--fw-med);
  letter-spacing: var(--tk-caps);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums lining-nums;
}
.wtl .wtl-lbl-now { fill: var(--tx-1); font-weight: var(--fw-semi); }
.wtl-ev { opacity: var(--wmx-o, 1); }
.wtl-ev[data-status="ok"]   { --st: var(--st-calm);    --st-fill: var(--st-calm-dim); }
.wtl-ev[data-status="warn"] { --st: var(--st-warn);    --st-fill: var(--st-warn-dim); }
.wtl-ev[data-status="crit"] { --st: var(--st-crit);    --st-fill: var(--st-crit-dim); }
.wtl-ev[data-status="unknown"], .wtl-ev:not([data-status]) { --st: var(--st-unknown); --st-fill: var(--st-unknown-dim); }

/* ─── 7. THE MONITORING HEALTH READOUT ─────────────────────────────────────
   A fixed two-column readout: label left, value right, values sharing one right
   edge so four numbers of four different lengths still form a column.

   The reason this panel is plain text and not a drawing: it is the panel that
   watches the watchers, and a silent panel and a healthy farm look identical.
   The one thing on the board whose job is to tell those apart may not itself be
   a mark that can fail to render. Numerals and labels, nothing else. */
.wgrid { margin: 0; display: flex; flex-direction: column; gap: 5px; min-width: 0; width: 100%; }
.wgrid-r {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--sp-3);
  align-items: baseline;
  min-width: 0;
}
.wgrid-k {
  margin: 0;
  font-size: var(--fz-cap);
  font-weight: var(--fw-med);
  letter-spacing: var(--tk-caps);
  text-transform: uppercase;
  color: var(--tx-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wgrid-v {
  margin: 0;
  font-family: var(--ff-display);
  font-size: var(--fz-sm);
  font-weight: var(--fw-semi);
  line-height: var(--lh-snug);
  letter-spacing: var(--tk-sm);
  color: var(--tx-1);
  font-variant-numeric: tabular-nums lining-nums;
  text-align: right;
  white-space: nowrap;
}
.wgrid-u { font-size: var(--fz-cap); font-weight: var(--fw-med); color: var(--tx-3); letter-spacing: var(--tk-caps); margin-left: 3px; }
/* NULL IS A BLANK AND NEVER A ZERO. Tertiary ink at the value's own size, so
   the column still aligns and "not measured" can never be read as "none".
   0 devices reporting and "we cannot tell how many are reporting" are opposite
   findings and the second one is the worse of the two. */
.wgrid-v[data-empty] { color: var(--tx-3); font-weight: var(--fw-med); }
/* The one place this panel spends the status channel, and it spends it on the
   VALUE. An ingest lag of 40 minutes is a fact about a number, not about a row. */
/* STATUS INK IS --mk-*, NOT --st-*. The status hues are surface and mark colours;
   as TEXT on the plate a crit panel forces they were measured at 3.79:1 on dark
   and warn at 1.83:1 on light, both under AA for a 14px figure - a value that is
   the sole carrier of its own severity may not be the least legible thing on the
   panel. --mk-warn/--mk-crit are the same two hues already mixed toward --tx-1
   for exactly this reason, so they lift on dark and deepen on light from one
   declaration and no new colour is invented here. The 2px rule at the row edge
   keeps the pure hue: it is a mark, not text. */
.wgrid-r[data-status="warn"] .wgrid-v { color: var(--st-warn-ink); }
.wgrid-r[data-status="crit"] .wgrid-v { color: var(--st-crit-ink); }

/* ─── 8. NOTHING REFLOWS WHEN A VALUE TICKS ────────────────────────────────
   .w already sets tabular figures. What it does not do is stop a value's own
   BOX from resizing: a flex item sized by its content moves its neighbours
   every time the content changes width, and tabular figures fix the width of a
   digit, not the NUMBER of them. "9" becoming "10" still shifts everything to
   its right. A minimum measure in ch — one "0" advance, and with tabular
   figures exactly one digit — pins the slot without capping the value. */
.farm-overview .w-val { min-width: 2ch; }
.farm-overview .w-dlt { min-width: 5ch; justify-content: flex-end; }
.farm-overview .w-age { min-width: 5ch; text-align: center; }

/* ─── 9. KEYBOARD ──────────────────────────────────────────────────────────
   Arrow to move, enter to drill, escape to clear. A wall operator does not hunt
   with a mouse, so the focus ring here is not an accessibility afterthought —
   it is the primary cursor of this screen.

   It is drawn OUTSIDE the edge while the selected rule is drawn INSIDE, because
   arrowing across the matrix focuses and selects the same cell and both states
   must be legible at once. Two rings, two sides, no ambiguity about which is
   "where I am" and which is "what I chose". Both wirings are supported: focus
   on the container with a roving selection, or focus on the cell itself. */
.wmx:focus-visible,
.wfeed-r:focus-visible,
.wgrid-r:focus-visible,
.wfeed-more:focus-visible {
  outline: 3px solid var(--w-focus);
  outline-offset: 1px;
  border-radius: var(--r-sm);
}
.wmx-cell:focus-visible,
.wtl-ev:focus-visible,
.wtl:focus-visible { outline: 2px solid var(--w-focus); outline-offset: 1px; }
/* A focusable cell must not also be a text selection target — dragging across
   254 cells with a mouse should move the selection, never highlight the SVG. */
.wmx, .wtl { -webkit-user-select: none; user-select: none; }

/* ─── 10. THE PHONE ────────────────────────────────────────────────────────
   Density gives, type does not. Every reduction below is padding or a track
   width; not one font-size moves. */
@media (max-width: 700px) {
  /* the entity track is the one that gives: the time and the event stay whole,
     the cage id truncates with its title attribute intact. */
  .wfeed { --wfeed-cols: 5ch minmax(0, 6ch) minmax(0, 1fr); }
  .wfeed-r, .wfeed-more { column-gap: var(--sp-2); }
  .farm-grid > .band { margin-top: var(--sp-3); }
  .w[data-dense] { padding: var(--sp-2) var(--sp-3) var(--sp-3); }
  .wgrid { gap: var(--sp-1); }
}

/* ─── 11. FALLBACKS ────────────────────────────────────────────────────────
   Every one of these has to still look deliberate. A board that degrades into
   something that looks broken teaches the operator to distrust it, and a wall
   panel nobody trusts is a wall panel nobody reads. */
@media (prefers-contrast: more) {
  :root {
    /* the recessive step nearly disappears, and the correlation ink goes to
       full strength — at high contrast a 30% rule is not a rule. */
    --w-recede: .82;
    --w-cor-ink: var(--w-focus);
  }
  .wfeed-t, .wgrid-k, .band-n, .wtl .wtl-lbl { color: var(--tx-2); fill: var(--tx-2); }
  .wmx-cell[data-status="none"], .wmx-cell:not([data-status]) { --wmx-o: .8; }
  .wtl .wtl-future { stroke: var(--tx-2); }
}
@media (prefers-reduced-motion: reduce) {
  .wfeed-r { transition: none; }
}
/* The highlight does not go away here — it goes OPAQUE. Reduced transparency
   is a request not to composite, not a request to lose a state: the same two
   luminance steps are mixed into --plate instead of into nothing, so the ladder
   is identical and only the compositing is gone. */
@media (prefers-reduced-transparency: reduce) {
  .wfeed-r[data-selected] {
    background: color-mix(in srgb, var(--w-veil) calc(var(--w-st-select) * 100%), var(--plate));
  }
  .wfeed-r[data-correlated] {
    background: color-mix(in srgb, var(--w-veil) calc(var(--w-st-correl) * 100%), var(--plate));
  }
}
/* ══════════════════════════════════════════════════════════════════════════
   THE WALL CONTRACT — ratified 2026-08-30
   ──────────────────────────────────────────────────────────────────────────
   These names are the interface between three lanes. Sol writes every line of
   CSS here; Kai emits the DOM for FEED and HEALTH; Mira emits the SVG for
   MATRIX and TIMELINE. A lane that emits a different name gets no styling at
   all — that is deliberate. An unstyled list is loud and gets fixed in a
   minute; a near-miss name that happens to inherit something plausible is the
   failure Mem named "the empty render" and it survives review.
   Rationale, including why TIMELINE is called .wtl and not .timeline, is in
   docs/DESIGN_SYSTEM.md § The wall contract.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── SECTIONS ─ .band ─────────────────────────────────────────────────────
   A band LABELS a run of tiles; it does not contain them. No box, no plate,
   no border — the tiles keep floating over the plane and the heading sits on
   the plane behind them, which is the only way a section marker costs nothing.

   SCOPED ON PURPOSE, and this is not style. `.band` is already taken ~2,700
   lines up by the confidence-interval band (.band / .band-dash / .band.absent),
   an inline-flex text object that lives INSIDE widgets. A bare
   `.band { grid-column: 1 / -1 }` written here carries equal specificity and
   wins on document order, so every interval on the board would silently become
   a grid item. That has already happened once and broke a live component. The
   child combinator makes it structurally impossible: an interval is never a
   direct child of the grid, a section always is.
   CONTRACT: <section class="band"> is a DIRECT CHILD of .farm-grid.
   Anywhere else it does not lay out, on purpose. */
.farm-grid > .band {
  grid-column: 1 / -1;
  grid-row: auto;
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  min-width: 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  /* The heading belongs to the tiles BELOW it, so it must sit nearer to them
     than to the run above. row-gap is 24px in both directions and that reads
     as a heading floating between two groups. Pulling 16px back leaves 8 below
     and 24 above — the same 1:3 ratio the grid's own gap argument is built on. */
  margin: 0 0 calc(var(--sp-2) - var(--fb-sp-5));
}
.farm-grid > .band .band-t {
  margin: 0;
  font-family: var(--ff-text);
  font-size: var(--fz-cap);
  font-weight: var(--fw-semi);
  line-height: var(--lh-snug);
  letter-spacing: var(--tk-caps);
  text-transform: uppercase;
  color: var(--tx-2);
}
/* the count. Muted and one weight down: it is context for the title, never a
   value in its own right, and it must not be mistaken for a reading. */
.farm-grid > .band .band-n {
  font-size: var(--fz-cap);
  font-weight: var(--fw-med);
  letter-spacing: var(--tk-caps);
  color: var(--tx-3);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ── SPANS ─ .w-4x1 / .w-1x2 / .w-3x2 ────────────────────────────────────
   Three new spans join .w-1x1 / .w-2x1 / .w-2x2 / .w-4x2 on the same unit:
   one unit = 3 desktop columns.
     4x1  full width, one row       TIMELINE — a day is a line, not a block
     1x2  one unit wide, two rows   FEED, HEALTH — a column of rows
     3x2  three units, two rows     MATRIX — 9 + 3 fills a 12-column row exactly
   The 3x2 and the 1x2 are designed as a pair: they agree about row count, so
   grid stretches both to the taller and neither leaves a hole. */
.w-4x1 { grid-column: span 12; grid-row: span 1; }
.w-1x2 { grid-column: span 3;  grid-row: span 2; }
.w-3x2 { grid-column: span 9;  grid-row: span 2; }
/* joins the same exemption as the other spans: a floor on a grid ITEM pins the
   implicit track it sits in and drags its neighbours with it. */
.w-4x1, .w-1x2, .w-3x2 { min-height: 0; }

/* A two-row tile holds a COLUMN of things, not one centred drawing, so its body
   starts at the top and stacks. .w-bd's default centring is right for a ring and
   wrong for a list — a nine-row feed centred in its body has its first row
   hidden under the header and its last row clipped by overflow: hidden. */
.w-4x1 .w-bd, .w-1x2 .w-bd, .w-3x2 .w-bd {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}
/* The feed is the one thing here that can outgrow its tile — events arrive and
   the tile does not. It scrolls inside itself rather than growing the row,
   because a row that grows re-lays the tile beside it. */
.w-1x2 .w-bd { overflow-y: auto; overscroll-behavior: contain; }

@media (max-width: 1100px) {
  /* Six columns. The matrix and the timeline are full width now, so nothing
     sits beside them — the row spans have nothing left to align and would only
     pin implicit tracks for their neighbours to inherit. */
  .w-4x1, .w-3x2 { grid-column: span 6; }
  .w-1x2 { grid-column: span 3; }
  .w-4x1, .w-1x2, .w-3x2 { grid-row: auto; }
}
@media (max-width: 700px) {
  /* 380 is the design floor and this is exactly where an auto-rows grid goes
     ragged: two items sharing a pair of implicit tracks are both sized by
     whichever is taller, so a matrix that wants three rows drags the feed
     beside it into 100px of empty tile it cannot fill — the "reserved space for
     data we do not have" this file spends a page removing everywhere else.
     The fix is not a floor and not a height. It is to stop sharing: on a phone
     no wall widget spans rows and no wall widget shares one. Each is full width
     and sized by exactly what it holds.
     It is also the right answer independently — a 190px matrix column is
     unreadable in daylight, and a feed row that wraps its weight onto a second
     line is a feed row nobody scans. */
  .w-4x1, .w-1x2, .w-3x2 { grid-column: span 2; grid-row: auto; }
  /* and with the tile now full width, the feed has room to run rather than
     scroll inside a 2-row box the phone never gave it. */
  .w-1x2 .w-bd { overflow-y: visible; }
}

/* ── DENSITY ─ .w[data-dense] ─────────────────────────────────────────────
   Density drops PADDING one step and nothing else. Type stays at its tier and
   the material stays glass, because those two are what say "this is the same
   kind of object as the tile next to it" — a dense tile that also shrinks its
   type has quietly changed tier, and the operator reads a demotion that was
   never meant. Padding is the only channel with no meaning attached to it. */
.w[data-dense] {
  padding: var(--sp-2) var(--sp-3) var(--sp-3);
  gap: var(--sp-1);
}

/* ── MATRIX ─ svg.wmx > g.wmx-cell[data-status][data-cage] (Mira) ─────────
   Mira draws geometry. She does not choose colour: the cell declares its status
   and --st / --st-fill do the rest, exactly as .w does. One paint model for the
   whole board is what keeps a cage the same colour in the matrix as it is on
   the tile it came from. The svg lives in .w-mount inside .w-bd. */
.wmx { display: block; width: 100%; height: auto; }
.wmx-cell[data-status="ok"]      { --st: var(--st-calm);    --st-fill: var(--st-calm-dim); }
.wmx-cell[data-status="warn"]    { --st: var(--st-warn);    --st-fill: var(--st-warn-dim); }
.wmx-cell[data-status="crit"]    { --st: var(--st-crit);    --st-fill: var(--st-crit-dim); }
.wmx-cell[data-status="unknown"],
.wmx-cell:not([data-status])     { --st: var(--st-unknown); --st-fill: var(--st-unknown-dim); }
.wmx-cell rect, .wmx-cell circle, .wmx-cell path {
  fill: var(--st-fill);
  stroke: var(--st);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
/* Critical is a fill, not a tint. A 14%-opacity alarm is an alarm nobody sees
   across a room, and this cell may be 12px wide. */
.wmx-cell[data-status="crit"] rect,
.wmx-cell[data-status="crit"] circle,
.wmx-cell[data-status="crit"] path { fill: var(--st-crit); }
/* stale and silent are hatched, never coloured: absence of data is not a status
   and must not borrow one. */
.wmx-cell[data-stale] rect, .wmx-cell[data-silent] rect {
  fill: none;
  stroke: var(--st-unknown);
  stroke-dasharray: 2 2;
}
.wmx-cell text { fill: var(--tx-3); font-size: var(--fz-cap); letter-spacing: var(--tk-caps); }
.wmx-cell { cursor: pointer; }

/* ── TIMELINE ─ svg.wtl (Mira) ───────────────────────────────────────────
   NOT .timeline. That class is taken by the incident view (line ~1045) and a
   second definition here would win the cascade for both. See DESIGN_SYSTEM.md.
     .wtl-past    elapsed ground
     .wtl-future  ground not yet lived — hairline, never filled
     .wtl-now     the current instant
     .wtl-dawn    the daylight boundary
     .wtl-ev      an event, carrying data-cage */
.wtl { display: block; width: 100%; height: auto; }
.wtl-past   { fill: var(--glass-brd); stroke: none; }
/* the future is drawn as an EDGE, not as a plane. A filled future track reads as
   data that exists; this one reads as room. */
.wtl-future { fill: none; stroke: var(--glass-brd); stroke-width: 1; vector-effect: non-scaling-stroke; }
/* now is ink, not colour: it is a position, not a severity, and the four status
   colours have to keep meaning what they mean. */
.wtl-now    { stroke: var(--tx-1); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.wtl-dawn   { stroke: var(--tx-3); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.wtl-ev     { fill: var(--st-unknown); cursor: pointer; }
.wtl-ev[data-status="ok"]   { fill: var(--st-calm); }
.wtl-ev[data-status="warn"] { fill: var(--st-warn); }
.wtl-ev[data-status="crit"] { fill: var(--st-crit); }
.wtl text { fill: var(--tx-3); font-size: var(--fz-cap); letter-spacing: var(--tk-caps); }

/* ── FEED ─ ol.wfeed > li.wfeed-r[data-cage] (Kai, DOM in .w-bd) ─────────
   time.wfeed-t + span.wfeed-e + span.wfeed-w. Three columns, and the time
   column is fixed so nine rows share one scan line down the left edge —
   a feed whose timestamps wander is a feed that has to be read rather than
   scanned. The event takes the slack; the weight is right-aligned against it. */
/* min-width: 0 IS THE FIX, and the ellipsis above only made it possible. A flex
   item refuses to shrink below its min-content width unless it is told it may, so
   the list sat at 430 inside a 426px .w-bd and .w-bd's hidden overflow cut four
   pixels off the right of every row - the tracks inside were never the thing
   holding it open. One line here, and the row's yielding column can finally do
   the yielding it was given an ellipsis for. */
.wfeed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; min-width: 0; }
.wfeed-r {
  display: grid;
  /* minmax(0, max-content) on the weight, not max-content. Two rigid columns
     either side of a flexible one can still outgrow the panel between them: on a
     426px Activity body the time plus "escalated x14" plus two gaps measured 430,
     the 1fr collapsed to nothing, and the row overflowed .w-bd's hidden overflow
     by four pixels - a hard cut with no ellipsis, which is the one thing this
     board is not allowed to do to a word. The time column stays rigid because the
     scan line down the left edge is the whole point of the feed; the weight is
     the column that may yield, and it yields into an ellipsis. */
  grid-template-columns: max-content minmax(0, 1fr) minmax(0, max-content);
  align-items: baseline;
  gap: var(--sp-2);
  /* THE ONE .wfeed-r BLOCK. There were two, and the second re-declared padding
     as vertical-only while the first left margin-inline: -4px standing — so every
     row measured 8px wider than its overflow-hidden .w-bd and lost 4px off EACH
     end: the leading digit of the time, the last stroke of the last word. The
     pair is one decision, never two — 4px out, 4px back in, so the content box is
     exactly .w-bd wide and a selected row still reaches the panel edge. Change
     one of these two lines and you change the other. */
  padding: var(--sp-1);
  margin-inline: calc(var(--sp-1) * -1);
  min-width: 0;
  border-top: 1px solid var(--glass-brd);
  border-radius: var(--r-sm);
  /* opacity and background only — the standing constraint, and the reason a
     correlated row can settle in during a repaint without moving anything. */
  transition: background-color var(--dur-fast) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out);
}
.wfeed-r:first-child { border-top: 0; }
.wfeed-t {
  font-size: var(--fz-cap);
  font-weight: var(--fw-med);
  letter-spacing: var(--tk-caps);
  color: var(--tx-3);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  white-space: nowrap;
}
.wfeed-e {
  font-size: var(--fz-lbl);
  line-height: var(--lh-snug);
  color: var(--tx-1);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wfeed-w {
  font-size: var(--fz-lbl);
  font-weight: var(--fw-semi);
  color: var(--tx-2);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  white-space: nowrap;
  /* and the track above can only yield if the thing inside it can. An ellipsis is
     the sanctioned compact-display exception; a word cut off mid-stroke by an
     ancestor's hidden overflow is not, because nothing on the row tells the reader
     that anything was removed. */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* THE TALLY IS ARITHMETIC, NOT ALARM. `escalated x9` folds nine transitions on
   one entity into the state they ended in; the x9 COUNTS them, it does not
   declare them again. The row has already said crit once, in its ink and in its
   state word, and a second crit-red object immediately beside the first is the
   annunciator mistake at row scale -- two red things, one finding. So the tally
   steps out of the status ink it inherits, drops to caption size and back to
   reading weight, and the state word keeps the colour it earned. Tabular, because
   a count that reflows the row every time it ticks is worse than no count. */
.wfeed-n {
  margin-left: var(--sp-1);
  font-size: var(--fz-cap);
  font-weight: var(--fw-med);
  letter-spacing: var(--tk-caps);
  color: var(--tx-3);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ── HEALTH ─ dl.wgrid > div.wgrid-r > dt.wgrid-k + dd.wgrid-v (Kai) ─────
   A definition list because it IS one, and because dt/dd gives a screen reader
   the pairing that a two-column div grid throws away. */
.wgrid { margin: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.wgrid-r {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: baseline;
  gap: var(--sp-2);
  min-width: 0;
}
.wgrid-k {
  margin: 0;
  font-size: var(--fz-cap);
  font-weight: var(--fw-med);
  letter-spacing: var(--tk-caps);
  text-transform: uppercase;
  color: var(--tx-3);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wgrid-v {
  margin: 0;
  font-size: var(--fz-sm);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tk-sm);
  color: var(--tx-1);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  white-space: nowrap;
}
/* a value that is stale or absent says so in the value slot. It never renders
   as a confident current number in lighter ink and hopes to be noticed. */
.wgrid-r[data-stale] .wgrid-v, .wgrid-r[data-empty] .wgrid-v {
  color: var(--tx-3);
  font-weight: var(--fw-med);
  font-style: italic;
}

/* ── CORRELATE ─ .farm-overview[data-sel] ────────────────────────────────
   One cage is picked; everything that mentions it lights, everything else
   recedes. data-correlated marks a participating widget AND the matching rows
   and cells inside it; data-selected marks the primary hit. Escape clears
   data-sel and the board returns without a transition of its own.

   RECEDING IS NOT HIDING and it is not a dim. Only opacity moves, only on the
   tiles that are genuinely irrelevant, and an alarm is never irrelevant: a crit,
   stale or silent tile keeps full presence while correlation is active, because
   the operator picking a cage does not stop being responsible for the one that
   is failing behind them. This is the same exemption those tiles already hold
   against blur, stagger and fade. */
.farm-overview[data-sel] .w {
  transition: opacity var(--dur-ui) var(--ease-out);
}
.farm-overview[data-sel] .w:not([data-correlated]):not([data-selected]):not([data-status="crit"]):not([data-stale]):not([data-silent]) {
  opacity: .42;
}
/* Participation is a MARK, not a colour — correlation is not a status and may
   not spend one of the four. A hairline inside the edge, achromatic, and one
   step short of the selection mark so the primary hit still wins. */
.farm-overview[data-sel] .w[data-correlated]:not([data-selected]) {
  box-shadow: var(--glass-shd), inset 0 0 0 1px var(--w-sel-ink);
}
/* Inside a participating widget the matching rows and cells are the only thing
   at full strength. Same rule for a feed row, a health row, a matrix cell and a
   timeline event, so the four read as one gesture. */
.farm-overview[data-sel] .wfeed-r:not([data-correlated]):not([data-selected]),
.farm-overview[data-sel] .wgrid-r:not([data-correlated]):not([data-selected]),
.farm-overview[data-sel] .wmx-cell:not([data-correlated]):not([data-selected]):not([data-status="crit"]),
.farm-overview[data-sel] .wtl-ev:not([data-correlated]):not([data-selected]):not([data-status="crit"]) {
  opacity: .38;
}
.farm-overview[data-sel] .wmx-cell[data-selected] rect,
.farm-overview[data-sel] .wmx-cell[data-selected] circle,
.farm-overview[data-sel] .wmx-cell[data-selected] path {
  stroke: var(--tx-1);
  stroke-width: 2;
}
.farm-overview[data-sel] .wfeed-r[data-selected],
.farm-overview[data-sel] .wgrid-r[data-selected] {
  box-shadow: inset 2px 0 0 var(--tx-1);
  padding-left: var(--sp-2);
}

/* Correlation is a state change, not an animation. Reduced motion removes the
   fade between states; it does not remove the state, because the state is the
   information. */
@media (prefers-reduced-motion: reduce) {
  .farm-overview[data-sel] .w { transition: none; }
}
/* At reduced transparency and raised contrast, opacity is the wrong channel —
   .42 of a tile on a low-transparency ground is a tile that has vanished. The
   mark carries the whole message instead. */
@media (prefers-contrast: more) {
  .farm-overview[data-sel] .w:not([data-correlated]):not([data-selected]) { opacity: 1; }
  .farm-overview[data-sel] .wfeed-r:not([data-correlated]):not([data-selected]),
  .farm-overview[data-sel] .wgrid-r:not([data-correlated]):not([data-selected]),
  .farm-overview[data-sel] .wmx-cell:not([data-correlated]):not([data-selected]),
  .farm-overview[data-sel] .wtl-ev:not([data-correlated]):not([data-selected]) { opacity: 1; }
  .farm-overview[data-sel] .w[data-correlated]:not([data-selected]) {
    box-shadow: var(--glass-shd), inset 0 0 0 2px var(--tx-1);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   v14.9 · THE ROW SLOT — several measured values on one panel

   The tile footer holds ONE value, which is right for a panel that draws a mark
   and prints the number under it. Monitoring is not that shape: gateways
   delivering, probes reporting, ingest lag and the oldest unacknowledged alarm
   are four unrelated scales with nothing to draw between them.

   THE REQUIREMENT IS THAT IT DOES NOT MOVE. These figures tick while somebody
   is reading them — "probes reporting" goes 41 to 9 and back — and on a flex
   row a figure that gains a digit pushes its unit sideways and drags the label
   with it, so the eye loses the line it was on. The three columns are declared
   once on the LIST and every row inherits them through subgrid, so a column is
   a property of the panel and not of whichever row happened to render widest.
   Inside the figure column the numerals are tabular over a 3ch floor: a row can
   change its digits and nothing else about it.
   ═══════════════════════════════════════════════════════════════════════════ */
.w-rows {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(3ch, max-content) minmax(0, max-content);
  gap: var(--sp-1) var(--sp-2);
  align-items: baseline;
  min-width: 0;
}
.w-row {
  position: relative;
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: baseline;
  min-width: 0;
}
/* Without subgrid a row keeps its three cells on one line instead of stacking
   them; the columns stop agreeing between rows, which is worse than the promise
   above and better than a panel that renders as a pile. */
@supports not (grid-template-columns: subgrid) {
  .w-rows { display: flex; flex-direction: column; }
  .w-row { display: flex; gap: var(--sp-2); }
  .w-rk { flex: 1 1 auto; }
}
.w-rk {
  font-size: var(--fz-lbl);
  font-weight: var(--fw-med);
  letter-spacing: var(--tk-lbl);
  color: var(--tx-2);
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* A supporting figure, one type step under the tile's own footer value — the
   footer value is still the thing the panel is about. Right-aligned, so the
   digits stack into a column down the tile rather than ragging off the labels. */
.w-rv {
  font-family: var(--ff-display);
  font-size: var(--fz-md);
  font-weight: var(--fw-semi);
  line-height: var(--lh-tight);
  letter-spacing: var(--tk-md);
  color: var(--tx-1);
  font-variant-numeric: tabular-nums lining-nums;
  text-align: right;
  white-space: nowrap;
}
/* A lag we could not read is not a lag of nought, so the em dash is set as an
   absence — muted and a weight down — and never as a value. */
.w-rv.none { color: var(--tx-3); font-weight: var(--fw-med); }
.w-ru {
  font-size: var(--fz-cap);
  font-weight: var(--fw-med);
  letter-spacing: var(--tk-lbl);
  color: var(--tx-3);
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Status on a row is never hue alone: the rule at the left edge is the channel
   that survives a colourblind reader and a glare-washed panel, and the ink is
   the second one. It is drawn out of flow, so it cannot become a fourth grid
   item and cannot shift the subgrid tracks it sits beside — a statused row and
   a clean row keep the same columns.
   `ok` spends nothing, the same withholding as everywhere else on this board: a
   healthy row is a row with no mark on it, which is what makes a marked one
   findable without reading any of them. */
.w-row[data-status="warn"]::before,
.w-row[data-status="crit"]::before {
  content: "";
  position: absolute;
  left: -6px; top: 0; bottom: 0;
  width: 2px;
  border-radius: 1px;
}
.w-row[data-status="warn"]::before { background: var(--st-warn); }
.w-row[data-status="crit"]::before { background: var(--st-crit); }
.w-row[data-status="warn"] .w-rv { color: var(--st-warn-ink); }
.w-row[data-status="crit"] .w-rv { color: var(--st-crit-ink); }

/* AND THE VALUE IS WHAT CARRIES IT. With the panel wash pulled back to a header
   band the critical figure sits on plate, where crit ink actually separates, and
   it takes the one weight this scale reserves for the thing in a group that is
   wrong. Both row shapes, because Monitoring renders through .wgrid and the row
   slot renders through .w-rows and a reader cannot be asked to know which.
   Declared here so it lands after both .wgrid blocks. Nothing is receded to
   achieve it: an ok row keeps full ink and spends no hue, and that withholding is
   the whole reason these two are findable. */
.w-row[data-status="crit"] .w-rv,
.wgrid-r[data-status="crit"] .wgrid-v { font-weight: var(--fw-bold); }

/* ONE THIRD OF TWELVE. Twelve divides by three exactly and by the widget unit
   (three columns) it does not, so the fleet band's span has to come from the
   grid rather than from .w-2x2's six. The class is ADDITIVE: the tile keeps
   .w-2x2 for its padding, its type and its tier, and this says only how wide.
   Below the grid's own breakpoints it yields to exactly what .w-2x2 does, so
   the two can never disagree — which is what the render-time matchMedia read
   was buying, at the price of a layout that was wrong for one frame after every
   viewport change and right only on the next poll. */
.w-3col { grid-column: span 4; }
@media (max-width: 1100px) { .w-3col { grid-column: span 6; } }
@media (max-width: 700px)  { .w-3col { grid-column: span 2; } }

/* ═══════════════════════════════════════════════════════════════════════════
   v14.9 · THE BOARD IS ONE MODULE, NOT A STACK OF THEM

   Every band on this page is a 12-column grid and the page that holds them was
   a single column, so a band could only ever be full width. That is why the
   board reads as a list: nine sections, nine rows, one scan line each, and an
   operator who has to scroll an operations wall is navigating it.

   .l1 becomes the same 12 columns its bands already use, at the same column
   gutter, so every panel edge on the page still lands on one of thirteen
   verticals — the module argument the grid comment above spends a page making
   is not weakened by this, it is finally available one level up. A band still
   claims all twelve by default; anything that does not need twelve may now say
   so and share its row.

   THE TRAILING TRIO. Out of bounds, Direction and Automation were three
   full-width cards below the wall panels, 702px of page between them, and none
   of the three is a wide object: two are lists and the third is three narrow
   charts. Direction takes seven and the exception list five — the proportions
   the reference widget grid already settled on, so this is not a second
   opinion — and 233px of page goes away without one of them losing a row.
   Automation keeps twelve: it is the only one of the three whose rows are
   sentences, and a sentence in a five-column card is a sentence in an ellipsis.

   THE ROW GAP IS STILL SET INLINE BY THE RENDERER. app.js asked for
   `.l1:has(.farm-grid)` and set shell.style.gap until it landed. It has landed;
   the inline line has to go, or the board keeps a 32px column gutter that is
   not on the module and 96px of band gap that is not needed to separate bands
   that no longer read as one list.
   ═══════════════════════════════════════════════════════════════════════════ */
.l1:has(.farm-grid) {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--sp-3);
  /* THE BAND GAP IS A RATIO, NOT A VALUE. What it has to beat is the 12px
     gutter between tiles inside a band: at twice that, a row break reads as the
     end of a set, which is the whole of what the 32px was buying. Above 1100px
     every band is a single row, so there is no intra-band row gap for this to
     compete with and 24 is the honest number. Below 1100 bands wrap, and a 24px
     band boundary against a 24px wrap puts an end-of-set and a line break at the
     same distance -- so the wider value stays exactly where it still does work. */
  row-gap: var(--fb-sp-5);
}
.l1:has(.farm-grid) > * { grid-column: 1 / -1; min-width: 0; }
.l1:has(.farm-grid) > .l1-trends { grid-column: span 7; }
.l1:has(.farm-grid) > .l1-exceptions { grid-column: span 5; }
.l1:has(.farm-grid) > .l1-trends > .card { height: 100%; }
@media (max-width: 1100px) {
  /* At six columns the trio has no width left to share. Three narrow charts and
     a list side by side in 1100px is two panels that both stopped working. */
  .l1:has(.farm-grid) > .l1-trends,
  .l1:has(.farm-grid) > .l1-exceptions { grid-column: 1 / -1; }
  .l1:has(.farm-grid) { row-gap: var(--fb-sp-6); }
}


/* ═══════════════════════════════════════════════════════════════════════════
   v16 — THE INSTRUMENT BOARD (2026-09-04). Additive; nothing above is edited.
   Three decisions, each a ratified exception to an older rule, recorded in
   DESIGN_SYSTEM.md:
     1  identity hue lives in the header BADGE only — the withholding rule still
        owns every other colour on a tile (status is the only other chroma).
     2  the phone nav is one horizontal row of links; the desktop groups flatten.
     3  the three Level-1 sections under the bands wear the widget material, so
        the board reads as one system instead of a board with a footer.
   ═══════════════════════════════════════════════════════════════════════════ */

/* 1 · the identity badge — an iOS widget header: tinted squircle, mark in the hue */
.w .w-ico {
  width: 26px; height: 26px; flex: none; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--dom, var(--tx-2)); opacity: 1;
  background: color-mix(in srgb, var(--dom, var(--tx-3)) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dom, var(--tx-3)) 18%, transparent);
}
.w .w-ico svg { width: 16px; height: 16px; }
.w-2x2 .w-ico, .w-4x2 .w-ico { width: 28px; height: 28px; border-radius: 10px; }
.w-2x2 .w-ico svg, .w-4x2 .w-ico svg { width: 17px; height: 17px; }
.w .w-hd { min-height: 28px; }
/* light stops — dark enough to hold 4.5:1 as a stroke on white glass */
.w[data-dom="water"], .w[data-dom="dissolved-oxygen"] { --dom: #0284c7; }
.w[data-dom="weather"]                               { --dom: #0369a1; }
.w[data-dom="farm"], .w[data-dom="ponds"], .w[data-dom="uncorrelated"] { --dom: #475569; }
.w[data-dom="activity"], .w[data-dom="timeline"]     { --dom: #4f46e5; }
.w[data-dom="monitoring"]                            { --dom: #4338ca; }
.w[data-dom="attention"], .w[data-dom="losses"]      { --dom: #dc2626; }
.w[data-dom="feed"]                                  { --dom: #d97706; }
.w[data-dom="harvest"]                               { --dom: #0d9488; }
.w[data-dom="stock"]                                 { --dom: #16a34a; }
/* dark stops — the app's own domain gradients, first stop */
:root[data-theme="dark"] .w[data-dom="water"], :root[data-theme="dark"] .w[data-dom="dissolved-oxygen"] { --dom: #22d3ee; }
:root[data-theme="dark"] .w[data-dom="weather"]                                   { --dom: #7dd3fc; }
:root[data-theme="dark"] .w[data-dom="farm"], :root[data-theme="dark"] .w[data-dom="ponds"],
:root[data-theme="dark"] .w[data-dom="uncorrelated"]                              { --dom: #94a3b8; }
:root[data-theme="dark"] .w[data-dom="activity"], :root[data-theme="dark"] .w[data-dom="timeline"] { --dom: #818cf8; }
:root[data-theme="dark"] .w[data-dom="monitoring"]                                { --dom: #a5b4fc; }
:root[data-theme="dark"] .w[data-dom="attention"], :root[data-theme="dark"] .w[data-dom="losses"] { --dom: #fb7185; }
:root[data-theme="dark"] .w[data-dom="feed"]                                      { --dom: #fbbf24; }
:root[data-theme="dark"] .w[data-dom="harvest"]                                   { --dom: #2dd4bf; }
:root[data-theme="dark"] .w[data-dom="stock"]                                     { --dom: #4ade80; }
/* the status glyphs stay status-coloured: a warning triangle in a hue would lie */
.w[data-status="warn"] .w-ico, .w[data-status="crit"] .w-ico { color: var(--st); background: var(--st-fill); box-shadow: none; }

/* 2 · the phone nav — one row, every link, groups flattened (app.js opens them all
      below 900px, so display:contents lets each group's links flow into the row) */
@media (max-width: 900px) {
  aside {
    padding: 8px 10px; gap: 8px; align-items: center;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  aside::-webkit-scrollbar { display: none; }
  aside .brand { padding: 0 6px 0 0; gap: 8px; }
  aside .brand img { width: 30px; height: 30px; }
  aside .brand .sub { display: none; }
  aside .brand .name { font-size: var(--fz-sm); white-space: nowrap; }
  aside nav {
    display: flex; flex-wrap: nowrap; align-items: center; gap: 4px;
    overflow: visible; margin: 0; padding: 0; flex: none; min-height: 0;
  }
  aside nav details.nav-group { display: contents; }
  aside nav summary.group, aside nav .group { display: none; }
  aside nav a { white-space: nowrap; padding: 7px 10px; font-size: var(--fz-cap); border-radius: 999px; }
  aside nav a .ext { display: none; }
  :root[data-theme="dark"] nav a svg { width: 22px; height: 22px; padding: 4px; }
}

/* 3 · the Level-1 sections under the bands wear the widget material */
.farm-overview > .l1-exceptions,
.farm-overview > .l1-automation,
.farm-overview .l1-trendcard {
  background: var(--glass-a-mid);
  border: 1px solid var(--glass-brd); border-top-color: var(--glass-hi);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shd), inset 0 1px 0 var(--glass-hi);
  backdrop-filter: blur(var(--glass-b-mid)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-b-mid)) saturate(180%);
}
.farm-overview .l1-exceptions .card-head h3,
.farm-overview .l1-automation .card-head h3,
.farm-overview .l1-trendcard .card-head h3 {
  font-size: var(--fz-cap); font-weight: var(--fw-med); letter-spacing: var(--tk-caps);
  text-transform: uppercase; color: var(--tx-3);
}
.farm-overview .auto-meta { color: var(--tx-3); font-size: var(--fz-cap); }
.farm-overview .auto-will { font-size: var(--fz-sm); }
@media (prefers-reduced-transparency: reduce) {
  .farm-overview > .l1-exceptions, .farm-overview > .l1-automation, .farm-overview .l1-trendcard {
    backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--plate);
  }
}

/* v16 · 4 — two layout defects found by the phone sweep.
   (a) #app is a grid with min-height:100vh and two auto rows; on a short page the leftover
       height is split between the rows, so the nav bar grew to 240px on Health and Tasks.
       The nav row is content-sized; main takes the rest.
   (b) wide tables (weather, water, devices, production, standards, activity) ran past the
       right edge of a 390px viewport. A table scrolls inside its card; the page never does. */
@media (max-width: 900px) {
  #app.on { grid-template-rows: auto 1fr; align-content: start; }
}
@media (max-width: 700px) {
  main table { display: block; overflow-x: auto; max-width: 100%; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  main table thead, main table tbody, main table tr { display: table; width: 100%; table-layout: auto; }
  main table th, main table td { white-space: nowrap; }
}


/* v16 · 5 — the inline trend in a row slot: name · spark · figure · unit. The spark column is
   auto-width, so a panel whose rows bring no trail keeps its three-column reading. */
.w .w-rows { grid-template-columns: minmax(0, 1fr) auto minmax(3ch, max-content) minmax(0, max-content); }
.w-rs { display: block; width: 60px; height: 16px; align-self: center; overflow: visible; }
.w-rs:empty { width: 0; }
.w-rs path { fill: none; stroke: var(--tx-2); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.w-rs circle { fill: var(--tx-1); }
@supports not (grid-template-columns: subgrid) {
  .w-rs { flex: none; }
}


/* v16 · 6 — identity on the shell, by owner direction (2026-09-05). A tile in a NORMAL
   state used to wash its top edge in the calm grey of its status; it now carries its own
   identity hue on the glass — a diagonal wash from the top-left, brightest under the
   badge, gone by the value — the way the phone's shells do, so twelve widgets read as
   twelve instruments instead of twelve grey panels. Status takes the shell back the
   moment a tile is warn or crit: chroma for a state still outranks chroma for a name.
   Alphas are absolute (not the --tint ladder) so the effect is legible at a glance:
   dark 24 % → 6 %, hero 32 % → 8 %; light glass takes about two thirds of that. */
.farm-grid > .w[data-dom]:not([data-status="warn"]):not([data-status="crit"])::before {
  background:
    linear-gradient(160deg,
      color-mix(in srgb, var(--dom, var(--st)) 24%, transparent) 0%,
      color-mix(in srgb, var(--dom, var(--st)) 6%, transparent) 48%,
      transparent 100%);
  opacity: 1;
}
.farm-grid > .w[data-tier="primary"][data-dom]:not([data-status="warn"]):not([data-status="crit"])::before {
  background:
    linear-gradient(160deg,
      color-mix(in srgb, var(--dom, var(--st)) 32%, transparent) 0%,
      color-mix(in srgb, var(--dom, var(--st)) 8%, transparent) 52%,
      transparent 100%);
}
.farm-grid > .w[data-dom]:not([data-status="warn"]):not([data-status="crit"]) {
  border-top-color: color-mix(in srgb, var(--dom, var(--glass-hi)) 70%, var(--glass-hi));
  border-left-color: color-mix(in srgb, var(--dom, var(--glass-brd)) 30%, var(--glass-brd));
}
:root:not([data-theme="dark"]) .farm-grid > .w[data-dom]:not([data-status="warn"]):not([data-status="crit"])::before {
  background:
    linear-gradient(160deg,
      color-mix(in srgb, var(--dom, var(--st)) 16%, transparent) 0%,
      color-mix(in srgb, var(--dom, var(--st)) 4%, transparent) 48%,
      transparent 100%);
}
/* the badge is the brightest object on the shell: fuller fill, a hairline of its hue */
.w .w-ico {
  background: color-mix(in srgb, var(--dom, var(--tx-3)) 22%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dom, var(--tx-3)) 28%, transparent);
}
.w-4x2 .w-ico, .w-2x2 .w-ico { width: 30px; height: 30px; border-radius: 10px; }
.w-4x2 .w-ico svg, .w-2x2 .w-ico svg { width: 18px; height: 18px; }
/* the value sits on the hue, so it is the brightest text on the tile */
.farm-grid > .w[data-dom] .w-val { color: var(--tx-1); }
/* the section captions under the bands take the same voice as the widget headers */
.farm-overview .l1-exceptions, .farm-overview .l1-automation, .farm-overview .l1-trendcard {
  border-top-color: color-mix(in srgb, #94a3b8 40%, var(--glass-hi));
}


/* v16 · 7 — the board fits, and every tile opens. Spans are classes with breakpoints
   (the inline arithmetic they replace overflowed the tablet grid); a one-row tile that
   stands beside two-row panels takes both rows; the farm tile fills its own hole when
   nothing else can. Tiles that are doors get the pointer and a focus ring - the hover
   lift for [tabindex] already exists above. */
.w-9col { grid-column: span 9; }
.w-quarter { grid-column: span 3; }
.w-tall { grid-row: span 2; }
@media (max-width: 1100px) {
  .w-9col { grid-column: span 6; }
  .w-quarter { grid-column: span 3; }
}
@media (max-width: 700px) {
  .w-9col, .w-quarter { grid-column: span 2; }
  .w-tall { grid-row: auto; }
}
.w-link { cursor: pointer; }
.w-link:focus-visible { outline: 2px solid var(--brand-mid); outline-offset: 3px; }
/* a two-row quiet tile centres its one fact instead of leaving it in a corner */
.farm-grid > .w-1x1.w-tall > .w-bd { justify-content: center; }


/* v16 · 7b — the two-row farm tile: rows in the middle, the count at the foot, and on
   the six-column tablet grid it becomes one full-width row (nothing can stand beside it
   there, so height would only be glass). */
.farm-grid > .w-1x1.w-tall > .w-rows { margin-top: var(--sp-2); }
.farm-grid > .w-1x1.w-tall > .w-ft { margin-top: auto; }
@media (max-width: 1100px) {
  .farm-grid > .w-1x1.w-tall { grid-column: span 6; grid-row: auto; }
}

/* v16 · 7c — the water band packs densely. In flow order the tiles are farm, weather,
   bench; on the six-column tablet grid the full-width weather panel fell between the two
   half-width tiles and left each alone in a half-empty row. Dense flow lets the bench tile
   backfill beside the farm tile there, and places it in the same hole under the farm tile
   at desktop that sparse flow already chose. */
.farm-grid[data-band="the-water"] { grid-auto-flow: row dense; }

/* v16 · 8 (audit F068/F069): a refresh that could not read everything says so. */
.tp.partial { background: color-mix(in srgb, var(--warn, #c77700) 18%, transparent); color: var(--warn, #c77700); }
.tp.partial i { background: var(--warn, #c77700); }

/* ── the readings, charted (redesign 2026-09-07) ─────────────────────────────────────
   Three panels, one time axis, one readout. Every poll is a tick; labels never collide. */
.sm { outline: none; }
.sm-readout { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); align-items: baseline;
  padding: 8px 12px; margin-top: var(--sp-2); border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface-sunken); font-size: 12.5px; }
.sm:focus-visible .sm-readout { box-shadow: 0 0 0 2px var(--brand-mid); }
.sm-ro-time { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.sm-ro-vals { display: flex; gap: var(--sp-4); flex-wrap: wrap; color: var(--text-secondary); margin-left: auto; }
.sm-ro-item b { color: var(--text-primary); font-variant-numeric: tabular-nums; font-weight: 650; }
.sm-ro-key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.sm-hero { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.sm-hero b { font-size: 20px; font-weight: 650; color: var(--text-primary); letter-spacing: -0.01em; }
.sm-hero .sm-uom { font-size: 11.5px; color: var(--text-muted); }
.sm-hero .sm-when { font-size: 11.5px; color: var(--text-secondary); margin-left: 4px; }
.sm-grid { stroke: var(--axis); stroke-width: 1; opacity: .45; }
.sm-ref { font-size: 10.5px; fill: var(--text-muted); }
.sm-dl-val { font-size: 10.5px; fill: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }
.sm-dl-time { font-size: 9.5px; fill: var(--text-muted); font-variant-numeric: tabular-nums; }
.sm-gap-note { font-size: 10px; fill: var(--text-muted); }
.sm-svg { cursor: crosshair; touch-action: pan-y; }
.sm-x { stroke: var(--text-secondary); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0; pointer-events: none; transition: opacity var(--dur-tip); }
.sm.hot .sm-x, .sm:focus-within .sm-x { opacity: .9; }
.sm-focus { opacity: 0; pointer-events: none; transition: opacity var(--dur-tip); }
.sm.hot .sm-focus, .sm:focus-within .sm-focus { opacity: 1; }
.sm-axis-svg { display: block; width: 100%; height: auto; margin-top: 2px; cursor: crosshair; }
.sm-axis-lbl { font-size: 10.5px; fill: var(--text-secondary); font-variant-numeric: tabular-nums; }
.sm-axis-day { font-size: 10px; fill: var(--text-muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }


/* ═════════════════════════════════════════════════
   2026-09-11 — the situation kit (situation.render.js): tone dots, segmented rings and
   bars, share rings, target meters, neutral score rings. Colour never carries alone.
   ═════════════════════════════════════════════════ */
.sk-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; vertical-align: middle;
  box-shadow: 0 0 0 2px var(--surface-1);
}
.sk-dot.good { background: var(--good); }
.sk-dot.warn { background: var(--warning, var(--serious)); }
.sk-dot.bad { background: var(--critical); }
.sk-dot.off { background: transparent; border: 1.5px dashed var(--text-muted); box-shadow: none; }

.sk-ring { display: flex; align-items: center; gap: var(--s4); min-width: 0; flex-wrap: wrap; }
.sk-ring > .sk-cap { flex-basis: 100%; }
.sk-ring-svg, .sk-mini, .sk-score-svg { flex: none; overflow: visible; }
.sk-ring-svg .track, .sk-mini .track, .sk-score-svg .track { stroke: var(--ring-track, var(--grid)); }
.sk-ring-svg .seg.good, .sk-mini .seg.good { stroke: var(--good); }
.sk-ring-svg .seg.warn, .sk-mini .seg.warn { stroke: var(--warning, var(--serious)); }
.sk-ring-svg .seg.bad, .sk-mini .seg.bad { stroke: var(--critical); }
.sk-ring-svg .seg.off, .sk-mini .seg.off { stroke: var(--text-muted); }
.sk-ring-svg .num { font-size: 30px; font-weight: 700; fill: var(--text-primary); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.sk-mini .num { font-size: 28px; font-weight: 700; fill: var(--text-primary); font-variant-numeric: tabular-nums; }
.sk-score-svg .sweep { stroke: var(--text-secondary); }
.sk-score-svg .num { font-size: 34px; font-weight: 700; fill: var(--text-primary); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.sk-score { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sk-score-of { font-size: var(--fs-micro); color: var(--text-muted); white-space: nowrap; }

.sk-legend { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sk-lg { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-small); color: var(--text-secondary); white-space: nowrap; }
.sk-lg b { font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.sk-cap { font-size: var(--fs-micro); color: var(--text-muted); }

.sk-segbar { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sk-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--grid); gap: 2px; }
.sk-bar.empty { background: repeating-linear-gradient(90deg, var(--grid) 0 4px, transparent 4px 8px); }
.sk-bar-seg.good { background: var(--good); }
.sk-bar-seg.warn { background: var(--warning, var(--serious)); }
.sk-bar-seg.bad { background: var(--critical); }
.sk-bar-seg.off { background: var(--text-muted); }
.sk-segbar .sk-legend { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; }

/* a widget cell that sits inside a .metric-grid beside the number tiles */
.metric.sk-cell { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.metric.sk-cell .m-k { margin-bottom: 2px; }

/* the tone dot inside a metric tile's value line */
.m-v .sk-dot { margin-right: 8px; transform: translateY(-3px); }

/* target meter */
.sk-meter { display: flex; flex-direction: column; gap: 2px; margin: 6px 0 4px; }
.sk-meter-svg { display: block; width: 100%; height: 12px; }
.sk-meter-svg .track { fill: var(--grid); }
.sk-meter-svg .goodzone { fill: color-mix(in srgb, var(--good) 22%, transparent); }
.sk-meter-svg .warnzone { fill: color-mix(in srgb, var(--warning, var(--serious)) 22%, transparent); }
.sk-meter-svg .fill.good { fill: var(--good); }
.sk-meter-svg .fill.warn { fill: var(--warning, var(--serious)); }
.sk-meter-svg .fill.bad { fill: var(--critical); }
.sk-meter-svg .mark { fill: var(--text-secondary); }
.sk-meter-svg .mark.flood { fill: var(--critical); }
.sk-meter-l { position: relative; height: 14px; font-size: var(--fs-micro); color: var(--text-muted); }
.sk-meter-l span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.sk-meter-l .flood { color: var(--critical); }

/* zones: the in-service share as a ring beside its words */
.zfact.sk-share { display: flex; align-items: center; gap: 10px; }
.zfact.sk-share .zf-words { display: flex; flex-direction: column; }

/* weather: the night score as a neutral ring beside the drivers */
.wx-night-s.sk { display: flex; align-items: center; gap: var(--s3); }

/* alerts: the strip's summary, and the richer item */
.alert-sum { display: flex; align-items: center; gap: var(--s5); flex-wrap: wrap; padding: var(--s3) var(--s4);
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: var(--s3); }
.alert-sum .sk-segbar { flex: 1; min-width: 220px; }
.alert-areas { display: flex; gap: 6px; flex-wrap: wrap; }
.alert-area { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: var(--fs-micro);
  color: var(--text-secondary); border: 1px solid var(--border); background: var(--surface-1); }
.alert-area svg { width: 13px; height: 13px; }
.alert .a-mark { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--border); }
.alert .a-mark svg { width: 18px; height: 18px; }
.alert .sev { display: inline-flex; align-items: center; gap: 6px; }
@media (min-width: 1100px) { .alert-strip.two { grid-template-columns: 1fr 1fr; } }

/* Add a buoy: the vendor message is plain text and must read exactly as it will be sent */
.buoy-ids { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--s4); }
.buoy-handoff {
  margin-top: var(--s4); width: 100%; resize: vertical; white-space: pre; overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.5;
}
.buoy-acts { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--s4); }

/* Reports (CSV). Period bar wraps on a phone; the segmented control scrolls rather than
   squeezing six presets into unreadable buttons. */
.rep-period { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.rep-period .segmented { max-width: 100%; overflow-x: auto; }
.rep-dates { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.rep-dates label {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fz-sm); color: var(--text-secondary);
}
.rep-dates input {
  padding: 6px 9px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface-1); color: var(--text-primary); font: inherit;
}
.rep-dates input:focus { outline: none; border-color: var(--brand-mid); box-shadow: 0 0 0 3px var(--brand-pale); }
.rep-standard { margin: var(--sp-3) 0 0; max-width: 72ch; font-size: var(--fz-sm); color: var(--text-muted); }
.rep-purpose { margin-top: 2px; font-size: var(--fz-sm); color: var(--text-muted); font-weight: normal; }
.rep-get { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; white-space: nowrap; }
.rep-note { font-size: 11.5px; color: var(--text-muted); max-width: 28ch; overflow: hidden; text-overflow: ellipsis; }
.rep-note.bad { color: var(--critical); white-space: normal; }

/* Cameras (CCTV). 3 x 2 on a wide screen, 2 x 3 on a tablet, one column on a phone. */
.cam-note { margin: 0 0 var(--sp-3); max-width: 80ch; font-size: var(--fz-sm); color: var(--text-muted); }
.cam-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.cam-grid.one { grid-template-columns: 1fr; }
.cam-tile { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3); }
.cam-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.cam-head h3 { margin: 0; font-size: var(--fz-md, 15px); }
.cam-frame { position: relative; aspect-ratio: 16 / 9; max-width: 100%; background: #05080c; border-radius: 8px; overflow: hidden; }
.cam-focus .cam-frame { max-height: 72vh; }
.cam-video { width: 100%; height: 100%; object-fit: contain; display: block; background: #05080c; }
.cam-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--sp-3);
  text-align: center; color: #c9d1da; font-size: var(--fz-sm); }
.cam-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.cam-detail { flex: 1; min-width: 0; font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Environment banner (demo/test only; production never renders it) */
.env-banner { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 1000; padding: 8px 16px;
  background: #b3261e; color: #fff; font: 600 13px/1.35 system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: center; letter-spacing: .02em; }
