/* ═══════════════════════════════════════════════════════════════════
   ORBIT DESIGN SYSTEM — BUNDLED
   All layers inlined. No @import dependencies.
═══════════════════════════════════════════════════════════════════ */

/* ── tokens/primitives.css ── */
/* ═══════════════════════════════════════════════════════════════════
   ORBIT DESIGN SYSTEM — LAYER 1: PRIMITIVES
   Raw values only. No opinions about where they are used.
   To change a color: change it here — nothing else needs touching.
═══════════════════════════════════════════════════════════════════ */
:root {

  /* ── Void (Space Blacks) ──────────────────────────────────────── */
  --void-50:   #050508;
  --void-100:  #09090f;
  --void-200:  #0e0e1a;
  --void-300:  #131325;

  /* ── Cyan ─────────────────────────────────────────────────────── */
  --cyan-500:     #00d4ff;
  --cyan-500-rgb: 0, 212, 255;

  /* ── Purple ───────────────────────────────────────────────────── */
  --purple-500:     #8b5cf6;
  --purple-500-rgb: 139, 92, 246;

  /* ── Amber ────────────────────────────────────────────────────── */
  --amber-500:     #f59e0b;
  --amber-500-rgb: 245, 158, 11;

  /* ── Crimson ──────────────────────────────────────────────────── */
  --crimson-500:     #ef4444;
  --crimson-500-rgb: 239, 68, 68;

  /* ── Emerald ──────────────────────────────────────────────────── */
  --emerald-500:     #10b981;
  --emerald-500-rgb: 16, 185, 129;

  /* ── Pink ─────────────────────────────────────────────────────── */
  --pink-500:     #ec4899;
  --pink-500-rgb: 236, 72, 153;

  /* ── Slate (Text) ─────────────────────────────────────────────── */
  --slate-100: #f1f5f9;
  --slate-400: #94a3b8;
  --slate-600: #475569;
  --slate-800: #2d3748;

  /* ── Spacing Scale (4px base) ─────────────────────────────────── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;

  /* ── Type Scale ───────────────────────────────────────────────── */
  --text-2xs:  7px;
  --text-xs:   8px;
  --text-sm:   9px;
  --text-base: 10px;
  --text-md:   11px;
  --text-lg:   13px;
  --text-xl:   16px;
  --text-2xl:  18px;
  --text-3xl:  24px;

  /* ── Border Radius ────────────────────────────────────────────── */
  --radius-xs:   3px;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-pill: 20px;

  /* ── Typography ───────────────────────────────────────────────── */
  --font-ui:   'Montserrat', system-ui, sans-serif;
  --font-data: 'JetBrains Mono', 'Fira Code', monospace;

  /* ── Z-Index Scale ────────────────────────────────────────────── */
  --z-base:    1;
  --z-panel:   10;
  --z-bar:     100;
  --z-overlay: 200;
  --z-modal:   300;

  /* ── Layout Constants ─────────────────────────────────────────── */
  --bar-h:        44px;
  --layout-gap:   12px;
  --layout-pad:   12px;

  /* ── Animation Durations ──────────────────────────────────────── */
  --dur-fast:   0.15s;
  --dur-base:   0.2s;
  --dur-slow:   0.3s;
  --dur-xslow:  0.4s;

  /* ── Easing Curves ────────────────────────────────────────────── */
  --ease-out:    cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

}

/* ── tokens/semantic.css ── */
/* ═══════════════════════════════════════════════════════════════════
   ORBIT DESIGN SYSTEM — LAYER 2: SEMANTIC TOKENS
   Purpose-mapped names. Values are set by the active theme file.
   Change the meaning of a token here — not in components.
   Swap themes by loading a different themes/*.css file.
═══════════════════════════════════════════════════════════════════ */

