/* ============================================================
 * Phase 6.10 — DARK CONTROL-ROOM THEME
 *
 * Restored from the May-2026 design: navy background (#0f1117),
 * indigo accent (#6366f1), sleek sidebar, big bold KPIs with
 * colored icon glows, FontAwesome icons.
 *
 * This file overrides the previous light-theme component layer
 * AND the Tailwind utility defaults that bled through (bg-white,
 * text-slate-*, border-slate-*) so the existing templates
 * automatically inherit the dark look without rewriting their
 * inline classes.
 * ============================================================ */

/* ---------- Theme tokens ---------- */
:root {
  --brand: #6366f1;
  --brand-rgb: 99, 102, 241;
  --brand-hover: #5558e3;
  --brand-dim: rgba(99, 102, 241, 0.15);
  --bg-page:    #0f1117;
  --bg-panel:   #1a1d26;
  --bg-elev:    #232637;
  --bg-muted:   #13151f;
  --bg-hover:   #1e2130;
  --border:     #232637;
  --border-strong: #2d3148;
  --fg-strong:  #f1f5f9;
  --fg:         #cbd5e1;
  --fg-muted:   #8892a4;
  --fg-dim:     #5f6478;
  --success:    #10b981;
  --warning:    #f59e0b;
  --danger:     #ef4444;
  --info:       #3b82f6;
  --accent:     #f97056;
}

* { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    box-sizing: border-box; }

html, body {
  background: var(--bg-page) !important;
  color: var(--fg) !important;
  height: 100%;
}

/* ---------- Override Tailwind utility classes that bleed through ---------- */
.bg-white       { background-color: var(--bg-panel) !important; }
.bg-slate-50    { background-color: var(--bg-muted) !important; }
.bg-slate-100   { background-color: var(--bg-elev) !important; }
.bg-slate-200   { background-color: var(--bg-hover) !important; }
.app-body       { background-color: var(--bg-page) !important; }

.text-slate-900 { color: var(--fg-strong) !important; }
.text-slate-800 { color: var(--fg-strong) !important; }
.text-slate-700 { color: var(--fg) !important; }
.text-slate-600 { color: var(--fg) !important; }
.text-slate-500 { color: var(--fg-muted) !important; }
.text-slate-400 { color: var(--fg-dim) !important; }
.text-slate-300 { color: var(--fg-muted) !important; }

.border-slate-100 { border-color: var(--border) !important; }
.border-slate-200 { border-color: var(--border) !important; }
.border-slate-300 { border-color: var(--border-strong) !important; }
.divide-slate-100 > * + * { border-color: var(--border) !important; }

.bg-brand-50  { background-color: rgba(99, 102, 241, 0.08) !important; }
.bg-brand-100 { background-color: rgba(99, 102, 241, 0.15) !important; }
.bg-brand-500, .bg-brand-600 { background-color: var(--brand) !important; }
.text-brand-500, .text-brand-600, .text-brand-700 { color: var(--brand) !important; }
.border-brand-100, .border-brand-200 { border-color: rgba(99, 102, 241, 0.3) !important; }

.bg-success-50  { background-color: rgba(16, 185, 129, 0.08) !important; }
.bg-success-100 { background-color: rgba(16, 185, 129, 0.15) !important; }
.bg-success-500 { background-color: var(--success) !important; }
.text-success-500, .text-success-600, .text-success-700 { color: var(--success) !important; }
.border-success-100, .border-success-200 { border-color: rgba(16, 185, 129, 0.3) !important; }

.bg-warning-50  { background-color: rgba(245, 158, 11, 0.08) !important; }
.bg-warning-100 { background-color: rgba(245, 158, 11, 0.15) !important; }
.bg-warning-500 { background-color: var(--warning) !important; }
.text-warning-500, .text-warning-600, .text-warning-700, .text-warning-800, .text-warning-900 { color: var(--warning) !important; }
.border-warning-100 { border-color: rgba(245, 158, 11, 0.3) !important; }

.bg-danger-50  { background-color: rgba(239, 68, 68, 0.08) !important; }
.bg-danger-100 { background-color: rgba(239, 68, 68, 0.15) !important; }
.bg-danger-500 { background-color: var(--danger) !important; }
.text-danger-500, .text-danger-600, .text-danger-700, .text-danger-800, .text-danger-900 { color: var(--danger) !important; }
.border-danger-100, .border-danger-200 { border-color: rgba(239, 68, 68, 0.3) !important; }

