:root {
  color-scheme: dark;
  --bg: #05070b;
  --panel: rgba(8, 14, 22, 0.92);
  --panel2: rgba(6, 10, 18, 0.94);
  --text: rgba(232, 243, 255, 0.98);
  --muted: rgba(149, 167, 190, 0.82);
  --border: rgba(0, 238, 255, 0.22);
  --border2: rgba(255, 0, 176, 0.3);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  --accent: #00f0ff;
  --accent2: #ff2bd1;
  --ember: #a3ff12;
  --glassTop: rgba(255, 255, 255, 0.06);
  --glassBot: rgba(255, 255, 255, 0.02);
  --innerGlow: inset 0 0 0 1px rgba(0, 240, 255, 0.08);
  --focusGlow: 0 0 0 2px rgba(0, 240, 255, 0.28), 0 0 24px rgba(255, 43, 209, 0.18);
  --activeGlow: 0 0 0 2px rgba(255, 43, 209, 0.28), 0 0 26px rgba(0, 240, 255, 0.18);
  --scanline: linear-gradient(transparent 80%, rgba(0, 240, 255, 0.08) 80%);
}

html, body {
  font-family: 'Oxanium', 'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
}

body::before {
  background:
    radial-gradient(1100px 600px at 18% 10%, rgba(0, 240, 255, 0.18), transparent 70%),
    radial-gradient(900px 560px at 85% 16%, rgba(255, 43, 209, 0.16), transparent 70%),
    linear-gradient(120deg, #070a12f2, #090612f5, #05070bfa);
  opacity: 0.98;
}

body::after {
  background-image:
    linear-gradient(transparent 94%, rgba(0, 255, 242, 0.09) 94%),
    linear-gradient(90deg, transparent 94%, rgba(255, 43, 209, 0.08) 94%);
  background-size: 32px 32px, 32px 32px;
  opacity: 0.12;
  animation: gridDrift 18s linear infinite;
}

@keyframes gridDrift {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-8px, 10px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  body::after {
    animation: none;
  }
}

.app {
  max-width: 1360px;
  gap: 18px;
  padding: 24px;
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
}

.header {
  grid-column: 1 / -1;
  align-items: center;
}

.title .h1 {
  font-family: 'Oxanium', sans-serif;
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #e8f3ff, #00f0ff, #ff2bd1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

.title .sub {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(160, 190, 215, 0.8);
}

.status .pill {
  border-radius: 999px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  background: linear-gradient(180deg, rgba(0, 240, 255, 0.1), rgba(255, 43, 209, 0.04));
  color: rgba(228, 250, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.pillOn {
  border-color: rgba(255, 43, 209, 0.55);
  box-shadow: 0 0 18px rgba(255, 43, 209, 0.25);
}

.panel,
.chat {
  border-radius: 18px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.68), rgba(8, 14, 24, 0.98));
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 43, 209, 0.12);
  position: relative;
  overflow: hidden;
}

.panel {
  grid-column: 1 / 2;
  min-height: 560px;
}

.controlDeck {
  grid-column: 1 / 2;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.deckCard {
  min-height: auto;
}

.deckHeader {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px 6px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.12);
  text-transform: uppercase;
}

.deckTitle {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: rgba(0, 240, 255, 0.9);
}

.deckSub {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(160, 190, 215, 0.8);
}

.chat {
  grid-column: 2 / 3;
}

.panel::before,
.chat::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(140deg, rgba(0, 240, 255, 0.06), transparent 40%),
    linear-gradient(320deg, rgba(255, 43, 209, 0.06), transparent 40%);
  pointer-events: none;
}

.panel::after,
.chat::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(0, 240, 255, 0.12);
  border-radius: 14px;
  pointer-events: none;
}

.modelDeck {
  grid-column: 1 / -1;
  min-height: auto;
}

.modelDeck .panelRow {
  border: 0;
  background: transparent;
  padding: 10px 12px 12px;
}

.modelDeck .selectModel {
  min-width: 100%;
  width: 100%;
}

.modelDeck .btn {
  min-width: 120px;
}

.modelDeck .progress {
  min-width: 240px;
}

.label, .labelInline {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.select,
.inputSmall,
.input,
.textarea {
  border-radius: 12px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  background: rgba(3, 8, 16, 0.92);
  font-family: 'Sora', sans-serif;
}

.select:focus,
.inputSmall:focus,
.input:focus,
.textarea:focus {
  border-color: rgba(0, 240, 255, 0.6);
  box-shadow: var(--focusGlow);
}

.btn {
  border-radius: 12px;
  border: 1px solid rgba(255, 43, 209, 0.4);
  background: linear-gradient(120deg, rgba(0, 240, 255, 0.15), rgba(255, 43, 209, 0.15));
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.btn:hover {
  border-color: rgba(0, 240, 255, 0.6);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.15);
}

.btnGhost {
  background: rgba(255, 255, 255, 0.04);
}

.progressText,
.hint,
.voiceHint {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
}

.barFill {
  background: linear-gradient(90deg, #00f0ff, #ff2bd1);
}

.msg {
  border-radius: 16px;
  border: 1px solid rgba(0, 240, 255, 0.16);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.6), rgba(12, 16, 26, 0.85));
}

.msg-user {
  border-color: rgba(255, 43, 209, 0.4);
}

.msg-assistant {
  border-color: rgba(0, 240, 255, 0.4);
}

.autoLlmRow {
  border-top: 1px solid rgba(255, 43, 209, 0.18);
  padding-top: 10px;
}

.autoLlmLabel {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.voiceProgressLabel {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(169, 203, 232, 0.82);
}

.voicePanelRow {
  border-top: 1px solid rgba(0, 240, 255, 0.15);
  padding-top: 10px;
}

.voiceModeButton.isActive {
  background: linear-gradient(120deg, rgba(0, 240, 255, 0.25), rgba(255, 43, 209, 0.25));
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
}

.voiceMeterFill,
.voiceProgressFill {
  background: linear-gradient(90deg, #00f0ff, #a3ff12);
}

.chatBody,
.panel {
  background-image: var(--scanline);
  background-size: 100% 6px;
}

.panelRow {
  padding: 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.4), rgba(12, 18, 28, 0.2));
  border: 1px solid rgba(0, 240, 255, 0.12);
}

.panelRow + .panelRow {
  margin-top: 10px;
}

.chatActions,
.composer {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.7), rgba(14, 18, 28, 0.9));
  border-top: 1px solid rgba(0, 240, 255, 0.18);
}

.chatBody::-webkit-scrollbar {
  width: 8px;
}

.chatBody::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 240, 255, 0.4), rgba(255, 43, 209, 0.4));
  border-radius: 999px;
}

.chatBody::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.4);
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
  }

  .panel,
  .chat {
    grid-column: 1 / -1;
  }
}
