@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=JetBrains+Mono:wght@400;700&family=Inter:wght@400;500&display=swap');

:root {
  --bg-void: #050810;
  --bg-panel: #0C1220;
  --bg-panel-active: #0F1E35;
  --bg-input: #080D18;
  --border-dim: #1A2840;
  --border-active: #1E6FD9;
  --border-handoff: #D97F1E;
  --accent-primary: #1E6FD9;
  --accent-handoff: #D97F1E;
  --accent-idle: #2A3A50;
  --accent-success: #1ED97A;
  --accent-warning: #D9C21E;
  --cursor-color: #1E6FD9;
  --glow-active: rgba(30, 111, 217, 0.15);
  --glow-handoff: rgba(217, 127, 30, 0.15);
  --text-primary: #E8EEF7;
  --text-secondary: #6B84A3;
  --text-dim: #2F445C;
  --text-agent-name: #FFFFFF;
  --agent-jarvis: #1E6FD9;
  --agent-mason: #1ED97A;
  --agent-riley: #D97F1E;
  --agent-coach: #D9C21E;
  --agent-nora: #A07FD9;
  --agent-kai: #D91E6F;
  --agent-sage: #1ED9D9;
  --font-display: 'Orbitron', monospace;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Inter', sans-serif;
  --panel-padding: 16px;
  --feed-padding-left: 16px;
  --gap-panels: 12px;
  --header-height: 48px;
  --input-height: 64px;
  --transition-panel: border-color 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow: hidden;
}

/* ─── Layout ─────────────────────────────────────────── */

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

/* ─── Header ─────────────────────────────────────────── */

#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 20px;
  border-bottom: 1px solid var(--border-dim);
  background: var(--bg-void);
  flex-shrink: 0;
}

#header-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-primary);
}

#header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

#system-clock {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
}

#system-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent-success);
}

#system-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-success);
}

/* ─── Agent Panels ───────────────────────────────────── */

#agent-panels {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--gap-panels);
  padding: 12px;
  height: 28vh;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-dim);
}

.agent-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--panel-padding);
  border: 1px solid var(--border-dim);
  background: var(--bg-panel);
  overflow: hidden;
  transition: var(--transition-panel);
}

.agent-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-idle);
  flex-shrink: 0;
}

.status-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.agent-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.agent-description {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.agent-last-activity {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-secondary);
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}

.agent-panel-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-dim);
}

.agent-timestamp {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* Active state */
.agent-panel.active {
  border-color: var(--border-active);
  background: var(--bg-panel-active);
  box-shadow: 0 0 20px var(--glow-active);
}

.agent-panel.active .status-dot {
  background: var(--accent-primary);
  animation: pulse 2s ease-in-out infinite;
}

.agent-panel.active .status-label {
  color: var(--accent-primary);
}

.agent-panel.active .agent-name {
  color: var(--text-agent-name);
}

.agent-panel.active::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 1px;
  background: rgba(30, 111, 217, 0.18);
  animation: scanLine 3s linear infinite;
}

/* Handoff state */
.agent-panel.handoff {
  border-color: var(--border-handoff);
  background: var(--bg-panel);
  box-shadow: 0 0 20px var(--glow-handoff);
}

.agent-panel.handoff .status-dot {
  background: var(--accent-handoff);
  animation: pulse 0.8s ease-in-out infinite;
}

.agent-panel.handoff .status-label {
  color: var(--accent-handoff);
}

.agent-panel.handoff .agent-name {
  color: var(--text-primary);
}

/* ─── Activity Feed ──────────────────────────────────── */

#feed-wrapper {
  position: relative;
  flex: 1;
  overflow: hidden;
}

#activity-feed {
  height: 100%;
  overflow-y: auto;
  padding: 16px var(--feed-padding-left);
  background: var(--bg-void);
  scroll-behavior: smooth;
}

#activity-feed::-webkit-scrollbar {
  width: 4px;
}

#activity-feed::-webkit-scrollbar-track {
  background: transparent;
}

#activity-feed::-webkit-scrollbar-thumb {
  background: var(--border-dim);
  border-radius: 2px;
}

/* ─── Feed Cards ─────────────────────────────────────── */

.feed-entry.system-message {
  display: flex;
  justify-content: center;
  margin: 12px 0;
  animation: feedEntry 150ms ease-out both;
}

.feed-entry.system-message .feed-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

.feed-card {
  margin-bottom: 10px;
  border-left: 2px solid var(--border-dim);
  background: rgba(255, 255, 255, 0.025);
  padding: 10px 14px 12px;
  animation: feedEntry 180ms ease-out both;
  transition: border-color 0.3s ease;
}

.feed-card.agent-you {
  border-left-color: var(--text-dim);
  background: transparent;
}
.feed-card.agent-jarvis { border-left-color: var(--agent-jarvis); }
.feed-card.agent-mason  { border-left-color: var(--agent-mason);  }
.feed-card.agent-riley  { border-left-color: var(--agent-riley);  }
.feed-card.agent-coach  { border-left-color: var(--agent-coach);  }
.feed-card.agent-nora   { border-left-color: var(--agent-nora);   }
.feed-card.agent-kai    { border-left-color: var(--agent-kai);    }
.feed-card.agent-sage   { border-left-color: var(--agent-sage);   }

.feed-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}

.feed-agent-tag {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.feed-agent-tag.agent-you    { color: var(--text-secondary); }
.feed-agent-tag.agent-jarvis { color: var(--agent-jarvis); }
.feed-agent-tag.agent-mason  { color: var(--agent-mason);  }
.feed-agent-tag.agent-riley  { color: var(--agent-riley);  }
.feed-agent-tag.agent-coach  { color: var(--agent-coach);  }
.feed-agent-tag.agent-nora   { color: var(--agent-nora);   }
.feed-agent-tag.agent-kai    { color: var(--agent-kai);    }
.feed-agent-tag.agent-sage   { color: var(--agent-sage);   }

.feed-timestamp {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
}

/* ─── Card body — readable prose ────────────────────── */

.feed-card-body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.7;
}

.feed-card.agent-you .feed-card-body {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Streaming: show raw text + blinking cursor */
.feed-card-body.streaming {
  white-space: pre-wrap;
  word-break: break-word;
}
.feed-card-body.streaming::after {
  content: '▋';
  color: var(--accent-primary);
  animation: blink 0.9s step-end infinite;
  margin-left: 1px;
}

/* ─── Markdown elements inside cards ─────────────────── */

.feed-card-body h1,
.feed-card-body h2,
.feed-card-body h3 {
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  color: var(--text-agent-name);
  margin: 14px 0 6px;
  line-height: 1.3;
}
.feed-card-body h1 { font-size: 15px; }
.feed-card-body h2 { font-size: 13px; }
.feed-card-body h3 { font-size: 12px; color: var(--text-secondary); }

.feed-card-body p {
  margin: 0 0 8px;
}
.feed-card-body p:last-child { margin-bottom: 0; }

.feed-card-body ul,
.feed-card-body ol {
  padding-left: 18px;
  margin: 4px 0 8px;
}
.feed-card-body li { margin-bottom: 3px; line-height: 1.6; }

.feed-card-body strong {
  color: var(--text-agent-name);
  font-weight: 600;
}

.feed-card-body em {
  color: var(--text-secondary);
  font-style: italic;
}

.feed-card-body a {
  color: var(--accent-primary);
  text-decoration: none;
  border-bottom: 1px solid rgba(30, 111, 217, 0.3);
}

.feed-card-body hr {
  border: none;
  border-top: 1px solid var(--border-dim);
  margin: 10px 0;
}

.feed-card-body code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-dim);
  padding: 1px 5px;
  color: var(--accent-success);
  word-break: break-all;
}