.bg-accent-300 { background-color: rgba(249, 112, 86, 0.5) !important; }
.bg-accent-500 { background-color: var(--accent) !important; }
.text-accent-300, .text-accent-500 { color: var(--accent) !important; }

/* ---------- Sidebar ---------- */
aside.sidebar,
aside[aria-label] {
  width: 220px !important;
  background: var(--bg-muted) !important;
  border-right: 1px solid var(--border) !important;
  color: var(--fg) !important;
}
.sidebar-link, .sidebar-link-active {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; margin: 2px 6px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
  position: relative;
  text-decoration: none;
}
.sidebar-link { color: var(--fg-muted); }
.sidebar-link:hover { background: rgba(99, 102, 241, 0.08); color: #c7d2fe; }
.sidebar-link-active {
  background: var(--brand-dim);
  color: var(--brand);
}
.sidebar-link-active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--brand);
  border-radius: 0 2px 2px 0;
}
.sidebar-link-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
}
.sidebar-section-title {
  padding: 10px 14px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  font-weight: 600;
}

/* Sidebar widens main pane offset */
.flex-1.md\:ms-60 { margin-inline-start: 220px !important; }
@media (max-width: 768px) {
  .flex-1.md\:ms-60 { margin-inline-start: 0 !important; }
}

/* ---------- Topbar ---------- */
.topbar, header.topbar {
  height: 56px !important;
  background: var(--bg-muted) !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--fg) !important;
  padding: 0 16px;
}
.topbar h1 {
  color: var(--fg-strong) !important;
}

/* ---------- Cards ---------- */
.card, [class*="card"] {
  background: var(--bg-panel) !important;
  border: 1px solid var(--border) !important;
  border-radius: 14px !important;
  color: var(--fg) !important;
  box-shadow: none !important;
  transition: border-color 0.15s;
}
.card:hover {
  border-color: var(--border-strong) !important;
}
.card-padding {
  padding: 1.25rem 1.4rem !important;
}

/* ---------- KPI tiles ---------- */
.kpi-tile {
  background: var(--bg-panel) !important;
  border: 1px solid var(--border) !important;
  border-radius: 14px !important;
  padding: 1.1rem 1.25rem !important;
  position: relative;
  overflow: hidden;
}
.kpi-tile::before {
  content: '';
  position: absolute;
  width: 120px; height: 120px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.08;
  bottom: -20px; right: -20px;
  background: var(--brand);
  pointer-events: none;
}
.kpi-tile:nth-child(2)::before { background: var(--success); }
.kpi-tile:nth-child(3)::before { background: var(--warning); }
.kpi-tile:nth-child(4)::before { background: var(--accent); }
.kpi-tile:nth-child(5)::before { background: var(--danger); }
.kpi-tile:nth-child(6)::before { background: var(--info); }

.kpi-label {
  font-size: 11px !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted) !important;
  margin: 0;
  font-weight: 500;
}
.kpi-value {
  font-size: 2rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  color: var(--fg-strong) !important;
  line-height: 1.1;
  margin: 0.4rem 0 0.3rem;
}

