/* ===== OpsVoice — Dark Command Center Design System ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Core palette */
  --bg-deepest: #060a13;
  --bg-base: #0a0e17;
  --bg-surface: #111827;
  --bg-elevated: #1a2332;
  --bg-panel: rgba(17, 24, 39, 0.75);

  /* Accent — teal/cyan for SRE feel */
  --accent: #00d4aa;
  --accent-dim: rgba(0, 212, 170, 0.15);
  --accent-glow: rgba(0, 212, 170, 0.35);
  --accent-strong: #00ffcc;

  /* Status colors */
  --healthy: #22c55e;
  --degraded: #f59e0b;
  --critical: #ef4444;
  --unknown: #6b7280;

  /* Text — yellow theme */
  --text-primary: #ffd700;
  --text-secondary: #f5c518;
  --text-muted: #c8960c;
  --text-accent: var(--accent);

  /* Borders */
  --border: rgba(148, 163, 184, 0.1);
  --border-active: rgba(0, 212, 170, 0.3);

  /* Shadows & effects */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(0, 212, 170, 0.15);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Fonts */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 150ms var(--ease-out-expo);
  --transition-normal: 250ms var(--ease-out-expo);
  --transition-slow: 400ms var(--ease-out-expo);
}

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

/* ===== Base ===== */
html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-deepest);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(0, 212, 170, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, 0.03) 0%, transparent 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Utility ===== */
.mt-16 { margin-top: 16px; }

/* ===== App Layout ===== */
.app-layout {
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: 240px 1fr 280px;
  grid-template-areas:
    "header header header"
    "sidebar center right";
  min-height: 100vh;
  gap: 0;
}

@media (max-width: 1100px) {
  .app-layout {
    grid-template-columns: 200px 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "header header"
      "sidebar center"
      "right right";
  }
  .right-panel {
    border-left: none;
    border-top: 1px solid var(--border);
    flex-direction: row;
  }
  .right-panel-section { flex: 1; }
}

@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas:
      "header"
      "sidebar"
      "center"
      "right";
  }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
  }
  .sidebar-section { flex: 1; min-width: 0; }
  .sidebar-divider { display: none; }
  .right-panel {
    border-left: none;
    border-top: 1px solid var(--border);
    flex-direction: row;
  }
  .right-panel-section { flex: 1; }
}

/* ===== Header / Top Bar ===== */
.top-bar {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: linear-gradient(145deg, rgba(10, 14, 23, 0.95), rgba(17, 24, 39, 0.88));
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), inset 0 -1px 0 rgba(255, 255, 255, 0.02);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: var(--bg-deepest);
  flex-shrink: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-tag {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  line-height: 1;
}

.top-bar-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== Status Pills ===== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  transition: all var(--transition-fast);
  background: linear-gradient(145deg, rgba(100, 116, 139, 0.15), rgba(100, 116, 139, 0.05));
  border: 1px solid rgba(148, 163, 184, 0.08);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-primary);
}

.pill.is-connected {
  background: rgba(34, 197, 94, 0.12);
  color: var(--healthy);
}
.pill.is-connected::before {
  background: var(--healthy);
  box-shadow: 0 0 8px var(--healthy);
  animation: pulse-dot 2s ease-in-out infinite;
}

.pill.is-idle {
  background: rgba(239, 68, 68, 0.1);
  color: var(--critical);
}
.pill.is-idle::before {
  background: var(--critical);
}

.pill.is-mic-on {
  background: rgba(0, 212, 170, 0.12);
  color: var(--accent);
}
.pill.is-mic-on::before {
  background: var(--accent);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.pill.is-camera-on {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
}
.pill.is-camera-on::before {
  background: #60a5fa;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

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

/* ===== Sidebar — Service Health ===== */
.sidebar {
  grid-area: sidebar;
  padding: 10px 10px;
  border-right: 1px solid var(--border);
  background: rgba(10, 14, 23, 0.5);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-section {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.8), rgba(26, 35, 50, 0.5));
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.95), rgba(26, 35, 50, 0.8));
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  color: var(--accent);
}

.sidebar-section-header svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  margin: 0;
}

.sidebar-section-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-divider {
  height: 1px;
  margin: 8px 4px;
  background: linear-gradient(90deg, transparent, var(--border-active), transparent);
}