.feed-card-body pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-dim);
  border-left: 2px solid var(--accent-primary);
  padding: 12px 14px;
  margin: 8px 0;
  overflow-x: auto;
  line-height: 1.5;
}
.feed-card-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: var(--text-primary);
  word-break: normal;
}

.feed-card-body blockquote {
  border-left: 2px solid var(--accent-handoff);
  margin: 8px 0;
  padding: 4px 12px;
  color: var(--text-secondary);
  font-style: italic;
}

.feed-card-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
  font-size: 13px;
}
.feed-card-body th,
.feed-card-body td {
  border: 1px solid var(--border-dim);
  padding: 6px 10px;
  text-align: left;
}
.feed-card-body th {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.03);
}

#new-activity-badge {
  display: none;
  position: absolute;
  bottom: 12px;
  right: 16px;
  background: var(--bg-panel-active);
  border: 1px solid var(--border-active);
  color: var(--accent-primary);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  cursor: pointer;
  animation: breathe 1.5s ease-in-out infinite;
}

#new-activity-badge.visible {
  display: block;
}

/* ─── Command Input ──────────────────────────────────── */

#command-bar {
  flex-shrink: 0;
}

#agent-selector {
  display: flex;
  align-items: center;
  gap: 0;
  border-top: 1px solid var(--border-dim);
  border-bottom: 1px solid var(--border-dim);
  background: var(--bg-input);
  padding: 0 20px;
  height: 36px;
  overflow-x: auto;
}

#agent-selector::-webkit-scrollbar { display: none; }

.agent-tab {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  cursor: pointer;
  border-right: 1px solid var(--border-dim);
  transition: color 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.agent-tab:first-child {
  border-left: none;
}

.agent-tab:hover {
  color: var(--text-secondary);
}

.agent-tab.selected {
  color: var(--text-agent-name);
}

.agent-tab[data-agent="jarvis"].selected { color: var(--agent-jarvis); border-bottom: 2px solid var(--agent-jarvis); }
.agent-tab[data-agent="mason"].selected  { color: var(--agent-mason);  border-bottom: 2px solid var(--agent-mason);  }
.agent-tab[data-agent="riley"].selected  { color: var(--agent-riley);  border-bottom: 2px solid var(--agent-riley);  }
.agent-tab[data-agent="coach"].selected  { color: var(--agent-coach);  border-bottom: 2px solid var(--agent-coach);  }
.agent-tab[data-agent="nora"].selected   { color: var(--agent-nora);   border-bottom: 2px solid var(--agent-nora);   }
.agent-tab[data-agent="kai"].selected    { color: var(--agent-kai);    border-bottom: 2px solid var(--agent-kai);    }
.agent-tab[data-agent="sage"].selected   { color: var(--agent-sage);   border-bottom: 2px solid var(--agent-sage);   }

#input-row {
  display: flex;
  align-items: center;
  height: var(--input-height);
  padding: 0 20px;
  background: var(--bg-input);
  border-top: 1px solid var(--border-active);
  transition: border-color 0.2s ease;
}

#input-row.focused {
  border-top-color: #2E8FFF;
}

#input-prompt {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--accent-primary);
  margin-right: 12px;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

#input-row.focused #input-prompt {
  color: #2E8FFF;
}

#command-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-primary);
  caret-color: var(--cursor-color);
}

#command-input::placeholder {
  color: var(--text-dim);
}

#command-input:disabled {
  opacity: 0.5;
}

/* ─── Animations ─────────────────────────────────────── */

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
}

@keyframes scanLine {
  0% { top: 0; }
  100% { top: 100%; }
}

@keyframes feedEntry {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ─── Collapsible cards ──────────────────────────────── */

.feed-card-body.collapsible {
  max-height: 140px;
  overflow: hidden;
  position: relative;
}

.feed-card-body.collapsible::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: linear-gradient(transparent, #050810);
  pointer-events: none;
}

.feed-card-body.collapsible.expanded {
  max-height: none;
}

.feed-card-body.collapsible.expanded::after {
  display: none;
}

.feed-card-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px 0;
  transition: color 0.2s ease;
}

.feed-card-toggle:hover {
  color: var(--accent-primary);
}

/* ─── Round separator ────────────────────────────────── */

.feed-round-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  animation: feedEntry 200ms ease-out both;
}

.feed-round-separator::before,
.feed-round-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-dim));
}

.feed-round-separator::after {
  background: linear-gradient(to left, transparent, var(--border-dim));
}

.feed-round-label {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ─── Mute Toggle ────────────────────────────────────── */

#interrupt-btn {
  background: none;
  border: 1px solid var(--border-dim);
  color: var(--text-secondary);
  font-size: 13px;
  padding: 3px 8px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.15s ease;
  line-height: 1;
}

#interrupt-btn:hover {
  border-color: #D94040;
  color: #D94040;
}

#interrupt-btn.flash {
  background: rgba(217, 64, 64, 0.2);
  border-color: #D94040;
  color: #D94040;
}

#mute-toggle {
  background: none;
  border: 1px solid var(--border-dim);
  color: var(--text-secondary);
  font-size: 13px;
  padding: 3px 8px;
  cursor: pointer;
  transition: border-color 0.2s ease, opacity 0.2s ease;
  line-height: 1;
}

#mute-toggle:hover {
  border-color: var(--accent-primary);
}

#mute-toggle.muted {
  opacity: 0.4;
  border-color: var(--text-dim);
}

/* ─── Voice Controls ─────────────────────────────────── */

#voice-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 8px;
}

#ptt-pill {
  display: flex;
  border: 1px solid var(--border-dim);
  overflow: hidden;
}

#ptt-pill button {
  background: none;
  border: none;
  padding: 4px 10px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

#ptt-pill button + button {
  border-left: 1px solid var(--border-dim);
}

#ptt-pill button.active {
  background: var(--accent-primary);
  color: #fff;
}

#ptt-pill button:hover:not(.active) {
  color: var(--text-secondary);
}

#mic-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-dim);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

#mic-button:hover {
  border-color: var(--accent-primary);
}

#mic-button[data-state="listening"] {
  border-color: #E85050;
  background: rgba(232, 80, 80, 0.1);
  box-shadow: 0 0 12px rgba(232, 80, 80, 0.3);
  animation: micPulse 1.2s ease-in-out infinite;
}

#mic-button[data-state="processing"] {
  border-color: var(--accent-warning);
  background: rgba(217, 194, 30, 0.1);
  box-shadow: 0 0 8px rgba(217, 194, 30, 0.25);
}

#voice-interim {
  padding: 0 20px 6px;
  font-family: var(--font-body);
  font-size: 12px;
  font-style: italic;
  color: var(--text-dim);
  min-height: 0;
  transition: min-height 0.1s ease;
  background: var(--bg-input);
}

