/* ============================================================
   Full Service CM Hub — styles
   Spec: §5 UX/UI. Dark + light. No emojis in chrome.
   ============================================================ */

/* ---------- design tokens ---------- */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, "Cascadia Code", monospace;

  --fs-h1: 28px;
  --fs-h2: 22px;
  --fs-h3: 18px;
  --fs-body: 15px;
  --fs-small: 13px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --topbar-h: 56px;
  --tabbar-h: 44px;
  --leftnav-w: 260px;
  --leftnav-w-collapsed: 48px;
}

/* light (default) */
:root,
:root[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #e2e8f0;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #475569;
  --text-faint: #94a3b8;
  --accent: #0ea5e9;
  --accent-strong: #0284c7;
  --success: #16a34a;
  --warning: #ca8a04;
  --alert: #dc2626;
  --focus-ring: 0 0 0 2px #0ea5e9, 0 0 0 4px rgba(14,165,233,0.25);
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.06);
  --shadow-md: 0 2px 8px rgba(15,23,42,0.08);
  --search-hit: rgba(250, 204, 21, 0.55);
}

:root[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #243244;
  --surface-3: #334155;
  --border: #334155;
  --border-strong: #475569;
  --text: #f1f5f9;
  --text-muted: #cbd5e1;
  --text-faint: #64748b;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --success: #4ade80;
  --warning: #facc15;
  --alert: #f87171;
  --focus-ring: 0 0 0 2px #38bdf8, 0 0 0 4px rgba(56,189,248,0.3);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 2px 12px rgba(0,0,0,0.5);
  --search-hit: rgba(250, 204, 21, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-2: #243244;
    --surface-3: #334155;
    --border: #334155;
    --border-strong: #475569;
    --text: #f1f5f9;
    --text-muted: #cbd5e1;
    --text-faint: #64748b;
    --accent: #38bdf8;
    --accent-strong: #0ea5e9;
    --success: #4ade80;
    --warning: #facc15;
    --alert: #f87171;
    --focus-ring: 0 0 0 2px #38bdf8, 0 0 0 4px rgba(56,189,248,0.3);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 2px 12px rgba(0,0,0,0.5);
    --search-hit: rgba(250, 204, 21, 0.4);
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--text-muted);
}

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

/* lucide icons sized */
[data-lucide] { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center;
  padding: 0 var(--space-5);
  gap: var(--space-5);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: var(--space-2); color: var(--text); font-weight: 600; }
.logo:hover { text-decoration: none; }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white; font-size: 12px; font-weight: 700; letter-spacing: 0.5px;
}

.cm-picker { display: flex; gap: var(--space-2); }
.cm-chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: var(--fs-small);
  transition: background 100ms, color 100ms, border-color 100ms;
}
.cm-chip:hover { background: var(--surface-2); color: var(--text); }
.cm-chip[aria-pressed="true"] {
  background: var(--accent); color: white; border-color: var(--accent);
}
.cm-chip[aria-pressed="true"] .cm-avatar { background: rgba(255,255,255,0.25); }
.cm-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text);
  font-size: 10px; font-weight: 700;
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }

.search-trigger {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: var(--surface-2);
  font-size: var(--fs-small);
  min-width: 220px;
}
.search-trigger:hover { color: var(--text); }
.search-label { flex: 1; text-align: left; }

.icon-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  border: 1px solid transparent;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.icon-btn-label { font-size: 11px; font-weight: 600; letter-spacing: 0.4px; }

.health-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-faint);
  margin-left: var(--space-2);
}
.health-dot[data-health="ok"] { background: var(--success); }
.health-dot[data-health="warn"] { background: var(--warning); }
.health-dot[data-health="bad"] { background: var(--alert); }

/* ---------- tabbar ---------- */
.tabbar {
  position: sticky; top: var(--topbar-h); z-index: 20;
  height: var(--tabbar-h);
  display: flex; gap: var(--space-3);
  padding: 0 var(--space-5);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.tab {
  position: relative;
  display: inline-flex; align-items: center;
  padding: 0 4px;
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--text-muted);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--accent);
}

