/* ============================================================
   OBS CONTROL CENTER — app styles
   Layered on styles/tokens.css (Meridian).
   Accent remapped to teal to match the landing-page aesthetic.
   Density: operator-terminal (28px rows, 1px hairlines).
   ============================================================ */

:root,
:root[data-theme="graphite"],
:root[data-theme="carbon"] {
  /* Teal accent override (replaces Meridian amber for this product) */
  --accent: #3FB4A1;
  --accent-hover: #56C7B4;
  --accent-dim: rgba(63, 180, 161, 0.14);
  --accent-line: rgba(63, 180, 161, 0.38);
  --on-accent: #051412;
  --selection: rgba(63, 180, 161, 0.24);
}

:root[data-theme="ivory"] {
  --accent: #2D8A7A;
  --accent-hover: #3FB4A1;
  --accent-dim: rgba(45, 138, 122, 0.1);
  --accent-line: rgba(45, 138, 122, 0.35);
  --on-accent: #FBFAF5;
  --selection: rgba(45, 138, 122, 0.2);
}

:root {
  --ok-green: #6FB27A;
  --warn: var(--amber-500);
  --danger: var(--red-600);

  /* Density — flipped by [data-density="compact"] on <html> */
  --d-row: 36px;
  --d-row-sm: 28px;
  --d-pad-x: 16px;
  --d-pad-y: 12px;
  --d-gap: 12px;
  --d-card-pad: 20px;
  --d-section-gap: 28px;
}

:root[data-density="compact"] {
  --d-row: 28px;
  --d-row-sm: 24px;
  --d-pad-x: 12px;
  --d-pad-y: 8px;
  --d-gap: 8px;
  --d-card-pad: 14px;
  --d-section-gap: 20px;
}

html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg1); }

* { box-sizing: border-box; }

button { font-family: inherit; }

/* ============================================================
   CLASSIFICATION STRIP + SHELL
   ============================================================ */

.classbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  height: 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--fg3);
  text-transform: uppercase;
}
.classbar::before, .classbar::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
  max-width: 120px;
}
.classbar .tag {
  color: var(--danger);
  border: 1px solid rgba(210,59,42,0.35);
  padding: 1px 6px;
  border-radius: 1px;
}
.classbar .mid { color: var(--fg2); }

/* Top app bar */
.topbar {
  display: flex; align-items: stretch;
  height: 48px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 40;
}
.topbar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  border-right: 1px solid var(--line);
  min-width: 260px;
}
.topbar .brand .mark {
  width: 22px; height: 22px; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  border-radius: 2px;
  font-family: var(--font-mono); font-weight: 600; font-size: 12px;
}
.topbar .brand .name { font-weight: 500; letter-spacing: -0.01em; }
.topbar .brand .sep { opacity: 0.35; }
.topbar .brand .env {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.14em; color: var(--fg3); text-transform: uppercase;
}

.topbar .nav { display: flex; align-items: stretch; }
.topbar .nav a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 16px;
  font-size: 12px;
  color: var(--fg3);
  text-decoration: none;
  border-right: 1px solid var(--line);
  transition: color 120ms var(--ease), background 120ms var(--ease), box-shadow 120ms var(--ease);
}
.topbar .nav a:hover { color: var(--fg1); background: var(--bg-hover); }
.topbar .nav a.active {
  color: var(--fg1);
  background: var(--bg-1);
  box-shadow: 0 -2px 0 var(--accent) inset;
}
.topbar .nav a svg { width: 14px; height: 14px; }

.topbar .spacer { flex: 1; border-right: 1px solid var(--line); }
.topbar .right {
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
}
.topbar .kbd {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--fg3); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 2px;
}
.topbar .avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--ink-700);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--fg1);
  border: 1px solid var(--line-strong);
}
.topbar .live {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em; color: var(--ok-green);
  display: inline-flex; align-items: center; gap: 6px;
}
.topbar .live .d {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ok-green);
  box-shadow: 0 0 0 3px rgba(111,178,122,0.18);
  animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ============================================================
   STATUS BAR (bottom)
   ============================================================ */
.statusbar {
  position: sticky; bottom: 0; z-index: 30;
  display: flex; align-items: center;
  height: 22px;
  padding: 0 16px;
  gap: 20px;
  border-top: 1px solid var(--line);
  background: var(--bg-1);
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.08em; color: var(--fg3);
}
.statusbar .cell { display: inline-flex; align-items: center; gap: 6px; }
.statusbar .d {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ok-green);
}
.statusbar .sp { flex: 1; }

/* ============================================================
   LAYOUT
   ============================================================ */
.shell {
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.shell main {
  flex: 1;
  display: flex; flex-direction: column;
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding: var(--d-section-gap) 32px;
}

/* ============================================================
   TYPE HELPERS
   ============================================================ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg3);
}
.eyebrow .dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  transform: translateY(-1px);
}
.hero-title {
  font-family: var(--font-sans);
  font-size: clamp(40px, 5vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 16px 0 12px;
}
.lede { font-size: 15px; color: var(--fg2); max-width: 580px; line-height: 1.5; }

/* Standard page-header stack — eyebrow → h1 → lede.
   Used by Setup, Settings, etc. Landing has its own bigger .hero treatment. */
.page-hero { margin-bottom: 24px; }
.page-hero .eyebrow { margin-bottom: 8px; }
.page-hero h1 {
  font-family: var(--font-sans);
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 500;
  margin: 0;
}
.page-hero .lede { margin-top: 6px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ============================================================
   BUTTONS (unified across all screens)
   ============================================================ */
.btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--fg1);
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all 120ms var(--ease);
  white-space: nowrap;
}
.btn:hover { border-color: var(--line-strong); background: var(--bg-2); color: var(--fg1); }
.btn:active { transform: scale(0.98); }
.btn svg { width: 14px; height: 14px; }

.btn.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  font-weight: 600;
}
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn.danger {
  color: var(--danger);
  border-color: rgba(210,59,42,0.35);
  background: transparent;
}
.btn.danger:hover { background: rgba(210,59,42,0.08); border-color: var(--danger); }

.btn.ghost { background: transparent; border-color: transparent; color: var(--fg2); }
.btn.ghost:hover { color: var(--fg1); background: var(--bg-hover); }

.btn.sm { font-size: 11px; padding: 5px 9px; }
.btn.sm svg { width: 12px; height: 12px; }

.btn.icon {
  padding: 0; width: 28px; height: 28px;
  justify-content: center;
  background: transparent;
  color: var(--fg3);
}
.btn.icon:hover { color: var(--fg1); background: var(--bg-hover); border-color: var(--line-strong); }

