:root {
  --bg: #f6f7f9; --card: #ffffff; --text: #16181d; --muted: #5f6672; --border: #d9dde3;
  --key: #eceff3; --key-active: #dde2e8; --green: #1f8a4c; --red: #c4362c; --accent: #2457c5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317; --card: #1a1d23; --text: #e8eaee; --muted: #9aa1ad; --border: #2c3139;
    --key: #23272e; --key-active: #2d323a; --green: #2fa863; --red: #e0574c; --accent: #6b93ec;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 420px; margin: 0 auto; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
h1 { font-size: 1.4rem; margin: 24px 0 16px; }
label { display: block; margin-bottom: 12px; color: var(--muted); font-size: .9rem; }
input { width: 100%; padding: 12px; margin-top: 4px; font-size: 1rem; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; }
button { font: inherit; color: var(--text); background: var(--key); border: 0; border-radius: 12px;
  padding: 12px; cursor: pointer; touch-action: manipulation; }
button:active { background: var(--key-active); }
button:disabled { opacity: .45; cursor: default; }
button.primary { width: 100%; background: var(--accent); color: #fff; }
button.link { background: none; color: var(--accent); padding: 4px 0; }
header { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
#status-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px; margin: 12px 0; text-align: center; }
#state { font-weight: 600; }
#timer { font-size: 2rem; font-variant-numeric: tabular-nums; margin: 2px 0; }
#flags { color: var(--muted); font-size: .85rem; min-height: 1.2em; }
#number { font-size: 1.6rem; text-align: center; letter-spacing: .04em; }
#pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
#pad button { font-size: 1.5rem; padding: 14px 0; }
#actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
#actions button { padding: 16px 0; font-weight: 600; }
button.call { background: var(--green); color: #fff; }
button.hangup { background: var(--red); color: #fff; }
#mute[aria-pressed="true"] { background: var(--accent); color: #fff; }
.error { color: var(--red); min-height: 1.2em; font-size: .9rem; }
#history { margin-top: 16px; color: var(--muted); font-size: .9rem; }
#calls { padding-left: 20px; }
