/* ═══════════════════════════════════════════════════════════════
   MULTIVERSE · Blueprint Technical / Deep Space Neon
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ── Surfaces (three-tier dark) ─────────────────────────────── */
  --surface-primary:    #0A0A0A;
  --surface-secondary:  #0F0F12;
  --surface-elevated:   #141418;
  --surface-input:      #08080B;

  /* ── Foreground (three-tier text) ───────────────────────────── */
  --fg-primary:   #FFFFFF;
  --fg-secondary: #A1A1AA;
  --fg-muted:     #71717A;

  /* ── Borders (just hairlines) ───────────────────────────────── */
  --border-primary: #27272A;
  --border-subtle:  #1A1A1A;

  /* ── Accent (single hue, technical purple) ──────────────────── */
  --accent:         #A855F7;
  --accent-cyan:    #00CEC9;
  --accent-glow:    rgba(168, 92, 247, 0.15);

  /* ── Semantic / sentiment colors ────────────────────────────── */
  --pos:        #4ADE80;
  --neu:        #FACC15;
  --neg:        #F87171;
  --pending:    #60A5FA;
  --pruned:     #4B5563;
  --gold:       #FBBF24;

  /* ── Typography ─────────────────────────────────────────────── */
  --font-heading: 'Geist', 'Inter', -apple-system, sans-serif;
  --font-body:    'Inter', -apple-system, sans-serif;
  --font-mono:    'Geist Mono', 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* ── Layout tokens ──────────────────────────────────────────── */
  --sidebar-width:  340px;
  --topbar-height:  60px;
  --status-height:  32px;
  --pad-panel:      18px 20px;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100vw; height: 100vh;
  background: var(--surface-primary);
  color: var(--fg-primary);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
}
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
input, textarea { font: inherit; color: inherit; background: none; border: none; outline: none; }
ul { list-style: none; }
svg { display: block; }

/* ═══════════════════════════════════════════════════════════════
   GRID LAYOUT
   ═══════════════════════════════════════════════════════════════ */
body {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  grid-template-rows: var(--topbar-height) 1fr var(--status-height);
  grid-template-areas:
    "topbar    sidebar"
    "timeline  sidebar"
    "statusbar sidebar";
}

#workspace { display: contents; }
#top-bar           { grid-area: topbar; }
#timeline-container{ grid-area: timeline; position: relative; }
#status-bar        { grid-area: statusbar; }
#sidebar           { grid-area: sidebar; }

/* ═══════════════════════════════════════════════════════════════
   TOP BAR
   ═══════════════════════════════════════════════════════════════ */
#top-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  background: var(--surface-primary);
  border-bottom: 1px solid var(--border-primary);
}
.breadcrumb { display: flex; align-items: center; gap: 12px; }
.crumb-section {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; letter-spacing: 0.2em;
  color: var(--fg-muted);
}
.crumb-sep { color: var(--fg-muted); font-family: var(--font-mono); }
.crumb-current {
  font-family: var(--font-heading);
  font-size: 15px; font-weight: 600;
  color: var(--fg-primary);
}
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.zoom-group {
  display: flex;
  border: 1px solid var(--border-primary);
}
.zoom-btn {
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; letter-spacing: 0.15em;
  color: var(--fg-muted);
  background: transparent;
  transition: color 0.12s, background 0.12s;
}
.zoom-btn:hover { color: var(--fg-secondary); }
.zoom-btn.active { color: var(--accent); background: var(--accent-glow); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-primary);
  color: var(--fg-secondary);
  transition: color 0.12s, border-color 0.12s;
}
.icon-btn:hover { color: var(--fg-primary); border-color: var(--accent); }
.icon-btn svg { width: 13px; height: 13px; }

/* ═══════════════════════════════════════════════════════════════
   TIMELINE CANVAS
   ═══════════════════════════════════════════════════════════════ */
#timeline-container {
  overflow: auto;
  background: var(--surface-primary);
  background-image:
    radial-gradient(ellipse 60% 50% at 15% 10%, rgba(168, 92, 247, 0.04), transparent 70%),
    radial-gradient(ellipse 50% 40% at 85% 90%, rgba(0, 206, 201, 0.03), transparent 70%);
}
#timeline-container::-webkit-scrollbar { width: 6px; height: 6px; }
#timeline-container::-webkit-scrollbar-thumb { background: var(--border-primary); }
#timeline-container::-webkit-scrollbar-track { background: transparent; }

#timeline-svg {
  display: block;
  min-width: 100%;
  /* No min-height — when the tree is shorter than the viewport we want it
     sitting at the top with empty space below, not vertically centered. */
}
#timeline-container { align-items: flex-start; }

#timeline-svg .session-label {
  fill: var(--fg-primary);
  font-family: var(--font-heading);
  font-size: 14px; font-weight: 700;
}
#timeline-svg .session-meta {
  fill: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.2em;
}
#timeline-svg .session-row-bg { fill: rgba(168, 92, 247, 0.02); }
#timeline-svg .session-row-bg.active { fill: rgba(168, 92, 247, 0.05); }

/* Past zone — faint sepia/grey overlay marking the elapsed real time.
   Rendered below NOW line so the line stays crisp. */
#timeline-svg .past-zone { fill: rgba(75, 85, 99, 0.08); }