/*
  This file documents the semantic token contract.
  Actual values are assigned in themes/space-dark.css (or any future theme).

  Component CSS should ALWAYS reference semantic tokens, never primitives.

  Semantic token categories:
  ┌─────────────────────────────────────────────────────────┐
  │  surface-*   Panel and background fills                 │
  │  border-*    Border colors and strengths                │
  │  status-*    Signal colors (active, idle, error …)      │
  │  text-*      Typography hierarchy                       │
  │  fill-*      Low-opacity tinted backgrounds             │
  │  glow-*      Box-shadow glow values                     │
  └─────────────────────────────────────────────────────────┘

  Convenience aliases keep existing component code working
  without a breaking rename. New components should use semantic names.

  Alias map (old → semantic):
    --void         → --surface-bg
    --panel-bg     → --surface-panel
    --panel-border → --border-panel
    --cyan         → --status-active
    --purple       → --status-accent
    --amber        → --status-gate
    --crimson      → --status-error
    --emerald      → --status-success
    --pink         → --status-voice
    --cyan-soft    → --fill-active
    --purple-soft  → --fill-accent
    --amber-soft   → --fill-gate
    --crimson-soft → --fill-error
    --emerald-soft → --fill-success
    --pink-soft    → --fill-voice
    --cyan-glow    → --glow-active
    --emerald-glow → --glow-success
    --amber-glow   → --glow-gate
    --purple-glow  → --glow-accent
*/

/* ── tokens/themes/space-dark.css ── */
/* ═══════════════════════════════════════════════════════════════════
   ORBIT THEME — SPACE DARK (default)
   Deep space blacks · neon cyan/purple accents · glassmorphism

   To change the entire ORBIT aesthetic: edit values here only.
   To create a new theme: duplicate this file, rename, swap values.
═══════════════════════════════════════════════════════════════════ */
:root {

  /* ── Surfaces ─────────────────────────────────────────────────── */
  --surface-bg:          var(--void-50);
  --surface-panel:       rgba(255, 255, 255, 0.028);
  --surface-panel-hover: rgba(255, 255, 255, 0.045);
  --surface-panel-blur:  blur(18px);
  --surface-overlay:     rgba(9, 9, 15, 0.94);
  --surface-bar:         rgba(5, 5, 8, 0.92);
  --surface-node:        var(--void-200);

  /* ── Borders ──────────────────────────────────────────────────── */
  --border-panel:  rgba(255, 255, 255, 0.065);
  --border-strong: rgba(255, 255, 255, 0.12);

  /* ── Status Colors ────────────────────────────────────────────── */
  --status-active:      var(--cyan-500);
  --status-active-rgb:  var(--cyan-500-rgb);
  --status-accent:      var(--purple-500);
  --status-accent-rgb:  var(--purple-500-rgb);
  --status-gate:        var(--amber-500);
  --status-gate-rgb:    var(--amber-500-rgb);
  --status-error:       var(--crimson-500);
  --status-error-rgb:   var(--crimson-500-rgb);
  --status-success:     var(--emerald-500);
  --status-success-rgb: var(--emerald-500-rgb);
  --status-voice:       var(--pink-500);
  --status-voice-rgb:   var(--pink-500-rgb);
  --status-idle:        var(--slate-600);

  /* ── Text Hierarchy ───────────────────────────────────────────── */
  --text-primary:   var(--slate-100);
  --text-secondary: var(--slate-400);
  --text-dim:       var(--slate-600);
  --text-muted:     var(--slate-800);

  /* ── Low-Opacity Fills ────────────────────────────────────────── */
  --fill-active:  rgba(var(--cyan-500-rgb),    0.18);
  --fill-accent:  rgba(var(--purple-500-rgb),  0.18);
  --fill-gate:    rgba(var(--amber-500-rgb),   0.18);
  --fill-error:   rgba(var(--crimson-500-rgb), 0.18);
  --fill-success: rgba(var(--emerald-500-rgb), 0.18);
  --fill-voice:   rgba(var(--pink-500-rgb),    0.18);
  --fill-idle:    rgba(71, 85, 105,            0.18);

  /* ── Glow Effects (box-shadow values) ─────────────────────────── */
  --glow-active:  0 0 24px rgba(var(--cyan-500-rgb),    0.45), 0 0 48px rgba(var(--cyan-500-rgb),    0.2);
  --glow-accent:  0 0 24px rgba(var(--purple-500-rgb),  0.45), 0 0 48px rgba(var(--purple-500-rgb),  0.2);
  --glow-gate:    0 0 24px rgba(var(--amber-500-rgb),   0.45);
  --glow-error:   0 0 12px rgba(var(--crimson-500-rgb), 0.2);
  --glow-success: 0 0 20px rgba(var(--emerald-500-rgb), 0.4);
  --glow-voice:   0 0 20px rgba(var(--pink-500-rgb),    0.35);

  /* ── Radius Aliases ───────────────────────────────────────────── */
  --radius:    var(--radius-md);

  /* ─────────────────────────────────────────────────────────────────
     BACKWARD-COMPATIBILITY ALIASES
     Existing components use these names — they still work.
     New components should use semantic names above instead.
  ───────────────────────────────────────────────────────────────── */
  --void:          var(--void-50);
  --void-2:        var(--void-100);
  --void-3:        var(--void-200);
  --void-4:        var(--void-300);

  --panel-bg:       var(--surface-panel);
  --panel-bg-hover: var(--surface-panel-hover);
  --panel-border:   var(--border-panel);
  --panel-blur:     var(--surface-panel-blur);

  --cyan:         var(--status-active);
  --cyan-soft:    var(--fill-active);
  --cyan-glow:    var(--glow-active);
  --cyan-pulse:   rgba(var(--cyan-500-rgb), 0.6);

  --purple:       var(--status-accent);
  --purple-soft:  var(--fill-accent);
  --purple-glow:  var(--glow-accent);

  --amber:        var(--status-gate);
  --amber-soft:   var(--fill-gate);
  --amber-glow:   var(--glow-gate);

  --crimson:      var(--status-error);
  --crimson-soft: var(--fill-error);

  --emerald:      var(--status-success);
  --emerald-soft: var(--fill-success);
  --emerald-glow: var(--glow-success);

  --pink:         var(--status-voice);
  --pink-soft:    var(--fill-voice);

}

