/* ==========================================================================
   J.A.R.V.I.S. v4.0 - Advanced Cybernetic AI Neural Interface
   Tactical Glassmorphism HUD & Command Center
   ========================================================================== */

:root {
  --bg-primary: #050b12;
  --bg-secondary: #0a131e;
  --bg-card: rgba(12, 22, 34, 0.82);
  --bg-card-hover: rgba(16, 29, 45, 0.9);
  --bg-input: rgba(9, 17, 26, 0.88);
  --bg-code: #070e17;
  
  --cyan-core: #00f2fe;
  --cyan-glow: rgba(0, 242, 254, 0.5);
  --cyan-subtle: rgba(0, 242, 254, 0.15);
  --cyan-border: rgba(0, 242, 254, 0.28);
  --cyan-border-active: rgba(0, 242, 254, 0.7);

  --blue-accent: #0099ff;
  --emerald-accent: #00ffaa;
  --amber-alert: #ffaa00;
  --red-critical: #ff3366;

  --text-main: #e2f4ff;
  --text-muted: #5e819d;
  --text-dim: #3a5369;
  --text-cyan: #64f4ff;

  --font-display: 'Orbitron', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Share Tech Mono', Consolas, monospace;
  --font-ui: 'Rajdhani', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --card-radius: 14px;
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.55);
  --neon-glow: 0 0 16px rgba(0, 242, 254, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  user-select: none;
}

/* Background Cyber Grid & Vignette */
.app-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  position: relative;
  background: 
    radial-gradient(circle at 50% 10%, rgba(0, 153, 255, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 15% 30%, rgba(0, 242, 254, 0.05) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(0, 255, 170, 0.03) 0%, transparent 50%),
    #050a11;
  overflow: hidden;
}

.cyber-grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(0, 242, 254, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 242, 254, 0.02) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
  z-index: 1;
}

.scanline {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(0, 242, 254, 0.25), transparent);
  opacity: 0.6;
  animation: scanlineAnim 8s linear infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes scanlineAnim {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

/* ==========================================================================
   Header Bar
   ========================================================================== */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  height: 58px;
  background: rgba(7, 14, 23, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--cyan-border);
  z-index: 10;
  position: relative;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.6);
}

.brand-title .version {
  font-size: 11px;
  font-weight: 500;
  color: var(--cyan-core);
  letter-spacing: 1px;
  background: rgba(0, 242, 254, 0.1);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--cyan-core);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan-core);
  box-shadow: 0 0 10px var(--cyan-core);
  animation: pulseCore 2s ease-in-out infinite;
}

@keyframes pulseCore {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.6; }
}

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

.telemetry-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(0, 242, 254, 0.04);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(0, 242, 254, 0.12);
}

.telemetry-pill span.val {
  color: var(--cyan-core);
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.system-stat-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 5px 8px;
  border-radius: 6px;
}

.system-stat-icon:hover {
  color: var(--cyan-core);
  background: rgba(0, 242, 254, 0.08);
}

.system-stat-icon.active {
  color: var(--cyan-core);
}

.clock-display {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--cyan-core);
  letter-spacing: 1.5px;
}

/* ==========================================================================
   Main Grid Layout (HUD Column + Interactive Console Column)
   ========================================================================== */
.main-layout {
  display: flex;
  flex: 1;
  padding: 16px;
  gap: 16px;
  overflow: hidden;
  position: relative;
  z-index: 5;
}

/* ==========================================================================
   Left HUD Column
   ========================================================================== */
.hud-column {
  width: 360px;
  min-width: 320px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding-right: 2px;
}

.hud-column::-webkit-scrollbar {
  width: 4px;
}
.hud-column::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.2);
  border-radius: 4px;
}

.hud-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--cyan-border);
  border-radius: var(--card-radius);
  padding: 14px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.hud-card:hover {
  border-color: var(--cyan-border-active);
  box-shadow: 0 0 24px rgba(0, 242, 254, 0.15), var(--card-shadow);
}

/* Corner futuristic accents */
.hud-card::before, .hud-card::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  pointer-events: none;
}
.hud-card::before {
  top: 0;
  left: 0;
  border-top: 2px solid var(--cyan-core);
  border-left: 2px solid var(--cyan-core);
}
.hud-card::after {
  bottom: 0;
  right: 0;
  border-bottom: 2px solid var(--cyan-core);
  border-right: 2px solid var(--cyan-core);
}

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