.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* Pill tabs (landing hero) */
.pilltabs {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: var(--bg-1);
  gap: 2px;
}
.pilltabs button {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 14px;
  background: transparent;
  border: 0;
  color: var(--fg3);
  cursor: pointer;
  border-radius: 999px;
  transition: all 120ms var(--ease);
}
.pilltabs button:hover { color: var(--fg1); }
.pilltabs button.active {
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

/* Mode switcher (big buttons under hero) */
.modes { display: flex; flex-wrap: wrap; gap: 10px; }
.mode-btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 12px 18px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--fg1);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  transition: all 160ms var(--ease);
  position: relative;
}
.mode-btn:hover { border-color: var(--line-strong); background: var(--bg-2); transform: translateY(-1px); }
.mode-btn svg { width: 15px; height: 15px; color: var(--fg3); }
.mode-btn:hover svg { color: var(--fg1); }
.mode-btn.primary {
  background: var(--accent-dim);
  border-color: var(--accent-line);
  color: var(--accent);
  box-shadow: 0 0 32px rgba(63,180,161,0.08);
}
.mode-btn.primary svg { color: var(--accent); }

/* ============================================================
   CHIPS
   ============================================================ */
.chip {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  border: 1px solid var(--line);
  color: var(--fg3);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip.ok { color: var(--ok-green); border-color: rgba(111,178,122,0.3); background: rgba(111,178,122,0.06); }
.chip.warn { color: var(--warn); border-color: rgba(242,160,61,0.35); background: rgba(242,160,61,0.06); }
.chip.danger { color: var(--danger); border-color: rgba(210,59,42,0.35); background: rgba(210,59,42,0.06); }
.chip.accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-dim); }
.chip .d { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ============================================================
   CARDS / PANELS
   ============================================================ */
.panel {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 2px;
}
.panel + .panel { margin-top: 12px; }

.panel-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--d-pad-y) var(--d-pad-x);
  border-bottom: 1px solid var(--line);
  min-height: 40px;
}
.panel-hd .ti {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500; color: var(--fg1);
}
.panel-hd .ti .ix {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--fg3); letter-spacing: 0.14em;
  border: 1px solid var(--line); padding: 1px 5px;
  border-radius: 2px;
}
.panel-hd .ti svg { width: 14px; height: 14px; color: var(--fg3); }
.panel-hd .hint { font-family: var(--font-mono); font-size: 10px; color: var(--fg3); letter-spacing: 0.1em; text-transform: uppercase; }

.panel-bd { padding: var(--d-card-pad); }
.panel-bd.dense { padding: 0; }

/* Field label */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--fg3);
  text-transform: uppercase;
}
.field .help { font-size: 12px; color: var(--fg3); line-height: 1.5; }

/* ============================================================
   INPUT + COMBO
   ============================================================ */
.input {
  display: flex; align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: border-color 120ms var(--ease);
}
.input:focus-within { border-color: var(--accent-line); }
.input input {
  flex: 1;
  background: transparent;
  border: 0; outline: 0;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg1);
  letter-spacing: 0;
}
.input input::placeholder { color: var(--fg4); }
.input .suffix {
  display: flex; align-items: center;
  padding-right: 4px;
}
.input .suffix button {
  height: 26px; min-width: 26px;
  padding: 0 8px;
  background: transparent;
  border: 0;
  color: var(--fg3);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: all 120ms var(--ease);
}
.input .suffix button:hover { color: var(--fg1); background: var(--bg-hover); }
.input .suffix button svg { width: 12px; height: 12px; }
.input .suffix .sep { width: 1px; height: 14px; background: var(--line); margin: 0 2px; }

/* Copy feedback */
.btn.copied, .input .suffix button.copied {
  color: var(--ok-green) !important;
}
.btn.copied svg, .input .suffix button.copied svg {
  color: var(--ok-green);
}

/* ============================================================
   TABLES / LIST ROWS
   ============================================================ */
.list { border-top: 1px solid var(--line); }
.list-row {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px var(--d-pad-x);
  border-bottom: 1px solid var(--line);
  transition: background 120ms var(--ease);
  cursor: pointer;
}
:root[data-density="compact"] .list-row {
  grid-template-columns: 28px 1fr auto auto;
  padding: 6px var(--d-pad-x);
}
.list-row:hover { background: var(--bg-hover); }
.list-row.sel { background: var(--accent-dim); box-shadow: -2px 0 0 var(--accent) inset; }

.list-row .glyph {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--fg2);
  background: var(--bg);
}
:root[data-density="compact"] .list-row .glyph { width: 22px; height: 22px; }
.list-row .glyph svg { width: 14px; height: 14px; }

.list-row .ttl { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.list-row .ttl .t { font-size: 13px; font-weight: 500; color: var(--fg1); }
.list-row .ttl .d { font-size: 11px; color: var(--fg3); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .path {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--accent); letter-spacing: 0;
}
.list-row .meta { display: flex; align-items: center; gap: 10px; }

/* Section heading inside lists */
.list-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 14px var(--d-pad-x) 8px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 88px; z-index: 5;
}
.list-hd .t {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg2); font-weight: 500;
}
.list-hd .t svg { width: 12px; height: 12px; margin-right: 6px; transform: translateY(1px); }
.list-hd .n {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--fg3); letter-spacing: 0.08em;
}
.list-hd .sp { flex: 1; }

/* ============================================================
   INFO BAR (authenticated / warning etc)
   ============================================================ */
.infobar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg-1);
  font-size: 12px;
  color: var(--fg2);
}
.infobar svg { width: 14px; height: 14px; color: var(--fg3); flex-shrink: 0; }
.infobar b { color: var(--fg1); font-weight: 500; }
.infobar.accent { border-color: var(--accent-line); background: var(--accent-dim); color: var(--accent); }
.infobar.accent svg { color: var(--accent); }
.infobar.accent b { color: var(--accent); }
.infobar.warn { border-color: rgba(242,160,61,0.3); background: rgba(242,160,61,0.06); color: var(--warn); }
.infobar.warn svg { color: var(--warn); }
.infobar.warn b { color: var(--warn); }
.infobar.danger { border-color: rgba(210,59,42,0.3); background: rgba(210,59,42,0.06); color: var(--fg2); }
.infobar.danger svg { color: var(--danger); }
.infobar.danger b { color: var(--danger); }

/* ============================================================
   SETUP WIZARD (step rail)
   ============================================================ */
.setup {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  min-height: 560px;
}
.setup .steps { display: flex; flex-direction: column; gap: 0; border-left: 1px solid var(--line); }
.setup .step {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  position: relative;
  transition: background 120ms var(--ease);
}
.setup .step:first-child { border-top: 1px solid var(--line); }
.setup .step:hover { background: var(--bg-hover); }
.setup .step.active {
  background: var(--bg-1);
  box-shadow: -2px 0 0 var(--accent) inset;
}
.setup .step.done { opacity: 0.7; }
.setup .step .ix {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--fg3); letter-spacing: 0.14em;
}
.setup .step .t { font-size: 13px; font-weight: 500; color: var(--fg1); margin-top: 4px; }
.setup .step .d { font-size: 11px; color: var(--fg3); margin-top: 2px; line-height: 1.45; }
.setup .step .check { position: absolute; right: 20px; top: 14px; color: var(--accent); }
.setup .step.done .check { display: block; }
.setup .step:not(.done) .check { display: none; }

