/* ============================================================
   Jabra Plus Art of Possible — shared.css
   Design system: inverted-tile + aurora gradient mesh + warm
   masculine accent (lime → amber → burnt orange).
   Tokens, components, and base reset live here. Every page
   inherits the look automatically through CSS custom props.
   ============================================================ */

/* Self-hosted fonts (was Google Fonts via @import). Switched to local
   /assets/fonts/ in v1.5.3 for GDPR posture — Google Fonts requests
   leak the visitor's IP + User-Agent to a third country (US) processor
   that we have no DPA with. The local bundle is ~344 KB across 17
   woff2 files; the browser only downloads the subsets it needs. To
   regenerate: node scripts/fetch-fonts.js                            */
@import url("/assets/fonts/fonts.css");

/* ============================================================
   TOKENS — DARK MODE (default)
   Deep aubergine page; tiles RAISED into pale lavender.
   The contrast is reversed from typical "everything dark" UIs —
   content cards feel like lit panels floating over a night sky.
   ============================================================ */
:root {
  --bg:        oklch(0.16 0.045 295);
  --bg-2:      oklch(0.13 0.055 280);

  --surface:   oklch(0.86 0.025 280);
  --surface2:  oklch(0.92 0.018 280);

  --aurora-1:  oklch(0.78 0.20 80);
  --aurora-2:  oklch(0.74 0.16 195);
  --aurora-3:  oklch(0.70 0.20 145);
  --aurora-4:  oklch(0.84 0.20 110);
  --aurora-5:  oklch(0.72 0.22 45);

  --border:    oklch(0 0 0 / 0.06);
  --border2:   oklch(0 0 0 / 0.10);
  --border-on-bg: oklch(1 0 0 / 0.10);

  /* ════════════════════════════════════════════════════════════════════
     TEXT COLOR TOKENS — READ THIS BEFORE PICKING ONE
     This theme INVERTS lightness between two zones, so there is no single
     readable text color. Pick the family by WHAT THE TEXT SITS ON:

       • On a CARD / PANEL / TABLE / CHIP (background = --surface):
           use  --text  /  --text2  /  --text3
       • Directly on the PAGE BACKGROUND (background = --bg):
           use  --text-on-bg  /  --text-on-bg2  /  --text-on-bg3

     Surface is LIGHT in dark-theme and DARK in light-theme — the exact
     opposite of --bg — so using a --text* token on the page background
     (or vice-versa) is low-contrast in BOTH themes. This is the #1 source
     of contrast bugs here. When unsure which zone an element is in, run the
     auditor: open the page with ?audit=contrast (or call __auditContrast()
     in the console). See contrast-audit.js.
     ──────────────────────────────────────────────────────────────────── */
  --text:      oklch(0.18 0.030 280);
  --text2:     oklch(0.42 0.025 280);
  --text3:     oklch(0.60 0.020 280);
  --muted:     var(--text2);

  --text-on-bg:  oklch(0.96 0.015 280);
  --text-on-bg2: oklch(0.78 0.020 280);
  --text-on-bg3: oklch(0.62 0.022 280);

  --accent:     oklch(0.74 0.18 75);
  --accent-d:   oklch(0.74 0.18 75 / 0.14);
  --accent-grad: linear-gradient(135deg,
                  oklch(0.78 0.18 110),
                  oklch(0.74 0.20 75) 50%,
                  oklch(0.70 0.22 40));

  --green:     oklch(0.72 0.20 152);
  --red:       oklch(0.66 0.24 22);
  --amber:     oklch(0.80 0.18 75);
  --blue:      oklch(0.70 0.18 240);
  --zoom:      #2D8CFF;  /* Zoom brand blue — constant across themes; token so it's not re-hardcoded per badge */
  --jabra:     #f2b500;  /* Jabra brand yellow — constant across themes, same rationale as --zoom */
  --jabra-ink: #b07f00;  /* darker text-safe variant of --jabra for use on light/dim backgrounds */
  --purple:    oklch(0.68 0.22 300);
  --pink:      oklch(0.74 0.22 340);

  --green-dim: oklch(0.72 0.20 152 / 0.16);
  --red-dim:   oklch(0.66 0.24 22  / 0.16);
  --amber-dim: oklch(0.80 0.18 75  / 0.18);
  --blue-dim:  oklch(0.70 0.18 240 / 0.16);
  --purple-dim:oklch(0.68 0.22 300 / 0.16);

  --green-ink: oklch(0.42 0.20 152);
  --red-ink:   oklch(0.46 0.24 22);
  --amber-ink: oklch(0.50 0.18 75);
  --blue-ink:  oklch(0.42 0.18 240);
  --purple-ink:oklch(0.42 0.22 300);

  --radius:    16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --radius-lg: 24px;

  /* Shell topbar height — sticky offsets under the topbar use this. */
  --topbar-h:  72px;

  --shadow:    0 1px 0 oklch(1 0 0 / 0.6) inset,
               0 0 0 1px oklch(0 0 0 / 0.04),
               0 1px 2px oklch(0 0 0 / 0.20),
               0 12px 32px -16px oklch(0 0 0 / 0.55),
               0 2px 6px oklch(from var(--accent) l c h / 0.04);
  --shadow-lg: 0 1px 0 oklch(1 0 0 / 0.7) inset,
               0 24px 60px -20px oklch(0 0 0 / 0.6),
               0 8px 24px -8px oklch(from var(--accent) l c h / 0.08);
  --shadow-pop: 0 8px 28px -6px oklch(0 0 0 / 0.5),
                0 0 40px -8px oklch(from var(--accent) l c h / 0.35);
  --shadow-glow: 0 0 0 1px oklch(from var(--accent) l c h / 0.4),
                 0 0 32px -4px oklch(from var(--accent) l c h / 0.5);

  --font-sans:    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Instrument Serif", "Inter", ui-sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease:      cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast:  120ms;
  --dur:       240ms;
  --dur-slow:  420ms;
}

