/* Email Delivery Tracker — internal reporting view.

   Direction (redesign 23 Sep): calm instrument. Soft, slightly cool-tinted surfaces instead of
   black-and-white; one quiet blue accent for anything interactive; colour otherwise reserved for
   DATA (chart series) and STATUS (small dots, always next to a word). Nothing is highlighted in
   a solid signal colour any more — the old orange pills and bands read as alarms.

   Every text token clears WCAG AA 4.5:1 on its surface in both themes (measured 23 Sep).
   Chart series (blue/aqua) were run through the dataviz validator: dark all-pass; light aqua is
   2.82:1 on white, so every chart ships with a legend and its table (the required relief). */

:root {
  --bg:          #f4f5f7;
  --surface:     #ffffff;
  --surface-2:   #f6f7f9;
  --surface-3:   #eef0f3;
  --line:        #e2e5ea;
  --line-soft:   #edf0f3;
  --ink:         #1d232c;
  --ink-soft:    #4f5967;
  --ink-faint:   #687180;
  --accent:      #2a6fd1;
  --accent-ink:  #ffffff;
  --accent-soft: rgba(42, 111, 209, .09);
  --accent-line: rgba(42, 111, 209, .35);
  --good:        #1b8a61;
  --warn:        #b7791f;
  --bad:         #c0443f;
  --focus:       #2a6fd1;
  --hatch:       rgba(29, 35, 44, .06);
  --series-1:    #2a78d6;
  --series-2:    #1baf7a;
  --grid:        #eceef1;
  --axis:        #c9ced6;
  --mark:        #b3bcc8;                 /* quiet non-data marks (coverage meter) */
  --radius:      10px;
  --shadow:      0 1px 2px rgba(20, 27, 38, .04), 0 2px 8px rgba(20, 27, 38, .04);
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --cond: "IBM Plex Sans Condensed", "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}

/* Light is the default for everyone, whatever the computer's own setting (owner, 23 Sep: "make
   the background white, not black"). There is deliberately NO prefers-color-scheme rule: it
   turned the whole tracker — sign-in page included — black on every dark-mode PC. Dark exists
   only for someone who picks it with the header toggle. */
:root[data-theme="dark"] {
  --bg: #111317; --surface: #171a1f; --surface-2: #1d2127; --surface-3: #232830;
  --line: #2a3038; --line-soft: #21262d;
  --ink: #d6dce4; --ink-soft: #a3acb8; --ink-faint: #8b94a2;
  --accent: #72a5f2; --accent-ink: #0f1520; --accent-soft: rgba(114, 165, 242, .12);
  --accent-line: rgba(114, 165, 242, .38);
  --good: #43b98d; --warn: #dcaa4a; --bad: #e57373; --focus: #72a5f2;
  --hatch: rgba(214, 220, 228, .06);
  --series-1: #3987e5; --series-2: #199e70; --grid: #242931; --axis: #3a414b; --mark: #4b5563;
  --shadow: 0 1px 2px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 14px/1.55 var(--sans);
}
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
a { color: var(--accent); }

/* ---------------------------------------------------------------- masthead */
/* Solid, not frosted glass: a backdrop blur is recomputed over the moving page on every frame of
   a scroll — a known cause of the jerky scrolling reported on 24 Sep. */
.masthead {
  position: sticky; top: 0; z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.masthead-in {
  max-width: 1440px; margin: 0 auto; padding: 0 24px;
  height: 56px; display: flex; align-items: center; gap: 16px; justify-content: space-between;
}
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
/* the GrowMailers logo (brand/ — the website's own files), light and dark versions */
.wordmark-logo { height: 24px; width: auto; display: block; flex: none; }
.wordmark-logo.logo-dark { display: none; }
:root[data-theme="dark"] .wordmark-logo.logo-light { display: none; }
:root[data-theme="dark"] .wordmark-logo.logo-dark { display: block; }
.wordmark-sep { color: var(--ink-faint); }
.wordmark-app { font: 400 14px/1 var(--sans); color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.masthead-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.asof { font: 400 12px/1 var(--sans); color: var(--ink-faint); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.asof::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.theme-toggle, .whoami, .alertbadge {
  font: 500 12px/1 var(--sans); color: var(--ink-soft); text-decoration: none; white-space: nowrap;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 12px; cursor: pointer;
}
.theme-toggle:hover, .whoami:hover, .alertbadge:hover { color: var(--ink); background: var(--surface-2); }
.whoami { max-width: 15rem; overflow: hidden; text-overflow: ellipsis; }
.alertbadge { display: inline-flex; align-items: center; gap: 7px; }
.alertbadge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); }
.alertbadge.has-critical::before { background: var(--warn); }
form.signout { display: inline; margin: 0; }

/* ---------------------------------------------------------------- crumbs */
.crumbs { max-width: 1440px; margin: 0 auto; padding: 18px 24px 0; }
.crumbs:empty, .crumbs ol:empty, .crumbs ol:only-child li:only-child { display: none; }
.crumbs:has(ol:empty) { padding-top: 8px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; }
.crumbs li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-faint); }
.crumbs li + li::before { content: "/"; color: var(--line); }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current] { color: var(--ink); font-weight: 500; }