/* ============================================================
   THEME GRID (settings)
   ============================================================ */
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.theme-card {
  position: relative;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg);
  cursor: pointer;
  transition: all 120ms var(--ease);
  overflow: hidden;
}
.theme-card:hover { border-color: var(--line-strong); }
.theme-card.sel {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.theme-card .swatch {
  display: flex; gap: 2px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: 2px;
  height: 48px; overflow: hidden;
}
.theme-card .swatch > div { flex: 1; }
.theme-card .name { font-size: 13px; font-weight: 500; }
.theme-card .meta { font-family: var(--font-mono); font-size: 10px; color: var(--fg3); letter-spacing: 0.08em; margin-top: 2px; }
.theme-card .check {
  position: absolute; top: 10px; right: 10px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center;
  opacity: 0; transition: opacity 120ms var(--ease);
}
.theme-card.sel .check { opacity: 1; }
.theme-card .check svg { width: 10px; height: 10px; }

/* ============================================================
   KV LIST (for Stream Deck / integrations)
   ============================================================ */
.kv-list { display: grid; grid-template-columns: 160px 1fr; gap: 10px 20px; font-size: 12px; }
.kv-list dt {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg3); padding-top: 4px;
}
.kv-list dd { margin: 0; color: var(--fg1); }

/* ============================================================
   TWEAKS PANEL
   ============================================================ */
.tweaks {
  position: fixed; right: 20px; bottom: 42px;
  width: 280px;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  box-shadow: var(--shadow-pop);
  z-index: 70;
  display: none;
}
.tweaks.open { display: block; }
.tweaks .hd {
  padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.tweaks .hd .t {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg2);
}
.tweaks .hd .x { cursor: pointer; color: var(--fg3); font-family: var(--font-mono); }
.tweaks .hd .x:hover { color: var(--fg1); }
.tweaks .bd { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.tweaks .row { display: flex; flex-direction: column; gap: 6px; }
.tweaks .row label {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--fg3); letter-spacing: 0.14em; text-transform: uppercase;
}
.tweaks .seg {
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line); border-radius: 2px;
}
.tweaks .seg button {
  padding: 7px 10px;
  background: transparent; border: 0;
  font-family: var(--font-sans); font-size: 12px;
  color: var(--fg3);
  cursor: pointer;
}
.tweaks .seg button + button { border-left: 1px solid var(--line); }
.tweaks .seg button.on {
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

/* ============================================================
   GEAR FAB + SETTINGS DRAWER
   ============================================================ */
/* Floating gear visible on the dashboard (other routes already expose
   Settings via TopBar). Sits above content but below modal editors,
   which use z-index 80 in their inline styles. */
.gear-fab {
  position: fixed; top: 14px; right: 16px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--bg-1); color: var(--fg2);
  border: 1px solid var(--line-strong); border-radius: 2px;
  cursor: pointer;
  box-shadow: var(--shadow-pop);
  z-index: 60;
  transition: transform 120ms var(--ease), color 120ms var(--ease), top 200ms var(--ease);
}
/* Auth banner takes ~38px at the top of the shell. Drop the gear below
   it so it doesn't overlap the Dismiss button. App.jsx writes the
   data-banner attribute on .shell. */
.shell[data-banner="on"] .gear-fab { top: 52px; }
.gear-fab:hover {
  color: var(--accent);
  transform: rotate(20deg);
  border-color: var(--accent-line, var(--line-strong));
}

/* Backdrop dims the dashboard while drawer is open. Click anywhere
   off the panel to close. */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 12, 15, 0.6);
  z-index: 75;
  animation: drawer-fade-in 160ms var(--ease);
}

/* Right-edge slide-out. Constrained width so the dashboard stays
   visible behind it — operator can sanity-check live state while
   tweaking. */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(680px, 92vw);
  background: var(--bg-1);
  border-left: 1px solid var(--line-strong);
  box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column;
  animation: drawer-slide-in 220ms var(--ease);
}
.drawer-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.drawer-hd .t {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
}
.drawer-hd .x {
  cursor: pointer; color: var(--fg3);
  font-family: var(--font-mono); font-size: 22px; line-height: 1;
  padding: 0 6px;
}
.drawer-hd .x:hover { color: var(--fg1); }
.drawer-bd {
  flex: 1; overflow: auto;
  /* Settings.jsx expects to be the page body — give it room. */
}
@keyframes drawer-slide-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@keyframes drawer-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
.page-anim { animation: fade-up 240ms var(--ease); }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.pop { animation: pop 180ms var(--ease); }
@keyframes pop {
  0% { opacity: 0; transform: scale(0.94); }
  100% { opacity: 1; transform: scale(1); }
}

/* ============================================================
   DASHBOARD (sidebar + main + preview)
   ============================================================ */
.dash { display: grid; grid-template-columns: 232px 1fr; height: 100vh; overflow: hidden; }
/* rail-slim narrows the column once the middle nav (BROADCAST / CORP DEV /
   etc) was removed — the Overlay Stack panel does that job better. */
.dash:has(.rail-slim) { grid-template-columns: 200px 1fr; }
.rail { border-right: 1px solid var(--line); background: var(--bg-1); display: flex; flex-direction: column; }
.rail-slim .rail-scroll { display: none; }
.rail-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  min-height: 64px;
}
.rail-hd .mark {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  border-radius: 2px;
  font-family: var(--font-mono); font-weight: 600; font-size: 12px;
}
.rail-brand { font-weight: 500; letter-spacing: -0.01em; font-size: 13px; white-space: nowrap; }
.rail-scroll { overflow: auto; padding: 6px 0 12px; flex: 1; }
.rail-group { padding: 8px 0 4px; }
.rail-group-hd {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.16em; color: var(--fg4);
  padding: 6px 16px; text-transform: uppercase;
}
.rail-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 16px; font-size: 12.5px;
  color: var(--fg2); cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 120ms var(--ease);
}
.rail-row:hover { background: var(--bg-hover); color: var(--fg1); }
.rail-row.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-left-color: var(--accent);
}
.rail-row svg { color: var(--fg3); flex-shrink: 0; }
.rail-row.active svg { color: var(--accent); }

.rail-ft {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}
.rail-ft-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 10px;
  background: var(--bg-1);
  border: 0;
  color: var(--fg3);
  font-family: var(--font-sans); font-size: 12px;
  cursor: pointer;
  transition: all 120ms var(--ease);
}
.rail-ft-btn:hover { color: var(--fg1); background: var(--bg-2); }

.dash-main { display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow: hidden; }
.dash-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  height: 64px;
  flex-shrink: 0;
}
.dash-title { display: flex; align-items: baseline; gap: 12px; }
.dash-title .t { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; color: var(--fg1); }
.dash-title .m {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.08em; color: var(--fg3); text-transform: uppercase;
}

