/* ═══════════════════════════════════════════════════════════════════════
   PULSE V2 — ADMIN PANEL (functional reskin of v1 admin.html)
   Load order: tokens.css FIRST, then this file. No other css.

   What this file is:
   1. Self-hosted @font-face set (English-only surface — latin + latin-ext).
      'JetBrains Mono' is ALIASED to the Space Mono files: the verbatim v1
      admin JS injects styles naming JetBrains Mono (never actually shipped
      in v1 either — it fell back to system mono); the alias renders the V2
      house mono instead without touching a byte of JS.
   2. A v1→v2 TOKEN BRIDGE: the verbatim v1 markup + JS reference v1 token
      names (--grey, --border, --on-fg-08, --card, --red, …) in hundreds of
      inline style attributes and JS-injected styles. Bridging those names to
      Ion Atmosphere tokens reskins every one of them in one move.
      Status colors (--green/--yellow/--purple) have no v2 equivalent; they
      are defined HERE as admin-scoped tokens (deliberate: tokens.css is a
      shared foundation file owned by the marketing-shell work this phase —
      see ANALYSIS_SECURITY.md note). Admin pages are dark-forced
      (html[data-theme="dark"]), so no light overrides are required.
   3. The v1 admin.html inline <style> block, extracted (CSP: zero inline
      style blocks) and reskinned to V2 — every selector preserved verbatim
      so the JS DOM contract (ids/classes/data-*) is untouched.
   4. The subset of v1 shared.css the page shell uses (skip-link, nav,
      buttons, card, focus ring, scrollbar), restyled to V2.

   PERF GUARD: NEVER add filter:blur() or backdrop-filter to large/ fixed
   layers (the v1 nav used backdrop-filter:blur(20px) — replaced by the
   near-opaque --veil-92 fill on purpose). Keep it that way.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── 1. Fonts (self-hosted, copied from v1 fonts.css; English-only set) ── */
