:root {
  --bg-deep: #051224;
  --bg-mid: #0a223d;
  --panel: rgba(11, 40, 72, 0.55);
  --panel-strong: rgba(8, 33, 62, 0.8);
  --line: rgba(111, 225, 255, 0.28);
  --text-main: #d8f6ff;
  --text-muted: #95d7ea;
  --accent: #39d6ff;
  --accent-strong: #0ea5e9;
  --ok: #67e8f9;
  --warn: #facc15;
  --critical: #fb7185;
}

html {
  scrollbar-gutter: stable;
}

body {
  background: radial-gradient(circle at 12% 8%, rgba(25, 118, 210, 0.25) 0, transparent 30%),
              radial-gradient(circle at 82% 18%, rgba(56, 189, 248, 0.2) 0, transparent 24%),
              linear-gradient(140deg, var(--bg-deep), var(--bg-mid));
  background-color: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
}

.jarvis-grid {
  background-image:
    linear-gradient(to bottom, rgba(147, 233, 255, 0.055), rgba(147, 233, 255, 0) 45%),
    linear-gradient(rgba(83, 186, 232, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 186, 232, 0.06) 1px, transparent 1px),
    repeating-linear-gradient(0deg, rgba(120, 220, 248, 0.035) 0, rgba(120, 220, 248, 0.035) 1px, transparent 1px, transparent 4px);
  background-size: 100% 100%, 26px 26px, 26px 26px, 100% 100%;
}

.glass-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: inset 0 1px 0 rgba(210, 249, 255, 0.12), 0 10px 30px rgba(4, 10, 22, 0.35);
  backdrop-filter: blur(16px);
}

.glass-card-strong {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: inset 0 1px 0 rgba(210, 249, 255, 0.12), 0 12px 34px rgba(4, 10, 22, 0.45);
  backdrop-filter: blur(16px);
}

.btn-primary {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.95), rgba(6, 182, 212, 0.95));
  border: 1px solid rgba(125, 229, 255, 0.55);
  color: #e7fbff;
  box-shadow: 0 0 0 1px rgba(132, 228, 255, 0.2) inset, 0 8px 20px rgba(8, 145, 178, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-secondary {
  background: rgba(9, 37, 66, 0.8);
  border: 1px solid rgba(129, 225, 255, 0.35);
  color: #d8f6ff;
}

.input-glass {
  background: rgba(9, 31, 56, 0.72);
  border: 1px solid rgba(118, 214, 244, 0.32);
  color: var(--text-main);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.input-glass::placeholder {
  color: rgba(149, 215, 234, 0.75);
}

.input-glass:focus {
  border-color: rgba(110, 233, 255, 0.75);
  box-shadow: 0 0 0 1px rgba(110, 233, 255, 0.4), 0 0 18px rgba(6, 182, 212, 0.35);
}

.pulse-on-load {
  animation: pulseGlow 2s ease-out;
}

[x-cloak] {
  display: none !important;
}

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

.chat-segment {
  border-radius: 0.35rem;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-segment-active {
  background: rgba(34, 211, 238, 0.22);
  box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.35) inset;
}

.voice-waveform {
  align-items: end;
  background: rgba(4, 25, 45, 0.7);
  border: 1px solid rgba(120, 220, 248, 0.3);
  border-radius: 0.5rem;
  display: inline-flex;
  gap: 0.2rem;
  height: 2.1rem;
  padding: 0.35rem 0.45rem;
}

.voice-waveform__bar {
  animation: waveformIdle 1.6s ease-in-out infinite;
  background: rgba(140, 230, 255, 0.45);
  border-radius: 9999px;
  display: block;
  height: 0.55rem;
  width: 0.2rem;
}

.voice-waveform--playing .voice-waveform__bar {
  animation: waveformPlaying 0.8s ease-in-out infinite;
  background: rgba(110, 233, 255, 0.95);
}

.voice-waveform--error .voice-waveform__bar {
  animation: none;
  background: rgba(251, 113, 133, 0.75);
  height: 0.4rem;
}

.voice-waveform__bar:nth-child(2) { animation-delay: 0.08s; }
.voice-waveform__bar:nth-child(3) { animation-delay: 0.16s; }
.voice-waveform__bar:nth-child(4) { animation-delay: 0.24s; }
.voice-waveform__bar:nth-child(5) { animation-delay: 0.32s; }
.voice-waveform__bar:nth-child(6) { animation-delay: 0.4s; }

@keyframes waveformIdle {
  0%, 100% { height: 0.45rem; opacity: 0.5; }
  50% { height: 0.8rem; opacity: 0.75; }
}

@keyframes waveformPlaying {
  0%, 100% { height: 0.5rem; }
  25% { height: 1.5rem; }
  50% { height: 0.95rem; }
  75% { height: 1.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  .voice-waveform__bar {
    animation: none;
    height: 0.7rem;
  }
}