/* ── components/base.css ── */
/* ── Reset & Base ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  height: 100dvh;
  background: var(--surface-bg);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
}

/* ── Scrollbars ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--status-active-rgb), 0.35); }

/* ── components/health-bar.css ── */
/* ── System Health Bar ───────────────────────────────────────────── */
#health-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--bar-h);
  z-index: var(--z-bar);
  display: flex;
  align-items: center;
  background: var(--surface-bar);
  border-bottom: 1px solid var(--border-panel);
  backdrop-filter: blur(12px);
  padding: 0 var(--space-5);
  overflow: hidden;
}

/* Animated sweep line */
#health-bar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--status-active) 0%, var(--status-accent) 40%, var(--status-active) 100%);
  background-size: 200% 100%;
  animation: bar-sweep 4s linear infinite;
}
@keyframes bar-sweep {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.hb-brand {
  font-size: var(--text-md);
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--status-active);
  text-shadow: var(--glow-active);
  white-space: nowrap;
  margin-right: var(--space-7);
}

.hb-sep {
  width: 1px;
  height: 20px;
  background: var(--border-panel);
  margin: 0 var(--space-4);
  flex-shrink: 0;
}

.hb-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: var(--space-5);
}

.hb-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.hb-surface-link {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-sm);
  transition: color .15s, border-color .15s;
}
.hb-surface-link:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.provider-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-base);
  font-family: var(--font-data);
  color: var(--text-secondary);
}

/* ── Status Dots ─────────────────────────────────────────────────── */
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot.green { background: var(--status-success); box-shadow: 0 0 6px var(--status-success); }
.dot.amber { background: var(--status-gate);    box-shadow: 0 0 6px var(--status-gate); }
.dot.red   { background: var(--status-error);   box-shadow: 0 0 6px var(--status-error); }
.dot.dim   { background: var(--text-dim); }

/* ── Cost / Right Side ───────────────────────────────────────────── */
.hb-cost {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.cost-value {
  font-family: var(--font-data);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--status-success);
  text-shadow: var(--glow-success);
}

.cost-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.hb-uptime {
  font-family: var(--font-data);
  font-size: var(--text-base);
  color: var(--text-dim);
  margin-left: var(--space-5);
}

/* ── System Status Badge ─────────────────────────────────────────── */
.hb-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--fill-success);
  border: 1px solid rgba(var(--emerald-500-rgb), 0.25);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--status-success);
  text-transform: uppercase;
  margin-left: var(--space-4);
}
.hb-status-badge .dot {
  width: 5px; height: 5px;
  animation: pulse-dot 1.8s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.7); }
}

/* ── components/layout.css ── */
/* ── Main Layout ─────────────────────────────────────────────────── */
#mc-layout {
  position: fixed;
  top: var(--bar-h);
  left: 0; right: 0; bottom: 0;
  padding: var(--layout-pad);
  padding-bottom: max(var(--layout-pad), env(safe-area-inset-bottom, 0px));
  padding-left:   max(var(--layout-pad), env(safe-area-inset-left,   0px));
  padding-right:  max(var(--layout-pad), env(safe-area-inset-right,  0px));
  display: flex;
  flex-direction: column;
  gap: var(--layout-gap);
  overflow: hidden;
  z-index: var(--z-base);
}

