/* ==========================================================================
   Tambak7 AI - Jarvis Neural Engine Core Styling (Next-Gen Sci-Fi HUD)
   Theme: Holographic Arc Reactor & Cyberpunk Neural Core
   Device Support: iOS, Android, iPad, Mac, Windows (Fully Responsive)
   ========================================================================== */

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

:root {
  --bg-space: #02060e;
  --bg-deep: #040a17;
  --bg-panel: rgba(6, 16, 32, 0.82);
  --bg-panel-hover: rgba(10, 24, 48, 0.92);
  --bg-pill: rgba(4, 18, 36, 0.88);

  --cyan-core: #00f0ff;
  --cyan-bright: #38bdf8;
  --cyan-glow: rgba(0, 240, 255, 0.65);
  --cyan-glow-subtle: rgba(0, 240, 255, 0.16);
  --cyan-dim: #0284c7;
  --cyan-border: rgba(0, 240, 255, 0.42);

  --amber-accent: #ffb703;
  --amber-glow: rgba(255, 183, 3, 0.75);
  --amber-dim: rgba(255, 183, 3, 0.25);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-cyan: #38bdf8;
  --text-amber: #fde047;

  --border-hud: rgba(0, 240, 255, 0.22);
  --border-hud-solid: rgba(0, 240, 255, 0.55);

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-hud: 'Orbitron', 'Rajdhani', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-neon: 0 0 25px rgba(0, 240, 255, 0.5), 0 0 50px rgba(0, 240, 255, 0.25);
  --shadow-neon-amber: 0 0 25px rgba(255, 183, 3, 0.6), 0 0 50px rgba(255, 183, 3, 0.3);
  --radius-hud: 14px;
  --radius-pill: 9999px;
  --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset & Mobile Safe-Area Handling */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  background-color: var(--bg-space);
  color: var(--text-main);
  font-family: var(--font-main);
  overflow-x: hidden;
  overflow-y: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

/* Cyber Matrix Background & Vignette */
.cyber-background {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: 
    radial-gradient(circle at 50% 50%, rgba(0, 240, 255, 0.09) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 50%, rgba(4, 15, 30, 0.7) 0%, #02060e 95%),
    linear-gradient(rgba(0, 240, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, clamp(24px, 4vw, 40px) clamp(24px, 4vw, 40px), clamp(24px, 4vw, 40px) clamp(24px, 4vw, 40px);
}

.cyber-grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(2, 6, 14, 0.95) 100%);
}

/* Main App Viewport */
.jarvis-viewport {
  position: relative;
  z-index: 10;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(12px, 2.5vh, 24px) clamp(14px, 3vw, 32px);
  padding-top: max(clamp(12px, 2.5vh, 24px), env(safe-area-inset-top));
  padding-bottom: max(clamp(12px, 2.5vh, 24px), env(safe-area-inset-bottom));
  box-sizing: border-box;
}

/* Sci-Fi Reticle Corner Brackets (Exact match to reference) */
.reticle-corner {
  position: absolute;
  width: clamp(16px, 3vw, 26px);
  height: clamp(16px, 3vw, 26px);
  border-color: var(--amber-accent);
  border-style: solid;
  pointer-events: none;
  z-index: 20;
  filter: drop-shadow(0 0 6px var(--amber-glow));
  opacity: 0.85;
}

.reticle-tl { top: max(14px, env(safe-area-inset-top)); left: 14px; border-width: 2px 0 0 2px; }
.reticle-tr { top: max(14px, env(safe-area-inset-top)); right: 14px; border-width: 2px 2px 0 0; }
.reticle-bl { bottom: max(14px, env(safe-area-inset-bottom)); left: 14px; border-width: 0 0 2px 2px; }
.reticle-br { bottom: max(14px, env(safe-area-inset-bottom)); right: 14px; border-width: 0 2px 2px 0; }

/* Top HUD Header */
.hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 30;
  background: var(--bg-panel);
  border: 1px solid var(--border-hud);
  border-radius: var(--radius-hud);
  padding: 8px 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 0 12px var(--cyan-glow-subtle);
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

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

.brand-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--cyan-core);
  border-radius: 50%;
  color: var(--cyan-core);
  font-size: 14px;
  box-shadow: 0 0 12px var(--cyan-glow);
  position: relative;
  flex-shrink: 0;
}