/* ============================================================
   LIGHT MODE — warm cream sky, DEEP MOODY tiles
   ============================================================ */
body.light {
  --bg:        oklch(0.97 0.020 90);
  --bg-2:      oklch(0.94 0.035 65);

  --surface:   oklch(0.26 0.040 235);
  --surface2:  oklch(0.32 0.038 235);

  --aurora-1:  oklch(0.70 0.22 80);
  --aurora-2:  oklch(0.66 0.18 195);
  --aurora-3:  oklch(0.62 0.22 145);
  --aurora-4:  oklch(0.78 0.20 110);
  --aurora-5:  oklch(0.66 0.24 45);

  --border:    oklch(1 0 0 / 0.08);
  --border2:   oklch(1 0 0 / 0.14);
  --border-on-bg: oklch(0 0 0 / 0.08);

  --text:      oklch(0.96 0.020 280);
  --text2:     oklch(0.80 0.020 280);
  --text3:     oklch(0.73 0.020 280);

  --text-on-bg:  oklch(0.22 0.030 295);
  --text-on-bg2: oklch(0.42 0.025 295);
  --text-on-bg3: oklch(0.58 0.022 295);

  --accent:    oklch(0.62 0.20 70);
  --accent-d:  oklch(0.62 0.20 70 / 0.14);
  --accent-grad: linear-gradient(135deg,
                  oklch(0.66 0.20 110),
                  oklch(0.62 0.22 70) 50%,
                  oklch(0.58 0.24 40));

  --green-ink: oklch(0.84 0.18 152);
  --red-ink:   oklch(0.78 0.22 22);
  --amber-ink: oklch(0.86 0.18 75);
  --blue-ink:  oklch(0.78 0.18 240);
  --purple-ink:oklch(0.78 0.22 300);

  --shadow:    0 1px 0 oklch(1 0 0 / 0.10) inset,
               0 0 0 1px oklch(1 0 0 / 0.06),
               0 1px 2px oklch(0 0 0 / 0.10),
               0 14px 36px -16px oklch(from var(--surface) l c h / 0.5),
               0 2px 8px oklch(from var(--accent) l c h / 0.10);
  --shadow-lg: 0 1px 0 oklch(1 0 0 / 0.10) inset,
               0 28px 70px -20px oklch(from var(--surface) l c h / 0.55),
               0 12px 30px -8px oklch(from var(--accent) l c h / 0.18);
  --shadow-pop: 0 12px 36px -6px oklch(from var(--surface) l c h / 0.4),
                0 0 50px -8px oklch(from var(--accent) l c h / 0.35);
  --shadow-glow: 0 0 0 1.5px oklch(from var(--accent) l c h / 0.5),
                 0 0 40px -4px oklch(from var(--accent) l c h / 0.45);
}

/* ============================================================
   COLORBLIND MODE — deuteranopia-safe blue/orange
   Keeps dark sky / light tile vibe; swaps green/red and accent.
   ============================================================ */
body.colorblind {
  --accent:    oklch(0.62 0.22 245);
  --accent-d:  oklch(0.62 0.22 245 / 0.14);
  --accent-grad: linear-gradient(135deg,
                  oklch(0.62 0.22 245),
                  oklch(0.70 0.20 200) 60%,
                  oklch(0.78 0.18 80));

  --green:     oklch(0.74 0.16 230);
  --red:       oklch(0.74 0.18 60);
  --green-dim: oklch(0.74 0.16 230 / 0.16);
  --red-dim:   oklch(0.74 0.18 60  / 0.16);
  --green-ink: oklch(0.42 0.16 230);
  --red-ink:   oklch(0.50 0.18 60);

  --aurora-1:  oklch(0.66 0.22 245);
  --aurora-3:  oklch(0.74 0.20 60);
}

/* ============================================================
   BASE RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text-on-bg);
  background-image:
    radial-gradient(1100px 800px at 88% -8%,  oklch(from var(--aurora-1) l c h / 0.55), transparent 55%),
    radial-gradient(900px 700px  at -10% 18%, oklch(from var(--aurora-2) l c h / 0.40), transparent 50%),
    radial-gradient(800px 700px  at 50% 110%, oklch(from var(--aurora-3) l c h / 0.45), transparent 55%),
    radial-gradient(700px 600px  at 110% 80%, oklch(from var(--aurora-5) l c h / 0.30), transparent 60%),
    radial-gradient(600px 500px  at 20% 90%,  oklch(from var(--aurora-4) l c h / 0.22), transparent 60%);
  background-attachment: fixed;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  min-height: 100vh;
  min-height: 100dvh; /* mobile browsers: track the dynamic toolbar */
}