/* Flex row — each row is exactly 50% of available height.
   flex:1 1 0 + min-height:0 is the Safari-safe equal-height pattern. */
.mc-row {
  display: flex;
  flex-direction: row;
  flex: 1 1 0;
  min-height: 0;
  gap: var(--layout-gap);
}

/* ── Connection Status ───────────────────────────────────────────── */
#conn-status {
  position: fixed;
  bottom: max(14px, env(safe-area-inset-bottom, 14px));
  right:  max(14px, env(safe-area-inset-right,  14px));
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  z-index: var(--z-bar);
}
#conn-status .dot { width: 6px; height: 6px; }

/* ── Gate Approval Overlay ───────────────────────────────────────── */
#gate-overlay {
  position: fixed;
  top: calc(var(--bar-h) + var(--layout-gap));
  right: var(--layout-gap);
  z-index: var(--z-overlay);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

/* ── components/panels.css ── */
/* ── Glass Panel ─────────────────────────────────────────────────── */
.mc-panel {
  background: var(--surface-panel);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius);
  backdrop-filter: var(--surface-panel-blur);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
}

/* ── Panel Header ────────────────────────────────────────────────── */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-panel);
  flex-shrink: 0;
}

.panel-title {
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* ── Panel Badges ────────────────────────────────────────────────── */
.panel-badge {
  font-family: var(--font-data);
  font-size: var(--text-sm);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.badge-cyan    { color: var(--status-active);  border-color: rgba(var(--cyan-500-rgb),    0.3); background: var(--fill-active);  }
.badge-purple  { color: var(--status-accent);  border-color: rgba(var(--purple-500-rgb),  0.3); background: var(--fill-accent);  }
.badge-amber   { color: var(--status-gate);    border-color: rgba(var(--amber-500-rgb),   0.3); background: var(--fill-gate);    }
.badge-emerald { color: var(--status-success); border-color: rgba(var(--emerald-500-rgb), 0.3); background: var(--fill-success); }
.badge-crimson { color: var(--status-error);   border-color: rgba(var(--crimson-500-rgb), 0.3); background: var(--fill-error);   }

/* ── Panel Body (generic scrollable content area) ────────────────── */
.panel-body {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-3) 14px;
  min-height: 0;
}

/* ── Empty State ─────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: var(--space-2);
  opacity: 0.35;
  padding: var(--space-5);
  text-align: center;
}
.empty-state svg { opacity: 0.4; }
.empty-state p   { font-size: var(--text-base); color: var(--text-dim); line-height: 1.6; }

/* backward compat alias */
.empty-feed { display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; gap: var(--space-2); opacity: 0.35; padding: var(--space-5); text-align: center; }
.empty-feed svg { opacity: 0.4; }
.empty-feed p   { font-size: var(--text-base); color: var(--text-dim); line-height: 1.6; }

/* ── components/agent-tile.css ── */
/* ── Agent Fleet Grid ────────────────────────────────────────────── */
#fleet-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 6px 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}
.fleet-layer-header {
  font-family: var(--font-data);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 6px 0 3px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 4px;
}
.fleet-layer-header:first-child { padding-top: 0; }
.fleet-layer-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 5px;
  margin-bottom: 6px;
}

/* ── Tile Base ───────────────────────────────────────────────────── */
.agent-tile {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  cursor: default;
  transition: background var(--dur-base), border-color var(--dur-base), box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}
.agent-tile:hover {
  background: var(--surface-panel-hover);
  border-color: var(--border-strong);
}

/* ── Tile Status Variants ────────────────────────────────────────── */
.agent-tile.status-live    { border-color: rgba(var(--cyan-500-rgb),    0.35); }
.agent-tile.status-active  { border-color: rgba(var(--cyan-500-rgb),    0.5);
  box-shadow: 0 0 16px rgba(var(--cyan-500-rgb), 0.15);
  animation: tile-breathe 2.2s ease-in-out infinite; }
.agent-tile.status-partial { border-color: rgba(var(--purple-500-rgb),  0.25); }
.agent-tile.status-planned { border-color: rgba(255,255,255,0.04); opacity: 0.55; }
.agent-tile.status-error   { border-color: rgba(var(--crimson-500-rgb), 0.5);
  box-shadow: 0 0 12px rgba(var(--crimson-500-rgb), 0.2);
  animation: tile-flash 1s ease-in-out infinite; }