.brand-icon::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 1px dashed var(--amber-accent);
  border-radius: 50%;
  animation: spinSlow 12s linear infinite;
}

.brand-title {
  font-family: var(--font-hud);
  font-size: clamp(13px, 2vw, 16px);
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #ffffff;
  text-shadow: 0 0 10px var(--cyan-glow);
  white-space: nowrap;
}

.brand-subtitle {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

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

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid var(--border-hud);
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  color: var(--text-cyan);
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.status-badge:hover {
  background: rgba(0, 240, 255, 0.16);
  border-color: var(--cyan-core);
}

.status-badge.online-badge {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.status-badge.online-badge:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
}

.status-badge.visitor-badge {
  background: rgba(0, 240, 255, 0.08);
  border-color: var(--border-hud);
  color: #bae6fd;
}

.status-badge.country-badge {
  background: rgba(255, 183, 3, 0.08);
  border-color: rgba(255, 183, 3, 0.35);
  color: #fef08a;
}

.status-badge.country-badge:hover {
  background: rgba(255, 183, 3, 0.18);
  border-color: var(--amber-accent);
}

.flag-icon-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.hud-flag-img {
  width: 17px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
  display: inline-block;
  vertical-align: middle;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan-core);
  box-shadow: 0 0 8px var(--cyan-core);
  animation: pulseDot 2s infinite ease-in-out;
  flex-shrink: 0;
}

.status-dot.amber {
  background: var(--amber-accent);
  box-shadow: 0 0 8px var(--amber-accent);
}

.status-dot.green {
  background: #10b981;
  box-shadow: 0 0 8px #10b981, 0 0 14px rgba(16, 185, 129, 0.6);
  animation: pulseDotGreen 1.8s infinite ease-in-out;
}

@keyframes pulseDotGreen {
  0%, 100% {
    opacity: 0.5;
    transform: scale(0.85);
    box-shadow: 0 0 6px #10b981;
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
    box-shadow: 0 0 12px #10b981, 0 0 18px rgba(16, 185, 129, 0.8);
  }
}

.hud-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-btn-icon {
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid var(--border-hud);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 14px;
}

.hud-btn-icon:hover, .hud-btn-icon.active {
  background: rgba(0, 240, 255, 0.22);
  border-color: var(--cyan-core);
  color: var(--cyan-core);
  box-shadow: 0 0 10px var(--cyan-glow);
}

/* ==========================================================================
   Central Holographic Stage & Multi-Layer Concentric Rings
   ========================================================================== */
.neural-stage-container {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(88vw, 88vh, 640px);
  height: min(88vw, 88vh, 640px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  pointer-events: none;
}

/* Hologram Concentric Rings (Exact match with reference image) */
.hologram-rings-wrapper {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Outer Sweeping Golden/Amber Arc Segment */
.ring-segment-amber {
  position: absolute;
  width: 96%;
  height: 96%;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--amber-accent);
  border-left-color: var(--amber-accent);
  filter: drop-shadow(0 0 10px var(--amber-glow));
  animation: rotateClockwise 35s linear infinite;
  opacity: 0.9;
}

/* Outer Fine Cyan Dashed Orbital Circle */
.ring-outer-dashed {
  position: absolute;
  width: 88%;
  height: 88%;
  border-radius: 50%;
  border: 1.2px dashed rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
  animation: rotateCounterClockwise 50s linear infinite;
}

.ring-outer-ticks {
  position: absolute;
  width: 82%;
  height: 82%;
  border-radius: 50%;
  border: 1px solid rgba(0, 240, 255, 0.22);
}

/* Middle Vivid Cyan Orbital Ring */
.ring-mid-glow {
  position: absolute;
  width: 70%;
  height: 70%;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 240, 255, 0.55);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.25), inset 0 0 16px rgba(0, 240, 255, 0.12);
}

.ring-mid-dashed {
  position: absolute;
  width: 64%;
  height: 64%;
  border-radius: 50%;
  border: 1.5px dashed rgba(0, 240, 255, 0.7);
  animation: rotateClockwise 25s linear infinite;
}