#voice-interim:not(:empty) {
  min-height: 20px;
}

/* ─── Speaking waveform on agent panel ───────────────── */

.agent-panel.speaking::before {
  content: '';
  position: absolute;
  bottom: 10px;
  left: var(--panel-padding);
  width: 24px;
  height: 10px;
  background: repeating-linear-gradient(
    to right,
    var(--agent-jarvis) 0px,
    var(--agent-jarvis) 2px,
    transparent 2px,
    transparent 4px
  );
  animation: waveform 0.6s ease-in-out infinite alternate;
  opacity: 0.7;
}

#panel-mason.speaking::before   { background: repeating-linear-gradient(to right, var(--agent-mason) 0px, var(--agent-mason) 2px, transparent 2px, transparent 4px); }
#panel-riley.speaking::before   { background: repeating-linear-gradient(to right, var(--agent-riley) 0px, var(--agent-riley) 2px, transparent 2px, transparent 4px); }
#panel-coach.speaking::before   { background: repeating-linear-gradient(to right, var(--agent-coach) 0px, var(--agent-coach) 2px, transparent 2px, transparent 4px); }
#panel-nora.speaking::before    { background: repeating-linear-gradient(to right, var(--agent-nora) 0px, var(--agent-nora) 2px, transparent 2px, transparent 4px); }
#panel-kai.speaking::before     { background: repeating-linear-gradient(to right, var(--agent-kai) 0px, var(--agent-kai) 2px, transparent 2px, transparent 4px); }
#panel-sage.speaking::before    { background: repeating-linear-gradient(to right, var(--agent-sage) 0px, var(--agent-sage) 2px, transparent 2px, transparent 4px); }

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(232, 80, 80, 0.25); }
  50%       { box-shadow: 0 0 18px rgba(232, 80, 80, 0.55); }
}

@keyframes waveform {
  from { height: 4px; }
  to   { height: 12px; }
}

/* ─── Main Area ──────────────────────────────────────── */

#main-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

/* ─── Visualizer ─────────────────────────────────────── */

#visualizer {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#viz-svg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

#viz-orbit-ring {
  position: absolute;
  width: 370px;
  height: 370px;
  border-radius: 50%;
  border: 1px solid rgba(30, 111, 217, 0.1);
  pointer-events: none;
}

#viz-orbit-ring::before {
  content: '';
  position: absolute;
  inset: -24px;
  border-radius: 50%;
  border: 1px dashed rgba(30, 111, 217, 0.06);
}

#viz-orbit-ring::after {
  content: '';
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  border: 1px dashed rgba(30, 111, 217, 0.06);
}

/* ─── Central Reactor (large) ────────────────────────── */

#viz-reactor {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  cursor: pointer;
}

.vr-ring {
  position: absolute;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.vr-p1 {
  width: 110px; height: 110px;
  border: 1px dashed rgba(30, 111, 217, 0.2);
  animation: reactor-spin 24s linear infinite;
}

.vr-p2 {
  width: 82px; height: 82px;
  border: 1px solid rgba(30, 111, 217, 0.15);
  border-top-color: transparent;
  border-bottom-color: transparent;
  animation: reactor-spin 12s linear infinite reverse;
}

.vr-p3 {
  width: 60px; height: 60px;
  border: 1px dashed rgba(30, 111, 217, 0.2);
  animation: reactor-spin 7s linear infinite;
}

.vr-p4 { display: none; }

.vr-core {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 32%,
    rgba(180, 220, 255, 0.95) 0%,
    rgba(30, 111, 217, 1) 42%,
    rgba(6, 24, 70, 1) 100%
  );
  box-shadow:
    0 0 16px rgba(30, 111, 217, 0.9),
    0 0 32px rgba(30, 111, 217, 0.5),
    0 0 64px rgba(30, 111, 217, 0.2),
    inset 0 0 10px rgba(140, 190, 255, 0.25);
  transition: box-shadow 0.4s ease, transform 0.4s ease;
  z-index: 3;
}

/* Jarvis active — gentle breathe */
#viz-reactor.jarvis-active .vr-core {
  animation: orb-active 2s ease-in-out infinite;
}

/* Jarvis speaking — full pulse */
#viz-reactor.speaking .vr-core {
  animation: orb-speak 0.9s ease-in-out infinite;
}

@keyframes orb-active {
  0%, 100% {
    box-shadow:
      0 0 16px rgba(30,111,217,0.9),
      0 0 32px rgba(30,111,217,0.5),
      0 0 64px rgba(30,111,217,0.2),
      inset 0 0 10px rgba(140,190,255,0.25);
  }
  50% {
    box-shadow:
      0 0 22px rgba(30,111,217,1),
      0 0 50px rgba(30,111,217,0.7),
      0 0 90px rgba(30,111,217,0.35),
      inset 0 0 14px rgba(140,190,255,0.35);
  }
}

@keyframes orb-speak {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 16px rgba(30,111,217,0.9),
      0 0 32px rgba(30,111,217,0.5),
      0 0 64px rgba(30,111,217,0.2),
      inset 0 0 10px rgba(140,190,255,0.25);
  }
  50% {
    transform: scale(1.22);
    box-shadow:
      0 0 28px rgba(30,111,217,1),
      0 0 60px rgba(30,111,217,0.85),
      0 0 110px rgba(30,111,217,0.5),
      0 0 160px rgba(30,111,217,0.2),
      inset 0 0 16px rgba(180,220,255,0.5);
  }
}

#viz-orb-name {
  position: absolute;
  top: calc(50% + 28px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--agent-jarvis);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.85;
}

#viz-status-text {
  position: absolute;
  top: calc(50% + 44px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  white-space: nowrap;
  transition: color 0.4s ease;
  pointer-events: none;
}

#viz-status-text.active {
  color: var(--accent-primary);
  animation: breathe 1.2s ease-in-out infinite;
}

/* Hide Jarvis orbit node — he lives in the center now */
#vnode-jarvis { display: none; }

/* When Web Audio is driving the orb, disable CSS animations */
#viz-reactor.audio-reactive .vr-core {
  animation: none;
  transition: none;
}

/* ─── Agent Nodes ────────────────────────────────────── */

.viz-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
  cursor: default;
}

.viz-node-ring {
  position: absolute;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.viz-node-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  transition: background 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
  z-index: 1;
}

.viz-node-label {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-top: 16px;
  transition: color 0.35s ease;
  white-space: nowrap;
}

.viz-node-role {
  font-family: var(--font-body);
  font-size: 9px;
  color: var(--text-dim);
  opacity: 0.5;
  white-space: nowrap;
  transition: opacity 0.35s ease;
}

/* Idle dot colors */
#vnode-jarvis .viz-node-dot { background: rgba(30,  111, 217, 0.3); }
#vnode-mason  .viz-node-dot { background: rgba(30,  217, 122, 0.3); }
#vnode-riley  .viz-node-dot { background: rgba(217, 127,  30, 0.3); }
#vnode-coach  .viz-node-dot { background: rgba(217, 194,  30, 0.3); }
#vnode-nora   .viz-node-dot { background: rgba(160, 127, 217, 0.3); }
#vnode-kai    .viz-node-dot { background: rgba(217,  30, 111, 0.3); }
#vnode-sage   .viz-node-dot { background: rgba( 30, 217, 217, 0.3); }

