:root {
  --bg: #f4f6f8; --panel: #fff; --fg: #111827; --muted: #6b7280; --line: #e5e7eb; --accent: #0f766e; --accent-fg: #fff;
  --green: #16a34a; --red: #dc2626; --call-bg: #0b3b37;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b0f17; --panel: #121826; --fg: #e5e7eb; --muted: #9ca3af; --line: #263041; --call-bg: #062825; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font: 15px/1.5 "Noto Sans Bengali", "Hind Siliguri", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; } .grow { flex: 1; }
.err { color: var(--red); min-height: 1.2em; }
button, input { font: inherit; color: inherit; }
button { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 8px 14px; cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
button.icon { border: none; background: none; font-size: 18px; padding: 6px 10px; }
input { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 10px 12px; width: 100%; }

.screen { min-height: 100%; max-width: 560px; margin: 0 auto; }
#reg { display: grid; place-items: center; padding: 16px; min-height: 100vh; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px; width: min(380px, 100%); display: grid; gap: 12px; text-align: center; }
.card h1 { margin: 0; color: var(--accent); }
.logo { font-size: 44px; }

.top { display: flex; align-items: center; gap: 8px; padding: 14px 16px; background: var(--accent); color: var(--accent-fg); }
.top .muted { color: #ccfbf1; }
.conn { font-size: 14px; } .conn.on { color: #86efac; } .conn.off { color: #fca5a5; }
.tabs { display: flex; background: var(--accent); }
.tabs button { flex: 1; border: none; border-radius: 0; background: none; color: #ccfbf1; padding: 10px 4px; border-bottom: 3px solid transparent; }
.tabs button.active { color: #fff; border-bottom-color: #fff; font-weight: 600; }
.badge { background: #fff; color: var(--accent); border-radius: 10px; padding: 0 7px; font-size: 12px; }
.tab { padding: 10px 12px 24px; }
.search { margin-bottom: 8px; }
.list { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: none; }
.item .who { flex: 1; min-width: 0; }
.item .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .call-mini { border: none; background: var(--green); color: #fff; border-radius: 50%; width: 42px; height: 42px; font-size: 18px; padding: 0; }
.item .call-mini:disabled { background: var(--line); }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: #99f6e4; color: #134e4a; display: grid; place-items: center; font-weight: 700; flex: none; position: relative; }
.avatar.on::after { content: ''; position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--green); border: 2px solid var(--panel); }
.avatar.big { width: 110px; height: 110px; font-size: 42px; margin: 0 auto; }
.st-in { color: var(--green); } .st-out { color: var(--accent); } .st-miss { color: var(--red); }

.dial-num { font-size: 26px; text-align: center; letter-spacing: 1px; margin: 8px 0 12px; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pad button { font-size: 24px; padding: 14px 0; border-radius: 14px; }
.dial-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.call-btn { background: var(--green); color: #fff; border: none; padding: 14px; border-radius: 14px; font-weight: 600; }
.call-btn.alt { background: var(--accent); }

.call { position: fixed; inset: 0; max-width: none; background: var(--call-bg); color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 64px 16px 56px; text-align: center; z-index: 10; }
.call h2 { margin: 16px 0 2px; font-size: 26px; }
.call .muted { color: #a7f3d0; }
.call-state { margin-top: 14px; font-size: 18px; color: #d1fae5; font-variant-numeric: tabular-nums; }
.call-actions { display: flex; justify-content: center; gap: 56px; }
.round { width: 70px; height: 70px; border-radius: 50%; border: none; font-size: 26px; background: rgba(255,255,255,.15); color: #fff; }
.round.red { background: var(--red); } .round.green { background: var(--green); animation: pulse 1.2s infinite; }
.round.on { background: #fff; color: var(--call-bg); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.6); } 100% { box-shadow: 0 0 0 22px rgba(22,163,74,0); } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 20; max-width: 90vw; }