#timeline-svg .session-age {
  fill: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 600; letter-spacing: 0.15em;
}

/* NOW marker — vertical cyan line + small pill at the top */
#timeline-svg .now-line {
  stroke: var(--accent-cyan);
  stroke-width: 1.5;
  stroke-dasharray: 3 4;
  opacity: 0.75;
}
#timeline-svg .now-pill {
  fill: var(--accent-cyan);
}
#timeline-svg .now-label {
  fill: var(--surface-primary);
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 800; letter-spacing: 0.2em;
}

#timeline-svg .day-axis-line { stroke: var(--border-subtle); stroke-width: 1; stroke-dasharray: 2 6; }
#timeline-svg .day-axis-label {
  fill: var(--fg-secondary);
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700; letter-spacing: 0.2em;
}
#timeline-svg .day-axis-label.today { fill: var(--accent); }

#timeline-svg .path { fill: none; stroke-width: 2; stroke-linecap: round; }
#timeline-svg .path.alive.positive { stroke: var(--pos); }
#timeline-svg .path.alive.neutral  { stroke: var(--neu); }
#timeline-svg .path.alive.negative { stroke: var(--neg); }
#timeline-svg .path.alive.pending  { stroke: var(--pending); stroke-dasharray: 4 4; }
#timeline-svg .path.pruned {
  stroke: var(--pruned); stroke-opacity: 0.5;
  stroke-dasharray: 4 5; stroke-width: 1.5;
}

#timeline-svg .node {
  cursor: pointer;
  stroke: var(--surface-primary); stroke-width: 1.5;
  transition: stroke 0.12s, r 0.12s;
}
#timeline-svg .node.alive.positive { fill: var(--pos); }
#timeline-svg .node.alive.neutral  { fill: var(--neu); }
#timeline-svg .node.alive.negative { fill: var(--neg); }
#timeline-svg .node.alive.pending  { fill: var(--pending); }
#timeline-svg .node.pruned {
  fill: var(--pruned); stroke: none; opacity: 0.7;
}
#timeline-svg .node:hover { stroke: var(--fg-primary); }

#timeline-svg .node-halo {
  fill: none; stroke: var(--gold); stroke-width: 1.5;
  opacity: 0.7; pointer-events: none;
  animation: divergence-pulse 2.5s ease-in-out infinite;
}
@keyframes divergence-pulse {
  0%, 100% { opacity: 0.35; stroke-width: 1.2; }
  50%      { opacity: 0.9; stroke-width: 2; }
}

/* Inline SVG label removed — the HTML #hover-tooltip below takes over.
   Only the node hover highlight stays. */
#timeline-svg .node-group:hover .node,
#timeline-svg .node-group.hovered .node {
  stroke: var(--fg-primary);
  stroke-width: 2;
}

/* ─ Temporal styling — past nodes / paths are dimmed to mark "already real" ─ */
#timeline-svg .node-group.past .node     { opacity: 0.42; filter: saturate(0.55); }
#timeline-svg .node-group.past .node-halo{ opacity: 0.25; }
#timeline-svg .path.past                 { stroke-opacity: 0.38; }

/* Present column nodes get a subtle drop shadow so they read as "in flux now" */
#timeline-svg .node-group.present .node {
  filter: drop-shadow(0 0 6px currentColor);
}

#timeline-svg .session-divider { stroke: var(--border-primary); stroke-width: 1; }

/* Empty state ─────────────────────────────────────────────────── */
.empty-state {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  pointer-events: none;
  color: var(--fg-muted);
}
.empty-state.hidden { display: none; }
.empty-glyph {
  width: 48px; height: 48px;
  border: 1px solid var(--border-primary);
  display: flex; align-items: center; justify-content: center;
}
.empty-glyph svg { width: 22px; height: 22px; color: var(--accent); }
.empty-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; letter-spacing: 0.25em;
  color: var(--fg-secondary);
}
.empty-hint {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--fg-muted);
}

/* ═══════════════════════════════════════════════════════════════
   STATUS BAR
   ═══════════════════════════════════════════════════════════════ */
#status-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: var(--surface-secondary);
  border-top: 1px solid var(--border-primary);
}
.status-item { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; }
.status-dot {
  display: inline-block;
  width: 6px; height: 6px;
}
.status-dot.connected    { background: var(--pos); box-shadow: 0 0 8px rgba(74, 222, 128, 0.6); }
.status-dot.disconnected { background: var(--neg); }
.status-label {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; letter-spacing: 0.15em;
  color: var(--fg-secondary);
}
.status-divider { width: 1px; height: 14px; background: var(--border-primary); }
.status-tag {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; letter-spacing: 0.15em;
  color: var(--fg-muted);
}
.status-spacer { flex: 1; }
.model-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px;
  background: var(--surface-input);
  border: 1px solid var(--border-primary);
}
.model-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(168, 92, 247, 0.7);
}
#model-badge-text {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--fg-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════ */
#sidebar {
  background: var(--surface-secondary);
  border-left: 1px solid var(--border-primary);
  overflow-y: auto;
  display: flex; flex-direction: column;
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: var(--border-primary); }
#sidebar::-webkit-scrollbar-track { background: transparent; }