@font-face {
  font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700;
  font-stretch: 100%; font-display: swap;
  src: url(/fonts/instrument-sans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700;
  font-stretch: 100%; font-display: swap;
  src: url(/fonts/instrument-sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/space-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/space-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Mono'; font-style: normal; font-weight: 700; font-display: swap;
  src: url(/fonts/space-mono-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Mono'; font-style: normal; font-weight: 700; font-display: swap;
  src: url(/fonts/space-mono-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* JetBrains Mono → Space Mono alias (see header §1). */
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/space-mono-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 700; font-display: swap;
  src: url(/fonts/space-mono-700-latin.woff2) format('woff2');
}

/* ── 2. v1 → v2 token bridge (see header §2) ───────────────────────────── */
:root {
  /* surfaces */
  --bg: var(--canvas);
  --black: var(--canvas);
  --bg-elev: var(--surface-1);
  --bg-elev-2: var(--surface-2);
  --bg-hover: var(--surface-3);
  --bg-panel: var(--surface-2);
  --card: var(--surface-1);
  --card-bg: var(--wash-1);
  --card-bg-hover: var(--wash-2);
  /* text */
  --fg: var(--text-1);
  --white: var(--text-1);
  --text: var(--text-2);
  --grey: var(--text-3);
  --fg-dim: var(--text-3);
  --fg-dimmer: var(--text-3);
  --dim: var(--text-3);
  /* hairlines + alpha fills */
  --border: var(--line-1);
  --border-strong: var(--line-2);
  --on-fg-02: var(--wash-1);
  --on-fg-04: var(--wash-1);
  --on-fg-05: var(--wash-2);
  --on-fg-06: var(--line-1);
  --on-fg-08: var(--line-1);
  --on-fg-10: var(--line-2);
  --on-fg-15: var(--line-2);
  --on-fg-20: var(--line-3);
  --on-fg-30: var(--line-3);
  --on-fg-55: var(--text-3);
  --on-fg-60: var(--text-3);
  /* shell */
  --nav-bg: var(--veil-78);
  --nav-bg-scrolled: var(--veil-92);
  --shadow: var(--shadow-2);
  --glow: var(--accent-tint-1);
  --grid-line: var(--line-0);
  /* accent family (anchor --accent comes from tokens.css) */
  --accent-hover: var(--accent-bright);
  --accent-rgb: 0, 212, 200;
  --accent-fg: var(--accent-ink);
  --accent-secondary: var(--mint);
  /* status colors — admin-scoped tokens (AA on canvas; hex noted) */
  --red: var(--danger);                       /* ≈ #ff4d5e (tokens.css)   */
  --red-tint: var(--danger-tint);
  --green: oklch(0.80 0.17 162);              /* ≈ #2fe39a · ok/active    */
  --green-tint: oklch(0.80 0.17 162 / 0.10);
  --yellow: oklch(0.85 0.14 92);              /* ≈ #ecc845 · warn/pastdue */
  --yellow-tint: oklch(0.85 0.14 92 / 0.10);
  --purple: oklch(0.74 0.16 305);             /* ≈ #c490f5 · lifetime     */
  --purple-tint: oklch(0.74 0.16 305 / 0.12);
}

/* ── 3. Base + atmosphere ──────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-sans);
  color: var(--white);
  min-height: 100vh;
  /* Ion Atmosphere: cyan-tinted canvas with one quiet top-light. Pure
     gradients — NO blur layers (perf guard in the file header). */
  background:
    radial-gradient(120% 60% at 50% -10%, var(--accent-tint-2), transparent 60%),
    var(--canvas);
  background-attachment: fixed;
}

/* Brand-tinted scrollbar (ported from v1 shared.css, token-mapped) */
* { scrollbar-width: auto; scrollbar-color: oklch(0.52 0.10 184 / 0.85) oklch(1 0 0 / 0.04); }
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: oklch(1 0 0 / 0.04); }
::-webkit-scrollbar-thumb {
  background: oklch(0.52 0.10 184 / 0.85);
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  background-clip: content-box;
  min-height: 48px;
}
::-webkit-scrollbar-thumb:hover { background: oklch(0.64 0.13 184 / 0.95); background-clip: content-box; }

/* Keyboard focus ring (ported from v1 shared.css) */
:where(a, button, [role="button"], [tabindex], select, input, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
:where(a, button, [role="button"]):focus:not(:focus-visible) { outline: none; }

/* Skip link */
.skip-link { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus {
  position: fixed; left: 12px; top: 12px; width: auto; height: auto;
  padding: 10px 16px; background: var(--accent); color: var(--accent-ink);
  border-radius: var(--radius-sm); z-index: 9999; text-decoration: none;
  font-weight: 700; font-size: 14px; box-shadow: 0 4px 20px var(--slab-halo);
}

/* ── 4. Shell (v1 shared.css subset, V2-skinned) ───────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 14px 40px; display: flex; justify-content: space-between; align-items: center;
  background: var(--nav-bg-scrolled);           /* near-opaque veil — no backdrop blur */
  border-bottom: 1px solid var(--line-1);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  color: var(--text-1); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.02em;
}
.nav-brand img { height: 36px; width: auto; }
.nav-brand-logo { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.nav-brand-logo img { width: 32px; height: 32px; display: block; }
.nav-brand-logo .brand-svg {
  width: 32px; height: 32px; color: var(--accent); display: block;
  filter: drop-shadow(var(--glow-soft));        /* static glow — no ambient loop on a tool page */
}
.nav-badge {
  font-family: var(--font-mono); font-size: var(--fs-micro); font-weight: 700;
  letter-spacing: var(--track-micro); text-transform: uppercase;
  padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--danger-tint); color: var(--danger); border: 1px solid var(--danger-tint);
}
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link {
  padding: 8px 14px; color: var(--text-3); text-decoration: none;
  font-size: 13px; font-weight: 500; border-radius: var(--radius-sm);
  transition: color var(--dur-1) var(--ease-glide), background var(--dur-1) var(--ease-glide);
}
.nav-link:hover { color: var(--text-1); background: var(--wash-2); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-email { font-size: 12px; color: var(--grey); }
.icon-btn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line-1); border-radius: var(--radius-sm);
  color: var(--text-3); cursor: pointer; text-decoration: none;
  transition: all var(--dur-1) var(--ease-glide);
}
.icon-btn:hover { color: var(--text-1); border-color: var(--line-2); background: var(--wash-2); }
.icon-btn svg { width: 16px; height: 16px; }
/* Dark-forced surface: the v1 theme driver is intentionally not shipped here,
   so its toggle (and the never-hydrated language picker) are hidden. The
   elements stay in the DOM — the JS contract is untouched. */
.icon-btn[data-theme-toggle], #lang-picker { display: none; }
.nav-dl {
  padding: 9px 20px; background: var(--accent); color: var(--accent-ink);
  text-decoration: none; border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; letter-spacing: 0.2px; white-space: nowrap;
  transition: all var(--dur-1) var(--ease-glide);
}
.nav-dl:hover { background: var(--accent-bright); transform: translateY(-1px); }
.nav-user-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px;
  background: var(--accent-tint-2); border: 1px solid var(--accent-tint-1);
  border-radius: var(--radius-pill); color: var(--accent-bright);
  font-size: 12px; font-weight: 500; letter-spacing: 0.2px; white-space: nowrap;
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; text-decoration: none;
  transition: background var(--dur-1) var(--ease-glide);
}
.nav-user-pill:hover { background: var(--accent-tint-1); }
.nav-btn {
  padding: 6px 14px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  cursor: pointer; border: none; font-family: inherit; transition: all var(--dur-1) var(--ease-glide);
}
.btn-logout { background: var(--danger-tint); color: var(--danger); border: 1px solid var(--danger-tint); }
.btn-logout:hover { background: var(--danger-tint); filter: brightness(1.35); }

/* Generic card (shared.css port — admin JS renders into .card wrappers) */
.card {
  background: var(--surface-1); border: 1px solid var(--line-1);
  border-radius: var(--radius-md); transition: border-color var(--dur-2) var(--ease-glide);
}
.card:hover { border-color: var(--line-2); }

/* ── 5. Page ───────────────────────────────────────────────────────────── */
.page { max-width: 1200px; margin: 0 auto; padding: 80px 32px 60px; }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; margin-bottom: 28px; border-bottom: 1px solid var(--line-1); padding-bottom: 0; flex-wrap: wrap; }
.tab {
  padding: 10px 20px; font-size: 13px; font-weight: 600; color: var(--text-3);
  cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color var(--dur-1) var(--ease-glide), border-color var(--dur-1) var(--ease-glide);
  font-family: inherit;
}
.tab:hover { color: var(--text-1); }
.tab.active { color: var(--accent-bright); border-bottom-color: var(--accent); }