/* Active */
#vnode-jarvis.active .viz-node-dot { background: var(--agent-jarvis); box-shadow: 0 0 12px var(--agent-jarvis), 0 0 24px rgba(30,111,217,0.4); }
#vnode-mason.active  .viz-node-dot { background: var(--agent-mason);  box-shadow: 0 0 12px var(--agent-mason),  0 0 24px rgba(30,217,122,0.4); }
#vnode-riley.active  .viz-node-dot { background: var(--agent-riley);  box-shadow: 0 0 12px var(--agent-riley),  0 0 24px rgba(217,127,30,0.4); }
#vnode-coach.active  .viz-node-dot { background: var(--agent-coach);  box-shadow: 0 0 12px var(--agent-coach),  0 0 24px rgba(217,194,30,0.4); }
#vnode-nora.active   .viz-node-dot { background: var(--agent-nora);   box-shadow: 0 0 12px var(--agent-nora),   0 0 24px rgba(160,127,217,0.4); }
#vnode-kai.active    .viz-node-dot { background: var(--agent-kai);    box-shadow: 0 0 12px var(--agent-kai),    0 0 24px rgba(217,30,111,0.4); }
#vnode-sage.active   .viz-node-dot { background: var(--agent-sage);   box-shadow: 0 0 12px var(--agent-sage),   0 0 24px rgba(30,217,217,0.4); }

#vnode-jarvis.active .viz-node-label { color: var(--agent-jarvis); }
#vnode-mason.active  .viz-node-label { color: var(--agent-mason);  }
#vnode-riley.active  .viz-node-label { color: var(--agent-riley);  }
#vnode-coach.active  .viz-node-label { color: var(--agent-coach);  }
#vnode-nora.active   .viz-node-label { color: var(--agent-nora);   }
#vnode-kai.active    .viz-node-label { color: var(--agent-kai);    }
#vnode-sage.active   .viz-node-label { color: var(--agent-sage);   }

.viz-node.active .viz-node-role { opacity: 1; }

.viz-node-activity {
  font-family: var(--font-body);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.3s ease;
  min-height: 11px;
}

.viz-node.active .viz-node-activity {
  opacity: 0.75;
}

#vnode-mason.active  .viz-node-activity { color: var(--agent-mason);  }
#vnode-riley.active  .viz-node-activity { color: var(--agent-riley);  }
#vnode-coach.active  .viz-node-activity { color: var(--agent-coach);  }
#vnode-nora.active   .viz-node-activity { color: var(--agent-nora);   }
#vnode-kai.active    .viz-node-activity { color: var(--agent-kai);    }
#vnode-sage.active   .viz-node-activity { color: var(--agent-sage);   }

.viz-node.active .viz-node-dot {
  animation: pulse 1.5s ease-in-out infinite;
}

.viz-node.active .viz-node-ring {
  animation: viz-ring-expand 1.5s ease-out infinite;
}

@keyframes viz-ring-expand {
  0%   { transform: scale(1);   opacity: 0.5; }
  100% { transform: scale(2.2); opacity: 0;   }
}

/* Speaking */
.viz-node.speaking .viz-node-ring {
  animation: viz-ring-expand 0.9s ease-out infinite;
}

/* ─── Activity Feed Panel ────────────────────────────── */

#feed-panel {
  position: absolute;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100%;
  background: rgba(5, 8, 16, 0.96);
  border-left: 1px solid var(--border-dim);
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
  backdrop-filter: blur(14px);
}

#feed-panel.open {
  right: 0;
  border-left-color: var(--border-active);
}

#feed-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  --c: rgba(30, 111, 217, 0.35);
  background:
    linear-gradient(var(--c) 0 0) top    left  / 16px 1px no-repeat,
    linear-gradient(var(--c) 0 0) top    left  / 1px 16px no-repeat,
    linear-gradient(var(--c) 0 0) bottom left  / 16px 1px no-repeat,
    linear-gradient(var(--c) 0 0) bottom left  / 1px 16px no-repeat;
  pointer-events: none;
  z-index: 0;
}

#feed-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-dim);
  flex-shrink: 0;
  z-index: 1;
}

#feed-panel-title {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-secondary);
}

#feed-panel-controls {
  display: flex;
  gap: 6px;
}

#feed-panel-controls button {
  background: none;
  border: 1px solid var(--border-dim);
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

#feed-panel-controls button:hover {
  color: var(--text-secondary);
  border-color: var(--accent-primary);
}

#pin-feed.pinned {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

#feed-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

/* ─── Scan line overlay ──────────────────────────────── */

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.06) 3px,
    rgba(0, 0, 0, 0.06) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ─── Ambient dot grid ───────────────────────────────── */

#app {
  background-image: radial-gradient(circle, rgba(30, 111, 217, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* ─── Header left group ──────────────────────────────── */

#header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ─── Reactor Logo ───────────────────────────────────── */

#reactor-logo {
  position: relative;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.r-ring {
  position: absolute;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.r-outer {
  width: 28px;
  height: 28px;
  border: 1px dashed rgba(30, 111, 217, 0.45);
  animation: reactor-spin 14s linear infinite;
}

.r-mid {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(30, 111, 217, 0.55);
  border-top-color: transparent;
  animation: reactor-spin 5s linear infinite reverse;
}

.r-inner {
  width: 10px;
  height: 10px;
  border: 1px dashed rgba(30, 111, 217, 0.7);
  animation: reactor-spin 3s linear infinite;
}

.r-core {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-primary);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px var(--accent-primary), 0 0 14px rgba(30, 111, 217, 0.6);
  animation: reactor-pulse 2.5s ease-in-out infinite;
}

@keyframes reactor-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes reactor-pulse {
  0%, 100% { box-shadow: 0 0 5px var(--accent-primary), 0 0 10px rgba(30, 111, 217, 0.5); }
  50%       { box-shadow: 0 0 10px var(--accent-primary), 0 0 22px rgba(30, 111, 217, 0.8), 0 0 40px rgba(30, 111, 217, 0.3); }
}

/* Reactor intensifies when any agent is active — toggled by JS class on #app */
#app.agents-active .r-core {
  animation: reactor-pulse-active 1s ease-in-out infinite;
}

#app.agents-active .r-outer {
  animation-duration: 4s;
  border-color: rgba(30, 111, 217, 0.7);
}

@keyframes reactor-pulse-active {
  0%, 100% { box-shadow: 0 0 8px var(--accent-primary), 0 0 18px rgba(30, 111, 217, 0.7); }
  50%       { box-shadow: 0 0 16px var(--accent-primary), 0 0 35px rgba(30, 111, 217, 1), 0 0 60px rgba(30, 111, 217, 0.4); }
}

/* ─── HUD Corner Brackets ────────────────────────────── */