body.light {
  background-image:
    radial-gradient(1100px 800px at 88% -8%,  oklch(from var(--aurora-3) l c h / 0.45), transparent 55%),
    radial-gradient(900px 700px  at -10% 18%, oklch(from var(--aurora-4) l c h / 0.55), transparent 50%),
    radial-gradient(800px 700px  at 50% 110%, oklch(from var(--aurora-5) l c h / 0.45), transparent 55%),
    radial-gradient(700px 600px  at 110% 80%, oklch(from var(--aurora-1) l c h / 0.30), transparent 60%);
}

/* ============================================================
   TYPE
   ============================================================ */
.t-label   { font-family: var(--font-mono); font-size: 10px; font-weight: 600; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.1em; }

/* ============================================================
   CARDS / PANELS
   ============================================================ */
.card {
  position: relative;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform var(--dur) var(--ease-out),
              box-shadow var(--dur) var(--ease-out);
}
.card::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, oklch(1 0 0 / 0.5), transparent 30%);
  mix-blend-mode: overlay;
  opacity: 0.6;
}
.card.interactive { cursor: pointer; }
.card.interactive:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-pop);
}
.card.interactive:active { transform: translateY(-1px); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; white-space: nowrap;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  border-radius: var(--radius-sm); padding: 9px 15px;
  cursor: pointer; user-select: none; text-decoration: none;
  border: 1px solid transparent; background: transparent;
  color: inherit;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent-grad);
  color: oklch(0.99 0 0);
  font-weight: 600;
  box-shadow:
    0 1px 0 oklch(1 0 0 / 0.35) inset,
    0 -1px 0 oklch(0 0 0 / 0.25) inset,
    0 6px 18px -4px oklch(from var(--accent) l c h / 0.55),
    0 0 0 1px oklch(from var(--accent) l c h / 0.5);
}
.btn-primary:hover {
  filter: brightness(1.1) saturate(1.1);
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 oklch(1 0 0 / 0.4) inset,
    0 10px 28px -4px oklch(from var(--accent) l c h / 0.75),
    0 0 0 1px oklch(from var(--accent) l c h / 0.6);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: default;
  filter: none;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: oklch(from var(--surface) calc(l - 0.05) c h);
  border-color: var(--border);
  color: var(--text);
}
body.light .btn-secondary {
  background: oklch(from var(--surface) calc(l + 0.06) c h);
}
.btn-secondary:hover {
  background: oklch(from var(--surface) calc(l - 0.10) c h);
}
body.light .btn-secondary:hover {
  background: oklch(from var(--surface) calc(l + 0.10) c h);
}

.btn-sm {
  background: transparent;
  border: 1px solid var(--border-on-bg);
  color: var(--text-on-bg2);
  font-family: var(--font-mono); font-size: 11px;
  padding: 5px 10px; border-radius: var(--radius-xs);
  cursor: pointer; white-space: nowrap;
  transition: all var(--dur-fast) var(--ease);
}
.btn-sm:hover {
  color: var(--text-on-bg);
  border-color: oklch(from var(--accent) l c h / 0.4);
  background: oklch(from var(--accent) l c h / 0.10);
}

/* Icon button — small mono toolbar button. Injected by shell.js in the
   topbar (refresh, docs "?") on every page; rooms' toolbar also uses it
   (with a surface-zone override in rooms' own CSS). */
.icon-btn {
  background: oklch(from var(--bg) calc(l + 0.08) c h / 0.4);
  border: 1px solid var(--border-on-bg);
  border-radius: var(--radius-sm); padding: 6px 14px;
  color: var(--text-on-bg2);
  font-family: var(--font-mono); font-size: 12px;
  cursor: pointer; transition: all var(--dur-fast) var(--ease);
  display: flex; align-items: center; gap: 6px;
}
body.light .icon-btn { background: oklch(from var(--bg) calc(l - 0.06) c h / 0.5); }
.icon-btn:hover { border-color: oklch(from var(--accent) l c h / 0.4); color: var(--accent); }
.icon-btn.amber:hover { border-color: var(--amber); color: var(--amber); }
.icon-btn.spinning svg { animation: spin 1s linear infinite; }

/* Hamburger (shell.js topbar) — hidden on desktop, shown ≤900px by the
   responsive block below. Carries .icon-btn for its visual recipe, so this
   hide rule must come AFTER the .icon-btn family (same specificity —
   source order decides). */
.nav-burger { display: none; }
body.kiosk .nav-burger { display: none !important; }

/* Ask-Claude launcher button — small accent-gradient pill, identical across
   the feed pages (message-center / roadmap / release-notes). */
.claude-btn {
  background: var(--accent-grad); border: none; border-radius: var(--radius-sm);
  padding: 7px 14px; color: oklch(0.99 0 0);
  font-family: var(--font-sans); font-size: 12px; font-weight: 600; cursor: pointer;
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.3) inset, 0 4px 14px -4px oklch(from var(--accent) l c h / 0.5);
  transition: all var(--dur-fast) var(--ease);
}
.claude-btn:hover { filter: brightness(1.1) saturate(1.1); transform: translateY(-1px); }