.sidebar-header {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border-primary);
}
.logo-row { display: flex; align-items: center; gap: 10px; }
.logo-box {
  width: 22px; height: 22px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  font-size: 14px; font-weight: 700;
  color: var(--fg-primary);
}
.sidebar-header h1 {
  font-family: var(--font-heading);
  font-size: 17px; font-weight: 700; letter-spacing: 0.2em;
  color: var(--fg-primary);
}
.sidebar-header .subtitle {
  display: block; margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 600; letter-spacing: 0.25em;
  color: var(--fg-muted);
}

/* ── Panel ─────────────────────────────────────────────────────── */
.panel { padding: var(--pad-panel); border-bottom: 1px solid var(--border-subtle); }
.panel.hidden { display: none; }

/* Panel titles are now <span class="panel-title"> — no h2 to bring browser
   default margin/font scaling into the layout. */
.panel-title {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; letter-spacing: 0.22em;
  color: var(--fg-muted);
  line-height: 14px;
  display: inline-block;
}
.panel-title-solo {
  margin-bottom: 12px;
}

/* Panel head — strict 14px row so icon + title + count share the exact
   same vertical center. */
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  height: 14px;
}
.panel-head .head-icon {
  width: 14px; height: 14px;
  color: var(--fg-muted);
  flex-shrink: 0;
  display: block;
}
.panel-head .panel-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--accent);
}
.panel-head .panel-id {
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--accent);
}
.panel-head .day-badge {
  margin-left: auto;
  padding: 3px 8px;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.15em;
  color: var(--accent);
}
.panel-head .day-badge .day-badge-date {
  font-weight: 500;
  letter-spacing: 0.08em;
  opacity: 0.75;
  margin-left: 2px;
}
.chevron-toggle {
  margin-left: auto;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  transition: transform 0.15s;
}
.settings-toggle { cursor: pointer; user-select: none; }
.settings-toggle:hover .chevron-toggle { color: var(--fg-secondary); }
.settings-toggle.open .chevron-toggle { transform: rotate(90deg); }

/* ── Query panel ───────────────────────────────────────────────── */
.query-input-group { display: flex; flex-direction: column; gap: 10px; }
#query-input {
  width: 100%;
  padding: 12px;
  background: var(--surface-input);
  border: 1px solid var(--border-primary);
  font-family: var(--font-body);
  font-size: 13px; line-height: 1.5;
  color: var(--fg-primary);
  resize: none;
}
#query-input::placeholder { color: var(--fg-muted); }
#query-input:focus { border-color: var(--accent); }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700; letter-spacing: 0.15em;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn-primary {
  background: var(--accent); color: var(--fg-primary);
}
.btn-primary:hover { background: #BD68FF; }
.btn-primary svg { width: 13px; height: 13px; }
.btn-secondary {
  background: var(--surface-input);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
}
.btn-secondary:hover { background: var(--accent-cyan); color: var(--surface-primary); }
.btn-secondary svg { width: 13px; height: 13px; }

#query-submit { width: 100%; }

/* ── Example query chips ───────────────────────────────────────── */
.query-examples {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 8px;
}
.query-examples-label {
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.2em;
  color: var(--fg-muted);
  margin-right: 4px;
}
.query-chip {
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--border-primary);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--fg-secondary);
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.query-chip:hover {
  border-color: var(--accent);
  color: var(--fg-primary);
  background: rgba(168, 85, 247, 0.08);
}

/* ── Cancel-generation row ─────────────────────────────────────── */
.query-cancel-row {
  display: flex; justify-content: center;
  margin-top: 6px;
}
.query-cancel-row.hidden { display: none; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border-primary);
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600; letter-spacing: 0.18em;
  color: var(--fg-muted);
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.btn-ghost:hover {
  border-color: var(--neg);
  color: var(--neg);
}
.btn-ghost:disabled { opacity: 0.4; cursor: default; }