.agent-panel::before,
.feed-card::before {
  content: '';
  position: absolute;
  inset: 0;
  --c: rgba(42, 58, 80, 0.8);
  background:
    linear-gradient(var(--c) 0 0) top    left  / 12px 1px no-repeat,
    linear-gradient(var(--c) 0 0) top    left  / 1px 12px no-repeat,
    linear-gradient(var(--c) 0 0) top    right / 12px 1px no-repeat,
    linear-gradient(var(--c) 0 0) top    right / 1px 12px no-repeat,
    linear-gradient(var(--c) 0 0) bottom left  / 12px 1px no-repeat,
    linear-gradient(var(--c) 0 0) bottom left  / 1px 12px no-repeat,
    linear-gradient(var(--c) 0 0) bottom right / 12px 1px no-repeat,
    linear-gradient(var(--c) 0 0) bottom right / 1px 12px no-repeat;
  pointer-events: none;
  z-index: 1;
  transition: --c 0.4s ease;
}

/* Active panels: corners light up in agent accent color */
#panel-jarvis.active::before { --c: var(--agent-jarvis); }
#panel-mason.active::before  { --c: var(--agent-mason);  }
#panel-riley.active::before  { --c: var(--agent-riley);  }
#panel-coach.active::before  { --c: var(--agent-coach);  }
#panel-nora.active::before   { --c: var(--agent-nora);   }
#panel-kai.active::before    { --c: var(--agent-kai);    }
#panel-sage.active::before   { --c: var(--agent-sage);   }

/* Feed cards: corners match agent color */
.feed-card.agent-jarvis::before { --c: var(--agent-jarvis); }
.feed-card.agent-mason::before  { --c: var(--agent-mason);  }
.feed-card.agent-riley::before  { --c: var(--agent-riley);  }
.feed-card.agent-coach::before  { --c: var(--agent-coach);  }
.feed-card.agent-nora::before   { --c: var(--agent-nora);   }
.feed-card.agent-kai::before    { --c: var(--agent-kai);    }
.feed-card.agent-sage::before   { --c: var(--agent-sage);   }
.feed-card.agent-you::before    { --c: var(--text-dim);     }

/* Command bar HUD corners */
#command-bar {
  position: relative;
}

#command-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  --c: rgba(30, 111, 217, 0.4);
  background:
    linear-gradient(var(--c) 0 0) top    left  / 18px 1px no-repeat,
    linear-gradient(var(--c) 0 0) top    left  / 1px 18px no-repeat,
    linear-gradient(var(--c) 0 0) top    right / 18px 1px no-repeat,
    linear-gradient(var(--c) 0 0) top    right / 1px 18px no-repeat;
  pointer-events: none;
  z-index: 1;
}

/* ─── Enhanced active panel glows ────────────────────── */

#panel-jarvis.active { border-color: var(--agent-jarvis); box-shadow: 0 0 24px rgba(30, 111, 217, 0.2),  inset 0 0 20px rgba(30, 111, 217, 0.04); }
#panel-mason.active  { border-color: var(--agent-mason);  box-shadow: 0 0 24px rgba(30, 217, 122, 0.2),  inset 0 0 20px rgba(30, 217, 122, 0.04); }
#panel-riley.active  { border-color: var(--agent-riley);  box-shadow: 0 0 24px rgba(217, 127, 30, 0.2),  inset 0 0 20px rgba(217, 127, 30, 0.04); }
#panel-coach.active  { border-color: var(--agent-coach);  box-shadow: 0 0 24px rgba(217, 194, 30, 0.2),  inset 0 0 20px rgba(217, 194, 30, 0.04); }
#panel-nora.active   { border-color: var(--agent-nora);   box-shadow: 0 0 24px rgba(160, 127, 217, 0.2), inset 0 0 20px rgba(160, 127, 217, 0.04); }
#panel-kai.active    { border-color: var(--agent-kai);    box-shadow: 0 0 24px rgba(217, 30, 111, 0.2),  inset 0 0 20px rgba(217, 30, 111, 0.04); }

#panel-jarvis.active .status-dot { background: var(--agent-jarvis); }
#panel-mason.active  .status-dot { background: var(--agent-mason);  }
#panel-riley.active  .status-dot { background: var(--agent-riley);  }
#panel-coach.active  .status-dot { background: var(--agent-coach);  }
#panel-nora.active   .status-dot { background: var(--agent-nora);   }
#panel-kai.active    .status-dot { background: var(--agent-kai);    }

#panel-jarvis.active .status-label { color: var(--agent-jarvis); }
#panel-mason.active  .status-label { color: var(--agent-mason);  }
#panel-riley.active  .status-label { color: var(--agent-riley);  }
#panel-coach.active  .status-label { color: var(--agent-coach);  }
#panel-nora.active   .status-label { color: var(--agent-nora);   }
#panel-kai.active    .status-label { color: var(--agent-kai);    }

/* ─── Speaking: sonar ping on status dot ─────────────── */

.agent-panel.speaking .status-dot {
  animation: none;
}

.agent-panel.speaking .status-dot::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid currentColor;
  animation: sonar-ping 1.2s ease-out infinite;
  opacity: 0;
}

.status-dot {
  position: relative;
}

@keyframes sonar-ping {
  0%   { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2.8); opacity: 0; }
}

/* ─── Floating Windows Layer ─────────────────────────── */

#windows-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
}

.float-window {
  position: absolute;
  pointer-events: all;
  background: rgba(7, 11, 20, 0.96);
  border: 1px solid var(--border-dim);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(16px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.float-window::before {
  content: '';
  position: absolute;
  inset: 0;
  --c: rgba(30, 111, 217, 0.35);
  background:
    linear-gradient(var(--c) 0 0) top    left  / 14px 1px no-repeat,
    linear-gradient(var(--c) 0 0) top    left  / 1px 14px no-repeat,
    linear-gradient(var(--c) 0 0) top    right / 14px 1px no-repeat,
    linear-gradient(var(--c) 0 0) top    right / 1px 14px no-repeat,
    linear-gradient(var(--c) 0 0) bottom left  / 14px 1px no-repeat,
    linear-gradient(var(--c) 0 0) bottom left  / 1px 14px no-repeat,
    linear-gradient(var(--c) 0 0) bottom right / 14px 1px no-repeat,
    linear-gradient(var(--c) 0 0) bottom right / 1px 14px no-repeat;
  pointer-events: none;
  z-index: 0;
}

.float-window.win-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.97) translateY(4px);
}

.float-window.dragging {
  opacity: 0.9;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--border-active);
}

.float-win-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-dim);
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.float-win-titlebar:active { cursor: grabbing; }

.float-win-title {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-secondary);
}

.float-win-controls {
  display: flex;
  gap: 4px;
}

.win-btn {
  background: none;
  border: 1px solid var(--border-dim);
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
  pointer-events: all;
}