.agent-tile.status-gate    { border-color: rgba(var(--amber-500-rgb),   0.5);
  box-shadow: 0 0 14px rgba(var(--amber-500-rgb), 0.2); }

@keyframes tile-breathe {
  0%, 100% { box-shadow: 0 0 10px rgba(var(--cyan-500-rgb), 0.12); }
  50%       { box-shadow: 0 0 22px rgba(var(--cyan-500-rgb), 0.3); }
}
@keyframes tile-flash {
  0%, 100% { border-color: rgba(var(--crimson-500-rgb), 0.3); }
  50%       { border-color: rgba(var(--crimson-500-rgb), 0.8); }
}

/* ── Tile Anatomy ────────────────────────────────────────────────── */
.tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}

.tile-status-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-live .tile-status-dot    { background: var(--status-active);  box-shadow: 0 0 5px var(--status-active); }
.status-active .tile-status-dot  { background: var(--status-active);  box-shadow: 0 0 5px var(--status-active); animation: dot-pulse 1.4s ease-in-out infinite; }
.status-partial .tile-status-dot { background: var(--status-accent);  opacity: 0.7; }
.status-planned .tile-status-dot { background: var(--text-dim); }
.status-error .tile-status-dot   { background: var(--status-error);   box-shadow: 0 0 5px var(--status-error); }
.status-gate .tile-status-dot    { background: var(--status-gate);    box-shadow: 0 0 5px var(--status-gate); }

@keyframes dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.6); opacity: 0.6; }
}

.tier-chip {
  font-family: var(--font-data);
  font-size: var(--text-2xs);
  font-weight: 600;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.04em;
}