.service-card {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.9), rgba(26, 35, 50, 0.7));
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: var(--radius-sm);
  padding: 10px;
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
  cursor: default;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.service-card:hover {
  border-color: var(--border-active);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 212, 170, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.service-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.service-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}

.service-badge {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.service-badge.healthy {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.08));
  color: var(--healthy);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.1);
}
.service-badge.degraded {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.08));
  color: var(--degraded);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.1);
}
.service-badge.critical {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.08));
  color: var(--critical);
  animation: badge-pulse 2s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.15);
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.service-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.metric-label {
  font-size: 8px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.metric-value.warn { color: var(--degraded); }
.metric-value.danger { color: var(--critical); }
.metric-value.ok { color: var(--healthy); }

.service-summary {
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 6px;
}

/* ===== Center — Main Content ===== */
.center-content {
  grid-area: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 24px;
  overflow-y: auto;
  gap: 20px;
}

/* Landing nav: Architecture & Video slides */
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.85), rgba(26, 35, 50, 0.6));
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 400px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.landing-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  background: linear-gradient(145deg, rgba(26, 35, 50, 0.9), rgba(17, 24, 39, 0.7));
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: all var(--transition-normal);
}
.landing-nav-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3), 0 0 16px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.landing-nav-icon {
  font-size: 14px;
  line-height: 1;
}