.win-btn:hover               { color: var(--text-secondary); border-color: var(--text-secondary); }
.win-btn.win-close:hover     { color: #E85050;               border-color: #E85050; }
.win-btn.win-pin.pinned      { color: var(--accent-primary); border-color: var(--accent-primary); }

/* Abort button — hidden until agent is active */
.win-btn.win-abort {
  display: none;
  font-size: 10px;
  padding: 2px 5px;
  border-color: transparent;
}
.win-btn.win-abort.abort-visible {
  display: inline-flex;
  align-items: center;
  animation: abort-pulse 1s ease-in-out infinite;
}
.win-btn.win-abort:hover { border-color: #E85050; }

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

.float-win-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  z-index: 1;
}

/* ─── Per-agent activity windows ─────────────────────── */

.agent-win {
  width: 360px;
  height: 420px;
}

/* Cascaded default positions — user can drag to rearrange */
#win-jarvis { right: 20px;  top: 68px;  }
#win-mason  { right: 40px;  top: 88px;  }
#win-riley  { right: 60px;  top: 108px; }
#win-coach  { right: 80px;  top: 128px; }
#win-nora   { right: 100px; top: 148px; }
#win-kai    { right: 120px; top: 168px; }

/* Agent-colored title bars */
.agent-jarvis-bar { border-bottom-color: rgba(30,  111, 217, 0.4); }
.agent-mason-bar  { border-bottom-color: rgba(30,  217, 122, 0.4); }
.agent-riley-bar  { border-bottom-color: rgba(217, 127,  30, 0.4); }
.agent-coach-bar  { border-bottom-color: rgba(217, 194,  30, 0.4); }
.agent-nora-bar   { border-bottom-color: rgba(160, 127, 217, 0.4); }
.agent-kai-bar    { border-bottom-color: rgba(217,  30, 111, 0.4); }
.agent-sage-bar   { border-bottom-color: rgba( 30, 217, 217, 0.4); }

.agent-jarvis-bar .float-win-title { color: var(--agent-jarvis); }
.agent-mason-bar  .float-win-title { color: var(--agent-mason);  }
.agent-riley-bar  .float-win-title { color: var(--agent-riley);  }
.agent-coach-bar  .float-win-title { color: var(--agent-coach);  }
.agent-nora-bar   .float-win-title { color: var(--agent-nora);   }
.agent-kai-bar    .float-win-title { color: var(--agent-kai);    }
.agent-sage-bar   .float-win-title { color: var(--agent-sage);   }

/* HUD corner color matches agent */
#win-jarvis::before { --c: rgba(30,  111, 217, 0.4); }
#win-mason::before  { --c: rgba(30,  217, 122, 0.4); }
#win-riley::before  { --c: rgba(217, 127,  30, 0.4); }
#win-coach::before  { --c: rgba(217, 194,  30, 0.4); }
#win-nora::before   { --c: rgba(160, 127, 217, 0.4); }
#win-kai::before    { --c: rgba(217,  30, 111, 0.4); }
#win-sage::before   { --c: rgba( 30, 217, 217, 0.4); }

/* Scrollable feed inside each window */
.agent-feed {
  height: 100%;
  overflow-y: auto;
  padding: 10px 12px;
  scroll-behavior: smooth;
}

.agent-feed::-webkit-scrollbar       { width: 3px; }
.agent-feed::-webkit-scrollbar-track { background: transparent; }
.agent-feed::-webkit-scrollbar-thumb { background: var(--border-dim); border-radius: 2px; }

#win-feed #feed-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

/* ─── Agent Detail Window ────────────────────────────── */

#win-agent-detail {
  width: 300px;
  left: calc(50% - 150px);
  top: calc(50% - 130px);
}

#agent-detail-content {
  padding: 16px;
}

.detail-agent-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}

.detail-agent-role {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.detail-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.detail-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.detail-status-label {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.detail-last-msg {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.65;
  border-left: 2px solid var(--border-dim);
  padding: 4px 10px;
  font-style: italic;
}

/* ─── Command Window ─────────────────────────────────── */

#win-command {
  width: 700px;
  left: calc(50% - 350px);
  bottom: 20px;
}

/* Reuse existing agent-selector / input-row styles — IDs unchanged */
#win-command #agent-selector {
  border-top: none;
}

#win-command #input-row {
  border-top: 1px solid var(--border-active);
}

/* ─── Minimized Tray ─────────────────────────────────── */

#minimized-tray {
  position: fixed;
  bottom: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  z-index: 300;
  pointer-events: all;
}

.tray-icon {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 5px 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  animation: feedEntry 150ms ease-out both;
}

.tray-icon:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

/* ─── Task Board Window ──────────────────────────────── */

#win-tasks {
  width: 300px;
  height: 480px;
  left: 20px;
  top: 68px;
}

#win-tasks::before { --c: rgba(30, 111, 217, 0.3); }

.task-board-bar {
  border-bottom-color: rgba(30, 111, 217, 0.4);
}

.task-board-bar .float-win-title {
  color: var(--accent-primary);
}

#task-stats {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px 6px;
  border-bottom: 1px solid var(--border-dim);
  flex-shrink: 0;
}