.card-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-title .tag {
  color: var(--cyan-core);
}

.header-dots {
  display: flex;
  gap: 4px;
}

.header-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 242, 254, 0.25);
}
.header-dots .dot.active {
  background: var(--cyan-core);
  box-shadow: 0 0 6px var(--cyan-core);
}

/* Card 1: HUD Arc Reactor & Audio Visualizer */
.reactor-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 8px 0;
}

.reactor-wrapper {
  position: relative;
  width: 170px;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reactor-canvas {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
  filter: drop-shadow(0 0 12px rgba(0, 242, 254, 0.45));
}

.reactor-status-overlay {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.reactor-hz {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan-core);
  text-shadow: 0 0 8px rgba(0, 242, 254, 0.8);
}

.reactor-state {
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* 4 Micro Gauges under Reactor */
.micro-gauges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 14px;
  width: 100%;
}

.micro-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(6, 12, 19, 0.6);
  padding: 6px 2px;
  border-radius: 8px;
  border: 1px solid rgba(0, 242, 254, 0.12);
  transition: all 0.2s ease;
}

.micro-gauge:hover {
  border-color: rgba(0, 242, 254, 0.35);
  background: rgba(10, 22, 34, 0.8);
}

.gauge-canvas {
  width: 48px;
  height: 48px;
}

.gauge-label {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
  letter-spacing: 0.5px;
}

.gauge-val {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan-core);
}

/* Card 2: System Diagnostics Waveform */
.diagnostics-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diagnostics-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 90px;
  border-radius: 8px;
  background: rgba(5, 10, 16, 0.8);
  border: 1px solid rgba(0, 242, 254, 0.12);
  overflow: hidden;
}

.diagnostics-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.diagnostics-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 4px;
}

.diagnostics-stats .alert-tag {
  color: var(--emerald-accent);
  display: flex;
  align-items: center;
  gap: 4px;
}

.diagnostics-stats .anomaly-count {
  color: var(--cyan-core);
  font-weight: 600;
}

/* Card 3: Satellite Intelligence 3D Radar Globe */
.satellite-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.satellite-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 140px;
  border-radius: 8px;
  background: radial-gradient(circle at 50% 50%, #0a1726 0%, #04080e 100%);
  border: 1px solid rgba(0, 242, 254, 0.15);
  overflow: hidden;
}

.satellite-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.satellite-hud-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(0, 242, 254, 0.7);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.satellite-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 4px;
}

.satellite-status-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--cyan-core);
}

.satellite-status-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   Right Panel: AI Console & Command Center
   ========================================================================== */
.console-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  background: rgba(9, 16, 26, 0.65);
  backdrop-filter: blur(18px);
  border: 1px solid var(--cyan-border);
  border-radius: var(--card-radius);
  padding: 16px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}

.console-column::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--cyan-core);
  border-right: 2px solid var(--cyan-core);
}

.console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 242, 254, 0.12);
}

.system-status-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(0, 242, 254, 0.05);
  border: 1px solid rgba(0, 242, 254, 0.15);
  padding: 3px 10px;
  border-radius: 6px;
}

.status-chip.active {
  color: var(--cyan-core);
  border-color: rgba(0, 242, 254, 0.4);
  background: rgba(0, 242, 254, 0.08);
}

.status-chip.running {
  animation: chipGlowPulse 1.1s ease-in-out infinite !important;
  color: #ffffff !important;
  border-color: var(--cyan-core) !important;
  background: rgba(0, 242, 254, 0.25) !important;
  text-shadow: 0 0 8px var(--cyan-core);
}

.status-chip.running-amber {
  animation: chipGlowPulseAmber 1.1s ease-in-out infinite !important;
  color: #ffffff !important;
  border-color: #ff9100 !important;
  background: rgba(255, 145, 0, 0.28) !important;
  text-shadow: 0 0 10px #ff9100;
}

@keyframes chipGlowPulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.5), inset 0 0 6px rgba(0, 242, 254, 0.3);
    transform: scale(1.02);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.95), inset 0 0 12px rgba(0, 242, 254, 0.5);
    transform: scale(1.06);
  }
}