/* ---------- shell ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--leftnav-w) 1fr;
  min-height: calc(100vh - var(--topbar-h) - var(--tabbar-h));
}
.shell:has([data-view="picker-landing"]:not([hidden])) {
  grid-template-columns: 1fr;
}
@media (max-width: 1100px) {
  .shell { grid-template-columns: var(--leftnav-w-collapsed) 1fr; }
}

/* Hide topbar & tabbar before a CM is chosen — avoids flash on load */
body[data-cm=""] .topbar,
body[data-cm=""] .tabbar { display: none !important; }

/* ---------- picker landing ---------- */
.picker-logos {
  display: flex; align-items: center; justify-content: center;
  gap: var(--space-8); margin-bottom: var(--space-7);
  padding: var(--space-5) var(--space-8);
}
.picker-logo-wrap {
  background: #fff; border-radius: 10px;
  padding: 12px 24px;
  display: flex; align-items: center;
}
.picker-logo {
  height: 40px; width: auto;
  max-width: 190px; max-height: 40px;
  object-fit: contain; display: block;
}
.picker-logo-sep { font-size: 28px; font-weight: 300; color: var(--text-muted); flex-shrink: 0; }
.picker-logo-sep { font-size: 28px; font-weight: 300; color: var(--text-muted); flex-shrink: 0; }

.picker-landing {
  padding: var(--space-8) var(--space-5);
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.picker-landing h1 { font-size: var(--fs-h1); margin: 0 0 var(--space-6); }
.picker-grid {
  display: grid; gap: var(--space-5);
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
}
.picker-card {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--space-4); padding: var(--space-8) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 100ms, transform 100ms, box-shadow 100ms;
  cursor: pointer;
}
.picker-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.picker-avatar {
  width: 72px; height: 72px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  font-size: 22px; font-weight: 700; letter-spacing: 0.5px;
}
.picker-name { font-weight: 600; font-size: 1.15rem; }

/* ---------- left nav ---------- */
.leftnav {
  position: sticky; top: calc(var(--topbar-h) + var(--tabbar-h));
  align-self: start;
  height: calc(100vh - var(--topbar-h) - var(--tabbar-h));
  overflow-y: auto;
  padding: var(--space-4) var(--space-3);
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.leftnav-section { margin-bottom: var(--space-4); }
.leftnav-header {
  display: flex; align-items: center; gap: 6px;
  width: 100%;
  padding: 4px 6px;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.2px;
  text-transform: none;
  border-radius: var(--radius-sm);
  text-align: left;
}
.leftnav-header:hover { background: var(--surface-2); }
.leftnav-header[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.chev { display: inline-block; transition: transform 120ms; width: 12px; height: 12px; }
.leftnav-children { list-style: none; padding: 0 0 0 18px; margin: 4px 0 0; }
.leftnav-link {
  display: block;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-small);
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -2px;
}
.leftnav-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.leftnav-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--surface-2);
}
.leftnav-link.is-filter {
  display: flex; justify-content: space-between; align-items: center;
}
.leftnav-link .count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

/* ---------- content ---------- */
.content { padding: var(--space-5) var(--space-6); max-width: 1100px; }

/* ---------- How-To pane ---------- */
.content-howto h2 { font-size: var(--fs-h2); margin-top: var(--space-6); border-bottom: 1px solid var(--border); padding-bottom: var(--space-2); }
.content-howto h3 { font-size: var(--fs-h3); margin-top: var(--space-5); }
.content-howto p { color: var(--text); }
.content-howto code { font-family: var(--font-mono); font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 3px; }
.content-howto blockquote {
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}
.callout {
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-small);
}
.callout.warn { background: rgba(220,38,38,0.08); border-left: 3px solid var(--alert); color: var(--text); }
.callout.tip { background: rgba(14,165,233,0.08); border-left: 3px solid var(--accent); color: var(--text); }
.howto-source {
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  font-size: var(--fs-small);
  color: var(--text-faint);
  border-top: 1px dashed var(--border);
}
.howto-source a { color: var(--text-muted); }
.search-hit { background: var(--search-hit); transition: background 1.6s ease-out 0.4s; }
.search-hit-fade { background: transparent !important; }