/* Inner Core Glowing Reactor Ring */
.ring-core-contain {
  position: absolute;
  width: 44%;
  height: 44%;
  border-radius: 50%;
  border: 2px solid rgba(0, 240, 255, 0.95);
  box-shadow: 0 0 32px var(--cyan-glow), inset 0 0 24px rgba(0, 240, 255, 0.4);
}

/* Dynamic Amber Arc Segment Markers on Core */
.ring-core-amber-top {
  position: absolute;
  width: 44%;
  height: 44%;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--amber-accent);
  border-right-color: var(--amber-accent);
  filter: drop-shadow(0 0 10px var(--amber-glow));
  animation: rotateClockwise 18s linear infinite;
}

.ring-core-amber-bottom {
  position: absolute;
  width: 44%;
  height: 44%;
  border-radius: 50%;
  border: 3px solid transparent;
  border-bottom-color: var(--amber-accent);
  filter: drop-shadow(0 0 10px var(--amber-glow));
  animation: rotateCounterClockwise 22s linear infinite;
}

/* 3D Neural Particle Canvas */
#neuralCanvas {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}

#neuralCanvas:active {
  cursor: grabbing;
}

/* Waveform Dots Pill (Exact match with reference image) */
.hud-wave-dots {
  position: absolute;
  bottom: 23%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: clamp(4px, 1vw, 6px);
  background: rgba(3, 12, 26, 0.85);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hud);
  backdrop-filter: blur(10px);
  z-index: 25;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.wave-dot {
  width: clamp(5px, 1.2vw, 7px);
  height: clamp(5px, 1.2vw, 7px);
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.wave-dot.active {
  background: var(--cyan-core);
  box-shadow: 0 0 10px var(--cyan-core);
  animation: bounceDot 0.8s infinite alternate ease-in-out;
}

.wave-dot:nth-child(2).active { animation-delay: 0.1s; }
.wave-dot:nth-child(3).active { animation-delay: 0.2s; }
.wave-dot:nth-child(4).active { animation-delay: 0.3s; }
.wave-dot:nth-child(5).active { animation-delay: 0.4s; }
.wave-dot:nth-child(6).active { animation-delay: 0.5s; }
.wave-dot:nth-child(7).active { animation-delay: 0.6s; }

/* ==========================================================================
   Bottom Action & Interaction Hub
   ========================================================================== */
.hud-interaction-hub {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 35;
  width: 100%;
  max-width: min(92vw, 720px);
  margin: 0 auto;
}

/* Prompt Status Pill (Subtitle readout container) */
.hud-status-pill {
  width: 100%;
  background: var(--bg-pill);
  border: 1.5px solid var(--cyan-border);
  border-radius: var(--radius-hud);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 18px var(--cyan-glow-subtle);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  transition: var(--transition-smooth);
  max-height: 120px;
  overflow-y: auto;
}

.hud-status-pill:hover {
  border-color: var(--cyan-core);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), 0 0 28px var(--cyan-glow);
  transform: translateY(-2px);
}

.pill-icon {
  font-size: 16px;
  color: var(--cyan-core);
  flex-shrink: 0;
}

.pill-prefix {
  font-family: var(--font-hud);
  font-size: clamp(12px, 1.8vw, 13.5px);
  font-weight: 700;
  color: var(--cyan-core);
  letter-spacing: 1px;
  flex-shrink: 0;
}

.pill-text {
  font-size: clamp(12.5px, 1.8vw, 14px);
  line-height: 1.5;
  color: #e2e8f0;
  text-align: left;
  flex: 1;
}

/* Primary Voice Button (Exact match: "Bicara ke Tambak7 AI") */
.btn-primary-voice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #0d1e34 0%, #193556 50%, #11223e 100%);
  border: 2px solid var(--cyan-core);
  border-radius: var(--radius-pill);
  padding: clamp(14px, 2vh, 18px) clamp(28px, 6vw, 48px);
  color: #ffffff;
  font-family: var(--font-hud);
  font-size: clamp(13.5px, 2vw, 16px);
  font-weight: 700;
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow: var(--shadow-neon), inset 0 0 15px rgba(0, 240, 255, 0.25);
  transition: var(--transition-smooth);
  outline: none;
  min-height: 48px;
}

