/* ============================================================
   Capstone Intelligence Console — application styles
   Consumes design-system tokens from ../../styles.css
   ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
#root { height: 100vh; }
body {
  font-family: var(--font-sans);
  background: var(--bg-canvas);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  font-size: var(--text-md);
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
::selection { background: color-mix(in oklab, var(--brand) 35%, transparent); }

.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-h); flex: 0 0 auto;
  display: flex; align-items: center; gap: var(--space-5);
  padding: 0 var(--space-6);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: var(--space-3); }
.brand-mark {
  width: 26px; height: 26px; background:url(/assets/capstone-mark.svg) center/contain no-repeat;
}
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); letter-spacing: -0.02em; }
.case-switch {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-4); margin-left: var(--space-3);
  border-radius: var(--radius-md); border: 1px solid var(--border-subtle);
  background: var(--bg-inset); cursor: pointer; transition: border-color var(--dur-fast);
}
.case-switch:hover { border-color: var(--border-strong); }
.case-switch .ttl { font-weight: 600; font-size: var(--text-sm); }
.case-switch .sub { font-size: var(--text-2xs); color: var(--text-muted); font-family: var(--font-mono); }
.case-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px; max-height: 360px; overflow-y: auto;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: var(--space-2); z-index: 41; cursor: default; }
.case-menu-label { font-size: var(--text-2xs); font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--text-faint); padding: var(--space-3) var(--space-3) var(--space-2); }
.case-menu-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border-radius: var(--radius-md); transition: background var(--dur-fast); }
.case-menu-item:hover { background: var(--bg-inset); }
.case-menu-item.on { background: var(--brand-subtle); }
.case-menu-item .cm-name { font-size: var(--text-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.case-menu-item .cm-sub { font-size: var(--text-2xs); color: var(--text-muted); font-family: var(--font-mono); }
.pri-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 3px color-mix(in oklab, var(--danger) 22%, transparent); }
.engine-chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-2xs); font-weight: 600; padding: 5px 10px; border-radius: var(--radius-pill);
  background: var(--bg-inset); color: var(--text-muted); border: 1px solid var(--border-subtle); white-space: nowrap; }
.engine-chip .engine-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); }
.engine-chip.live { color: var(--success-text); border-color: color-mix(in oklab, var(--success) 35%, var(--border-subtle)); background: var(--success-subtle); }
.engine-chip.live .engine-dot { background: var(--success); box-shadow: 0 0 0 3px color-mix(in oklab, var(--success) 25%, transparent); }
.home-btn { text-decoration: none; flex: 0 0 auto; }
/* ---- entrance animations ---- */
@keyframes capFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes capPop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.dash, .timeline-view, .map-view { animation: capFadeUp .34s var(--ease-out) both; }
.kpi { animation: capPop .4s var(--ease-out) both; }
.kpi:nth-child(2){animation-delay:.04s}.kpi:nth-child(3){animation-delay:.08s}.kpi:nth-child(4){animation-delay:.12s}.kpi:nth-child(5){animation-delay:.16s}.kpi:nth-child(6){animation-delay:.2s}
.dash-cols .card { animation: capFadeUp .4s var(--ease-out) .12s both; }
.rail-right { animation: capFadeUp .28s var(--ease-out) both; }
.node { transition: opacity var(--dur-base) var(--ease-out); }
.engine-chip.live .engine-dot { animation: capPulse 2.4s ease-in-out infinite; }
@keyframes capPulse { 0%,100% { box-shadow: 0 0 0 3px color-mix(in oklab, var(--success) 25%, transparent); } 50% { box-shadow: 0 0 0 5px color-mix(in oklab, var(--success) 8%, transparent); } }
@media (prefers-reduced-motion: reduce) { .dash, .timeline-view, .map-view, .kpi, .dash-cols .card, .rail-right, .engine-chip.live .engine-dot { animation: none !important; } }