/* ── Source progress list (#4) ─────────────────────────────────── */
.query-source-list {
  max-height: 180px;
  overflow-y: auto;
  margin-top: 8px;
  padding: 6px 8px;
  background: var(--surface-input);
  border: 1px solid var(--border-primary);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.query-source-list.hidden { display: none; }
.source-row {
  display: grid;
  grid-template-columns: 18px 14px 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  color: var(--fg-secondary);
}
.source-row .source-icon {
  text-align: center;
  font-weight: 700;
}
.source-row.ok .source-icon { color: var(--pos, #4ade80); }
.source-row.fail .source-icon { color: var(--neg, #f87171); }
.source-row.timeout .source-icon { color: var(--fg-muted); }
.source-row.skipped { opacity: 0.5; }
.source-row.skipped .source-icon { color: var(--fg-muted); }
.source-tier-badge {
  display: inline-block;
  text-align: center;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 1px 3px;
  border-radius: 2px;
  border: 1px solid currentColor;
}
.source-tier-badge.tier-a { color: rgba(168, 85, 247, 0.9); }
.source-tier-badge.tier-b { color: rgba(120, 120, 120, 0.7); }
.source-row .source-name {
  font-weight: 600;
  color: var(--fg-primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.source-row .source-detail {
  color: var(--fg-muted);
  font-size: 9px;
  letter-spacing: 0.1em;
}

/* ── Query clarification panel (B) ─────────────────────────────── */
.query-clarify {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(56, 189, 248, 0.05);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-left: 3px solid rgba(56, 189, 248, 0.7);
  border-radius: 3px;
  display: flex; flex-direction: column; gap: 8px;
}
.query-clarify.hidden { display: none; }
.qc-header {
  display: flex; align-items: center; gap: 6px;
}
.qc-icon {
  color: rgba(56, 189, 248, 0.9);
  display: inline-flex;
}
.qc-title {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; letter-spacing: 0.18em;
  color: rgba(56, 189, 248, 0.95);
}
.qc-suggestions {
  display: flex; flex-direction: column; gap: 6px;
}
.qc-card {
  display: flex; flex-direction: column;
  align-items: flex-start; gap: 3px;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid var(--border-primary);
  border-radius: 3px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.08s;
}
.qc-card:hover {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.04);
}
.qc-card:active { transform: translateY(1px); }
.qc-card-reason {
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.18em;
  color: rgba(56, 189, 248, 0.85);
  text-transform: uppercase;
}
.qc-card-variant {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--fg-primary);
  line-height: 1.4;
}
.qc-footer {
  display: flex; gap: 6px; justify-content: flex-end;
  margin-top: 4px;
}
.qc-cancel { color: var(--fg-muted); }

/* ── Synthesis stream box (#8) ─────────────────────────────────── */
.query-synthesis {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(168, 85, 247, 0.06);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 3px;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color 0.4s, background 0.4s;
}
.query-synthesis.hidden { display: none; }
.query-synthesis.done {
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(74, 222, 128, 0.06);
}
.qs-header {
  display: flex; align-items: center; gap: 6px;
}
.qs-pulse {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent, #a855f7);
  animation: qs-pulse 1.2s infinite ease-in-out;
}
.query-synthesis.done .qs-pulse {
  background: var(--pos, #4ade80);
  animation: none;
}
@keyframes qs-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.15); }
}
.qs-title {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; letter-spacing: 0.2em;
  color: rgba(168, 85, 247, 0.9);
}
.query-synthesis.done .qs-title { color: rgba(74, 222, 128, 0.9); }
.qs-text {
  margin: 0;
  max-height: 130px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.4;
  color: var(--fg-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Knowledge freshness bar (#7) ──────────────────────────────── */
.knowledge-freshness {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 3px;
}
.knowledge-freshness.hidden { display: none; }
.knowledge-freshness .kf-icon {
  width: 14px; height: 14px;
  color: rgba(56, 189, 248, 0.85);
}
.kf-title {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; letter-spacing: 0.18em;
  color: rgba(56, 189, 248, 0.95);
}
.kf-sub {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--fg-secondary);
  margin-top: 2px;
}
.kf-sub #kf-age {
  font-weight: 600;
  color: var(--fg-primary);
}
.kf-refresh {
  padding: 5px 9px;
  font-size: 9px;
  letter-spacing: 0.15em;
}

.progress-container {
  margin-top: 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.progress-container.hidden { display: none; }
.progress-bar { height: 2px; background: var(--surface-input); overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%;
  background: var(--accent);
  transition: width 0.3s;
}
.progress-fill.evolve-fill { background: var(--accent-cyan); }
.progress-text {
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.2em;
  color: var(--fg-muted);
}

/* ── Sessions list ─────────────────────────────────────────────── */
#session-list, .scrollable-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 240px;
  overflow-y: auto;
}
#session-list::-webkit-scrollbar,
.scrollable-list::-webkit-scrollbar { width: 3px; }
#session-list::-webkit-scrollbar-thumb,
.scrollable-list::-webkit-scrollbar-thumb { background: var(--border-primary); }

.session-item {
  padding: 10px 12px;
  background: var(--surface-elevated);
  border-left: 2px solid var(--border-primary);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.session-item:hover { border-left-color: var(--accent-cyan); }
.session-item.active { border-left-color: var(--accent); background: var(--accent-glow); }
.session-item .title {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  color: var(--fg-primary);
  margin-bottom: 6px;
}
.session-item .delete-btn {
  width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-muted);
}
.session-item .delete-btn:hover { color: var(--neg); }
.session-item .meta {
  display: flex; gap: 12px;
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 600; letter-spacing: 0.1em;
}
.session-item .meta .alive  { color: var(--pos); }
.session-item .meta .pruned { color: var(--pruned); }
.session-item .meta .cycle  { color: var(--fg-muted); }

/* ── Node detail panel ─────────────────────────────────────────── */
.card-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.2em;
  color: var(--fg-muted);
  margin-bottom: 6px;
}
.prediction-card {
  padding: 12px 14px;
  background: var(--surface-input);
  border-left: 2px solid var(--accent);
  margin-bottom: 12px;
}
.detail-summary {
  font-family: var(--font-body);
  font-size: 12px; line-height: 1.55;
  color: var(--fg-primary);
}
.detail-divergence {
  margin: 0 0 12px;
  padding: 8px 12px;
  background: rgba(251, 191, 36, 0.08);
  border-left: 2px solid var(--gold);
  font-family: var(--font-body);
  font-size: 11px; line-height: 1.5;
  color: var(--gold);
}

.metrics-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.metric-cell {
  padding: 10px 12px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-primary);
}
.metric-cell .card-label { margin-bottom: 8px; font-size: 8px; }

.sentiment-bar-track {
  position: relative;
  height: 4px;
  background: var(--surface-input);
  margin-bottom: 6px;
}
.sentiment-bar-fill {
  position: absolute; top: 0; bottom: 0;
  left: 50%;
  background: var(--neu);
  transition: width 0.3s, background 0.3s;
}
.sentiment-marker {
  position: absolute; top: -2px;
  width: 2px; height: 8px;
  background: var(--fg-primary);
  left: 50%;
}
.sentiment-labels {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 8px; color: var(--fg-muted);
}

.prob-track {
  height: 4px;
  background: var(--surface-input);
  margin-bottom: 6px;
  position: relative;
}
.prob-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: var(--accent);
  transition: width 0.3s;
}
.prob-value {
  font-family: var(--font-mono);
  font-size: 14px; font-weight: 700;
  color: var(--fg-primary);
}

.events-block { margin-bottom: 12px; }
.events-block:empty { display: none; }
.event-items, .risk-items, .catalyst-items {
  display: flex; flex-direction: column; gap: 4px;
}
.event-items li, .risk-items li, .catalyst-items li {
  padding: 6px 10px 6px 8px;
  background: var(--surface-elevated);
  font-family: var(--font-body);
  font-size: 11px; line-height: 1.45;
  color: var(--fg-secondary);
  border-left: 2px solid var(--pos);
}
.risk-items li { border-left-color: var(--neg); }
.catalyst-items li { border-left-color: var(--accent-cyan); }

.actions-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 12px;
}
.actions-row .btn-primary,
.actions-row .btn-secondary { padding: 10px 12px; font-size: 10px; }
#evolve-btn.hidden { display: none; }