.tile-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-task {
  font-family: var(--font-data);
  font-size: var(--text-2xs);
  color: var(--text-dim);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Phase 24: Dispatch wire indicator ──────────────────────────── */
.dispatch-wired::before,
.dispatch-bridge::before,
.dispatch-python::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 2px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  pointer-events: none;
}
.dispatch-wired::before  { background: #10b981; opacity: 0.85; }
.dispatch-bridge::before { background: #f59e0b; opacity: 0.55; }
.dispatch-python::before { background: #06b6d4; opacity: 0.75; }

/* Fleet dispatch legend */
.fleet-dispatch-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 10px 5px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.fdl-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-data);
  font-size: var(--text-2xs);
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.fdl-bar {
  width: 2px;
  height: 10px;
  border-radius: 1px;
  flex-shrink: 0;
}
.fdl-wired  .fdl-bar { background: #10b981; }
.fdl-bridge .fdl-bar { background: #f59e0b; }
.fdl-python .fdl-bar { background: #06b6d4; }
.fdl-count {
  margin-left: auto;
  font-family: var(--font-data);
  font-size: var(--text-2xs);
  color: var(--text-dim);
  opacity: 0.6;
}

/* ── Phase 22D: Health probe badge ──────────────────────────────── */
.tile-health {
  position: absolute;
  bottom: 3px; right: 4px;
  font-family: var(--font-data);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 1px 3px;
  border-radius: 2px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.tile-health.visible     { opacity: 1; }
.tile-health.probe-ok    { background: rgba(16,185,129,0.18); color: #10b981; }
.tile-health.probe-warn  { background: rgba(245,158,11,0.18); color: #f59e0b; }
.tile-health.probe-fail  { background: rgba(239,68,68,0.18);  color: #ef4444; }

/* Probe button in fleet header */
.fleet-probe-btn {
  font-family: var(--font-data);
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-xs);
  padding: 2px 7px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.fleet-probe-btn:hover   { color: #06b6d4; border-color: rgba(6,182,212,0.35); background: rgba(6,182,212,0.08); }
.fleet-probe-btn.probing { color: #f59e0b; border-color: rgba(245,158,11,0.35); animation: btn-pulse 0.8s ease-in-out infinite; }
.fleet-probe-btn.done-ok   { color: #10b981; border-color: rgba(16,185,129,0.35); }
.fleet-probe-btn.done-fail { color: #ef4444; border-color: rgba(239,68,68,0.35); }

@keyframes btn-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── Phase 28: Memory-Retrieval Inspector ────────────────────────── */
.pxi-mem-section-label {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.pxi-mem-section { margin-bottom: 18px; }
.pxi-mem-record  { margin-bottom: 10px; }

/* Produced memory card */
.pxi-memcard {
  padding: 9px 11px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
  margin-bottom: 8px;
}
.pxi-memcard-header {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-bottom: 5px;
}
.pxi-memcard-class {
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}
.pxi-memcard-class.episodic   { background: rgba(139,92,246,0.15); color: #a78bfa; border: 1px solid rgba(139,92,246,0.25); }
.pxi-memcard-class.semantic   { background: rgba(0,212,255,0.10);  color: var(--cyan); border: 1px solid rgba(0,212,255,0.2); }
.pxi-memcard-class.operational{ background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }
.pxi-memcard-title {
  font-size: 10px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
  flex: 1;
}
.pxi-memcard-summary {
  font-size: 9px;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 5px;
}
.pxi-memcard-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pxi-memcard-pill {
  font-family: var(--font-mono);
  font-size: 7px;
  color: var(--slate);
  letter-spacing: 0.06em;
}

/* Drill-through button + results */
.pxi-mem-drill-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  padding: 3px 7px;
  cursor: pointer;
  margin-top: 6px;
  transition: color 0.15s, border-color 0.15s;
  text-transform: uppercase;
}
.pxi-mem-drill-btn:hover { color: var(--cyan); border-color: rgba(0,212,255,0.3); }
.pxi-mem-drill-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pxi-mem-drill-results {
  margin-top: 8px;
  padding-left: 8px;
  border-left: 2px solid rgba(0,212,255,0.15);
}
.pxi-mem-hit {
  padding: 7px 9px;
  border-radius: 5px;
  background: rgba(0,212,255,0.03);
  border: 1px solid rgba(0,212,255,0.1);
  margin-bottom: 5px;
}
.pxi-mem-hit-title { font-size: 9px; color: var(--text); font-weight: 500; margin-bottom: 3px; }
.pxi-mem-hit-summary { font-size: 9px; color: var(--text-dim); line-height: 1.5; margin-bottom: 4px; }
.pxi-mem-hit-meta { display: flex; gap: 7px; }
.pxi-mem-hit-pill { font-family: var(--font-mono); font-size: 7px; color: var(--slate); letter-spacing: 0.06em; }
.pxi-mem-hit-sim  { font-family: var(--font-mono); font-size: 7px; color: var(--cyan); letter-spacing: 0.06em; }

/* ── Phase 26: Live Coordinator Step Feed ────────────────────────── */
.step-feed-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  margin-bottom: 10px;
  border-radius: 6px;
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--cyan);
}
.step-feed-bar.done   { background: rgba(16,185,129,0.05); border-color: rgba(16,185,129,0.2); color: #10b981; }
.step-feed-bar.error  { background: rgba(239,68,68,0.05);  border-color: rgba(239,68,68,0.2);  color: var(--crimson); }
.sfb-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.step-feed-bar:not(.done):not(.error) .sfb-dot {
  animation: sfb-pulse 1s ease-in-out infinite;
}
@keyframes sfb-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

/* Step row live state patches */
.srow-running {
  border-color: rgba(0, 212, 255, 0.4) !important;
  background: rgba(0, 212, 255, 0.04) !important;
}
.srow-running .srow-icon  { animation: sfb-pulse 0.9s ease-in-out infinite; }
.srow-done    { border-color: rgba(16,185,129,0.3) !important; }
.srow-error   { border-color: rgba(239,68,68,0.3)  !important; }

/* Run button in pf-footer */
.pf-btn-run {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(16,185,129,0.4);
  background: rgba(16,185,129,0.08);
  color: #10b981;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pf-btn-run:hover   { background: rgba(16,185,129,0.14); border-color: rgba(16,185,129,0.55); }
.pf-btn-run:disabled { opacity: 0.45; cursor: not-allowed; }
.pf-btn-run.running { color: var(--cyan); border-color: rgba(0,212,255,0.4); background: rgba(0,212,255,0.06);
                      animation: btn-pulse 0.9s ease-in-out infinite; }
.pf-btn-run.done-ok { color: #10b981; border-color: rgba(16,185,129,0.4); animation: none; }
.pf-btn-run.done-err{ color: var(--crimson); border-color: rgba(239,68,68,0.4); animation: none; }

/* ── components/pipeline.css ── */
/* ── Execution Pipeline ──────────────────────────────────────────── */
.pipeline-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--space-4) var(--space-3);
  gap: var(--space-4);
  overflow: hidden;
  min-height: 0;
}

.pipeline-track {
  position: relative;
  height: 60px;
  display: flex;
  align-items: center;
}

/* Flow line */
.pipeline-line {
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(var(--cyan-500-rgb), 0.3) 10%,
    rgba(var(--cyan-500-rgb), 0.3) 90%,
    transparent);
  transform: translateY(-50%);
}

.pipeline-stages {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  position: relative;
  z-index: 1;
}

.pipeline-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* Stage Nodes */
.stage-node {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-panel);
  background: var(--surface-node);
  font-size: var(--text-sm);
  font-family: var(--font-data);
  color: var(--text-dim);
  transition: all var(--dur-slow);
  position: relative;
}
.stage-node.gate {
  width: 26px; height: 26px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 700;
}
.stage-node.gate-a { border-color: rgba(var(--amber-500-rgb),   0.4); color: var(--status-gate);    background: var(--fill-gate);    }
.stage-node.gate-b { border-color: rgba(var(--purple-500-rgb),  0.4); color: var(--status-accent);  background: var(--fill-accent);  }
.stage-node.gate-c { border-color: rgba(var(--crimson-500-rgb), 0.4); color: var(--status-error);   background: var(--fill-error);   }
.stage-node.gate-d { border-color: rgba(var(--emerald-500-rgb), 0.4); color: var(--status-success); background: var(--fill-success); }
.stage-node.active {
  border-color: var(--status-active);
  color: var(--status-active);
  animation: node-pulse 1.8s ease-in-out infinite;
}
@keyframes node-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(var(--cyan-500-rgb), 0.3); }
  50%       { box-shadow: 0 0 22px rgba(var(--cyan-500-rgb), 0.6); }
}

.stage-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
  white-space: nowrap;
}

/* Particle canvas */
#pipeline-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* ── Pipeline Stats ──────────────────────────────────────────────── */
.pipeline-stats {
  display: flex;
  gap: var(--space-4);
  padding: 0 4px;
}

.pip-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pip-stat-value {
  font-family: var(--font-data);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1;
}

.pip-stat-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ── components/lens.css ── */
/* ── LENS Economics Panel ────────────────────────────────────────── */
.lens-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* ── Top Metrics Row ─────────────────────────────────────────────── */
.lens-metrics-row {
  display: flex;
  border-bottom: 1px solid var(--border-panel);
  flex-shrink: 0;
}

.lens-metric {
  flex: 1;
  padding: 10px 14px;
  border-right: 1px solid var(--border-panel);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lens-metric:last-child { border-right: none; }

.lm-value {
  font-family: var(--font-data);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}
.lm-value.cost-val {
  color: var(--status-success);
  text-shadow: 0 0 10px rgba(var(--emerald-500-rgb), 0.35);
}

.lm-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ── Charts Row ──────────────────────────────────────────────────── */
.lens-charts-row {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1.4fr 1.4fr;
  overflow: hidden;
  min-height: 0;
}

.chart-cell {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-right: 1px solid var(--border-panel);
  overflow: hidden;
}
.chart-cell:last-child { border-right: none; }

.chart-cell-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  text-transform: uppercase;
  flex-shrink: 0;
}

.chart-container {
  flex: 1;
  position: relative;
  min-height: 0;
}

/* ── components/feed.css ── */
/* ── Memory Live Feed ────────────────────────────────────────────── */
#memory-feed {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 0;
  min-height: 0;
}

/* ── Feed Row ────────────────────────────────────────────────────── */
.feed-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 14px;
  border-left: 2px solid transparent;
  transition: background var(--dur-fast);
  animation: feed-in var(--dur-slow) ease-out forwards;
}
@keyframes feed-in {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.feed-row:hover { background: rgba(255,255,255,0.025); }

/* Event type accent stripe */
.feed-row.type-llm_usage     { border-left-color: var(--status-active); }
.feed-row.type-tool_call     { border-left-color: var(--status-accent); }
.feed-row.type-agent_message { border-left-color: var(--status-success); }
.feed-row.type-voice_session { border-left-color: var(--status-gate); }

/* ── Row Anatomy ─────────────────────────────────────────────────── */
.feed-time {
  font-family: var(--font-data);
  font-size: var(--text-sm);
  color: var(--text-dim);
  flex-shrink: 0;
  min-width: 54px;
  padding-top: 1px;
}

.feed-content {
  flex: 1;
  min-width: 0;
}

.feed-summary {
  font-family: var(--font-data);
  font-size: var(--text-base);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.feed-meta {
  font-size: var(--text-sm);
  color: var(--text-dim);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Event Type Badges ───────────────────────────────────────────── */
.feed-badge {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  text-transform: uppercase;
  align-self: center;
}
.feed-badge.llm_usage     { background: var(--fill-active);  color: var(--status-active);  }
.feed-badge.tool_call     { background: var(--fill-accent);  color: var(--status-accent);  }
.feed-badge.agent_message { background: var(--fill-success); color: var(--status-success); }
.feed-badge.voice_session { background: var(--fill-gate);    color: var(--status-gate);    }

/* ── components/gates.css ── */
/* ── Gate Approval Cards ─────────────────────────────────────────── */
.gate-card {
  background: var(--surface-overlay);
  border: 1px solid;
  border-radius: var(--radius);
  backdrop-filter: blur(24px);
  padding: 14px 16px;
  width: 280px;
  pointer-events: all;
  animation: gate-arrive var(--dur-xslow) var(--ease-spring) forwards;
}
@keyframes gate-arrive {
  from { opacity: 0; transform: translateX(30px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* Gate color variants */
.gate-card.gate-a { border-color: rgba(var(--amber-500-rgb),   0.5); box-shadow: 0 0 30px rgba(var(--amber-500-rgb),   0.15); }
.gate-card.gate-b { border-color: rgba(var(--purple-500-rgb),  0.5); box-shadow: 0 0 30px rgba(var(--purple-500-rgb),  0.15); }
.gate-card.gate-c { border-color: rgba(var(--crimson-500-rgb), 0.5); box-shadow: 0 0 30px rgba(var(--crimson-500-rgb), 0.15); }
.gate-card.gate-d { border-color: rgba(var(--emerald-500-rgb), 0.5); box-shadow: 0 0 30px rgba(var(--emerald-500-rgb), 0.15); }

/* ── Card Anatomy ────────────────────────────────────────────────── */
.gc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.gc-gate-label {
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.gc-gate-label.gate-a { color: var(--status-gate);    }
.gc-gate-label.gate-b { color: var(--status-accent);  }
.gc-gate-label.gate-c { color: var(--status-error);   }
.gc-gate-label.gate-d { color: var(--status-success);  }

.gc-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.gc-desc {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-3);
}

/* ── Action Buttons ──────────────────────────────────────────────── */
.gc-actions {
  display: flex;
  gap: var(--space-2);
}

.gc-btn {
  flex: 1;
  padding: 7px 0;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity var(--dur-fast), transform 0.1s;
}
.gc-btn:hover  { opacity: 0.85; }
.gc-btn:active { transform: scale(0.97); }
.gc-btn.approve { background: var(--status-success); color: #000; }
.gc-btn.reject  {
  background: rgba(var(--crimson-500-rgb), 0.15);
  color: var(--status-error);
  border: 1px solid rgba(var(--crimson-500-rgb), 0.3);
}

/* ── components/stars.css ── */
/* ── Star Field Background ───────────────────────────────────────── */
#stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: white;
  animation: star-twinkle var(--dur) ease-in-out infinite;
  animation-delay: var(--delay);
  opacity: 0;
}
@keyframes star-twinkle {
  0%, 100% { opacity: 0; }
  50%       { opacity: var(--brightness); }
}

/* ── components/responsive.css ── */
/* ═══════════════════════════════════════════════════════════════════
   ORBIT RESPONSIVE OVERRIDES
   Breakpoint strategy:
     max-height: 900px  → compact landscape (iPad, laptops)
     portrait + ≤1024px → single-column tablet portrait
     max-height: 600px  → extreme compact (split-screen, phone landscape)
═══════════════════════════════════════════════════════════════════ */

/* Compact landscape — tighten chrome so bottom panels get more height */
@media screen and (max-height: 900px) {
  :root { --bar-h: 40px; }
  .panel-header   { padding: 7px 12px; }
  .lens-metric    { padding: 7px 12px; }
  .lm-value       { font-size: var(--text-lg); }
  .pip-stat-value { font-size: var(--text-xl); }
  .pipeline-body  { gap: 10px; }
  .pipeline-track { height: 52px; }
}

/* Tablet portrait — stack rows so each panel is full width */
@media screen and (max-width: 1024px) and (orientation: portrait) {
  .mc-row {
    flex-direction: column;
  }
  .mc-panel {
    min-height: 220px;
  }
  #mc-layout {
    overflow-y: auto;
  }
}

/* Extreme compact — hide non-essential chrome */
@media screen and (max-height: 600px) {
  .lens-metrics-row { display: none; }
  .pipeline-stats   { flex-wrap: wrap; gap: var(--space-2); }
}