/* ---------------------------------------------------------------- main */
main { max-width: 1440px; margin: 0 auto; padding: 16px 24px 64px; }
main:focus { outline: none; }
.loading { padding: 48px 0; color: var(--ink-faint); font: 400 13px/1 var(--sans); }

.view-head { margin: 4px 0 24px; }
.eyebrow { font: 500 12px/1 var(--sans); color: var(--ink-faint); margin: 0 0 8px; }
.view-title { font: 600 26px/1.2 var(--sans); letter-spacing: -.02em; margin: 0; color: var(--ink); }
.view-title:focus, .view-title:focus-visible { outline: none; }   /* focused for screen readers, not a control */
.view-sub { margin: 8px 0 0; color: var(--ink-soft); font-size: 14px; max-width: 72ch; }

.section-title { font: 600 13px/1.2 var(--sans); color: var(--ink-soft); margin: 32px 0 12px; }

/* add a client (admins) */
.view-head .head-action { display: inline-block; margin-top: 12px; text-decoration: none; }
.add-panel { max-width: 720px; padding: 20px 24px 24px; }
.add-steps { margin: 0 0 20px; padding-left: 20px; color: var(--ink-soft); font-size: 13.5px; line-height: 1.6; }
.add-steps strong { color: var(--ink); font-weight: 600; }
.add-field { margin: 0 0 16px; }
.add-field label { display: block; font: 500 13px/1.3 var(--sans); color: var(--ink-soft); margin: 0 0 6px; }
.add-field input { width: 100%; max-width: 480px; font: 400 15px/1.4 var(--sans); padding: 9px 12px; color: var(--ink);
                   background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.add-field input:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }
.add-field input:disabled { background: var(--surface-2); color: var(--ink-faint); }
.add-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-faint); }
.add-actions { display: flex; gap: 8px; margin: 8px 0 16px; }
.add-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.add-primary:hover { background: var(--accent); color: var(--accent-ink); filter: brightness(1.08); }
.add-actions button:disabled { opacity: 1; background: var(--surface-2); border-color: var(--line); color: var(--ink-faint); cursor: not-allowed; filter: none; }
.add-result { font-size: 14px; color: var(--ink-soft); }
.add-result .add-msg { margin: 0 0 8px; font-weight: 600; color: var(--ink); }
.add-result.is-bad .add-msg { color: var(--bad); }
.add-result.is-ok .add-msg { color: var(--good); }
.add-acct { margin: 0 0 8px; }
.add-checks { list-style: none; margin: 0 0 12px; padding: 0; }
.add-checks li { padding: 3px 0; }
.add-checks .add-mark { display: inline-block; width: 18px; font-weight: 700; }
.add-checks li.ok .add-mark { color: var(--good); }
.add-checks li.bad .add-mark { color: var(--bad); }
.add-checks code { font: 500 12.5px/1.4 var(--mono); color: var(--ink); }
.add-detail { color: var(--ink-soft); }