.searchbar {
  flex: 1 1 auto; max-width: 520px;
  display: flex; align-items: center; gap: var(--space-3);
  height: 36px; padding: 0 var(--space-4);
  background: var(--bg-inset); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); color: var(--text-muted);
  cursor: text; transition: border-color var(--dur-fast), background var(--dur-fast);
}
.searchbar:hover { border-color: var(--border-default); }
.searchbar.is-open { border-color: var(--brand); background: var(--bg-surface); }
.searchbar input { flex: 1; border: none; background: none; outline: none; color: var(--text-primary); font-size: var(--text-md); }
.searchbar .kbd { font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-faint); border: 1px solid var(--border-default); border-radius: 4px; padding: 1px 5px; }

.top-actions { display: flex; align-items: center; gap: var(--space-3); margin-left: auto; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: var(--radius-md); color: var(--text-secondary);
  border: 1px solid transparent; transition: background var(--dur-fast), color var(--dur-fast);
  position: relative;
}
.icon-btn:hover { background: var(--bg-inset); color: var(--text-primary); }
.icon-btn .badge {
  position: absolute; top: 3px; right: 3px; min-width: 15px; height: 15px;
  background: var(--danger); color: #fff; border-radius: 999px;
  font-size: 9px; font-weight: 700; display: grid; place-items: center; padding: 0 3px;
  border: 2px solid var(--bg-surface);
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--azure-400), var(--navy));
  color: #fff; display: grid; place-items: center; font-size: var(--text-xs); font-weight: 700;
}
.user-chip { display: flex; align-items: center; gap: var(--space-3); }
.user-chip .user-meta { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.user-chip .user-meta b { font-size: var(--text-xs); color: var(--text-primary); font-weight: 600; white-space: nowrap; }
.user-chip .user-role { font-size: 10px; color: var(--text-muted); white-space: nowrap; }

/* ---------- Graph filter panel ---------- */
.filter-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  width: 280px; padding: var(--space-4) var(--space-5) var(--space-5);
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: 0 18px 44px -12px rgba(0,0,0,0.55);
}
.filter-panel-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); }
.filter-clear { background: none; border: none; color: var(--brand); font-size: var(--text-xs); cursor: pointer; padding: 0; }
.filter-clear:hover { text-decoration: underline; }
.filter-sec { margin-bottom: var(--space-4); }
.filter-sec:last-child { margin-bottom: 0; }
.filter-sec-h { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--space-3); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  font-size: var(--text-xs); padding: 4px 10px; border-radius: 999px; cursor: pointer;
  background: var(--bg-inset); border: 1px solid var(--border-subtle); color: var(--text-secondary);
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.filter-chip:hover { color: var(--text-primary); border-color: var(--brand); }
.filter-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.filter-empty { font-size: var(--text-xs); color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-3);
  height: 36px; padding: 0 var(--space-5); border-radius: var(--radius-md);
  font-size: var(--text-md); font-weight: 600; white-space: nowrap;
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.btn:active { transform: translateY(0.5px); }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-ghost { color: var(--text-secondary); border: 1px solid var(--border-default); background: var(--bg-surface); }
.btn-ghost:hover { background: var(--bg-inset); color: var(--text-primary); }
.btn-sm { height: 30px; padding: 0 var(--space-4); font-size: var(--text-sm); }

/* ---------- Sub-bar / view switcher ---------- */
.subbar {
  height: var(--subbar-h); flex: 0 0 auto;
  display: flex; align-items: center; gap: var(--space-4);
  padding: 0 var(--space-6); background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}
.viewtabs { display: flex; gap: var(--space-1); background: var(--bg-inset); padding: 3px; border-radius: var(--radius-md); }
.viewtab {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-weight: 600; color: var(--text-muted);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.viewtab:hover { color: var(--text-primary); }
.viewtab.active { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-xs); }
[data-theme="dark"] .viewtab.active { background: var(--bg-elevated); }
.subbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }
.crumbs { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-sm); color: var(--text-muted); }
.crumbs b { color: var(--text-secondary); font-weight: 600; }