.dash-stack {
  flex: 1;
  padding: 16px 20px;
  display: flex;
  min-height: 0;
  overflow: hidden;
}
.dash-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 260px 300px minmax(0, 1.6fr);
  grid-template-areas: "companies overlays preview";
  grid-template-rows: 1fr;
  gap: 14px;
  min-height: 0;
}
.area-companies { grid-area: companies; }
.area-overlays  { grid-area: overlays;  }
.area-preview   { grid-area: preview;   }
.dash-grid > .panel {
  display: flex; flex-direction: column;
  min-height: 0; min-width: 0;
  overflow: hidden;
}
.area-companies .panel-bd { overflow: auto; flex: 1; }
.area-overlays .vis-list { overflow: auto; flex: 1; }
.area-preview .preview-frame {
  flex: 1; min-height: 0;
  display: grid; place-items: center;
  padding: 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  container-type: size;
}
.preview-canvas {
  position: relative;
  /* size by the larger of width-bound or height-bound 16:9 */
  height: min(100cqh, calc(100cqw * 9 / 16));
  width: min(100cqw, calc(100cqh * 16 / 9));
  background: #000;
  overflow: hidden;
}
@media (max-width: 1400px) {
  .dash-grid { grid-template-columns: 240px 280px minmax(0,1.4fr); }
}
@media (max-width: 1200px) {
  .dash-grid { grid-template-columns: 220px 260px minmax(0,1.2fr); }
}
@media (max-width: 1000px) {
  .dash-stack { overflow: auto; }
  .dash-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "companies" "overlays" "preview";
    grid-template-rows: auto;
  }
  .area-preview .preview-frame { aspect-ratio: 16/9; }
}
.dash-cols { display: none; }

.pair { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 1400px) { .pair { grid-template-columns: 1fr 1fr; } }

.cp2 { display: flex; flex-direction: column; gap: 10px; }
.cp2-hd { display: flex; align-items: center; justify-content: space-between; }

.kind-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 2px;
  background: var(--bg);
}
.kind-toggle button {
  background: transparent; border: 0;
  color: var(--fg3);
  font-family: var(--font-sans); font-size: 10px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 1px; cursor: pointer;
  transition: all 120ms var(--ease);
}
.kind-toggle button:hover { color: var(--fg1); }
.kind-toggle button.on {
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.ticker-row { display: flex; flex-wrap: wrap; gap: 4px; }
.ticker {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  padding: 4px 8px; background: var(--bg); border: 1px solid var(--line);
  color: var(--fg2); cursor: pointer; border-radius: 2px;
  transition: all 120ms var(--ease);
}
.ticker:hover { border-color: var(--line-strong); color: var(--fg1); }
.ticker.on { background: var(--accent-dim); color: var(--accent); border-color: var(--accent-line); }

.ticker-pop {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 6px;
  z-index: 20;
  display: flex; flex-wrap: wrap; gap: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

/* --- Visibility list --- */
.vis-list { border-top: 1px solid var(--line); }
.vis-row {
  display: grid;
  grid-template-columns: 3px 16px 1fr auto 78px;
  align-items: center; gap: 10px;
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 120ms var(--ease);
  position: relative;
}
.vis-row:last-child { border-bottom: 0; }
.vis-row:hover { background: var(--bg-hover); }
.vis-row .vis-bar { align-self: stretch; background: transparent; }
.vis-row.on .vis-bar { background: var(--accent); }
.vis-row .vis-key {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--fg4);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1px 5px; line-height: 1.3;
  background: var(--bg);
  justify-self: center;
  min-width: 18px; text-align: center;
}
.vis-row.on .vis-key { color: var(--accent); border-color: var(--accent-line); background: var(--accent-dim); }
.vis-row svg:not(.inline-sel svg) { color: var(--fg3); }
.vis-row.on svg:not(.inline-sel svg) { color: var(--accent); }
.vis-row .lbl { font-size: 13px; color: var(--fg1); font-weight: 500; }
.vis-row .vis-scene {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.1em; color: var(--fg4);
  text-transform: uppercase;
}
.vis-row .vis-state {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.1em; color: var(--fg4);
  display: inline-flex; align-items: center; gap: 5px;
  min-width: 54px; justify-content: flex-end;
}
.vis-row .vis-state.live { color: var(--accent); }
.vis-row .vis-state .d {
  width: 5px; height: 5px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);
  animation: pulse 1.6s var(--ease) infinite;
}
@keyframes pulse { 0%,100% {opacity:1} 50% {opacity:0.35} }

.air-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg2);
  cursor: pointer;
  transition: all 120ms var(--ease);
  justify-self: end;
  white-space: nowrap;
}
.air-btn:hover {
  color: var(--fg1);
  border-color: var(--fg4);
  background: var(--ink-800);
}
.air-btn.on {
  color: #071813;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--accent), 0 0 12px color-mix(in srgb, var(--accent) 40%, transparent);
}
.air-btn.on:hover {
  background: color-mix(in srgb, var(--accent) 85%, white);
}

/* --- Preview card (full-width, on-canvas mock overlays) --- */
.preview-hd {
  align-items: flex-start !important;
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}
.preview-hd-left { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.preview-metrics {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0;
  padding-left: 18px;
}
.preview-card .preview-actions {
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.kv-inline {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--fg4); letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0 10px;
}
.kv-inline b { color: var(--fg1); font-weight: 500; font-size: 11px; }
.kv-inline + .kv-inline { border-left: 1px solid var(--line); }
.kv-inline:first-child { padding-left: 0; }

.live-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  animation: pulse 1.8s var(--ease) infinite;
}
.preview-frame.big { aspect-ratio: 16/9; width: 100%; }

/* Sample on-canvas overlay mocks */
.ovr { position: absolute; font-family: var(--font-sans); }
.ovr-lower {
  left: 6%; bottom: 14%; right: 32%;
  display: flex; align-items: stretch; gap: 10px;
  background: rgba(0,0,0,0.72);
  border-left: 3px solid var(--accent);
  padding: 10px 16px; backdrop-filter: blur(2px);
}
.ovr-lower-bar { display: none; }
.ovr-lower-kick {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.2em;
  color: var(--accent); text-transform: uppercase;
}
.ovr-lower-name {
  color: #fff; font-size: 18px; font-weight: 500; margin-top: 2px;
}
.ovr-widget {
  right: 6%; top: 10%;
  padding: 10px 14px;
  background: rgba(14,40,38,0.9);
  border: 1px solid rgba(63,180,161,0.35);
  min-width: 140px;
  text-align: right;
}
.ovr-widget-sym { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; color: var(--fg3); }
.ovr-widget-px { color: #fff; font-size: 22px; font-weight: 500; font-feature-settings: 'tnum'; }
.ovr-widget-ch { color: var(--accent); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; }
.ovr-fg {
  left: 6%; top: 10%;
  padding: 10px 14px;
  background: rgba(0,0,0,0.72);
  border: 1px solid var(--line-strong);
  text-align: left;
}
.ovr-fg-lbl { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.2em; color: var(--fg3); }
.ovr-fg-val { color: #fff; font-size: 28px; font-weight: 500; line-height: 1; margin-top: 4px; font-feature-settings: 'tnum'; }
.ovr-fg-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--accent); margin-top: 2px; }
.ovr-sap {
  right: 6%; bottom: 10%;
  font-family: var(--font-mono); font-size: 28px; font-weight: 700;
  color: rgba(255,255,255,0.88);
  letter-spacing: 0.05em;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.2);
}