/* ── Memory / Learned patterns ─────────────────────────────────── */
#memory-content { display: flex; flex-direction: column; gap: 6px; }
.entity-card {
  padding: 10px 12px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-primary);
}
.entity-card.hidden { display: none; }
.entity-name {
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  color: var(--fg-primary);
  margin-bottom: 4px;
}
.entity-stats {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--fg-muted);
}

.pattern-list { display: flex; flex-direction: column; gap: 4px; }
.pattern-card {
  padding: 8px 10px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-primary);
}
.pattern-row {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-body);
  font-size: 11px; font-weight: 500;
  color: var(--fg-primary);
}
.pattern-confidence {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
}
.pattern-confidence.high { color: var(--pos); }
.pattern-confidence.med  { color: var(--neu); }
.pattern-confidence.low  { color: var(--fg-muted); }
.pattern-note {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-muted);
}

/* ── Settings ──────────────────────────────────────────────────── */
.setting-group {
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: 12px;
}
.setting-group label {
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.2em;
  color: var(--fg-muted);
}
.setting-group input {
  padding: 8px 10px;
  background: var(--surface-input);
  border: 1px solid var(--border-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-primary);
}
.setting-group input:focus { border-color: var(--accent); }
.key-status {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--fg-muted);
}
#cfg-save { width: 100%; margin-top: 4px; }
.cfg-status-msg {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--pos);
}

/* ── Event log ─────────────────────────────────────────────────── */
.tick-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  background: var(--surface-input);
  border: 1px solid var(--border-primary);
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.15em;
  color: var(--accent);
  transition: border-color 0.12s;
}
.tick-btn:hover { border-color: var(--accent); }
.tick-btn svg { width: 10px; height: 10px; }

#event-log {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}
.log-entry {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px; align-items: start;
  padding: 2px 0;
}
.log-time {
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 500;
  color: var(--fg-muted);
}
.log-tag {
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
}
.log-tag.info    { color: var(--fg-muted); }
.log-tag.tick    { color: var(--pos); }
.log-tag.learn,
.log-tag.learned { color: var(--accent); }
.log-tag.prune,
.log-tag.pruned  { color: var(--neg); }
.log-tag.evolve,
.log-tag.grown   { color: var(--accent-cyan); }
.log-tag.error   { color: var(--neg); }
.log-tag.genesis { color: var(--accent); }
.log-tag.oracle  { color: var(--accent-cyan); }
.log-message {
  font-family: var(--font-body);
  font-size: 10px; line-height: 1.4;
  color: var(--fg-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   RESIMULATE BAR (placeholder warning + retry button)
   ═══════════════════════════════════════════════════════════════ */
.resimulate-bar {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: rgba(251, 191, 36, 0.08);
  border-left: 2px solid var(--gold);
}
.resimulate-icon {
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
}
.resimulate-text { display: flex; flex-direction: column; gap: 2px; }
.resimulate-title {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; letter-spacing: 0.15em;
  color: var(--gold);
}
.resimulate-sub {
  font-family: var(--font-body);
  font-size: 10px; line-height: 1.4;
  color: var(--fg-secondary);
}
.resimulate-btn {
  padding: 6px 10px;
  font-size: 9px;
  background: var(--gold);
  color: var(--surface-primary);
  border: none;
}
.resimulate-btn:hover { background: #fcd34d; }
.resimulate-btn:disabled { opacity: 0.6; cursor: wait; }
.resimulate-btn svg { width: 12px; height: 12px; }

/* ═══════════════════════════════════════════════════════════════
   HOVER TOOLTIP — floating prediction card
   ═══════════════════════════════════════════════════════════════ */
.hover-tooltip {
  position: fixed;
  width: 300px;
  z-index: 100;
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px 11px;
  background: var(--surface-secondary);
  border: 1px solid var(--border-primary);
  border-top: 2px solid var(--neu);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 16px)) scale(0.94);
  transform-origin: center bottom;
  transition:
    opacity 0.12s ease,
    transform 0.16s cubic-bezier(0.2, 0, 0.13, 1);
}
.hover-tooltip.visible {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 16px)) scale(1);
}
.hover-tooltip.flip-below {
  transform-origin: center top;
  transform: translate(-50%, 16px) scale(0.94);
}
.hover-tooltip.flip-below.visible {
  transform: translate(-50%, 16px) scale(1);
}

