:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #14181d;
  --fg: #e6e8eb;
  --muted: #8a929c;
  --accent: #5eead4;
  --accent-dim: #134e4a;
  --danger: #f87171;
  --border: #1f262d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.app {
  width: min(640px, 92vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  display: grid;
  gap: 20px;
}

header h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.01em;
}
.sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--muted);
  transition: background 120ms, box-shadow 200ms;
}
.dot[data-status="listening"] { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.dot[data-status="thinking"]  { background: #fbbf24; box-shadow: 0 0 12px #fbbf24; }
.dot[data-status="speaking"]  { background: #60a5fa; box-shadow: 0 0 12px #60a5fa; }

.level-meter {
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.level-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 80ms linear;
}

.transcript {
  min-height: 220px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.transcript:empty::before {
  content: "Press \"Start call\" and ask a question.";
  color: var(--muted);
  font-size: 13px;
}
.msg {
  display: grid;
  gap: 2px;
  font-size: 14px;
  line-height: 1.45;
}
.msg .who {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.msg.user .who { color: var(--accent); }

.interim {
  margin: 0;
  min-height: 1em;
  font-style: italic;
  color: var(--muted);
  font-size: 13px;
}

.controls {
  display: flex;
  gap: 10px;
}
button {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
}
button:hover:not(:disabled) { border-color: var(--accent-dim); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary { background: var(--accent); color: #052e2b; border-color: var(--accent); font-weight: 600; }
button.primary.live { background: var(--danger); color: #1a0606; border-color: var(--danger); }

.error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}