/* ===== Agent State Bar ===== */
.agent-state-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.9), rgba(26, 35, 50, 0.65));
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius-full);
  backdrop-filter: blur(12px);
  transition: all var(--transition-normal);
  width: fit-content;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.agent-state-bar.active {
  border-color: var(--border-active);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 212, 170, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.state-icon {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, rgba(26, 35, 50, 0.9), rgba(17, 24, 39, 0.7));
  color: var(--text-primary);
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.state-icon.connected { color: var(--healthy); background: rgba(34, 197, 94, 0.1); }
.state-icon.listening { color: var(--accent); background: var(--accent-dim); animation: state-bounce 1.5s ease-in-out infinite; }
.state-icon.analyzing { color: var(--degraded); background: rgba(245, 158, 11, 0.1); animation: state-pulse 1.5s ease-in-out infinite; }
.state-icon.tool { color: #60a5fa; background: rgba(59, 130, 246, 0.1); animation: state-flash 0.8s ease-in-out infinite; }
.state-icon.speaking { color: #a78bfa; background: rgba(139, 92, 246, 0.1); animation: state-bounce 1s ease-in-out infinite; }

@keyframes state-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes state-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes state-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.state-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

.state-label.active {
  color: var(--accent);
}

.state-steps {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: 4px;
}

.state-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.state-step::before {
  content: '';
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  transition: background var(--transition-normal);
  display: block;
}

.state-step.done::before { background: var(--accent); }
.state-step.current::before { background: var(--accent); animation: step-glow 1s ease-in-out infinite alternate; }

.step-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  font-weight: 500;
}

.state-step.done .step-label { color: var(--accent); }
.state-step.current .step-label { color: var(--accent); }

@keyframes step-glow {
  from { box-shadow: 0 0 4px var(--accent-glow); }
  to { box-shadow: 0 0 12px var(--accent-glow); }
}

/* ===== Voice Orb ===== */
.orb-container {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin: 8px 0;
}

.orb {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #3b82f6, #8b5cf6);
  background-size: 300% 300%;
  animation: orb-gradient 8s ease-in-out infinite;
  transition: all var(--transition-slow);
  position: relative;
  z-index: 2;
}

.orb-container.idle .orb {
  width: 80px;
  height: 80px;
  opacity: 0.4;
  filter: grayscale(0.6);
}

.orb-container.connected .orb {
  opacity: 0.7;
  filter: none;
  box-shadow: 0 0 40px var(--accent-glow);
}

.orb-container.listening .orb {
  opacity: 1;
  filter: none;
  box-shadow: 0 0 60px var(--accent-glow);
  animation: orb-gradient 4s ease-in-out infinite, orb-pulse-listening 1.5s ease-in-out infinite;
}

.orb-container.speaking .orb {
  opacity: 1;
  filter: none;
  box-shadow: 0 0 50px rgba(139, 92, 246, 0.4);
  animation: orb-gradient 3s ease-in-out infinite, orb-pulse-speaking 0.8s ease-in-out infinite;
}

.orb-container.tool .orb {
  animation: orb-gradient 2s ease-in-out infinite;
  box-shadow: 0 0 50px rgba(59, 130, 246, 0.4);
}

@keyframes orb-gradient {
  0%, 100% { background-position: 0% 50%; }
  25% { background-position: 100% 0%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
}

@keyframes orb-pulse-listening {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes orb-pulse-speaking {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Orb rings */
.orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--accent-glow);
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.orb-container.listening .orb-ring,
.orb-container.speaking .orb-ring {
  opacity: 1;
}

.orb-ring:nth-child(2) {
  width: 120px; height: 120px;
  animation: ring-expand 3s ease-out infinite;
}
.orb-ring:nth-child(3) {
  width: 140px; height: 140px;
  animation: ring-expand 3s ease-out infinite 1s;
}
.orb-ring:nth-child(4) {
  width: 160px; height: 160px;
  animation: ring-expand 3s ease-out infinite 2s;
}

@keyframes ring-expand {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 0; }
}

.orb-label {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

/* ===== Waveform Canvas ===== */
.waveform-container {
  width: 100%;
  max-width: 480px;
  height: 40px;
  position: relative;
}

#waveform-canvas {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
}

/* ===== Controls Row ===== */
.controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

/* ===== Button System ===== */
.btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  cursor: pointer;
  background: linear-gradient(145deg, rgba(26, 35, 50, 0.9), rgba(17, 24, 39, 0.7));
  color: var(--text-primary);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.4;
  white-space: nowrap;
  vertical-align: middle;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.btn svg {
  flex-shrink: 0;
}

.btn:hover:not(:disabled) {
  border-color: var(--border-active);
  background: linear-gradient(145deg, rgba(26, 35, 50, 1), rgba(17, 24, 39, 0.85));
  transform: translateY(-1px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), 0 0 16px rgba(0, 212, 170, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-sm {
  font-size: 12px;
  padding: 6px 12px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  border-color: transparent;
  color: var(--bg-deepest);
  font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-outline {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.6), rgba(26, 35, 50, 0.3));
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.btn-outline:hover:not(:disabled) {
  background: linear-gradient(145deg, rgba(26, 35, 50, 0.9), rgba(17, 24, 39, 0.7));
  border-color: var(--border-active);
  color: var(--text-primary);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25), 0 0 12px rgba(0, 212, 170, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.btn-outline-danger {
  color: var(--critical);
  border-color: rgba(239, 68, 68, 0.2);
}

.btn-outline-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-primary);
  padding: 4px 10px;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: transparent;
  transform: none;
  box-shadow: none;
}

/* Mic button active state */
.btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-deepest);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn.active:hover:not(:disabled) {
  box-shadow: 0 0 30px var(--accent-glow);
}

/* ===== Action Card (groups controls / camera mode / text command) ===== */
.action-card {
  width: 100%;
  max-width: 560px;
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.88), rgba(26, 35, 50, 0.65));
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.action-card-section {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-card-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.action-card-divider {
  height: 1px;
  background: rgba(148, 163, 184, 0.08);
}

.camera-mode-panel {
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.camera-mode-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.camera-mode-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.camera-mode-btn {
  flex: 1 1 220px;
  cursor: pointer;
}

.camera-mode-btn.is-selected {
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.18), rgba(14, 165, 233, 0.14));
  border-color: rgba(0, 212, 170, 0.35);
  color: var(--text-primary);
  box-shadow: 0 0 18px rgba(0, 212, 170, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.camera-mode-help {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ===== Text Form ===== */
.text-form {
  width: 100%;
}

.text-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.input-row {
  display: flex;
  gap: 8px;
}

.input-row input {
  flex: 1;
  min-width: 0;
  padding: 8px 14px;
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.9), rgba(26, 35, 50, 0.6));
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  transition: all var(--transition-fast);
  outline: none;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.input-row input:focus {
  border-color: var(--border-active);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.2), 0 0 0 3px var(--accent-dim), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.input-row input::placeholder {
  color: var(--text-secondary);
}

/* ===== Panels (shared) ===== */
.panel {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.85), rgba(26, 35, 50, 0.6));
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  transition: all var(--transition-normal);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.panel:hover {
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.6), rgba(26, 35, 50, 0.3));
}

.panel-header h2 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin: 0;
}

/* ===== Transcript Panel ===== */
.transcript-section {
  width: 100%;
  max-width: 560px;
  flex: 1;
  min-height: 180px;
}