.inline-sel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-sans); font-size: 11px;
  color: var(--fg2);
  padding: 4px 8px;
  cursor: pointer;
  outline: 0;
  transition: all 120ms var(--ease);
}
.inline-sel:hover { border-color: var(--line-strong); color: var(--fg1); }

.panel-hd .ix {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--fg3); margin-left: 6px;
}

/* Toggle switch */
.sw {
  width: 34px; height: 18px; border-radius: 999px;
  background: var(--ink-700); border: 1px solid var(--line);
  position: relative; cursor: pointer;
  transition: all 120ms var(--ease); padding: 0; flex-shrink: 0;
}
.sw .knob {
  position: absolute; left: 2px; top: 1px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--fg2);
  transition: all 160ms var(--ease);
}
.sw.on { background: var(--accent); border-color: var(--accent); }
.sw.on .knob { left: 18px; background: var(--on-accent); }

/* Preview */
.preview-col { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 20px; }
.preview-frame {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.preview-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(63,180,161,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63,180,161,0.08) 1px, transparent 1px);
  background-size: 32px 18px;
}
.preview-corners span {
  position: absolute; color: var(--accent); opacity: 0.5;
  font-family: var(--font-mono); font-size: 12px;
}
.preview-corners span:nth-child(1) { top: 6px; left: 6px; }
.preview-corners span:nth-child(2) { top: 6px; right: 6px; }
.preview-corners span:nth-child(3) { bottom: 6px; left: 6px; }
.preview-corners span:nth-child(4) { bottom: 6px; right: 6px; }
.preview-meta {
  position: absolute; bottom: 10px; left: 10px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.1em; color: var(--fg3);
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.preview-meta .d { width: 6px; height: 6px; border-radius: 50%; background: var(--ok-green); }
.preview-watermark {
  position: absolute; top: 10px; right: 10px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.16em; color: var(--accent); opacity: 0.7;
}
.preview-kv { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.preview-kv > div {
  display: flex; justify-content: space-between; font-size: 12px;
  color: var(--fg3);
}
.preview-kv b { color: var(--fg1); font-weight: 500; font-family: var(--font-mono); }

.kv-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--fg3); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink-700); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-600); }
::-webkit-scrollbar-track { background: transparent; }

/* Decorative hero corner ticks */
.ticks {
  position: absolute;
  pointer-events: none;
  color: var(--line-strong);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
}

/* Grid bg for landing hero */
.hero {
  position: relative;
  padding: 48px 0 36px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse at 30% 40%, rgba(0,0,0,0.7), transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, rgba(0,0,0,0.7), transparent 70%);
  pointer-events: none;
}
.hero > * { position: relative; }

/* Auth bar */
.authbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg-1);
  font-size: 12px;
  color: var(--fg2);
}
.authbar .lock {
  color: var(--ok-green);
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500;
}
.authbar .lock svg { width: 14px; height: 14px; }
.authbar .sp { flex: 1; }
.authbar .mono { font-size: 11px; color: var(--fg3); }

/* Two-column page */
.two-col {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 1080px) {
  .two-col { grid-template-columns: 1fr; }
}

.sidecard {
  position: sticky; top: 96px;
  display: flex; flex-direction: column; gap: 12px;
}


/* ==========================================================
   DASHBOARD v2 — "Broadcast Op Station"
   Layered OVER the v1 rules above. v1 remains for other views.
   ========================================================== */

/* ---------- TOP BAR v2 (broadcast truck) ---------- */
.dash-topbar.v2 {
  height: 64px;
  padding: 0 20px;
  gap: 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  background:
    linear-gradient(180deg, rgba(63,180,161,0.04) 0%, transparent 28%),
    var(--bg);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.dash-topbar.v2::after {
  content: '';
  position: absolute; inset: auto 0 -1px 0; height: 1px;
  background: linear-gradient(90deg, transparent 0, var(--accent-line) 20%, var(--accent-line) 80%, transparent 100%);
  opacity: 0.35;
}
.dash-topbar.v2 .dash-title { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.dash-topbar.v2 .dash-title .t { font-size: 18px; font-weight: 500; color: var(--fg1); letter-spacing: -0.01em; }
.dash-topbar.v2 .dash-breadcrumb {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.14em; color: var(--fg3); text-transform: uppercase;
}

/* Metric strip */
.tb-metrics {
  display: flex; align-items: center;
  gap: 14px;
  padding: 0 16px;
  justify-self: center;
  min-width: 0;
  overflow: hidden;
  flex-wrap: nowrap;
}
.tb-metric { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tb-k {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.18em; color: var(--fg4); text-transform: uppercase;
}
.tb-v {
  font-family: var(--font-mono); font-size: 15px;
  font-weight: 500; color: var(--fg1);
  letter-spacing: 0.02em;
  line-height: 1;
}
.tb-v em { font-style: normal; font-size: 10px; color: var(--fg3); font-weight: 400; letter-spacing: 0.06em; }
.tb-v.live { color: var(--accent); text-shadow: 0 0 10px color-mix(in srgb, var(--accent) 55%, transparent); }
.tabnum { font-variant-numeric: tabular-nums; }
.tb-sep {
  width: 1px; height: 28px;
  background: var(--line);
  flex-shrink: 0;
}

/* Audio VU meter */
.vu {
  display: grid;
  grid-template-columns: 8px 1fr;
  grid-auto-rows: 6px;
  row-gap: 3px; column-gap: 5px;
  align-items: center;
  width: 96px;
  flex-shrink: 0;
}
.vu-lab {
  font-family: var(--font-mono); font-size: 8px;
  color: var(--fg4); letter-spacing: 0.1em;
  text-align: right;
  line-height: 1;
}
.vu-bar {
  position: relative;
  height: 6px; width: 100%;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--accent) 10%, transparent) 0 70%,
    color-mix(in srgb, var(--amber-500) 10%, transparent) 70% 90%,
    color-mix(in srgb, var(--danger) 12%, transparent) 90% 100%);
  border: 1px solid var(--line);
  border-radius: 1px;
  overflow: hidden;
}
.vu-g, .vu-y, .vu-r {
  position: absolute; top: 0; bottom: 0;
  transition: width 80ms linear, left 80ms linear;
}
.vu-g { left: 0; background: var(--accent); box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent); }
.vu-y { background: var(--amber-500); }
.vu-r { background: var(--danger); }