/* ---------- Dashboard pane ---------- */
.dashboard-header {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-4); flex-wrap: wrap;
}
.dashboard-header h1 { font-size: var(--fs-h2); margin: 0; }
.dashboard-meta { font-size: var(--fs-small); color: var(--text-muted); margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }
.dashboard-meta button {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: var(--fs-small);
  color: var(--text);
}
.dashboard-meta button:hover { background: var(--surface-2); }

.kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.kpi-tile {
  display: block; text-align: left;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 100%;
}
.kpi-tile:hover { border-color: var(--accent); }
.kpi-tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.kpi-label { font-size: var(--fs-small); color: var(--text-muted); }
.kpi-value { font-size: 28px; font-weight: 700; line-height: 1.1; margin-top: 2px; }
.kpi-tile[data-state="alert"] .kpi-value { color: var(--alert); }
.kpi-tile[data-state="warn"] .kpi-value { color: var(--warning); }
.kpi-tile[data-state="ok"] .kpi-value { color: var(--success); }

.alerts-strip {
  margin-bottom: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.alerts-strip-header {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2);
  font-size: var(--fs-small); font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.alerts-strip ul { list-style: none; margin: 0; padding: 0; }
.alert-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 8px var(--space-3);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-small);
  cursor: pointer;
}
.alert-row:last-child { border-bottom: 0; }
.alert-row:hover { background: var(--surface-2); }
.alert-sev {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.alert-sev[data-sev="high"] { background: var(--alert); }
.alert-sev[data-sev="medium"] { background: var(--warning); }
.alert-sev[data-sev="low"] { background: var(--text-faint); }
.alert-listing { font-weight: 600; color: var(--text); font-family: var(--font-mono); font-size: 12px; }
.alert-title { color: var(--text); }
.alert-detail { color: var(--text-muted); flex: 1; }
.alert-empty { padding: var(--space-3); color: var(--text-muted); font-size: var(--fs-small); }

/* listing cards */
.listings { display: flex; flex-direction: column; gap: var(--space-2); }
.listing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.listing-card.focused { box-shadow: 0 0 0 2px var(--accent); }
.listing-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.listing-header:hover { background: var(--surface-2); }
.listing-title { display: flex; align-items: center; gap: var(--space-2); }
.listing-id { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }
.listing-name { font-weight: 600; }
.listing-meta {
  display: flex; align-items: center; gap: var(--space-3);
  font-size: var(--fs-small); color: var(--text-muted);
}
.stage-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.stage-badge[data-stage="On Market"] { background: rgba(14,165,233,0.15); color: var(--accent-strong); }
.stage-badge[data-stage="Onboarding"] { background: rgba(202,138,4,0.15); color: var(--warning); }
.stage-badge[data-stage="Due Diligence"] { background: rgba(168,85,247,0.15); color: #a855f7; }
.stage-badge[data-stage="Post-Closing"] { background: rgba(22,163,74,0.15); color: var(--success); }
.listing-status-dots { display: flex; gap: var(--space-2); }
.status-dot {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.status-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-faint);
}
.status-dot[data-state="green"]::before { background: var(--success); }
.status-dot[data-state="yellow"]::before { background: var(--warning); }
.status-dot[data-state="red"]::before { background: var(--alert); }
.listing-alerts {
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(220,38,38,0.12); color: var(--alert);
}
.listing-alerts:empty { display: none; }

.listing-body { display: none; padding: 0; border-top: 1px solid var(--border); }
.listing-card[aria-expanded="true"] .listing-body { display: block; }
.detail-tabs {
  display: flex; gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.detail-tab {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-small);
  color: var(--text-muted);
}
.detail-tab:hover { background: var(--surface-3); color: var(--text); }
.detail-tab[aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 600; }
.detail-content { padding: var(--space-4); }

/* snapshot grid */
.snapshot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}
.snapshot-facts dl {
  margin: 0;
  display: grid;
  grid-template-columns: 140px 1fr;
  row-gap: 6px;
  font-size: var(--fs-small);
}
.snapshot-facts dt { color: var(--text-muted); }
.snapshot-facts dd { margin: 0; color: var(--text); }
.snapshot-timeline { font-size: var(--fs-small); }
.snapshot-timeline ol { list-style: none; padding: 0; margin: 0; }
.snapshot-timeline li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: var(--space-2);
  padding: 6px 0;
  border-left: 0;
}
.snapshot-timeline .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
  margin-top: 6px;
}
.snapshot-timeline li.current .dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(14,165,233,0.2); }
.snapshot-timeline li.done .dot { background: var(--success); }
.snapshot-timeline .when { color: var(--text-faint); font-size: 11px; }

