/* Team Genesis admin, design reset (docs/design/tokens.md, approved 2026-12-03). Inter for everything you scan,
   Newsreader for titles and the hero sentence, Poppins only in the wordmark. Layering replaces borders: a panel is a
   surface, one soft shadow and a hairline. Contrast and target sizes are checked in test/look.test.ts.
   Strict CSP: no inline styles anywhere, so every width and position here is a class or an SVG attribute. */

/* Self-hosted, Latin + Latin-1 subsets (José Ramírez). Inter and Newsreader from @fontsource-variable 5.3.0 (OFL). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/assets/fonts/inter-latin-wght.woff2) format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/assets/fonts/newsreader-latin-opsz.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/poppins-600.woff2) format("woff2"); }

:root {
  /* Color: light theme; the sidebar and hero panels stay dark. */
  --ground: #f3f1ea;
  --surface: #fffefa;
  --surface-sunken: #f7f5ef;
  --surface-raised: #ffffff;
  --track: #ece9e0;
  --field-border: #878f84;
  --ink: #161d18;
  --text: #2f3a31;
  --muted: #5a665c;
  --sage: #354536;
  --sage-hover: #2c3a2e;
  --sage-tint: #e8eee4;
  --sage-tint-2: #dde6d8;
  --deep: #243026;
  --sidebar: #1d251f;
  --cream: #efe8d9;
  --lichen: #a9b7a0;
  --focus: #3b7a4c;
  --success-ink: #2b6a37;
  --success-bg: #e6f0e3;
  --warning-ink: #7d5410;
  --warning-bg: #f7ecd3;
  --danger-ink: #a2321f;
  --danger-bg: #fbe9e4;
  --white: #fffefa;
  /* The older names the other pages still use, mapped onto the reset palette (one source of truth per value). */
  --line: #e2dfd6;
  --divider: #ebe8e0;
  --pos: #2b6a37;
  --neg: #a2321f;
  --chip-bg: #e6f0e3;
  --chip-ink: #2b6a37;
  --field: #878f84;
  --on-sage: #fffefa;
  --side-head: #fffefa;
  --side-text: #cdd4c9;
  --side-muted: #aab4a6;
  --side-current: #323832;
  --deep-head: #fffefa;
  --deep-text: #ece6d8;
  --deep-muted: #d4dccf;
  --deep-chip: #e6ede1;
  --hero-fill: #384238;
  --error-ink: #a2321f;
  --error-bg: #fbe9e4;
  --ok-ink: #2b6a37;
  --ok-bg: #e6f0e3;
  /* Lines that are decoration only (never the only signal). */
  --hairline: rgb(31 38 32 / .08);
  --border: rgb(31 38 32 / .11);
  /* Radius */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  /* Elevation */
  --e1: 0 0 0 1px var(--border), 0 1px 2px rgb(22 29 24 / .04), 0 2px 6px -2px rgb(22 29 24 / .05);
  --e2: 0 0 0 1px var(--border), 0 4px 10px -4px rgb(22 29 24 / .08), 0 12px 28px -12px rgb(22 29 24 / .12);
  --e3: 0 0 0 1px rgb(22 29 24 / .06), 0 16px 40px -12px rgb(22 29 24 / .22), 0 4px 12px -4px rgb(22 29 24 / .08);
  --e-inset: inset 0 1px 2px rgb(22 29 24 / .06);
  /* Focus: a 2px gap in the ground's color, then a 2px ring. Dark grounds set their own gap and a cream ring. */
  --ring-gap: var(--surface);
  --ring-color: var(--focus);
  --ring: 0 0 0 2px var(--ring-gap), 0 0 0 4px var(--ring-color);
  /* Type */
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Newsreader", Georgia, "Times New Roman", serif;
  --mark: "Poppins", var(--ui);
  /* Motion */
  --ease: cubic-bezier(.2, 0, 0, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --side-w: 248px;
  /* Older radius names the other pages use. */
  --radius: 8px;
  --r-card: 16px;
  --r-list: 16px;
  --r-hero: 22px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--ui);
  font-size: .9375rem;
  line-height: 1.55;
  letter-spacing: -.005em;
  font-feature-settings: "cv11" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: anywhere;
}
::selection { background: #cfdcc6; color: var(--ink); }

h1, h2, h3, h4 { color: var(--ink); }
h1 { font-family: var(--display); font-size: 2.5rem; font-weight: 500; line-height: 1.1; letter-spacing: -.02em; margin: 0 0 1rem; font-optical-sizing: auto; }
h2 { font-size: 1.0625rem; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; margin: 2.5rem 0 .75rem; }
h2:first-child { margin-top: 0; }
h3 { font-size: 1rem; font-weight: 600; line-height: 1.35; }
p { margin: 0 0 1rem; }
a { color: var(--sage); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
/* Tabular figures on numbers only (a global tnum widens hyphens and dashes). */
.num, .tnum { font-variant-numeric: tabular-nums; }

/* One focus treatment everywhere. The transparent outline turns solid in forced-colors mode, where shadows vanish. */
:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring) !important; }
.side, .hero, .affil, .toast, .skip { --ring-gap: var(--deep); --ring-color: var(--cream); }
.side { --ring-gap: var(--sidebar); }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* Skip link: off screen until it has focus. */
.skip {
  position: absolute; left: .5rem; top: -4rem; z-index: 30;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem;
  background: var(--sage); color: var(--on-sage); border-radius: var(--r-sm); font-weight: 500; text-decoration: none;
}
.skip:focus { top: .5rem; }

.icon, .spark { flex: none; display: block; }
.spark path { fill: var(--sage); }
.spark.on-dark path { fill: var(--cream); }

/* ---------- Buttons: primary (once per view), secondary, quiet, icon, danger. Radius 8, never pills. ---------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; min-width: 44px; padding: 0 1rem;
  font: 500 .9375rem/1.2 var(--ui); letter-spacing: -.005em; text-decoration: none; white-space: nowrap; cursor: pointer;
  color: var(--white); background: var(--sage); border: 0; border-radius: var(--r-sm);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .1), 0 1px 2px rgb(22 29 24 / .2), 0 2px 6px -2px rgb(22 29 24 / .25);
  transition: background-color .12s var(--ease), box-shadow .12s var(--ease), color .12s var(--ease), transform .06s linear;
}
button:hover, .btn:hover { background: var(--sage-hover); color: var(--white); }
button:active, .btn:active { transform: translateY(1px); box-shadow: inset 0 1px 2px rgb(0 0 0 / .25); }
.btn .icon, button .icon { margin-left: -2px; }
button.plain, .btn.plain, .btn-secondary { color: var(--ink); background: var(--surface-raised); box-shadow: var(--e1); }
button.plain:hover, .btn.plain:hover, .btn-secondary:hover { background: var(--surface-sunken); color: var(--ink); }
button.plain:active, .btn.plain:active, .btn-secondary:active { background: var(--surface-sunken); box-shadow: 0 0 0 1px var(--border), var(--e-inset); }
.btn-quiet { color: var(--text); background: transparent; box-shadow: none; padding: 0 .75rem; }
.btn-quiet:hover { background: var(--sage-tint); color: var(--ink); }
.btn-quiet:active { background: var(--sage-tint-2); box-shadow: none; }
.btn-icon { width: 44px; padding: 0; color: var(--muted); background: transparent; box-shadow: none; }
.btn-icon .icon { margin: 0; }
.btn-icon:hover { background: var(--sage-tint); color: var(--ink); }
.btn-icon:active, .btn-icon[aria-pressed="true"] { background: var(--sage-tint-2); color: var(--ink); box-shadow: none; }
.btn-icon.ok { color: var(--success-ink); background: var(--success-bg); }
.btn-danger { color: var(--danger-ink); background: transparent; box-shadow: none; }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger-ink); }
.btn-danger-fill { color: #fff; background: var(--danger-ink); }
.btn-danger-fill:hover { background: #8c2918; color: #fff; }
.btn-on-dark { color: var(--cream); background: transparent; box-shadow: none; }
.btn-on-dark:hover { background: rgb(239 232 217 / .1); color: var(--white); }
.btn-sm { padding: 0 .75rem; font-size: .875rem; }
.btn-lg { min-height: 52px; padding: 0 1.25rem; font-size: 1rem; border-radius: 10px; }
.btn-block { display: flex; width: 100%; }
/* Disabled never fades alone: the fill drops and the reason is written beside it. */
button:disabled, .btn[aria-disabled="true"] { background: var(--surface-sunken); color: var(--muted); box-shadow: 0 0 0 1px var(--hairline); cursor: not-allowed; transform: none; }