/* Top bar right cluster */
.tb-right { display: flex; align-items: center; gap: 10px; }
.rec-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: transparent; color: var(--fg2);
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.16em;
  transition: all 120ms var(--ease);
}
.rec-btn:hover { color: var(--fg1); border-color: var(--fg4); }
.rec-btn .rec-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--fg4);
}
.rec-btn.on {
  color: #fff;
  border-color: color-mix(in srgb, var(--danger) 60%, transparent);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
}
.rec-btn.on .rec-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent),
              0 0 10px color-mix(in srgb, var(--danger) 70%, transparent);
  animation: rec-pulse 1.2s var(--ease) infinite;
}
@keyframes rec-pulse {
  0%,100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent), 0 0 10px color-mix(in srgb, var(--danger) 70%, transparent); }
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--danger) 12%, transparent), 0 0 16px color-mix(in srgb, var(--danger) 90%, transparent); }
}

/* rail hot-dot */
.rail-row { position: relative; }
.rail-row .rr-lbl { flex: 1; min-width: 0; }
.rail-row .rr-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent),
              0 0 8px color-mix(in srgb, var(--accent) 70%, transparent);
  animation: pulse 1.6s var(--ease) infinite;
  flex-shrink: 0;
}
.rail-row.hot { color: var(--fg1); }

/* ---------- GRID v2 ---------- */
.dash-stack.v2 { padding: 14px 18px; }
.dash-grid.v2 {
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  grid-template-areas: none;
  grid-template-rows: 1fr;
  gap: 14px;
}
.dash-grid.v2 .col-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  min-width: 0;
}
.dash-grid.v2 .col-left > .panel { margin-top: 0; }
.dash-grid.v2 .col-left > .area-companies > .panel-bd { padding: 10px 12px; }
.dash-grid.v2 .col-left > .area-companies .pair { gap: 8px; grid-template-columns: 1fr; }
.dash-grid.v2 .col-left > .area-overlays .panel-hd .ti { white-space: nowrap; }
.dash-grid.v2 .col-left > .area-overlays .slot-list { min-height: 0; }
.dash-grid.v2 .col-left > .area-overlays  { flex: 1 1 auto; min-height: 220px; }
@media (max-width: 1180px) {
  .dash-grid.v2 { grid-template-columns: 360px minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .dash-grid.v2 { grid-template-columns: 1fr; grid-template-rows: auto auto; }
}

/* ---------- COMPANY SLOT v2 ---------- */
.cs2 { display: flex; flex-direction: column; gap: 6px; }
.cs2-hd {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.cs2-hd-l { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cs2-letter {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
}
.cs2-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.cs2-sym { font-size: 12px; font-weight: 500; color: var(--fg1); letter-spacing: 0.02em; }
.cs2-name {
  font-size: 10px; color: var(--fg3);
  white-space: nowrap; text-overflow: ellipsis; overflow: hidden; max-width: 140px;
}
.cs2-fig {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px; align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg-1);
}
.cs2-price { display: flex; flex-direction: column; gap: 1px; }
.cs2-px {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 15px; font-weight: 500;
  color: var(--fg1); line-height: 1;
  letter-spacing: 0.01em;
}
.cs2-ch { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; }
.cs2-ch.up { color: var(--accent); }
.cs2-ch.down { color: var(--danger); }
.sparkline { width: 100%; height: 22px; display: block; }

/* ---- Compact single-row Company slot (v3) ---- */
.cs3 {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg-1);
}
.cs3-l { display: flex; align-items: center; gap: 8px; min-width: 0; position: relative; }
.cs3-idbox { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; position: relative; }
.cs3-sym {
  background: none; border: 0; padding: 0;
  font-size: 13px; font-weight: 500; color: var(--fg1);
  letter-spacing: 0.02em;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px dashed transparent;
}
.cs3-sym:hover { color: var(--accent); border-bottom-color: var(--accent-line); }
.cs3-symrow { display: inline-flex; align-items: center; gap: 4px; }
.cs3-pick {
  background: transparent; border: 1px solid var(--line); border-radius: 1px;
  color: var(--fg4); font-size: 8px; padding: 2px 5px; cursor: pointer;
  line-height: 1;
  transition: all 120ms var(--ease);
}
.cs3-pick:hover { color: var(--accent); border-color: var(--accent-line); }
.cs3-field {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: var(--bg);
  height: 20px;
  transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease);
}
.cs3-field:hover { border-color: var(--line-strong); }
.cs3-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}
.cs3-field .cs3-pick { border: 0; border-left: 1px solid var(--line); border-radius: 0; height: auto; }
.cs3-input {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 500; color: var(--fg1);
  letter-spacing: 0.04em;
  background: transparent;
  border: 0;
  padding: 0 6px;
  width: 64px;
  outline: none;
  text-transform: uppercase;
}
.cs3-input::placeholder { color: var(--fg4); letter-spacing: 0.04em; }
.cs3-caret { font-size: 9px; color: var(--fg4); }
.cs3-fig {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px; align-items: center;
  min-width: 0;
}
.cs3-price { display: flex; flex-direction: column; gap: 1px; line-height: 1; }
.cs3-kind { transform: scale(0.88); transform-origin: right center; }
.cs3-l .ticker-pop { top: 28px; left: 0; }

/* ---------- OVERLAY SLOT STACK ---------- */
.slot-list { overflow: auto; flex: 1; display: flex; flex-direction: column; }
.slot-bucket { display: flex; flex-direction: column; }
.slot-bucket-hd {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.18em; color: var(--fg4); text-transform: uppercase;
  padding: 10px 14px 6px 14px;
  display: flex; align-items: center; gap: 8px;
  border-top: 1px dashed var(--line);
}
.slot-bucket:first-child .slot-bucket-hd { border-top: 0; padding-top: 6px; }
.slot-bucket-hd.live { color: var(--accent); }
.slot-bucket-hd.live .live-pulse {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.4s var(--ease) infinite;
}