/* Callout / note box — surface card with a colored left rule. */
.callout {
  position: relative;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px; margin: 16px 0;
  font-size: 13px; line-height: 1.6;
  box-shadow: var(--shadow);
}
.callout.warn   { border-left-color: var(--accent); }
.callout.danger { border-left-color: var(--red); }
.callout strong { color: var(--text); font-weight: 600; }

/* ============================================================
   INPUTS — designed to live inside light tiles
   ============================================================ */
.input, input[type="text"], input[type="email"], input[type="url"],
input[type="password"], input[type="search"], input[type="number"],
textarea, select {
  width: 100%;
  background: oklch(from var(--surface) calc(l - 0.06) c h);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  color: var(--text);
  font-family: var(--font-sans); font-size: 13px;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
body.light .input,
body.light input[type="text"], body.light input[type="email"],
body.light input[type="url"], body.light input[type="password"],
body.light input[type="search"], body.light input[type="number"],
body.light textarea, body.light select {
  background: oklch(from var(--surface) calc(l + 0.08) c h);
}
.input:focus, input:focus, textarea:focus, select:focus {
  border-color: oklch(from var(--accent) l c h / 0.5);
  box-shadow: 0 0 0 3px var(--accent-d);
}
.input::placeholder, input::placeholder, textarea::placeholder { color: var(--text3); }

/* ============================================================
   TABLE CARD + BADGES
   Promoted from tenant/styles.css (the de-facto standard — `.table-card`
   is used ~100× across pages). Table element rules are SCOPED under
   `.table-card` on purpose: the old copy declared bare `table`/`th`/`td`,
   which leaked out of the tenant bundle and styled every table app-wide.
   Any standalone table (e.g. `.tcq-table`) keeps its own styling.
   ============================================================ */
.table-card {
  position: relative; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow-x: auto; overflow-y: hidden; box-shadow: var(--shadow);
}
.table-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, oklch(1 0 0 / 0.4), transparent 25%);
  mix-blend-mode: overlay; opacity: 0.5;
}
.table-card-header {
  padding: 18px 22px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: relative; z-index: 1;
}
.table-card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.table-card-badge { font-family: var(--font-mono); font-size: 10px; padding: 3px 9px; border-radius: 999px; font-weight: 600; border: 1px solid transparent; }
.table-card table { width: 100%; border-collapse: collapse; position: relative; z-index: 1; }
.table-card th { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.08em; padding: 11px 22px; text-align: left; border-bottom: 1px solid var(--border); background: oklch(from var(--surface) calc(l - 0.04) c h); }
.table-card td { font-family: var(--font-mono); font-size: 11px; color: var(--text); padding: 11px 22px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-card tr:last-child td { border-bottom: none; }
.table-card td.td-primary { color: var(--text); font-weight: 600; }

/* Badge color family — used inside table cells / headers (and reusable
   anywhere a small status chip is wanted). Pair `.badge-<color>` with
   `.table-card-badge` for the base pill shape. */
.badge-red { background: var(--red-dim); color: var(--red-ink); border-color: oklch(from var(--red-ink) l c h / 0.25); }
.badge-amber { background: var(--amber-dim); color: var(--amber-ink); border-color: oklch(from var(--amber-ink) l c h / 0.25); }
.badge-green { background: var(--green-dim); color: var(--green-ink); border-color: oklch(from var(--green-ink) l c h / 0.25); }
.badge-blue { background: var(--blue-dim); color: var(--blue-ink); border-color: oklch(from var(--blue-ink) l c h / 0.25); }

/* ============================================================
   STATUS BAR + SPINNER + LIVE DOT
   ============================================================ */
.status-bar {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-on-bg2);
  padding: 0 4px;
  margin-bottom: 16px;
  min-height: 18px;
}

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 12px; height: 12px;
  border: 2px solid oklch(from var(--accent) l c h / 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 oklch(from currentColor l c h / 0.6); }
  70%  { box-shadow: 0 0 0 8px oklch(from currentColor l c h / 0); }
  100% { box-shadow: 0 0 0 0 oklch(from currentColor l c h / 0); }
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  animation: pulse 2s var(--ease) infinite;
}

/* ============================================================
   SCROLLBARS
   ============================================================ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: oklch(from var(--accent) l c h / 0.25);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: oklch(from var(--accent) l c h / 0.5);
  background-clip: padding-box;
  border: 2px solid transparent;
}
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
.show-more { text-align: center; padding: 16px 0; }

::selection {
  background: oklch(from var(--accent) l c h / 0.35);
  color: var(--text-on-bg);
}

/* ============================================================
   APP SHELL — left rail + topbar + content
   Pages opt in by setting <body data-shell="app"> and
   loading shell.js, which injects .app > (.rail + .app-main).
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  background: transparent;
}
.app-main { min-width: 0; display: flex; flex-direction: column; }

/* ── Left rail ── */
.rail {
  background: oklch(from var(--bg) calc(l + 0.04) c h / 0.5);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border-right: 1px solid var(--border-on-bg);
  display: flex; flex-direction: column;
  padding: 18px 14px;
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  color: var(--text-on-bg);
}
body.light .rail {
  background: oklch(from var(--bg) calc(l - 0.05) c h / 0.5);
}

