/* ===========================================================================
 * hud.css — the ONE canonical top navigation, shared by every page.
 * Linked in each page's <head> (before first paint → no reflow/jank) and
 * written with .top-nav-scoped selectors so it overrides any page's own nav
 * CSS regardless of load order. Change the HUD here, once, for all pages.
 * Relies on the per-page CSS variables (--surface, --border, --accent, …).
 *
 * Layout: row 1 = logo + lang/theme/logout (always one line); row 2 = ALL nav
 * links, full width, wrapping onto 2 (or more, on very narrow screens) lines
 * instead of hiding items behind an overflow menu or a horizontal scrollbar.
 * ========================================================================= */

/* The scrollbar must never decide the layout: without a stable gutter a
   short page (no scrollbar) centres ~10px to the right of a long one, and
   the whole nav appears to shift as you switch tabs. */
html{ scrollbar-gutter:stable; }

.top-nav{
  position:sticky; top:0; z-index:100;
  background:var(--surface); border-bottom:1px solid var(--border);
  /* Decoupled from each page's own body font — some pages load the Inter
     webfont, some don't, which used to render the exact same nav in two
     different typefaces (and a 1px height difference) depending on page.
     The nav always requests Inter (falls back the same way everywhere). */
  font-family:'Inter',system-ui,-apple-system,sans-serif;
}
.top-nav .nav-inner{
  /* same content width as .main (see the Paper block) — nav and page edges
     stay aligned, and nothing shifts when switching tabs */
  max-width:1480px; margin:0 auto; padding:10px 22px;
  display:flex; flex-wrap:wrap; align-items:center; row-gap:8px; gap:18px;
  min-height:58px;
  justify-content:flex-start;            /* override any space-between */
}
.top-nav .logo{
  font-size:16px; font-weight:800; color:var(--accent);
  text-decoration:none; letter-spacing:-.2px; white-space:nowrap; flex-shrink:0;
}
.top-nav .nav-right{
  /* flex-basis 0 (not auto): with basis:auto the nav-inner line-break is
     decided against this block's MAX-content (the full link row), so past a
     threshold the whole control row — zen button included — dropped below
     the logo. Basis 0 never trips that check: logo + controls share row 1
     at every width, links wrap inside as usual. */
  margin-left:auto; flex:1 1 0; min-width:0;
  display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end;
  gap:10px; row-gap:8px;
}
/* nav-links takes a row of its own (row 2) whenever it doesn't fit next to
   the lang/theme/logout controls on row 1 */