.tstat {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.tstat-sep     { color: var(--text-dim); font-size: 8px; }
.tstat-active  { color: var(--accent-primary); }
.tstat-pending { color: var(--text-dim); }
.tstat-done    { color: var(--accent-success); }
.tstat-blocked { color: #D94040; }

#task-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 0;
}

#task-list::-webkit-scrollbar       { width: 3px; }
#task-list::-webkit-scrollbar-track { background: transparent; }
#task-list::-webkit-scrollbar-thumb { background: var(--border-dim); border-radius: 2px; }

.task-empty {
  font-family: var(--font-display);
  font-size: 9px;
  color: var(--text-dim);
  text-align: center;
  padding: 32px 0;
  letter-spacing: 0.14em;
}

.task-item {
  display: flex;
  align-items: stretch;
  background: var(--bg-input);
  border: 1px solid var(--border-dim);
  border-left: none;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
  animation: feedEntry 200ms ease-out both;
  position: relative;
}

.task-item:hover { background: var(--bg-panel); }

.task-active  { border-color: rgba(30, 111, 217, 0.4); }
.task-blocked { border-color: rgba(217, 64, 64, 0.3); }
.task-done    { opacity: 0.45; }

.task-bar {
  width: 3px;
  flex-shrink: 0;
  background: var(--ac, #3A4E66);
}

.task-active  .task-bar { box-shadow: 2px 0 8px var(--ac, #1E6FD9); }
.task-blocked .task-bar { box-shadow: 2px 0 8px #D9404066; }

.task-inner {
  flex: 1;
  padding: 9px 10px 8px;
  min-width: 0;
}

.task-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.task-agent {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.task-status-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.task-status-lbl {
  font-family: var(--font-display);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.task-score {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-left: 5px;
  padding: 1px 5px;
  border: 1px solid currentColor;
  opacity: 0.9;
}

.task-title {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

.task-notes {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Task Progress Bar ──────────────────────────────── */

.task-progress-wrap {
  margin-top: 7px;
  height: 3px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
}

.task-progress-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
  box-shadow: 0 0 6px currentColor;
}

.task-progress-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-secondary);
  margin-top: 3px;
  letter-spacing: 0.04em;
}

/* ─── Resize Handle ──────────────────────────────────── */

.win-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 18px;
  height: 18px;
  cursor: se-resize;
  z-index: 10;
}

.win-resize-handle::after {
  content: '';
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-right: 2px solid rgba(255, 255, 255, 0.12);
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
  transition: border-color 0.2s ease;
}

.float-window:hover .win-resize-handle::after {
  border-color: rgba(255, 255, 255, 0.25);
}

/* ─── Waveform ───────────────────────────────────────── */

.viz-waveform {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.viz-node.speaking .viz-waveform {
  opacity: 1;
}

.viz-node.speaking .viz-node-dot {
  display: none;
}

.viz-waveform span {
  display: block;
  width: 2px;
  height: 3px;
  border-radius: 1px;
  background: currentColor;
  animation: waveform-bar 0.7s ease-in-out infinite;
}

.viz-waveform span:nth-child(1) { animation-delay: 0.00s; }
.viz-waveform span:nth-child(2) { animation-delay: 0.12s; }
.viz-waveform span:nth-child(3) { animation-delay: 0.24s; }
.viz-waveform span:nth-child(4) { animation-delay: 0.12s; }
.viz-waveform span:nth-child(5) { animation-delay: 0.00s; }

@keyframes waveform-bar {
  0%, 100% { height: 3px;  opacity: 0.4; }
  50%       { height: 14px; opacity: 1;   }
}

/* Per-agent waveform color */
#vnode-jarvis .viz-waveform { color: var(--agent-jarvis); }
#vnode-mason  .viz-waveform { color: var(--agent-mason);  }
#vnode-riley  .viz-waveform { color: var(--agent-riley);  }
#vnode-coach  .viz-waveform { color: var(--agent-coach);  }
#vnode-nora   .viz-waveform { color: var(--agent-nora);   }
#vnode-kai    .viz-waveform { color: var(--agent-kai);    }

/* ─── DOS Feed Font ──────────────────────────────────── */

.feed-card-body {
  font-family: 'VT323', monospace;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.feed-card-body p  { margin-bottom: 0.5em; }
.feed-card-body li { margin-bottom: 0.2em; }
.feed-card-body h1, .feed-card-body h2, .feed-card-body h3 {
  font-family: 'VT323', monospace;
  font-size: 17px;
  letter-spacing: 0.05em;
  margin-bottom: 0.3em;
}
.feed-card-body code, .feed-card-body pre {
  font-family: 'VT323', monospace;
  font-size: 14px;
}

/* ─── Responsive ─────────────────────────────────────── */

@media (max-width: 1024px) {
  #agent-panels {
    grid-template-columns: repeat(3, 1fr);
    height: auto;
    max-height: 40vh;
  }
}

@media (max-width: 768px) {
  #agent-panels {
    grid-template-columns: repeat(2, 1fr);
    height: auto;
    max-height: 50vh;
  }

  #activity-feed {
    min-height: 40vh;
  }
}

/* ─── Platform Metrics Window ────────────────────────── */

#win-metrics {
  width: 340px;
  right: 20px;
  top: 68px;
}

#win-metrics::before { --c: rgba(30, 187, 217, 0.28); }

.metrics-bar {
  border-bottom-color: rgba(30, 187, 217, 0.35);
}

.metrics-bar .float-win-title {
  color: #1EBBD9;
}

#metrics-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-dim);
  color: #1EBBD9;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 3px 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

#metrics-toggle-btn:hover {
  border-color: #1EBBD9;
  background: rgba(30, 187, 217, 0.08);
}

.mp-ts {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

#win-metrics .float-win-body {
  overflow-y: auto;
  padding: 0;
}

#win-metrics .float-win-body::-webkit-scrollbar       { width: 3px; }
#win-metrics .float-win-body::-webkit-scrollbar-track { background: transparent; }
#win-metrics .float-win-body::-webkit-scrollbar-thumb { background: var(--border-dim); border-radius: 2px; }

.mp-section {
  padding: 12px 14px;
}

.mp-divider {
  height: 1px;
  background: var(--border-dim);
  margin: 0 14px;
}

.mp-section-label {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #1EBBD9;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.mp-big-num {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  line-height: 1;
}

.mp-stat-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.mp-sub-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-secondary);
  margin-top: 4px;
  letter-spacing: 0.04em;
}