.rail-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 22px;
  text-decoration: none;
  color: inherit;
}
.rail-mark {
  width: 36px; height: 36px;
  border-radius: 11px;
  /* The brand mark is now an <img> sourced from the high-res favicon
     (/android-chrome-512x512.png). Keep the rounded square + shadow as
     a frame, but drop the accent gradient + text-only styles so the
     icon itself provides the colour. */
  object-fit: cover;
  flex-shrink: 0;
  display: block;
  box-shadow:
    0 6px 20px -4px oklch(0 0 0 / 0.25),
    0 0 0 1px oklch(from var(--accent) l c h / 0.25);
}
.rail-name { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 18px; letter-spacing: -0.01em; color: var(--text-on-bg); line-height: 1.1; }
.rail-sub { font-family: var(--font-mono); font-size: 10px; color: var(--text-on-bg3); letter-spacing: 0; }

/* Scrollable middle of the rail. flex:1 + min-height:0 is the canonical
   trick for "let me overflow inside a flex column" — without min-height:0
   the flex item refuses to shrink below its content and overflow-y:auto
   never engages. */
.rail-scroll {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  /* Subtle scrollbar so the rail doesn't grow a chunky native gutter. */
  scrollbar-width: thin;
  scrollbar-color: var(--border-on-bg) transparent;
}
.rail-scroll::-webkit-scrollbar { width: 6px; }
.rail-scroll::-webkit-scrollbar-track { background: transparent; }
.rail-scroll::-webkit-scrollbar-thumb {
  background: var(--border-on-bg); border-radius: 3px;
}
.rail-scroll::-webkit-scrollbar-thumb:hover {
  background: oklch(from var(--text-on-bg3) l c h / 0.6);
}

.rail-section { padding: 14px 8px 6px; }
.rail-section .t-label { color: var(--text-on-bg3); display: block; padding-bottom: 6px; }

.rail-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--text-on-bg2); cursor: pointer;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  text-decoration: none;
  transition: all var(--dur-fast) var(--ease);
  user-select: none;
  position: relative;
}
.rail-link:hover {
  background: oklch(from var(--bg) calc(l + 0.10) c h / 0.5);
  color: var(--text-on-bg);
}
body.light .rail-link:hover {
  background: oklch(from var(--bg) calc(l - 0.08) c h / 0.5);
}
.rail-link.active {
  background: var(--accent-grad);
  color: oklch(0.99 0 0);
  box-shadow:
    0 1px 0 oklch(1 0 0 / 0.3) inset,
    0 6px 18px -4px oklch(from var(--accent) l c h / 0.55);
}
.rail-link.active .rail-icon, .rail-link.active span { color: oklch(0.99 0 0); }
.rail-icon { width: 16px; height: 16px; flex-shrink: 0; display: inline-flex; }
/* Green dot for nav items with new content since the user's last visit.
   Driven by shell.js's _updateFeedBadges() which toggles .has-new based
   on /feeds/newest vs the per-user feedSeen timestamps. Pulses subtly
   so it catches the eye without being noisy. */
.rail-link.has-new::after {
  content: ""; display: inline-block;
  width: 7px; height: 7px; margin-left: 8px;
  border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 2px oklch(from var(--green) l c h / 0.18);
  vertical-align: middle;
  animation: rail-newdot 2.4s ease-in-out infinite;
}
@keyframes rail-newdot {
  0%, 100% { box-shadow: 0 0 0 2px oklch(from var(--green) l c h / 0.18); }
  50%      { box-shadow: 0 0 0 4px oklch(from var(--green) l c h / 0.05); }
}
.rail-link.active.has-new::after {
  background: oklch(0.99 0 0);  /* white dot on accent-gradient active state */
  box-shadow: 0 0 0 2px oklch(1 0 0 / 0.2);
}

/* ── Rail drag-reorder + favorites + right-click menu (shell.js) ────────────
   Per-user nav customisation. The ⠿ handle is absolutely positioned so it
   never shifts the row; it fades in on hover and is the ONLY thing that
   starts a drag, so links stay clickable. Desktop-only — hidden on the
   mobile drawer (below). */
.rail-section .t-label { position: relative; }
.rail-drag {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  opacity: 0; cursor: grab; font-size: 13px; line-height: 1;
  color: var(--text-on-bg3); padding: 3px; border-radius: 4px;
  background: oklch(from var(--bg) calc(l + 0.10) c h / 0.6);
  transition: opacity var(--dur-fast) var(--ease); user-select: none;
}
.rail-link:hover .rail-drag,
.rail-section .t-label:hover .rail-drag { opacity: 0.6; }
.rail-drag:hover { opacity: 1; }
.rail-drag:active { cursor: grabbing; }
.rail-link.rail-dragging,
.rail-section.rail-dragging { opacity: 0.4; }

/* Favorites section — a star instead of a drag handle (it's pinned to top). */
.rail-fav-label { display: flex; align-items: center; gap: 6px; }
.rail-fav-star  { color: var(--accent); font-size: 11px; line-height: 1; }

