/* =====================================================================================================
   Site hub · styles. Consumes tokens.css (the brand's tokens, copied verbatim) and adds only hub roles:
   0 fonts · 1 hub roles (chart series, ordinal ramp, status) · 2 base · 3 shell (sidebar / phone top bar)
   · 4 page header & grid · 5 components · 6 charts · 7 login · 8 phone.
   Motion: transform/opacity only; reduced motion respected through the token durations.
   ===================================================================================================== */

/* ---------- 0 · fonts (self-hosted, latin subset; metric-matched fallbacks from the site) ---------------- */
@font-face {
  font-family: 'Archivo';
  src: url('/assets/fonts/archivo-wght-latin.woff2?v=8f704806db') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('/assets/fonts/newsreader-italic-400-latin.woff2?v=2bf0dbb1a4') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Archivo Fallback';
  src: local('Arial'), local('ArialMT'), local('Helvetica Neue'), local('Helvetica');
  size-adjust: 100.8%; ascent-override: 87.1%; descent-override: 20.8%; line-gap-override: 0%;
}
@font-face {
  font-family: 'Archivo Heavy Fallback';
  src: local('Arial Bold'), local('Arial-BoldMT'), local('Helvetica Neue Bold'), local('Helvetica Bold');
  font-weight: 700 900; size-adjust: 104%; ascent-override: 84.4%; descent-override: 20.2%; line-gap-override: 0%;
}
@font-face {
  font-family: 'Newsreader Fallback';
  src: local('Times New Roman Italic'), local('TimesNewRomanPS-ItalicMT'), local('Times Italic');
  font-style: italic; size-adjust: 103.1%; ascent-override: 71.3%; descent-override: 25.7%; line-gap-override: 0%;
}

/* ---------- 1 · hub roles ----------------------------------------------------------------------------
   Categorical (identity), validated with the dataviz validator against the card surface in both themes:
   light #FEFCF9 — adjacent CVD ΔE ≥ 8.2, normal ≥ 22.9; dark #262231 — CVD ≥ 8.4, normal ≥ 18.2, all ≥ 3:1.
   k4/k5 sit under 3:1 on light → every chart ships a legend + table view (the relief rule).
   Ordinal (funnel, map grid): one violet ramp, monotone, light end ≥ 2:1 on the surface (validated --ordinal). */
