:root {
  --bg: #f6f5f1; --panel: #ffffff; --ink: #16181d; --muted: #646a75; --line: #e3e1da;
  --accent: #1f5eff; --agent: #eef2ff; --user: #16181d; --user-ink: #fff; --warn: #b54708; --ok: #067647;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115; --panel: #171a21; --ink: #eceef2; --muted: #9aa1ad; --line: #2a2f39;
    --accent: #6f95ff; --agent: #1c2333; --user: #eceef2; --user-ink: #0f1115; --warn: #f79009; --ok: #32d583;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
.call { max-width: 860px; margin: 0 auto; padding: 24px 16px 40px; }
header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h1 { margin: 4px 0 0; font-size: 26px; letter-spacing: -.01em; }
h1 span { color: var(--muted); font-weight: 500; }
.status { display: flex; align-items: center; gap: 10px; }
#state { font-weight: 600; font-size: 14px; padding: 5px 12px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); }
#state[data-s="listening"] { color: var(--ok); }
#state[data-s="thinking"] { color: var(--warn); }
#state[data-s="speaking"] { color: var(--accent); }
#meter { width: 90px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
#meter i { display: block; height: 100%; width: 0; background: var(--ok); transition: width 60ms linear; }
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.services div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.services span { color: var(--muted); font-size: 13px; }
.controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
#start { font: inherit; font-weight: 600; background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 12px 20px; cursor: pointer; }
#start:disabled { opacity: .6; }
#mode { font-size: 13px; color: var(--muted); }
#hint { margin: 0; color: var(--muted); font-size: 14px; width: 100%; }
#transcript { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; min-height: 300px; max-height: 58vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; flex-direction: column; max-width: 82%; }
.msg.agent { align-self: flex-start; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 9px 13px; border-radius: 14px; }
.agent .bubble { background: var(--agent); border-top-left-radius: 4px; }
.user .bubble { background: var(--user); color: var(--user-ink); border-top-right-radius: 4px; }
.meta { font-size: 12px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.meta b { color: var(--ink); }
.note { align-self: center; font-size: 12px; color: var(--muted); text-align: center; }
.note.barge { color: var(--warn); font-weight: 600; }
.note.err { color: #d92d20; }
#stats table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14px; font-variant-numeric: tabular-nums; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
#stats th, #stats td { text-align: left; padding: 7px 12px; border-bottom: 1px solid var(--line); }
#stats td + td, #stats th + th { text-align: right; white-space: nowrap; }
footer { margin-top: 18px; font-size: 14px; color: var(--muted); }
footer a { color: var(--accent); }
@media (max-width: 600px) { .services { grid-template-columns: 1fr; } .msg { max-width: 92%; } h1 { font-size: 22px; } }