/* Right-click favorite/unfavorite menu. */
.rail-ctx-menu {
  position: fixed; z-index: 700; min-width: 190px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); overflow: hidden; padding: 4px;
}
.rail-ctx-item {
  display: block; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-sans); font-size: 13px; color: var(--text);
  padding: 8px 12px; border-radius: var(--radius-xs);
}
.rail-ctx-item:hover { background: var(--accent-d); }
.rail-link .count {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 10px;
  background: oklch(from var(--bg) calc(l + 0.12) c h / 0.6);
  color: var(--text-on-bg3);
  border-radius: 999px; padding: 2px 7px;
}
body.light .rail-link .count {
  background: oklch(from var(--bg) calc(l - 0.10) c h / 0.6);
}
.rail-link.active .count {
  background: oklch(1 0 0 / 0.25);
  color: oklch(0.99 0 0);
}

.rail-foot {
  margin-top: auto; padding: 10px 8px 0;
  border-top: 1px solid var(--border-on-bg);
}
.rail-user {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 4px;
}
.rail-avatar {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  color: oklch(0.99 0 0);
  flex-shrink: 0;
  box-shadow: 0 4px 10px -2px oklch(from var(--accent) l c h / 0.5);
}
.rail-user-info { min-width: 0; flex: 1; }
.rail-user-name { font-size: 13px; font-weight: 600; color: var(--text-on-bg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-user-email { font-family: var(--font-mono); font-size: 10px; color: var(--text-on-bg3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-signout {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-on-bg);
  background: transparent;
  color: var(--text-on-bg3);
  border-radius: var(--radius-xs);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--dur-fast) var(--ease);
}
.rail-signout:hover { color: var(--red); border-color: oklch(from var(--red) l c h / 0.5); }

/* ── Topbar ── */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 30px;
  border-bottom: 1px solid var(--border-on-bg);
  background: oklch(from var(--bg) l c h / 0.55);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  position: sticky; top: 0; z-index: 50;
  color: var(--text-on-bg);
  min-height: var(--topbar-h);
}
.topbar-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topbar-title { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 26px; letter-spacing: -0.015em; line-height: 1.1; color: var(--text-on-bg); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-version {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  color: var(--text-on-bg3); letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--border-on-bg);
  background: oklch(from var(--bg) calc(l + 0.06) c h / 0.4);
  white-space: nowrap; user-select: all;
}
.topbar-live { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--text-on-bg2); }
.topbar-live a { color: var(--amber, var(--accent)); text-decoration: none; border-bottom: 1px dashed currentColor; }
.topbar-live a:hover { color: var(--accent); }
.topbar-live .live-dot { color: var(--green); }

/* ── Screen padding wrapper ── */
.screen-pad { padding: 28px 32px 96px; max-width: 1440px; margin: 0 auto; color: var(--text-on-bg); }

/* ============================================================
   DASHBOARD COMPONENTS
   ============================================================ */

/* Stats grid — N-up stat tiles (admin-settings, tenant). */
.stats-grid { display: grid; gap: 16px; }
.stats-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.stats-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stats-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .stats-grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .stats-grid.cols-2, .stats-grid.cols-3, .stats-grid.cols-4 { grid-template-columns: 1fr; } }

/* ── Filter bar (on-bg regex filter — feed pages) ──
   Promoted from message-center/roadmap (byte-identical core). Both error
   class names are aliased so pages migrate with no markup change. Pages
   with a differently-styled filter (e.g. rooms' toolbar) keep their own. */
.filter-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-input {
  flex: 1; min-width: 200px;
  background: oklch(from var(--bg) calc(l + 0.08) c h / 0.4);
  border: 1px solid var(--border-on-bg);
  border-radius: var(--radius-sm); padding: 9px 13px; color: var(--text-on-bg);
  font-family: var(--font-sans); font-size: 13px; outline: none; backdrop-filter: blur(8px);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
body.light .filter-input { background: oklch(from var(--bg) calc(l - 0.06) c h / 0.5); }
.filter-input:focus { border-color: oklch(from var(--accent) l c h / 0.5); box-shadow: 0 0 0 3px var(--accent-d); }
.filter-input.regex-error, .filter-input.regex-err { border-color: var(--red); }
.filter-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-on-bg3); white-space: nowrap; }

/* ── Responsive: collapse rail on narrow viewports ── */
/* ── Responsive convention ──────────────────────────────────────────────────
   900px = tablet pivot: the rail becomes an off-canvas drawer opened by the
           topbar hamburger (.nav-burger, injected by shell.js).
   600px = phone tier: density/touch adjustments, full-width sheets.
   Legacy one-off breakpoints (640/700/820/1100) predate this convention. */

/* Drawer backdrop (shell.js inserts it between .rail and .app-main). The
   base rule MUST live outside the media query: unstyled it's a block-level
   grid child of .app, silently occupying the 1fr column on desktop and
   shoving .app-main into the 248px rail column (v2.1.0 regression). Fixed
   positioning + display:none keep it out of the grid at every width. */
.rail-backdrop {
  display: none; position: fixed; inset: 0; z-index: 590;
  background: oklch(0 0 0 / 0.45);
}