/* ---------- Body layout ---------- */
.body { flex: 1 1 auto; display: flex; min-height: 0; }
.rail-left {
  width: var(--rail-left); flex: 0 0 auto; display: flex; flex-direction: column;
  background: var(--bg-surface); border-right: 1px solid var(--border-subtle); min-height: 0;
}
.center { flex: 1 1 auto; min-width: 0; position: relative; display: flex; flex-direction: column; }
.rail-right {
  width: var(--rail-right); flex: 0 0 auto; display: flex; flex-direction: column;
  background: var(--bg-surface); border-left: 1px solid var(--border-subtle); min-height: 0;
}

/* ---------- Left rail ---------- */
.rail-tabs { display: flex; padding: var(--space-3) var(--space-4) 0; gap: var(--space-1); border-bottom: 1px solid var(--border-subtle); }
.rail-tab { flex: 1; padding: var(--space-3) 0 var(--space-4); font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); text-align: center; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color var(--dur-fast); }
.rail-tab:hover { color: var(--text-primary); }
.rail-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.rail-search { padding: var(--space-4); }
.rail-search input { width: 100%; height: 32px; padding: 0 var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--border-default); background: var(--bg-inset); color: var(--text-primary); font-size: var(--text-sm); outline: none; }
.rail-search input:focus { border-color: var(--brand); }
.rail-scroll { overflow-y: auto; flex: 1; padding: 0 var(--space-3) var(--space-5); }
.rail-group-label { font-size: var(--text-2xs); font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-faint); padding: var(--space-5) var(--space-3) var(--space-3); display: flex; justify-content: space-between; }