.slot {
  display: grid;
  /* Wider right column now hosts copy + open icon buttons next to the
     air toggle. minmax keeps the air-btn legible on narrow widths. */
  grid-template-columns: 28px 1fr minmax(168px, auto);
  align-items: center;
  gap: 10px;
  padding: 12px 14px 12px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
  position: relative;
  transition: background 120ms var(--ease);
}
.slot-actions {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.slot-path {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--fg3); letter-spacing: 0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 240px;
}
.slot.on .slot-path { color: color-mix(in srgb, var(--accent) 80%, var(--fg2)); }
.btn.sm.icon {
  padding: 4px 6px;
  display: inline-grid; place-items: center;
}
.btn.sm.icon svg { width: 13px; height: 13px; }
.slot:first-child { border-top: 0; }
.slot:hover { background: color-mix(in srgb, var(--fg1) 3%, transparent); }
.slot.on {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--accent) 10%, transparent) 0%,
    transparent 60%);
}
.slot-gutter {
  display: flex; align-items: center; justify-content: center;
  position: relative;
  align-self: stretch;
}
.slot-num {
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  color: var(--fg4);
  font-variant-numeric: tabular-nums;
}
.slot.on .slot-num { color: var(--accent); }
.slot-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: transparent;
}
.slot.on .slot-bar { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.slot-body {
  display: grid;
  grid-template-rows: auto auto;
  gap: 4px;
  min-width: 0;
}
.slot-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--fg1); font-weight: 500;
  min-width: 0;
}
.slot-title svg { color: var(--fg3); flex-shrink: 0; }
.slot.on .slot-title svg { color: var(--accent); }
.slot-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}
.slot-preset {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--fg4); letter-spacing: 0.08em;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: var(--bg-1);
  white-space: nowrap;
  max-width: 110px;
  overflow: hidden; text-overflow: ellipsis;
  flex-shrink: 1;
}
.slot-meta {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.slot-state {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.14em; color: var(--fg4);
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 6px;
}
.slot-state.live { color: var(--accent); }
.slot-state .d {
  width: 5px; height: 5px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 6px currentColor;
  animation: pulse 1.4s var(--ease) infinite;
}
.slot-k { display: inline-flex; gap: 2px; }
.slot-k kbd {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--fg4); padding: 1px 5px;
  border: 1px solid var(--line); border-radius: 1px;
  background: var(--bg-1);
  line-height: 1.2;
}
.slot .air-btn {
  align-self: center;
  min-width: 90px; text-align: center;
  justify-self: end;
}
.slot.on .air-btn { /* inherit from earlier rule */ }

/* ---------- PROGRAM MONITOR ---------- */
.program-card {
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
  overflow: hidden;
  background: var(--bg);
}
.program-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.program-hd-l { display: flex; align-items: center; gap: 14px; min-width: 0; }
.program-hd-r { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.program-title { font-size: 14px; font-weight: 500; color: var(--fg1); white-space: nowrap; }
.program-sub {
  display: flex; gap: 8px;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--fg4); letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tally {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px 4px 7px;
  border: 1px solid var(--line);
  border-radius: 1px;
  font-family: var(--font-mono); font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--fg3);
  background: var(--bg-1);
  text-transform: uppercase;
  white-space: nowrap;
}
.tally .tally-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fg4);
}
.tally.live {
  color: #071310;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent),
              0 0 20px color-mix(in srgb, var(--accent) 50%, transparent),
              inset 0 0 0 1px color-mix(in srgb, white 20%, transparent);
}
.tally.live .tally-dot {
  background: #071310;
  box-shadow: 0 0 6px color-mix(in srgb, white 50%, transparent);
  animation: pulse 1s var(--ease) infinite;
}

/* Monitor stage */
.program-stage {
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 0;
  padding: 16px;
  gap: 10px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(63,180,161,0.04), transparent 60%),
    var(--bg-1);
}
.program-monitor {
  flex: 1; min-height: 0;
  position: relative;
  display: grid; place-items: center;
  container-type: size;
  padding: 0;
}
.program-monitor::before {
  /* outer monitor bezel / glow */
  content: '';
  position: absolute; inset: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.015), transparent 40%),
    #05080a;
  pointer-events: none;
}
.program-canvas {
  position: relative;
  height: min(100cqh, calc(100cqw * 9 / 16));
  width:  min(100cqw, calc(100cqh * 16 / 9));
  background: #000;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent),
    inset 0 0 60px rgba(63,180,161,0.06),
    0 0 0 1px var(--line),
    0 0 40px rgba(0,0,0,0.6);
}

/* grid + scanlines */
.pm-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(63,180,161,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63,180,161,0.07) 1px, transparent 1px);
  background-size: 8.333% 11.111%;
  mask-image: radial-gradient(ellipse at 50% 50%, black 40%, rgba(0,0,0,0.6) 100%);
}
.pm-scan {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    0deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
}
.pm-safe {
  position: absolute; inset: 4%;
  pointer-events: none;
}
.pm-safe span {
  position: absolute; width: 18px; height: 18px;
  border: 1px solid rgba(255,255,255,0.22);
}
.pm-safe span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.pm-safe span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.pm-safe span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.pm-safe span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* HUD readouts */
.pm-hud-tl, .pm-hud-tr, .pm-hud-bl, .pm-hud-br {
  position: absolute;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.1em; color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  display: flex; gap: 10px; align-items: center;
  pointer-events: none;
  text-shadow: 0 0 6px rgba(0,0,0,0.9);
}
.pm-hud-tl { top: 10px; left: 12px; }
.pm-hud-tr { top: 10px; right: 12px; }
.pm-hud-bl { bottom: 10px; left: 12px; }
.pm-hud-br { bottom: 10px; right: 12px; }
.pm-hud-rec { display: inline-flex; align-items: center; gap: 6px; }
.pm-hud-recd {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--fg4);
}
.pm-hud-recd.on {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
  animation: rec-pulse 1.2s var(--ease) infinite;
}
.pm-hud-mode { color: var(--accent); letter-spacing: 0.14em; }
.pm-tally {
  padding: 3px 8px;
  border-radius: 1px;
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.4);
  font-weight: 600;
}
.pm-tally.on {
  color: #071310;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 70%, transparent);
}