@media (max-width: 900px) {
  html, body { background-attachment: scroll; } /* iOS: fixed attachment is janky/ignored */
  .app { grid-template-columns: 1fr; }
  .nav-burger { display: flex; }
  /* Rail → off-canvas drawer. Keeps its desktop vertical layout (nav
     sections, footer, user info all visible); slides in over the page. */
  .rail {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 260px; height: 100vh; height: 100dvh;
    z-index: 600;
    transform: translateX(-100%);
    transition: transform var(--dur) var(--ease-out);
    border-right: 1px solid var(--border-on-bg);
    box-shadow: 0 0 60px oklch(0 0 0 / 0.35);
  }
  body.nav-open .rail { transform: none; }
  body.nav-open .rail-backdrop { display: block; }
  .topbar { padding: 14px 18px; }
  .screen-pad { padding: 22px 18px 80px; }
  /* Nav reorder is desktop-only (per the feature's chosen scope) — the saved
     layout + favorites still render here, but the drag handles don't show on
     the touch drawer. */
  .rail-drag { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rail { transition: none; }
}

/* Phone tier (≤600px) rules live at the END of this file — several of the
   components they override (.claude-panel, .copy-btn, .card-check) are
   defined below this point, and source order decides at equal specificity. */

/* ============================================================
   ASK-CLAUDE CHAT — message styles (.sc-*)
   The transcript styling was byte-identical across message-center,
   roadmap, release-notes, tenant, and security — promoted here. The
   floating panel shell itself is promoted separately below as
   .claude-panel (Phase C).
   ============================================================ */
.sc-msg { display: flex; flex-direction: column; gap: 3px; }
.sc-label { font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  color: var(--text2); text-transform: uppercase; letter-spacing: 0.08em; }
.sc-msg.user .sc-label { color: var(--accent); }
.sc-bubble { font-family: var(--font-sans); font-size: 13px; line-height: 1.55;
  color: var(--text); background: oklch(from var(--surface) calc(l - 0.06) c h);
  border-radius: var(--radius-sm); padding: 10px 12px;
  white-space: pre-wrap; word-break: break-word; }
.sc-msg.user .sc-bubble { background: var(--accent-d); border: 1px solid oklch(from var(--accent) l c h / 0.25); }
.sc-msg.error .sc-bubble { background: var(--red-dim); color: var(--red-ink); }
.sc-typing { display: flex; gap: 4px; padding: 8px 4px; }
.sc-typing span { width: 6px; height: 6px; background: var(--text2); border-radius: 50%;
  animation: sc-bounce 1.2s infinite; }
.sc-typing span:nth-child(2) { animation-delay: 0.2s; }
.sc-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes sc-bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

/* ── Shared layout primitives ────────────────────────────────────────────────
   .logo-mark — square-with-emoji brand mark, used by the rooms (toolbar)
   and mapping (top bar) React pages.
*/
.logo-mark {
  width: 36px; height: 36px; background: var(--accent);
  border-radius: 9px; display: flex; align-items: center;
  justify-content: center; font-size: 17px;
}

/* ============================================================
   ASK-CLAUDE FLOATING PANEL SHELL
   Byte-identical across roadmap/message-center/release-notes (480px);
   tenant/security used the same geometry at a wider 760px. Promoted here
   with a size modifier instead of 4+ page-local copies. Pages keep their
   own trigger button (.claude-btn already shared) and #id/.class hook —
   just add "claude-panel" alongside it.
   ============================================================ */
.claude-panel { display: none; position: fixed; bottom: 0; right: 24px; width: 480px;
  max-width: calc(100vw - 48px);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0; box-shadow: var(--shadow-lg);
  z-index: 500; flex-direction: column; overflow: hidden; max-height: 65vh; max-height: 65dvh; }
.claude-panel.open { display: flex; }
.claude-panel-lg { width: 760px; max-height: 80vh; max-height: 80dvh; }
@media (max-width: 820px) { .claude-panel-lg { width: 480px; max-height: 65vh; max-height: 65dvh; } }

/* ============================================================
   EMAIL-SELECT BAR — byte-identical in roadmap + message-center, close
   variant in release-notes. Appears once at least one card is checked
   via .card-check; the digest-recipient input + selection count live here.
   ============================================================ */
.card-check { width: 15px; height: 15px; cursor: pointer; accent-color: var(--accent);
  flex-shrink: 0; margin-top: 4px; position: relative; z-index: 1; }
.email-bar { display: none; align-items: center; gap: 8px; margin-bottom: 12px;
  flex-wrap: wrap; padding: 12px 16px;
  background: oklch(from var(--bg) calc(l + 0.08) c h / 0.4);
  border: 1px solid var(--border-on-bg); border-radius: var(--radius-sm);
  backdrop-filter: blur(8px); }
.email-bar.visible { display: flex; }
body.light .email-bar { background: oklch(from var(--bg) calc(l - 0.06) c h / 0.5); }
.email-input { flex: 1; min-width: 180px;
  background: oklch(from var(--bg) calc(l + 0.08) c h / 0.5);
  border: 1px solid var(--border-on-bg); border-radius: var(--radius-sm);
  padding: 8px 12px; color: var(--text-on-bg); font-family: var(--font-mono);
  font-size: 12px; outline: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
body.light .email-input { background: oklch(from var(--bg) calc(l - 0.10) c h / 0.5); }
.email-input:focus { border-color: oklch(from var(--accent) l c h / 0.5); box-shadow: 0 0 0 3px var(--accent-d); }
.sel-count { font-family: var(--font-mono); font-size: 11px;
  color: var(--text-on-bg3); white-space: nowrap; min-width: 80px; }

/* ============================================================
   NOTICE — small inline info/warn/error banner. Four spellings of the
   same component existed (roadmap .notice-err, message-center .notice-error,
   zoom-app-updates .err-bar, security .error-text) — this is the union,
   both err/error spellings kept as aliases so no markup rename is forced.
   ============================================================ */
.notice { padding: 16px; font-family: var(--font-mono); font-size: 12px; border-radius: var(--radius-sm); }
.notice-err, .notice-error { background: var(--red-dim); border: 1px solid oklch(from var(--red-ink) l c h / 0.25); color: var(--red-ink); }
.notice-warn { background: var(--amber-dim); border: 1px solid oklch(from var(--amber) l c h / 0.30); color: var(--amber); }
.notice-muted { color: var(--text-on-bg3); }

/* ============================================================
   COPY BUTTON — ghost mono button for "copy HTML/text" toolbars. Was
   duplicated near-identically as .mc-copy-btn (message-center + create-room,
   byte-identical) and .mtr-copy-btn (release-notes, minor padding diff).
   ============================================================ */
.copy-bar { display: flex; justify-content: flex-end; gap: 6px;
  margin: -6px 0 6px; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.copy-btn { display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--border); color: var(--text3);
  font-family: var(--font-mono); font-size: 11px; cursor: pointer;
  padding: 5px 10px; border-radius: var(--radius-xs);
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.copy-btn:hover { color: var(--accent); border-color: oklch(from var(--accent) l c h / 0.5);
  background: oklch(from var(--accent) l c h / 0.06); }
.copy-btn.copied { color: var(--green); border-color: oklch(from var(--green) l c h / 0.5); }
.copy-btn.copying { opacity: 0.6; cursor: wait; }

/* ============================================================
   SECTION LABEL — small uppercase mono divider heading. 3+ copies
   (admin-settings, create-room, tenant).
   ============================================================ */
.section-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-on-bg3);
  margin: 40px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border-on-bg);
}
.section-label:first-child { margin-top: 0; }