.entity-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-3); border-radius: var(--radius-md);
  cursor: pointer; transition: background var(--dur-fast);
}
.entity-row:hover { background: var(--bg-inset); }
.entity-row.sel { background: var(--brand-subtle); }
.ent-glyph { width: 28px; height: 28px; border-radius: var(--radius-sm); display: grid; place-items: center; flex: 0 0 auto; color: #fff; }
.ent-main { min-width: 0; flex: 1; }
.ent-label { font-size: var(--text-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ent-sub { font-size: var(--text-2xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.risk-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.flag-mini { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 5px; border-radius: 4px; }

/* ---------- Graph canvas ---------- */
.graph-wrap { flex: 1; position: relative; overflow: hidden; background:
  radial-gradient(circle at 50% 40%, color-mix(in oklab, var(--brand) 5%, transparent), transparent 60%), var(--bg-canvas); }
.graph-grid { position: absolute; inset: 0; background-image:
  linear-gradient(var(--border-subtle) 1px, transparent 1px),
  linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 34px 34px; opacity: 0.35; pointer-events: none; }
.graph-svg { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.graph-svg.panning { cursor: grabbing; }
.node {
  cursor: pointer;
}
.node-chip {
  fill: color-mix(in oklab, var(--bg-elevated) 86%, transparent); stroke: var(--border-strong); stroke-width: 1.25;
  transition: stroke var(--dur-fast);
}
.node-glass { fill: color-mix(in oklab, #fff 7%, transparent); pointer-events: none; }
.node.sel .node-chip { stroke: var(--brand); stroke-width: 2.5; }
.node.multi .node-chip { stroke: var(--brand); stroke-width: 2; }
.node-marq { fill: color-mix(in oklab, var(--brand) 14%, transparent); stroke: var(--brand); stroke-width: 1.5; stroke-dasharray: 4 3; }
.graph-marquee { fill: color-mix(in oklab, var(--brand) 10%, transparent); stroke: var(--brand); stroke-width: 1.5; stroke-dasharray: 5 4; pointer-events: none; }
.graph-svg.lasso { cursor: crosshair; }
.node-label { fill: var(--text-primary); font-family: var(--font-sans); font-weight: 600; font-size: 13px; }
.node-sub { fill: var(--text-muted); font-family: var(--font-mono); font-size: 10px; }
.link-line { stroke: var(--border-strong); stroke-width: 1.5; fill: none; }
.link-line.suspicious { stroke: var(--danger); stroke-dasharray: 5 4; stroke-width: 2; }
.link-label { fill: var(--text-muted); font-size: 10px; font-family: var(--font-mono); }
.link-label-bg { fill: var(--bg-canvas); }

.graph-controls { position: absolute; bottom: var(--space-6); right: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); z-index: 5; }
.gc-group { display: flex; flex-direction: column; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.gc-btn { width: 38px; height: 38px; display: grid; place-items: center; color: var(--text-secondary); border-bottom: 1px solid var(--border-subtle); }
.gc-btn:last-child { border-bottom: none; }
.gc-btn:hover { background: var(--bg-inset); color: var(--text-primary); }
.gc-btn.on { background: var(--brand); color: var(--on-brand); }
.gc-btn.on:hover { background: var(--brand-hover); color: var(--on-brand); }
.graph-statusbar { position: absolute; bottom: var(--space-6); left: 50%; transform: translateX(-50%); display: flex; gap: var(--space-3); align-items: center; z-index: 6; }
.gsb-sel { background: var(--bg-elevated); border: 1px solid var(--brand); color: var(--text-primary); font-size: var(--text-xs); font-weight: 500; padding: 7px 14px; border-radius: var(--radius-pill); box-shadow: var(--shadow-md); }
.gsb-sel b { font-family: var(--font-display); color: var(--brand); }
.gsb-toast { display: inline-flex; align-items: center; gap: 6px; background: var(--brand); color: var(--on-brand); font-size: var(--text-xs); font-weight: 600; padding: 7px 14px; border-radius: var(--radius-pill); box-shadow: var(--shadow-md); }
.graph-legend { position: absolute; bottom: var(--space-6); left: var(--space-6); background: color-mix(in oklab, var(--bg-surface) 90%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); box-shadow: var(--shadow-sm); z-index: 5; }
.legend-title { font-size: var(--text-2xs); font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-faint); margin-bottom: var(--space-3); }
.legend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-5); }
.legend-item { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-xs); color: var(--text-secondary); }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; }
.legend-badge { flex: 0 0 auto; display: block; }
.legend-risk { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.legend-edge { width: 5px; height: 14px; border-radius: 3px; box-sizing: border-box; flex: 0 0 auto; }

.graph-hint { position: absolute; top: var(--space-5); left: 50%; transform: translateX(-50%); background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-pill); padding: var(--space-2) var(--space-5); font-size: var(--text-xs); color: var(--text-muted); box-shadow: var(--shadow-sm); z-index: 5; display: flex; align-items: center; gap: var(--space-3); }

/* ---------- Right panel ---------- */
.panel-scroll { overflow-y: auto; flex: 1; }
.panel-empty { padding: var(--space-8) var(--space-6); }
.panel-head { padding: var(--space-6); border-bottom: 1px solid var(--border-subtle); }
.panel-eyebrow { font-size: var(--text-2xs); font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-faint); }
.panel-title { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600; letter-spacing: -0.01em; margin: var(--space-3) 0 var(--space-2); display: flex; align-items: center; gap: var(--space-3); }
.section { padding: var(--space-6); border-bottom: 1px solid var(--border-subtle); }
.section-label { font-size: var(--text-2xs); font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-faint); margin-bottom: var(--space-4); }
.kv { display: flex; justify-content: space-between; gap: var(--space-5); padding: var(--space-3) 0; font-size: var(--text-sm); border-bottom: 1px solid var(--border-subtle); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-muted); }
.kv .v { color: var(--text-primary); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }

/* screening result rows */
.screen-row { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--border-subtle); margin-bottom: var(--space-3); }
.screen-row.hit { border-color: color-mix(in oklab, var(--danger) 45%, var(--border-subtle)); background: var(--danger-subtle); }
.screen-row.pep { border-color: color-mix(in oklab, var(--warning) 45%, var(--border-subtle)); background: var(--warning-subtle); }
.screen-row.clear { }