/* ---------- Pills ---------- */
.pill-info, .pill-success, .pill-warning, .pill-danger, .pill-neutral, .pill-accent {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill-info     { background: rgba(99, 102, 241, 0.15) !important; color: #a5b4fc !important; }
.pill-success  { background: rgba(16, 185, 129, 0.15) !important; color: #6ee7b7 !important; }
.pill-warning  { background: rgba(245, 158, 11, 0.15) !important; color: #fcd34d !important; }
.pill-danger   { background: rgba(239, 68, 68, 0.15) !important;  color: #fca5a5 !important; }
.pill-neutral  { background: rgba(136, 146, 164, 0.15) !important; color: var(--fg) !important; }
.pill-accent   { background: rgba(249, 112, 86, 0.15) !important; color: #fcd34d !important; }

/* ---------- Buttons ---------- */
.btn-primary {
  background: var(--brand) !important;
  color: white !important;
  border: 1px solid var(--brand) !important;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.15s;
  text-decoration: none;
}
.btn-primary:hover { background: var(--brand-hover) !important; }
.btn-secondary {
  background: var(--bg-elev) !important;
  color: var(--fg-strong) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 500;
  font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
}
.btn-secondary:hover { background: var(--bg-hover) !important; }
.btn-accent {
  background: var(--accent) !important;
  color: white !important;
  border: 1px solid var(--accent) !important;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
}
.btn-accent:hover { filter: brightness(1.08); }
.btn-sm { padding: 5px 12px !important; font-size: 12px !important; }

.btn-ghost {
  background: transparent !important;
  color: var(--fg) !important;
  border: 0 !important;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.btn-ghost:hover { background: var(--bg-hover) !important; color: var(--fg-strong) !important; }

/* ---------- Field inputs ---------- */
.field-select, select, input, textarea {
  background: var(--bg-elev) !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--fg-strong) !important;
  border-radius: 8px;
}
input:focus, select:focus, textarea:focus, .field-select:focus {
  outline: none !important;
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2) !important;
}
input::placeholder { color: var(--fg-dim) !important; }

/* ---------- Tables ---------- */
table { color: var(--fg) !important; }
table thead {
  background: transparent !important;
  border-bottom: 1px solid var(--border) !important;
}
table thead th {
  color: var(--fg-muted) !important;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
table tbody tr {
  border-bottom: 1px solid var(--border) !important;
}
table tbody tr:hover { background: var(--bg-hover) !important; }

/* ---------- Section + page titles ---------- */
.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--fg-strong) !important;
  letter-spacing: -0.02em;
}
.page-subtitle, .section-subtitle {
  color: var(--fg-muted) !important;
  font-size: 0.85rem;
}
.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg-strong) !important;
  letter-spacing: -0.01em;
}

/* ---------- Skeleton ---------- */
.skeleton-line, .skeleton-block {
  background: linear-gradient(90deg, var(--bg-elev) 25%, var(--bg-hover) 50%, var(--bg-elev) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
.skeleton-line { height: 14px; }
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

/* ---------- Modal backdrop ---------- */
.modal-backdrop:not(.hidden) {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal-panel {
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-panel) !important;
  border: 1px solid var(--border-strong) !important;
}

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 60;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  background: var(--bg-elev);
  color: var(--fg-strong);
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.toast.toast-info    { background: rgba(99, 102, 241, 0.15); border-color: rgba(99, 102, 241, 0.4); color: #a5b4fc; }
.toast.toast-warn    { background: rgba(245, 158, 11, 0.15); border-color: rgba(245, 158, 11, 0.4); color: #fcd34d; }
.toast.toast-success { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.4); color: #6ee7b7; }
.toast.toast-danger  { background: rgba(239, 68, 68, 0.15);  border-color: rgba(239, 68, 68, 0.4);  color: #fca5a5; }
.toast-fade { opacity: 0; transition: opacity 0.4s; }

/* ---------- Live indicator ---------- */
.live-indicator {
  display: inline-block;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 9999px;
  background-color: #94a3b8;
}
.live-indicator-green { background-color: var(--success); }
.live-indicator-gray  { background-color: #94a3b8; }
.live-indicator-red   { background-color: var(--danger); }
.live-indicator-pulse { animation: live-indicator-pulse 1.6s ease-in-out infinite; }
@keyframes live-indicator-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ---------- Empty state ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  gap: 0.75rem;
  color: var(--fg-muted);
}
.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg) !important;
}
.empty-state-body {
  font-size: 0.875rem;
  color: var(--fg-muted) !important;
  max-width: 28rem;
}

/* ---------- Density ---------- */
body[data-density="compact"] .card-padding { padding: 0.85rem 1rem !important; }
body[data-density="compact"] .kpi-value    { font-size: 1.5rem !important; }
body[data-density="compact"] .kpi-tile     { padding: 0.75rem 0.95rem !important; }
body[data-density="roomy"]   .card-padding { padding: 1.85rem 2rem !important; }
body[data-density="roomy"]   .kpi-value    { font-size: 2.4rem !important; }

/* ---------- Read-mode + board view ---------- */
body.read-mode aside.sidebar,
body.read-mode header.topbar,
body.read-mode footer { display: none !important; }
body.read-mode main { max-width: 740px !important; padding-top: 2.5rem; }
body.read-mode .card { box-shadow: none; border: 0; }

body[data-view="board"] aside.sidebar,
body[data-view="board"] header.topbar,
body[data-view="board"] footer,
body[data-view="board"] nav[aria-label="breadcrumb"],
body[data-view="board"] #ed-switcher-wrap,
body[data-view="board"] [data-board-hide="1"] { display: none !important; }
body[data-view="board"] .flex-1.md\:ms-60 { margin-inline-start: 0 !important; }
body[data-view="board"] main { max-width: 100% !important; padding: 1.5rem 2rem !important; }
body[data-view="board"] .grid { gap: 0.75rem !important; }

@media print {
  aside.sidebar, header.topbar, footer { display: none !important; }
  main { max-width: 100% !important; padding: 0 !important; }
  .card { break-inside: avoid; box-shadow: none !important; border: 1px solid #ddd; background: white; color: black; }
  body { background: white; color: black; }
}

/* ============================================================
 * Phase 6.9 polish layer (Cmd+K palette, cheatsheet, KPI hover,
 * drill-down, glossary, TOC, freshness chip) — re-themed dark.
 * ============================================================ */

/* TL;DR hero card */
.tldr-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(99, 102, 241, 0.04) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 14px;
  padding: 1.1rem 1.4rem;
  margin-bottom: 1rem;
}
.tldr-eyebrow {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #a5b4fc;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.tldr-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.tldr-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--fg-strong);
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}
.tldr-list .tldr-icon {
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.05rem;
}
.tldr-list li.tldr-success { background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.3); }
.tldr-list li.tldr-warn    { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.3); }
.tldr-list li.tldr-info    { background: rgba(99, 102, 241, 0.08); border-color: rgba(99, 102, 241, 0.3); }

/* Per-panel takeaway */
.panel-takeaway {
  font-size: 0.8125rem;
  color: var(--fg-muted) !important;
  font-style: italic;
  padding: 0.5rem 0.75rem;
  background: var(--bg-elev);
  border-inline-start: 3px solid var(--brand);
  border-radius: 4px;
  margin: 0.25rem 0 0.85rem 0;
  line-height: 1.45;
}

/* Info-icon (?) */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-inline-start: 0.35rem;
  border-radius: 999px;
  background: var(--bg-hover);
  color: var(--fg-muted);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: help;
  vertical-align: middle;
  border: 0;
  font-family: inherit;
  line-height: 1;
}
.info-icon:hover { background: var(--brand); color: white; }

/* KPI threshold pill */
.kpi-threshold {
  position: absolute;
  bottom: 0.45rem;
  inset-inline-start: 0.85rem;
  font-size: 0.6rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
  z-index: 2;
}
.kpi-spark {
  position: absolute;
  top: 0.5rem;
  inset-inline-end: 0.85rem;
  width: 64px;
  height: 18px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 2;
}
.kpi-tile:hover .kpi-spark { opacity: 0.85; }
.kpi-copy {
  position: absolute;
  bottom: 0.4rem;
  inset-inline-end: 0.5rem;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
  font-size: 0.65rem;
  color: var(--fg-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s;
  z-index: 2;
}
.kpi-tile:hover .kpi-copy,
.kpi-tile:focus-within .kpi-copy { opacity: 1; }
.kpi-copy:hover { background: var(--brand); color: white; border-color: var(--brand); }

/* ---------- Owner overlay (palette + cheatsheet + glossary + drill) ---------- */
.owner-overlay { position: fixed; inset: 0; z-index: 70; }
.owner-overlay.hidden { display: none; }
.owner-overlay-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
  cursor: pointer;
}

.owner-palette-card,
.owner-cheatsheet-card,
.owner-glossary-card,
.owner-drill-card {
  position: relative;
  margin: 12vh auto 0;
  max-width: 580px;
  background: var(--bg-panel);
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  color: var(--fg);
  display: flex;
  flex-direction: column;
}
.owner-palette-input,
#owner-glossary-search {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  font-size: 1rem;
  outline: none;
  background: transparent;
  color: var(--fg-strong);
}
.owner-palette-input::placeholder,
#owner-glossary-search::placeholder { color: var(--fg-dim); }

.owner-palette-list,
.owner-cheatsheet-list,
.owner-glossary-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  max-height: 60vh;
  overflow-y: auto;
}
.owner-palette-row,
.owner-cheatsheet-list li,
.owner-glossary-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1.25rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--fg);
}
.owner-palette-row.active,
.owner-palette-row:hover { background: var(--bg-hover); color: var(--fg-strong); }
.owner-palette-icon { color: var(--fg-muted); display: flex; }
.owner-palette-label { flex: 1; color: var(--fg-strong); }
.owner-palette-kind {
  font-size: 0.7rem;
  color: var(--fg-muted);
  background: var(--bg-elev);
  padding: 0.125rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.owner-palette-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.875rem;
}
.owner-palette-footer {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg-muted);
  font-size: 0.7rem;
  color: var(--fg-muted);
}
.owner-palette-footer kbd,
.owner-cheatsheet-list kbd {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  font-size: 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--fg-strong);
}
.owner-cheatsheet-head,
.owner-glossary-head,
.owner-drill-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.owner-cheatsheet-title { font-weight: 600; font-size: 0.95rem; color: var(--fg-strong); }
.owner-cheatsheet-close {
  background: transparent;
  border: 0;
  font-size: 1rem;
  cursor: pointer;
  color: var(--fg-muted);
  line-height: 1;
}
.owner-cheatsheet-close:hover { color: var(--fg-strong); }