/* Sentiment / status colored top border */
.hover-tooltip[data-sentiment="positive"] { border-top-color: var(--pos); }
.hover-tooltip[data-sentiment="neutral"]  { border-top-color: var(--neu); }
.hover-tooltip[data-sentiment="negative"] { border-top-color: var(--neg); }
.hover-tooltip[data-status="pending"]     { border-top-color: var(--pending); }
.hover-tooltip[data-status="pruned"]      { border-top-color: var(--pruned); }

.ht-header {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.18em;
}
.ht-id { color: var(--accent); }
.ht-sep { color: var(--fg-muted); }
.ht-day { color: var(--fg-secondary); }
.ht-status {
  margin-left: auto;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 8px; font-weight: 700; letter-spacing: 0.18em;
  border: 1px solid currentColor;
}
.ht-status.alive   { color: var(--pos); }
.ht-status.pending { color: var(--pending); }
.ht-status.pruned  { color: var(--pruned); }

.ht-divergence {
  padding: 6px 10px;
  background: rgba(251, 191, 36, 0.08);
  border-left: 2px solid var(--gold);
  font-family: var(--font-body);
  font-size: 11px; line-height: 1.5;
  color: var(--gold);
}
.ht-divergence:empty { display: none; }

.ht-summary {
  font-family: var(--font-body);
  font-size: 12px; line-height: 1.55;
  color: var(--fg-primary);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ht-footer {
  display: grid; grid-template-columns: 1fr auto; gap: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}
.ht-meta-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 8px; font-weight: 700; letter-spacing: 0.2em;
  color: var(--fg-muted);
  margin-bottom: 4px;
}
.ht-prob-col, .ht-sent-col {
  display: flex; flex-direction: column;
}
.ht-prob-row {
  display: flex; align-items: center; gap: 8px;
}
.ht-prob-track {
  flex: 1; min-width: 80px;
  height: 4px;
  background: var(--surface-input);
  position: relative;
}
.ht-prob-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: var(--accent);
  transition: width 0.18s;
}
.ht-prob-value {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700;
  color: var(--fg-primary);
  white-space: nowrap;
}
.ht-sent-col { align-items: flex-end; }
.ht-sentiment-value {
  font-family: var(--font-mono);
  font-size: 16px; font-weight: 700;
}
.ht-sentiment-value.positive { color: var(--pos); }
.ht-sentiment-value.neutral  { color: var(--neu); }
.ht-sentiment-value.negative { color: var(--neg); }

/* ═══════════════════════════════════════════════════════════════
   ORACLE CONSOLE (floating bottom-left)
   ═══════════════════════════════════════════════════════════════ */
.oracle-console {
  position: fixed;
  left: 20px; bottom: calc(var(--status-height) + 16px);
  width: 400px; max-height: 480px;
  background: var(--surface-secondary);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  display: flex; flex-direction: column;
  z-index: 50;
}
.oracle-console.hidden { display: none; }

.oracle-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border-primary);
}
.oracle-icon {
  width: 22px; height: 22px;
  border: 1px solid var(--accent-cyan);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-cyan);
}
.oracle-icon svg { width: 12px; height: 12px; }
.oracle-title-col { display: flex; flex-direction: column; gap: 1px; }
.oracle-title {
  font-family: var(--font-heading);
  font-size: 13px; font-weight: 700; letter-spacing: 0.2em;
  color: var(--fg-primary);
}
.oracle-node-label {
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 600; letter-spacing: 0.12em;
  color: var(--accent-cyan);
}
.oracle-close {
  margin-left: auto;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-input);
  color: var(--fg-muted);
}
.oracle-close:hover { color: var(--neg); }
.oracle-close svg { width: 11px; height: 11px; }

.chat-messages {
  flex: 1;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto;
  min-height: 200px;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border-primary); }

.chat-msg { display: flex; flex-direction: column; gap: 4px; }
.chat-msg .msg-role,
.chat-msg .thinking-header {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.15em;
}
.chat-msg.user .msg-role { color: var(--fg-muted); }
.chat-msg.user .msg-role::before {
  content: ''; width: 5px; height: 5px; background: var(--fg-muted);
}
.chat-msg.oracle .msg-role { color: var(--accent-cyan); }
.chat-msg.oracle .msg-role::before {
  content: ''; width: 5px; height: 5px; background: var(--accent-cyan);
}
.chat-msg .msg-content {
  font-family: var(--font-body);
  font-size: 12px; line-height: 1.55;
}
.chat-msg.user .msg-content   { color: var(--fg-primary); }
.chat-msg.oracle .msg-content { color: var(--fg-secondary); }