/* multi-list screening */
.screen-summary { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) 0 var(--space-4); margin-bottom: var(--space-2); border-bottom: 1px solid var(--border-subtle); }
.scl-stat { font-size: var(--text-xs); color: var(--text-muted); }
.scl-stat b { font-family: var(--font-display); font-weight: 600; font-size: var(--text-md); margin-right: 3px; }
.screen-group-label { font-size: var(--text-2xs); font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-faint); margin: var(--space-5) 0 var(--space-2); }
.screen-line { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); }
.screen-line:last-child { border-bottom: none; }
.scl-ico { width: 22px; height: 22px; border-radius: var(--radius-sm); display: grid; place-items: center; flex: 0 0 auto; color: #fff; }
.scl-main { flex: 1; min-width: 0; }
.scl-name { font-size: var(--text-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scl-detail { font-size: var(--text-2xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scl-badge { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 5px; letter-spacing: 0.04em; flex: 0 0 auto; }
.screen-ico { width: 30px; height: 30px; border-radius: var(--radius-sm); display: grid; place-items: center; flex: 0 0 auto; }
.screen-main { flex: 1; min-width: 0; }
.screen-name { font-size: var(--text-sm); font-weight: 600; }
.screen-meta { font-size: var(--text-2xs); color: var(--text-muted); font-family: var(--font-mono); }

/* ---------- Badges / chips ---------- */
.badge-pill { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-2xs); font-weight: 700; padding: 3px 9px; border-radius: var(--radius-pill); letter-spacing: 0.03em; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-xs); font-weight: 600; padding: 4px 10px; border-radius: var(--radius-sm); background: var(--bg-inset); color: var(--text-secondary); }

/* ---------- Dashboard ---------- */
.dash { overflow-y: auto; flex: 1; padding: var(--space-7); }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: var(--space-7); gap: var(--space-5); }
.dash-title { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 600; letter-spacing: -0.02em; }
.dash-sub { color: var(--text-muted); font-size: var(--text-md); margin-top: var(--space-2); }
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-5); margin-bottom: var(--space-7); }
.kpi { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: var(--space-5); }
.kpi-label { font-size: var(--text-2xs); font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-faint); }
.kpi-val { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 600; letter-spacing: -0.02em; margin: var(--space-4) 0 var(--space-2); font-variant-numeric: tabular-nums; }
.kpi-delta { font-size: var(--text-xs); font-weight: 600; display: flex; align-items: center; gap: var(--space-2); }
.dash-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-6); }
.card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--border-subtle); }
.card-head h3 { margin: 0; font-size: var(--text-base); font-weight: 600; }
.alert-row { display: flex; gap: var(--space-4); padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--border-subtle); cursor: pointer; transition: background var(--dur-fast); }
.alert-row:hover { background: var(--bg-inset); }
.alert-row:last-child { border-bottom: none; }
.sev-bar { width: 3px; border-radius: 3px; flex: 0 0 auto; }
.alert-title { font-size: var(--text-sm); font-weight: 600; }
.alert-detail { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.alert-time { font-size: var(--text-2xs); color: var(--text-faint); font-family: var(--font-mono); margin-left: auto; white-space: nowrap; }

table.wtable { width: 100%; border-collapse: collapse; }
.wtable th { text-align: left; font-size: var(--text-2xs); font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-faint); padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--border-subtle); }
.wtable td { padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--border-subtle); font-size: var(--text-sm); }
.wtable tr { cursor: pointer; }
.wtable tbody tr:hover { background: var(--bg-inset); }
.wtable tr:last-child td { border-bottom: none; }

