:root {
  color-scheme: dark;
  --bg: #070a16;
  --panel: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.1);
  --text: #eef1ff;
  --muted: #98a0c0;
  --accent: #5b7cff;
  --accent-2: #22d3ee;
  --ok: #34d399;
  --err: #f87171;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(900px 520px at 18% -10%, rgba(91, 124, 255, 0.35), transparent 65%),
    radial-gradient(700px 460px at 92% 8%, rgba(34, 211, 238, 0.18), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  display: grid;
  place-items: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}

.shell {
  width: 100%;
  max-width: 520px;
  display: grid;
  gap: 20px;
}

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

.mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #05070f;
}

.titles h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.02em;
}

.titles p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.pill {
  margin-left: auto;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
}

.pill[data-state="live"] { color: var(--ok); border-color: rgba(52, 211, 153, 0.45); }
.pill[data-state="error"] { color: var(--err); border-color: rgba(248, 113, 113, 0.45); }

.stage {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 26px 18px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  backdrop-filter: blur(12px);
}

.orb {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 24px;
  color: #05070f;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 0 rgba(91, 124, 255, 0.5);
  transition: transform 0.25s ease;
}

.orb[data-state="live"] {
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(91, 124, 255, 0.45); }
  70% { box-shadow: 0 0 0 26px rgba(91, 124, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(91, 124, 255, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .orb[data-state="live"] { animation: none; }
}

.mic, .connect {
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 12px 22px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.mic:disabled, .connect:disabled { opacity: 0.45; cursor: not-allowed; }

.connect {
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #05070f;
  font-weight: 700;
  border: 0;
  padding: 13px 30px;
}

.hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.log {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  padding: 16px 18px;
}

.log h2 {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

#transcript {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
}

#transcript li {
  display: grid;
  gap: 2px;
  font-size: 14px;
  line-height: 1.45;
}

#transcript li b { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
#transcript li.me span { color: #cfd6ff; }
#transcript li.agent span { color: #9ff3e6; }

.foot {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}