@keyframes chipGlowPulseAmber {
  0%, 100% {
    box-shadow: 0 0 10px rgba(255, 145, 0, 0.6), inset 0 0 6px rgba(255, 145, 0, 0.3);
    transform: scale(1.02);
  }
  50% {
    box-shadow: 0 0 22px rgba(255, 145, 0, 1), inset 0 0 14px rgba(255, 145, 0, 0.6);
    transform: scale(1.06);
  }
}

.console-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: rgba(0, 242, 254, 0.06);
  border: 1px solid rgba(0, 242, 254, 0.2);
  color: var(--text-main);
  padding: 5px 9px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-ui);
  font-weight: 600;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(0, 242, 254, 0.18);
  border-color: var(--cyan-core);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

/* Chat Messages Feed */
.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 4px;
  min-height: 0;
}

.chat-messages-container::-webkit-scrollbar {
  width: 5px;
}
.chat-messages-container::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.25);
  border-radius: 4px;
}

/* User Message Card */
.message-bubble.user {
  align-self: flex-start;
  max-width: 85%;
  background: rgba(14, 25, 38, 0.9);
  border: 1px solid rgba(0, 242, 254, 0.35);
  border-radius: 12px;
  padding: 12px 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: fadeIn 0.3s ease;
}

.user-text {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.8px;
  color: #ffffff;
}

.user-tag {
  color: var(--cyan-core);
  font-weight: 700;
  margin-right: 6px;
}

/* JARVIS Response Card */
.message-bubble.jarvis {
  align-self: stretch;
  background: rgba(11, 20, 31, 0.85);
  border: 1px solid rgba(0, 242, 254, 0.22);
  border-left: 3px solid var(--cyan-core);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.3s ease;
}

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

.jarvis-lead {
  font-size: 15px;
  color: #e2f4ff;
  line-height: 1.6;
}

.jarvis-tag {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--cyan-core);
  margin-right: 6px;
  letter-spacing: 1px;
}

.inline-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--cyan-core);
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.4);
  padding: 1px 7px;
  border-radius: 4px;
  margin: 0 3px;
  box-shadow: 0 0 6px rgba(0, 242, 254, 0.2);
}

.inline-badge.memory {
  color: #38ef7d;
  background: rgba(56, 239, 125, 0.12);
  border-color: rgba(56, 239, 125, 0.4);
}

.inline-badge.os-action {
  color: #ff9100;
  background: rgba(255, 145, 0, 0.15);
  border-color: rgba(255, 145, 0, 0.5);
  box-shadow: 0 0 8px rgba(255, 145, 0, 0.3);
}

/* Live Telemetry Progress Stream Card */
.telemetry-stream-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: rgba(8, 16, 26, 0.75);
  border: 1px solid rgba(0, 242, 254, 0.28);
  border-left: 3px solid #ff9100;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  animation: fadeIn 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.telemetry-stream-card.completed {
  border-left-color: #38ef7d;
}

.telemetry-step {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.4;
  animation: slideInStep 0.2s ease-out;
}

.telemetry-step.initiating {
  color: #ffea00;
}
.telemetry-step.navigating {
  color: #00f2fe;
}
.telemetry-step.clicking {
  color: #ff9100;
}
.telemetry-step.completed {
  color: #38ef7d;
  font-weight: 600;
}

.step-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0, 242, 254, 0.3);
  border-top-color: var(--cyan-core);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 4px;
}

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

@keyframes slideInStep {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Client-Side Action Tab Banner */
.action-tab-banner {
  margin: 6px 0 10px 0;
  display: flex;
  align-items: center;
}

.action-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.45);
  color: #00f2fe;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.15);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-tab-btn:hover {
  background: rgba(0, 242, 254, 0.2);
  border-color: #ffffff;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.45);
  transform: translateY(-1px);
}

.tab-open-indicator {
  color: #38ef7d;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1px;
  background: rgba(56, 239, 125, 0.14);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(56, 239, 125, 0.4);
  flex-shrink: 0;
}