.thinking-bubble {
  padding: 8px 12px;
  background: var(--surface-input);
  border-left: 2px solid var(--accent);
}
.thinking-header { color: var(--fg-muted); cursor: pointer; user-select: none; }
.thinking-icon { color: var(--accent); }
.thinking-content {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px; line-height: 1.5;
  color: var(--fg-muted);
}

.chat-input-group {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--surface-input);
  border-top: 1px solid var(--border-primary);
}
.chat-input-group input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--fg-primary);
}
.chat-input-group input::placeholder { color: var(--fg-muted); }
.oracle-send {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-cyan);
  color: var(--surface-primary);
}
.oracle-send:hover { background: #00E5DF; }
.oracle-send svg { width: 12px; height: 12px; }

/* ═══════════════════════════════════════════════════════════════
   TREE ROW (SVG foreignObject content)
   ═══════════════════════════════════════════════════════════════ */
.tree-header {
  display: grid;
  grid-template-columns: 180px 1fr 110px 90px;
  align-items: center;
  gap: 16px;
  padding: 12px 28px 8px 0;
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.2em;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border-subtle);
}
.tree-header .th-sent,
.tree-header .th-prob { text-align: right; }

.tree-row {
  display: grid;
  grid-template-columns: 180px 1fr 110px 90px;
  align-items: center;
  gap: 16px;
  padding: 0 16px 0 12px;
  height: 100%;
  font-family: var(--font-body);
  color: var(--fg-primary);
  transition: background 0.12s;
}
.tree-row.pruned { color: var(--fg-muted); }
.tree-row.active { background: transparent; /* row tint drawn in SVG */ }

.tree-row .trc-id { display: flex; flex-direction: column; gap: 2px; }
.tree-row .trc-name {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 700;
  color: inherit;
}
.tree-row.active .trc-name { color: var(--accent); }
.tree-row .trc-meta {
  display: flex; gap: 6px; align-items: center;
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 600; letter-spacing: 0.15em;
}
.tree-row .trc-day { color: var(--fg-muted); }
.tree-row .trc-sep { color: var(--fg-muted); }
.tree-row .trc-date {
  font-family: var(--font-mono);
  color: var(--fg-secondary);
  letter-spacing: 0.05em;
}
.tree-row .trc-status {
  padding: 1px 6px;
  border: 1px solid currentColor;
  font-size: 8px;
}
.tree-row .trc-status.alive  { color: var(--pos); }
.tree-row .trc-status.pruned { color: var(--pruned); }

.tree-row .trc-summary {
  font-family: var(--font-body);
  font-size: 12px; line-height: 1.45;
  color: inherit;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tree-row .trc-sent { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.tree-row .trc-sent-val { font-family: var(--font-mono); font-size: 15px; font-weight: 700; }
.tree-row .trc-sent.positive .trc-sent-val { color: var(--pos); }
.tree-row .trc-sent.neutral  .trc-sent-val { color: var(--neu); }
.tree-row .trc-sent.negative .trc-sent-val { color: var(--neg); }

.tree-row .trc-prob { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.tree-row .trc-prob-val { font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: inherit; }

.tree-row .trc-bar {
  width: 64px; height: 2px;
  background: var(--surface-input);
  position: relative;
}
.tree-row .trc-bar-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: var(--fg-muted);
}
.tree-row .trc-bar-fill.positive { background: var(--pos); }
.tree-row .trc-bar-fill.neutral  { background: var(--neu); }
.tree-row .trc-bar-fill.negative { background: var(--neg); }
.tree-row .trc-bar-fill.prob     { background: var(--accent); }
.tree-row.pruned .trc-bar-fill   { background: var(--pruned); }

/* ═══════════════════════════════════════════════════════════════
   VIEW ROUTING — Dashboard vs Detail
   ═══════════════════════════════════════════════════════════════ */
body.view-dashboard #timeline-svg,
body.view-dashboard #empty-state          { display: none !important; }
body.view-detail    #dashboard-content    { display: none !important; }
body.view-dashboard [data-view="detail"]  { display: none !important; }
body.view-detail    [data-view="dashboard"] { display: none !important; }
body.view-detail    .dashboard-only        { display: none !important; }

.nav-back {
  background: none; border: none;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.25em;
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: color 0.12s;
}
.nav-back:hover { color: var(--fg-primary); }
button.crumb-section.nav-back {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; letter-spacing: 0.2em;
  color: var(--fg-muted);
  padding: 0;
  transition: color 0.12s;
}
button.crumb-section.nav-back:hover { color: var(--accent-cyan); }

.dashboard-search {
  width: 240px;
  padding: 6px 12px;
  background: var(--surface-input);
  border: 1px solid var(--border-primary);
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600; letter-spacing: 0.15em;
  color: var(--fg-primary);
}
.dashboard-search::placeholder { color: var(--fg-muted); }
.dashboard-search:focus { border-color: var(--accent); outline: none; }

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD VIEW
   ═══════════════════════════════════════════════════════════════ */
.dashboard-content {
  position: absolute; inset: 0;
  overflow: auto;
  display: flex; flex-direction: column;
}
.dashboard-content::-webkit-scrollbar { width: 6px; height: 6px; }
.dashboard-content::-webkit-scrollbar-thumb { background: var(--border-primary); }

.dashboard-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-primary);
}
.stat-cell {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 24px;
  border-right: 1px solid var(--border-subtle);
}
.stat-cell:last-child { border-right: none; }
.stat-label {
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.2em;
  color: var(--fg-muted);
}
.stat-value {
  font-family: var(--font-heading);
  font-size: 24px; font-weight: 700;
  color: var(--fg-primary);
}
.stat-value.alive   { color: var(--pos); }
.stat-value.pruned  { color: var(--neg); }
.stat-value.accent  { color: var(--accent); }