/* The outline is a ring (box-shadow), not a border. At 125% display scaling a 1px border snaps
   to 0.8 CSS px, which put the table scroller at x.8: the pinned first column and the clip edge
   then straddled a device pixel, and scrolled header text showed through in a 1px sliver. A
   ring takes no layout space, so the scroller starts on a whole pixel. */
.panel {
  background: var(--surface); border: 0;
  border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line), var(--shadow);
  overflow: clip;       /* not hidden: still clips to the rounded corners, but is not a scroll box,
                           so the sideways scrollbar inside can stick to the WINDOW's bottom edge */
}
.panel + .panel { margin-top: 20px; }
.panel-head {
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.panel-title { font: 600 14px/1.3 var(--sans); margin: 0; }
.panel-meta { font: 400 12px/1.3 var(--sans); color: var(--ink-faint); }
.panel-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0 0 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; min-width: 0;
  display: flex; flex-direction: column;       /* each tile's small chart sits on the bottom edge */
}
.stat-label { font: 500 12.5px/1.3 var(--sans); color: var(--ink-faint); margin: 0; }
.stat-value { font: 600 26px/1.15 var(--sans); letter-spacing: -.02em; color: var(--ink); margin: 8px 0 0; }
.stat-sub { font: 400 12.5px/1.4 var(--sans); color: var(--ink-soft); margin: 6px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stat-viz { margin-top: auto; padding-top: 14px; }
.stat-spark { display: block; width: 100%; height: auto; }
.stat .dotstrip { display: flex; flex-wrap: wrap; gap: 7px; }
.dotstrip i { width: 10px; height: 10px; border-radius: 50%; background: var(--good); display: block; }
.dotstrip i.warn { background: var(--warn); }
.dotstrip i.bad  { background: var(--bad); }
.dotstrip i.idle { background: var(--axis); }
.delta { font-weight: 500; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); } .delta.flat { color: var(--ink-faint); }