/* ── Stats grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--surface-1); border: 1px solid var(--line-1); border-radius: var(--radius-md); padding: 20px; }
.stat-label {
  font-family: var(--font-mono); font-size: var(--fs-micro); font-weight: 700;
  letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--text-3); margin-bottom: 8px;
}
.stat-value { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.stat-accent { color: var(--accent-bright); }
.stat-green { color: var(--green); }
.stat-red { color: var(--red); }
.stat-yellow { color: var(--yellow); }
.stat-purple { color: var(--purple); }

/* ── Charts ── */
.chart-card { background: var(--surface-1); border: 1px solid var(--line-1); border-radius: var(--radius-md); padding: 24px; margin-bottom: 20px; }
.chart-title {
  font-family: var(--font-mono); font-size: var(--fs-micro); font-weight: 700;
  letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--text-3); margin-bottom: 16px;
}
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 768px) { .chart-row { grid-template-columns: 1fr; } }

/* ── Bar chart (CSS-only; fills rendered by admin JS with inline widths) ── */
.bar-chart { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label { font-size: 11px; color: var(--text-3); width: 40px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.bar-track { flex: 1; height: 22px; background: var(--viz-track); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--accent); transition: width var(--dur-3) var(--ease-glide); min-width: 2px; }
.bar-count { font-size: 11px; color: var(--text-3); width: 30px; flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* ── Reliability & Adoption (telemetry insights) ── */
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-step { display: flex; align-items: center; gap: 10px; }
.funnel-step-label { font-size: 11px; color: var(--text-3); width: 120px; flex-shrink: 0; }
.funnel-step-track { flex: 1; height: 26px; background: var(--viz-track); border-radius: 4px; overflow: hidden; position: relative; }
.funnel-step-fill {
  height: 100%; border-radius: 4px; background: var(--accent);
  transition: width var(--dur-3) var(--ease-glide); min-width: 2px;
  display: flex; align-items: center; justify-content: flex-end; padding-right: 8px;
}
.funnel-step-fill.fail { background: var(--danger); }
.funnel-step-count { font-size: 11px; font-weight: 700; color: var(--accent-ink); }
.funnel-step-pct { font-size: 10px; color: var(--text-3); width: 46px; text-align: right; flex-shrink: 0; font-family: var(--font-mono); }

.va-chart-wrap { width: 100%; overflow-x: auto; }
.va-chart-wrap svg { display: block; width: 100%; height: 180px; min-width: 280px; }
.va-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.va-legend-item { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); }
.va-legend-swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

.feat-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-0); }
.feat-row:last-child { border-bottom: none; }
.feat-name { font-size: 12px; font-weight: 600; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feat-meta { font-size: 11px; color: var(--text-3); text-align: right; white-space: nowrap; font-family: var(--font-mono); }
.feat-bar { grid-column: 1 / -1; display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: var(--viz-track); }
.feat-bar-apply { background: var(--green); min-width: 0; }
.feat-bar-revert { background: var(--danger); min-width: 0; }
.feat-reach { font-size: 10px; color: var(--text-3); grid-column: 1 / -1; font-family: var(--font-mono); }
.crash-row td { color: var(--danger) !important; font-weight: 600; }

/* ── Country list ── */
.country-list { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; }
.country-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; }
.country-name { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.country-count { font-size: 13px; color: var(--text-3); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── Users table ── */
.table-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.search-input {
  padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--line-1);
  border-radius: var(--radius-sm); color: var(--text-1); font-size: 13px; font-family: inherit;
  outline: none; transition: border-color var(--dur-1) var(--ease-glide); min-width: 260px;
}
.search-input:focus { border-color: var(--accent-line); }
.search-input::placeholder { color: var(--text-3); }
.filter-select {
  padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--line-1);
  border-radius: var(--radius-sm); color: var(--text-1); font-size: 13px; font-family: inherit;
  outline: none; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23899d9d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px;
}