.transcript {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.transcript::-webkit-scrollbar {
  width: 4px;
}
.transcript::-webkit-scrollbar-track {
  background: transparent;
}
.transcript::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.transcript-entry {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.8), rgba(26, 35, 50, 0.5));
  border: 1px solid rgba(148, 163, 184, 0.08);
  animation: entry-appear 0.3s var(--ease-out-expo);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.transcript-entry.is-agent {
  border-left: 2px solid var(--accent);
  background: linear-gradient(145deg, rgba(0, 212, 170, 0.08), rgba(0, 212, 170, 0.02));
}

.transcript-entry.is-user {
  border-left: 2px solid #60a5fa;
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.02));
}

@keyframes entry-appear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.transcript-entry strong {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.transcript-entry.is-agent strong { color: var(--accent); }
.transcript-entry.is-user strong { color: #60a5fa; }

.transcript-entry span {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.transcript-entry span b {
  color: var(--text-primary);
  font-weight: 600;
}

.transcript-entry span em {
  color: var(--text-secondary);
  font-style: italic;
}

.transcript-entry span .inline-code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: rgba(0, 212, 170, 0.1);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0, 212, 170, 0.15);
}

/* ===== Tool Execution Cards ===== */
.tool-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-card {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.03));
  border: 1px solid rgba(59, 130, 246, 0.18);
  animation: entry-appear 0.3s var(--ease-out-expo);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(59, 130, 246, 0.05);
}

.tool-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.tool-card-icon {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #60a5fa;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 0 4px rgba(59, 130, 246, 0.08);
}

.tool-card-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
}

.tool-card-status {
  margin-left: auto;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.tool-card-status.running { color: var(--degraded); }
.tool-card-status.done { color: var(--healthy); }

.tool-card-result {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  color: var(--text-primary);
  padding: 8px;
  background: linear-gradient(145deg, rgba(6, 10, 19, 0.9), rgba(13, 17, 23, 0.8));
  border: 1px solid rgba(148, 163, 184, 0.06);
  border-radius: var(--radius-sm);
  max-height: 100px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* ===== Right Panel ===== */
.right-panel {
  grid-area: right;
  border-left: 1px solid var(--border);
  background: rgba(10, 14, 23, 0.5);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 10px 10px;
  gap: 10px;
}

.right-panel-section {
  padding: 0;
}

.right-panel-section:last-child {
  border-bottom: none;
}

.right-panel-section--grow {
  flex: 1;
  overflow-y: auto;
}

.right-section-panel {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.8), rgba(26, 35, 50, 0.5));
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.right-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.95), rgba(26, 35, 50, 0.8));
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  color: var(--accent);
}

.right-section-header svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.right-section-header .right-section-title {
  margin-bottom: 0;
}

.right-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.right-section-panel > video,
.right-section-panel > .drop-zone,
.right-section-panel > .tool-cards-list {
  margin: 10px;
}

.right-section-panel > video {
  width: calc(100% - 20px);
}

.right-section-panel > .drop-zone {
  margin-top: 0;
}

/* Camera & Video */
#camera-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: linear-gradient(145deg, rgba(6, 10, 19, 0.9), rgba(13, 17, 23, 0.7));
  border: 1px solid rgba(148, 163, 184, 0.1);
  display: block;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

/* Drop zone */
.drop-zone {
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  color: var(--text-primary);
  font-size: 11px;
  transition: all var(--transition-fast);
  cursor: pointer;
  margin-top: 8px;
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.5), rgba(26, 35, 50, 0.3));
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.15);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: linear-gradient(145deg, rgba(0, 212, 170, 0.12), rgba(0, 212, 170, 0.04));
  color: var(--accent);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.15), 0 0 12px rgba(0, 212, 170, 0.1);
}

.drop-zone-icon {
  margin-bottom: 4px;
  display: flex;
  justify-content: center;
  opacity: 0.6;
}

.drop-zone p {
  line-height: 1.4;
}

/* ===== Event Log (collapsible) ===== */
.event-log-section {
  width: 100%;
  max-width: 560px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.event-log-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.9), rgba(26, 35, 50, 0.7));
  border: none;
  border-radius: 0;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.event-log-toggle:hover {
  background: linear-gradient(145deg, rgba(26, 35, 50, 1), rgba(17, 24, 39, 0.85));
}

.event-log-toggle .arrow {
  transition: transform var(--transition-fast);
  color: var(--text-primary);
}

.event-log-toggle.open .arrow {
  transform: rotate(180deg);
}

