:root {
  --bg: #0f1115;
  --fg: #e6e8eb;
  --muted: #7a808a;
  --accent: #4caf50;
  --accent-dim: #2a5a2d;
  --danger: #e53935;
  --warn: #f9a825;
  --border: #1d2129;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100dvh; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  display: grid;
  place-items: center;
  padding: 24px;
}
main { width: 100%; max-width: 520px; display: grid; gap: 24px; }
header h1 { margin: 0 0 8px; font-size: 24px; }
header .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
header select {
  background: #0a0c10; color: var(--fg); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 14px;
}
.muted { color: var(--muted); font-size: 13px; }
#status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 13px; width: fit-content;
}
#status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
#status.connected .dot { background: var(--accent); }
#status.listening .dot { background: var(--warn); }
#status.speaking .dot { background: var(--accent); animation: pulse 1s infinite; }
#status.error .dot { background: var(--danger); }
@keyframes pulse { 0%,100% {opacity:1} 50% {opacity:.4} }
button#ptt {
  padding: 32px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--accent-dim); color: var(--fg); cursor: pointer;
  font: inherit; font-size: 18px; text-align: center;
  display: grid; gap: 6px; transition: background .15s, transform .05s;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
button#ptt:disabled { opacity: .5; cursor: not-allowed; }
button#ptt.active { background: var(--accent); transform: scale(.98); }
#transcript {
  min-height: 120px; max-height: 300px; overflow: auto;
  background: #0a0c10; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; display: grid; gap: 8px; font-size: 14px; line-height: 1.4;
}
#transcript .u, #transcript .m { padding: 8px 12px; border-radius: 10px; max-width: 92%; }
#transcript .u { justify-self: end; background: #1d3a1f; }
#transcript .m { justify-self: start; background: #1a1f28; }
#transcript .past { opacity: 0.55; }
#transcript .hdr { color: var(--muted); font-size: 11px; text-align: center; padding: 4px 0; }
footer { font-size: 12px; display: flex; gap: 16px; }
details { font-size: 12px; }
details summary { color: var(--muted); cursor: pointer; padding: 4px 0; }
pre#log {
  max-height: 240px; overflow: auto;
  background: #0a0c10; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px; margin: 0; font-size: 11px; color: #c5c9d0;
}