.users-table { width: 100%; border-collapse: collapse; }
.users-table th {
  text-align: left; font-family: var(--font-mono); font-size: var(--fs-micro); font-weight: 700;
  letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--text-3);
  padding: 10px 12px; border-bottom: 1px solid var(--line-1);
}
.users-table td { font-size: 13px; padding: 12px; border-bottom: 1px solid var(--line-0); vertical-align: middle; }
.users-table tr:hover td { background: var(--wash-1); }
.users-table tr { cursor: pointer; }

.badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}
.badge-free { background: var(--wash-2); color: var(--text-3); }
.badge-pro { background: var(--accent-tint-1); color: var(--accent-bright); border: 1px solid var(--accent-tint-1); }
.badge-lifetime { background: var(--purple-tint); color: var(--purple); border: 1px solid var(--purple-tint); }
.badge-active { background: var(--green-tint); color: var(--green); }
.badge-canceled { background: var(--danger-tint); color: var(--danger); }
.badge-past-due { background: var(--yellow-tint); color: var(--yellow); }
.badge-none { background: var(--wash-1); color: var(--text-3); }

/* ── Pagination ── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; }
.page-btn {
  padding: 6px 14px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--line-1); background: transparent; color: var(--text-3);
  font-family: inherit; transition: all var(--dur-1) var(--ease-glide);
}
.page-btn:hover:not(:disabled) { background: var(--wash-2); color: var(--text-1); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.page-btn.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.page-info { font-size: 12px; color: var(--text-3); }

/* ── User detail modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: oklch(0.05 0.012 210 / 0.78); z-index: 200;
  display: none; align-items: center; justify-content: center;
  /* PERF: v1 used backdrop-filter:blur(4px) here — replaced by a denser
     scrim. Do not re-add blur (file-header guard). */
}
.modal-overlay.visible { display: flex; }
.modal {
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  max-width: 600px; width: calc(100% - 40px); max-height: 80vh; overflow-y: auto; padding: 28px;
  box-shadow: var(--shadow-2);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h2 { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); background: var(--wash-1); border: none; color: var(--text-3);
  cursor: pointer; font-size: 18px; transition: background var(--dur-1) var(--ease-glide);
}
.modal-close:hover { background: var(--wash-2); color: var(--text-1); }
.modal-section { margin-bottom: 20px; }
.modal-section h3 {
  font-family: var(--font-mono); font-size: var(--fs-micro); font-weight: 700;
  letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--text-3); margin-bottom: 12px;
}
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 13px; }
.detail-label { color: var(--text-3); }
.detail-value { font-weight: 500; }

.modal-device { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line-0); }
.modal-device:last-child { border-bottom: none; }
.modal-device-info { display: flex; flex-direction: column; gap: 2px; }
.modal-device-name { font-size: 13px; font-weight: 600; }
.modal-device-meta { font-size: 11px; color: var(--text-3); }

.action-bar { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.btn {
  padding: 8px 16px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  cursor: pointer; border: none; font-family: inherit; transition: all var(--dur-1) var(--ease-glide);
}
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-bright); }
.btn-outline { background: transparent; border: 1px solid var(--line-1); color: var(--text-3); }
.btn-outline:hover { background: var(--wash-2); color: var(--text-1); border-color: var(--line-2); }
.btn-danger { background: var(--danger-tint); color: var(--danger); border: 1px solid var(--danger-tint); }
.btn-danger:hover { background: var(--danger-tint); filter: brightness(1.35); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Loading ── */
.loading { display: flex; align-items: center; justify-content: center; min-height: 60vh; flex-direction: column; gap: 16px; }
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--line-2); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 14px; color: var(--text-3); }

/* ── Error ── */
.error-full { display: flex; align-items: center; justify-content: center; min-height: 60vh; flex-direction: column; gap: 12px; }
.error-full h2 { font-size: 1.2rem; font-weight: 700; color: var(--danger); }
.error-full p { font-size: 14px; color: var(--text-3); }