.event-log {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: #a5f3ab;
  background: linear-gradient(145deg, rgba(6, 10, 19, 0.95), rgba(13, 17, 23, 0.85));
  padding: 12px 14px;
  max-height: 280px;
  overflow-y: auto;
  display: none;
  white-space: pre-wrap;
  word-break: break-all;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.event-log.visible {
  display: block;
  animation: entry-appear 0.2s var(--ease-out-expo);
}

.event-log::-webkit-scrollbar {
  width: 4px;
}
.event-log::-webkit-scrollbar-track {
  background: transparent;
}
.event-log::-webkit-scrollbar-thumb {
  background: rgba(165, 243, 171, 0.2);
  border-radius: 2px;
}

/* ===== Incident Cards ===== */
.incident-card {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.9), rgba(26, 35, 50, 0.7));
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 6px;
  transition: all var(--transition-fast);
  animation: entry-appear 0.3s var(--ease-out-expo);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.incident-card:hover {
  border-color: var(--border-active);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25), 0 0 16px rgba(0, 212, 170, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.incident-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.incident-severity {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.incident-severity.P1 { background: rgba(239, 68, 68, 0.2); color: var(--critical); }
.incident-severity.P2 { background: rgba(245, 158, 11, 0.2); color: var(--degraded); }
.incident-severity.P3 { background: rgba(107, 114, 128, 0.2); color: var(--text-muted); }

.incident-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incident-meta {
  font-size: 10px;
  color: var(--text-primary);
  display: flex;
  gap: 12px;
}

/* ===== Scrollbar global ===== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.25);
}

/* ===== Empty States ===== */
.empty-state {
  text-align: center;
  padding: 20px 12px;
  color: var(--text-primary);
  font-size: 11px;
}

.empty-state-icon {
  margin-bottom: 6px;
  display: flex;
  justify-content: center;
  opacity: 0.4;
  color: var(--text-primary);
}

.empty-state p {
  line-height: 1.4;
}

/* ===== Visually Hidden ===== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Proactive Alert Toasts ===== */
.alert-toast {
  position: fixed;
  top: 60px;
  right: 20px;
  width: 360px;
  max-width: calc(100vw - 40px);
  background: linear-gradient(145deg, rgba(26, 35, 50, 0.95), rgba(17, 24, 39, 0.85));
  border: 1px solid var(--critical);
  border-radius: var(--radius-lg);
  padding: 0;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.25), 0 0 60px rgba(239, 68, 68, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: alert-slide-in 0.4s var(--ease-out-expo);
  backdrop-filter: blur(20px);
  overflow: hidden;
}

.alert-toast.severity-P2 {
  border-color: var(--degraded);
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.25), 0 0 60px rgba(245, 158, 11, 0.1);
}

.alert-toast.dismissing {
  animation: alert-slide-out 0.3s var(--ease-out-expo) forwards;
}

@keyframes alert-slide-in {
  from { transform: translateX(100%) scale(0.95); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes alert-slide-out {
  from { transform: translateX(0) scale(1); opacity: 1; }
  to { transform: translateX(100%) scale(0.95); opacity: 0; }
}

.alert-toast-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.04));
  border-bottom: 1px solid rgba(239, 68, 68, 0.15);
}

.severity-P2 .alert-toast-header {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.04));
  border-bottom-color: rgba(245, 158, 11, 0.15);
}

.alert-toast-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  animation: badge-pulse 1.5s ease-in-out infinite;
}

.alert-toast-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.alert-toast-close {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color var(--transition-fast);
}

.alert-toast-close:hover {
  color: var(--text-primary);
}

.alert-toast-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alert-toast-service {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.alert-toast-summary {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-primary);
}

.alert-toast-metrics {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
}

.alert-toast-metrics b {
  color: var(--critical);
  font-weight: 600;
}

.severity-P2 .alert-toast-metrics b {
  color: var(--degraded);
}

/* Sidebar alert flash */
.sidebar.alert-flash {
  animation: sidebar-flash 0.6s ease-in-out 3;
}

@keyframes sidebar-flash {
  0%, 100% { background: rgba(10, 14, 23, 0.5); }
  50% { background: rgba(239, 68, 68, 0.08); }
}

/* System transcript entries */
.transcript-entry.is-system {
  border-left: 2px solid var(--critical);
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.02));
}

.transcript-entry.is-system strong {
  color: var(--critical);
}