/* ============================================================
   EXPORT DROPDOWN — CSV/JSON/HTML menu. Near-identical in roadmap +
   release-notes; supports both the plain-display and .open toggle styles.
   ============================================================ */
.exp-wrap { position: relative; display: inline-block; }
.exp-menu { display: none; position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; z-index: 100; min-width: 130px;
  box-shadow: var(--shadow-lg); }
.exp-menu.open { display: block; }
.exp-item { display: block; width: 100%; padding: 10px 16px; background: none; border: none;
  color: var(--text); font-family: var(--font-mono); font-size: 11px; text-align: left; cursor: pointer;
  transition: background var(--dur-fast) var(--ease); }
.exp-item:hover { background: var(--accent-d); }

/* ============================================================
   EMPTY STATE — "no results" placeholder. 6 competing page-local copies
   (firmware, zoom-app-updates, rooms, notifications, cli-maker,
   release-notes .mtr-empty) with varying flex/text-align shapes — this is
   the flex-column centered version (the more common of the two shapes).
   ============================================================ */
.empty-state { display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: 80px 20px; text-align: center;
  color: var(--text-on-bg3); font-family: var(--font-mono); font-size: 14px; }
.empty-icon { font-size: 40px; opacity: 0.5; }

/* Teams call-quality widget — shared by the Tenant page card and the
   rooms Room-Detail modal. */
.tcq-metrics {
  display: flex; flex-wrap: wrap; gap: 18px; padding: 14px 0;
  font-family: var(--font-mono); font-size: 12px; color: var(--text2);
}
.tcq-metrics b { color: var(--text); font-weight: 700; }
.tcq-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 11px; }
.tcq-table th {
  text-align: left; color: var(--text3); font-weight: 700; font-size: 10px;
  text-transform: uppercase; letter-spacing: .05em; padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}
.tcq-table th:not(:first-child), .tcq-table td:not(:first-child) { text-align: right; }
.tcq-table td { padding: 6px 10px; color: var(--text2); border-bottom: 1px solid oklch(from var(--border) l c h / 0.5); }
.tcq-table tr:last-child td { border-bottom: none; }
.tcq-note { font-size: 10px; color: var(--text3); margin-top: 10px; line-height: 1.5; }


/* ============================================================
   PHONE TIER (≤600px) — touch targets + iOS input-zoom guard +
   bottom-sheet Claude panel. Lives at the END of the file so it
   out-orders every component defined above at equal specificity.
   (.fchip's touch bump lives in feed-header.css, which loads after
   this file.)
   ============================================================ */
@media (max-width: 600px) {
  input[type="text"], input[type="email"], input[type="url"], input[type="password"],
  input[type="search"], input[type="number"], select, textarea { font-size: 16px; }
  .btn-sm, .copy-btn { padding: 8px 12px; }
  .icon-btn { padding: 9px 14px; }
  .exp-item { padding: 13px 16px; }
  .card-check { width: 18px; height: 18px; }
  .screen-pad { padding: 16px 14px 60px; }
  /* Ask-Claude panel becomes a full-width bottom sheet */
  .claude-panel, .claude-panel-lg {
    left: 0; right: 0; width: 100%; max-width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 80vh; max-height: 80dvh;
  }
}