/* ── Toasts (admin-wide: FF / Announcements / Server Health) ── */
.toast-stack {
  position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px;
  z-index: 300; pointer-events: none; max-width: min(420px, calc(100vw - 48px));
}
.toast {
  pointer-events: auto; background: var(--surface-2); border: 1px solid var(--line-2);
  border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 13px; color: var(--text-1); box-shadow: var(--shadow-2);
  display: flex; align-items: flex-start; gap: 10px; animation: toast-in 0.18s var(--ease-glide);
}
.toast-err { border-left-color: var(--danger); }
.toast-ok { border-left-color: var(--green); }
.toast-body { flex: 1; line-height: 1.4; word-break: break-word; }
.toast-close { flex-shrink: 0; background: none; border: none; color: var(--text-3); font-size: 16px; cursor: pointer; padding: 0; line-height: 1; }
.toast-close:hover { color: var(--text-1); }
.toast.leaving { animation: toast-out 0.15s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ── Feature flags polish ── */
.ff-row.ff-dirty td:first-child::before {
  content: '●'; color: var(--accent); margin-right: 6px; font-size: 9px;
  vertical-align: middle; text-shadow: 0 0 6px var(--accent);
}
.ff-row.ff-dirty textarea[data-ff-field], .ff-row.ff-dirty input[data-ff-field] { border-color: var(--accent) !important; }
.ff-bool-toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line-1); border-radius: var(--radius-sm); padding: 2px; gap: 2px; }
.ff-bool-btn {
  padding: 4px 10px; font-size: 11px; font-weight: 600; border: none; border-radius: 4px;
  background: transparent; color: var(--text-3); cursor: pointer; font-family: var(--font-mono);
}
.ff-bool-btn:hover { color: var(--text-1); }
.ff-bool-btn.active { background: var(--accent); color: var(--accent-ink); }
.ff-bool-btn.ff-bool-false.active { background: var(--text-4); color: var(--text-1); }

/* ── Announcement compose helpers ── */
.char-count { font-size: 10px; color: var(--text-3); margin-top: 2px; text-align: right; font-family: var(--font-mono); }
.char-count.over { color: var(--danger); }
.char-count.warn { color: var(--yellow); }
.ann-preview { margin-top: 8px; padding: 14px 16px; background: var(--surface-1); border: 1px dashed var(--line-2); border-radius: var(--radius-sm); font-size: 13px; }
.ann-preview-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--text-3); margin-bottom: 10px;
}
.ann-preview-body { padding: 12px 14px; border-radius: var(--radius-sm); border-left: 3px solid var(--text-3); }
.ann-preview-body.sev-info { background: var(--wash-1); border-left-color: var(--text-3); }
.ann-preview-body.sev-success { background: var(--green-tint); border-left-color: var(--green); }
.ann-preview-body.sev-warning { background: var(--yellow-tint); border-left-color: var(--yellow); }
.ann-preview-body.sev-critical { background: var(--danger-tint); border-left-color: var(--danger); }
.ann-preview-title { font-weight: 600; color: var(--text-1); margin-bottom: 4px; }
.ann-preview-text { font-size: 12px; color: var(--text-3); white-space: pre-wrap; line-height: 1.5; }
.ann-preview-cta { display: inline-block; margin-top: 8px; font-size: 11px; font-weight: 600; color: var(--accent-bright); text-decoration: underline; }

/* ── Admin help system (hints / severity chips / danger tips / history) ── */
.field-hint { font-size: 11px; color: var(--text-3); margin-top: 4px; line-height: 1.45; }
.field-hint code { background: var(--surface-1); padding: 1px 5px; border-radius: 3px; border: 1px solid var(--line-1); font-size: 10px; color: var(--text-1); font-family: var(--font-mono); }
.field-hint.field-hint-accent { color: var(--accent-bright); }
.sev-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 4px; }
.sev-chip {
  padding: 8px 10px; border-radius: var(--radius-sm); border-left: 3px solid var(--text-3);
  background: var(--wash-1); font-size: 10px; line-height: 1.35; color: var(--text-3); cursor: pointer;
  transition: background var(--dur-1), outline-color var(--dur-1); outline: 1px solid transparent; outline-offset: 1px;
}
.sev-chip.sev-info { border-left-color: var(--text-3); background: var(--wash-1); }
.sev-chip.sev-success { border-left-color: var(--green); background: var(--green-tint); }
.sev-chip.sev-warning { border-left-color: var(--yellow); background: var(--yellow-tint); }
.sev-chip.sev-critical { border-left-color: var(--danger); background: var(--danger-tint); }
.sev-chip:hover { filter: brightness(1.25); }
.sev-chip.is-selected { outline-color: var(--accent); }
.sev-chip-name { font-weight: 700; color: var(--text-1); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; font-size: 9px; }
.danger-wrap { position: relative; display: inline-block; margin-left: 6px; vertical-align: middle; }
.danger-pill { background: var(--danger); color: var(--text-1); font-size: 9px; padding: 1px 5px; border-radius: var(--radius-pill); font-weight: 700; cursor: help; display: inline-block; line-height: 1.4; }
.danger-tip {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; width: 280px;
  padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--danger);
  border-radius: var(--radius-sm); font-size: 11px; color: var(--text-1); line-height: 1.55;
  box-shadow: var(--shadow-2); white-space: normal; text-transform: none; letter-spacing: 0; font-weight: 400;
}
.danger-wrap:hover .danger-tip, .danger-wrap:focus-within .danger-tip { display: block; }
.danger-tip strong { color: var(--danger); display: block; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 4px; font-weight: 700; }
.flag-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.flag-actions-row { display: flex; gap: 4px; width: 100%; }
.flag-history-link {
  font-size: 10px; color: var(--accent-bright); text-decoration: underline; cursor: pointer;
  background: none; border: none; padding: 0; font-family: inherit; text-align: left; line-height: 1.4;
}
.flag-history-link:hover { text-shadow: 0 0 4px var(--accent); }