.dashboard-log-header {
  display: grid;
  grid-template-columns: 24px 160px 80px 1fr 120px 100px 110px 110px;
  gap: 12px; align-items: center;
  padding: 12px 28px 10px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.2em;
  color: var(--fg-muted);
}
.dashboard-log-header .col-sent,
.dashboard-log-header .col-stats { text-align: right; }
.dashboard-log-header .col-actions { text-align: center; }

.dashboard-session-list {
  display: flex; flex-direction: column;
  flex: 1;
}
.dashboard-empty {
  margin: 80px auto;
  text-align: center;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}

.dashboard-row {
  display: grid;
  grid-template-columns: 24px 160px 80px 1fr 120px 100px 110px 110px;
  gap: 12px; align-items: center;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.12s;
}
.dashboard-row:hover { background: rgba(168, 92, 247, 0.04); }
.dashboard-row.active { background: var(--accent-glow); }

.dashboard-row .row-rail {
  width: 24px; height: 100%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
/* Continuous left rail line connecting all session dots */
.dashboard-row::before {
  content: '';
  position: absolute; left: 39px; top: 0; bottom: 0;
  width: 1px;
  background: var(--border-primary);
}
.dashboard-row:first-child::before { top: 50%; }
.dashboard-row:last-child::before  { bottom: 50%; }
.dashboard-row .row-dot {
  width: 14px; height: 14px;
  background: var(--surface-primary);
  border: 2px solid var(--fg-muted);
  border-radius: 50%;
  position: relative; z-index: 1;
}
.dashboard-row .row-dot.positive { border-color: var(--pos); background: var(--pos); }
.dashboard-row .row-dot.neutral  { border-color: var(--neu); background: var(--neu); }
.dashboard-row .row-dot.negative { border-color: var(--neg); background: var(--neg); }
.dashboard-row.active .row-dot {
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.25);
  border-color: var(--gold);
}

.dashboard-row .row-id {
  display: flex; flex-direction: column; gap: 2px;
}
.dashboard-row .row-id-hash {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 700;
  color: var(--fg-primary);
}
.dashboard-row .row-id-sub {
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 600; letter-spacing: 0.15em;
  color: var(--fg-muted);
}
.dashboard-row .row-age {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-secondary);
}
.dashboard-row .row-query {
  font-family: var(--font-body);
  font-size: 14px; font-weight: 600;
  color: var(--fg-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dashboard-row .row-sparkline {
  display: flex; align-items: center; gap: 4px;
}
.dashboard-row .spark-dot {
  width: 8px; height: 8px;
  background: var(--fg-muted);
  border-radius: 50%;
  flex-shrink: 0;
}
.dashboard-row .spark-line {
  width: 14px; height: 1px;
  background: var(--fg-muted);
  flex-shrink: 0;
}
.dashboard-row .spark-dot.positive,
.dashboard-row .spark-line.positive { background: var(--pos); }
.dashboard-row .spark-dot.neutral,
.dashboard-row .spark-line.neutral  { background: var(--neu); }
.dashboard-row .spark-dot.negative,
.dashboard-row .spark-line.negative { background: var(--neg); }

.dashboard-row .row-sent {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 15px; font-weight: 700;
}
.dashboard-row .row-sent.positive { color: var(--pos); }
.dashboard-row .row-sent.neutral  { color: var(--neu); }
.dashboard-row .row-sent.negative { color: var(--neg); }

.dashboard-row .row-stats {
  display: flex; gap: 6px; justify-content: flex-end;
}
.dashboard-row .stat-tag {
  padding: 3px 7px;
  border: 1px solid currentColor;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
}
.dashboard-row .stat-tag.alive  { color: var(--pos); }
.dashboard-row .stat-tag.pruned { color: var(--pruned); }

/* Actions column — TICK + delete always visible, no hover gating */
.dashboard-row .row-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 6px;
}

.dashboard-row .row-tick {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px;
  background: var(--surface-elevated);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.15em;
  transition: background 0.12s, color 0.12s;
}
.dashboard-row .row-tick:hover { background: var(--accent-cyan); color: var(--surface-primary); }
.dashboard-row .row-tick:disabled { opacity: 0.6; cursor: wait; }
.dashboard-row .row-tick svg { width: 10px; height: 10px; }

.dashboard-row .row-delete {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-elevated);
  border: 1px solid var(--border-primary);
  color: var(--fg-muted);
  transition: color 0.12s, border-color 0.12s;
}
.dashboard-row .row-delete:hover { color: var(--neg); border-color: var(--neg); }
.dashboard-row .row-delete svg { width: 12px; height: 12px; }


/* Time Machine sidebar panel removed — auto-tick is disabled and per-session
   TICK lives in the Dashboard "操作" column. */

/* ═══════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════ */
.hidden { display: none !important; }

@media (max-width: 900px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-height) 1fr var(--status-height);
    grid-template-areas:
      "topbar"
      "timeline"
      "statusbar";
  }
  #sidebar { display: none; }
}