.top-nav .nav-links{
  order:2; flex:1 1 100%; min-width:0;
  display:flex; flex-wrap:wrap; justify-content:flex-start; gap:5px 6px;
}
.top-nav .nav-links a{
  padding:7px 11px; border-radius:8px;
  font-size:13px; font-weight:600; line-height:1;
  color:var(--text-muted); text-decoration:none; white-space:nowrap;
  transition:background .15s, color .15s;
}
.top-nav .nav-links a:hover{ background:var(--surface-2); color:var(--text); }
.top-nav .nav-links a.active{ background:var(--accent); color:#fff; }

/* lang switch (stays on row 1, next to theme/logout) */
.top-nav .lang-switch{
  order:1; display:inline-flex; border:1px solid var(--border); border-radius:8px;
  overflow:hidden; height:38px; flex-shrink:0;
}
.top-nav .lang-switch button{
  font-family:inherit; font-size:12.5px; font-weight:700; letter-spacing:.03em;
  padding:0 12px; border:none; background:transparent; color:var(--text-muted);
  cursor:pointer; transition:all .15s;
}
.top-nav .lang-switch button:hover{ color:var(--text); }
.top-nav .lang-switch button.active{ background:var(--accent); color:#fff; }

/* theme toggle */
.top-nav .theme-toggle{
  order:1; width:38px; height:38px; flex-shrink:0; border-radius:8px;
  background:var(--surface-2); border:1px solid var(--border);
  cursor:pointer; color:var(--text-muted);
  display:flex; align-items:center; justify-content:center; padding:0;
}
.top-nav .theme-toggle svg{ width:18px; height:18px; }
:root:not([data-theme="light"]) .top-nav .icon-sun{ display:none; }
:root[data-theme="light"]      .top-nav .icon-moon{ display:none; }

/* logout + "logged in as" — filled by i18n.js from the brevo-me cache */
.top-nav .logout-btn{
  order:1; display:inline-flex; align-items:center; gap:7px; height:38px; padding:0 11px;
  flex-shrink:0; border:1px solid var(--border); border-radius:8px;
  background:var(--surface-2); color:var(--text-muted);
  text-decoration:none; font-size:12.5px; font-weight:600; transition:all .15s;
}
.top-nav .logout-btn:hover{ color:var(--red,#a3392b); border-color:var(--red,#a3392b); }
.top-nav .logout-btn svg{ width:17px; height:17px; }
/* reserve room so filling the username never shifts the siblings (no jank) */
.top-nav .nav-user{
  display:inline-block; min-width:70px; text-align:right;
  font-weight:700; color:var(--text); white-space:nowrap;
}

@media (max-width:760px){
  .top-nav .nav-inner{ gap:8px; padding:8px 12px; }
  .top-nav .nav-links a{ padding:6px 9px; font-size:12.5px; }
  .top-nav .nav-user{ display:none; }
}

/* ===========================================================================
 * Editorial type system — the one thing kept from the design round.
 * Serif for headings, monospaced tabular figures for every number, letter-
 * spaced mono for micro-labels. Applied HERE so all seven pages inherit it
 * from one file: no page structure, layout or colour is touched, only type.
 * ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,500;8..60,600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* Headings speak in the serif — page titles, section heads, card titles. */
.page-intro h1,
.section-header h2,
.card-head > span:first-child,
.ca-card-title,
.wkd-head h2,
h1.page-title{
  font-family:'Source Serif 4',Georgia,serif;
  font-weight:600;
  letter-spacing:-.01em;
}

/* Every number is monospaced and tabular, so columns line up digit-for-digit
   and a figure never reflows as it updates. */
.kpi .v, .ca-big, .mono, .ln, .wp-count,
td.mono, .num, .kpi-v,
table tbody td:not(.kw):not(.ex-subj):not(.ca-subj){
  font-variant-numeric:tabular-nums;
}
/* Mono family for the cells that actually hold figures. Pages mark these
   either with .mono or by right-aligning them inline; Word Performance's
   table does neither, so its non-label columns are named directly. */
.kpi .v, .ca-big, .mono, td.mono, .num, .kpi-v,
table tbody td[style*="text-align:right"],
#wp-table tbody td:not(.kw){
  font-family:'IBM Plex Mono',ui-monospace,Menlo,monospace;
  letter-spacing:-.02em;
}

/* Column headers and small caps-y labels: mono, letterspaced, quiet. */
table thead th,
.kpi .l,
.rng-label,
.ca-card-sub,
.ledger-sub{
  font-family:'IBM Plex Mono',ui-monospace,Menlo,monospace;
  letter-spacing:.06em;
  text-transform:uppercase;
  font-size:10.5px;
}

/* ===========================================================================
 * The Paper — project-wide editorial skin (from the "Readership File" design
 * round). hud.css is linked AFTER each page's own <style>, so at equal
 * specificity these :root blocks win: ONE palette here recolours every page
 * through the shared variable contract; no page's own CSS is touched.
 * Light = paper & ink (the identity, default). Dark = the navy answer desk.
 * Return point: tag `design-v2` (git reset --hard design-v2 undoes the skin).
 * ========================================================================= */
:root{
  --bg:#0b0f1c; --surface:#111726; --surface-2:#1a2133; --surface-hi:#242e46;
  --border:rgba(240,234,220,.14); --border-2:rgba(240,234,220,.26);
  --text:#f0eadc; --text-muted:#8b93a7; --text-dim:#5b6378;
  --accent:#f97316; --accent-2:#fb923c; --accent-soft:rgba(249,115,22,.15);
  --success:#4fbf8a; --info:#5b8def; --amber:#c9a24b; --red:#e2604f; --green:#4fbf8a;
  --gold:#c9a24b; --rule:rgba(240,234,220,.14); --up:#4fbf8a; --down:#e2604f;
  /* Gold has two jobs and they need two values. --gold marks charts (a
     diamond on a median does not have to be readable as text); --gold-ink
     carries TYPE, so it is darkened until it clears WCAG AA on every
     surface. Measured: --gold is 3.15:1 on paper — pretty and illegible;
     --gold-ink is 4.56:1 on paper, 4.96 on card, 9.7+ on the dark desk. */
  --gold-ink:#dcbb72;
  --ch-quiet:rgba(240,234,220,.28);   /* chart volume wash (chart-theme.js) */
  /* legacy aliases (base-evolution predates the contract) */
  --surface2:var(--surface-2); --muted:var(--text-muted);
}
/* :root[...] (not bare [data-theme]) — admin.html scopes its light palette at
   that specificity, and this block must out-cascade every page's own. */
:root[data-theme="light"]{
  --bg:#f8f3ea; --surface:#fffdf9; --surface-2:#f1e8d8; --surface-hi:#eadfc8;
  --border:rgba(23,19,13,.14); --border-2:rgba(23,19,13,.28);
  --text:#17130d; --text-muted:#7d7261; --text-dim:#a89a86;
  --accent:#c94f0e; --accent-2:#e25a04; --accent-soft:rgba(201,79,14,.12);
  --success:#0f6b44; --info:#44618f; --amber:#b0812f; --red:#a3392b; --green:#0f6b44;
  --gold:#b0812f; --rule:rgba(23,19,13,.14); --up:#0f6b44; --down:#a3392b;
  --gold-ink:#8f6820;
  --ch-quiet:rgba(23,19,13,.28);      /* chart volume wash (chart-theme.js) */
  --surface2:var(--surface-2); --muted:var(--text-muted);
}

/* One content width on EVERY page (pages used to range 1100–1600px, so the
   layout jumped between tabs). hud.css loads after each page's own CSS, so
   this single rule standardises them all; arrivals fade in gently. */
.main{ max-width:1480px; }
@keyframes pageIn{ from{ opacity:.35; } to{ opacity:1; } }
@media (prefers-reduced-motion: no-preference){
  .main{ animation:pageIn .18s ease-out; }
}

/* Paper is flat: EVERY page's chrome speaks one radius language — cards and
   wells sit on hairline borders (no shadows, no bulky corners), chips and
   buttons square off. Knobs (slider handles, round help buttons) stay round.
   The class list is the full radius inventory across the pages. */
.card, .kpi, .kpi-card, .dcard,
.src-card, .wkd-card, .ucard, .tbl-card, .blueprint, .lead-card, .chk-card,
.filter-stack, .filter-summary, .help-popover, .note-box, .callout,
.w-table-wrap, .leg-item, .run-item, .wkd-skip-list, .wkd-result,
.ca-reengage, .run-applied{ border-radius:3px; box-shadow:none; }
.chip, .badge, .term-badge, .term, .uc-role, .pill, .src,
.preset-btn, .tab-btn, .ex-sort, .chk-badge, .seg-label-tag,
.wkd-btn, .seg-input, .seg-apply, .ca-search,
.metrics button, .login-btn{ border-radius:3px; }
.tab-switch{ border-radius:4px; }
.top-nav .nav-links a,
.top-nav .lang-switch,
.top-nav .theme-toggle,
.top-nav .logout-btn{ border-radius:4px; }

/* ===========================================================================
 * Zen mode — the HUD and page filters step aside and the content ZOOMS to
 * fill the screen (presentation scale): i18n.js sets an inline `zoom` on
 * .main = viewport ÷ composed width, floor 1×, cap 1.5×. The layout keeps
 * its max-width so the composition never re-flows — it just gets bigger.
 * State lives on <html data-zen>; pages mark filter panels `data-zen-hide`.
 * ========================================================================= */
:root[data-zen] .top-nav{ display:none; }
:root[data-zen] [data-zen-hide]{ display:none !important; }
.zen-btn{
  order:1; width:38px; height:38px; flex-shrink:0; border-radius:4px;
  background:var(--surface-2); border:1px solid var(--border);
  cursor:pointer; color:var(--text-muted);
  display:flex; align-items:center; justify-content:center; padding:0;
}
.zen-btn svg{ width:17px; height:17px; }
.zen-exit{
  position:fixed; right:18px; bottom:18px; z-index:300;
  display:none; align-items:center; gap:8px; height:36px; padding:0 13px;
  border-radius:4px; border:1px solid var(--border); background:var(--surface);
  color:var(--text-muted); cursor:pointer;
  font:600 12px 'IBM Plex Mono',ui-monospace,Menlo,monospace; letter-spacing:.08em;
}
.zen-exit svg{ width:15px; height:15px; }
.zen-exit:hover{ color:var(--text); border-color:var(--accent); }
:root[data-zen] .zen-exit{ display:flex; }

/* ===========================================================================
 * Filter panel — ONE pattern for every page with real filters: sticky under
 * the nav, collapsible, and when collapsed it states what is still applied
 * instead of hiding it. Ported here from user-analytics (the version he
 * approved) so other pages stop inventing their own filter card.
 *
 * `top` follows --nav-h, which i18n.js measures from the live nav: the
 * original 60px was written when the nav was one row — it is ~94px now, so
 * the panel used to slide underneath it.
 * ========================================================================= */
.filter-stack{
  display:flex; flex-direction:column; gap:14px; margin-bottom:24px;
  background:var(--surface); border:1px solid var(--border);
  padding:14px 20px;
  position:sticky; top:var(--nav-h,94px); z-index:90;
}
.filter-collapse{
  position:absolute; top:10px; right:12px;
  width:30px; height:30px; border-radius:3px; background:var(--surface-2);
  border:1px solid var(--border); color:var(--text-muted);
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  font:700 16px/1 inherit; transition:all .15s; z-index:2;
}
.filter-collapse:hover{ background:var(--accent); color:#fff; border-color:var(--accent); }
.filter-stack.collapsed{ padding:10px 18px; gap:0; }
.filter-stack.collapsed > .filter-row,
.filter-stack.collapsed > .filter-head,
.filter-stack.collapsed > .date-slider-block{ display:none; }
.filter-stack.collapsed > .filter-summary{ display:flex; }
.filter-summary{
  display:none; align-items:center; gap:16px; flex-wrap:wrap;
  font-size:13.5px; color:var(--text-muted); padding:4px 40px 4px 0;
}
.filter-summary strong{ color:var(--accent); font-weight:700; }
.filter-summary .pill{
  background:var(--surface-2); border:1px solid var(--border);
  padding:3px 10px; border-radius:3px; font-size:12.5px; color:var(--text);
}
.filter-row{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.filter-label{
  font-family:'IBM Plex Mono',ui-monospace,Menlo,monospace;
  font-size:12px; letter-spacing:.08em; text-transform:uppercase;
  color:var(--text-dim); white-space:nowrap; min-width:118px;
}
/* a row whose controls sit side by side rather than label-then-control:
   two sliders and the toggle that belongs WITH the second one */
.filter-row.col3{
  display:grid; grid-template-columns:1fr 1fr minmax(200px,240px);
  gap:26px; align-items:start;
}
.filter-row.col3 > *{ min-width:0; }
@media (max-width:900px){ .filter-row.col3{ grid-template-columns:1fr; } }
.filter-head{
  font-family:'IBM Plex Mono',ui-monospace,Menlo,monospace;
  font-size:12px; letter-spacing:.12em; text-transform:uppercase;
  color:var(--text-muted);
}

/* ===========================================================================
 * Type scale +2 — everything was tuned about two pixels too small to read
 * comfortably. Applied HERE so one file moves the whole app: reading text
 * gains ~2px, the letterspaced micro-labels and mono column heads gain ~1.5
 * (at 11px a full 2px changes their character, not just their size), and the
 * serif display numbers scale with them so the hierarchy holds.
 * Wide tables live in .tbl-wrap{overflow-x:auto}, so nothing clips.
 * ========================================================================= */
/* reading text */
body{ font-size:16px; }
.top-nav .nav-links a{ font-size:14.5px; }
.top-nav .lang-switch button,
.top-nav .logout-btn{ font-size:13.5px; }
table tbody td{ font-size:15px; }
/* .section-header p is 0-2-0 on user-analytics, so name it at equal weight */
.page-intro p, .section-sub, .section-header p{ font-size:15.5px; }
.lrow .k{ font-size:15px; }
.lrow .v, .wrow .word{ font-size:15px; }
.wrow .rate{ font-size:14.5px; }
.wrow .lift, .retire-row .rw, .retire-row .rv{ font-size:14.5px; }
.quiet a{ font-size:15px; }
.quiet a .hint{ font-size:13.5px; }
.chip{ font-size:14.5px; }
.tab-btn{ font-size:15.5px; }
.preset-btn{ font-size:13.5px; }
.kpi-sub{ font-size:14.5px; }
.note, .method, .asof{ font-size:13px; }
.dcard-go{ font-size:13.5px; }

/* ===========================================================================
 * Audit "?" — the calculation, next to the number it explains (audit-tip.js).
 * The marker is quiet by design: an accountant should find it, nobody else
 * should trip over it. It sits in the flow so it never covers a digit.
 * ========================================================================= */
.atip-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:17px; height:17px; margin-left:7px; padding:0; vertical-align:middle;
  border:1px solid var(--border); border-radius:50%;   /* a knob stays round */
  background:transparent; color:var(--text-dim); cursor:help;
  font:600 10.5px/1 'IBM Plex Mono',ui-monospace,Menlo,monospace;
  transition:all .15s; flex:none; position:relative; top:-1px;
}
.atip-btn:hover{ border-color:var(--gold-ink); color:var(--gold-ink); }
.atip{
  position:fixed; z-index:400; max-width:420px;
  background:var(--surface); border:1px solid var(--border-2);
  padding:14px 16px 12px; box-shadow:0 10px 34px rgba(0,0,0,.28);
  /* never let it run off a short window — it scrolls itself instead */
  max-height:min(72vh,560px); overflow-y:auto; overscroll-behavior:contain;
}
[data-theme="light"] .atip{ box-shadow:0 10px 30px rgba(74,55,30,.16); }
.atip-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.atip-kicker{
  font-family:'IBM Plex Mono',ui-monospace,Menlo,monospace; font-size:10.5px;
  letter-spacing:.16em; text-transform:uppercase; color:var(--gold-ink); font-weight:600;
}
.atip-x{
  background:none; border:none; color:var(--text-dim); cursor:pointer;
  font-size:18px; line-height:1; padding:0 2px;
}
.atip-x:hover{ color:var(--text); }
.atip-name{
  font-family:'Source Serif 4',Georgia,serif; font-size:17px; font-weight:600;
  margin-bottom:8px; letter-spacing:-.01em;
}
.atip-formula{
  font-family:'IBM Plex Mono',ui-monospace,Menlo,monospace; font-size:12px;
  line-height:1.55; background:var(--surface-2); border-left:2px solid var(--gold-ink);
  padding:8px 11px; margin-bottom:8px; white-space:pre-wrap; word-break:break-word;
}
.atip-formula .fn{ color:var(--accent); font-weight:600; }
.atip-formula .ref{ color:var(--info); text-decoration:underline dotted; }
.atip-eq{
  font-family:'IBM Plex Mono',ui-monospace,Menlo,monospace; font-size:13.5px;
  background:var(--accent-soft); border:1px solid var(--border);
  padding:7px 11px; display:inline-block; margin-bottom:8px;
  font-variant-numeric:tabular-nums;
}
.atip-eq b{ color:var(--accent); font-size:15px; }
/* a worked example is NOT the figure on the page — say so before the numbers */
.atip-eq.ex{ background:transparent; border-style:dashed; }
.atip-eq .exl{
  font-family:'Inter',system-ui,sans-serif; font-size:9.5px; letter-spacing:.1em;
  text-transform:uppercase; color:var(--gold-ink); margin-right:7px;
}
.atip-ops{ margin-bottom:8px; }
.atip-op{
  display:flex; justify-content:space-between; align-items:baseline; gap:14px;
  padding:5px 0; border-bottom:1px dotted var(--rule); font-size:13px;
  color:var(--text-muted);
}
.atip-op:last-child{ border-bottom:none; }
.atip-op b{
  color:var(--text); font-family:'IBM Plex Mono',ui-monospace,Menlo,monospace;
  font-variant-numeric:tabular-nums; white-space:nowrap;
}
.atip-refs{
  font-family:'IBM Plex Mono',ui-monospace,Menlo,monospace; font-size:11px;
  color:var(--text-dim); line-height:1.7; margin-bottom:8px; word-break:break-word;
}
/* Source columns are LINKS into the EON explorer — a reader who wants the rows
   behind a number should not have to go looking for the table by hand. */
.atip-refs .rl{
  display:block; font-family:'Inter',system-ui,sans-serif; font-size:9.5px;
  letter-spacing:.1em; text-transform:uppercase; color:var(--gold-ink);
  margin-bottom:3px;
}
.atip-refs .ref-link{ color:var(--text-muted); text-decoration:none;
  border-bottom:1px dotted var(--border-2); }
.atip-refs .ref-link b{ color:var(--text); font-weight:600; }
.atip-refs .ref-link:hover{ color:var(--accent); border-bottom-color:var(--accent); }
.atip-refs .ref-link:hover b{ color:var(--accent); }
.atip-refs .sep{ padding:0 5px; color:var(--text-dim); }
.atip-foot{ display:flex; flex-wrap:wrap; gap:6px 18px; }
.atip-notes{ margin:0 0 8px; padding-left:16px; }
.atip-notes li{ font-size:12.5px; color:var(--text-muted); line-height:1.55; margin-bottom:3px; }
.atip-more{ font-size:12px; font-weight:600; color:var(--accent); text-decoration:none; }
.atip-more:hover{ text-decoration:underline; }

/* ===========================================================================
 * Gold in the type — with a rule, so it stays meaning and not decoration:
 *
 *   GOLD  = structure and reference. The eyebrow above a title, the label
 *           that names a group of numbers, the ordinal in a ranking, the
 *           unit on a display figure, a median mark. Things that orient you.
 *   ORANGE = live and active. The current value, the selected tab, the rate
 *           being reported, a link you can follow.
 *
 * Gold used to sit on the kickers' place as orange, which meant the loudest
 * colour was spent on a caption. Freeing orange for values is the point.
 * Deliberately NOT gilded: table column heads and every micro-label — gold
 * on all of them flattens the hierarchy back into noise.
 * ========================================================================= */
.page-kicker,
.strip-group-label,
.filter-head,
.wrow .rank,
.big .unit,
.retire-row .rl{ color:var(--gold-ink); }

/* labels & column heads: +1.5, they are letterspaced and set in mono */
.microlabel{ font-size:12.5px; }
table thead th, .kpi .l, .rng-label, .ca-card-sub, .ledger-sub{ font-size:12px; }
.kpi-label, .kpi-section-label{ font-size:13px; }
.whead{ font-size:11.5px; }
.mini-kpis .ml, .retire-row .rl, .sg-cat{ font-size:12px; }
.page-kicker{ font-size:13px; }
.spark-x, .wrow .rank{ font-size:11.5px; }

/* display numbers keep the hierarchy */
.big{ font-size:38px; }
.big .unit{ font-size:25px; }
.dcard-title{ font-size:21px; }
.word-quote{ font-size:33px; }
.kpi .v{ font-size:26px; }
.kpi-value{ font-size:38px; }
.section-header h2{ font-size:24px; }
.page-intro h1{ font-size:38px; }

/* ===========================================================================
 * Editorial KPI styles — the Overview's font language applied to every
 * dashboard's headline numbers. Two component styles:
 *   strip — .kpi-row .kpi: transparent cells divided by hairlines between
 *           top/bottom rules (the Overview stat strip look);
 *   card  — .kpi-card keeps its box (it carries help buttons and subtexts)
 *           but the value speaks serif, the label letterspaced mono.
 * (Placed after the type-system block on purpose: display numbers are
 *  serif; the mono there stays for table/ledger figures.)
 * ========================================================================= */
.kpi .v, .kpi-v, .kpi-value, .ca-big{
  font-family:'Source Serif 4',Georgia,serif;
  font-weight:600; letter-spacing:-.01em; font-variant-numeric:tabular-nums;
}
.kpi-label, .kpi-section-label{
  font-family:'IBM Plex Mono',ui-monospace,Menlo,monospace;
  letter-spacing:.08em; text-transform:uppercase; font-weight:500;
}
/* strip variant — .kpi-row pages AND user-analytics' .kpi-strip cards: the
   same transparent-cells-between-hairlines look as the Overview stat strip. */
.kpi-row{ gap:0; border-top:1px solid var(--rule); border-bottom:1px solid var(--rule); }
.kpi-row .kpi{
  background:transparent; border:none; border-radius:0; box-shadow:none;
  border-left:1px solid var(--rule); padding:16px 20px;
}
.kpi-row .kpi:first-child{ border-left:none; padding-left:0; }
.kpi-strip{ gap:0; border-top:1px solid var(--rule); border-bottom:1px solid var(--rule); }
.kpi-strip .kpi-card{
  background:transparent; border:none; border-radius:0; box-shadow:none;
  border-left:1px solid var(--rule); padding:18px 22px;
}
.kpi-strip .kpi-card:first-child{ border-left:none; padding-left:0; }
.kpi-strip .kpi-card:hover{ border-left-color:var(--rule); }

/* A strip standing on the page and a strip inside a card are not the same
   object, and the difference is the two hairlines. Alone it needs them: they
   are what separates the numbers from the text above and below. Inside a
   card the head already draws the line above and the card border the one
   below, so the strip's own rules land exactly on top of both — a doubled
   line at the top, and at the bottom a line that IS the card's edge, leaving
   the labels sitting on it with no air beneath. A two-line label makes it
   obvious; a one-line label only hides it.

   The inset matters as much. .card is padding:0, so an unadjusted strip runs
   edge to edge while every other card body on the page starts 18px in. (The
   heading text sits further right still, at 37px — its collapse caret pushes
   it — so 18px is the body line to match, not the heading's.) */
.card > .kpi-row{ margin:0; padding:2px 18px 8px; }

/* Each of the two rules is dropped only where something else already draws
   that exact line — never both by default. The head's divider sits directly
   above, so a strip following it never needs its own top rule. The card's
   border closes the bottom, so a strip that ends the card never needs its
   own bottom rule. But a strip with a section under it does: on two cards
   here the next thing is a bare .mini-title with no border of its own, and
   removing the rule there would run the numbers straight into the section
   below instead of tidying anything. */
.card > .card-head + .kpi-row{ border-top:none; }
.card > .kpi-row:last-child{ border-bottom:none; }

/* ── Segment builder ─────────────────────────────────────────────────────
   Four multi-selects that read as one question. Chips carry their size so a
   pick is never blind: "Producer 371" tells you what you are about to select
   before the cohort loads. */
.sg-picks{ display:grid; grid-template-columns:repeat(2,1fr); gap:18px 26px; padding:2px 0 4px; }
@media(max-width:860px){ .sg-picks{ grid-template-columns:1fr; } }
.sg-pick-h{ display:flex; justify-content:space-between; align-items:baseline;
  font-size:11px; letter-spacing:.1em; text-transform:uppercase;
  color:var(--gold-ink); font-weight:600; margin-bottom:7px; }
.sg-clear{ background:none; border:none; cursor:pointer; font-family:inherit;
  font-size:11px; color:var(--text-dim); text-transform:none; letter-spacing:0; }
.sg-clear:hover{ color:var(--accent); }
.sg-search{ width:100%; margin-bottom:7px; padding:6px 9px; font-family:inherit;
  font-size:12.5px; background:var(--surface-2); color:var(--text);
  border:1px solid var(--border); border-radius:3px; }
.chip-row.wrap{ display:flex; flex-wrap:wrap; gap:6px; }
.chip-row.scroll{ max-height:172px; overflow-y:auto; overscroll-behavior:contain;
  padding-right:4px; }
.chip .chip-n{ opacity:.55; font-variant-numeric:tabular-nums; margin-left:4px; }
.sg-actions{ display:flex; gap:10px; justify-content:flex-end;
  margin-top:14px; padding-top:12px; border-top:1px solid var(--rule); }
.sg-btn{ font-family:inherit; font-size:13px; font-weight:600; cursor:pointer;
  padding:8px 16px; border-radius:3px; border:1px solid var(--accent);
  background:var(--accent); color:#fff; }
.sg-btn.ghost{ background:transparent; color:var(--text-muted); border-color:var(--border); }
.sg-btn:hover{ filter:brightness(1.08); }
.sg-btn.ghost:hover{ color:var(--text); border-color:var(--text-dim); }
#sg-auto-body tr, #sg-saved-body tr{ cursor:pointer; }
#sg-auto-body tr:hover, #sg-saved-body tr:hover{ background:var(--surface-2); }
.sg-x{ background:none; border:none; cursor:pointer; color:var(--text-dim);
  font-size:16px; line-height:1; padding:0 4px; }
.sg-x:hover{ color:var(--down); }
/* Pinned = carried on the Overview page. Filled star when it is, hollow when
   it is not, so the state reads without a legend. */
.sg-pin{ background:none; border:none; cursor:pointer; color:var(--text-dim);
  font-size:15px; line-height:1; padding:0 4px; }
.sg-pin:hover{ color:var(--accent); }
.sg-pin.on{ color:var(--accent); }
.sg-link{ cursor:pointer; border-bottom:1px dotted var(--border-2); }
.sg-link:hover{ color:var(--accent); }
.sg-subj{ max-width:420px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.note.warn{ border-left:2px solid var(--gold-ink); padding-left:10px; }

/* Detail that supports a headline but is not the headline. Folded by default:
   the number above answers the question, this answers "how do you know". */
.sc-detail{ margin:0 18px 14px; }
.sc-detail > summary{ cursor:pointer; font-size:12px; color:var(--text-muted);
  padding:6px 0; list-style:none; }
.sc-detail > summary::-webkit-details-marker{ display:none; }
.sc-detail > summary::before{ content:'▸ '; color:var(--text-dim); }
.sc-detail[open] > summary::before{ content:'▾ '; }
.sc-detail > summary:hover{ color:var(--accent); }

/* Foldable variant of the filter panel. The legacy .filter-stack.collapsed
   hides its own head and swaps in a summary; this one keeps the head visible
   BECAUSE the head is the toggle — hiding it left no way back open. */
.filter-stack.foldable > .filter-head{
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  width:100%; background:none; border:none; cursor:pointer;
  font-family:inherit; text-align:left; padding:0;
}
.filter-stack.foldable.collapsed > .filter-head{ display:flex; }
.filter-stack.foldable.collapsed > .filter-body{ display:none; }
.filter-stack.foldable .filter-head-l{ display:flex; align-items:baseline; gap:12px;
  font-size:11px; letter-spacing:.1em; text-transform:uppercase;
  color:var(--gold-ink); font-weight:600; }
.filter-stack.foldable .filter-head .filter-summary{
  display:flex; text-transform:none; letter-spacing:0; font-size:12.5px;
  color:var(--text-muted); font-weight:400; padding:0; }
/* The fold control was a bare ▾ in the dimmest grey on the page — the only
   affordance on that bar, and the easiest thing on it to miss. Framed, it
   reads as a button; the whole head lights it up so the target is the bar. */
.filter-stack.foldable .filter-caret{
  display:inline-flex; align-items:center; justify-content:center;
  flex:0 0 auto; width:26px; height:26px; font-size:13px; line-height:1;
  border:1px solid var(--border-2); border-radius:3px;
  background:var(--surface-2); color:var(--gold-ink);
  transition:transform .15s, background .15s, border-color .15s, color .15s; }
.filter-stack.foldable > .filter-head:hover .filter-caret{
  background:var(--accent); border-color:var(--accent); color:var(--bg); }
.filter-stack.foldable.collapsed .filter-caret{ transform:rotate(-90deg); }
.filter-stack.foldable .filter-body{ margin-top:14px; }

/* Period control — one length, two start dates. */
.sg-period{ display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px;
  margin:14px 0 18px; padding:12px 16px; background:var(--surface);
  border:1px solid var(--border); border-radius:3px; }
.sg-period-l{ font-size:11px; letter-spacing:.1em; text-transform:uppercase;
  color:var(--gold-ink); font-weight:600; }
.sg-period-u{ font-size:12.5px; color:var(--text-muted); }
.sg-date{ display:flex; align-items:center; gap:7px; font-size:12.5px; color:var(--text-muted); }
.sg-date input{ font-family:inherit; font-size:12.5px; padding:5px 8px;
  background:var(--surface-2); color:var(--text);
  border:1px solid var(--border); border-radius:3px; }
.sg-period-note{ font-family:'IBM Plex Mono',ui-monospace,monospace;
  font-size:11px; color:var(--text-dim); margin-left:auto; }
/* windowed columns read as a second block, not more of the same */
td.sg-win{ background:var(--surface-2); }
tr.sg-was td{ color:var(--text-dim); }
tr.sg-delta td{ border-top:1px solid var(--rule-strong); font-weight:600; }

/* One person, read like a one-person segment. */
.pp-id{ display:flex; gap:18px; flex-wrap:wrap; align-items:center;
  margin-bottom:14px; padding:12px 16px; background:var(--surface-2);
  border:1px solid var(--border); border-radius:3px; }
.pp-name{ font-family:'Source Serif 4',Georgia,serif; font-size:18px; font-weight:600; }
.pp-meta{ font-size:12px; color:var(--text-muted); margin-top:2px; }
.pp-state{ margin-left:auto; font-size:11px; letter-spacing:.09em;
  text-transform:uppercase; font-weight:700; }
.pp-state.ok{ color:var(--up); } .pp-state.bad{ color:var(--down); }
.kpi-strip.kpi-strip-4{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
@media(max-width:860px){ .kpi-strip.kpi-strip-4{ grid-template-columns:repeat(2,1fr); } }

/* Tabs — the message stays visible, the detail waits behind a click. */
.tabs{ display:flex; flex-wrap:wrap; gap:2px; border-bottom:1px solid var(--rule);
  margin:0 0 2px; padding:0 4px; }
.tabs .tab{ font-family:inherit; font-size:12.5px; font-weight:600; cursor:pointer;
  padding:10px 14px; background:none; border:none; border-bottom:2px solid transparent;
  color:var(--text-muted); }
.tabs .tab:hover{ color:var(--text); }
.tabs .tab.active{ color:var(--accent); border-bottom-color:var(--accent); }
.pane[hidden]{ display:none; }

/* A person's months: the frame is what we sent, the fill is what they opened. */
.pp-grid{ display:grid; grid-template-columns:1.1fr .9fr; gap:14px; margin-bottom:14px; }
@media(max-width:900px){ .pp-grid{ grid-template-columns:1fr; } }
.pp-tl{ padding:14px 16px 10px; }
.pp-bars{ display:flex; align-items:flex-end; gap:3px; height:96px; }
.pp-bar{ flex:1; display:flex; align-items:flex-end; min-width:4px; }
.pp-bar-frame{ width:100%; background:var(--surface-2);
  border:1px solid var(--border); display:flex; align-items:flex-end; }
.pp-bar-fill{ width:100%; background:var(--accent); }
.pp-bars-x{ display:flex; justify-content:space-between; margin-top:6px;
  font-family:'IBM Plex Mono',ui-monospace,monospace; font-size:10px; color:var(--text-dim); }
.pp-dot{ width:26px; text-align:center; font-size:14px; }
.pp-dot.c{ color:var(--accent); } .pp-dot.o{ color:var(--up); } .pp-dot.m{ color:var(--text-dim); }
.kpi-vs{ font-size:11px; margin-top:4px; color:var(--text-dim); }

/* Grouped table head: the era label sits over its own block of columns, so a
   column never has to be guessed from its position. */
table thead tr.grp th{ font-size:10px; letter-spacing:.08em; padding-bottom:2px;
  border-bottom:1px solid var(--rule); color:var(--gold-ink); text-align:center; }
table thead tr.grp th.sg-win{ background:var(--surface-2); }
table thead th{ font-size:11px; }
table thead th.sg-win{ background:var(--surface-2); }

/* Latest issue, per edition. Two audiences of very different size never share
   an axis; they get a block each. */
.ed + .ed{ margin-top:16px; padding-top:14px; border-top:1px solid var(--rule); }
.ed-head{ display:flex; justify-content:space-between; align-items:baseline; margin-bottom:6px; }
.ed-name{ font-size:11px; letter-spacing:.11em; text-transform:uppercase;
  color:var(--gold-ink); font-weight:600; }
.ed-date{ font-family:'IBM Plex Mono',ui-monospace,monospace; font-size:11px; color:var(--text-dim); }
.ed-vs{ font-size:11px; color:var(--text-dim); margin-top:6px; }

/* Column headers were 10.5px — small enough that the reader had to lean in to
   find out what a number was. The group row names the era, the row under it
   names the measure, and both are legible. */
table thead tr.grp th{ font-size:11.5px; padding:8px 14px 3px; }
table thead th{ font-size:11.5px; text-transform:none; letter-spacing:.02em; }
/* A window header carries its own comparison. The ▲▼ in those columns are
   measured against the equally-long window immediately before, and the reader
   should read that off the header, not hunt for a footnote under the table. */
table thead tr.grp th .grp-vs{ display:block; margin-top:2px; font-size:10.5px;
  font-weight:400; letter-spacing:.02em; color:var(--text-dim); }
table thead th .atip-btn{ vertical-align:middle; }

/* ── The shared filter bar (static/filterbar.js) ─────────────────────────────
   Overview and Exits had no filter control at all, so their figures were
   whole-archive while the page next door showed ninety days. This is the same
   bar in both, styled off the same tokens as the Users one so moving between
   pages does not feel like moving between apps. */
.eonbar{ background:var(--surface); border:1px solid var(--border); border-radius:12px;
  padding:14px 18px; margin-bottom:20px; display:flex; flex-direction:column; gap:11px; }
.eonbar-row{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.eonbar-label{ font-size:10.5px; font-weight:800; letter-spacing:.11em; text-transform:uppercase;
  color:var(--text-dim); min-width:92px; }
.eonbar-chips{ display:flex; gap:6px; flex-wrap:wrap; }
.eonbar .preset-btn{ padding:5px 13px; border-radius:14px; background:var(--surface-2);
  border:1px solid var(--border); color:var(--text-muted); font-size:12px; cursor:pointer;
  font-family:inherit; font-weight:500; transition:all .12s; }
.eonbar .preset-btn:hover{ border-color:var(--accent); color:var(--accent); }
.eonbar .preset-btn.active{ background:var(--accent); border-color:var(--accent); color:#fff; }
.eonbar .chip{ padding:5px 13px; border-radius:14px; background:var(--surface-2);
  border:1px solid var(--border); color:var(--text-muted); font-size:12px; cursor:pointer;
  font-family:inherit; font-weight:500; transition:all .12s; }
.eonbar .chip:hover{ border-color:var(--accent); color:var(--accent); }
.eonbar .chip.active{ background:var(--accent); border-color:var(--accent); color:#fff; }
.eonbar-dates{ display:flex; align-items:center; gap:7px; margin-left:auto; }
.eonbar-dates input[type=date]{ font-family:inherit; font-size:12.5px; padding:5px 9px;
  border-radius:8px; border:1px solid var(--border); background:var(--surface-2); color:var(--text); }
.eonbar-arrow{ color:var(--text-dim); font-size:12px; }
@media(max-width:820px){ .eonbar-dates{ margin-left:0; } .eonbar-label{ min-width:0; } }

/* ---------------------------------------------------------------------------
 * Brevo mirror — the one nav link that leaves our own numbers behind.
 *
 * It sits last and wears Brevo's green rather than our orange, because the
 * page it opens carries BREVO's figures under BREVO's definitions. Anything
 * that looks like the rest of the menu invites the reader to compare a figure
 * there against a figure here, and the two were never measuring the same
 * thing.
 *
 * The green is per-theme, and not for taste. Brevo's own #0b996e measures
 * 3.28:1 on our paper background — under the 4.5 these 13px links need — while
 * scoring 5.27:1 on the navy. So the light theme takes a darkened green
 * (5.23:1) and the dark theme a lifted one (6.86:1). One value could not have
 * cleared both, and the failing side would have been the one we look at most.
 * ------------------------------------------------------------------------- */
.top-nav .nav-links a.nav-brevo{
  --brevo: #12b07f;                        /* on the navy desk */
  color: var(--brevo);
  border: 1px solid color-mix(in srgb, var(--brevo) 34%, transparent);
  display: inline-flex; align-items: center; gap: 7px;
}
[data-theme="light"] .top-nav .nav-links a.nav-brevo{
  --brevo: #097453;                        /* on the paper */
}
.top-nav .nav-links a.nav-brevo::before{
  content: ""; width: 7px; height: 7px; border-radius: 2px;
  background: var(--brevo); flex: none;
}
.top-nav .nav-links a.nav-brevo:hover{
  background: color-mix(in srgb, var(--brevo) 12%, transparent);
  color: var(--brevo); border-color: var(--brevo);
}
.top-nav .nav-links a.nav-brevo.active{
  background: var(--brevo); color: #fff; border-color: var(--brevo);
}
.top-nav .nav-links a.nav-brevo.active::before{ background: #fff; }