/* ---------------------------------------------------------------- charts */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin: 0 0 20px; }
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px 12px; min-width: 0; position: relative; }
.chart-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; }
.chart-title { font: 600 14px/1.3 var(--sans); margin: 0; }
.chart-sub { font: 400 12px/1.3 var(--sans); color: var(--ink-faint); }
.chart-legend { display: flex; gap: 14px; margin-left: auto; flex-wrap: wrap; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-legend i.line { height: 2px; width: 14px; border-radius: 1px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart text { fill: var(--ink-faint); font: 400 11px/1 var(--sans); font-variant-numeric: tabular-nums; }
.chart .value-label { fill: var(--ink-soft); font-weight: 500; }
.chart .bar { transition: opacity .12s ease; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart .hit:focus + .bar { opacity: .78; }
.chart .crosshair { stroke: var(--axis); stroke-width: 1; }
.chart .s1 { fill: var(--series-1); }
.chart .muted { fill: var(--axis); }
.chart .s2 { fill: var(--series-2); }
.chart .lineseries.l1 { stroke: var(--series-1); }
.chart .dot.l1 { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart-legend i.s1 { background: var(--series-1); }
.chart-legend i.s2 { background: var(--series-2); }
.chart-empty { padding: 36px 0; text-align: center; color: var(--ink-faint); font-size: 13px; }
.tip {
  position: absolute; pointer-events: none; z-index: 20; min-width: 150px;
  background: var(--surface-3); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18); padding: 9px 11px; font-size: 12px; color: var(--ink-soft);
}
.tip-title { color: var(--ink-faint); margin: 0 0 5px; font-size: 11.5px; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-row b { color: var(--ink); font-weight: 600; margin-left: auto; font-variant-numeric: tabular-nums; }
.tip-row i { width: 12px; height: 2px; border-radius: 1px; display: inline-block; }

/* sparklines (client list, picker) */
.spark { display: block; }
.spark rect { fill: var(--series-1); }
.spark rect.dim { fill: var(--axis); }
.spark rect.spark-hit { fill: transparent; }
.spark rect.spark-hit:hover { fill: var(--hatch); }
.spark polyline { fill: none; stroke: var(--series-1); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--series-1); stroke: var(--surface); stroke-width: 1.5; }

/* ---------------------------------------------------------------- segmented switches */
.navbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 0 0 20px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.seg button {
  font: 500 13px/1 var(--sans); color: var(--ink-soft); background: transparent; border: 0;
  padding: 8px 14px; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.seg button:hover:not(:disabled):not([aria-pressed="true"]) { color: var(--ink); background: var(--surface-3); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 0 1px var(--line); }
.seg button:disabled { color: var(--ink-faint); opacity: .55; cursor: not-allowed; }

/* ---------------------------------------------------------------- tables */
/* ⚠ The scroller owns BOTH axes: overflow-x alone still makes it a y scroll container, which
   captures the sticky header. So both axes scroll here and the header pins to top: 0. */
.scroller:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
/* position: relative makes the scroller the containing block of the .sr-only labels inside the
   table (position: absolute). Without it they escaped its clipping and widened the whole page
   to the table's full width — a horizontal scrollbar on every report. */
/* Tables scroll SIDEWAYS only; up and down, the page scrolls as one. They used to scroll inside
   themselves too (max-height + overscroll-behavior: contain): a wheel over a table moved only
   its rows, the page froze part-way down, and at the table's end the wheel did nothing at all —
   the scrollbar was the only way on (owner, 24 Sep). overflow-y: hidden means a table can never
   capture the wheel.
   clip-path hides the scroller's first pixel column: at a fractional scroll offset (313.6 is
   normal at 125% scaling) Chrome snaps the pinned column and the scrolled layer differently, and
   scrolled header text showed through in a 1px sliver beside the pinned column. */
.scroller { overflow-x: auto; overflow-y: hidden; position: relative; clip-path: inset(0 0 0 1px); }
/* The sideways scrollbar of a report table, kept on screen (app.js stickyScrollbar): it sticks to
   the bottom of the window while the table runs below it, and settles under the table after.
   The table's own scrollbar is hidden so there are never two. */
.hbar { position: sticky; bottom: 0; z-index: 6; overflow-x: auto; overflow-y: hidden;
        background: var(--surface); border-top: 1px solid var(--line-soft); }
.hbar[hidden] { display: none; }
.hbar-inner { height: 1px; }
.scroller.has-hbar { scrollbar-width: none; }
.scroller.has-hbar::-webkit-scrollbar { display: none; }
.scroller.free { max-height: none; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
th, td { padding: 10px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line-soft); }
thead th {
  position: sticky; top: 0; z-index: 10;
  background: var(--surface); color: var(--ink-faint);
  font: 500 12px/1.3 var(--sans); border-bottom: 1px solid var(--line);
}
/* .num/.pct set the CELL font; a header keeps the header's, or right-aligned headings came out
   larger and lighter than their neighbours */
thead th.num, thead th.pct { font: 500 12px/1.3 var(--sans); color: var(--ink-faint); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
.num, .pct { text-align: right; font: 400 13px/1.45 var(--sans); font-variant-numeric: tabular-nums; }
.pct { color: var(--ink-soft); }
.subject { white-space: normal; min-width: 22ch; max-width: 46ch; }
.wrap { white-space: normal; min-width: 18ch; max-width: 54ch; }

tbody th[scope="row"] { font-weight: 400; color: var(--ink); text-align: left; white-space: normal; }
.pinned th:first-child, .pinned td:first-child {
  position: sticky; left: 0; z-index: 5; background: var(--surface);
  border-right: 1px solid var(--line-soft); min-width: 15rem; white-space: normal; font-weight: 500;
}
.pinned thead th:first-child { z-index: 15; }
.pinned tbody tr:hover td:first-child, .pinned tbody tr:hover th:first-child { background: var(--surface-2); }

/* workflow blocks: a quiet band with an accent edge, not an inverted slab */
.block-head th, .block-head td,
.pinned tbody tr.block-head th:first-child, .pinned tbody tr.block-head td:first-child {
  background: var(--surface-2); color: var(--ink); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line-soft);
  font: 600 12.5px/1.35 var(--sans); white-space: normal; text-align: left;
}
.block-head th:first-child { box-shadow: inset 3px 0 0 var(--axis); }
.block-head td.bh-period { font: 500 11px/1.35 var(--sans); color: var(--ink-faint); text-align: right; white-space: nowrap; }
.block-head.is-combined th, .block-head.is-combined td,
.pinned tbody tr.block-head.is-combined th:first-child,
.pinned tbody tr.block-head.is-combined td:first-child { background: var(--accent-soft); color: var(--ink); }
.block-head.is-combined th:first-child { box-shadow: inset 3px 0 0 var(--accent); }
/* the pinned first cell must be opaque: the tint alone is see-through, and the period labels
   scrolling underneath showed through it ("ALL WORKFLOWS COMBINEDSun 13 Sep") */
.pinned tbody tr.block-head.is-combined th:first-child,
.pinned tbody tr.block-head.is-combined td:first-child {
  background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface);
}
/* workflows the workbook does not track: their own section below the combined total */
.block-head.is-section th, .block-head.is-section td,
.pinned tbody tr.block-head.is-section th:first-child {
  background: var(--surface); border-top: 2px solid var(--line); padding-top: 18px;
  font: 600 11.5px/1.35 var(--sans); letter-spacing: .04em; color: var(--ink-soft);
}
.block-head.is-section th:first-child { box-shadow: none; }
.block-head.is-untracked th:first-child { box-shadow: inset 3px 0 0 var(--mark); }
.row-formula th:first-child, .row-formula td:first-child { color: var(--ink-soft); font-weight: 400; }
.row-summary td { background: var(--surface-2); font-weight: 500; }
.pinned tbody tr.row-summary td:first-child { background: var(--surface-2); }

/* where each column came from */
tr.row-source th, tr.row-source td {
  font-size: 11.5px; color: var(--ink-faint); background: var(--surface); white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
tr.row-source td { text-align: right; }
/* filled = read live · hollow grey = the workbook · hollow blue = both · half = live, but only
   from the first reading (a floor) */
.src { display: inline-flex; align-items: center; gap: 5px; }
.src::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--series-1); background: var(--series-1); flex: none; }
.src.sheet::before { background: transparent; border-color: var(--ink-faint); }
.src.mixed::before { background: transparent; }
.src.partial::before { background: linear-gradient(90deg, var(--series-1) 50%, transparent 50%); }

/* ------------------------------------------------- THE TYPOGRAPHY OF ABSENCE
   Three states a generic dashboard collapses into one: a measured zero, no reading, and
   not-tracked. They differ in TEXT, not only in colour. */
.cell-zero    { color: var(--ink-soft); }
.cell-unknown { color: var(--ink-faint); cursor: help; }
.cell-norate  { color: var(--ink-faint); cursor: help; }
.cell-na { background-image: repeating-linear-gradient(-45deg, transparent 0 4px, var(--hatch) 4px 5px); }
.cell-na-mark { color: var(--ink-faint); font-style: normal; font-size: 11.5px; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; padding: 12px 18px; border-top: 1px solid var(--line-soft); }
.legend span { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-faint); }
.legend i { width: 20px; height: 15px; border: 1px solid var(--line); border-radius: 4px; display: inline-block;
            font: 400 11px/13px var(--sans); text-align: center; font-style: normal; color: var(--ink-faint); }
.legend i.cell-na { background-image: repeating-linear-gradient(-45deg, transparent 0 4px, var(--hatch) 4px 5px); }
.is-partial { position: relative; }
.is-partial::after { content: "+"; color: var(--ink-faint); font-weight: 600; margin-left: 1px; }

/* ---------------------------------------------------------------- client list */
.client-row { cursor: pointer; }
.client-row td { padding-top: 13px; padding-bottom: 13px; }
.client-name { font-weight: 600; color: var(--ink); }
.client-crm { display: block; font-size: 12px; color: var(--ink-faint); margin-top: 2px; font-weight: 400; }
.tag { display: inline-block; font: 500 11.5px/1 var(--sans); padding: 5px 9px; border-radius: 999px; color: var(--ink-soft); background: var(--surface-3); }
.coverage { font: 400 13px/1 var(--sans); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.coverage-na { font: 400 12px/1 var(--sans); color: var(--ink-faint); }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-soft); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
.status.warn::before { background: var(--warn); }
.status.bad::before { background: var(--bad); }
.status.idle::before { background: var(--ink-faint); }
.status-detail { display: block; font-size: 12px; color: var(--ink-faint); margin: 3px 0 0 15px; white-space: normal; max-width: 44ch; }
/* Coverage is metadata: a full meter is the NORMAL state and stays quiet (slate, not the series
   blue — 90 blue cells out-shouted every figure on the page). Only the exceptions differ: an
   outline for n/a, a faint blue for "filling in". */
.meter { display: inline-flex; gap: 3px; vertical-align: middle; margin-right: 8px; }
.meter i { width: 6px; height: 14px; border-radius: 2px; background: var(--mark); display: block; }
.meter i.na { background: transparent; box-shadow: inset 0 0 0 1px var(--axis); }
.meter i.pending { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.muted { color: var(--ink-faint); }

/* ---------------------------------------------------------------- report picker */
.picker-group { margin: 0 0 28px; }
.picker-group-title { font: 600 13px/1.2 var(--sans); color: var(--ink-soft); margin: 0 0 12px; }
/* three columns = daily / weekly / monthly, so each group reads across and the grains line up
   down the page (auto-fill left an empty fourth track at desktop widths) */
.picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .picker { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pick {
  display: flex; flex-direction: column; width: 100%; text-align: left; cursor: pointer; min-height: 132px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; color: inherit; font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.pick:hover:not(:disabled) { border-color: var(--accent-line); box-shadow: 0 4px 16px rgba(0, 0, 0, .10); transform: translateY(-1px); }
.pick:disabled { cursor: not-allowed; background: var(--surface-2); box-shadow: none; }
.pick:disabled .pick-name { color: var(--ink-faint); }
.pick-kind { font: 500 12px/1 var(--sans); color: var(--ink-faint); display: block; margin-bottom: 6px; }
.pick-name { font: 600 16px/1.25 var(--sans); display: block; color: var(--ink); }
.pick-value { font: 500 13px/1.35 var(--sans); color: var(--ink-soft); display: block; margin-top: 6px; }
.pick-note { font: 400 12px/1.4 var(--sans); color: var(--ink-faint); display: block; margin-top: auto; padding-top: 10px; }
.pick .spark { margin-top: 12px; width: 100%; height: auto; }
.pick.pick-na { border-style: dashed; }

/* ---------------------------------------------------------------- misc */
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.controls label { font: 400 12px/1 var(--sans); color: var(--ink-faint); }
.controls select {
  font: 500 12.5px/1 var(--sans); padding: 7px 10px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.tb-btn {
  font: 500 12.5px/1 var(--sans); cursor: pointer; padding: 7px 12px;
  background: var(--surface); color: var(--ink-soft); border: 1px solid var(--line); border-radius: 8px;
}
.tb-btn:hover { color: var(--ink); background: var(--surface-2); }
.toolbar { display: none; }                  /* export moved into the panel header */

.note { padding: 14px 18px; font-size: 13px; line-height: 1.6; color: var(--ink-soft); background: var(--surface-2); border-top: 1px solid var(--line-soft); }
.note .note-lead { margin: 0 0 8px; }
.note strong { color: var(--ink); font-weight: 600; }
.empty { padding: 44px 18px; text-align: center; color: var(--ink-faint); font-size: 14px; }

.pagefoot { max-width: 1440px; margin: 0 auto; padding: 0 24px 40px; }
.pagefoot p { font-size: 12.5px; color: var(--ink-faint); margin: 0; max-width: 78ch; line-height: 1.6; }

/* ---------------------------------------------------------------- ESP tracker */
.espwrap { padding: 18px 18px 6px; }
.espbar { display: flex; width: 100%; height: 12px; border-radius: 6px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.espseg { display: block; height: 100%; min-width: 2px; }
.swatchcell { width: 1px; padding-right: 0; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; }

/* ------------------------------------------------- period header, as the workbook shows it */
th.hd { vertical-align: bottom; padding-top: 9px; padding-bottom: 9px; }
.hd-label { display: block; font: 600 12.5px/1.25 var(--sans); color: var(--ink); }
.hd-range { display: block; font: 400 11px/1.3 var(--sans); color: var(--ink-faint); margin-top: 2px; }
.hd-key   { display: none; }                 /* the machine key stays in the export and the tooltip */

/* ---------------------------------------------------------------- alerts */
.alerts { display: flex; flex-direction: column; }
.alert { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); border-left: 3px solid transparent; }
.alert:last-child { border-bottom: 0; }
.alert.sev-critical { border-left-color: var(--bad); }
.alert.sev-warning  { border-left-color: var(--warn); }
.alert.sev-ok       { border-left-color: var(--good); }
.alert-top { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.alert-kind { font: 500 11.5px/1 var(--sans); color: var(--ink-faint); }
.alert-title { margin: 0 0 4px; font: 600 14px/1.35 var(--sans); }
.alert-detail { margin: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.55; max-width: 92ch; }
.alert-action { margin: 7px 0 0; font-size: 12.5px; color: var(--ink-soft); max-width: 92ch; line-height: 1.55; }
.alert-action-label { font: 600 12px/1 var(--sans); color: var(--ink); margin-right: 5px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 560px) { .asof { display: none; } }
@media (max-width: 640px) {
  .masthead-in { height: 52px; padding: 0 16px; }
  .wordmark-app, .wordmark-sep { display: none; }
  main, .crumbs, .pagefoot { padding-left: 16px; padding-right: 16px; }
  .view-title { font-size: 22px; }
  .pinned th:first-child, .pinned td:first-child { min-width: 11rem; }
  .picker { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .seg { max-width: 100%; flex-wrap: wrap; }   /* wraps: a scrolled switch hid "Sending volume" behind a scrollbar */
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------- print / PDF
   The screen view is a dense grid; the PDF is a REPORT built into #print, the only thing on paper. */
#print { display: none; }
@media print {
  @page { size: A4; margin: 15mm 14mm; }
  body { background: #fff; color: #000; font: 400 10pt/1.45 var(--sans); }
  body.printing > *:not(#print) { display: none !important; }
  #print { display: block; }
  .pr-kicker { font: 600 7.5pt/1 var(--cond); letter-spacing: .18em; text-transform: uppercase; color: #555; margin: 0 0 5pt; }
  .pr-title { font: 600 18pt/1.2 var(--sans); margin: 0 0 10pt; letter-spacing: -.01em; }
  .pr-head { border-bottom: 1.5pt solid #000; padding-bottom: 8pt; margin-bottom: 12pt; }
  .pr-meta { display: grid; grid-template-columns: max-content 1fr; gap: 2pt 12pt; margin: 0; font-size: 9pt; }
  .pr-meta dt { font-weight: 600; color: #444; }
  .pr-meta dd { margin: 0; }
  .pr-h2 { font: 600 8pt/1 var(--cond); letter-spacing: .16em; text-transform: uppercase; margin: 14pt 0 6pt; padding-bottom: 3pt; border-bottom: .5pt solid #bbb; }
  .pr-facts { list-style: none; margin: 0; padding: 0; }
  .pr-facts li { display: grid; grid-template-columns: 16em max-content 1fr; gap: 10pt; padding: 3.5pt 0; border-bottom: .25pt solid #e2e2e2; font-size: 9.5pt; }
  .pr-fact-k { color: #333; }
  .pr-fact-v { font: 500 9.5pt/1.3 var(--mono); text-align: right; }
  .pr-fact-n { color: #666; font-size: 8.5pt; }
  .pr-table { width: 100%; border-collapse: collapse; font-size: 8pt; margin-top: 3pt; }
  .pr-table th { text-align: left; font: 600 7pt/1.3 var(--cond); letter-spacing: .08em; text-transform: uppercase; border-bottom: .75pt solid #000; padding: 3pt 4pt; }
  .pr-table td { padding: 2.5pt 4pt; border-bottom: .25pt solid #e6e6e6; }
  .pr-num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
  .pr-table thead { display: table-header-group; }
  .pr-table tr { break-inside: avoid; }
  .pr-foot { margin-top: 12pt; padding-top: 7pt; border-top: .5pt solid #bbb; font-size: 8pt; color: #555; line-height: 1.5; }
}

/* Visually hidden but read aloud. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