/* Data ribbon */
.data-ribbon {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg);
  overflow: hidden;
  flex-shrink: 0;
}
.dr-cell {
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 2px;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.dr-cell:last-child { border-right: 0; }
.dr-cell span {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.16em; color: var(--fg4);
  text-transform: uppercase;
}
.dr-cell b {
  font-family: var(--font-mono); font-size: 12px;
  font-weight: 500; color: var(--fg1);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
@media (max-width: 1300px) {
  .data-ribbon { grid-template-columns: repeat(4, 1fr); }
  .dr-cell:nth-child(4n) { border-right: 0; }
  .dr-cell:nth-child(n+5) { border-top: 1px solid var(--line); }
}

/* ============ ENABLEMENT SWITCH ============ */
.switch {
    width: 32px; height: 18px;
    border-radius: 999px;
    background: var(--bg-1);
    border: 1px solid var(--line-strong);
    padding: 0;
    position: relative;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, opacity 160ms;
}
.switch .knob {
    position: absolute;
    top: 1px; left: 1px;
    width: 14px; height: 14px;
    border-radius: 999px;
    background: var(--fg3);
    transition: transform 160ms ease, background 160ms ease;
}
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on .knob { transform: translateX(14px); background: var(--on-accent); }
.switch.dis { opacity: 0.35; cursor: not-allowed; }
.switch.busy { opacity: 0.6; }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============ FIX: let company ticker dropdown escape panel overflow ============ */
/* The dashboard panels are clip regions (overflow: hidden); the dropdown gets cut
   off unless we explicitly allow this one panel and its body to overflow. */
.area-companies,
.area-companies .panel-bd { overflow: visible !important; }
.ticker-pop { z-index: 1000 !important; }
.cs3-idbox { position: relative; }

/* ============================================================
   STREAM DECK SETUP + DEBUG PAGE
   ============================================================ */
.sd-page { padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 24px; }
.sd-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
@media (max-width: 1000px) {
  .sd-grid { grid-template-columns: 1fr; }
}
.sd-section .panel-hd .caption {
  font-size: 11px; color: var(--fg3); margin-top: 2px;
  font-family: var(--font-sans); letter-spacing: 0;
}
.sd-page .panel { background: var(--bg-1); }

/* Connection card — colored left edge per state */
.sd-conn { border-left: 3px solid var(--line); }
.sd-conn.ok  { border-left-color: var(--accent); }
.sd-conn.warn { border-left-color: var(--warn, #d49c2b); }
.sd-conn.bad { border-left-color: var(--danger, #d97757); }
.sd-status { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 14px; }
.sd-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  background: var(--fg4);
}
.sd-dot.ok  { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.sd-dot.warn { background: var(--warn, #d49c2b); }
.sd-dot.bad { background: var(--danger, #d97757); }
.sd-status-text { font-weight: 500; }

.sd-errors {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.sd-errors-hd {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--danger, #d97757); margin-bottom: 6px;
}
.sd-error { font-size: 12px; color: var(--fg2); margin: 2px 0; }
.sd-aux {
  margin-top: 12px; padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
}

/* Setup steps */
.sd-steps { list-style: decimal inside; padding: 0; margin: 0; }
.sd-steps li { margin-bottom: 14px; }
.sd-step-t { font-weight: 500; font-size: 13px; color: var(--fg1); }
.sd-step-d { font-size: 12px; color: var(--fg2); margin: 4px 0 6px; line-height: 1.5; }
.sd-step-d em { color: var(--fg1); font-style: normal; font-weight: 500; }
.sd-step-cp {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 2px;
  font-family: var(--font-mono); font-size: 11px;
  word-break: break-all;
}
.sd-step-cp code { flex: 1; min-width: 0; word-break: break-all; }

/* Quick test list */
.sd-test-list { display: flex; flex-direction: column; gap: 6px; }
.sd-test-row {
  display: grid;
  grid-template-columns: 1fr 60px 80px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--bg-1);
}
.sd-test-row.on { border-left: 2px solid var(--accent); }
.sd-test-row.off { border-left: 2px solid var(--line); }
.sd-test-l { min-width: 0; }
.sd-test-label { font-size: 13px; color: var(--fg1); font-weight: 500; }
.sd-test-path { font-size: 10px; margin-top: 2px; }
.sd-test-state {
  font-family: var(--font-mono); font-size: 11px;
  padding: 4px 8px; text-align: center;
  border: 1px solid var(--line);
}
.sd-test-state.on { color: var(--accent); border-color: var(--accent); background: var(--accent-dim, transparent); }
.sd-test-state.off { color: var(--fg3); }
.sd-test-state.unknown { color: var(--fg4); }
.sd-test-err {
  grid-column: 1 / -1;
  font-size: 11px; color: var(--danger, #d97757);
  margin-top: 4px;
}

/* Heartbeat history table */
.sd-hb-table {
  display: flex; flex-direction: column;
  font-family: var(--font-mono); font-size: 11px;
}
.sd-hb-hd, .sd-hb-row {
  display: grid;
  grid-template-columns: 100px 80px 80px 70px 130px 1fr;
  gap: 10px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
}
.sd-hb-hd {
  color: var(--fg3); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase;
  position: sticky; top: 0; background: var(--bg-1);
}
.sd-hb-row .on { color: var(--accent); }
.sd-hb-row .off { color: var(--fg4); }

.empty {
  padding: 16px;
  text-align: center;
  color: var(--fg3); font-size: 13px;
  border: 1px dashed var(--line);
}
.dim { color: var(--fg4); }
.mono { font-family: var(--font-mono); }

/* Overlay endpoints list */
.sd-overlays {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
}
.sd-overlay-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.sd-overlay-row:last-child { border-bottom: 0; }
.sd-overlay-row:hover { background: color-mix(in srgb, var(--fg1) 3%, transparent); }
.sd-overlay-l { min-width: 0; }
.sd-overlay-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--fg1); font-weight: 500;
}
.sd-overlay-badge {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em;
  padding: 1px 6px; border: 1px solid var(--line);
  text-transform: uppercase;
}
.sd-overlay-badge.on  { color: var(--accent); border-color: var(--accent); }
.sd-overlay-badge.off { color: var(--fg4); }
.sd-overlay-path { font-size: 11px; margin-top: 2px; }
.sd-overlay-desc { font-size: 11px; color: var(--fg3); margin-top: 2px; }
.sd-overlay-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* SD request log */
.sd-reqlog {
  display: flex; flex-direction: column;
  font-family: var(--font-mono); font-size: 11px;
  max-height: 360px; overflow: auto;
  border: 1px solid var(--line);
}
.sd-reqlog-hd, .sd-reqlog-row {
  display: grid;
  grid-template-columns: 90px 60px 60px 1fr 40px;
  gap: 10px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.sd-reqlog-hd {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg3);
  position: sticky; top: 0; background: var(--bg-1); z-index: 1;
}
.sd-reqlog-row.ok   .sd-reqlog-status { color: var(--accent); }
.sd-reqlog-row.auth .sd-reqlog-status { color: var(--warn, #d49c2b); }
.sd-reqlog-row.err  .sd-reqlog-status { color: var(--danger, #d97757); }
.sd-reqlog-row.auth { background: color-mix(in srgb, var(--warn, #d49c2b) 6%, transparent); }
.sd-reqlog-row.err  { background: color-mix(in srgb, var(--danger, #d97757) 6%, transparent); }
.sd-reqlog-path { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Live activity rows */
.sd-activity {
  display: flex; flex-direction: column;
  max-height: 320px; overflow: auto;
  border: 1px solid var(--line);
}
.sd-activity-row {
  display: grid;
  grid-template-columns: 100px 1fr 60px 1fr;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  font-size: 12px;
}
.sd-activity-row:last-child { border-bottom: 0; }
.sd-activity-row.on { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.sd-activity-label { color: var(--fg1); font-weight: 500; }
.sd-activity-state {
  font-family: var(--font-mono); font-size: 10px;
  padding: 2px 6px; text-align: center;
  border: 1px solid var(--line);
}
.sd-activity-state.on  { color: var(--accent); border-color: var(--accent); }
.sd-activity-state.off { color: var(--fg3); }
.sd-activity-event { font-size: 10px; }
