:root {
  --bg: #f5f5f7; --card: #ffffff; --ink: #1d1d1f; --muted: #6e6e73; --line: #e5e5ea; --key: #f2f2f7;
  --green: #34c759; --red: #ff3b30; --blue: #0071e3; --amber: #ff9f0a;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000000; --card: #1c1c1e; --ink: #f5f5f7; --muted: #98989d; --line: #38383a; --key: #2c2c2e; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  min-height: 100vh; min-height: 100dvh; }
.shell { max-width: 400px; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 16px 24px; }
.card { background: var(--card); border-radius: 22px; padding: 24px 22px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 30px rgba(0,0,0,.06); }

.brand { text-align: center; margin-bottom: 18px; }
.brand img { display: block; margin: 0 auto 10px; }
.brand h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -.2px; }
.brand p { color: var(--muted); margin: 4px 0 0; font-size: 15px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 5px; }
input { width: 100%; font: inherit; color: var(--ink); background: transparent; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; outline: none; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,113,227,.18); }
.hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.error { color: var(--red); font-size: 14px; min-height: 1em; margin: 10px 0 0; }
.fine { font-size: 12px; color: var(--muted); text-align: center; margin: 18px 0 0; }
.warn { text-align: center; color: var(--amber); font-size: 13px; margin: -6px 0 10px; }

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { opacity: .4; cursor: default; }
.btn { background: var(--key); border-radius: 12px; padding: 12px 16px; font-weight: 500; }
.btn.primary { width: 100%; margin-top: 16px; background: var(--blue); color: #fff; }
.link { color: var(--blue); font-size: 14px; padding: 4px 0; }

.bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #c7c7cc; }
.dot.ok { background: var(--green); } .dot.warn { background: var(--amber); } .dot.err { background: var(--red); }

.display { position: relative; margin: 8px 0 4px; }
.display input { border: 0; font-size: 30px; text-align: center; letter-spacing: .5px; padding: 10px 44px;
  font-variant-numeric: tabular-nums; }
.display input:focus { box-shadow: none; }
.icon { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--muted);
  padding: 8px; }

.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 18px; margin: 14px 10px 20px; }
.pad button { aspect-ratio: 1; border-radius: 50%; background: var(--key); font-size: 28px; font-weight: 400;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  transition: filter .1s; }
.pad button:active { filter: brightness(.9); }
.pad button small { font-size: 9px; letter-spacing: 1.6px; color: var(--muted); margin-top: 3px; font-weight: 600; }
.pad.small { margin: 0 24px 14px; gap: 10px 16px; }
.pad.small button { font-size: 22px; }

.round { display: flex; align-items: center; justify-content: center; width: 68px; height: 68px;
  border-radius: 50%; color: #fff; margin: 0 auto; transition: transform .1s; }
.round:active { transform: scale(.95); }
.round.call { background: var(--green); }
.round.end { background: var(--red); }
.pair { display: flex; justify-content: space-around; margin: 30px 0 10px; }
.pair .round { margin: 0; }

.who { text-align: center; padding: 26px 0 22px; }
.who .name { font-size: 28px; font-weight: 600; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.who .label { color: var(--muted); font-size: 14px; margin-top: 4px; font-variant-numeric: tabular-nums; }
#incoming .who .label { margin: 0 0 6px; }

.ctl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.tile { background: var(--key); border-radius: 14px; padding: 14px 0; font-size: 14px; font-weight: 500; }
.tile[aria-pressed="true"] { background: var(--ink); color: var(--card); }

.xfer { display: flex; gap: 8px; margin-bottom: 22px; }
.xfer input { padding: 10px 12px; font-size: 15px; }
.xfer .btn { flex: 0 0 auto; padding: 10px 14px; font-size: 15px; }

@media (max-width: 360px) { .pad { gap: 10px 14px; margin: 10px 4px 16px; } .pad button { font-size: 24px; } }