/* detail tables */
table.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
}
table.detail-table th, table.detail-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
table.detail-table th {
  color: var(--text-muted); font-weight: 600;
  background: var(--surface-2);
}
table.detail-table tr.ghosted td { color: var(--alert); }

.ds-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: var(--fs-small);
}
.ds-link:hover { background: var(--surface-2); text-decoration: none; }

/* banners */
.banner {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--fs-small);
  margin-bottom: var(--space-3);
}
.banner.warn { background: rgba(202,138,4,0.12); border-left: 3px solid var(--warning); color: var(--text); }
.banner.error { background: rgba(220,38,38,0.12); border-left: 3px solid var(--alert); color: var(--text); }
.banner.info { background: rgba(14,165,233,0.10); border-left: 3px solid var(--accent); color: var(--text); }

/* ---------- search modal ---------- */
.search-modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,23,42,0.55);
  display: flex; justify-content: center;
  padding-top: 80px;
}
.search-card {
  width: min(640px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-height: 70vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.search-input-row {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}
.search-input {
  flex: 1;
  border: 0; background: transparent;
  font: inherit; color: var(--text);
  outline: none;
  font-size: var(--fs-h3);
}
.search-close { color: var(--text-muted); padding: 4px; border-radius: var(--radius-sm); }
.search-close:hover { background: var(--surface-2); color: var(--text); }
.search-meta {
  padding: 6px var(--space-4);
  font-size: var(--fs-small);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.search-results {
  list-style: none; padding: var(--space-2); margin: 0;
  overflow-y: auto;
}
.search-result {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2);
}
.search-result:hover, .search-result.focused { background: var(--surface-2); }
.search-result-title { font-weight: 500; color: var(--text); }
.search-result-section { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.search-result-snippet { grid-column: 1 / -1; font-size: var(--fs-small); color: var(--text-muted); }

/* ---------- dev console ---------- */
.dev-console {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 40;
  font-size: var(--fs-small);
  max-height: 33vh;
}
.console-toggle {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 6px var(--space-3);
  color: var(--text-muted);
  width: 100%;
}
.console-count {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 11px;
}
.console-count[data-count="0"] { display: none; }
.console-log { list-style: none; margin: 0; padding: 0; max-height: 25vh; overflow-y: auto; display: none; }
.dev-console[data-open="true"] .console-log { display: block; }
.console-log li {
  padding: 4px var(--space-4);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
.console-log li.error { color: var(--alert); }
.console-log li.warn { color: var(--warning); }

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

@media (max-width: 1100px) {
  .cm-chip .cm-name { display: none; }
  .search-trigger { min-width: 0; }
  .search-label { display: none; }
  .leftnav { padding: var(--space-2); }
  .leftnav-link, .leftnav-header { font-size: 11px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .snapshot-grid { grid-template-columns: 1fr; }
}