/* ── Server health polish ── */
.health-meta { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }
.health-live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green-tint); }
@media (prefers-reduced-motion: no-preference) {
  .health-live-dot { animation: pulse-dot 1.6s ease-in-out infinite; }
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.btn.is-busy { opacity: 0.6; pointer-events: none; position: relative; }
.btn.is-busy::after {
  content: ''; display: inline-block; width: 10px; height: 10px;
  border: 1.5px solid currentColor; border-top-color: transparent; border-radius: 50%;
  animation: spin 0.6s linear infinite; margin-left: 8px; vertical-align: -1px;
}

/* ── Mobile nav (nav-mobile.js injects .nav-toggle + .nav-drawer — these
      rules are the shared.css port that keeps them hidden on desktop) ── */
.nav-toggle {
  display: none; width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  border: 1px solid var(--line-1); background: transparent; border-radius: var(--radius-sm);
  color: var(--text-1); cursor: pointer; padding: 0; position: relative;
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle-close { display: none; }
.nav-open .nav-toggle-icon { display: none; }
.nav-open .nav-toggle-close { display: block; }
.nav-drawer {
  position: fixed; top: 0; left: 0; right: 0; z-index: 99;
  background: var(--veil-92);                /* near-opaque veil — no backdrop blur (perf guard) */
  border-bottom: 1px solid var(--line-1);
  padding: 80px 24px 24px; display: flex; flex-direction: column; gap: 8px;
  transform: translateY(-100%); transition: transform var(--dur-2) var(--ease-glide), opacity var(--dur-2) var(--ease-glide);
  opacity: 0; pointer-events: none;
}
.nav-drawer-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.nav-drawer-links { display: flex; flex-direction: column; gap: 4px; }
.nav-drawer-links a, .nav-drawer-actions a {
  display: flex; align-items: center; min-height: 44px; padding: 10px 16px;
  color: var(--text-3); text-decoration: none; font-size: 15px; font-weight: 500;
  border-radius: var(--radius-sm); transition: color var(--dur-1), background var(--dur-1);
}
.nav-drawer-links a:hover, .nav-drawer-actions a:hover { color: var(--text-1); background: var(--wash-2); }
.nav-drawer-actions { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line-1); margin-top: 8px; padding-top: 12px; }
.nav-drawer-actions .nav-dl { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 4px; }

/* ── Responsive ── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 640px; }
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-actions .nav-link { display: none; }
  .nav-actions .nav-link.nav-link-always-show { display: inline-flex; }
  .nav-actions .nav-dl { padding: 8px 16px; font-size: 12px; min-height: 44px; display: inline-flex; align-items: center; }
}
@media (max-width: 768px) {
  .nav { padding: 14px 20px; }
  .page { padding: 70px 16px 40px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .table-controls { flex-direction: column; }
  .search-input { width: 100%; min-width: 0; }
  .users-table { font-size: 12px; }
  .users-table th, .users-table td { padding: 8px 6px; }
  .col-country, .col-devices { display: none; }
  .toast-stack { bottom: 12px; right: 12px; left: 12px; max-width: none; }
  .users-table.sticky-first thead th:first-child,
  .users-table.sticky-first tbody td:first-child { position: sticky; left: 0; z-index: 2; background: var(--canvas); }
  .users-table.sticky-first tbody tr:hover td:first-child { background: var(--surface-3); }
  .filter-bar { flex-wrap: wrap; }
  .filter-select { flex: 1 1 calc(50% - 4px); min-width: 0; max-width: none; }
  .chart-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .nav { padding: 12px 14px; font-size: 13px; }
  .page { padding: 60px 10px 30px; }
  .users-table th, .users-table td { padding: 6px 4px; font-size: 11px; }
}

/* ── System Controls tab (sysctl-*) — CSP-clean module, zero inline styles.
      Owned by js/admin-system.js; markup in admin.html #tab-system. ── */
.sysctl-intro { font-size: 13px; color: var(--text-3); max-width: 760px; line-height: 1.55; margin-bottom: 18px; }
.sysctl-intro code, .sysctl-section-sub code, .sysctl-modal-text code {
  background: var(--surface-1); padding: 1px 6px; border-radius: 4px;
  border: 1px solid var(--line-1); font-size: 11px; font-family: var(--font-mono); color: var(--text-1);
}
.sysctl-section-title { font-size: 16px; font-weight: 700; margin: 26px 0 6px; color: var(--text-1); }
.sysctl-section-sub { font-size: 12px; color: var(--text-3); max-width: 760px; line-height: 1.55; margin: 0 0 14px; }
.sysctl-muted { color: var(--text-3); font-size: 12px; padding: 8px 0; }
.sysctl-error {
  margin-top: 10px; padding: 8px 12px; background: var(--danger-tint);
  border: 1px solid var(--danger); border-radius: var(--radius-sm);
  color: var(--danger); font-size: 12px;
}
.sysctl-btn-sm { font-size: 11px; padding: 5px 12px; }

/* Status strip */
.sysctl-status { padding: 14px 16px; margin-bottom: 8px; }
.sysctl-status-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.sysctl-status-title { margin-bottom: 0; }
.sysctl-status-meta { font-size: 10px; color: var(--text-3); font-family: var(--font-mono); margin-left: auto; }
.sysctl-status-verdict { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.sysctl-pill {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; background: var(--wash-1); color: var(--text-3);
  border: 1px solid var(--line-1); font-family: var(--font-mono);
}
.sysctl-pill-ok { background: var(--green-tint); color: var(--green); border-color: var(--green-tint); }
.sysctl-pill-warn { background: var(--yellow-tint); color: var(--yellow); border-color: var(--yellow-tint); }
.sysctl-pill-danger { background: var(--danger-tint); color: var(--danger); border-color: var(--danger); }

/* Legacy hard-503 banner (relocated from the top-of-page header 2026-06-16).
   admin-maintenance.js fills #maintenance-banner with its own styled markup;
   this wrapper just provides spacing below it. */
.sysctl-maint-503-banner { margin-bottom: 22px; }

/* Maintenance surface cards */
.sysctl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.sysctl-card { padding: 18px; }
.sysctl-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sysctl-card-name { font-size: 14px; font-weight: 700; color: var(--text-1); }
.sysctl-card-head .sysctl-switch { margin-left: auto; }
.sysctl-card-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.sysctl-label {
  display: block; font-family: var(--font-mono); font-size: var(--fs-micro); font-weight: 700;
  letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--text-3); margin: 12px 0 4px;
}
.sysctl-textarea, .sysctl-input {
  width: 100%; box-sizing: border-box; padding: 8px 10px; background: var(--surface-2);
  border: 1px solid var(--line-1); border-radius: var(--radius-sm); color: var(--text-1);
  font-size: 13px; font-family: inherit; outline: none;
  transition: border-color var(--dur-1) var(--ease-glide);
}
.sysctl-textarea { resize: vertical; min-height: 64px; }
.sysctl-textarea:focus, .sysctl-input:focus { border-color: var(--accent-line); }
.sysctl-textarea::placeholder, .sysctl-input::placeholder { color: var(--text-3); }

/* Toggle switch (checkbox-driven; danger rows go red when checked) */
.sysctl-switch { position: relative; display: inline-flex; width: 40px; height: 22px; flex-shrink: 0; cursor: pointer; }
.sysctl-switch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.sysctl-switch-track {
  pointer-events: none; width: 100%; height: 100%; border-radius: var(--radius-pill);
  background: var(--wash-2); border: 1px solid var(--line-2); position: relative;
  transition: background var(--dur-1) var(--ease-glide), border-color var(--dur-1) var(--ease-glide);
}
.sysctl-switch-track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--text-3);
  transition: transform var(--dur-1) var(--ease-glide), background var(--dur-1) var(--ease-glide);
}
.sysctl-switch input:checked + .sysctl-switch-track { background: var(--accent); border-color: var(--accent); }
.sysctl-switch input:checked + .sysctl-switch-track::after { transform: translateX(18px); background: var(--accent-ink); }
.sysctl-switch input:focus-visible + .sysctl-switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.sysctl-ks-danger .sysctl-switch input:checked + .sysctl-switch-track,
.sysctl-ks-warn .sysctl-switch input:checked + .sysctl-switch-track { background: var(--danger); border-color: var(--danger); }
.sysctl-ks-warn .sysctl-switch input:checked + .sysctl-switch-track { background: var(--yellow); border-color: var(--yellow); }

