:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --fg: #e9ecef;
  --muted: #8a94a3;
  --accent: #5eead4;
  --danger: #f87171;
  --card: #151a20;
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); }
main { max-width: 34rem; margin: 0 auto; min-height: 100dvh; padding: max(1rem, env(safe-area-inset-top)) 1.25rem max(1rem, env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
section { flex: 1; display: flex; flex-direction: column; gap: 1rem; }
#auth { justify-content: center; text-align: center; }
h1 { font-size: 2.25rem; margin: 0; letter-spacing: -0.02em; }
.sub { color: var(--muted); margin: 0 0 1rem; }
header { display: flex; justify-content: space-between; align-items: center; }
.pill { padding: 0.35rem 0.8rem; border-radius: 999px; background: var(--card); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.pill[data-state='LISTENING'] { color: var(--accent); }
.pill[data-state='SPEAKING'] { color: #a5b4fc; }
.pill[data-state='THINKING'] { color: #fcd34d; }
.orb { width: 7.5rem; height: 7.5rem; margin: 1rem auto; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #99f6e4, #0f766e 70%); box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.35); transition: transform 0.3s ease, filter 0.3s ease; }
body[data-state='LISTENING'] .orb { animation: breathe 2.4s ease-in-out infinite; }
body[data-state='SPEAKING'] .orb { animation: talk 0.6s ease-in-out infinite alternate; filter: hue-rotate(60deg); }
body[data-state='THINKING'] .orb { animation: breathe 1s ease-in-out infinite; filter: hue-rotate(-40deg); }
@keyframes breathe { 50% { box-shadow: 0 0 0 1.2rem rgba(94, 234, 212, 0); transform: scale(1.03); } }
@keyframes talk { to { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .orb { animation: none !important; } }
#transcript { list-style: none; margin: 0; padding: 0; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem; max-height: 45dvh; }
#transcript li { padding: 0.6rem 0.85rem; border-radius: 1rem; max-width: 85%; line-height: 1.4; background: var(--card); }
#transcript li.user { align-self: flex-end; background: #1e3a36; }
#transcript li.cut { opacity: 0.55; }
#transcript li:empty { display: none; }
.latency { color: var(--muted); font-size: 0.8rem; min-height: 1.2em; text-align: center; font-variant-numeric: tabular-nums; }
footer { display: flex; gap: 0.75rem; justify-content: center; align-items: center; }
button { font: inherit; border: 0; border-radius: 999px; padding: 0.8rem 1.3rem; background: var(--card); color: var(--fg); cursor: pointer; min-height: 44px; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: 0.4; cursor: default; }
button.primary { background: var(--accent); color: #042f2e; font-weight: 600; }
button.danger { background: var(--danger); color: #3b0a0a; font-weight: 600; }
button.big { padding: 1rem 2rem; font-size: 1.1rem; }
button.ghost { background: transparent; color: var(--muted); padding: 0.4rem 0.6rem; }
#enroll-row { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1.5rem; text-align: left; }
#enroll-row[hidden] { display: none; }
input { font: inherit; padding: 0.75rem 1rem; border-radius: 0.75rem; border: 1px solid #2a323c; background: var(--card); color: var(--fg); }
#auth-msg { color: var(--danger); min-height: 1.2em; }
.pair { color: var(--muted); font-size: 0.9rem; }
.pair summary { cursor: pointer; }
#pair-code { font-family: ui-monospace, monospace; font-size: 1.1rem; color: var(--fg); }
[hidden] { display: none !important; }
