:root {
  --bg: #070b13;
  --bg-soft: #0c1422;
  --surface: rgba(17, 27, 45, .78);
  --surface-solid: #111b2d;
  --surface-light: rgba(255, 255, 255, .055);
  --line: rgba(255, 255, 255, .105);
  --line-strong: rgba(255, 255, 255, .18);
  --text: #f5f8ff;
  --muted: #91a0b9;
  --accent: #42d3a3;
  --accent-2: #6d78ff;
  --accent-soft: rgba(66, 211, 163, .14);
  --danger: #ff5d73;
  --warning: #ffbd59;
  --success: #42d3a3;
  --radius: 24px;
  --radius-small: 15px;
  --shadow: 0 24px 80px rgba(0, 0, 0, .38);
  --sidebar: 260px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% -20%, rgba(109, 120, 255, .19), transparent 36%),
    radial-gradient(circle at 95% 10%, rgba(66, 211, 163, .13), transparent 28%),
    linear-gradient(155deg, #070b13 0%, #09101c 55%, #070a11 100%);
}
button, input, select { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
input, select {
  width: 100%;
  color: var(--text);
  background: rgba(3, 8, 16, .52);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 14px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input::placeholder { color: #61708a; }
input:focus, select:focus {
  border-color: rgba(66, 211, 163, .72);
  box-shadow: 0 0 0 4px rgba(66, 211, 163, .11);
  background: rgba(3, 8, 16, .8);
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8390a7 50%), linear-gradient(135deg, #8390a7 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.8rem, 3vw, 2.7rem); letter-spacing: -.045em; }
h2 { margin-bottom: 0; font-size: 1.2rem; letter-spacing: -.025em; }
svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.hidden { display: none !important; }

.ambient { position: fixed; z-index: -1; pointer-events: none; filter: blur(75px); opacity: .33; border-radius: 999px; }
.ambient-one { width: 330px; height: 330px; background: #4758e8; top: -170px; left: -100px; }
.ambient-two { width: 300px; height: 300px; background: #23b982; right: -170px; bottom: -150px; }
.glass-card, .glass-panel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(23, 35, 57, .84), rgba(10, 18, 31, .72));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.glass-card { border-radius: var(--radius); }
.center-view { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }

.brand { display: flex; align-items: center; gap: 10px; line-height: 1; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; color: #07140f; background: linear-gradient(135deg, #65f1c1, #42d3a3 55%, #63a9ff); box-shadow: 0 10px 30px rgba(66, 211, 163, .24); }
.brand-mark svg { width: 20px; height: 20px; stroke-width: 2.2; }
.brand strong { display: block; font-size: 1rem; letter-spacing: -.03em; }
.brand em { display: block; margin-top: 3px; color: var(--accent); font-size: .72rem; font-style: normal; letter-spacing: .14em; text-transform: uppercase; }
.brand-large { justify-content: center; }
.brand-large .brand-mark { width: 54px; height: 54px; border-radius: 18px; }
.brand-large .brand-mark svg { width: 27px; height: 27px; }
.brand-large strong { font-size: 1.42rem; }
.brand-large em { font-size: .8rem; }

.loader { width: 36px; height: 36px; margin: 28px auto 0; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--accent); border-radius: 50%; animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-card { width: min(100%, 440px); padding: 40px; text-align: center; }
.auth-card h1 { font-size: 1.8rem; margin-bottom: 8px; }
.auth-subtitle { margin: 16px 0 28px; color: var(--muted); }
.stack-form { display: grid; gap: 16px; text-align: left; }
.stack-form label, .inline-form label { display: grid; gap: 8px; }
.stack-form label > span, .inline-form label > span { color: #bdc7d7; font-size: .82rem; font-weight: 650; }
.microcopy { margin: 20px auto 0; color: #73829a; font-size: .78rem; line-height: 1.55; text-align: center; }
.microcopy.left { text-align: left; }
.primary-button, .secondary-button, .outline-button, .text-button {
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 750;
  transition: transform .16s ease, filter .16s ease, border-color .16s ease, background .16s ease;
}
.primary-button { color: #071610; background: linear-gradient(135deg, #64edbe, #42d3a3); box-shadow: 0 12px 32px rgba(66, 211, 163, .18); }
.secondary-button { color: var(--text); background: rgba(255, 255, 255, .075); border: 1px solid var(--line); }
.outline-button { color: #dbe5f5; background: rgba(5, 11, 20, .35); border: 1px solid var(--line); }
.text-button { min-height: 36px; padding: 0 4px; color: var(--accent); background: transparent; }
.primary-button:hover, .secondary-button:hover, .outline-button:hover { transform: translateY(-1px); filter: brightness(1.07); }
.primary-button:active, .secondary-button:active, .outline-button:active { transform: translateY(0); }
.primary-button.compact, .secondary-button.compact { min-height: 42px; padding: 0 15px; }
.primary-button:disabled, .secondary-button:disabled, .outline-button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 12px; color: #dbe5f5; background: rgba(255,255,255,.045); cursor: pointer; }
.icon-button:hover { background: rgba(255,255,255,.09); }
.activation-badge { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 24px; border-radius: 24px; color: var(--accent); background: var(--accent-soft); }
.activation-badge svg { width: 34px; height: 34px; }
.big-public-id { margin: 12px 0; color: var(--accent); font-size: clamp(2rem, 8vw, 3.2rem); font-weight: 800; letter-spacing: .08em; }
.big-public-id.small { font-size: 1.65rem; }

.app-layout { min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: fixed; inset: 18px auto 18px 18px; z-index: 20; width: calc(var(--sidebar) - 18px); padding: 18px 14px 14px; border-radius: 24px; display: flex; flex-direction: column; }
.sidebar-brand { padding: 4px 10px 22px; }
.main-nav { display: grid; gap: 6px; }
.nav-button { border: 0; background: transparent; cursor: pointer; color: #8e9cb4; display: flex; align-items: center; gap: 13px; min-height: 48px; padding: 0 13px; border-radius: 14px; font-weight: 650; text-align: left; }
.nav-button svg { width: 20px; height: 20px; }
.nav-button:hover { color: #dce5f4; background: rgba(255,255,255,.045); }
.nav-button.active { color: var(--text); background: linear-gradient(90deg, rgba(66,211,163,.16), rgba(66,211,163,.055)); box-shadow: inset 3px 0 var(--accent); }
.sidebar-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 6px 2px; border-top: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 15px; color: #dffcf3; font-size: .76rem; font-weight: 850; background: linear-gradient(145deg, rgba(66,211,163,.26), rgba(109,120,255,.22)); border: 1px solid rgba(255,255,255,.12); }
.sidebar-user-copy { min-width: 0; flex: 1; }
.sidebar-user-copy strong, .sidebar-user-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-copy strong { font-size: .87rem; }
.sidebar-user-copy span { margin-top: 4px; color: var(--muted); font-size: .72rem; letter-spacing: .05em; }
.sidebar-user .icon-button { width: 36px; height: 36px; border: 0; }
.app-main { grid-column: 2; min-width: 0; min-height: 100dvh; }
.mobile-header, .bottom-nav { display: none; }
.page-scroll { min-height: 100dvh; padding: 46px clamp(28px, 4vw, 68px) 60px; }
.app-page { display: none; width: min(1180px, 100%); margin: 0 auto; animation: page-in .22s ease; }
.app-page.active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
.eyebrow { display: block; margin-bottom: 7px; color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
#dialer-my-id { color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: .035em; }
.dialer-layout { display: grid; grid-template-columns: minmax(360px, .78fr) minmax(300px, 1.22fr); gap: 24px; align-items: stretch; }
.dialer-card { padding: clamp(24px, 4vw, 38px); }
.dial-input-wrap { display: grid; gap: 9px; text-align: center; }
.dial-input-wrap > span { color: var(--muted); font-size: .78rem; }
.dial-input-wrap input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; padding: 8px 4px 16px; color: var(--text); font-size: clamp(2rem, 5vw, 3rem); font-weight: 750; letter-spacing: .09em; text-align: center; }
.dial-input-wrap input:focus { border-color: var(--accent); }
.dial-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 16px; width: min(100%, 315px); margin: 25px auto 22px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.dial-pad button, .dial-pad > span { min-height: 64px; }
.dial-pad button { border: 1px solid transparent; border-radius: 20px; background: rgba(255,255,255,.045); cursor: pointer; color: var(--text); font-size: 1.36rem; font-weight: 700; line-height: 1; transition: background .15s ease, border-color .15s ease, transform .15s ease; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.dial-pad button:hover { background: rgba(255,255,255,.09); border-color: var(--line); }
.dial-pad button:active { transform: scale(.94); }
.dial-pad small { display: block; height: 10px; margin-top: 6px; color: #6e7b90; font-size: .48rem; font-weight: 750; letter-spacing: .15em; }
.dial-backspace { color: var(--muted) !important; background: transparent !important; }
.call-button { display: flex; align-items: center; justify-content: center; gap: 11px; width: min(100%, 260px); min-height: 56px; margin: 0 auto; border: 0; border-radius: 19px; color: #061611; background: linear-gradient(135deg, #68f2c2, #39c995); font-weight: 850; cursor: pointer; box-shadow: 0 17px 40px rgba(66,211,163,.2); transition: transform .18s ease, filter .18s ease; }
.call-button svg { width: 23px; height: 23px; stroke-width: 2.2; }
.call-button:hover { transform: translateY(-2px); filter: brightness(1.07); }
.quick-panel { min-height: 600px; padding: 30px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.compact-list, .history-list, .admin-users { display: grid; }
.empty-state { min-height: 130px; place-items: center; color: var(--muted); text-align: center; }
.empty-state p { margin: 0; }
.list-row { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row-copy { flex: 1; min-width: 0; }
.list-row-copy strong, .list-row-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row-copy strong { font-size: .92rem; }
.list-row-copy span { margin-top: 5px; color: var(--muted); font-size: .76rem; }
.list-row-meta { color: var(--muted); font-size: .74rem; white-space: nowrap; }
.row-call-button { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid rgba(66,211,163,.2); border-radius: 14px; color: var(--accent); background: rgba(66,211,163,.09); cursor: pointer; }
.row-call-button:hover { background: rgba(66,211,163,.16); }

.inline-form { display: grid; grid-template-columns: 1.1fr 1.2fr auto auto; gap: 14px; align-items: end; padding: 20px; margin-bottom: 22px; }
.people-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.person-card { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 19px; background: rgba(255,255,255,.035); }
.person-card .person-copy { min-width: 0; }
.person-card strong, .person-card span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-card strong { font-size: .9rem; }
.person-card span { margin-top: 5px; color: var(--muted); font-size: .74rem; letter-spacing: .035em; }
.person-actions { display: flex; gap: 7px; }
.person-actions .icon-button { width: 37px; height: 37px; }
.history-list { padding: 8px 22px; }
.history-icon { display: grid; place-items: center; width: 43px; height: 43px; flex: 0 0 auto; border-radius: 15px; color: var(--accent); background: rgba(66,211,163,.1); }
.history-icon.missed, .history-icon.declined { color: var(--danger); background: rgba(255,93,115,.1); }
.history-icon.outgoing svg { transform: rotate(-28deg); }
.history-icon.incoming svg { transform: rotate(152deg); }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.settings-card { padding: 25px; }
.settings-title { display: flex; gap: 13px; align-items: center; margin-bottom: 22px; }
.settings-title > svg { width: 24px; height: 24px; color: var(--accent); }
.settings-title h2 { margin-bottom: 5px; }
.settings-title p { margin: 0; color: var(--muted); font-size: .78rem; }
.switch-row { display: flex !important; align-items: center; justify-content: space-between; gap: 18px; cursor: pointer; }
.switch-row > span { flex: 1; }
.switch-row strong, .switch-row small { display: block; }
.switch-row strong { color: var(--text); font-size: .88rem; }
.switch-row small { margin-top: 5px; color: var(--muted); font-weight: 400; line-height: 1.4; }
.switch-row input { position: absolute; opacity: 0; width: 1px; }
.switch-row i { position: relative; width: 48px; height: 28px; flex: 0 0 auto; border-radius: 99px; background: rgba(255,255,255,.12); transition: background .2s ease; }
.switch-row i::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: #c8d0dc; transition: transform .2s ease, background .2s ease; }
.switch-row input:checked + i { background: rgba(66,211,163,.35); }
.switch-row input:checked + i::after { transform: translateX(20px); background: var(--accent); }
.status-line { color: var(--muted); font-size: .85rem; line-height: 1.5; }
.status-line.good { color: var(--accent); }
.status-line.bad { color: var(--danger); }
.settings-card > .outline-button { margin-top: 10px; }
.admin-grid { display: grid; grid-template-columns: minmax(320px, .82fr) minmax(300px, 1.18fr); gap: 20px; margin-bottom: 20px; }
.activation-result { padding: 26px; }
.copy-field { display: flex; gap: 8px; margin-top: 16px; }
.copy-field input { min-width: 0; font-size: .82rem; }
.admin-table-card { padding: 25px; }
.search-input { width: min(300px, 45vw); min-height: 42px; }
.admin-user-row { display: grid; grid-template-columns: minmax(230px, 1.4fr) minmax(120px, .7fr) minmax(140px, .8fr) auto; align-items: center; gap: 18px; padding: 14px 2px; border-bottom: 1px solid var(--line); }
.admin-user-row:last-child { border-bottom: 0; }
.admin-user-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.admin-user-main > div:last-child { min-width: 0; }
.admin-user-main strong, .admin-user-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-main span { margin-top: 5px; color: var(--muted); font-size: .74rem; }
.status-badge { display: inline-flex; align-items: center; justify-content: center; width: fit-content; padding: 6px 10px; border-radius: 99px; color: var(--muted); background: rgba(255,255,255,.06); font-size: .7rem; font-weight: 750; }
.status-badge.active { color: var(--success); background: rgba(66,211,163,.1); }
.status-badge.pending { color: var(--warning); background: rgba(255,189,89,.1); }
.status-badge.disabled { color: var(--danger); background: rgba(255,93,115,.1); }
.admin-user-stats { color: var(--muted); font-size: .76rem; line-height: 1.6; }
.admin-user-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }

.audit-list { display: grid; }
.audit-row { display: grid; grid-template-columns: 150px minmax(180px, 1fr) auto; gap: 16px; align-items: center; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.audit-row:last-child { border-bottom: 0; }
.audit-row time { color: var(--muted); font-size: .75rem; }
.audit-row strong { display: block; font-size: .84rem; }
.audit-row span { color: var(--muted); font-size: .75rem; }
.audit-target { text-align: right; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.admin-action { border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; color: #c7d1e1; background: rgba(255,255,255,.035); cursor: pointer; font-size: .7rem; }
.admin-action:hover { background: rgba(255,255,255,.08); }
.admin-action.danger { color: #ff9aaa; }

.call-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(3, 7, 13, .78); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.incoming-card { width: min(100%, 430px); padding: 42px 28px 32px; text-align: center; }
.incoming-pulse { position: relative; display: grid; place-items: center; width: 132px; height: 132px; margin: 0 auto 27px; }
.incoming-pulse::before, .incoming-pulse::after { content: ""; position: absolute; inset: 0; border: 1px solid rgba(66,211,163,.35); border-radius: 50%; animation: pulse-ring 2.2s ease-out infinite; }
.incoming-pulse::after { animation-delay: 1.1s; }
@keyframes pulse-ring { 0% { transform: scale(.65); opacity: 0; } 25% { opacity: 1; } 100% { transform: scale(1.15); opacity: 0; } }
.call-avatar { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 32px; color: #e9fff8; background: linear-gradient(145deg, rgba(66,211,163,.38), rgba(89,104,240,.38)); border: 1px solid rgba(255,255,255,.16); font-size: 1.5rem; font-weight: 850; box-shadow: 0 18px 60px rgba(0,0,0,.28); }
.call-avatar.large { width: 116px; height: 116px; border-radius: 38px; font-size: 1.8rem; }
.call-kicker { display: block; margin-bottom: 10px; color: var(--accent); font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.incoming-card h2, .active-call-body h2 { font-size: clamp(1.8rem, 6vw, 2.7rem); letter-spacing: -.04em; }
.call-public-id { margin: 9px 0 0; color: var(--muted); font-size: 1rem; letter-spacing: .1em; }
.incoming-actions { display: flex; justify-content: center; gap: clamp(55px, 18vw, 105px); margin-top: 43px; }
.round-call-button { border: 0; background: transparent; cursor: pointer; display: grid; justify-items: center; gap: 11px; font-size: .75rem; font-weight: 650; color: #dbe4f3; }
.round-call-button svg { width: 27px; height: 27px; }
.round-call-button::before { content: ""; grid-area: 1 / 1; width: 66px; height: 66px; border-radius: 50%; }
.round-call-button svg { grid-area: 1 / 1; align-self: center; z-index: 1; }
.round-call-button span { grid-area: 2 / 1; }
.round-call-button.decline::before { background: var(--danger); box-shadow: 0 15px 35px rgba(255,93,115,.24); }
.round-call-button.answer::before { background: var(--success); box-shadow: 0 15px 35px rgba(66,211,163,.24); }

.active-call { padding: 0; background: #060b12; }
.active-call-background { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(circle at 50% 35%, rgba(66,211,163,.2), transparent 28%), radial-gradient(circle at 15% 95%, rgba(109,120,255,.2), transparent 30%), #07101a; }
.active-call-background::after { content: ""; position: absolute; width: 580px; height: 580px; left: calc(50% - 290px); top: calc(36% - 290px); border-radius: 50%; border: 1px solid rgba(255,255,255,.045); box-shadow: 0 0 0 70px rgba(255,255,255,.018), 0 0 0 150px rgba(255,255,255,.012); }
.active-call-shell { position: relative; z-index: 1; width: 100%; height: 100%; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; }
.active-call-header { display: flex; align-items: center; justify-content: space-between; padding: 24px clamp(22px, 4vw, 48px); }
.connection-badge { padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: rgba(0,0,0,.18); font-size: .72rem; }
.connection-badge.connected { color: var(--accent); border-color: rgba(66,211,163,.2); background: rgba(66,211,163,.07); }
.active-call-body { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 15px 20px 35px; text-align: center; }
.active-call-body .call-avatar { margin-bottom: 30px; }
.call-timer { margin: 21px 0 0; color: #d3ddeb; font-size: 1.18rem; font-variant-numeric: tabular-nums; letter-spacing: .12em; }
.call-participants { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 760px; margin-top: 22px; }
.participant-chip { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 99px; color: #bdc8da; background: rgba(0,0,0,.17); font-size: .72rem; }
.participant-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.participant-chip.joined::before { background: var(--success); box-shadow: 0 0 0 4px rgba(66,211,163,.1); }
.participant-chip.ringing::before { background: var(--warning); }
.audio-unlock { position: absolute; left: 50%; bottom: 122px; transform: translateX(-50%); z-index: 2; }
.active-call-controls { display: flex; justify-content: center; align-items: flex-start; gap: clamp(22px, 7vw, 70px); padding: 18px 24px calc(27px + var(--safe-bottom)); background: linear-gradient(to top, rgba(4,8,14,.86), rgba(4,8,14,.25)); }
.call-control { border: 0; background: transparent; cursor: pointer; display: grid; justify-items: center; gap: 9px; color: #cbd5e4; }
.call-control > span { display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid var(--line); border-radius: 19px; background: rgba(255,255,255,.075); transition: transform .15s ease, background .15s ease; }
.call-control:hover > span { transform: translateY(-2px); background: rgba(255,255,255,.12); }
.call-control em { font-size: .7rem; font-style: normal; }
.call-control.muted > span { color: var(--danger); background: rgba(255,93,115,.13); border-color: rgba(255,93,115,.25); }
.call-control.speaker-on > span { color: #07140f; background: var(--accent); border-color: transparent; box-shadow: 0 12px 28px rgba(66,211,163,.2); }
.call-control.speaker-on em { color: var(--accent); }
.call-control.danger > span { color: #fff; background: var(--danger); border-color: transparent; box-shadow: 0 15px 32px rgba(255,93,115,.25); }
.call-control:disabled { opacity: .38; cursor: not-allowed; }

.app-dialog { width: min(calc(100% - 30px), 430px); color: var(--text); padding: 24px; border: 1px solid var(--line); }
.app-dialog::backdrop { background: rgba(2,6,12,.72); backdrop-filter: blur(10px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.dialog-heading .icon-button { font-size: 1.5rem; }
.toast-region { position: fixed; z-index: 300; right: 20px; bottom: 20px; display: grid; gap: 10px; width: min(380px, calc(100% - 40px)); pointer-events: none; }
.toast { padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 14px; background: rgba(16,25,41,.96); box-shadow: 0 18px 50px rgba(0,0,0,.35); color: #dce5f3; font-size: .83rem; line-height: 1.45; animation: toast-in .22s ease; }
.toast.error { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
#remote-audio { position: fixed; width: 1px; height: 1px; overflow: hidden; opacity: .01; pointer-events: none; }

@media (max-width: 1050px) {
  .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-user-row { grid-template-columns: minmax(220px, 1.5fr) minmax(110px, .6fr) auto; }
  .admin-user-stats { display: none; }
}

@media (max-width: 820px) {
  :root { --radius: 21px; }
  .app-layout { display: block; }
  .sidebar { display: none; }
  .app-main { min-height: 100dvh; }
  .mobile-header { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; min-height: 66px; padding: calc(10px + env(safe-area-inset-top, 0px)) 17px 10px; border-width: 0 0 1px; background: rgba(7,12,21,.84); }
  .mobile-header .brand-mark { width: 34px; height: 34px; border-radius: 12px; }
  .mobile-header .brand strong { font-size: .88rem; }
  .mobile-header .brand em { font-size: .63rem; }
  .header-id { color: var(--muted); font-size: .75rem; letter-spacing: .07em; }
  .page-scroll { min-height: calc(100dvh - 66px); padding: 27px 16px calc(94px + var(--safe-bottom)); }
  .bottom-nav { position: fixed; z-index: 50; inset: auto 10px calc(10px + var(--safe-bottom)) 10px; display: grid; grid-template-columns: repeat(4, 1fr); padding: 7px; border-radius: 20px; background: rgba(12,19,32,.93); }
  .bottom-nav.has-admin { grid-template-columns: repeat(5, 1fr); }
  .bottom-nav .nav-button { display: grid; justify-items: center; gap: 4px; min-height: 52px; padding: 5px 2px; font-size: .62rem; }
  .bottom-nav .nav-button svg { width: 19px; height: 19px; }
  .bottom-nav .nav-button.active { box-shadow: none; background: rgba(66,211,163,.12); color: var(--accent); }
  .page-heading { align-items: center; margin-bottom: 21px; }
  .page-heading h1 { font-size: 1.8rem; }
  .page-heading .outline-button { min-height: 40px; padding: 0 12px; font-size: .75rem; }
  .dialer-layout, .settings-grid, .admin-grid { grid-template-columns: 1fr; }
  .quick-panel { min-height: auto; padding: 22px; }
  .dialer-card { padding: 24px 18px; }
  .dial-input-wrap input { font-size: 2.1rem; }
  .dial-pad { margin-top: 18px; width: min(100%, 330px); }
  .dial-pad button, .dial-pad > span { min-height: 57px; }
  .inline-form { grid-template-columns: 1fr; }
  .people-grid { grid-template-columns: 1fr; }
  .history-list { padding: 7px 16px; }
  .admin-table-card { padding: 19px 15px; }
  .admin-user-row { grid-template-columns: 1fr auto; gap: 10px; }
  .admin-user-status { justify-self: end; }
  .admin-user-actions { grid-column: 1 / -1; justify-content: flex-start; padding-left: 55px; }
  .search-input { width: min(180px, 45vw); }
  .audit-row { grid-template-columns: 1fr auto; gap: 7px 12px; }
  .audit-row time { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .center-view { padding: 13px; }
  .auth-card { padding: 30px 20px; }
  .page-heading .outline-button svg { display: none; }
  .page-heading .outline-button { padding: 0 10px; }
  .dial-input-wrap input { font-size: 1.84rem; letter-spacing: .06em; }
  .dial-pad { gap: 8px 12px; }
  .dial-pad button, .dial-pad > span { min-height: 54px; }
  .person-card { padding: 15px; }
  .settings-card { padding: 21px 18px; }
  .incoming-card { padding: 37px 20px 29px; }
  .active-call-header .brand em { display: none; }
  .active-call-header { padding: 18px; }
  .active-call-body .call-avatar { margin-bottom: 22px; }
  .call-avatar.large { width: 104px; height: 104px; }
  .active-call-controls { gap: 12px; padding-left: 12px; padding-right: 12px; }
  .call-control > span { width: 52px; height: 52px; }
  .call-control em { max-width: 64px; font-size: .64rem; }
  .toast-region { right: 12px; bottom: calc(90px + var(--safe-bottom)); width: calc(100% - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


.presence {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 0.76rem !important;
}

.presence i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 15%, transparent);
}

.presence.online { color: var(--success); }
.presence.offline { color: var(--muted); }