/* ---------- Timeline ---------- */
.timeline-view { overflow: auto; flex: 1; padding: var(--space-7); }
.tl-axis { position: relative; height: 300px; margin: var(--space-8) 0 var(--space-7); border-left: 1px solid var(--border-default); }
.tl-track { position: absolute; left: 0; right: 0; height: 2px; background: var(--border-default); top: 150px; }
.tl-tick { position: absolute; top: 150px; transform: translate(-50%, -50%); }
.tl-tick .dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--bg-canvas); }
.tl-tick .date { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); font-size: var(--text-2xs); color: var(--text-faint); font-family: var(--font-mono); white-space: nowrap; }
.tl-event { position: absolute; width: 188px; transform: translateX(-50%); cursor: pointer; }
.tl-event .box { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-4); box-shadow: var(--shadow-sm); transition: border-color var(--dur-fast), transform var(--dur-fast); }
.tl-event:hover .box { transform: translateY(-2px); border-color: var(--border-strong); }
.tl-event .stem { position: absolute; left: 50%; width: 1px; background: var(--border-default); }
.tl-ev-title { font-size: var(--text-xs); font-weight: 600; line-height: 1.3; }
.tl-ev-meta { font-size: var(--text-2xs); color: var(--text-muted); font-family: var(--font-mono); margin-top: var(--space-2); }

/* ---------- Map ---------- */
.map-view { flex: 1; position: relative; overflow: hidden; background: var(--bg-canvas); }
.map-graticule { position: absolute; inset: 0; background-image:
  linear-gradient(var(--border-subtle) 1px, transparent 1px),
  linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 8.33% 12.5%; opacity: 0.4; }
.map-marker { position: absolute; transform: translate(-50%, -50%); cursor: pointer; }
.map-pin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--bg-canvas); box-shadow: 0 0 0 3px color-mix(in oklab, var(--danger) 25%, transparent); }
.map-label { position: absolute; left: 18px; top: -4px; white-space: nowrap; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 3px 8px; font-size: var(--text-2xs); font-weight: 600; box-shadow: var(--shadow-sm); }
.map-note { position: absolute; top: var(--space-5); left: var(--space-6); font-size: var(--text-xs); color: var(--text-muted); background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; background: color-mix(in oklab, var(--ink-1000) 55%, transparent); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: var(--space-8); }
.modal { width: min(760px, 94vw); max-height: 86vh; overflow: hidden; display: flex; flex-direction: column; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-2xl); box-shadow: var(--shadow-pop); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-6) var(--space-7); border-bottom: 1px solid var(--border-subtle); }
.modal-body { overflow-y: auto; padding: var(--space-7); }
.conn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.conn { display: flex; gap: var(--space-4); padding: var(--space-5); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); align-items: flex-start; }
.conn-ico { width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--bg-inset); display: grid; place-items: center; color: var(--brand); flex: 0 0 auto; }
.conn-name { font-size: var(--text-sm); font-weight: 600; }
.conn-meta { font-size: var(--text-2xs); color: var(--text-muted); margin-top: 2px; }

/* search dropdown */
.search-pop { position: absolute; top: 46px; left: 0; right: 0; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); overflow: hidden; z-index: 50; max-height: 60vh; overflow-y: auto; }
.search-section-label { font-size: var(--text-2xs); font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-faint); padding: var(--space-4) var(--space-5) var(--space-2); }
.search-res { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-5); cursor: pointer; }
.search-res:hover { background: var(--bg-inset); }

.scrim-fade { animation: fade var(--dur-base) var(--ease-out); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.node-enter { animation: pop var(--dur-slow) var(--ease-spring); }
@keyframes pop { from { opacity: 0; } to { opacity: 1; } }

/* scrollbars */
.rail-scroll::-webkit-scrollbar, .panel-scroll::-webkit-scrollbar, .dash::-webkit-scrollbar, .modal-body::-webkit-scrollbar, .search-pop::-webkit-scrollbar { width: 10px; }
.rail-scroll::-webkit-scrollbar-thumb, .panel-scroll::-webkit-scrollbar-thumb, .dash::-webkit-scrollbar-thumb, .modal-body::-webkit-scrollbar-thumb, .search-pop::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