/* Kill-switch rows */
.sysctl-ks-card { padding: 6px 18px; }
.sysctl-ks-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 0;
  border-bottom: 1px solid var(--line-0);
}
.sysctl-ks-row:last-child { border-bottom: none; }
.sysctl-ks-info { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sysctl-ks-label { font-size: 13px; font-weight: 600; color: var(--text-1); text-transform: capitalize; }
.sysctl-ks-id { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); background: var(--wash-1); border: 1px solid var(--line-1); border-radius: 4px; padding: 1px 6px; }
.sysctl-ks-desc { flex-basis: 100%; font-size: 11px; color: var(--text-3); line-height: 1.45; }
/* Red zone: the API switch is the everything-off lever */
.sysctl-ks-danger {
  background: var(--danger-tint); border: 1px solid var(--danger);
  border-radius: var(--radius-sm); padding: 13px 14px; margin: 8px 0;
}
.sysctl-ks-danger .sysctl-ks-label { color: var(--danger); text-transform: uppercase; letter-spacing: 0.04em; }
.sysctl-ks-warn { border-left: 3px solid var(--yellow); padding-left: 11px; }
.sysctl-ks-row.is-on .sysctl-ks-label { color: var(--danger); }

/* Confirm modals */
.sysctl-modal { max-width: 460px; }
.sysctl-modal-text { margin: 0 0 14px; color: var(--text-1); font-size: 13px; line-height: 1.55; }
.sysctl-confirm-check { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--text-3); cursor: pointer; line-height: 1.5; }
.sysctl-confirm-check input { accent-color: var(--accent); margin-top: 2px; cursor: pointer; }
.sysctl-confirm-input {
  font-family: var(--font-mono); letter-spacing: 0.12em; text-align: center;
  font-size: 15px; border-color: var(--danger);
}