/* ---------- Fields: label above, hint below, one focus treatment. ---------- */
form { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0 0 1rem; }
label { display: block; font-size: .8125rem; font-weight: 500; color: var(--ink); margin: 0; }
.hint { color: var(--muted); font-size: .8125rem; line-height: 1.45; margin: 0; }
input, select, textarea {
  display: block; width: 100%; min-height: 44px; padding: 0 .75rem;
  font: 400 .9375rem/1.4 var(--ui); letter-spacing: -.005em; color: var(--ink); background: var(--surface-raised);
  border: 1px solid var(--field-border); border-radius: var(--r-sm); box-shadow: var(--e-inset);
  transition: border-color .12s var(--ease), box-shadow .12s var(--ease);
}
textarea { padding: .625rem .75rem; min-height: 6rem; }
input:hover, select:hover, textarea:hover { border-color: var(--text); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--focus); box-shadow: inset 0 0 0 .5px var(--focus), 0 0 0 3px rgb(59 122 76 / .25) !important; }
input::placeholder { color: var(--muted); }
/* Selects: no system chevron; a drawn one (a self-hosted SVG) at 12px from the right. */
select {
  appearance: none; -webkit-appearance: none; padding-right: 2.5rem; cursor: pointer;
  background-image: url(/assets/img/chevron-down.svg);
  background-repeat: no-repeat; background-position: right 12px center;
}
input[type="checkbox"], input[type="radio"] { display: inline-block; width: 24px; height: 24px; min-height: 0; padding: 0; margin: 0; accent-color: var(--sage); box-shadow: none; }
/* Passwords read in the UI face: Inter with tabular figures and a little air, never monospace. */
input[type="password"], .pw-text { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
/* A password field with its show/hide button inside the right edge. */
.pw-field { position: relative; }
.pw-field input { padding-right: 3rem; }
.pw-field .pw-toggle { position: absolute; top: 0; right: 0; height: 100%; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.field-error { display: flex; gap: 6px; align-items: flex-start; margin: 0; color: var(--danger-ink); font-size: .8125rem; font-weight: 500; line-height: 1.45; }
.field-error .icon { margin-top: 1px; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger-ink); box-shadow: inset 0 0 0 1px var(--danger-ink); }

/* Messages: an icon and a sentence, never a color or a border alone. */
.alert, .flash {
  display: flex; gap: 10px; align-items: flex-start; margin: 0 0 1rem; padding: 12px 14px; border-radius: var(--r-md);
  font-size: .90625rem; line-height: 1.45;
}
.alert .icon, .flash .icon { margin-top: 1px; flex: none; }
.alert strong, .flash strong { font-weight: 600; }
.alert.error strong { display: block; }
.alert.error, .flash.error { background: var(--danger-bg); color: #7e2617; box-shadow: inset 0 0 0 1px rgb(162 50 31 / .16); }
.alert.error .icon, .flash.error .icon { color: var(--danger-ink); }
.alert.ok, .flash.ok { background: var(--success-bg); color: var(--success-ink); box-shadow: inset 0 0 0 1px rgb(43 106 55 / .16); }
/* A message with its action: the sentence, then a full 44px button that wraps under it on narrow screens. */
.flash-act { flex-wrap: wrap; align-items: center; }
.flash-act p { flex: 1 1 12rem; margin: 0; }
.flash-act .flash-btn { flex: none; }

/* ---------- Segmented control: a sunken track, the current choice a lifted thumb in 600 weight. ---------- */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 0 4px; list-style: none; background: var(--track); border-radius: 10px; box-shadow: var(--e-inset); isolation: isolate; }
.seg li { display: flex; }
.seg a {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 0 14px;
  border-radius: 7px; color: var(--muted); font-size: .875rem; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: color .12s var(--ease);
}
.seg a::before { content: ""; position: absolute; inset: 4px 0; z-index: -1; border-radius: 7px; transition: background-color .12s var(--ease), box-shadow .12s var(--ease); }
.seg a:hover { color: var(--ink); }
.seg a:hover::before { background: rgb(255 255 255 / .45); }
.seg a[aria-current="true"], .seg a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.seg a[aria-current="true"]::before, .seg a[aria-current="page"]::before { background: var(--surface-raised); box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgb(22 29 24 / .08), 0 2px 4px -1px rgb(22 29 24 / .06); }
.seg .count { padding: 1px 7px; border-radius: 999px; background: rgb(22 29 24 / .06); color: var(--text); font-size: .75rem; font-weight: 500; }
.seg a[aria-current] .count { background: var(--sage-tint); color: var(--success-ink); }

/* ---------- Badges, changes, chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: var(--r-xs); font-size: .8125rem; font-weight: 500; line-height: 1; white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.b-success { background: var(--success-bg); color: var(--success-ink); }
.b-warning { background: var(--warning-bg); color: var(--warning-ink); }
.b-danger { background: var(--danger-bg); color: var(--danger-ink); }
.b-off { background: #efede6; color: var(--muted); }
.b-off .dot { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.notyet { color: var(--muted); font-size: .875rem; }
.chg { display: inline-flex; align-items: center; gap: 4px; font-size: .8125rem; font-weight: 500; white-space: nowrap; }
.chg .icon { stroke-width: 2; }
.chg.up { color: var(--success-ink); }
.chg.down { color: var(--danger-ink); }
.chg.same { color: var(--muted); }

/* ---------- Panels: a surface, one soft shadow and a hairline ---------- */
.panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--e1); color: var(--text); min-width: 0; }
.ph-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 12px; }
.ph-head h2, .ph-head h3 { margin: 0; font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; color: var(--ink); }
.ph-head .meta, caption .meta { font-size: .8125rem; color: var(--muted); font-weight: 400; }
.link {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: -6px -6px -6px 0; padding: 0 6px; border-radius: 6px;
  color: var(--sage); font-size: .875rem; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.link:hover { background: var(--sage-tint); color: var(--ink); }
.panel-note { margin: 0 24px 8px; font-size: .8125rem; color: var(--muted); }

/* Rows inside panels: no zebra, no vertical rules; hairlines inset 24px so they read as a list, not a grid. */
.rows { list-style: none; margin: 0; padding: 0; }
.lrow { position: relative; display: grid; align-items: center; gap: 16px; min-height: 56px; padding: 0 24px; }
.lrow + .lrow::before { content: ""; position: absolute; top: 0; left: 24px; right: 24px; height: 1px; background: var(--hairline); }
.lrow.two { min-height: 64px; }
.lf { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 8px 4px 24px; box-shadow: inset 0 1px 0 var(--hairline); font-size: .8125rem; color: var(--muted); }
.lf .btn .icon { margin: 0 -2px 0 0; }

/* Initials avatars. The letters come from data-initials, so they are never part of the row's text. */
.av { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .02em; line-height: 1; background: var(--sage-tint); color: #2f4a30; }
.av[data-initials]::before { content: attr(data-initials); }
.av.c2 { background: var(--cream); color: #4a3f26; }
.av.c3 { background: #e2ebe8; color: #244038; }
.av-key { background: var(--surface-sunken); color: var(--muted); box-shadow: inset 0 0 0 1px var(--hairline); }
.who-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.who-cell .nm { font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
/* Long names wrap (spec: nothing is cut off); a name with no spaces breaks where it must. */
.who-cell .nm.trunc { white-space: normal; overflow-wrap: anywhere; }
.who-txt .sub { font-size: .8125rem; color: var(--muted); }

/* ---------- Menus on <details>: raised, 12px radius, items 44px, the destructive one last and red. ---------- */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; z-index: 25; top: calc(100% + 6px); right: 0; min-width: 236px; padding: 6px;
  background: var(--surface-raised); border-radius: var(--r-md); box-shadow: var(--e3);
  animation: menu-in .14s var(--ease-out);
}
/* The veil under an open menu (see menu() in kit.ts): above the page and the tab bar, below the menu itself. */
.menu-veil { position: fixed; inset: 0; z-index: 24; cursor: default; }
/* The veil takes every click while a menu is open, so the other rows' "…" buttons step back instead of peeking out
   from under the open menu as half-covered targets. */
body:has(details.menu[open]) details.menu:not([open]) > summary { visibility: hidden; }
.menu-start .menu-pop { right: auto; left: 0; }
.menu-up .menu-pop { top: auto; bottom: calc(100% + 6px); }
.menu-item {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px;
  border-radius: var(--r-sm); background: transparent; box-shadow: none; color: var(--ink); font-size: .90625rem; font-weight: 400; text-decoration: none; text-align: left;
}
.menu-item .icon { color: var(--muted); margin: 0; }
.menu-item:hover, button.menu-item:hover { background: var(--sage-tint); color: var(--ink); }
.menu-item.danger, .menu-item.danger .icon { color: var(--danger-ink); }
.menu-item.danger:hover { background: var(--danger-bg); color: var(--danger-ink); }
.menu-pop form { margin: 0; }
.menu-sep { border: 0; height: 1px; margin: 6px 4px; background: var(--hairline); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Toast: ink, cream text, a check; above the tab bar on phones, bottom right on desks. ---------- */
.toast {
  position: fixed; z-index: 40; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 6px 4px 14px; border-radius: var(--r-md);
  background: var(--ink); color: var(--cream); font-size: .90625rem; font-weight: 500; box-shadow: var(--e3);
  animation: toast-in .22s var(--ease-out);
}
.toast > .icon { color: #9fd29a; }
.toast-error > .icon { color: #f3b6a8; }
.toast-text { flex: 1; min-width: 0; }
.toast-act { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--white); font-weight: 600; text-decoration: none; }
.toast .btn-icon { color: var(--cream); }
.toast .btn-icon:hover { background: rgb(239 232 217 / .12); color: var(--white); }
.toast.leaving { opacity: 0; transition: opacity .16s var(--ease-out); }
@media (min-width: 64rem) { .toast { left: auto; right: 24px; bottom: 24px; max-width: 26rem; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Loading and empty states ---------- */
.sk { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--track) 0%, #f4f2eb 40%, var(--track) 80%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.sk-row { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 12px; min-height: 56px; padding: 0 24px; }
.sk-av { width: 32px; height: 32px; border-radius: 999px; }
.sk-line { height: 12px; }
.sk-line.w45 { width: 45%; } .sk-line.w50 { width: 50%; } .sk-line.w60 { width: 60%; } .sk-line.w70 { width: 70%; }
.sk-end { width: 80px; height: 12px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px 24px; text-align: center; }
.empty-state .es { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--hairline); color: var(--sage); }
.empty-state .es .spark path { fill: var(--sage); }
.empty-state .es-title { margin: 6px 0 0; font-family: var(--display); font-size: 1.375rem; font-weight: 500; letter-spacing: -.01em; line-height: 1.2; color: var(--ink); }
.empty-state p { margin: 0; max-width: 34ch; color: var(--muted); font-size: .90625rem; }
.empty-state .btn { margin-top: 6px; }

/* ---------- App shell. Phone first: top bar and bottom tabs; the sidebar takes over at 64rem (1024px). Hidden parts
   use display: none, so screen readers meet exactly one of each. ---------- */
.spark-tile {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(160deg, #3a4a3b, #2a362b); box-shadow: inset 0 1px 0 rgb(255 255 255 / .08), 0 0 0 1px rgb(0 0 0 / .3);
}
.spark-tile .spark path { fill: var(--cream); }
.spark-tile.sm { width: 32px; height: 32px; border-radius: 9px; }
.spark-tile.lg { width: 56px; height: 56px; border-radius: 16px; box-shadow: inset 0 1px 0 rgb(255 255 255 / .08), 0 0 0 1px rgb(0 0 0 / .3), 0 10px 24px -10px rgb(36 48 38 / .55); }

.side { display: none; }
/* The title never truncates: if it and the action can't share a row, the action moves to its own row. */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 10px; min-height: 64px; padding: 14px 16px 10px; background: var(--ground); }
.topbar-title { flex: 1 0 auto; font-family: var(--display); font-size: 1.5rem; font-weight: 500; line-height: 1.15; letter-spacing: -.015em; color: var(--ink); white-space: nowrap; }
.topbar a, .topbar-action { min-height: 44px; min-width: 44px; margin-left: auto; overflow-wrap: normal; white-space: nowrap; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 6px 6px max(8px, env(safe-area-inset-bottom));
  background: rgb(255 254 250 / .94); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 -1px 0 var(--hairline), 0 -10px 24px -16px rgb(22 29 24 / .18);
}
.tabs ul { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; }
.tabs a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 52px; min-width: 44px; padding: 0 2px 6px; border-radius: 10px;
  font-size: .71875rem; font-weight: 500; line-height: 1.2; text-align: center; color: var(--muted); text-decoration: none;
}
.tabs a[aria-current="page"], .tabs a.on { color: var(--ink); font-weight: 600; }
.tabs a[aria-current="page"] .icon, .tabs a.on .icon { color: var(--sage); stroke-width: 2; }
.tabs a[aria-current="page"]::after, .tabs a.on::after { content: ""; position: absolute; bottom: 2px; width: 4px; height: 4px; border-radius: 9px; background: var(--sage); }
main { display: block; padding: 4px 16px calc(6.5rem + env(safe-area-inset-bottom)); }
/* Keyboard focus never lands hidden behind the fixed tab bar (WCAG 2.4.11). */
html:has(.tabs) { scroll-padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }
/* Panels respond to the width of this column, not the window: the sidebar takes 248px at 64rem and up. */
.wrap { max-width: 1096px; margin: 0 auto; container-type: inline-size; container-name: wrap; }

@media (min-width: 64rem) {
  .app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--sidebar) var(--side-w), transparent var(--side-w)); }
  .topbar, .tabs { display: none; }
  .side {
    display: flex; flex-direction: column; gap: 24px;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: 20px 16px; background: var(--sidebar); color: var(--side-text);
  }
  main { padding: 40px 48px 64px; }
  html:has(.tabs) { scroll-padding-bottom: 0; }
}
.brand { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 8px; border-radius: var(--r-sm); text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--mark); font-weight: 600; font-size: .9375rem; letter-spacing: 0; color: var(--white); }
.brand-sub { margin-top: 2px; font-size: .75rem; font-weight: 500; letter-spacing: .01em; color: var(--side-muted); }
.side-links { display: flex; flex-direction: column; gap: 2px; list-style: none; margin: 0; padding: 0; }
.side a {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px;
  border-radius: var(--r-sm); color: var(--side-text); font-size: .90625rem; font-weight: 500; text-decoration: none;
  transition: background-color .12s var(--ease), color .12s var(--ease);
}
.side-links .icon { color: #97a293; }
.side-links a:hover { background: rgb(239 232 217 / .06); color: var(--white); }
.side-links a[aria-current="page"] { background: rgb(239 232 217 / .1); color: var(--white); box-shadow: inset 0 1px 0 rgb(255 255 255 / .04); }
.side-links a[aria-current="page"] .icon { color: var(--cream); }
/* Reading the site, then running it: a hairline between the two groups. */
.side-links .group-start { position: relative; margin-top: 21px; }
.side-links .group-start::before { content: ""; position: absolute; top: -11px; left: 12px; right: 12px; height: 1px; background: rgb(239 232 217 / .08); }
.sync { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 12px; font-size: .78125rem; line-height: 1.35; color: var(--side-muted); }
.sync-dot { flex: none; width: 8px; height: 8px; border-radius: 999px; background: #8fbf8a; box-shadow: 0 0 0 3px rgb(143 191 138 / .18); }
.sync.stale .sync-dot { background: #d9b36a; box-shadow: 0 0 0 3px rgb(217 179 106 / .18); }
.account { position: relative; }
.account summary {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  min-height: 44px; padding: 10px; cursor: pointer; list-style: none; border-radius: var(--r-md);
  background: rgb(239 232 217 / .05); box-shadow: inset 0 0 0 1px rgb(239 232 217 / .06);
  transition: background-color .12s var(--ease);
}
.account summary::-webkit-details-marker { display: none; }
.account summary:hover { background: rgb(239 232 217 / .09); }
.account-av { grid-column: 1; grid-row: 1 / span 2; background: #3a4a3b; color: var(--cream); }
.account-name { grid-column: 2; grid-row: 1; font-size: .875rem; font-weight: 500; line-height: 1.3; color: var(--white); }
.account-role { grid-column: 2; grid-row: 2; font-size: .78125rem; color: var(--side-muted); }
.account-chev { grid-column: 3; grid-row: 1 / span 2; color: var(--side-muted); transition: transform .14s var(--ease-out); }
.account[open] .account-chev { transform: rotate(180deg); }
.account-menu { left: 0; right: 0; min-width: 0; }

/* ---------- Page header: the serif title, a muted subline, then the actions on the right. ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 24px; margin: 0 0 1.75rem; }
.page-title { min-width: 0; }
.page-title h1 { margin: 0; }
.page-sub { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; margin: 6px 0 0; color: var(--muted); font-size: .9375rem; }
/* "Weekly report · Nov 30 to Dec 3 · site": each dot is drawn before the next part, so a wrapped line never ends on one. */
.page-sub > span { white-space: nowrap; }
.page-sub > span + span::before { content: ""; display: inline-block; width: 3px; height: 3px; margin-right: 8px; border-radius: 9px; background: currentColor; opacity: .6; vertical-align: middle; }
.page-sub .sub-path { white-space: normal; overflow-wrap: anywhere; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* Below 64rem the top bar shows the page title, so the h1 is for screen readers only; the subtitle stays. */
@media (max-width: 63.99rem) {
  .title-in-bar h1 { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .title-in-bar { margin-bottom: 1rem; }
  h1 { font-size: 1.875rem; line-height: 1.15; letter-spacing: -.015em; }
  .ov-head .page-sub { display: none; }
  .ov-head { margin: 0; }
}

/* ---------- Date bar: presets as a segmented control, then the custom dates as one field. ---------- */
.datebar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 2.5rem; }
.datebar a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; overflow-wrap: normal; }
.range-field {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 0 0 12px;
  background: var(--surface-raised); border-radius: 10px; box-shadow: var(--e1); font-size: .875rem; font-weight: 500; color: var(--ink);
}
.range-field .dr-cal { color: var(--muted); margin-right: 4px; }
.range-field .dr-to { margin: 0 2px; font-size: .875rem; font-weight: 400; color: var(--muted); }
.range-field .btn { margin-left: 4px; }
.dr-part { position: relative; display: inline-block; }
/* The real date input stays in place for keyboard, pickers and no-JS; at rest its own text is transparent and the
   formatted date is drawn over it. With focus, the input's editable text shows and the drawn copy steps aside. */
.dr-part input {
  width: 6.25rem; min-height: 44px; padding: 0 4px; border: 0; background: transparent; box-shadow: none;
  color: transparent; font: 500 .875rem/1.2 var(--ui); font-variant-numeric: tabular-nums; cursor: pointer;
}
.dr-part input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; margin: 0; opacity: 0; cursor: pointer; }
/* Not just :focus-visible: Tab also stops on the (invisible) picker button inside the input, where only :focus-within
   matches, and the ring has to show then too. */
.dr-part input:focus, .dr-part input:focus-within { color: var(--ink); border-radius: 6px; outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring) !important; }
.dr-part .dr-text { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); pointer-events: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dr-part:focus-within .dr-text { visibility: hidden; }
.datebar-phone { position: relative; margin: 0 0 8px; }
.datebar-phone summary, .pill-select {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; cursor: pointer; list-style: none;
  background: var(--surface-raised); border-radius: 10px; box-shadow: var(--e1); color: var(--ink); font-size: .9375rem; font-weight: 500;
}
.datebar-phone summary::-webkit-details-marker { display: none; }
.pill-select .icon { color: var(--muted); }
.pill-select .ps-range { margin-left: auto; font-size: .875rem; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.datebar-phone[open] .ps-chev { transform: rotate(180deg); }
.datebar-pop {
  position: absolute; z-index: 25; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 8px;
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  background: var(--surface-raised); border-radius: var(--r-md); box-shadow: var(--e3); animation: menu-in .14s var(--ease-out);
}
.datebar-pop .seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 2px 4px; }
.datebar-pop .seg a { width: 100%; }
.datebar-pop .range-field { flex-wrap: wrap; box-shadow: inset 0 0 0 1px var(--hairline); padding: 0 4px 0 12px; }
.datebar.datebar-desk { display: none; }
@media (min-width: 64rem) {
  .datebar.datebar-desk { display: flex; }
  .datebar-phone { display: none; }
}

/* ---------- Overview (src/pages/overview.ts, src/ui/report.ts), per design-reset ab1 (1440) and ab2 (390). ---------- */
.sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 1rem; margin: 0 0 .75rem; }
.sec-head h2, .sec-head h3 { margin: 0; font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; }
.sec-head > a:not(.link) { display: inline-flex; align-items: center; min-height: 44px; font-size: .875rem; font-weight: 500; }
.lk-short { display: none; }
.members { display: block; margin: 0; }
.band { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.pair-tiles { display: grid; grid-template-columns: minmax(0, 1fr); }
/* Spec Addendum 5: the recruit page's unlocks lead the band; Customer Hub and Affiliate onboarding follow, smaller. */
.lead-tile { display: grid; grid-template-columns: minmax(0, 1fr); }

/* Members tiles: phone first, one row per page: label and "11 personal, 7 main" left, the number right. */
.mtile { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label num" "sub num"; align-items: center; gap: 2px 12px; padding: 14px 16px; min-width: 0; }
.mtile + .mtile { box-shadow: inset 0 1px 0 var(--hairline); }
.tl { display: flex; align-items: center; gap: 8px; font-size: .875rem; font-weight: 500; color: var(--text); }
.tl .icon { color: var(--muted); }
.mtile .tl { grid-area: label; color: var(--ink); font-size: .90625rem; }
.mtile .tl .icon { display: none; }
.mtile .numrow { grid-area: num; }
.mtile .mt-sub { grid-area: sub; font-size: .8125rem; color: var(--muted); }
.mtile .bignum { font-size: 1.875rem; letter-spacing: -.035em; }
.mtile .mt-chg, .mtile .split, .mtile .legend { display: none; }
/* The label is the tile's one link, stretched over the tile; 44px tall without moving the layout. */
.tile-link { min-height: 44px; margin: -11px 0; text-decoration: none; overflow-wrap: normal; }
.tile-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tile-link:hover { text-decoration: underline; text-underline-offset: .2em; }
.tile-link:focus-visible { box-shadow: none !important; }
.tile-link:focus-visible::after { box-shadow: var(--ring); }
.numrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.bignum { font-size: 2.75rem; font-weight: 600; letter-spacing: -.04em; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.split { display: block; width: 100%; height: 8px; margin-top: 14px; border-radius: 999px; overflow: hidden; }
.split-p { fill: var(--sage); }
.split-m { fill: #c6d1bf; }
.split-empty { fill: var(--track); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; padding: 0; list-style: none; font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.lsw { width: 8px; height: 8px; border-radius: 2px; background: var(--sage); }
.lsw.m { background: #c6d1bf; }

/* The dark "Become an affiliate" tile: a constellation of sparks, one per person who unlocked, lit for each click. */
.affil {
  position: relative; overflow: hidden; padding: 16px; border-radius: var(--r-lg); color: var(--cream);
  /* The big faint spark in the corner is a background, so it can't push the tile's content box wider. */
  background: url(/assets/img/spark-cream.svg) no-repeat right -30px top -30px / 170px 170px, radial-gradient(120% 90% at 100% 0%, #33443a 0%, var(--deep) 55%);
  box-shadow: 0 1px 2px rgb(22 29 24 / .2), 0 18px 36px -18px rgb(22 29 24 / .45);
}
.affil .tl { position: static; color: var(--cream); }
.affil .tl .icon { color: var(--lichen); }
.affil .numrow { margin-top: 6px; }
.affil .bignum { font-size: 2.125rem; color: var(--white); }
.affil .of { color: var(--deep-muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.constel { display: block; width: 100%; max-width: 100%; height: auto; margin-top: 12px; overflow: visible; }
.constel .lit { fill: var(--cream); }
.constel .off { fill: none; stroke: #7f8f7c; stroke-width: 1.4; }
.constel .track { fill: none; stroke: #7f8f7c; stroke-width: 1.2; }
.constel .on { transform-box: fill-box; transform-origin: center; animation: spark-pop .4s var(--ease-out) both; }
.constel .on:nth-of-type(2) { animation-delay: 30ms; } .constel .on:nth-of-type(3) { animation-delay: 60ms; } .constel .on:nth-of-type(4) { animation-delay: 90ms; }
.constel .on:nth-of-type(5) { animation-delay: 120ms; } .constel .on:nth-of-type(6) { animation-delay: 150ms; } .constel .on:nth-of-type(7) { animation-delay: 180ms; }
.constel .on:nth-of-type(8) { animation-delay: 210ms; } .constel .on:nth-of-type(9) { animation-delay: 240ms; } .constel .on:nth-of-type(n+10) { animation-delay: 270ms; }
@keyframes spark-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.constel-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.constel-bar .constel { margin: 0; flex: 1 1 auto; min-width: 0; }
.constel-pct { color: var(--white); font-size: .875rem; font-weight: 600; }
.constel-none { margin: 12px 0 0; }
.affil .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; padding-top: 14px; box-shadow: inset 0 1px 0 rgb(239 232 217 / .12); font-size: .875rem; }
.affil .chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: rgb(239 232 217 / .12); color: var(--white); font-size: .8125rem; font-weight: 500; white-space: nowrap; }

/* The latest-unlocks strip: newest first; the newest draws its spark once when it is fresh. */
.ticker { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; overflow: hidden; }
.livepill { display: inline-flex; align-items: center; gap: 8px; flex: none; font-size: .8125rem; font-weight: 600; color: var(--success-ink); }
.pulse { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 999px; background: #3f8a52; box-shadow: 0 0 0 4px rgb(63 138 82 / .16); }
.ticker .lp-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ticks { display: flex; align-items: center; gap: 16px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.tick { display: flex; align-items: flex-start; gap: 10px; font-size: .875rem; color: var(--text); }
.tick.old { display: none; }
.tick b { font-weight: 600; color: var(--ink); }
.tick .when { color: var(--muted); white-space: nowrap; }
.tick .tsp { display: none; width: 16px; height: 16px; }
.tsp path { fill: var(--sage); }
.tick.new .tsp path { fill: #3f8a52; }
.tick-none { margin: 0; font-size: .875rem; color: var(--muted); }

/* The two short people lists (wide screens): real tables drawn as rows with avatars. */
.lists { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.lists > * { min-width: 0; }
.pl { overflow: hidden; display: flex; flex-direction: column; }
.ptable { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .9375rem; color: var(--ink); }
.ptable caption { padding: 20px 24px 12px; text-align: left; overflow: hidden; }
.ptable .cap-title { float: left; font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; color: var(--ink); }
.ptable caption .meta { float: right; line-height: 1.75; }
.ptable thead th { height: 36px; padding: 0 12px; background: var(--surface-sunken); box-shadow: inset 0 1px 0 var(--hairline), inset 0 -1px 0 var(--hairline); font-size: .8125rem; font-weight: 500; color: var(--muted); text-align: left; white-space: nowrap; }
.ptable th, .ptable td { padding: 0 12px; height: 56px; vertical-align: middle; border: 0; }
.ptable tr > :first-child { padding-left: 24px; }
.ptable tr > :last-child { padding-right: 24px; }
.ptable tbody th { font-weight: 500; text-align: left; }
.ptable tbody tr + tr > * { background-image: linear-gradient(var(--hairline), var(--hairline)); background-repeat: no-repeat; background-size: 100% 1px; background-position: 0 0; }
.ptable tbody tr + tr > :first-child { background-size: calc(100% - 24px) 1px; background-position: 24px 0; }
.ptable tbody tr + tr > :last-child { background-size: calc(100% - 24px) 1px; }
.ptable tbody tr { transition: background-color .12s var(--ease); }
.ptable tbody tr:hover { background-color: var(--surface-sunken); }
.ptable .end { text-align: right; }
.ptable .date { font-size: .875rem; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ptable.aff thead th:nth-child(2), .ptable.aff td:nth-child(2) { width: 104px; }
.ptable.aff thead th:nth-child(3), .ptable.aff td:nth-child(3) { width: 174px; }
.ptable:not(.aff) thead th:nth-child(2), .ptable:not(.aff) td:nth-child(2) { width: 164px; text-align: right; }
.ptable .quiet .nm { color: var(--ink); }
.pl .lf { margin-top: auto; }
.pl .empty-state { padding-top: 8px; }

/* Visitors hero: a dark panel, stacked on narrow columns, 5/7 from 56rem. Shared with Traffic and Articles. */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 16px 0 0; padding: 20px 20px 16px;
  border-radius: var(--r-xl); background: var(--deep); color: var(--deep-text); container-type: inline-size; container-name: hero;
  box-shadow: 0 1px 2px rgb(22 29 24 / .2), 0 24px 48px -24px rgb(22 29 24 / .5);
}
.hero > * { min-width: 0; }
.hero h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .875rem; font-weight: 500; color: var(--deep-muted); }
.hero h2 .icon { color: var(--lichen); }
.hero-num { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 8px; }
.hero-value { font-size: 3rem; font-weight: 600; line-height: 1; letter-spacing: -.045em; color: var(--white); font-variant-numeric: tabular-nums; }
.chg.hchip, .change.on-hero { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; background: rgb(239 232 217 / .1); color: var(--deep-chip); font-size: .8125rem; font-weight: 500; }
.hero-text { margin: 14px 0 0; max-width: 34ch; font-family: var(--display); font-size: 1.125rem; line-height: 1.45; letter-spacing: -.005em; color: var(--deep-text); }
.hero .note { margin: .5rem 0 0; }
.hero .empty, .hero-one { color: var(--deep-muted); margin: 0; }
.hc svg { display: block; width: 100%; height: auto; overflow: visible; }
.hgrid line { stroke: #e9e3d5; stroke-opacity: .1; stroke-width: 1; }
.hgrid .base { stroke-opacity: .22; }
.hc .ax { fill: #b9c4b3; font: 500 12px var(--ui); }
.hc .ax.dim { fill: #8d9a89; }
.hc .ax.now { fill: var(--white); }
.hc .g0 { stop-color: #a9b7a0; stop-opacity: .42; }
.hc .g1 { stop-color: #a9b7a0; stop-opacity: 0; }
.hline { fill: none; stroke: #c9d6bd; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.hguide { fill: none; stroke: var(--lichen); stroke-opacity: .35; stroke-width: 1.5; stroke-dasharray: 2 6; stroke-linecap: round; }
.hdrop { stroke: var(--cream); stroke-opacity: .3; stroke-dasharray: 3 4; }
.hhalo { fill: var(--cream); fill-opacity: .16; }
.hdot { fill: var(--white); stroke: var(--deep); stroke-width: 2; }
.hc .tip rect { fill: var(--white); }
.hc .tip .t1 { fill: var(--ink); font: 600 15px var(--ui); letter-spacing: -.01em; }
.hc .tip .t2 { fill: var(--muted); font: 400 13px var(--ui); }
/* Where the chart is narrow its axis text would shrink below 12px, so it goes; the table keeps every number. */
@container hero (max-width: 40rem) { .hc .ax, .hc .tip { display: none; } }
.hero-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-top: 8px; }
.hero-note { font-size: .8125rem; color: #b9c4b3; }
.hero .chart-table { margin: 0; }
.hero .chart-table > summary { min-height: 44px; list-style: none; }
.hero .chart-table > summary::-webkit-details-marker { display: none; }
.hero .chart-table[open] { flex-basis: 100%; }
.hero .chart-table .table-wrap { margin-top: 8px; color: var(--ink); }
.area-chart { margin: 0; }
.area-chart svg:not(.icon) { display: block; width: 100%; height: auto; overflow: visible; }
.area-chart .empty { color: var(--deep-muted); }
.hero .chart-table summary { color: var(--cream); }

/* Phone quick actions and the who-clicked card. */
.quick { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; margin-top: 16px; }
.quick .btn { padding: 0 .75rem; }
.card.phone-only { margin-top: 16px; padding: 4px 0 0; }
.card.phone-only .ph-head { padding: 16px 16px 8px; }
.card.phone-only .lrow { grid-template-columns: minmax(0, 1fr) auto; padding: 0 16px; }
.card.phone-only .lrow + .lrow::before { left: 16px; right: 16px; }
.card.phone-only .lf { padding-left: 16px; }
.card.phone-only .empty { padding: 0 16px 12px; }

/* Key numbers: one panel, four numbers between hairlines; 2 x 2 on narrow columns. */
.kpi-area { margin-top: 16px; }
.keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.key { display: flex; flex-direction: column; align-items: flex-start; padding: 16px; min-width: 0; }
.key:nth-child(2n) { box-shadow: inset 1px 0 0 var(--hairline); }
.key:nth-child(3) { box-shadow: inset 0 1px 0 var(--hairline); }
.key:nth-child(4) { box-shadow: inset 1px 0 0 var(--hairline), inset 0 1px 0 var(--hairline); }
.key .tl .pulse { width: 7px; height: 7px; margin-right: -2px; }
.key .v { margin: 8px 0 6px; font-size: 1.5rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; color: var(--ink); }
.key .m { font-size: .8125rem; color: var(--muted); }

/* Panels in pairs: articles and sources (7/5), Google and AI and who got in (5/7). */
.duo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.duo > .panel { padding-bottom: 4px; }
.duo + .panel { margin-top: 16px; } /* the Back Office panel after the last pair keeps the 16px gutter */
.art-list { list-style: none; margin: 0; padding: 0 0 4px; }
.art-list .lrow { grid-template-columns: 20px minmax(0, 1fr) auto; min-height: 56px; }
.rank { color: var(--muted); font-size: .875rem; font-weight: 500; }
.art-list .t { min-width: 0; }
.art-list .t a { display: flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.art-list .t a:hover { text-decoration: underline; text-underline-offset: .2em; }
.art-list small { display: none; }
.reads { font-weight: 600; color: var(--ink); text-align: right; white-space: nowrap; }
.src { padding: 4px 24px 20px; }
.bar-track { display: block; width: 100%; height: 8px; border-radius: 4px; overflow: hidden; }
.src .bar-rows { gap: 16px; }
.src .bar-rows li { gap: 6px 12px; font-size: .875rem; }
.src .bar-value { font-weight: 600; color: var(--ink); }
.src .bar-track { height: 6px; border-radius: 999px; }
.src .track-bg { fill: var(--track); }
.metric2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: 24px; padding: 4px 24px 20px; }
.metric2 > * { min-width: 0; }
.metric { display: flex; flex-direction: column; align-items: flex-start; }
.metric .v { margin: 8px 0 6px; font-size: 1.75rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; color: var(--ink); }
.metric .hint { margin-top: 8px; }
.metric2 .empty, .metric2 .note { margin: 0; }
.feed .lrow { grid-template-columns: auto minmax(0, 1fr) auto; }
.fi { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: var(--sage-tint); color: var(--sage); }
.fi .spark path { fill: var(--sage); }
.fi.click { background: var(--cream); color: #6a5523; }
.feed .s { font-size: .875rem; color: var(--text); min-width: 0; }
.feed .s .who { font-weight: 600; color: var(--ink); }
.feed .when, .card.phone-only .when { font-size: .875rem; color: var(--text); text-align: right; white-space: nowrap; }
.panel > .note, .panel > .empty { margin: 0 24px 20px; }
.panel > .note { padding: 0; background: none; box-shadow: none; color: var(--muted); }

/* Wider columns: the desktop arrangement of the same blocks. */
@container wrap (min-width: 40rem) {
  .pair-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mtile { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 22px 24px 24px; }
  .mtile + .mtile { box-shadow: inset 1px 0 0 var(--hairline); }
  .mtile .tl { color: var(--text); font-size: .875rem; }
  .mtile .tl .icon { display: block; }
  .mtile .numrow { margin-top: 10px; }
  .mtile .bignum { font-size: 2.75rem; letter-spacing: -.04em; }
  .mtile .mt-chg, .mtile .split { display: block; }
  .mtile .mt-chg { display: inline-flex; }
  .mtile .legend { display: flex; }
  .mtile .mt-sub { display: none; }
  .secondary .mtile { padding: 18px 24px 20px; }
  .secondary .mtile .numrow { margin-top: 6px; }
  .secondary .mtile .bignum { font-size: 2rem; letter-spacing: -.035em; }
  .affil { padding: 22px 24px; }
  .affil .numrow { margin-top: 10px; }
  .affil .bignum { font-size: 2.75rem; }
  .affil .constel { width: auto; margin-top: 16px; }
  .ticker { min-height: 52px; padding: 0 8px 0 16px; gap: 16px; }
  .ticker .lp-text { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; }
  /* As many whole items as fit on one 52px line, newest first; the rest wrap onto a line that isn't shown, so no
     name is ever cut in half. Screen readers still hear the whole list. */
  .ticks { flex-wrap: wrap; align-content: flex-start; height: 52px; overflow: hidden; }
  .ticks .tick { min-height: 52px; }
  .tick, .tick.old { display: flex; align-items: center; white-space: nowrap; }
  .tick .tsp { display: block; }
  .tick.old { color: var(--muted); }
  .tick.old b { color: var(--text); }
  .ticker .livepill::after, .tick + .tick::before { content: ""; flex: none; width: 1px; height: 20px; background: var(--hairline); }
  .ticker .livepill::after { margin-left: 8px; }
  .tick + .tick::before { margin-right: 6px; }
  .keys { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .key { padding: 20px 24px; }
  .key:nth-child(n) { box-shadow: inset 1px 0 0 var(--hairline); }
  .key:first-child { box-shadow: none; }
  .key .v { font-size: 1.75rem; }
  .art-list .lrow { grid-template-columns: 28px minmax(0, 1fr) auto; min-height: 64px; }
  .art-list small { display: block; font-size: .8125rem; font-weight: 400; color: var(--muted); }
  .art-list .t a { min-height: 44px; align-items: flex-end; padding-top: 4px; }
  .art-list .t small { padding-bottom: 10px; }
  .art-list .reads small { font-size: .75rem; color: var(--muted); }
  .hero { gap: 40px; padding: 36px 40px 28px; margin-top: 40px; }
  .hero-num { flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 14px; }
  .hero-value { font-size: 4rem; }
  .hero-text { margin-top: 22px; font-size: 1.3125rem; max-width: 30ch; }
  .lk-long { display: inline; }
  .lk-short { display: none; }
}
@container wrap (max-width: 39.99rem) {
  .panel .ph-head { padding: 16px 16px 8px; }
  .hchip .than { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .panel .lrow { padding: 0 16px; }
  .panel .lrow + .lrow::before { left: 16px; right: 16px; }
  .panel .lf { padding-left: 16px; }
  .src, .metric2 { padding-left: 16px; padding-right: 16px; }
  .panel > .note, .panel > .empty { margin-left: 16px; margin-right: 16px; }
  .lk-long { display: none; }
  .lk-short { display: inline; }
  .members > .sec-head { margin: 8px 0 10px; }
}
@container wrap (min-width: 56rem) {
  .band { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.08fr); }
  .pair-tiles, .lead-tile { grid-column: span 2; }
  .pair-tiles.secondary, .ticker { grid-column: 1 / -1; }
  .lists { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lists > .lead { grid-column: 1 / -1; }
  .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .duo.g75 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .duo.g57 { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .affil .constel { max-width: 300px; }
}
/* 320px: icons drop from the two quick actions so both labels fit side by side. */
@container wrap (max-width: 22rem) { .quick .icon { display: none; } }
@media (max-width: 22.5rem) {
  .topbar { gap: .25rem 6px; padding-inline: 12px; }
}
@media (min-width: 64rem) {
  .members > .sec-head { margin-top: 0; }
}

/* ---------- Signed-out screens and the forced password change (ab5): the spark tile, one calm card. ---------- */
.solo-page {
  display: flex; flex-direction: column; align-items: center;
  min-height: 100vh; min-height: 100dvh; padding: 0 16px 40px;
  background:
    url(/assets/img/spark-faint.svg) no-repeat 50% 40px / 520px 520px,
    radial-gradient(90% 50% at 50% 0%, #e9eee4 0%, var(--ground) 70%);
}
.solo-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 64px 0 28px; text-align: center; }
.solo-name { font-family: var(--mark); font-size: 1.0625rem; font-weight: 600; line-height: 1.2; letter-spacing: 0; color: var(--ink); }
.solo-sub { margin-top: -10px; font-size: .8125rem; font-weight: 500; color: var(--muted); }
.solo-page main { width: 100%; padding: 0; }
.solo { width: 100%; max-width: 25rem; margin: 0 auto; container-type: inline-size; }
.solo-card { padding: 28px 20px 20px; background: var(--surface); border-radius: 20px; box-shadow: var(--e2); color: var(--text); }
@container (min-width: 24rem) { .solo-card { padding: 32px 28px 24px; } }
.solo-card h1 { margin: 0; font-size: 2rem; line-height: 1.1; letter-spacing: -.02em; }
.solo-card > :last-child { margin-bottom: 0; }
.solo-card .alert, .solo-card .flash { margin: 20px 0 4px; }
.solo-lede { margin: 8px 0 0; color: var(--muted); }
.solo-form { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.solo-form .field { margin: 0; }
.solo-form .btn-block { margin-top: 4px; }
.solo-note { margin: 20px 0 0; padding-top: 16px; box-shadow: inset 0 1px 0 var(--hairline); font-size: .84375rem; color: var(--muted); text-align: center; }
.solo-go { margin: 20px 0 0; }
.solo-out { margin-top: 16px; text-align: center; }
@media (min-width: 64rem) { .solo-brand { padding-top: 12vh; } }

/* One layout per screen size. Utility classes, so they win over a component's own display. */
@media (max-width: 63.99rem) { .desk-only { display: none !important; } }
@media (min-width: 64rem) { .phone-only { display: none !important; } }

/* ==========================================================================================================
   The other screens (Traffic, Articles, Search and AI, Passwords, Admins, Activity, reports). Their own layouts
   are unchanged in this phase; they pick up the reset's type, color, radius, buttons, fields and elevation here.
   ========================================================================================================== */

/* Change password inside the app, and the "are you sure" screens: one focused card. */
.form-card { max-width: 32rem; }
.confirm { max-width: 34rem; padding: 1.75rem; border-radius: var(--r-xl); }
.confirm h1 { margin: 0 0 .75rem; font-size: 1.75rem; }
.confirm p { color: var(--text); }
.confirm .actions { margin-top: 1.5rem; }
/* The button that removes or deletes is the one red thing on the screen; its words say what it does. */
.confirm button[type=submit] { background: var(--error-ink); border-color: var(--error-ink); color: var(--on-sage); }
/* A long name wraps the button onto several lines: a rounded box then, not a stretched pill that clips the words. */
.confirm .actions button, .confirm .actions .btn { border-radius: var(--r-sm); white-space: normal; padding-top: .5rem; padding-bottom: .5rem; text-align: center; }
.confirm button[type=submit]:hover { background: #8c2918; }

/* Activity: one card, newest first, 50 at a time. */
.log .table-wrap td.what { font-weight: 500; }
/* On a wide card an address or an action stays on one line; the About and Detail columns take the wrapping. */
@container (min-width: 56rem) {
  .log .table-wrap td.actor { min-width: 14rem; }
  .log .table-wrap td.what { min-width: 13rem; }
}
.log .plist-foot { margin-top: .75rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Full reports (src/pages/reports.ts), restyled with the kit: the Overview's people table on wide screens, a list of
   small rows with avatars on phones (about 140px a person at 320px wide), Previous and Next as quiet buttons. */
.report { margin-top: 0; padding-top: 16px; container-type: inline-size; }
.report .panel-note { margin: 0 16px 12px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }
.pager .btn-quiet .icon { margin: 0; }
.pager-at { font-size: .875rem; color: var(--muted); white-space: nowrap; }
.rtable .end { text-align: right; }
.ptable.rtable thead th:nth-child(2), .ptable.rtable thead th:nth-child(3) { width: 168px; text-align: left; }
.ptable.rtable thead th:nth-child(4) { width: 96px; }
.ptable.rtable.r-aff thead th:nth-child(5) { width: 212px; }
.ptable.rtable.r-aff thead th:nth-child(6) { width: 204px; }
.rtable .mark-toggle { padding: 0 .75rem 0 .5rem; font-size: .875rem; }
.rtable .mark { gap: 2px 8px; }
.rtable tbody th.quiet .nm { color: var(--muted); font-weight: 500; }
.rtable .clicked { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.rtable .clicked .date { font-size: .8125rem; color: var(--muted); }
.rtable td .mark { flex-wrap: nowrap; }
.rlist { list-style: none; margin: 0; padding: 0; }
.rl { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; padding: 14px 16px; background: linear-gradient(var(--hairline), var(--hairline)) no-repeat 16px 0 / calc(100% - 32px) 1px; }
.rl:first-child { background: none; }
.rl > .av { grid-row: 1 / span 2; margin-top: 2px; }
.rl > :not(.av) { grid-column: 2; }
.rl p { margin: 0; }
.rl-name { font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.rl-name.quiet { color: var(--muted); }
.rl-sub { font-size: .8125rem; color: var(--muted); }
.rl-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 6px; font-size: .875rem; color: var(--text); }
.rl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .25rem; margin-top: 8px; }
.rl-actions .mark { margin: 0; }
p.rl-signed { font-size: .875rem; color: var(--muted); }
.rl-more[open] { flex-basis: 100%; }
/* A quiet More link-button so it fits beside the toggle at 320px; still a 44px target. */
.rlist .rl-more summary { min-width: 44px; padding: 0 .5rem; box-shadow: none; background: transparent; color: var(--sage); }
.rlist .rl-more summary:hover { background: var(--sage-tint); }
.rl-more dl { margin: .5rem 0 0; display: grid; gap: .25rem; font-size: .875rem; }
.rl-more dl div { display: flex; justify-content: space-between; gap: 1rem; }
.rl-more dt { color: var(--muted); }
.rl-more dd { margin: 0; text-align: right; }
.report .lf { padding: 8px 8px 8px 16px; }
@container (min-width: 40rem) {
  .report .panel-note { margin: 0 24px 12px; }
  .report .lf { padding-left: 24px; }
}

/* Phone "More": one 52px row per screen. */
.more-list { list-style: none; margin: 0; padding: 0; background: var(--surface); box-shadow: var(--e1); border-radius: var(--r-list); overflow: hidden; }
.more-list li + li { box-shadow: inset 0 1px 0 var(--hairline); }
.more-list a, .more-list button.plain {
  background: transparent; box-shadow: none; font-size: .9375rem;
  display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 52px; padding: 0 1rem;
  color: var(--ink); text-decoration: none; font-weight: 500; border: 0; border-radius: 0; justify-content: flex-start;
}
.more-list a:hover, .more-list button.plain:hover { background: var(--surface-sunken); }
.more-list .icon { color: var(--muted); }

/* Grid: 12 columns from 64rem, one column below. */
.grid-12 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.grid-12 > * { min-width: 0; }
@media (min-width: 64rem) {
  .grid-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .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-12 { grid-column: span 12; }
}

/* Page body */
.narrow { max-width: 28rem; }
.card { background: var(--surface); box-shadow: var(--e1); border-radius: var(--r-card); padding: 1.25rem 1.5rem; color: var(--ink); }

.row select { width: auto; }
.secret { margin: 0 0 1.5rem; border-color: var(--sage); }
.secret input { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
td .row, td form { margin: 0 0 .5rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: stretch; }
.row input, .row code, .row select { flex: 1 1 12rem; min-width: 0; }
.row button, .row .btn { flex: 0 0 auto; white-space: nowrap; }
/* Words in controls and column headers never split mid-word, even in a narrow table column. */
button, .btn, .side a, .tabs a, summary, label, th[scope=col] { overflow-wrap: normal; }
/* …except a control that carries a person's or admin's name, which can be 80 characters with no space. */
button.has-name, .btn.has-name, label.has-name { overflow-wrap: anywhere; }
.account-name { overflow-wrap: anywhere; }
/* Dates and short values that must stay on one line. */
.nowrap { white-space: nowrap; }
/* A link that stands on its own (Back to …, See all …) is a full 44px target. */
a.go { display: inline-flex; align-items: center; min-height: 44px; }

/* Tables scroll inside their own box */
.table-wrap { overflow-x: auto; box-shadow: var(--e1); border-radius: var(--r-list); background: var(--surface); }
.table-wrap:focus-visible { outline-offset: 0; }
table { border-collapse: collapse; width: 100%; font-size: .9375rem; color: var(--ink); }
caption { text-align: left; font-weight: 600; color: var(--ink); padding: .75rem 1rem .375rem; }
th, td { text-align: left; padding: .75rem 1rem; border-top: 1px solid var(--hairline); vertical-align: top; }
thead th { font-size: .8125rem; font-weight: 500; color: var(--muted); background: var(--surface-sunken); }
th { font-weight: 500; }

.check { min-height: 44px; display: flex; gap: .5rem; align-items: flex-start; }

/* Charts (src/ui/charts.ts). Marks are sage/ink on surface, well above 3:1; series also differ by dash and marker shape. */
.chart { margin: 0 0 1.5rem; padding: 1.25rem 1.5rem; background: var(--surface); box-shadow: var(--e1); border-radius: var(--r-card); color: var(--ink); }
.chart figcaption { font-weight: 600; color: var(--ink); margin-bottom: .5rem; }
.chart svg { display: block; width: 100%; height: auto; max-width: 100%; }
.chart .grid { stroke: var(--divider); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .line { stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart .plot { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: .5rem; }
.chart .plot svg { grid-column: 2; grid-row: 1; overflow: visible; }
.chart .ylabels { grid-column: 1; grid-row: 1; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; justify-content: space-between; font-size: .75rem; line-height: 1; color: var(--muted); text-align: right; }
.chart .ylabels li { height: 0; display: flex; align-items: center; justify-content: flex-end; white-space: nowrap; }
.chart .xlabels { grid-column: 2; grid-row: 2; list-style: none; margin: .5rem 0 0; padding: 0; display: flex; justify-content: space-between; gap: .25rem; font-size: .75rem; line-height: 1.3; color: var(--muted); }
.chart .xlabels li { text-align: center; min-width: 0; }
.chart .xlabels li:first-child { text-align: left; }
.chart .xlabels li:last-child { text-align: right; }
.chart .line.s1, .chart .dot.s1, .chart .cap.s1 { stroke: var(--sage); }
.chart .line.s2, .chart .dot.s2, .chart .cap.s2 { stroke: var(--ink); }
/* Point marks on a stretched chart: zero-length lines with a fixed-width cap stay round (or square) at any scale. */
.chart .cap { stroke-width: 10; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart .cap.s2 { stroke-linecap: square; }
.chart .dot.s1 { fill: var(--sage); }
.chart .dot.s2 { fill: var(--ink); }
.chart .legend { list-style: none; margin: .5rem 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.chart .legend .key { display: inline-block; width: 28px; height: 10px; vertical-align: middle; }
.chart .empty { margin: 0; color: var(--muted); }
.chart-table { margin-top: .5rem; }
.chart-table summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--sage); font-weight: 500; }
.chart .num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar-list { list-style: none; margin: 0; padding: 0; }
.bar-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "bar bar"; gap: .15rem .75rem; margin-bottom: .75rem; }
.bar-label { grid-area: label; overflow-wrap: anywhere; }
.bar-value { grid-area: value; font-variant-numeric: tabular-nums; font-weight: 500; }
.chart .bar-svg { grid-area: bar; height: 12px; }
.bar-bg { fill: var(--track); }
.bar-fill { fill: var(--sage); }
.tiles { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: .25rem; padding: 1.25rem 1.5rem; background: var(--surface); box-shadow: var(--e1); border-radius: var(--r-card); }
.tile-label { color: var(--text); font-size: .875rem; font-weight: 500; }
.tile-value { font-size: 1.75rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.tile-change { font-size: .875rem; color: var(--text); }

.note { margin: 0 0 1rem; padding: .75rem 1rem; background: var(--surface); box-shadow: var(--e1); border-radius: var(--r-card); color: var(--ink); }
.muted { color: var(--muted); margin: 0 0 1rem; }
.area { margin-bottom: 2rem; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 16px; }
.cols > * { min-width: 0; }
.panel h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 .5rem; }

/* Content tabs: links inside tables stay 44px tall, long paths and queries wrap */
.table-wrap td a, .table-wrap th a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
.table-wrap.wide { margin-bottom: 1.5rem; }
.table-wrap td, .table-wrap th { overflow-wrap: anywhere; }
.table-wrap th[scope=col] { overflow-wrap: normal; }

/* Narrow content columns (phones, small tablets, 200% zoom, and laptops once the sidebar is in): every row becomes a labelled card, so all numbers are visible without
   sideways scrolling and no column gets squeezed until its words split. The labels are visual only; real table
   roles stay in the markup. */
@container (max-width: 55.99rem) {
  .table-wrap { overflow-x: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td, .table-wrap th { display: block; width: 100%; }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table-wrap tr { padding: .5rem 1rem; border-top: 1px solid var(--divider); }
  .table-wrap tbody tr:first-child { border-top: 0; }
  .table-wrap th, .table-wrap td { border: 0; padding: .25rem 0; }
  .table-wrap th[scope=row] { font-weight: 600; }
  .table-wrap td[data-label] { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; text-align: right; }
  .table-wrap td[data-label]::before { content: attr(data-label); flex: 0 0 auto; max-width: 50%; text-align: left; font-weight: 500; color: var(--muted); }
  /* Cells holding buttons or forms: label on its own line, controls get the full width */
  .table-wrap td[data-label]:has(button, form, .row), .table-wrap td[data-label].stack { display: block; text-align: left; }
  .table-wrap td[data-label]:has(button, form, .row)::before, .table-wrap td[data-label].stack::before { display: block; max-width: none; margin-bottom: .25rem; }
  /* The More menu needs no label of its own. */
  .table-wrap td.menu-cell::before { content: none; }
  .table-wrap td.menu-cell { padding-top: .5rem; }
  .table-wrap td button { white-space: nowrap; }
}
@container (min-width: 56rem) {
  .table-wrap.wide table { min-width: 36rem; }
  .table-wrap.wide th[scope=row] { min-width: 11rem; }
  .table-wrap.wide td { white-space: nowrap; }
}

/* Shared report parts the other pages still use (Traffic, Search, Passwords, reports). */
.empty { margin: 0; color: var(--muted); }
.small { font-size: .875rem; }
.strong { font-weight: 600; color: var(--ink); }
.quiet { color: var(--muted); }
.change { font-size: .8125rem; line-height: 1.3; }
.change.up { color: var(--pos); }
.change.down { color: var(--neg); }
.change.same { color: var(--muted); }
.plist { display: flex; flex-direction: column; padding: .5rem 1.5rem 1rem; background: var(--surface); box-shadow: var(--e1); border-radius: var(--r-list); }
.plist table { font-size: .90625rem; }
.plist caption { padding: .75rem 0 .375rem; }
.plist th, .plist td { padding: .6875rem 0; }
.plist th + th, .plist th + td, .plist td + td { padding-left: .75rem; }
.plist tbody th { font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.plist tbody th.quiet { font-weight: 400; color: var(--muted); }
.plist .end { text-align: right; }
.plist td.end { white-space: nowrap; }
.plist-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .625rem; border-top: 1px solid var(--divider); }
.plist-foot > span { font-size: .84375rem; color: var(--muted); }
.chip { display: inline-block; padding: 3px 8px; border-radius: var(--r-xs); background: var(--chip-bg); color: var(--chip-ink); font-weight: 500; white-space: nowrap; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 1rem;
  border-radius: var(--r-sm); border: 0; color: var(--ink); background: var(--surface-raised); box-shadow: var(--e1);
  font-size: .875rem; font-weight: 500; text-decoration: none; overflow-wrap: normal;
}
.pill:hover { background: var(--surface-sunken); }
.card h2 { margin: 0 0 .25rem; }
.mini-list, .event-list, .rank-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; justify-content: space-between; gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--divider); }
.mini-list + .pill, .card .empty + .pill { margin-top: .5rem; }
.who { font-weight: 500; color: var(--ink); }
.chip-text { color: var(--chip-ink); font-weight: 500; white-space: nowrap; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.stat-tile { padding: 1rem 1.125rem; }
.stat-tile .tile-value { font-size: 1.625rem; }
.tile-note { font-size: .8125rem; color: var(--muted); }
.kpi-area .note { margin: 0; }
.pair { gap: 1rem; }
.pair > .card { padding: 1.25rem; }
.rank-list li { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .25rem 0; border-top: 1px solid var(--divider); }
.rank { color: var(--muted); }
.rank-list a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: 500; text-decoration: none; }
.rank-list a:hover { text-decoration: underline; }
.bar-rows { display: flex; flex-direction: column; gap: .875rem; list-style: none; margin: 0; padding: 0; }
.bar-rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "bar bar"; gap: 6px .75rem; }
.bar-rows .bar-value { font-weight: 600; }
.bar-track { grid-area: bar; }
.track-bg { fill: var(--track); }
.track-fill { fill: var(--sage); }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: 1rem; }
.mini-stat { display: flex; flex-direction: column; gap: .25rem; }
.mini-value { font-size: 1.5rem; font-weight: 600; line-height: 1.2; color: var(--ink); }
.event-list li { display: flex; justify-content: space-between; gap: .75rem; padding: .625rem 0; border-top: 1px solid var(--divider); }
.when { color: var(--muted); white-space: nowrap; }
/* Traffic (src/pages/traffic.ts): the Overview's parts, one section per kind of number. */
.area > .sec-head { margin-bottom: .75rem; }
.sec-note { font-size: .875rem; color: var(--muted); }
.area > .muted.small { margin: -.25rem 0 .75rem; }
.area > .pair { margin-bottom: 0; }
.pair > .card > .sec-head { margin-bottom: .75rem; }
.pair > .card > .muted.small { margin: -.5rem 0 .75rem; }
.sub-head { margin: 1rem 0 .75rem; font-size: .9375rem; font-weight: 600; }
.kpis.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 64rem) {
  .kpis.half { max-width: calc(50% - 8px); }
  .span-8 { grid-column: span 8; }
}
.pair > .area { margin-bottom: 0; }
.pair > .area > .chart { margin: 0; }
/* Each Traffic card is its own container, so a table in a half-width card turns into labelled rows instead of
   hiding columns behind a sideways scroll. */
.area .pair > .card { container-type: inline-size; }
.card .table-wrap { border: 0; border-radius: 0; background: none; }
.card .table-wrap th, .card .table-wrap td { vertical-align: middle; }
.card .table-wrap tr > :first-child { padding-left: 0; }
.card .table-wrap tr > :last-child { padding-right: 0; }
.card .table-wrap tr { padding-left: 0; padding-right: 0; }
/* A chart inside a card is not a second box. Room above the plot so the top axis number clears the chart title. */
.card .chart { margin: 0; padding: 0; border: 0; background: none; }
.card .chart .plot { padding-top: .75rem; }
/* The 52-week trend: full width, a fixed height whatever the width. */
.trend { margin-bottom: 2rem; }
.card.trend { padding: 1.25rem; }
@media (min-width: 64rem) { .card.trend { padding: 1.5rem; } }
.trend > .sec-head { margin-bottom: .75rem; }
.chart.fixed .plot svg { height: 14rem; }
/* The keyword chart under its table in a full-width card: shorter, so it doesn't outweigh the table above it. */
.chart.fixed.short .plot svg { height: 10rem; }
/* "Home page" with its path under it, inside a 44px link row. */
.table-wrap th .muted { margin: 0; font-weight: 400; }
/* Short page-and-number tables in half-width cards stay one line per row (path left, number right) until the card is
   narrower than 18rem; below that they stack like every other table. Overrides the 55.99rem stacking above. */
@container (min-width: 18rem) {
  .table-wrap.pairs table { display: table; width: 100%; }
  .table-wrap.pairs thead { position: static; display: table-header-group; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal; }
  .table-wrap.pairs tbody { display: table-row-group; width: auto; }
  .table-wrap.pairs tr { display: table-row; width: auto; padding: 0; }
  .table-wrap.pairs th, .table-wrap.pairs td { display: table-cell; width: auto; padding: .375rem 0; border-top: 1px solid var(--divider); }
  .table-wrap.pairs th + td, .table-wrap.pairs th + th { padding-left: 1rem; }
  .table-wrap.pairs td.num, .table-wrap.pairs th.num { text-align: right; white-space: nowrap; }
  .table-wrap.pairs td[data-label]::before { content: none; }
}
.card .table-wrap.wide { margin-bottom: 0; }
.page-sub .sub-path { white-space: normal; overflow-wrap: anywhere; }
/* Search and AI (src/pages/search.ts): a chart under a table in the same card. */
.chart-gap { margin-top: 1.25rem; }
.mark { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .625rem; }
td .mark { margin: 0; }
.mark-toggle { min-height: 44px; padding: 0 .875rem 0 .625rem; color: var(--ink); background: var(--surface-raised); box-shadow: var(--e1); }
.mark-toggle:hover { background: var(--surface-sunken); color: var(--ink); }
.mark-box { flex: none; width: 1.125rem; height: 1.125rem; border: 2px solid var(--field); border-radius: 4px; background: var(--surface); }
.mark-toggle[aria-pressed="true"] { background: var(--chip-bg); color: var(--chip-ink); box-shadow: inset 0 0 0 1px rgb(43 106 55 / .35); }
.mark-toggle[aria-pressed="true"] .mark-box { border-color: var(--chip-ink); background: var(--chip-ink); position: relative; }
.mark-toggle[aria-pressed="true"] .mark-box::after { content: ""; position: absolute; left: 4px; top: 0; width: 5px; height: 10px; border: solid var(--on-sage); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.mark-when { font-size: .875rem; color: var(--muted); white-space: nowrap; }
.more summary { list-style: none; display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 1rem; border-radius: var(--r-sm); background: var(--surface-raised); box-shadow: var(--e1); color: var(--ink); font-weight: 500; cursor: pointer; white-space: nowrap; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: ""; width: .4rem; height: .4rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.more[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.more summary:hover { background: var(--surface-sunken); }
.more-menu { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.more-menu form { margin: 0; }
@container (min-width: 56rem) {
  .menu-cell { text-align: right; }
  .more-menu { justify-content: flex-end; }
}
.mark-toggle { white-space: nowrap; }
/* Admins: the role select with Save role, then the More menu (Reset password, Remove). */
.admin-change { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; }
.admin-change > form.row { flex-wrap: nowrap; margin: 0; }
.admins td.menu-cell { text-align: left; }
/* ---------- Passwords (src/pages/passwords.ts), per design-reset ab3 (1440), ab3b (Add person), ab4 (390), ab6 (the
   Make a password sheet). One page at a time behind the switch; rows lead with the name. ---------- */
.toolrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 20px; }
.seg-lg a { min-height: 44px; padding: 0 18px; font-size: .9375rem; }
.view-note { display: flex; align-items: center; gap: 8px; }
.view-note .icon { color: var(--muted); }

/* Password tags: the UI face with tabular figures, never monospace. The key shows only on the big one. */
.tag {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0; min-height: 30px; padding: 0 10px; border-radius: var(--r-xs);
  background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--hairline); color: var(--ink);
  font-size: .875rem; font-weight: 500; letter-spacing: .02em; font-variant-numeric: tabular-nums;
}
.tag > .icon { display: none; color: var(--muted); }
.tag .pw-text { overflow-wrap: anywhere; }
.tag-off { color: var(--muted); }
.tag-lg { min-height: 36px; padding: 0 12px; font-size: 1rem; }
.tag-xl { min-height: 56px; padding: 0 18px; gap: 12px; border-radius: 12px; font-size: 1.5rem; font-weight: 600; letter-spacing: .03em; }
.tag-xl > .icon { display: block; }
.pw-cell { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }

/* Copy: the icon turns into a check and "Copied" rises above it for 1.6s (admin.js); screen readers hear it too. */
.copy { position: relative; }
.copy .done, .copy-lg .done { display: none; }
.copy.is-copied, .copy-lg.is-copied { color: var(--success-ink); background: var(--success-bg); box-shadow: 0 0 0 1px rgb(43 106 55 / .2); }
.copy.is-copied > .icon:first-child, .copy-lg.is-copied > .icon:first-child { display: none; }
.copy.is-copied .done, .copy-lg.is-copied .done { display: block; animation: pop .18s var(--ease-out); }
.copied {
  display: none; position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); z-index: 5;
  padding: 5px 9px; border-radius: 7px; background: var(--ink); color: var(--cream); font-size: .78125rem; font-weight: 500; white-space: nowrap;
  box-shadow: 0 6px 16px -6px rgb(0 0 0 / .4); pointer-events: none;
}
.copied::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--ink); }
.copy.is-copied .copied { display: block; animation: fade-in .14s var(--ease-out); }
@keyframes pop { from { transform: scale(.8); } to { transform: none; } }

/* Summary strip: main password with Copy and Change, then three numbers between hairlines. */
.summary { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0 0 16px; }
.summary .k { display: flex; align-items: center; gap: 6px; margin: 0; font-size: .8125rem; font-weight: 500; color: var(--muted); }
.summary .v { margin: 8px 0 4px; font-size: 1.75rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; color: var(--ink); }
.summary .v.none { font-size: 1.125rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.summary .m { margin: 0; font-size: .8125rem; color: var(--muted); overflow-wrap: anywhere; }
.sm-main { padding: 14px 16px 12px; }
.sm-main .k .change-sm { margin-left: auto; }
.mainpw { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 8px 0 6px; }
.mainpw.none { color: var(--muted); font-size: .9375rem; }
.mainpw .change-lg { display: none; margin-left: 8px; }
.sm-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); box-shadow: inset 0 1px 0 var(--hairline); }
.sm-stats > div { padding: 12px 14px; min-width: 0; }
.sm-stats > div + div { box-shadow: inset 1px 0 0 var(--hairline); }
.sm-stats .k { font-size: .78125rem; line-height: 1.3; }
.sm-stats .v { margin: 4px 0 0; font-size: 1.125rem; letter-spacing: -.02em; white-space: nowrap; }
.sm-stats .m { display: none; }

/* People: search and All/Active/Off in the head, then the rows. */
.people { container-type: inline-size; container-name: people; }
.people:focus { outline: none; }
.people-head { flex-wrap: wrap; }
.people-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; width: 100%; }
.find { display: flex; gap: 8px; flex: 1 1 16rem; min-width: 0; margin: 0; }
.find .input-icon { flex: 1 1 auto; }
.find-go { flex: none; }
.seg-sm a { padding: 0 12px; }
.input-icon { position: relative; min-width: 0; }
.input-icon > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > input { padding-left: 40px; }
.input-icon > .trail { position: absolute; top: 0; right: 0; height: 100%; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.input-icon.search > input:not(:placeholder-shown) { padding-right: 44px; }
.pw-input > input { padding-right: 7.5rem; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.empty.pad { padding: 4px 24px 20px; }
.info { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 0; font-size: .8125rem; color: var(--muted); }
.info .icon { margin-top: 1px; }
.info + .info { margin-top: 6px; }
/* Rows 12px apart: each .link reaches 6px past its line to be 44px tall, so wrapped rows must not overlap. */
.foot-links { display: flex; flex-wrap: wrap; gap: 12px 20px; margin: 16px 0 0; }

/* The rows. On a phone each row is a small card: name and use, then the tag, the badges and "…" (ab4). */
.pwt .tag { white-space: nowrap; }
.ptable.pwt tbody td.c-pw, .ptable.rtable tbody td:nth-child(2) { text-align: left; }
.pwt .tag .pw-text { overflow-wrap: normal; }
.menu-pop { text-align: left; }
.pwt tbody th { font-weight: 400; }
.pwt .badge .icon { margin: 0; }
.pwt .c-sig { white-space: nowrap; }
.sig-when { margin-left: 8px; font-size: .8125rem; color: var(--muted); }
.notyet { color: var(--muted); font-size: .875rem; }
.sm-only { display: none; }
.pwt tbody tr:has(details[open]) { background-color: var(--sage-tint); }
.row-menu .menu-head { display: flex; flex-direction: column; gap: 2px; max-width: 18rem; padding: 8px 10px 6px; font-size: .78125rem; color: var(--muted); font-weight: 500; overflow-wrap: anywhere; }
.row-menu .mh-name { color: var(--muted); }
.row-menu .mh-sub { font-weight: 400; }
.row-menu .menu-head + * { margin-top: 2px; }
.pwt .c-menu { width: 68px; text-align: right; }
@container people (min-width: 56rem) {
  .people-tools { width: auto; flex: 0 1 auto; flex-wrap: nowrap; }
  .find { flex: 0 1 20rem; }
  .ptable.pwt thead th.c-pw { width: 220px; text-align: left; }
  .ptable.pwt thead th.c-sig { width: 230px; text-align: left; }
  .ptable.pwt thead th.c-st { width: 110px; text-align: left; }
  .ptable.pwt thead th.c-menu { width: 68px; }
  .people-tools .seg { flex: none; flex-wrap: nowrap; }
}
@container people (max-width: 55.99rem) {
  .pwt, .pwt tbody { display: block; }
  .pwt thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pwt tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 8px; padding: 14px 16px; }
  .pwt tbody tr + tr { background-image: linear-gradient(var(--hairline), var(--hairline)); background-repeat: no-repeat; background-size: calc(100% - 32px) 1px; background-position: 16px 0; }
  .pwt tbody tr + tr > * { background-image: none; }
  .pwt tbody tr > *, .pwt tr > :first-child, .pwt tr > :last-child { display: block; height: auto; padding: 0; }
  /* Name and use on line one with the menu at the right; the tag and Copy, then the badges, wrap below. */
  .pwt tbody th { order: 1; flex: 1 1 calc(100% - 52px); min-width: 0; }
  .pwt .c-menu { order: 2; flex: none; width: auto; align-self: flex-start; margin: -6px -10px 0 0; }
  .pwt .c-pw, .ptable.pwt tbody td.c-pw { order: 3; flex: 0 0 auto; width: auto; max-width: 100%; }
  .pwt .c-sig { order: 4; margin-left: auto; }
  .pwt .c-st { order: 5; margin-left: auto; }
  .pwt .c-sig:has(.notyet) { display: none; }
  .pwt .c-sig:not(:has(.notyet)) ~ .c-st { margin-left: 0; }
  .pwt .nm.trunc { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
  .sig-when, .lg-only { display: none; }
  .sm-only { display: inline; }
  .people .ph-head, .people .lf { padding-left: 16px; }
  .people .ph-head { padding-right: 16px; }
  .pwt .tag { min-height: 32px; white-space: normal; }
  .pwt .tag .pw-text { overflow-wrap: anywhere; }
}

/* Add person and Change main password: an inline panel under the switch, no modal; ?add=1 without script. */
.addpanel { margin: 0 0 16px; box-shadow: var(--e2); container-type: inline-size; container-name: addp; overflow: hidden; }
.ap-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 0; }
.ap-head h2 { margin: 0; font-family: var(--display); font-size: 1.5rem; font-weight: 500; letter-spacing: -.01em; line-height: 1.2; }
.pf-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px; }
.pf-body .field { margin: 0; }
.pf-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 16px; background: var(--surface-sunken); box-shadow: inset 0 1px 0 var(--hairline); }
.pf-foot .actions { gap: 8px; margin-left: auto; }
.pf-for { margin: 0; padding: 0; border: 0; min-width: 0; }
.pf-for legend { padding: 0; margin: 0 0 6px; font-size: .8125rem; font-weight: 500; color: var(--ink); }
/* Three pages: each column is at least its longest word wide, so "onboarding" never splits on a phone. */
.seg-radio { display: grid; grid-template-columns: repeat(3, minmax(min-content, 1fr)); padding: 4px; }
.seg-opt { position: relative; display: flex; margin: 0; font-size: .875rem; font-weight: 500; color: var(--muted); cursor: pointer; }
.seg-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg-opt span { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 40px; padding: 4px 8px; border-radius: 7px; text-align: center; transition: background-color .12s var(--ease), box-shadow .12s var(--ease), color .12s var(--ease); }
.seg-opt:hover span { color: var(--ink); }
.seg-opt input:checked + span { background: var(--surface-raised); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgb(22 29 24 / .08), 0 2px 4px -1px rgb(22 29 24 / .06); }
.seg-opt input:focus-visible { box-shadow: none !important; }
.seg-opt input:focus-visible + span { box-shadow: var(--ring); }
.seg-opt input[aria-invalid="true"] + span { color: var(--danger-ink); }
.pf-contact { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px; border-radius: var(--r-md); background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--hairline); }
.pf-contact .oh { display: flex; gap: 10px; align-items: flex-start; }
.pf-contact .oh > .icon { color: var(--sage); margin-top: 2px; }
.oh-title { margin: 0 0 2px; font-size: .875rem; font-weight: 500; color: var(--ink); }
.opt { font-weight: 400; color: var(--muted); }
/* Email and Phone are for the recruit page only (its radio carries data-recruit): hidden while any other page (or
   nothing) is chosen, unless they hold an error to fix. Without :has() support they simply always show, and the server
   keeps the rule. */
.pf:has(.pf-for):not(:has(input[name="gate"][data-recruit]:checked)) .pf-contact:not(:has([aria-invalid="true"])) { display: none; }
.pf-disclose { padding: 0; background: none; box-shadow: none; gap: 12px; }
.pf-disclose > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 4px; color: var(--sage); font-size: .90625rem; font-weight: 500; cursor: pointer; list-style: none; border-radius: var(--r-sm); }
.pf-disclose > summary::-webkit-details-marker { display: none; }
.pf-disclose > summary:hover { background: var(--sage-tint); }
.pf-disclose[open] > summary .icon { transform: rotate(45deg); }
.check-field .check { align-items: flex-start; font-size: .9375rem; font-weight: 400; color: var(--text); }
.form-panel { max-width: 40rem; }
@container addp (min-width: 40rem) {
  .ap-head { padding: 20px 24px 0; }
  .pf-body { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding: 20px 24px 24px; }
  .pf-body > .pf-for, .pf-body > .pf-contact, .main-form .pf-body > .field { grid-column: 1 / -1; }
  .pf-panel .pf-for { max-width: calc(50% - 10px); }
  .pf-contact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; padding: 18px 20px; }
  .pf-contact .oh { grid-column: 1 / -1; }
  .pf-foot { padding: 14px 24px; }
  .main-form .pf-body > .field:first-child { max-width: calc(50% - 10px); }
}

/* Make a password: a sheet from the bottom on a phone (admin.js puts this markup in a <dialog>), a centered card on a
   desk; without script it is a page of its own. Success becomes "<Name> can get in" in place. */
.sheet-page { display: flex; justify-content: center; padding-top: 8px; }
.sheet-card { width: 100%; max-width: 30rem; padding: 20px 20px 24px; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--e2); color: var(--text); }
.sheet-card .sh-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.sheet-card .sh-head h1 { margin: 0; font-size: 1.625rem; line-height: 1.15; letter-spacing: -.015em; }
.sheet-card .sh-head .btn-icon { margin-right: -10px; }
.sheet-card .pf-body { padding: 8px 0 0; }
.sheet-card .pf-foot { padding: 16px 0 0; background: none; box-shadow: none; }
.sheet-card .pf-foot .btn { margin-left: 0; }
.sheet-card .pw-input > input { padding-right: 48px; font-size: 1.0625rem; }
.sheet-card .trail-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sheet-card .trail { width: 44px; padding: 0; }
.sheet-card .flash { margin: 0 0 8px; }
.made { text-align: center; }
.success-mark { display: grid; place-items: center; width: 64px; height: 64px; margin: 8px auto 14px; border-radius: 20px; background: radial-gradient(circle at 30% 25%, #3e5040, var(--deep)); box-shadow: 0 12px 28px -10px rgb(36 48 38 / .6); }
.success-mark .spark path { fill: var(--cream); }
.made h1 { margin: 0; font-size: 1.75rem; line-height: 1.15; letter-spacing: -.015em; overflow-wrap: anywhere; }
.made-lede { max-width: 30ch; margin: 8px auto 18px; color: var(--muted); font-size: .90625rem; }
.made-pw { display: flex; justify-content: center; }
.made-pw .tag-xl { max-width: 100%; }
.made-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 22px 0 8px; }
.made-actions .btn { padding: 0 .75rem; }
.made-actions:has(.copy-lg[hidden]) { grid-template-columns: minmax(0, 1fr); }
.made .btn-quiet { width: 100%; }
dialog.sheet-dialog {
  position: fixed; inset: auto 0 0 0; width: 100%; max-width: none; max-height: calc(100dvh - 24px); margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--text); overflow: visible;
}
dialog.sheet-dialog::backdrop { background: rgb(22 29 24 / .38); animation: fade-in .28s var(--ease-out); }
dialog.sheet-dialog[open] { animation: sheet-in .28s var(--ease-out); }
dialog.sheet-dialog .sheet-card { max-width: none; max-height: calc(100dvh - 24px); overflow-y: auto; padding: 10px 20px max(24px, env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; box-shadow: 0 -20px 50px -20px rgb(0 0 0 / .4); }
dialog.sheet-dialog .sheet-card::before { content: ""; display: block; width: 40px; height: 5px; margin: 0 auto 14px; border-radius: 9px; background: #d3d0c6; }
.sheet-toast { top: 16px; bottom: auto; }
@media (min-width: 64rem) { .sheet-toast { top: 24px; bottom: auto; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (min-width: 40rem) {
  dialog.sheet-dialog { inset: 0; margin: auto; width: min(30rem, calc(100% - 32px)); height: fit-content; }
  dialog.sheet-dialog .sheet-card { border-radius: var(--r-xl); padding: 24px 24px 24px; box-shadow: var(--e3); }
  dialog.sheet-dialog .sheet-card::before { display: none; }
}
@container wrap (min-width: 40rem) {
  .sheet-page { padding-top: 24px; }
  .sheet-card { padding: 28px 28px 24px; }
}

/* Desktop arrangement (ab3). */
@container wrap (min-width: 40rem) {
  .summary { grid-template-columns: minmax(0, 1.7fr) minmax(0, 3.2fr); }
  .sm-main { padding: 20px 24px; }
  .sm-main .k .change-sm { display: none; }
  .mainpw { margin: 10px 0 8px; }
  .mainpw .change-lg { display: inline-flex; }
  .sm-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); box-shadow: inset 1px 0 0 var(--hairline); }
  .sm-stats > div { padding: 20px 24px; }
  .sm-stats .k { font-size: .8125rem; }
  .sm-stats .v { margin: 8px 0 4px; font-size: 1.75rem; letter-spacing: -.03em; }
  .sm-stats .m { display: block; }
}
@container wrap (max-width: 39.99rem) {
  .page-switch { display: grid; grid-template-columns: repeat(3, minmax(min-content, 1fr)); width: 100%; }
  .page-switch a { width: 100%; padding: 4px 6px; white-space: normal; overflow-wrap: normal; text-align: center; line-height: 1.25; }
  .page-switch .count { display: none; }
  .pw-head .page-sub { display: none; }
  .sm-stats .v { white-space: normal; }
  .pw-head { margin: 0; }
  .toolrow { margin-bottom: 16px; }
}
@container wrap (max-width: 22rem) {
  .sm-stats .v { font-size: 1rem; }
  .sm-stats > div { padding: 12px 10px; }
}

/* ---------- Reports in the kit (design reset phase 3): Traffic, a page's details, Articles, Search and AI. Sections
   40px apart, panels with a heading row, the Overview's bars and key-number strip, list rows for two columns, the
   table row style for three or more, and charts drawn in the hero's language on the light surface. ---------- */
.area { margin: 40px 0 0; }
.datebar ~ .area:first-of-type, .page-note + .area { margin-top: 0; }
.area > .sec-head { margin: 0 0 12px; }
.area-note { margin: -4px 0 12px; font-size: .8125rem; color: var(--muted); }
.area > .area-note { margin-top: -6px; }
.page-note { display: flex; gap: 8px; align-items: flex-start; margin: -16px 0 32px; font-size: .8125rem; color: var(--muted); }
.page-note .icon { margin-top: 1px; color: var(--muted); }
/* Under the phone's date pill (8px below it), the note's -16px pull-up would slide it under the pill. */
@media (max-width: 63.99rem) { .datebar-phone + .page-note { margin-top: 4px; } }
.area + .hero, .area + .kpi-area { margin-top: 40px; }
.hero + .kpi-area { margin-top: 16px; }
.kpi-area + .grid-12 { margin-top: 16px; }
.kpi-area + .area { margin-top: 40px; }
.grid-12.pair { gap: 16px; }
.back { margin: -8px 0 4px; }
a.go {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-left: -10px; padding: 0 12px 0 14px; border-radius: var(--r-sm);
  color: var(--text); font-size: .875rem; font-weight: 500; text-decoration: none;
}
a.go::before { content: ""; flex: none; width: 7px; height: 7px; border: solid currentColor; border-width: 0 0 1.75px 1.75px; transform: rotate(45deg); }
a.go:hover { background: var(--sage-tint); color: var(--ink); }

/* A report panel: its heading row, then content inset 24px (16px on phones); tables and row lists run edge to edge. */
.dp { container-type: inline-size; padding-bottom: 4px; }
.dp > .panel-note { margin: -4px 24px 12px; }
.dp > .panel-lede { margin: 0 24px 4px; font-size: .9375rem; color: var(--text); }
.dp > .bar-rows { margin: 4px 24px 20px; gap: 16px; }
.dp .bar-rows li { gap: 6px 12px; font-size: .875rem; }
.dp .bar-label { color: var(--text); }
.dp .bar-value { font-weight: 600; color: var(--ink); }
.dp .bar-track { height: 6px; border-radius: 999px; }
.dp > .empty, .dp > .note, .dp > p.stale { margin: 0 24px 20px; padding: 0; background: none; box-shadow: none; border-radius: 0; color: var(--muted); font-size: .90625rem; }
.dp > .sub-head { margin: 8px 24px 12px; font-size: .875rem; font-weight: 600; letter-spacing: -.005em; color: var(--ink); }
.dp > .chart { padding: 4px 24px 16px; }
.dp > .chart:first-child { padding-top: 20px; }
.dp > .chart-gap, .dp > .table-wrap + .chart-gap { margin: 0; padding: 8px 24px 16px; box-shadow: inset 0 1px 0 var(--hairline); }
.state-panel { padding: 20px 24px; }
.state-panel > .note { margin: 0; }
.missing { max-width: 40rem; }
.missing .empty-state { padding: 40px 24px; }
.kind { color: var(--text); font-size: .875rem; }

/* Two-column lists (top pages, where visits started): the name, or its link, then the number. */
.nrows { padding: 0 0 4px; }
.nrows .lrow { grid-template-columns: minmax(0, 1fr) auto; min-height: 52px; padding-top: 4px; padding-bottom: 4px; }
.nr-name { display: flex; flex-direction: column; min-width: 0; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.nr-name a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; }
.nr-name a:hover { text-decoration: underline; text-underline-offset: .2em; }
.nr-name a + .nr-sub { margin-top: -10px; padding-bottom: 4px; }
.nr-sub { font-size: .8125rem; font-weight: 400; color: var(--muted); }
.nr-v { font-weight: 600; color: var(--ink); text-align: right; white-space: nowrap; }

/* Key-number strips of two (Right now, New and returning, AI answers): half the width on wide columns. */
.keys.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.keys.k2 .key:nth-child(2) { box-shadow: inset 1px 0 0 var(--hairline); }
.keys.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.key .m { overflow-wrap: anywhere; }
@container wrap (min-width: 40rem) {
  .keys.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .keys.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container wrap (min-width: 56rem) { .keys.k2 { max-width: calc(50% - 8px); } }

/* The table row style (src/ui/table.ts and every chart's "Show as a table"): a sunken header row, 56px rows, hairlines
   inset 24px, no zebra, no vertical rules; hover lifts a row to the sunken fill. Tables live inside panels now. */
.table-wrap { overflow-x: auto; background: none; box-shadow: none; border-radius: 0; }
.table-wrap.wide { margin-bottom: 0; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .9375rem; color: var(--text); }
.table-wrap thead th {
  height: 36px; padding: 0 12px; border: 0; vertical-align: middle; white-space: nowrap;
  background: var(--surface-sunken); box-shadow: inset 0 1px 0 var(--hairline), inset 0 -1px 0 var(--hairline);
  font-size: .8125rem; font-weight: 500; color: var(--muted);
}
.table-wrap th, .table-wrap td { padding: 14px 12px; border: 0; vertical-align: middle; }
.table-wrap tr > :first-child { padding-left: 24px; }
.table-wrap tr > :last-child { padding-right: 24px; }
.table-wrap tbody th[scope=row] { font-weight: 500; color: var(--ink); }
.table-wrap td.num { color: var(--ink); }
.table-wrap tbody tr + tr > * { background-image: linear-gradient(var(--hairline), var(--hairline)); background-repeat: no-repeat; background-size: 100% 1px; background-position: 0 0; }
.table-wrap tbody tr + tr > :first-child { background-size: calc(100% - 24px) 1px; background-position: 24px 0; }
.table-wrap tbody tr + tr > :last-child { background-size: calc(100% - 24px) 1px; }
.table-wrap tbody tr { transition: background-color .12s var(--ease); }
.table-wrap tbody tr:hover { background-color: var(--surface-sunken); }
.table-wrap td a, .table-wrap th a { color: var(--ink); font-weight: 500; text-decoration: none; }
.table-wrap td a:hover, .table-wrap th a:hover { text-decoration: underline; text-underline-offset: .2em; }
.table-wrap .nr-sub { display: block; }
.table-wrap a + .nr-sub { margin-top: -8px; }
.table-wrap .badge { vertical-align: middle; }
/* Narrow panels: each row is a small card, the row's name first, then each value with its column's name. */
@container (max-width: 55.99rem) {
  .table-wrap tr, .table-wrap tbody tr { padding: 12px 24px; border: 0; }
  .table-wrap tbody tr + tr { background: linear-gradient(var(--hairline), var(--hairline)) no-repeat 24px 0 / calc(100% - 48px) 1px; }
  .table-wrap tbody tr + tr > * { background-image: none; }
  .table-wrap tbody tr:hover { background-color: transparent; }
  .table-wrap tbody tr + tr:hover { background: linear-gradient(var(--hairline), var(--hairline)) no-repeat 24px 0 / calc(100% - 48px) 1px; }
  .table-wrap th, .table-wrap td, .table-wrap tr > :first-child, .table-wrap tr > :last-child { padding: 3px 0; }
  .table-wrap th[scope=row] { padding-bottom: 6px; font-weight: 500; color: var(--ink); }
  .table-wrap td[data-label] { align-items: center; min-height: 28px; font-size: .875rem; }
  .table-wrap td[data-label]::before { font-size: .8125rem; font-weight: 400; color: var(--muted); }
}
.chart-table .table-wrap { margin-top: 8px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--hairline); }
.chart-table .table-wrap thead th:first-child { border-top-left-radius: var(--r-md); }
.chart-table .table-wrap thead th:last-child { border-top-right-radius: var(--r-md); }
.hero .chart-table .table-wrap { box-shadow: none; }

/* Line charts on light panels, in the hero's language: a smooth line over a soft fill, hairline gridlines, 12px axis
   text with the latest day in ink, the latest point lifted with a halo, and the latest number as a quiet note. */
.chart { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; column-gap: 12px; margin: 0; padding: 0; background: none; box-shadow: none; border-radius: 0; color: var(--ink); }
.chart > :not(figcaption):not(.ctip) { grid-column: 1 / -1; }
.chart figcaption { margin: 0 0 8px; font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; color: var(--ink); }
.ph-head ~ .chart figcaption { font-size: .8125rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.ctip { display: flex; flex-direction: column; align-items: flex-end; margin: 0; padding: 6px 10px; border-radius: 10px; background: var(--surface-raised); box-shadow: var(--e2); line-height: 1.25; text-align: right; }
.ct1 { font-size: .9375rem; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.ct2 { font-size: .75rem; color: var(--muted); }
.chart .plot { padding-top: 14px; column-gap: 10px; }
.chart .grid { stroke: rgb(31 38 32 / .09); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .ylabels, .chart .xlabels { font-size: .75rem; font-weight: 500; color: var(--muted); }
.chart .xlabels { margin-top: 10px; }
.chart .xlabels .now { color: var(--ink); font-weight: 600; }
.chart .line { stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart .line.s1, .chart .cap.s1 { stroke: var(--sage); }
.chart .line.s2, .chart .cap.s2 { stroke: var(--muted); }
.chart .area { stroke: none; }
.chart .g0 { stop-color: #5d7a60; stop-opacity: .22; }
.chart .g1 { stop-color: #5d7a60; stop-opacity: 0; }
.chart .dot.s1 { fill: var(--surface); stroke: var(--sage); stroke-width: 2; }
.chart .dot.s2 { fill: var(--surface); stroke: var(--muted); stroke-width: 2; }
.chart .cap { stroke-width: 6; }
.chart .dense .dot, .chart .dense .cap { display: none; }
.chart .dot-halo { fill: var(--sage); fill-opacity: .14; }
.chart .dot-now { fill: var(--sage); stroke: var(--surface); stroke-width: 2; }
.chart .cap-halo { stroke: var(--sage); stroke-opacity: .16; stroke-width: 20; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart .cap-now { stroke: var(--sage); stroke-width: 9; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart .legend { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 10px 0 0; padding: 0; list-style: none; font-size: .8125rem; color: var(--muted); }
.chart .legend li { display: inline-flex; align-items: center; gap: 8px; }
.chart > p:not(.ctip) { margin: 0; color: var(--text); font-family: var(--display); font-size: 1.125rem; line-height: 1.45; }
.chart-table { margin-top: 8px; }
/* The bars mark is drawn by CSS (a mask in the text color), so a chart with no plot carries no picture at all. */
.chart .chart-table > summary.btn::before { content: ""; flex: none; width: 16px; height: 16px; background: currentColor; -webkit-mask: url(/assets/img/table-bars.svg) center / 16px no-repeat; mask: url(/assets/img/table-bars.svg) center / 16px no-repeat; }
.area + .trend, .kpi-area + .trend { margin-top: 40px; }
.chart-table > summary { width: fit-content; margin-left: -12px; list-style: none; }
.chart-table > summary::-webkit-details-marker { display: none; }
.chart-table[open] > summary { color: var(--ink); }
.chart .empty { color: var(--muted); }
@container wrap (max-width: 39.99rem) {
  .dp > .panel-note, .dp > .panel-lede, .dp > .empty, .dp > .note, .dp > p.stale, .dp > .sub-head { margin-left: 16px; margin-right: 16px; }
  .dp > .bar-rows { margin-left: 16px; margin-right: 16px; }
  .dp > .chart, .dp > .chart-gap { padding-left: 16px; padding-right: 16px; }
  .state-panel { padding: 16px; }
  .area { margin-top: 32px; }
  .area + .hero, .area + .kpi-area, .kpi-area + .area { margin-top: 32px; }
}
@container wrap (max-width: 39.99rem) {
  @container (max-width: 55.99rem) {
    .table-wrap tr, .table-wrap tbody tr { padding-left: 16px; padding-right: 16px; }
    .table-wrap tbody tr + tr, .table-wrap tbody tr + tr:hover { background-position: 16px 0; background-size: calc(100% - 32px) 1px; }
  }
}

/* ---------- Running it (design reset phase 4): Admins, Activity, Vital, More, the confirm screens, not found. ---------- */
.info a { font-weight: 500; }
.info > span { min-width: 0; }

/* Admins: one row per person at 1440 (name, email, last sign-in, role with Save, "…"); small cards on narrow columns. */
.adm { container-type: inline-size; container-name: adm; overflow: visible; }
.admt { table-layout: fixed; }
.admt tbody th { font-weight: 400; }
.admt .trunc { display: block; overflow-wrap: anywhere; }
.ptable.admt td.c-email { color: var(--text); text-align: left; }
.ptable.admt th.c-email { text-align: left; }
.admt .c-when { color: var(--text); font-size: .875rem; font-variant-numeric: tabular-nums; }
.admt .role-fixed { display: block; color: var(--ink); font-weight: 500; white-space: nowrap; }
.admt .c-role .sub { display: block; font-size: .8125rem; color: var(--muted); }
.role-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.role-form select { width: 9.5rem; flex: none; }
.role-form .btn { flex: none; }
.admt .c-menu { width: 68px; text-align: right; }
.admt tbody tr:has(details[open]) { background-color: var(--sage-tint); }
@container adm (min-width: 52rem) {
  .ptable.admt thead th.c-email, .ptable.admt td.c-email { width: 30%; text-align: left; }
  .admt thead th.c-when { width: 172px; }
  .admt thead th.c-role { width: 236px; }
  .admt thead th.c-menu { width: 68px; }
  .admt tbody tr { height: 64px; }
}
@container adm (max-width: 51.99rem) {
  .admt, .admt tbody { display: block; }
  .admt thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .admt tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name menu" "email email" "when when" "role role"; gap: 2px 8px; padding: 14px 16px; }
  .admt tbody tr + tr { background: linear-gradient(var(--hairline), var(--hairline)) no-repeat 16px 0 / calc(100% - 32px) 1px; }
  .admt tbody tr + tr > * { background-image: none; }
  .admt tbody tr > *, .admt tr > :first-child, .admt tr > :last-child { display: block; height: auto; padding: 0; }
  .admt tbody th { grid-area: name; min-width: 0; }
  .admt .c-menu { grid-area: menu; width: auto; margin: -6px -10px 0 0; }
  .admt .c-email, .ptable.admt td.c-email { grid-area: email; width: auto; padding-left: 44px; font-size: .875rem; } /* not the 164px of a second column */
  .admt .c-when { grid-area: when; padding-left: 44px; font-size: .8125rem; color: var(--muted); }
  .admt .c-when .nowrap::before { content: "Last sign-in: "; }
  .admt .c-role { grid-area: role; padding: 8px 0 0 44px; }
  .admt .nm.trunc { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
  .admt .trunc { white-space: normal; overflow-wrap: anywhere; }
  .role-form select { width: auto; flex: 1 1 8rem; min-width: 0; }
  .adm .ph-head { padding-left: 16px; padding-right: 16px; }
}
/* The temporary password, shown once: the success mark, what to do with it, the password and Copy. */
.secret { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; margin: 0 0 16px; padding: 20px 24px; box-shadow: var(--e2); }
.secret .success-mark { width: 48px; height: 48px; margin: 0; border-radius: 14px; }
.secret h2 { margin: 2px 0 4px; font-family: var(--display); font-size: 1.375rem; font-weight: 500; letter-spacing: -.01em; overflow-wrap: anywhere; }
.secret p { margin: 0; color: var(--muted); font-size: .90625rem; }
.secret .mainpw { margin: 12px 0 0; }
@container wrap (max-width: 39.99rem) { .secret { grid-template-columns: minmax(0, 1fr); padding: 16px; } }

/* Activity: one panel; each Central day a heading band, then rows with an icon, who and what, and the time. */
.log { padding-bottom: 0; overflow: hidden; }
.act-day { margin: 0; padding: 10px 24px; background: var(--surface-sunken); box-shadow: inset 0 1px 0 var(--hairline), inset 0 -1px 0 var(--hairline); font-size: .8125rem; font-weight: 600; letter-spacing: 0; color: var(--text); }
.log > .act-day:first-child { box-shadow: inset 0 -1px 0 var(--hairline); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.act { grid-template-columns: auto minmax(0, 1fr) auto; min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
.act .fi { color: var(--sage); }
.act .fi.rm { background: var(--danger-bg); color: var(--danger-ink); }
.act-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
.act-line { color: var(--text); }
.act-line .who { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
/* The words are stored as a label ("Added admin"); after the name they read as a sentence ("Owner added admin"). */
.act-what { display: inline-block; }
.act-what::first-letter { text-transform: lowercase; }
.act .sub { font-size: .8125rem; color: var(--muted); overflow-wrap: anywhere; }
.act .when { align-self: center; font-size: .875rem; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.log .lf { justify-content: space-between; }
.pager-links { display: flex; gap: 4px; }
.log > .empty-state { padding: 48px 24px; }
@container wrap (max-width: 39.99rem) {
  .act-day { padding: 10px 16px; }
  .act { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "icon txt" "icon when"; row-gap: 2px; }
  .act .fi { grid-area: icon; align-self: start; }
  .act .act-txt { grid-area: txt; }
  .act .when { grid-area: when; align-self: start; font-size: .8125rem; color: var(--muted); }
}

/* Vital: a calm connect card (a mark, what it does, the state, the form), then who is connected. */
.vconnect { margin: 0 0 16px; padding: 24px; }
.vc-head { display: flex; gap: 16px; align-items: flex-start; }
.vc-mark { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 14px; background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--hairline); color: var(--sage); }
.vc-head h2 { margin: 2px 0 4px; font-family: var(--display); font-size: 1.5rem; font-weight: 500; letter-spacing: -.01em; line-height: 1.2; }
.vc-head .hint { max-width: 52ch; }
.vc-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 20px 0 0; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--hairline); }
.vc-until { font-size: .9375rem; font-weight: 500; color: var(--ink); }
.vc-body { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.vc-body.live { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
.vc-form { display: flex; flex-direction: column; gap: 16px; max-width: 26rem; }
.vc-form .field { margin: 0; }
.vc-actions { display: flex; gap: 8px; }
.vc-re { flex: 0 1 auto; }
.vc-re[open] { flex: 1 1 100%; order: 1; }
.vc-state { max-width: 40rem; }
.vwho th[scope=row] .nm.trunc { max-width: 16rem; }
.vc-re > summary { width: fit-content; list-style: none; }
.vc-re > summary::-webkit-details-marker { display: none; }
.vc-re[open] > summary { margin-bottom: 16px; }
.vc-off { margin: 0; }
.choices { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; }
.choices legend { padding: 0; margin: 0 0 4px; font-size: .8125rem; font-weight: 500; color: var(--ink); }
.choice { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: var(--r-sm); background: var(--surface-raised); box-shadow: var(--e1); font-size: .9375rem; font-weight: 500; cursor: pointer; }
.choice:has(input:checked) { box-shadow: 0 0 0 2px var(--sage); background: var(--sage-tint); }
.vwho { max-width: none; }
.state-note { display: block; margin-top: 4px; font-size: .8125rem; color: var(--muted); }
.vnotes { display: flex; flex-direction: column; gap: 6px; padding: 14px 24px 18px; box-shadow: inset 0 1px 0 var(--hairline); }
.vconnect .vnotes { margin: 20px -24px -24px; }
.vnote { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: .8125rem; color: var(--muted); }
.vnote .icon { margin-top: 1px; }
@container wrap (max-width: 39.99rem) {
  .vconnect { padding: 16px; }
  .vconnect .vnotes { margin: 16px -16px -16px; }
  .vnotes { padding: 12px 16px 16px; }
  .vc-head h2 { font-size: 1.3125rem; }
  .vc-mark { width: 40px; height: 40px; border-radius: 12px; }
}

/* Phone "More": who is signed in, then two groups of 56px rows with icon tiles and a chevron. */
.more-who { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 16px; }
.more-who .av { width: 40px; height: 40px; font-size: .875rem; }
.mw-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.mw-name { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.mw-role { font-size: .8125rem; color: var(--muted); }
.more-list { margin: 0 0 16px; padding: 4px 0; list-style: none; overflow: hidden; }
.more-list li + li { box-shadow: none; }
.more-list li + li > a, .more-list li + li > form > button { background-image: linear-gradient(var(--hairline), var(--hairline)); background-repeat: no-repeat; background-size: calc(100% - 64px) 1px; background-position: 64px 0; }
.more-list a, .more-list button.plain { min-height: 56px; gap: 12px; padding: 0 12px 0 16px; border-radius: 0; font-weight: 500; }
.more-list a:hover, .more-list button.plain:hover { background-color: var(--surface-sunken); }
.mi { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--hairline); color: var(--sage); }
.more-list .mi .icon { color: var(--sage); }
.ml { flex: 1; min-width: 0; text-align: left; }
.more-list .mc { color: var(--muted); }

/* "Are you sure": one focused panel, a red mark, the question, what happens, the one red button and Cancel. */
.confirm { max-width: 36rem; padding: 28px; border-radius: var(--r-xl); box-shadow: var(--e2); }
.confirm-mark { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 0 16px; border-radius: 14px; background: var(--danger-bg); color: var(--danger-ink); }
.confirm h1 { margin: 0 0 10px; font-size: 1.875rem; line-height: 1.15; overflow-wrap: anywhere; }
.confirm p { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.confirm .actions { margin-top: 24px; gap: 8px; }
.confirm button[type=submit], .confirm button[type=submit]:hover { border: 0; }
.confirm button[type=submit] { background: var(--danger-ink); }
.confirm button[type=submit]:hover { background: #8c2918; }
@container wrap (max-width: 39.99rem) {
  .confirm { padding: 20px 16px; }
  .confirm h1 { font-size: 1.5rem; }
  .confirm .actions { flex-direction: column; align-items: stretch; }
}

/* Not found (signed out): the error code as a quiet line over the title. */
.solo-code { margin: 0 0 6px; font-size: .8125rem; font-weight: 600; letter-spacing: .02em; color: var(--muted); }

/* Checkboxes and radios: a 24px box inside a 44px label target, the box on the first line of its words. */
input[type="checkbox"], input[type="radio"], .check input, .check-field .check input { width: 24px; height: 24px; flex: none; margin: 0; }
.check { align-items: flex-start; gap: 12px; min-height: 44px; padding: 10px 0; cursor: pointer; }
.check > span { padding-top: 1px; line-height: 1.45; }
.check-field .check input { margin-top: 0; }

/* ---------- Motion: quick and quiet; one authored moment, the newest unlock drawing its spark. ---------- */
.tick.new { animation: tick-in .6s var(--ease-out) both; }
.tick.new .tsp path { stroke: #3f8a52; stroke-width: 1.4; stroke-dasharray: 80; stroke-dashoffset: 80; fill-opacity: 0; animation: spark-draw .6s var(--ease-out) forwards, spark-fill .2s .45s var(--ease-out) forwards; }
@keyframes tick-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes spark-draw { to { stroke-dashoffset: 0; } }
@keyframes spark-fill { to { fill-opacity: 1; stroke-width: 0; } }

/* Reduced motion: nothing moves or scales; fades are capped at 120ms; the shimmer stops; sparks appear without drawing. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation-duration: .12s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .menu-pop, .datebar-pop, .toast, .tick.new, .constel .on, dialog.sheet-dialog[open], .copy .done, .copy-lg .done { animation-name: fade-in !important; }
  .tick.new .tsp path { animation: none !important; stroke-dashoffset: 0; fill-opacity: 1; stroke-width: 0; }
  .sk { animation: none !important; background: var(--track); }
  button:active, .btn:active { transform: none; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Signed up labels, Undo, and Match sign-ups yourself (Tasks 14 and 14b). ---------- */
/* The badge, then the date on its own muted line, so every row reads the same. A label too long for its column wraps
   inside the badge with room between the lines. */
.sig { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; max-width: 100%; }
.sig .badge { height: auto; min-height: 24px; max-width: 100%; white-space: normal; line-height: 1.3; padding-top: 3px; padding-bottom: 3px; text-align: left; }
.sig .badge .icon { align-self: flex-start; margin-top: 1px; }
.sig .sig-when { margin-left: 0; white-space: nowrap; }
.pwt .c-sig { white-space: normal; }
@container people (min-width: 56rem) { .ptable.pwt thead th.c-sig { width: 270px; } }
.mark-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.mark-cell .mark { margin: 0; }
.mark-act { min-height: 44px; }
.report + .vnote, .info + .vnote { margin: 12px 0 0; }
.report ~ .foot-links { margin-top: 12px; }
.match { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 64rem) { .match { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; } }
.mt-side .ph-head { flex-wrap: wrap; }
.mt-list > li { position: relative; }
.mt-list > li + li::before { content: ""; position: absolute; top: 0; left: 24px; right: 24px; height: 1px; background: var(--hairline); }
.mt-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 64px; padding: 10px 24px; color: var(--text); text-decoration: none; }
.mt-pick:hover { background: var(--surface-sunken); }
.mt-pick[aria-current="true"] { background: var(--sage-tint); box-shadow: inset 3px 0 0 var(--sage); }
.mt-pick .who-txt { flex: 1 1 10rem; }
.mt-pick .nm, .mt-signup .nm { font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.mt-signup { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; min-height: 64px; padding: 10px 24px; }
.mt-signup .who-txt { flex: 1 1 10rem; }
.mt-link { margin: 0; }
.mt-link .btn { white-space: normal; text-align: left; }
.mt-msg, .mt-hint { display: flex; align-items: flex-start; gap: 8px; margin: 0 24px 16px; font-size: .9375rem; color: var(--text); }
.mt-msg .icon, .mt-hint .icon { flex: none; margin-top: 3px; color: var(--muted); }
.mt-msg.warn .icon { color: var(--warning-ink); }
.mt-hint { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-sunken); }
.mt-hint .on-phone { display: none; }
@media (max-width: 63.99rem) { .mt-hint .on-wide { display: none; } .mt-hint .on-phone { display: inline; } }
.mt-flash { flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.mt-flash > span { flex: 1 1 14rem; }
.mt-undo { margin: 0; }
@media (max-width: 63.99rem) {
  .mt-pick, .mt-signup { padding-left: 16px; padding-right: 16px; }
  .mt-list > li + li::before { left: 16px; right: 16px; }
  .mt-msg, .mt-hint { margin-left: 16px; margin-right: 16px; }
}
@container people (max-width: 55.99rem) {
  /* Phone rows: the password and its status on one line, then how we know they signed up on its own line. */
  .pwt .c-st, .pwt .c-sig:not(:has(.notyet)) ~ .c-st { order: 4; margin-left: auto; }
  .pwt .c-sig { order: 5; flex: 1 1 100%; margin-left: 0; }
  .pwt .sig .sig-when { display: inline; }
}
/* The report's Signed up column: the label (and its date) on the left, its one action on the right, in one row. */
.ptable.rtable.r-aff thead th:nth-child(2), .ptable.rtable.r-aff thead th:nth-child(3) { width: 150px; }
.ptable.rtable.r-aff thead th:nth-child(4) { width: 96px; } /* room for "4 unlocks" without breaking the word */
/* The recruit report's six columns need about 68rem; in a narrower column (1024px with the sidebar) it uses the
   phone list instead of squeezing the Person column. */
/* Back Office sign-ins has seven columns: the same switch. */
@container (max-width: 67.99rem) {
  .report > .desk-only:has(> .r-aff, > .r-bo) { display: none !important; }
  .report > .desk-only:has(> .r-aff, > .r-bo) + .rlist.phone-only { display: block !important; }
}
.ptable.rtable.r-aff thead th:nth-child(5) { width: 180px; }
.ptable.rtable.r-aff thead th:nth-child(6) { width: 300px; }
.rtable .mark-cell { flex-wrap: nowrap; justify-content: space-between; }
.rtable .mark-cell > .sig { flex: 0 1 auto; min-width: 0; }
.mark-cell .mark-act { flex: none; }
/* Phone report rows: the label on its own line, then its action and More side by side, the same in every row. */
.rl-actions > .rl-signed:has(.mark-cell), .rl-actions .mark-cell { display: contents; }
.rl-actions .mark-cell > .sig { flex: 0 0 100%; }
.rtable .mark-cell .lg-only { display: none; }
.rtable .mark-cell .sm-only { display: inline; }
/* Overview's short list: the narrow last column takes the short "Check match" chip; long Signed up labels wrap. */
.ptable.aff .lg-only { display: none; }
.ptable.aff .sm-only { display: inline; }
.ptable.aff td.end .sig { align-items: flex-end; text-align: right; }
.ptable.aff thead th:nth-child(2), .ptable.aff td:nth-child(2) { width: 84px; }
.ptable.aff thead th:nth-child(3), .ptable.aff td:nth-child(3) { width: 232px; }

/* ---------- A field with a button inside its right edge (Show password, New one, Clear the search). The wrapper draws
   the field's box and the input stops where the button starts, so the two are side by side, never on top of each
   other. Focus, hover and error states move to the box. ---------- */
/* The 1px border is an inset shadow, so the input and its button keep their full 44px height inside the box. */
.pw-field, .input-icon:has(> .trail:not([hidden])) {
  display: flex; align-items: stretch; background: var(--surface-raised); border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px var(--field-border), var(--e-inset); transition: box-shadow .12s var(--ease);
}
.pw-field:hover, .input-icon:has(> .trail:not([hidden])):hover { box-shadow: inset 0 0 0 1px var(--text), var(--e-inset); }
.pw-field:has(> input:focus-visible), .input-icon:has(> .trail:not([hidden])):has(> input:focus-visible) {
  box-shadow: inset 0 0 0 1.5px var(--focus), 0 0 0 3px rgb(59 122 76 / .25);
}
.pw-field:has(> input[aria-invalid="true"]), .input-icon:has(> .trail:not([hidden])):has(> input[aria-invalid="true"]) {
  box-shadow: inset 0 0 0 2px var(--danger-ink);
}
.pw-field > input, .input-icon:has(> .trail:not([hidden])) > input,
.pw-field > input:focus-visible, .input-icon:has(> .trail:not([hidden])) > input:focus-visible {
  flex: 1 1 auto; width: auto; min-width: 0; min-height: 44px; padding-right: .5rem;
  border: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); background: transparent; box-shadow: none !important;
}
.pw-field > .pw-toggle, .input-icon > .trail:not([hidden]) {
  position: static; flex: none; align-self: stretch; height: auto; margin: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.mt-acts { margin: -8px 24px 16px; }
@media (max-width: 63.99rem) { .mt-acts { margin-left: 16px; margin-right: 16px; } }