.mp-delta {
  font-size: 9px;
  font-family: var(--font-mono);
}
.mp-delta.up   { color: #1ED97A; }
.mp-delta.down { color: #D94040; }

.mp-funnel {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.mp-funnel-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mp-funnel-label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  width: 82px;
  flex-shrink: 0;
  white-space: nowrap;
}

.mp-funnel-track {
  flex: 1;
  height: 16px;
  background: var(--bg-void);
  border: 1px solid var(--border-dim);
  border-radius: 2px;
  overflow: hidden;
}

.mp-funnel-fill {
  height: 100%;
  border-radius: 1px;
  transition: width 0.5s ease;
}

.mp-funnel-num {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

.mp-health-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mp-health-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mp-health-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  line-height: 1;
}

.mp-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.mp-badge-ready    { background: rgba(30, 217, 122, 0.12); color: #1ED97A; }
.mp-badge-error    { background: rgba(217, 64, 64, 0.12);  color: #D94040; }
.mp-badge-building { background: rgba(217, 194, 30, 0.12); color: #D9C21E; }
.mp-badge-enqueued { background: rgba(30, 111, 217, 0.12); color: #1E6FD9; }

.mp-error-msg {
  font-family: var(--font-mono);
  font-size: 8px;
  color: #D94040;
  margin-top: 4px;
  letter-spacing: 0.04em;
}

/* ─── YouTube Section ────────────────────────────────── */

.mp-yt-videos {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.mp-yt-video {
  padding: 6px 8px;
  background: rgba(255,0,0,0.05);
  border-left: 2px solid #FF000055;
  border-radius: 0 3px 3px 0;
}

.mp-yt-title {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--text-primary);
  line-height: 1.3;
}

.mp-yt-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-secondary);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.mp-yt-sep { opacity: 0.4; }

/* ─────────────────────────────────────────────────────── */

.mp-loading {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  animation: pulse 1.5s ease-in-out infinite;
  padding: 8px 0;
}

.mp-not-configured {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  font-style: italic;
  padding: 4px 0;
}

.mp-fetch-error {
  padding: 8px 14px;
  background: rgba(217, 64, 64, 0.08);
  border-bottom: 1px solid rgba(217, 64, 64, 0.2);
  font-style: normal;
}

#metrics-refresh-btn.spinning {
  animation: spin 0.6s linear infinite;
  opacity: 0.6;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ─── Growth Goals Window ────────────────────────────── */

#win-goals {
  width: 320px;
  right: 380px;
  top: 68px;
}

#win-goals::before { --c: rgba(30, 217, 122, 0.25); }

.goals-bar {
  border-bottom-color: rgba(30, 217, 122, 0.3);
}

.goals-bar .float-win-title {
  color: #1ED97A;
}

#goals-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-dim);
  color: #1ED97A;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 3px 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

#goals-toggle-btn:hover {
  border-color: #1ED97A;
  background: rgba(30, 217, 122, 0.08);
}

#win-goals .float-win-body {
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

#win-goals .float-win-body::-webkit-scrollbar       { width: 3px; }
#win-goals .float-win-body::-webkit-scrollbar-track { background: transparent; }
#win-goals .float-win-body::-webkit-scrollbar-thumb { background: var(--border-dim); border-radius: 2px; }

.gp-goal {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 4px 0;
}

.gp-divider {
  height: 1px;
  background: var(--border-dim);
  margin: 10px 0;
}

.gp-goal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gp-goal-title {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-primary);
}

.gp-goal-status {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.gp-goal-desc {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.gp-bar-track {
  height: 18px;
  background: var(--bg-void);
  border: 1px solid var(--border-dim);
  border-radius: 2px;
  overflow: hidden;
}

.gp-bar-fill {
  height: 100%;
  border-radius: 1px;
  transition: width 0.6s ease;
  min-width: 2px;
}

.gp-bar-blocked {
  width: 100% !important;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 4px,
    rgba(58, 78, 102, 0.3) 4px,
    rgba(58, 78, 102, 0.3) 8px
  );
  border-right: none;
}

.gp-goal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gp-goal-nums {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.gp-sep {
  color: var(--text-dim);
  font-size: 9px;
  font-weight: 400;
}

.gp-pct {
  font-size: 9px;
  color: var(--text-dim);
  font-weight: 400;
  margin-left: 2px;
}

/* ─── Social Intelligence Panel ──────────────────────────────────────────────── */

.social-bar {
  background: linear-gradient(90deg, rgba(30,111,217,0.12) 0%, transparent 100%);
  border-bottom-color: rgba(30,111,217,0.3);
}

#win-social {
  width: 800px;
  max-height: calc(100vh - 80px);
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
}

#win-social.win-hidden {
  transform: translateX(-50%) scale(0.97) translateY(4px);
}

.sp-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  font-family: var(--font-mono);
  font-size: 11px;
}

.sp-section-label {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.sp-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sp-loading {
  color: var(--text-dim);
  font-size: 11px;
  padding: 8px 0;
}

.sp-dim {
  color: var(--text-dim);
}

/* Own channels grid */
.sp-own-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.sp-platform-block {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  padding: 12px;
}

.sp-platform-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.sp-platform-icon {
  font-size: 14px;
}

.sp-platform-name {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.sp-platform-status {
  font-size: 9px;
  margin-left: auto;
}

.sp-status-warn {
  color: var(--accent-warning);
}

.sp-mini-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

.sp-mini-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.sp-mini-label {
  font-size: 9px;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
}

/* Video list under YouTube */
.sp-video-list {
  margin-top: 10px;
  border-top: 1px solid var(--border-dim);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sp-video-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sp-video-title {
  font-size: 10px;
  color: var(--text-primary);
  line-height: 1.3;
}

.sp-video-meta {
  font-size: 9px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.sp-sep {
  color: var(--text-dim);
}

/* Stat cards */
.sp-stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  padding: 10px 12px;
}

.sp-stat-label {
  font-size: 9px;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.sp-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.sp-stat-sub {
  font-size: 9px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Competitor table */
.sp-comp-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.sp-comp-table th {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-align: left;
  padding: 0 8px 8px 0;
  border-bottom: 1px solid var(--border-dim);
}

.sp-comp-row td {
  padding: 8px 8px 8px 0;
  border-bottom: 1px solid rgba(26, 40, 64, 0.5);
  font-size: 11px;
  vertical-align: middle;
}

.sp-comp-own td {
  border-bottom: 2px solid var(--border-dim);
}

.sp-comp-name {
  color: var(--text-primary);
  font-weight: 600;
}

.sp-comp-name a {
  color: var(--text-primary);
  text-decoration: none;
}

.sp-comp-name a:hover {
  color: var(--accent-primary);
}

.sp-own-label {
  color: var(--accent-primary) !important;
}

.sp-comp-cell {
  color: var(--text-secondary);
}

.sp-comp-actions {
  text-align: right;
  width: 24px;
}

.sp-btn-icon {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 10px;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.15s;
}

.sp-btn-icon:hover {
  color: #E85050;
}

/* Add competitor form */
.sp-add-form {
  padding: 8px 0 16px;
}

.sp-add-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.sp-input {
  background: var(--bg-input);
  border: 1px solid var(--border-dim);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 5px 8px;
  flex: 1;
  min-width: 0;
  outline: none;
  transition: border-color 0.15s;
}

.sp-input:focus {
  border-color: var(--accent-primary);
}

.sp-input::placeholder {
  color: var(--text-dim);
}

.sp-input-sm {
  flex: 0.5;
}

.sp-btn-add {
  background: none;
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.sp-btn-add:hover {
  background: var(--accent-primary);
  color: var(--bg-void);
}

/* History sparklines */
#sp-history {
  margin-bottom: 16px;
}

.sp-history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.sp-history-label {
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.1em;
  min-width: 80px;
}

.sp-spark {
  display: block;
}

.sp-spark-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  margin-left: 4px;
}

/* AI Analysis output */
.sp-analysis-output {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  padding: 14px;
  margin-top: 8px;
  min-height: 80px;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-primary);
}

.sp-analysis-output h1,
.sp-analysis-output h2,
.sp-analysis-output h3 {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  margin: 14px 0 6px;
}

.sp-analysis-output h1:first-child,
.sp-analysis-output h2:first-child,
.sp-analysis-output h3:first-child {
  margin-top: 0;
}

.sp-analysis-output strong {
  color: var(--accent-warning);
}

.sp-analysis-output ul,
.sp-analysis-output ol {
  padding-left: 18px;
  margin: 6px 0;
}

.sp-analysis-output li {
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.sp-analysis-placeholder {
  color: var(--text-dim);
  font-style: italic;
  font-size: 11px;
}

/* Score banner */
.sp-score-banner {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 16px 0 12px;
  border-bottom: 1px solid var(--border-dim);
  margin-bottom: 16px;
}

.sp-score-num {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
}

.sp-score-denom {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.sp-score-label {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  margin-left: 8px;
  margin-bottom: 4px;
}

/* Sections */
.sp-analysis-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sp-analysis-section {
  background: rgba(12, 18, 32, 0.6);
  border: 1px solid var(--border-dim);
}

.sp-analysis-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-left: 3px solid;
  background: rgba(26, 40, 64, 0.3);
}

.sp-analysis-section-icon {
  font-size: 12px;
  width: 14px;
  flex-shrink: 0;
}

.sp-analysis-section-title {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-primary);
}

.sp-analysis-section-body {
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.sp-analysis-section-body p { margin: 0 0 6px; }
.sp-analysis-section-body p:last-child { margin-bottom: 0; }
.sp-analysis-section-body ul,
.sp-analysis-section-body ol { padding-left: 16px; margin: 4px 0; }
.sp-analysis-section-body li { margin-bottom: 3px; }
.sp-analysis-section-body strong { color: var(--text-primary); }

.sp-ig-connect {
  padding: 4px 0;
}

.sp-connect-link {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #E1306C;
  text-decoration: none;
  border-bottom: 1px solid rgba(225, 48, 108, 0.4);
  padding-bottom: 1px;
  transition: border-color 0.15s;
}

.sp-connect-link:hover {
  border-color: #E1306C;
}

.sp-analyze-btn-header {
  color: var(--accent-primary) !important;
  border-color: var(--accent-primary) !important;
}

.sp-analyze-btn-header:hover {
  background: rgba(30, 111, 217, 0.15) !important;
}

/* Social toggle button */
#social-toggle-btn {
  color: var(--accent-primary);
  border-color: rgba(30, 111, 217, 0.4);
}

#social-toggle-btn:hover {
  border-color: var(--accent-primary);
  background: rgba(30, 111, 217, 0.08);
}