/* Recent system.* audit entries */
.sysctl-audit-list { display: flex; flex-direction: column; }
.sysctl-audit-row {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 9px 0; border-bottom: 1px solid var(--line-0); font-size: 12px;
}
.sysctl-audit-row:last-child { border-bottom: none; }
.sysctl-audit-when { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); white-space: nowrap; }
.sysctl-audit-action { font-family: var(--font-mono); font-size: 11px; color: var(--accent-bright); }
.sysctl-audit-who { color: var(--text-3); }
.sysctl-audit-detail { color: var(--text-3); font-family: var(--font-mono); font-size: 11px; }

@media (max-width: 768px) {
  .sysctl-grid { grid-template-columns: 1fr; }
  .sysctl-ks-row { flex-wrap: wrap; }
}

/* ── Shared admin form fields (token-driven; replaces the repeated inline
      "padding:8px 10px;background:#111;border:1px solid var(--on-fg-08);…"
      blob that drifted from .search-input / .sysctl-input). One source for
      input/textarea/select chrome + focus ring across every admin tab. ── */
.admin-field-label {
  display: block; font-size: 10px; color: var(--text-3); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 4px;
}
.admin-input, .admin-textarea, .admin-select {
  width: 100%; box-sizing: border-box; padding: 8px 10px; background: var(--surface-2);
  border: 1px solid var(--line-1); border-radius: var(--radius-sm); color: var(--text-1);
  font-size: 13px; font-family: inherit; outline: none;
  transition: border-color var(--dur-1) var(--ease-glide);
}
.admin-input:focus, .admin-textarea:focus, .admin-select:focus { border-color: var(--accent-line); }
.admin-input::placeholder, .admin-textarea::placeholder { color: var(--text-3); }
.admin-input.mono, .admin-textarea.mono { font-family: var(--font-mono); }
.admin-textarea { resize: vertical; min-height: 64px; }
.admin-select {
  cursor: pointer; appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23899d9d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}

/* ── Segmented control (filter rows) — replaces inline border-color toggling.
      Active = accent fill (mirrors .ff-bool-btn.active). aria-pressed driven. ── */
.seg-control {
  display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px;
  background: var(--surface-2); border: 1px solid var(--line-1); border-radius: var(--radius-sm);
}
.seg-btn {
  padding: 5px 12px; font-size: 12px; font-weight: 600; border: none; border-radius: 4px;
  background: transparent; color: var(--text-3); cursor: pointer; font-family: inherit;
  transition: color var(--dur-1) var(--ease-glide), background var(--dur-1) var(--ease-glide);
}
.seg-btn:hover { color: var(--text-1); }
.seg-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* ── Revenue console (plan-mix viz + MRR contribution split) ── */
.rev-split { display: flex; height: 16px; border-radius: 4px; overflow: hidden; background: var(--viz-track); margin: 4px 0 10px; }
.rev-split-seg { min-width: 0; transition: width var(--dur-3) var(--ease-glide); }
.rev-split-monthly { background: var(--accent); }
.rev-split-annual { background: var(--purple); }
.rev-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-3); }
.rev-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.rev-legend-swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

/* ── JS-built dialog (bug detail / reply composer) — aligns the createElement
      overlays to the static .modal system. Same scrim, no blur (perf guard). ── */
.admin-dialog-overlay {
  position: fixed; inset: 0; background: oklch(0.05 0.012 210 / 0.78); z-index: 9990;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.admin-dialog {
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  width: 100%; max-width: 720px; max-height: 88vh; overflow-y: auto; padding: 24px;
  box-shadow: var(--shadow-2);
}
.admin-dialog.dialog-sm { max-width: 500px; }

/* Reduced motion: kill the decorative transitions; keep functional spinners. */
@media (prefers-reduced-motion: reduce) {
  .toast, .toast.leaving { animation: none; }
  .nav-dl:hover { transform: none; }
  .rev-split-seg, .bar-fill, .funnel-step-fill { transition: none; }
}
