:root {
  --bg: #f4f6f8; --card: #ffffff; --text: #16202a; --muted: #5b6875; --border: #dbe1e7;
  --accent: #1f6feb; --accent-text: #ffffff; --danger: #c62828; --user-bg: #e8f0fe; --agent-bg: #f1f3f5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419; --card: #1a2129; --text: #e6ebf0; --muted: #9aa7b4; --border: #2c3640;
    --accent: #5b9dff; --accent-text: #0b1220; --danger: #ff8a80; --user-bg: #1f2d44; --agent-bg: #232c35;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { flex: 1; width: 100%; max-width: 920px; margin: 0 auto; padding: 24px 16px; display: flex; align-items: center; justify-content: center; }
[hidden] { display: none !important; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 24px; }
.narrow { width: 100%; max-width: 420px; }
h1 { font-size: 1.4rem; margin: 0 0 4px; }
h2 { font-size: 1.05rem; margin: 0 0 12px; }
.muted { color: var(--muted); margin: 0 0 16px; }
.call { width: 100%; display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: stretch; }
.panel { text-align: center; }
.avatar { width: 88px; height: 88px; margin: 0 auto 12px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; font-size: 2.2rem; font-weight: 700; }
.status { margin: 0 0 16px; font-weight: 600; }
.timer { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 8px; }
.notice { font-size: .9rem; color: var(--muted); margin: 0 0 12px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input { width: 100%; padding: 12px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
button { width: 100%; margin-top: 12px; padding: 12px 16px; font: inherit; font-weight: 600; color: var(--accent-text); background: var(--accent); border: 0; border-radius: 8px; cursor: pointer; }
button:disabled { opacity: .6; cursor: progress; }
button.hangup { background: var(--danger); color: #fff; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.error { color: var(--danger); min-height: 1.5em; margin: 8px 0 0; font-size: .95rem; }
.transcript-card { display: flex; flex-direction: column; min-height: 0; }
.transcript { flex: 1; min-height: 240px; max-height: 480px; overflow-y: auto; overflow-wrap: anywhere; }
.transcript p { margin: 0 0 8px; padding: 8px 12px; border-radius: 10px; background: var(--agent-bg); }
.transcript p.user { background: var(--user-bg); }
footer { text-align: center; padding: 16px; color: var(--muted); font-size: .85rem; }
@media (max-width: 640px) {
  .call { grid-template-columns: 1fr; }
  .card { padding: 20px 16px; }
  .transcript { min-height: 160px; max-height: 320px; }
}