.btn-primary-voice:hover {
  background: linear-gradient(135deg, #193556 0%, #0369a1 50%, #193556 100%);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.8), 0 0 65px rgba(0, 240, 255, 0.4);
  transform: scale(1.02);
}

.btn-primary-voice:active {
  transform: scale(0.98);
}

.btn-primary-voice.listening {
  background: linear-gradient(135deg, #78350f 0%, #b45309 50%, #92400e 100%);
  border-color: var(--amber-accent);
  box-shadow: var(--shadow-neon-amber);
  animation: pulseButtonAmber 1.2s infinite ease-in-out;
}

.btn-primary-voice.speaking {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 50%, #0369a1 100%);
  border-color: var(--cyan-core);
  box-shadow: 0 0 35px var(--cyan-glow), 0 0 60px rgba(0, 240, 255, 0.4);
  animation: pulseButtonCyan 1.2s infinite ease-in-out;
}

.btn-primary-voice.processing {
  border-color: #38bdf8;
  animation: pulseButtonCyan 1.5s infinite ease-in-out;
}

.voice-icon {
  font-size: 18px;
}

/* Quick Input Keyboard Drawer */
.quick-input-container {
  width: 100%;
  display: none;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-panel);
  border: 1.5px solid var(--cyan-border);
  border-radius: var(--radius-hud);
  padding: 10px 14px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), 0 0 20px var(--cyan-glow-subtle);
  animation: slideUp 0.3s ease;
}

.quick-input-container.visible {
  display: flex;
}

.input-box-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.text-prompt-input {
  flex: 1;
  background: rgba(3, 7, 18, 0.8);
  border: 1px solid var(--border-hud);
  border-radius: 8px;
  padding: 10px 14px;
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 13.5px;
  outline: none;
  transition: var(--transition-smooth);
  min-height: 44px;
}

.text-prompt-input:focus {
  border-color: var(--cyan-core);
  box-shadow: 0 0 12px var(--cyan-glow-subtle);
}

.btn-send-prompt {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid var(--cyan-core);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 8px;
  font-family: var(--font-hud);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--transition-smooth);
  min-height: 44px;
  white-space: nowrap;
}

.btn-send-prompt:hover {
  box-shadow: 0 0 15px var(--cyan-glow);
}

/* Suggestion Chips */
.suggestion-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.chip-btn {
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid var(--border-hud);
  color: var(--text-cyan);
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.chip-btn:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--cyan-core);
  color: #ffffff;
}

/* ==========================================================================
   History Drawer & Modals
   ========================================================================== */
.history-drawer {
  position: fixed;
  top: 0;
  right: -440px;
  width: 380px;
  max-width: 90vw;
  height: 100vh;
  height: 100dvh;
  z-index: 60;
  background: rgba(4, 10, 22, 0.96);
  border-left: 1.5px solid var(--cyan-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8), 0 0 20px var(--cyan-glow-subtle);
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.history-drawer.open {
  right: 0;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-hud);
}

.history-title {
  font-family: var(--font-hud);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #ffffff;
}

.history-search {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-hud);
}

.history-search-input {
  width: 100%;
  background: rgba(3, 7, 18, 0.8);
  border: 1px solid var(--border-hud);
  border-radius: 8px;
  padding: 8px 12px;
  color: #ffffff;
  font-size: 13px;
  outline: none;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  background: rgba(0, 240, 255, 0.04);
  border: 1px solid var(--border-hud);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.history-item:hover {
  background: rgba(0, 240, 255, 0.14);
  border-color: var(--cyan-core);
}

.history-item-title {
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.history-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-hud);
  display: flex;
  justify-content: space-between;
}

/* Telemetry & Stats Modal */
.telemetry-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(2, 6, 14, 0.85);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.telemetry-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.telemetry-card {
  width: 100%;
  max-width: 540px;
  background: var(--bg-panel);
  border: 1.5px solid var(--cyan-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.8), 0 0 30px var(--cyan-glow-subtle);
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.stat-box {
  background: rgba(0, 240, 255, 0.04);
  border: 1px solid var(--border-hud);
  border-radius: 8px;
  padding: 12px;
  position: relative;
  transition: var(--transition-smooth);
}

.stat-box:hover {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.4);
}

.stat-box.highlight-box {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.06) 0%, rgba(16, 185, 129, 0.05) 100%);
  border-color: rgba(0, 240, 255, 0.28);
}

