:root {
  --bg: #0f1417;
  --bg-elev: #172026;
  --panel: #1d2a31;
  --text: #eef3f1;
  --muted: #9cb0a9;
  --accent: #ff9e3d;
  --accent-2: #f26c2a;
  --ok: #39c06b;
  --warn: #ff6b4a;
  --neutral: #768d98;
  --line: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  background: radial-gradient(circle at 15% 12%, #23333b 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  filter: blur(60px);
  opacity: 0.28;
  z-index: -1;
}

.bg-glow-1 {
  width: 360px;
  height: 360px;
  background: #ff9e3d;
  top: -120px;
  left: -100px;
}

.bg-glow-2 {
  width: 300px;
  height: 300px;
  background: #f26c2a;
  right: -80px;
  bottom: -100px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(255, 158, 61, 0.13), rgba(18, 27, 33, 0));
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  margin: 0;
  letter-spacing: 0.01em;
}

h1 {
  font-size: 1.5rem;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.controls {
  display: flex;
  gap: 12px;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

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

.btn:not(:disabled):hover {
  transform: translateY(-1px);
}

.btn-start {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #111;
}

.btn-stop {
  background: #2b363d;
  color: var(--text);
}

.dashboard {
  padding: 24px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

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

.status-chip {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-idle {
  background: rgba(118, 141, 152, 0.2);
  color: #b7c8cf;
}

.status-live {
  background: rgba(57, 192, 107, 0.2);
  color: #7de5a0;
}

.status-error {
  background: rgba(255, 107, 74, 0.2);
  color: #ffb1a0;
}

.transcript-feed {
  min-height: 62vh;
  max-height: 72vh;
  overflow-y: auto;
  padding-right: 4px;
}

.placeholder {
  color: var(--muted);
  margin: 0;
}

.transcript-line {
  border-left: 3px solid rgba(255, 158, 61, 0.7);
  padding: 10px 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  animation: line-in 0.35s ease;
}

.line-time {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 5px;
}

.insights-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.insight-card,
.alert-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.metric {
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 600;
}

.reply-card .reply-text {
  margin: 8px 0 0;
  font-size: 1.08rem;
  line-height: 1.4;
  font-weight: 700;
  color: #fff0dc;
}

.guidance-card .guidance-text {
  margin: 8px 0 0;
  font-size: 0.98rem;
  line-height: 1.4;
  font-weight: 600;
  color: #d9e6df;
}

.alert-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.badge {
  margin-top: 8px;
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.badge.neutral {
  color: #d0dee2;
  background: rgba(118, 141, 152, 0.22);
}

.badge.ok {
  color: #cff8dd;
  background: rgba(57, 192, 107, 0.22);
}

.badge.warn {
  color: #ffd6cd;
  background: rgba(255, 107, 74, 0.25);
}

.meter {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  margin-top: 8px;
  overflow: hidden;
}

.meter-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--ok), var(--accent));
  transition: width 0.3s ease;
}

.meter-note {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.reveal {
  opacity: 0;
  animation: reveal 0.6s ease forwards;
}

.dashboard.reveal {
  animation-delay: 0.08s;
}

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

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

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

  .transcript-feed {
    min-height: 42vh;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}