.owner-cheatsheet-list li,
.owner-glossary-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 1.25rem;
  font-size: 0.875rem;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
}
.owner-cheatsheet-list li kbd { min-width: 80px; text-align: center; }

.owner-glossary-term { font-weight: 600; font-size: 0.875rem; color: var(--fg-strong); }
.owner-glossary-def  { font-size: 0.8125rem; color: var(--fg-muted); line-height: 1.5; margin-top: 0.2rem; }

.owner-drill-card { max-width: 720px; margin: 8vh auto 0; }
.owner-drill-body { max-height: 60vh; overflow-y: auto; padding: 1rem 1.25rem; }
.owner-drill-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; color: var(--fg); }
.owner-drill-table th,
.owner-drill-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: start;
}
.owner-drill-table th {
  background: var(--bg-muted);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  font-weight: 600;
}

/* ---------- TOC ---------- */
.owner-toc {
  position: fixed;
  top: 88px;
  inset-inline-end: 1rem;
  max-width: 200px;
  z-index: 20;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  font-size: 0.75rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  display: none;
  color: var(--fg);
}
@media (min-width: 1500px) { .owner-toc { display: block; } }
.owner-toc-eyebrow {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.owner-toc ol {
  list-style: none; padding: 0; margin: 0; counter-reset: toc;
}
.owner-toc ol li { counter-increment: toc; }
.owner-toc ol li a {
  display: block;
  padding: 0.25rem 0;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  line-height: 1.3;
}
.owner-toc ol li a::before {
  content: counter(toc) ".";
  display: inline-block;
  min-width: 18px;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
}
.owner-toc ol li a:hover { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- Freshness chip ---------- */
.owner-freshness {
  position: fixed;
  bottom: 12px;
  inset-inline-start: 12px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.owner-freshness .dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--success);
  animation: live-indicator-pulse 1.6s ease-in-out infinite;
}

body[data-view="board"] .owner-toc,
body[data-view="board"] .owner-freshness,
body.read-mode .owner-toc,
body.read-mode .owner-freshness { display: none !important; }

/* ---------- Board headline banner ---------- */
.board-headline {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(99, 102, 241, 0.05) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--fg-strong);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.board-headline-text { flex: 1; min-width: 280px; }
.board-headline-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a5b4fc;
  font-weight: 600;
}
.board-headline-h1 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 0.35rem;
  color: var(--fg-strong);
}
.board-headline-conf {
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ---------- Skeleton-to-content choreography ---------- */
@keyframes panelFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
body.panels-stagger .card {
  opacity: 0;
  animation: panelFadeUp 0.4s ease-out forwards;
}
body.panels-stagger .card:nth-child(1)  { animation-delay: 0ms; }
body.panels-stagger .card:nth-child(2)  { animation-delay: 40ms; }
body.panels-stagger .card:nth-child(3)  { animation-delay: 80ms; }
body.panels-stagger .card:nth-child(4)  { animation-delay: 120ms; }
body.panels-stagger .card:nth-child(5)  { animation-delay: 160ms; }
body.panels-stagger .card:nth-child(6)  { animation-delay: 200ms; }
body.panels-stagger .card:nth-child(7)  { animation-delay: 240ms; }
body.panels-stagger .card:nth-child(8)  { animation-delay: 280ms; }
body.panels-stagger .card:nth-child(n+9) { animation-delay: 320ms; }
@media (prefers-reduced-motion: reduce) {
  body.panels-stagger .card { animation: none; opacity: 1; }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--fg-dim); }