.stat-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
  letter-spacing: 0.8px;
}

.stat-value {
  font-size: 16px;
  font-family: var(--font-hud);
  font-weight: 700;
  color: var(--cyan-core);
}

.stat-sub {
  font-size: 9.5px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: 3px;
}

.stat-time-pill {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: auto;
}

/* ==========================================================================
   Custom Sci-Fi HUD Confirmation Dialog & Toasts
   ========================================================= */
.hud-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 6, 14, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.hud-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.hud-dialog-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-panel);
  border: 1.5px solid var(--amber-accent);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.9), 0 0 35px var(--amber-glow);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.hud-modal-overlay.active .hud-dialog-card {
  transform: translateY(0) scale(1);
}

.hud-dialog-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 183, 3, 0.3);
}

.hud-dialog-icon {
  font-size: 18px;
  color: var(--amber-accent);
}

.hud-dialog-title {
  font-family: var(--font-hud);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #ffffff;
}

.hud-dialog-body {
  font-size: 13.5px;
  line-height: 1.5;
  color: #e2e8f0;
  margin-bottom: 20px;
}

.hud-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.hud-btn-cancel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-hud);
  color: #cbd5e1;
  font-family: var(--font-hud);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.hud-btn-danger {
  background: linear-gradient(135deg, #991b1b 0%, #dc2626 100%);
  border: 1px solid #f87171;
  color: #ffffff;
  font-family: var(--font-hud);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(220, 38, 38, 0.4);
  transition: var(--transition-smooth);
}

/* Toast Container */
.hud-toast-container {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(90vw, 360px);
}

.hud-toast {
  pointer-events: auto;
  width: 100%;
  background: var(--bg-panel);
  border: 1.5px solid var(--cyan-border);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 18px var(--cyan-glow-subtle);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 12.5px;
  color: #ffffff;
  animation: slideInRight 0.3s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.hud-toast.warning {
  border-color: var(--amber-accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 18px var(--amber-glow);
}

.hud-toast.danger {
  border-color: #f87171;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 18px rgba(248, 113, 113, 0.4);
}

.toast-icon {
  font-size: 15px;
  color: var(--cyan-core);
}

.hud-toast.warning .toast-icon { color: var(--amber-accent); }
.hud-toast.danger .toast-icon { color: #f87171; }

.toast-message {
  flex: 1;
  line-height: 1.4;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

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

@keyframes pulseDot {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes bounceDot {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

@keyframes pulseButtonAmber {
  0%, 100% { box-shadow: 0 0 15px var(--amber-glow); }
  50% { box-shadow: 0 0 35px var(--amber-glow), 0 0 60px rgba(255, 183, 3, 0.4); }
}

@keyframes pulseButtonCyan {
  0%, 100% { box-shadow: 0 0 15px var(--cyan-glow); }
  50% { box-shadow: 0 0 35px var(--cyan-glow), 0 0 65px rgba(0, 240, 255, 0.45); }
}

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(25px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   Multi-Device Responsive Breakpoints (Mobile, Tablet, Desktop)
   ========================================================================== */
@media (max-width: 900px) {
  .status-badge.country-badge,
  .status-badge#latencyBadge {
    display: none;
  }
}

@media (max-width: 600px) {
  .jarvis-viewport {
    padding: 10px 12px;
  }
  .hud-header {
    padding: 6px 10px;
    gap: 8px;
  }
  .brand-subtitle,
  .status-badge.visitor-badge,
  .status-badge.country-badge,
  .status-badge#latencyBadge {
    display: none;
  }
  .status-badge {
    padding: 3px 7px;
    font-size: 10px;
  }
  .neural-stage-container {
    top: 45%;
    width: min(84vw, 84vw, 360px);
    height: min(84vw, 84vw, 360px);
  }
  .hud-status-pill {
    padding: 10px 14px;
    gap: 8px;
  }
  .btn-primary-voice {
    width: 100%;
    padding: 14px 20px;
  }
  .telemetry-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .status-badge.clock-badge {
    display: none;
  }
}

@media (min-width: 601px) and (max-width: 1024px) {
  .neural-stage-container {
    width: min(82vw, 82vh, 520px);
    height: min(82vw, 82vh, 520px);
  }
}