:root {
  --surface: var(--bg-raised);
  --k1: light-dark(#7534D3, #8D5AE8);   /* violet-600 / violet-500 — the site */
  --k2: light-dark(#DD5CA5, #DD5CA5);   /* pink-500 — comparison / previous period */
  --k3: light-dark(#2A78D6, #3987E5);
  --k4: light-dark(#EDA100, #C98500);
  --k5: light-dark(#1BAF7A, #199E70);
  --kOther: light-dark(var(--neutral-300), var(--neutral-600));
  --o1: light-dark(#AA88F7, #7534D3);
  --o2: light-dark(#8D5AE8, #8D5AE8);
  --o3: light-dark(#7534D3, #AA88F7);
  --o4: light-dark(#5E1EAE, #C8B5FF);
  --o5: light-dark(#48138A, #DED3FF);
  --on-o-strong: light-dark(#FFFFFF, var(--ink));   /* label on o3–o5 */
  --on-o-weak: light-dark(var(--ink), #FFFFFF);     /* label on o1 */
  --gridline: light-dark(var(--neutral-100), var(--neutral-850));
  --axisline: light-dark(var(--neutral-200), var(--neutral-700));
  /* status: fixed marks, always with an icon + a word; text stays in text tokens */
  --st-good: #0CA30C;
  --st-warn: #FAB219;
  --st-bad: #D03B3B;
  --good-fg: light-dark(#006300, #0CA30C);  /* delta text: 7.4:1 · 4.6:1 on the card */
  --bad-fg: light-dark(#D03B3B, #E66767);   /* 4.7:1 · 4.8:1 on the card */
  --wash: color-mix(in oklab, var(--fg) 4%, transparent);
  --wash-2: color-mix(in oklab, var(--fg) 7%, transparent);
  --side-w: 248px;
  --pad: clamp(1rem, .4rem + 2.2vw, 2.5rem);
}
/* the site swaps the serif for a subset phone cut below 1024px; the hub ships the full face everywhere */
@media (max-width: 1023.98px) {
  :root { --font-serif: 'Newsreader', 'Newsreader Fallback', Georgia, 'Times New Roman', serif; }
}

/* ---------- 2 · base ------------------------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--fg);
  font: var(--w-body) .9375rem / 1.55 var(--font-sans);
  font-synthesis: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg { display: block; }
code { font: .8125rem/1.3 var(--font-mono); padding: .1em .4em; border-radius: var(--r-xs); background: var(--wash-2); color: var(--fg); overflow-wrap: anywhere; }
::selection { background: var(--selection); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 300; padding: 10px 14px; border-radius: var(--r-sm); background: var(--bg-inverse); color: var(--fg-inverse); }
.skip:focus { top: 12px; }
.eyebrow { font: var(--w-strong) .75rem/1.2 var(--font-sans); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--fg-accent); }
em.acc { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 1.06em; letter-spacing: -.012em; }
.muted { color: var(--fg-muted); }
.link { color: var(--fg-accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.i { width: 20px; height: 20px; flex: none; }
.i--sm { width: 16px; height: 16px; }
.i--xs { width: 14px; height: 14px; }

/* the brand symbol: colours follow the theme */
.sym-ln { fill: none; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.sym-ink { stroke: var(--logo-ink); }
.sym-brand { stroke: var(--logo-brand); }
.sym-band { fill: var(--logo-brand); }
.sym-smoke { stroke: var(--logo-ink); opacity: var(--logo-smoke); }

/* ---------- 3 · shell ----------------------------------------------------------------------------------- */
.shell { min-height: 100dvh; }
.top { display: none; }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: var(--z-nav);
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 12px 12px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg-sunken);
  box-shadow: inset -1px 0 0 var(--line);
}
.main { margin-left: var(--side-w); padding: 28px var(--pad) 64px; max-width: calc(var(--side-w) + 84rem); }
.main:focus { outline: none; }

.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; border-radius: var(--r-sm); }
.brand__sym { width: 34px; height: 34px; flex: none; }
.brand__txt { display: grid; line-height: 1.15; }
.brand__name { font: var(--w-heading) 1rem/1.15 var(--font-sans-heavy); letter-spacing: var(--track-tight); }
.brand__by { font-size: .75rem; color: var(--fg-muted); }

.nav { display: flex; flex-direction: column; flex: 1; }
.nav__group { padding: 12px 10px 6px; font: var(--w-strong) .6875rem/1 var(--font-sans); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--fg-muted); }
.nav__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav__list--end { margin-top: auto; padding-top: 12px; }
.nav__a {
  position: relative; display: flex; align-items: center; gap: 10px;
  min-height: 36px; padding: 0 10px; border-radius: 10px;
  font: var(--w-ui) .875rem/1 var(--font-sans); color: var(--fg-muted);
  transition: background-color var(--d-micro) var(--e-out), color var(--d-micro) var(--e-out);
}
.nav__a:hover { background: var(--wash); color: var(--fg); }
.nav__i { width: 18px; height: 18px; }
.nav__a[aria-current="page"] {
  color: var(--fg); background: var(--bg-raised);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
}
.nav__a[aria-current="page"] .nav__i { color: var(--brand); }
.nav__a[aria-current="page"]::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand);
}

.me { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 6px 4px; border-top: 1px solid var(--line); }
.me__av {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: var(--r-full);
  background: var(--grad-brand); color: var(--on-brand); font: var(--w-strong) .75rem/1 var(--font-sans);
}
.me__who { display: grid; min-width: 0; flex: 1; line-height: 1.2; }
.me__name { font: var(--w-ui) .8125rem/1.2 var(--font-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me__role { font-size: .75rem; color: var(--fg-muted); }
.me__out { display: contents; }
.iconbtn {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none; padding: 0; border: 0;
  border-radius: var(--r-full); background: transparent; color: var(--fg-muted); cursor: pointer;
  transition: background-color var(--d-micro) var(--e-out), color var(--d-micro) var(--e-out);
}
.iconbtn:hover { background: var(--wash-2); color: var(--fg); }
.iconbtn[hidden] { display: none; }
.iconbtn .i { width: 18px; height: 18px; }
/* theme toggle shows the theme you would switch to */
.i--sun { display: none; }
:root[data-theme="dark"] .i--sun { display: block; }
:root[data-theme="dark"] .i--moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i--sun { display: block; }
  :root:not([data-theme="light"]) .i--moon { display: none; }
}

/* ---------- 4 · page header & grid ------------------------------------------------------------------- */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.pagehead__txt { display: grid; gap: 8px; max-width: 46rem; }
.pagehead__h {
  font: var(--w-heading) clamp(1.75rem, 1.1rem + 1.5vw, 2.5rem)/1.08 var(--font-sans-heavy);
  letter-spacing: var(--track-heading); text-wrap: balance;
}
.pagehead__lede { font-size: 1rem; line-height: 1.5; color: var(--fg-muted); text-wrap: pretty; }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; } .span-12 { grid-column: 1 / -1; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(164px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tiles--3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---------- 5 · components --------------------------------------------------------------------------- */
.card {
  min-width: 0; padding: 18px 20px 20px; border-radius: var(--r-md);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
}
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card__title { font: var(--w-strong) 1rem/1.3 var(--font-sans); letter-spacing: -.008em; }
.card__meta { margin-top: 2px; font-size: .8125rem; color: var(--fg-muted); }
.card__actions { display: flex; gap: 8px; flex: none; }

/* empty states: calm, plain words; never shaped like a chart */
.empty {
  display: flex; align-items: flex-start; gap: 14px;
  min-height: 7.5rem; padding: 18px; border-radius: var(--r-sm);
  background: var(--wash);
}
.empty__icon {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: var(--r-full);
  background: var(--brand-soft); color: var(--brand);
}
.empty__icon .i { width: 18px; height: 18px; }
.empty__text { display: grid; gap: 4px; min-width: 0; align-content: start; }
.empty__title { font: var(--w-strong) .9375rem/1.3 var(--font-sans); }
.empty__body { color: var(--fg-muted); text-wrap: pretty; }
.empty__needs { margin-top: 4px; font-size: .8125rem; line-height: 1.8; color: var(--fg-muted); }
.empty__needs code { margin-right: 2px; }
.empty--compact { min-height: 0; padding: 10px 12px; gap: 10px; }
.empty--compact .empty__icon { width: 28px; height: 28px; }

/* stat tile: the number is the chart */
.stat {
  display: grid; align-content: start; gap: 6px; min-width: 0; padding: 16px 18px; border-radius: var(--r-md);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
}
.stat__label { font: var(--w-ui) .8125rem/1.3 var(--font-sans); color: var(--fg-muted); }
.stat__row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 10px; min-width: 0; }
.stat__row .spark { width: min(112px, 100%); height: auto; }
.stat__value { font: 680 2rem/1.05 var(--font-sans); letter-spacing: -.02em; }
.stat__delta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; font: var(--w-ui) .8125rem/1.25 var(--font-sans); }
.delta--good { color: var(--good-fg); }
.delta--bad { color: var(--bad-fg); }
.delta--flat { color: var(--fg-muted); }
.delta__l { margin-left: 2px; font-weight: var(--w-body); color: var(--fg-muted); white-space: nowrap; }
.stat__help { font-size: .75rem; color: var(--fg-muted); }
.stat__none { display: flex; align-items: center; gap: 6px; padding: 6px 0 2px; font: var(--w-ui) .9375rem/1.2 var(--font-sans); color: var(--fg-muted); }
.stat__none .i { color: var(--brand); }

/* tables: hairline rows, numbers aligned in tabular figures */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: .875rem; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tbl thead th { padding-top: 0; font: var(--w-strong) .75rem/1.2 var(--font-sans); letter-spacing: .02em; color: var(--fg-muted); white-space: nowrap; }
.tbl tbody th { font-weight: var(--w-ui); }
.tbl tbody tr:last-child > * { border-bottom: 0; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl--dense th, .tbl--dense td { padding-block: 6px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px 0 7px;
  border-radius: var(--r-full); background: var(--wash-2);
  font: var(--w-ui) .75rem/1 var(--font-sans); color: var(--fg); white-space: nowrap;
}
.badge--good .i { color: var(--st-good); }
.badge--warn .i { color: light-dark(#B57A00, var(--st-warn)); }
.badge--bad .i { color: var(--st-bad); }
.badge--muted { color: var(--fg-muted); }
.badge--muted .i, .badge--neutral .i { color: var(--fg-muted); }
.badge--brand .i { color: var(--brand); }

/* buttons: the site's idiom (pill, brand gradient + grain on primary, quiet ghost) */
.btn {
  --btn-h: 48px; --btn-px: 22px;
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--btn-h); padding: 0 var(--btn-px); border: 0; border-radius: var(--r-button);
  font: var(--w-ui) .9375rem/1 var(--font-sans); letter-spacing: -.004em; white-space: nowrap;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform var(--d-micro) var(--e-out);
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn--sm { --btn-h: 36px; --btn-px: 14px; font-size: .8125rem; }
.btn--wide { width: 100%; }
.btn--primary { color: var(--on-brand); background: var(--grad-brand); box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), inset 0 -1px 0 rgb(0 0 0 / .22), var(--shadow-2); }
.btn--primary::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--grad-brand-hover); opacity: 0; transition: opacity var(--d-ui) var(--e-out); }
.btn--primary::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: url('/assets/grain.png?v=7130bd66b1') 0 0 / 128px 128px repeat; mix-blend-mode: soft-light; opacity: .55; pointer-events: none; }
.btn--primary:hover::before { opacity: 1; }
.btn--ghost { color: var(--fg); background: var(--wash); box-shadow: inset 0 0 0 1px var(--line); }
.btn--ghost:hover { background: var(--wash-2); }

/* form controls */
.stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field__label { font: var(--w-ui) .875rem/1.2 var(--font-sans); }
.field__input {
  width: 100%; min-height: 48px; padding: 0 14px; border: 0; border-radius: var(--r-sm);
  background: var(--bg-raised); color: var(--fg); font: inherit; font-size: 1rem;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: box-shadow var(--d-micro) var(--e-out);
}
.field__input:hover { box-shadow: inset 0 0 0 1px var(--fg-muted); }
.field__input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.field__help { font-size: .8125rem; color: var(--fg-muted); }

/* segmented period picker (links) */
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: inline-flex; flex: none; padding: 3px; gap: 2px; border-radius: var(--r-full); background: var(--wash-2); }
.seg__item { display: grid; white-space: nowrap; place-items: center; min-height: 32px; padding: 0 12px; border-radius: var(--r-full); font: var(--w-ui) .8125rem/1 var(--font-sans); color: var(--fg-muted); }
.seg__item[aria-current="true"] { background: var(--bg-raised); color: var(--fg); box-shadow: var(--shadow-1); }

/* ---------- 6 · charts (dataviz method: thin marks, hairline grid, text in text tokens) --------------- */
.chart { display: grid; gap: 10px; min-width: 0; }
.chart__cap { font: var(--w-strong) .9375rem/1.3 var(--font-sans); }
.chart__plot { position: relative; padding-inline: 6px; }
.chart--line .chart__plot, .chart--bars-v .chart__plot { padding-left: 40px; }
.chart__svg { display: block; width: 100%; overflow: visible; font-family: var(--font-sans); }
.chart__svg--grid { max-width: 26rem; height: auto; margin-inline: auto; }
.gridline { stroke: var(--gridline); stroke-width: 1; shape-rendering: crispEdges; }
.axis { stroke: var(--axisline); stroke-width: 1; shape-rendering: crispEdges; }
.tick { font-size: 11.5px; fill: var(--fg-muted); font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.lbl { font-size: 13.5px; fill: var(--fg); }
.val { font-size: 13.5px; font-weight: 600; fill: var(--fg); font-variant-numeric: tabular-nums; }
.ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.area { opacity: .1; stroke: none; }
.dot { stroke: var(--surface); stroke-width: 2; }
.ln.k1 { stroke: var(--k1); } .ln.k2 { stroke: var(--k2); } .ln.k3 { stroke: var(--k3); } .ln.k4 { stroke: var(--k4); } .ln.k5 { stroke: var(--k5); }
.fl.k1 { fill: var(--k1); } .fl.k2 { fill: var(--k2); } .fl.k3 { fill: var(--k3); } .fl.k4 { fill: var(--k4); } .fl.k5 { fill: var(--k5); } .fl.kOther { fill: var(--kOther); }
.fl.o1 { fill: var(--o1); } .fl.o2 { fill: var(--o2); } .fl.o3 { fill: var(--o3); } .fl.o4 { fill: var(--o4); } .fl.o5 { fill: var(--o5); }
.gap { stroke: var(--surface); stroke-width: 2; }
.hit { fill: transparent; }
.bar-row .hit:hover, .stack-row .hit:hover, .funnel-row .hit:hover, .hit.is-on { fill: var(--wash); }
.chart--line .hit.is-on, .chart--line .hit:hover { fill: transparent; }
.xhair { stroke: var(--fg-subtle); stroke-width: 1; shape-rendering: crispEdges; pointer-events: none; }
.chart__svg text, .dot, .mk { pointer-events: none; }
/* change-log markers: annotation, not data — ink badge, hairline */
.mk__line { stroke: var(--fg-subtle); stroke-width: 1; shape-rendering: crispEdges; }
.mk__dot { fill: var(--fg); stroke: var(--surface); stroke-width: 2; }
.mk__n { font-size: 10.5px; font-weight: 700; fill: var(--surface); text-anchor: middle; }
.markers { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .8125rem; }
.markers li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.markers__n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--r-full); background: var(--fg); color: var(--surface); font: 700 .6875rem/1 var(--font-sans); }
.markers__d { color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.markers__k { padding: 2px 7px; border-radius: var(--r-full); background: var(--wash-2); font-size: .6875rem; color: var(--fg-muted); }
/* legend: line keys for lines, rounded boxes for bars and cells; text in text tokens */
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .8125rem; }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend__val { font-weight: 600; font-variant-numeric: tabular-nums; }
.key { display: inline-block; flex: none; }
.key--line { width: 14px; height: 2px; border-radius: 2px; }
.key--box { width: 10px; height: 10px; border-radius: 3px; }
.key.k1 { background: var(--k1); } .key.k2 { background: var(--k2); } .key.k3 { background: var(--k3); } .key.k4 { background: var(--k4); } .key.k5 { background: var(--k5); } .key.kOther { background: var(--kOther); }
.key.o1 { background: var(--o1); } .key.o2 { background: var(--o2); } .key.o3 { background: var(--o3); } .key.o4 { background: var(--o4); } .key.o5 { background: var(--o5); }
/* map grid cells */
.cell rect { stroke: var(--surface); stroke-width: 2; }
.cell text { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.cell.b3 rect { fill: var(--o5); } .cell.b3 text { fill: var(--on-o-strong); }
.cell.b2 rect { fill: var(--o3); } .cell.b2 text { fill: var(--on-o-strong); }
.cell.b1 rect { fill: var(--o1); } .cell.b1 text { fill: var(--on-o-weak); }
.cell.b0 rect { fill: var(--bg-sunken); stroke: var(--line); stroke-width: 1; } .cell.b0 text { fill: var(--fg-muted); }
.key.sw-b3 { background: var(--o5); } .key.sw-b2 { background: var(--o3); } .key.sw-b1 { background: var(--o1); } .key.sw-b0 { background: var(--bg-sunken); box-shadow: inset 0 0 0 1px var(--line-strong); }
.legend--scale { justify-content: center; }
/* sparkline: history quiet, the latest point in violet */
.spark { flex: none; overflow: visible; }
.spark__ln { fill: none; stroke: var(--fg-subtle); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
/* table view twin */
.chart__table summary { width: max-content; cursor: pointer; font: var(--w-ui) .8125rem/1.6 var(--font-sans); color: var(--fg-accent); }
.chart__table[open] summary { margin-bottom: 8px; }
/* tooltip (hub.js) */
.tip {
  position: absolute; left: 0; top: 0; z-index: 5; min-width: 9rem; max-width: 16rem; padding: 8px 10px;
  border-radius: 10px; background: var(--panel-bg); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-2);
  font-size: .8125rem; line-height: 1.35; pointer-events: none; opacity: 0;
  transition: opacity var(--d-micro) var(--e-out);
}
.tip.is-on { opacity: 1; }
.tip__h { margin-bottom: 4px; color: var(--fg-muted); font-size: .75rem; }
.tip__r { display: flex; align-items: center; gap: 7px; }
.tip__v { font-weight: 650; font-variant-numeric: tabular-nums; }
.tip__n { color: var(--fg-muted); }

/* ---------- 7 · login ------------------------------------------------------------------------------- */
.hub--login { min-height: 100dvh; }
.login { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100dvh; padding: 16px; gap: 16px; }
.login__brand { display: grid; align-content: end; border-radius: var(--r-xl); background: var(--grad-brand); color: var(--on-brand); overflow: hidden; }
.login__brand-in { position: relative; z-index: 3; display: grid; gap: 14px; padding: clamp(28px, 4vw, 56px); }
.sym--on-brand { width: 64px; height: 64px; margin-bottom: 8px; }
.sym--on-brand .sym-ink, .sym--on-brand .sym-smoke { stroke: #FFFFFF; }
.sym--on-brand .sym-brand { stroke: var(--pink-300); }
.sym--on-brand .sym-band { fill: var(--pink-300); }
.login__claim { font: var(--w-heading) clamp(2rem, 1.2rem + 2.6vw, 3.5rem)/1.04 var(--font-sans-heavy); letter-spacing: var(--track-heading); text-wrap: balance; }
.login__sub { max-width: 28rem; font-size: 1.0625rem; line-height: 1.5; color: rgb(255 255 255 / .82); }
.login__form { display: grid; place-items: center; padding: 24px 8px; }
.login__card { width: min(100%, 24rem); display: grid; gap: 10px; }
.login__h { margin-bottom: 14px; font: var(--w-heading) 2rem/1.1 var(--font-sans-heavy); letter-spacing: var(--track-heading); }
.login__err { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-sm); background: color-mix(in oklab, var(--st-bad) 10%, transparent); font-weight: var(--w-ui); }
.login__err .i { color: var(--bad-fg); margin-top: 2px; }
.login__help { margin-top: 10px; font-size: .8125rem; color: var(--fg-muted); }
.has-grain { position: relative; isolation: isolate; }
.has-grain::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: url('/assets/grain.png?v=7130bd66b1') 0 0 / 128px 128px repeat; mix-blend-mode: var(--grain-blend); opacity: var(--grain-opacity); pointer-events: none; z-index: 2; }

/* ---------- 8 · tablet & phone ------------------------------------------------------------------------ */
@media (max-width: 1279.98px) {
  .span-2, .span-3 { grid-column: span 4; }
  .span-4, .span-5, .span-7, .span-8 { grid-column: span 6; }
}
@media (max-width: 1023.98px) {
  .side { display: none; }
  .main { margin-left: 0; padding: 20px 16px 48px; }
  .top {
    position: sticky; top: 0; z-index: var(--z-nav);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    height: var(--topbar-h); padding: 0 8px 0 12px;
    background: var(--frost-bg); -webkit-backdrop-filter: blur(var(--frost-blur)); backdrop-filter: blur(var(--frost-blur));
    box-shadow: inset 0 -1px 0 var(--frost-line);
  }
  .top .brand { padding: 0; }
  .top .brand__sym { width: 30px; height: 30px; }
  .top .brand__by { display: none; }
  .menu > summary { list-style: none; }
  .menu > summary::-webkit-details-marker { display: none; }
  .menu__btn {
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px 0 14px;
    border-radius: var(--r-full); background: var(--wash-2); cursor: pointer;
    font: var(--w-ui) .875rem/1 var(--font-sans); -webkit-tap-highlight-color: transparent;
  }
  .menu__btn .i { width: 18px; height: 18px; }
  .i--close { display: none; }
  .menu[open] .i--close { display: block; }
  .menu[open] .i--open { display: none; }
  .menu__panel {
    position: fixed; left: 8px; right: 8px; top: calc(var(--topbar-h) + 4px);
    max-height: calc(100dvh - var(--topbar-h) - 16px); overflow-y: auto; overscroll-behavior: contain;
    padding: 6px 10px 8px; border-radius: var(--r-lg);
    background: var(--panel-bg); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-3);
  }
  .menu[open] .menu__panel { animation: menu-in var(--d-ui) var(--e-out); }
  .nav--menu .nav__list { grid-template-columns: 1fr 1fr; }
  .nav--menu .nav__a { min-height: 44px; }
  .nav--menu .nav__a[aria-current="page"]::before { display: none; }
  .nav--menu .nav__list--end { padding-top: 6px; }
  .menu__panel .me { margin-top: 8px; }
  .pagehead { flex-direction: column; align-items: flex-start; margin-bottom: 18px; }
  .pagehead__lede { font-size: .9375rem; }
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; padding: 8px; gap: 8px; }
  .login__brand { border-radius: var(--r-lg); }
  .login__brand-in { padding: 24px 22px; gap: 8px; }
  .sym--on-brand { width: 44px; height: 44px; margin-bottom: 4px; }
  .login__sub { font-size: .9375rem; }
  .login__form { place-items: start center; padding: 28px 8px; }
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (max-width: 719.98px) {
  .grid { gap: 12px; }
  .grid > [class*="span-"] { grid-column: 1 / -1; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tiles--3 { grid-template-columns: 1fr; }
  .tiles--odd > :last-child:nth-child(odd) { grid-column: 1 / -1; } /* an odd last tile takes the whole row: no orphan */
  .card { padding: 16px 16px 18px; }
  .stat { padding: 14px; }
  .stat__value { font-size: 1.625rem; }
  .empty { padding: 14px; gap: 12px; min-height: 0; }
  .empty__icon { width: 32px; height: 32px; }
  .stat__none { font-size: .875rem; }
  .tick--alt { display: none; }
  .chart--line .chart__plot, .chart--bars-v .chart__plot { padding-left: 34px; }
  /* tables become stacked rows: no sideways scrolling on a phone */
  .tbl--stack thead { display: none; }
  .tbl--stack, .tbl--stack tbody, .tbl--stack tr { display: block; }
  .tbl--stack tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .tbl--stack tbody tr:last-child { border-bottom: 0; padding-bottom: 0; }
  .tbl--stack tbody tr:first-child { padding-top: 0; }
  .tbl--stack th, .tbl--stack td { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 10px; padding: 3px 0; border: 0; text-align: left; white-space: normal; }
  .tbl--stack tbody th { display: block; padding-bottom: 6px; font-weight: var(--w-strong); }
  .tbl--stack td::before { content: attr(data-label); font-size: .75rem; line-height: 1.9; color: var(--fg-muted); }
  .tbl--stack td > * { justify-self: start; }
  .tbl--stack .num { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .menu[open] .menu__panel { animation: none; }
}

/* ---------- 9 · screens (Task 8): notices, prose, definition lists, forms, change log, board, health -------- */
.notice { display: flex; align-items: center; gap: 8px; margin: -4px 0 16px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--wash); font: var(--w-ui) .875rem/1.35 var(--font-sans); }
.notice--ok .i { color: var(--st-good); }
.notice--warn { box-shadow: inset 3px 0 0 var(--st-warn); }
.notice--warn .i { color: light-dark(#B57A00, var(--st-warn)); }
.notice--bad { box-shadow: inset 3px 0 0 var(--st-bad); }
.notice--bad .i { color: var(--st-bad); }
.secret { display: grid; gap: 6px; margin: -4px 0 16px; padding: 14px 16px; border-radius: var(--r-md); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--line); }
.secret__label { font: var(--w-strong) .875rem/1.3 var(--font-sans); }
.secret__value code { display: inline-block; padding: .35em .6em; font-size: 1rem; background: var(--bg-raised); user-select: all; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; text-wrap: pretty; }
.card__body > .pre { font-size: .9375rem; line-height: 1.55; }
.dl { display: grid; gap: 0; margin-bottom: 4px; }
.dl__row { display: grid; grid-template-columns: minmax(7rem, 32%) minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .875rem; }
.dl__row:last-child { border-bottom: 0; }
.dl dt { color: var(--fg-muted); }
.dl dd { min-width: 0; overflow-wrap: anywhere; }
.card__body > .card__meta { margin: 14px 0 4px; }
.card__body > .card__meta:first-child { margin-top: 0; }
.plain-list { display: grid; gap: 6px; margin: 0; padding-left: 1.2em; font-size: .875rem; }
ol.plain-list { list-style: decimal; }
ul.plain-list { list-style: disc; }
.muted.note, .err-text { display: block; margin-top: 4px; font-size: .75rem; line-height: 1.35; }
.err-text { color: var(--bad-fg); overflow-wrap: anywhere; }
.inline-form { display: inline-flex; margin: 0; }
.filter { margin-bottom: 14px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.filter::-webkit-scrollbar { display: none; }
.pager { justify-content: space-between; margin-top: 12px; }
.field__input--area { min-height: 6rem; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; gap: 10px 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-row .field__help { display: none; }
.checks { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .875rem; line-height: 1.35; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.tiles--inline { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin-bottom: 14px; }
.tiles--inline .stat { box-shadow: inset 0 0 0 1px var(--line); padding: 12px 14px; }
.tiles--inline .stat__value { font-size: 1.5rem; }
.vital { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.who { overflow-wrap: anywhere; }
.decide { display: grid; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.decide__reject { display: grid; gap: 10px; justify-items: start; }
.decide__reject .field { width: 100%; }
.health-light { display: grid; gap: 10px; justify-items: start; }

/* change log */
.changes, .vitals, .board__list { list-style: none; margin: 0; padding: 0; }
.changes { display: grid; gap: 0; }
.changes__item { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.changes__item:first-child { padding-top: 0; }
.changes__item:last-child { border-bottom: 0; padding-bottom: 0; }
.changes__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .8125rem; }
.changes__title { font: var(--w-ui) .9375rem/1.35 var(--font-sans); overflow-wrap: anywhere; }
.changes__detail { font-size: .875rem; color: var(--fg-muted); }
.changes--compact .changes__item { padding: 9px 0; }

/* health: uptime and renewals */
.vitals { display: grid; gap: 10px; }
.vitals__item { display: grid; grid-template-columns: auto minmax(9rem, max-content) minmax(0, 1fr); align-items: center; gap: 6px 14px; font-size: .875rem; }
.vitals__name { font-weight: var(--w-ui); }

/* content board: one column per status, scrolls sideways inside the card on narrow screens */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(158px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
.board__col { display: grid; align-content: start; gap: 10px; min-width: 0; padding: 12px; border-radius: var(--r-sm); background: var(--wash); scroll-snap-align: start; }
.board__h { display: flex; justify-content: space-between; font: var(--w-strong) .8125rem/1.2 var(--font-sans); }
.board__list { display: grid; gap: 10px; }
.board__item { display: grid; gap: 6px; padding: 12px; border-radius: var(--r-sm); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1); }
.board__k { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .75rem; }
.board__k .badge { max-width: 100%; height: auto; min-height: 24px; padding-block: 3px; white-space: normal; line-height: 1.2; }
.board__t { font: var(--w-ui) .875rem/1.35 var(--font-sans); overflow-wrap: anywhere; }
.board__q { font-size: .75rem; line-height: 1.4; }
.board__none { font-size: .8125rem; }

@media (max-width: 719.98px) {
  .vitals__item { grid-template-columns: auto minmax(0, 1fr); }
  .vitals__item .muted { grid-column: 1 / -1; }
  .board { grid-auto-columns: minmax(78%, 1fr); }
  .dl__row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .form-row { grid-template-columns: 1fr; }
  .card__head { flex-wrap: wrap; }
  .card__actions { flex-wrap: wrap; }
}

/* Site tab: page picker above the section charts */
.sec-picker { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0 0 14px; }
.sec-picker .field { flex: 1 1 200px; min-width: 0; }
.sec-picker .btn { flex: none; align-self: flex-end; white-space: nowrap; }

/* My alerts: contact fields, one checkbox grid per site group, test buttons */
.myalerts__contact { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 10px; }
.myalerts__grid th[scope="row"] { font-weight: var(--w-ui); min-width: 140px; }
.myalerts__help { display: block; margin-top: 2px; font-weight: 400; font-size: .8125rem; color: var(--fg-muted); }
.myalerts__ch { text-align: center !important; width: 5.5rem; }
.myalerts__grid thead .myalerts__ch { white-space: normal; }
.myalerts__grid input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--brand); cursor: pointer; }
.myalerts__na { color: var(--fg-muted); }
.myalerts__save { margin: 16px 0 24px; }
.myalerts__chans { display: grid; gap: 14px; }
.myalerts__chan { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.myalerts__chan > div { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }

/* Leads inbox (E09): one row per lead; the quick outcomes open a small panel (no script; one open at a time) */
.inbox { display: grid; list-style: none; margin: 0; padding: 0; }
.inbox__toggle { margin: -4px 0 12px; font-size: .8125rem; }
.lead {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(7.5rem, auto) auto; grid-template-areas: "main state acts";
  align-items: center; gap: 8px 18px; padding: 14px 0; border-bottom: 1px solid var(--line);
}
.lead:first-child { padding-top: 2px; }
.lead:last-child { border-bottom: 0; padding-bottom: 2px; }
.lead__main { grid-area: main; display: grid; gap: 3px; min-width: 0; }
.lead__who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; overflow-wrap: anywhere; }
.lead__name { font: var(--w-strong) .9375rem/1.3 var(--font-sans); }
.lead__co { font-size: .875rem; color: var(--fg-muted); }
.lead__ans { font-size: .8125rem; line-height: 1.4; color: var(--fg); overflow-wrap: anywhere; }
.lead__meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: .8125rem; color: var(--fg-muted); }
.lead__site { font-weight: var(--w-ui); color: var(--fg); }
.lead__state { grid-area: state; display: grid; justify-items: start; gap: 4px; }
.lead__val { font: var(--w-ui) .8125rem/1.2 var(--font-sans); font-variant-numeric: tabular-nums; }
.lead__acts { grid-area: acts; position: relative; display: flex; gap: 6px; justify-content: flex-end; }
.lead__acts > .lead__form { display: flex; }
.lead__pop > summary { list-style: none; }
.lead__pop > summary::-webkit-details-marker { display: none; }
.lead__pop[open] > summary { background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.lead__panel {
  position: absolute; z-index: var(--z-dropdown, 20); top: calc(100% + 6px); right: 0; width: 18.5rem;
  padding: 14px; border-radius: var(--r-md); background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-3);
}
.lead__panel .lead__form { display: grid; gap: 12px; }
.lead__panel .btn { width: 100%; }
@media (max-width: 1023.98px) {
  .lead { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main state" "acts acts"; }
  .lead__acts { justify-content: flex-start; }
}
@media (max-width: 719.98px) {
  .lead { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "state" "acts"; gap: 8px; padding: 16px 0; }
  .lead__state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .lead__acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .lead__acts > .lead__form, .lead__pop, .lead__pop > summary { width: 100%; }
  .lead__acts .btn--sm { --btn-h: 44px; --btn-px: 10px; width: 100%; font-size: .875rem; }
  .lead__panel { left: 0; right: 0; width: auto; }
  .filter--inbox .seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; border-radius: var(--r-md); }
  .filter--inbox .seg__item { min-height: 40px; border-radius: calc(var(--r-md) - 3px); }
}

/* The page behind the lead email's one-click links (no sign-in, no script) */
.hub--act { min-height: 100dvh; }
.act { display: grid; place-items: center; min-height: 100dvh; padding: 24px 16px; }
.act__card {
  display: grid; gap: 14px; width: min(100%, 27rem); padding: 26px 24px 24px; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-2);
}
.act__brand { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font: var(--w-strong) .875rem/1 var(--font-sans); color: var(--fg-muted); }
.act__sym { width: 28px; height: 28px; }
.act__h { font: var(--w-heading) clamp(1.5rem, 1.2rem + 1vw, 1.875rem)/1.12 var(--font-sans-heavy); letter-spacing: var(--track-heading); text-wrap: balance; overflow-wrap: anywhere; }
.act__p { line-height: 1.5; text-wrap: pretty; overflow-wrap: anywhere; }
.act__foot { font-size: .8125rem; line-height: 1.45; color: var(--fg-muted); }
.act__err { padding: 10px 12px; border-radius: var(--r-sm); background: color-mix(in oklab, var(--st-bad) 10%, transparent); font-weight: var(--w-ui); }
.act__set { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.act__set legend { margin-bottom: 8px; }
.act__opt { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.act__opt:has(input:checked) { box-shadow: inset 0 0 0 2px var(--brand); background: var(--brand-soft); }
.act__opt input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--brand); }

/* ---------- E09 · sites: switcher, group tags, Sites overview, Settings → Sites / Features / Connections -------- */
.gtag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; flex: none; border-radius: var(--r-full);
  font: var(--w-strong) .6875rem/1 var(--font-sans); letter-spacing: .01em; white-space: nowrap; vertical-align: middle;
}
.gtag--tmc { background: light-dark(var(--violet-100), var(--violet-900)); color: light-dark(var(--violet-800), var(--violet-200)); }
.gtag--new { background: light-dark(var(--pink-100), var(--pink-900)); color: light-dark(var(--pink-800), var(--pink-200)); }
.gtag--wordpress { background: light-dark(var(--neutral-150), var(--neutral-800)); color: var(--fg); }
.card__title .gtag { margin-left: 6px; }

/* switcher: the current site under the brand; a disclosure with every site (works without JS) */
.switch { position: relative; margin: 0 0 4px; }
.switch > summary { list-style: none; }
.switch > summary::-webkit-details-marker { display: none; }
.switch__btn {
  display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 5px 10px 6px 12px; border-radius: 12px; cursor: pointer;
  background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
  transition: box-shadow var(--d-micro) var(--e-out);
}
.switch__btn:hover { box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-1); }
.switch__txt { display: grid; min-width: 0; flex: 1; line-height: 1.2; }
.switch__k { display: flex; align-items: center; gap: 6px; font: var(--w-strong) .625rem/1.2 var(--font-sans); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--fg-muted); }
.switch__k .gtag { height: 16px; padding: 0 6px; font-size: .625rem; letter-spacing: .02em; text-transform: none; }
/* the switcher takes room in the sidebar: the nav tightens a little so the whole menu still fits a 692px-tall screen */
.side:has(.switch) { gap: 4px; padding-top: 14px; }
.side:has(.switch) .brand { padding-bottom: 8px; }
.side:has(.switch) .nav__group { padding-top: 10px; padding-bottom: 5px; }
.side:has(.switch) .nav__a { min-height: 34px; }
.side:has(.switch) .nav__list--end { padding-top: 8px; }
.side:has(.switch) .me { margin-top: 6px; padding-top: 8px; }
.switch__name { font: var(--w-strong) .875rem/1.25 var(--font-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switch__chev { color: var(--fg-muted); transition: transform var(--d-micro) var(--e-out); }
.switch[open] .switch__chev { transform: rotate(180deg); }
.switch__panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: var(--z-dropdown, 50);
  max-height: min(62vh, 440px); overflow-y: auto; overscroll-behavior: contain; padding: 6px;
  border-radius: 12px; background: var(--panel-bg); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-3);
}
.switch[open] .switch__panel { animation: menu-in var(--d-ui) var(--e-out); }
.switch__all, .switch__add {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border-radius: 8px;
  font: var(--w-ui) .8125rem/1.2 var(--font-sans);
}
.switch__all { color: var(--fg); }
.switch__all[aria-current="page"] { background: var(--wash-2); }
.switch__all .i, .switch__add .i { color: var(--brand); }
.switch__add { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; color: var(--fg-accent); }
.switch__all:hover, .switch__add:hover { background: var(--wash); }
.switch__grp { padding: 10px 10px 4px; font: var(--w-strong) .625rem/1 var(--font-sans); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--fg-muted); }
.switch__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.switch__f { margin: 0; }
.switch__opt {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; width: 100%;
  min-height: 44px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer;
}
.switch__opt:hover { background: var(--wash); }
.switch__opt[aria-current="true"] { background: var(--brand-soft); }
.switch__on { grid-column: 1; font: var(--w-ui) .8125rem/1.25 var(--font-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switch__host { grid-column: 1; font-size: .75rem; line-height: 1.3; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switch__tick { grid-column: 2; grid-row: 1 / span 2; color: var(--brand); }
/* phone: the same list at the top of the menu; the top bar names the site */
.menu__sites { padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.menu__sites .switch__opt { min-height: 48px; }

/* Sites overview: the same columns in every group's table */
.card--setup { box-shadow: inset 0 0 0 1px var(--line), inset 3px 0 0 var(--st-warn), var(--shadow-1); }
.sites-tbl .tbl { table-layout: fixed; }
.sites-tbl .tbl th:nth-child(1) { width: 22%; }
.sites-tbl .tbl th:nth-child(2) { width: 13%; }
.sites-tbl .tbl th:nth-child(3) { width: 12%; }
.sites-tbl .tbl th:nth-child(4), .sites-tbl .tbl th:nth-child(5) { width: 11%; }
.sites-tbl .tbl th:nth-child(6), .sites-tbl .tbl th:nth-child(7) { width: 10%; }
.sites-tbl .tbl th:nth-child(8) { width: 11%; }
.sites__name { font-weight: var(--w-strong); }
.sites__host { display: block; margin-top: 2px; font-size: .75rem; font-weight: var(--w-body); overflow-wrap: anywhere; }
/* the first-run address prompt */
.addr { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.addr .field { flex: 1 1 18rem; max-width: 32rem; }
.addr__check { min-height: 48px; align-items: center; }

/* Settings → Features */
.feat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(13rem, 17rem); align-items: end; gap: 10px 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.feat:first-of-type { padding-top: 0; }
.feat__txt { display: grid; gap: 4px; align-self: center; }
.feat__name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: var(--w-strong) .9375rem/1.3 var(--font-sans); }
.feat .muted { font-size: .8125rem; }
.feat .field__label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Settings → Connections: one card per source, keys behind a disclosure */
.grid--conns { align-items: start; }
.conn__state { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 10px; font-size: .75rem; }
.conn__msg { margin: -4px 0 10px; }
.conn__keys { margin-top: 2px; border-top: 1px solid var(--line); }
.conn__keys > summary { list-style: none; }
.conn__keys > summary::-webkit-details-marker { display: none; }
.conn__sum {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding-top: 10px; cursor: pointer;
  font: var(--w-ui) .875rem/1.2 var(--font-sans); color: var(--fg-accent);
}
.conn__sum .muted { font-weight: var(--w-body); font-size: .8125rem; }
.conn__chev { margin-left: auto; color: var(--fg-muted); transition: transform var(--d-micro) var(--e-out); }
.conn__keys[open] .conn__chev { transform: rotate(180deg); }
.conn__form { display: grid; gap: 14px; padding-top: 8px; }
.conn__hint { align-self: center; font-size: .8125rem; }
.kv { display: grid; gap: 6px; min-width: 0; }
.kv__top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.kv__label { font: var(--w-ui) .875rem/1.3 var(--font-sans); }
.kv__st { display: inline-flex; align-items: center; gap: 4px; font: var(--w-ui) .75rem/1.3 var(--font-sans); color: var(--fg-muted); white-space: nowrap; }
.kv__st--set { color: var(--good-fg); }
.kv__st--set .i { color: var(--st-good); }
.kv__st--bad { color: var(--bad-fg); white-space: normal; }
.kv__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: .75rem; line-height: 1.4; }
.kv__in { display: flex; gap: 8px; align-items: stretch; }
.kv__in .field__input { flex: 1; min-width: 0; min-height: 44px; font-family: var(--font-mono); font-size: .875rem; }
.kv__in .btn { flex: none; min-height: 44px; }
.kv__area { min-height: 4.5rem !important; }
.kv__note { font-size: .8125rem; }

@media (max-width: 1023.98px) {
  .top .brand__by { display: block; max-width: 46vw; font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 719.98px) {
  .sites-tbl .tbl { table-layout: auto; }
  .sites-tbl .tbl th { width: auto !important; }
  .sites-tbl .tbl--stack th, .sites-tbl .tbl--stack td { grid-template-columns: 8.5rem minmax(0, 1fr); }
  .feat { grid-template-columns: 1fr; }
  .kv__in { flex-wrap: wrap; }
  .kv__in .btn { width: auto; }
  .conn__state { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .switch[open] .switch__panel { animation: none; }
}

/* content engine v2 (E09 task 5): board buttons wrap inside narrow columns; the quality-check report */
.board__item { min-width: 0; }
.board__item .inline-form, .board__item .btn { max-width: 100%; }
.board__item .btn { white-space: normal; text-align: left; line-height: 1.2; padding-block: 8px; }
.gate__sum { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; font-size: .875rem; }
.gate__sum + .pre { margin-bottom: 16px; }
.card__body > .muted + .row, .card__body > .muted + .decide { margin-top: 12px; }
.card--warn { box-shadow: inset 3px 0 0 var(--st-warn), inset 0 0 0 1px var(--line), var(--shadow-1); }

/* My view (E09 task 8): what each person sees, per site group; toggles are real checkboxes styled as switches */
.myview__set { margin: 0; padding: 14px 0 16px; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.myview__set:first-child { padding-top: 0; border-top: 0; }
.myview__leg { float: left; width: 100%; padding: 0 0 10px; font: var(--w-strong) .75rem/1.2 var(--font-sans); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--fg-muted); }
.myview__leg + * { clear: both; }
.myview__modes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.myview__radio { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 10px; border-radius: var(--r-full); background: var(--wash); box-shadow: inset 0 0 0 1px var(--line); font: var(--w-ui) .8125rem/1.2 var(--font-sans); cursor: pointer; }
.myview__radio input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.myview__radio:has(input:checked) { background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.myview__toggles, .myview__pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: 8px; }
.myview__pick { margin-bottom: 6px; }
.myview__set:has(input[value="some"]:not(:checked)) .myview__pick { opacity: .55; }
.tog { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px; border-radius: 10px; background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; transition: box-shadow var(--d-micro) var(--e-out); }
.tog:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.tog input {
  appearance: none; flex: none; position: relative; width: 34px; height: 20px; margin: 0; border-radius: var(--r-full);
  background: var(--wash-2); box-shadow: inset 0 0 0 1px var(--line-strong); cursor: pointer;
  transition: background var(--d-micro) var(--e-out);
}
.tog input::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--fg-muted); transition: transform var(--d-micro) var(--e-out), background var(--d-micro) var(--e-out);
}
.tog input:checked { background: var(--brand); box-shadow: none; }
.tog input:checked::after { transform: translateX(14px); background: var(--on-brand); }
.tog input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tog__txt { display: grid; min-width: 0; font: var(--w-ui) .875rem/1.25 var(--font-sans); }
.tog__note { font: var(--w-body) .75rem/1.3 var(--font-sans); color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tog:has(input:not(:checked)) .tog__txt { color: var(--fg-muted); }
.myview__bar { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 24px; padding: 12px 0 calc(12px + var(--safe-b, 0px)); background: linear-gradient(to bottom, transparent, var(--bg) 30%); }
.sites__hidden { margin: 4px 0 16px; font-size: .8125rem; }
@media (prefers-reduced-motion: reduce) {
  .tog input, .tog input::after { transition: none; }
}
a.me__who { color: inherit; text-decoration: none; border-radius: 6px; }
a.me__who:hover .me__view { text-decoration: underline; }
.me__view { color: var(--fg-accent); white-space: nowrap; }
.myview .field { max-width: 36rem; }
.myview__toggles + .field__help, .myview__pick + .field__help { margin-top: 10px; }

/* E11 · Settings → SEO areas */
.seo__sel { width: 100%; min-width: 10rem; padding-block: 8px; }
td .seo__sel { min-width: min(10rem, 100%); max-width: 100%; }
td .seo__sel--mode { min-width: min(17rem, 100%); }
td .seo__sel--lead { min-width: min(9rem, 100%); }
.seo__area { display: block; font-weight: var(--w-strong); }
.seo__area .seo__when { display: inline; font-weight: 400; }
.seo__ex { display: block; margin-top: 6px; max-width: 46ch; font-size: .875rem; font-weight: 400; line-height: 1.45; }
.seo__ex-k { font-weight: var(--w-ui); }
.seo__when, .seo__who { display: block; margin-top: 2px; font-size: .8125rem; font-weight: 400; }
.seo__save { margin: 16px 0 0; }
.seo__modes li, .seo__floor li { margin-bottom: 8px; }
.seo__floor li { display: flex; gap: 8px; align-items: flex-start; }
.seo__floor .i { flex: none; margin-top: 3px; color: light-dark(#B57A00, var(--st-warn)); }
.sysnote { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; font-size: .875rem; }
.sysnote .i { flex: none; margin-top: 2px; }

/* S3 Task C: a multi-site client's header line above its sites (All sites), and its entry in the site switcher */
.sites__client { margin: 20px 0 10px; font-size: .875rem; }
.sites__client:first-child { margin-top: 0; }
.switch__client { text-decoration: none; background: var(--wash); margin-top: 4px; }
.switch__client:hover { background: var(--brand-soft); }
.switch__client .switch__on { color: var(--brand); font-weight: var(--w-strong); }
/* a "Not computed yet" body inside a number tile: flat and small, so it does not stretch the row */
.stat .empty { min-height: 0; padding: 4px 0 0; background: none; box-shadow: none; display: block; }
.stat .empty__icon { display: none; }
.stat .empty__title { font-size: .875rem; }
.stat .empty__body { font-size: .75rem; line-height: 1.4; }

/* ---------- 9 · tour (SPEC-TOUR): the Help menu, the first-visit notice and the click-guided tour (public/tour.js) ----
   Only opacity moves (the card per step, the whole tour on open), inside the no-preference guard below; positions are
   set by tour.js as transforms. The dim is a ring with a page-sized shadow, so the highlighted element shows through. */
:root {
  --z-tour: 300;
  --tour-dim: light-dark(rgb(20 16 31 / .5), rgb(0 0 0 / .62));
}
.help { margin: 0; }
/* the menu's last row: Settings and Help side by side (sidebar); the phone menu gives Help a row of its own */
.side .nav__list--end { grid-template-columns: minmax(0, 1fr) auto; }
.help > summary { list-style: none; }
.help > summary::-webkit-details-marker { display: none; }
.help__btn {
  display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 10px; cursor: pointer;
  font: var(--w-ui) .875rem/1 var(--font-sans); color: var(--fg-muted); -webkit-tap-highlight-color: transparent;
}
.help__btn .i { width: 18px; height: 18px; }
.help__btn:hover, .help[open] > .help__btn { background: var(--wash); color: var(--fg); }
.help__chev { margin-left: auto; color: var(--fg-muted); transform: rotate(-90deg); }
.side .help__chev { margin-left: 0; }
.help__panel {
  display: grid; gap: 2px; padding: 6px; border-radius: 12px;
  background: var(--panel-bg); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-3);
}
/* desktop: beside the sidebar, bottom-aligned with it (fixed: the sidebar's own scroll does not clip it) */
.side .help__panel {
  position: fixed; left: calc(var(--side-w) + 8px); bottom: 12px; z-index: var(--z-dropdown);
  width: 18.5rem; max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain;
}
.side:has(.switch) .help__btn { min-height: 34px; }
.help__a { display: grid; gap: 2px; align-content: center; min-height: 40px; padding: 7px 10px; border-radius: 8px; font: var(--w-ui) .8125rem/1.25 var(--font-sans); color: var(--fg); }
.help__a:hover { background: var(--wash-2); }
.help__a--start { background: var(--wash); }
.help__a--start .help__t { font-weight: var(--w-strong); color: var(--fg-accent); }
.help__s { font-size: .75rem; font-weight: 400; color: var(--fg-muted); }
.help__grp { padding: 10px 10px 4px; font: var(--w-strong) .6875rem/1 var(--font-sans); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--fg-muted); }
.help__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
@media (max-width: 1023.98px) {
  .nav--menu .nav__help { grid-column: 1 / -1; }
  .menu__panel .help__btn { min-height: 44px; }
  .menu__panel .help__panel { margin-top: 4px; box-shadow: inset 0 0 0 1px var(--line); }
  .menu__panel .help__a { min-height: 44px; }
}

.tour-offer { flex-wrap: wrap; row-gap: 10px; }
.tour-offer__t { flex: 1 1 16rem; }
.tour-offer__f { display: flex; flex-wrap: wrap; gap: 8px; }

/* the docked card's height (tour.js): room under the page's last line and above the phone menu's bottom */
.is-touring body { padding-bottom: var(--tour-dock, 0px); }
@media (max-width: 1023.98px) {
  .is-touring .menu__panel { max-height: calc(100dvh - var(--topbar-h) - 16px - var(--tour-dock, 0px)); }
}
.tour { position: relative; z-index: var(--z-tour); opacity: 0; }
.tour.is-on { opacity: 1; }
.tour__shade { position: fixed; inset: 0; z-index: var(--z-tour); }
.tour--text .tour__shade { background: var(--tour-dim); }
.tour__ring {
  position: fixed; left: 0; top: 0; width: 0; height: 0; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 2px var(--focus), 0 0 0 5px var(--bg-raised), 0 0 0 100vmax var(--tour-dim);
}
.tour--text .tour__ring { display: none; }
.tour [hidden] { display: none; }
.tour__card {
  position: fixed; left: 0; top: 0; z-index: calc(var(--z-tour) + 1); width: min(22rem, calc(100% - 32px));
  display: grid; gap: 14px; padding: 18px 18px 16px; border-radius: var(--r-md);
  background: var(--bg-raised); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-3);
  opacity: 0;
}
.tour__card.is-in { opacity: 1; }
.tour__card.is-docked {
  top: auto; right: 0; bottom: 0; width: auto; border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
}
.tour__card.is-docked.is-top { top: 0; bottom: auto; border-radius: 0 0 var(--r-lg) var(--r-lg); padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
.tour__count { font: var(--w-strong) .6875rem/1 var(--font-sans); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--fg-muted); }
.tour__title { margin-top: 8px; padding-right: 64px; font: var(--w-heading) 1.0625rem/1.25 var(--font-sans-heavy); letter-spacing: var(--track-tight); text-wrap: balance; }
.tour__body { margin-top: 6px; font-size: .9375rem; line-height: 1.5; text-wrap: pretty; }
.tour__hint { margin-top: 8px; font-size: .8125rem; color: var(--fg-muted); }
.tour__acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.tour__acts .btn { --btn-h: 40px; }
.tour__x {
  position: absolute; top: 10px; right: 10px; min-height: 36px; padding: 0 12px; border: 0; border-radius: var(--r-full);
  background: transparent; color: var(--fg-muted); font: var(--w-ui) .8125rem/1 var(--font-sans); cursor: pointer;
}
.tour__x:hover { background: var(--wash-2); color: var(--fg); }
.tour__card.is-docked .tour__acts .btn, .tour__card.is-docked .tour__x { --btn-h: 44px; min-height: 44px; }
/* no ring after a click or a tap on the card (memory "no focus ring on click"); Tab brings it back */
.tour[data-input="pointer"] :focus-visible { outline: none; }
@media (prefers-reduced-motion: no-preference) {
  .tour, .tour__card { transition: opacity var(--d-ui) var(--e-out); }
}