/* Code Snippet Box inside Jarvis Message */
.code-container {
  background: var(--bg-code);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(0, 242, 254, 0.05);
  border-bottom: 1px solid rgba(0, 242, 254, 0.1);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.code-header .code-lang {
  color: var(--cyan-core);
  font-weight: 600;
}

.code-actions {
  display: flex;
  gap: 8px;
}

.code-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.code-btn:hover {
  color: var(--cyan-core);
  background: rgba(0, 242, 254, 0.1);
}

.code-pre {
  margin: 0;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: #d6eaff;
  overflow-x: auto;
}

/* Syntax Highlighting */
.syn-kw { color: #00f2fe; font-weight: 600; }
.syn-fn { color: #50e3c2; }
.syn-str { color: #38ef7d; }
.syn-var { color: #9bc5ff; }
.syn-com { color: #4e6a82; font-style: italic; }

.sources-footer {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sources-footer .src-pill {
  color: var(--cyan-core);
  background: rgba(0, 242, 254, 0.06);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(0, 242, 254, 0.15);
  cursor: pointer;
  transition: background 0.2s ease;
}

.sources-footer .src-pill:hover {
  background: rgba(0, 242, 254, 0.15);
}

/* Mission Chips / Quick Commands */
.quick-chips-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 6px 0;
}

.quick-chips-bar::-webkit-scrollbar {
  height: 3px;
}
.quick-chips-bar::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.2);
}

.mission-chip {
  flex-shrink: 0;
  background: rgba(12, 24, 38, 0.7);
  border: 1px solid rgba(0, 242, 254, 0.2);
  color: #a5cce8;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mission-chip:hover {
  border-color: var(--cyan-core);
  color: #fff;
  background: rgba(0, 242, 254, 0.12);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
  transform: translateY(-1px);
}

/* ==========================================================================
   Bottom Command Input Bar
   ========================================================================== */
.command-input-wrapper {
  background: var(--bg-input);
  border: 1px solid var(--cyan-border);
  border-radius: 30px;
  padding: 6px 10px 6px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 242, 254, 0.08);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.command-input-wrapper:focus-within {
  border-color: var(--cyan-core);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.35), 0 4px 20px rgba(0, 0, 0, 0.5);
}

.command-input-box {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.command-input-box::placeholder {
  color: var(--text-muted);
}

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

.code-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  padding: 6px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.code-toggle-btn:hover {
  color: var(--cyan-core);
  background: rgba(0, 242, 254, 0.1);
}

/* ==========================================================================
   FUTURISTIC CYBERNETIC MICROPHONE (J.A.R.V.I.S. QUANTUM VOICE CORE)
   ========================================================================== */
.cyber-mic-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  outline: none;
  padding: 0;
  margin: 0 6px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: visible;
  flex-shrink: 0;
}

/* Outer Cybernetic Tech Ring */
.cyber-mic-ring {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px dashed rgba(0, 242, 254, 0.7);
  pointer-events: none;
  transition: all 0.3s ease;
  animation: cyberRingIdle 12s linear infinite;
}

@keyframes cyberRingIdle {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Inner Glowing Core Dome */
.cyber-mic-core {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #00f2fe 0%, #0077b6 55%, #051329 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 22px rgba(0, 242, 254, 0.7), inset 0 0 12px rgba(255, 255, 255, 0.5);
  border: 1.5px solid rgba(0, 242, 254, 0.9);
  transition: all 0.25s ease;
  position: relative;
  z-index: 2;
}

/* Cyber Mic Sub-Badge */
.cyber-mic-badge {
  position: absolute;
  bottom: -6px;
  background: rgba(5, 11, 18, 0.95);
  border: 1px solid #00f2fe;
  color: #00f2fe;
  font-family: var(--font-display, monospace);
  font-size: 8px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  box-shadow: 0 0 8px rgba(0, 242, 254, 0.5);
  pointer-events: none;
  z-index: 3;
  transition: all 0.25s ease;
}

.cyber-mic-btn.listening .cyber-mic-badge {
  border-color: #ff1744;
  color: #ffffff;
  background: #ff1744;
  box-shadow: 0 0 12px #ff1744;
}

.cyber-mic-btn svg {
  width: 22px;
  height: 22px;
  fill: #050b12;
  stroke: #050b12;
  stroke-width: 0.5px;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.6));
  transition: all 0.25s ease;
}

/* Hover State - High Energy Charge */
.cyber-mic-btn:hover {
  transform: scale(1.1);
}

.cyber-mic-btn:hover .cyber-mic-ring {
  border-color: #00f2fe;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.5);
  animation-duration: 6s;
}

.cyber-mic-btn:hover .cyber-mic-core {
  background: radial-gradient(circle at 35% 30%, #38ef7d 0%, #00f2fe 55%, #0052d4 100%);
  box-shadow: 0 0 26px rgba(0, 242, 254, 0.9), inset 0 0 14px rgba(255, 255, 255, 0.7);
}

.cyber-mic-btn:active {
  transform: scale(0.95);
}

/* --------------------------------------------------------------------------
   ACTIVE / RECORDING STATE (Pulsing Laser-Red Arc Reactor)
   -------------------------------------------------------------------------- */
.cyber-mic-btn.listening,
.mic-btn.listening {
  transform: scale(1.08);
}

.cyber-mic-btn.listening .cyber-mic-ring,
.mic-btn.listening .cyber-mic-ring {
  border: 2px dashed rgba(255, 23, 68, 0.95);
  box-shadow: 0 0 25px rgba(255, 23, 68, 0.8);
  animation: cyberRingActive 2s linear infinite;
}

@keyframes cyberRingActive {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.cyber-mic-btn.listening .cyber-mic-core,
.mic-btn.listening .cyber-mic-core {
  background: radial-gradient(circle at 35% 30%, #ff5252 0%, #ff1744 55%, #880e4f 100%) !important;
  border-color: #ff5252 !important;
  box-shadow: 0 0 35px rgba(255, 23, 68, 1), 0 0 70px rgba(255, 23, 68, 0.7), inset 0 0 18px rgba(255, 255, 255, 0.8) !important;
  animation: coreLaserPulse 1.1s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

.cyber-mic-btn.listening svg,
.mic-btn.listening svg {
  fill: #ffffff !important;
  stroke: #ffffff !important;
  filter: drop-shadow(0 0 8px #ffffff) drop-shadow(0 0 14px rgba(255, 23, 68, 0.9)) !important;
}

/* Expanding Radar Shockwaves */
.cyber-mic-btn.listening::before,
.cyber-mic-btn.listening::after,
.mic-btn.listening::before,
.mic-btn.listening::after {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 23, 68, 0.8);
  animation: sonicShockwave 1.6s infinite ease-out;
  pointer-events: none;
  z-index: 1;
}

.cyber-mic-btn.listening::after,
.mic-btn.listening::after {
  animation-delay: 0.8s;
}

@keyframes sonicShockwave {
  0% { transform: scale(0.85); opacity: 0.95; }
  100% { transform: scale(1.95); opacity: 0; }
}

@keyframes coreLaserPulse {
  0% { transform: scale(1); box-shadow: 0 0 25px rgba(255, 23, 68, 0.85), inset 0 0 12px rgba(255, 255, 255, 0.6); }
  50% { transform: scale(1.12); box-shadow: 0 0 45px rgba(255, 23, 68, 1), 0 0 85px rgba(255, 23, 68, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.95); }
  100% { transform: scale(1); box-shadow: 0 0 25px rgba(255, 23, 68, 0.85), inset 0 0 12px rgba(255, 255, 255, 0.6); }
}

/* --------------------------------------------------------------------------
   PROCESSING STATE (Golden Solar Plasma Orbit)
   -------------------------------------------------------------------------- */
.cyber-mic-btn.processing .cyber-mic-ring,
.mic-btn.processing .cyber-mic-ring {
  border: 2px dotted #ffb300;
  animation: cyberRingActive 1s linear infinite;
  box-shadow: 0 0 20px rgba(255, 179, 0, 0.8);
}

.cyber-mic-btn.processing .cyber-mic-core,
.mic-btn.processing .cyber-mic-core {
  background: radial-gradient(circle at 35% 30%, #fff176 0%, #ffb300 60%, #e65100 100%) !important;
  border-color: #ffd54f !important;
  box-shadow: 0 0 35px rgba(255, 179, 0, 0.95), 0 0 65px rgba(255, 179, 0, 0.5) !important;
}

.cyber-mic-btn.processing svg,
.mic-btn.processing svg {
  fill: #050b12 !important;
  stroke: #050b12 !important;
}

/* Input Wrapper Reactive Halo */
.command-input-wrapper.listening {
  border-color: rgba(255, 23, 68, 0.95) !important;
  box-shadow: 0 0 35px rgba(255, 23, 68, 0.5), 0 4px 20px rgba(0, 0, 0, 0.8) !important;
}

.command-input-wrapper.processing {
  border-color: rgba(255, 179, 0, 0.9) !important;
  box-shadow: 0 0 30px rgba(255, 179, 0, 0.4), 0 4px 20px rgba(0, 0, 0, 0.8) !important;
}

/* --------------------------------------------------------------------------
   DYNAMIC HOLOGRAPHIC VOICE HUD PILL & FREQUENCY EQUALIZER
   -------------------------------------------------------------------------- */
.live-rec-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(18, 4, 10, 0.92);
  border: 1px solid rgba(255, 23, 68, 0.7);
  box-shadow: 0 0 18px rgba(255, 23, 68, 0.4), inset 0 0 10px rgba(255, 23, 68, 0.15);
  border-radius: 18px;
  padding: 5px 14px;
  margin-right: 8px;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
  animation: hudPillPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes hudPillPop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.live-rec-pill .rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff1744;
  box-shadow: 0 0 10px #ff1744, 0 0 18px #ff1744;
  animation: recDotBlink 0.8s infinite ease-in-out;
}

@keyframes recDotBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.2; transform: scale(0.65); }
}

.live-rec-pill .rec-status-tag {
  font-family: var(--font-display, monospace);
  font-size: 11px;
  font-weight: 700;
  color: #ff5252;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.live-rec-pill .rec-timer {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  background: rgba(255, 23, 68, 0.25);
  border-radius: 6px;
  padding: 1px 6px;
  letter-spacing: 0.5px;
}

/* 7 Dynamic Voice Equalizer Bars */
.rec-equalizer {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 16px;
}

.rec-equalizer .eq-bar {
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, #ff8a80 0%, #ff1744 100%);
  border-radius: 2px;
  transform-origin: bottom;
  box-shadow: 0 0 6px rgba(255, 23, 68, 0.8);
  animation: eqBarBounce 0.9s infinite ease-in-out;
}

.rec-equalizer .eq-bar:nth-child(1) { animation-delay: 0.1s; height: 35%; }
.rec-equalizer .eq-bar:nth-child(2) { animation-delay: 0.35s; height: 65%; }
.rec-equalizer .eq-bar:nth-child(3) { animation-delay: 0.15s; height: 90%; }
.rec-equalizer .eq-bar:nth-child(4) { animation-delay: 0.5s; height: 100%; }
.rec-equalizer .eq-bar:nth-child(5) { animation-delay: 0.25s; height: 80%; }
.rec-equalizer .eq-bar:nth-child(6) { animation-delay: 0.4s; height: 55%; }
.rec-equalizer .eq-bar:nth-child(7) { animation-delay: 0.2s; height: 40%; }

@keyframes eqBarBounce {
  0%, 100% { transform: scaleY(0.25); }
  50% { transform: scaleY(1); }
}

/* --------------------------------------------------------------------------
   CYBER VOICE TOAST ALERT
   -------------------------------------------------------------------------- */
.cyber-voice-toast {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid #00f2fe;
  box-shadow: 0 0 24px rgba(0, 242, 254, 0.4), 0 8px 30px rgba(0, 0, 0, 0.7);
  border-radius: 12px;
  padding: 8px 18px;
  color: #f8fafc;
  font-family: var(--font-display, sans-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(12px);
  animation: toastSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.cyber-voice-toast.warning {
  border-color: #ff1744;
  box-shadow: 0 0 25px rgba(255, 23, 68, 0.5);
  color: #ffcdd2;
}

@keyframes toastSlideUp {
  0% { opacity: 0; transform: translate(-50%, 12px); }
  100% { opacity: 1; transform: translate(-50%, 0); }
}

.send-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.send-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.send-btn:hover {
  color: var(--cyan-core);
  filter: drop-shadow(0 0 8px var(--cyan-core));
  transform: translateX(2px);
}

/* ==========================================================================
   Terminal Runner Drawer / Modal
   ========================================================================== */
.terminal-modal {
  position: absolute;
  top: 60px;
  right: 20px;
  bottom: 90px;
  width: 480px;
  background: rgba(5, 10, 16, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--cyan-core);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 242, 254, 0.25);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transform: translateX(110%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.terminal-modal.open {
  transform: translateX(0);
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0, 242, 254, 0.08);
  border-bottom: 1px solid rgba(0, 242, 254, 0.2);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--cyan-core);
}

.terminal-body {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #79c0ff;
  line-height: 1.6;
}

.terminal-body .term-line {
  margin-bottom: 4px;
  word-break: break-all;
}

.term-line.info { color: #58a6ff; }
.term-line.success { color: #38ef7d; }
.term-line.alert { color: #ffab40; font-weight: 600; }
.term-line.error { color: #ff5252; font-weight: 600; }

.term-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--cyan-core);
  vertical-align: middle;
  animation: blinkCursor 0.8s infinite;
}

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

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
  .hud-column {
    width: 300px;
  }
}

@media (max-width: 768px) {
  .main-layout {
    flex-direction: column;
    overflow-y: auto;
  }
  .hud-column {
    width: 100%;
    max-width: none;
  }
  .terminal-modal {
    width: calc(100% - 40px);
  }
}

/* ==========================================================================
   Cyber Markdown Body Styling (Headings, Code, Tables, Lists)
   ========================================================================== */
.jarvis-lead {
  font-size: 14.5px;
  color: #dceaf8;
  line-height: 1.7;
}

.jarvis-lead .markdown-body {
  margin-top: 6px;
  word-break: break-word;
}

.jarvis-lead .markdown-body p {
  margin-bottom: 12px;
  line-height: 1.7;
}

.jarvis-lead .markdown-body p:last-child {
  margin-bottom: 0;
}

.jarvis-lead .markdown-body h1,
.jarvis-lead .markdown-body h2,
.jarvis-lead .markdown-body h3,
.jarvis-lead .markdown-body h4 {
  font-family: var(--font-display);
  color: var(--cyan-core);
  margin-top: 18px;
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

.jarvis-lead .markdown-body h1 { 
  font-size: 19px; 
  border-bottom: 1px solid rgba(0, 242, 254, 0.25); 
  padding-bottom: 4px; 
}
.jarvis-lead .markdown-body h2 { font-size: 17px; }
.jarvis-lead .markdown-body h3 { font-size: 15px; }

.jarvis-lead .markdown-body strong {
  color: #00f2fe;
  font-weight: 700;
}

.jarvis-lead .markdown-body em {
  color: #88c6ed;
  font-style: italic;
}

.jarvis-lead .markdown-body ul,
.jarvis-lead .markdown-body ol {
  padding-left: 22px;
  margin-bottom: 14px;
}

.jarvis-lead .markdown-body li {
  margin-bottom: 6px;
  line-height: 1.6;
}

.jarvis-lead .markdown-body ul li {
  list-style-type: square;
}

.jarvis-lead .markdown-body ul li::marker {
  color: var(--cyan-core);
}

.jarvis-lead .markdown-body ol li::marker {
  color: var(--cyan-core);
  font-weight: 700;
}

.jarvis-lead .markdown-body hr,
.cyber-hr {
  border: none;
  border-top: 1px solid rgba(0, 242, 254, 0.2);
  margin: 16px 0;
}

.jarvis-lead .markdown-body blockquote {
  border-left: 3px solid var(--cyan-core);
  padding: 6px 14px;
  margin: 12px 0;
  background: rgba(0, 242, 254, 0.05);
  border-radius: 0 8px 8px 0;
  color: #a0c4de;
}

.jarvis-lead .markdown-body code:not(pre code) {
  font-family: var(--font-mono);
  background: rgba(0, 242, 254, 0.09);
  color: #38ef7d;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  border: 1px solid rgba(0, 242, 254, 0.2);
}

/* Cyber Table Styling */
.jarvis-lead .markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 13.5px;
  background: rgba(6, 14, 22, 0.7);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0, 242, 254, 0.25);
}

.jarvis-lead .markdown-body th {
  background: rgba(0, 242, 254, 0.15);
  color: var(--cyan-core);
  font-family: var(--font-display);
  font-weight: 700;
  padding: 8px 12px;
  text-align: left;
  border: 1px solid rgba(0, 242, 254, 0.2);
  letter-spacing: 0.5px;
}

.jarvis-lead .markdown-body td {
  padding: 8px 12px;
  border: 1px solid rgba(0, 242, 254, 0.15);
  color: #d8ecf8;
}

.jarvis-lead .markdown-body tr:nth-child(even) {
  background: rgba(0, 242, 254, 0.03);
}

.jarvis-lead .markdown-body tr:hover {
  background: rgba(0, 242, 254, 0.08);
}

/* Markdown Code Blocks */
.markdown-code-container {
  margin: 14px 0 !important;
}

.markdown-body pre {
  margin: 0 !important;
}

