:root {
    color-scheme: dark;
    --bg: #02070d;
    --bg-soft: #06111f;
    --surface: rgba(8, 20, 34, .90);
    --surface-2: rgba(11, 29, 48, .88);
    --surface-3: #0b1c2d;
    --line: rgba(137, 185, 222, .16);
    --line-strong: rgba(77, 197, 255, .34);
    --text: #f2f9ff;
    --muted: #8ea8bd;
    --muted-2: #5f788e;
    --cyan: #35c6ff;
    --cyan-strong: #009ce6;
    --green: #25d486;
    --red: #ff5d6c;
    --amber: #ffbe4f;
    --nav-h: 74px;
    --header-h: 74px;
    --radius-xl: 28px;
    --radius-lg: 21px;
    --radius-md: 15px;
    --shadow-xl: 0 34px 90px rgba(0, 0, 0, .42);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { min-height: 100%; background: var(--bg); overscroll-behavior: none; }
body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 2%, rgba(20, 145, 220, .19), transparent 28rem),
        radial-gradient(circle at 90% 94%, rgba(27, 183, 255, .10), transparent 27rem),
        linear-gradient(155deg, #02060b 0%, #071522 53%, #03090f 100%);
}
body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    opacity: .32;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(to bottom, #000, transparent 88%);
}
button, input { font: inherit; }
button { color: inherit; }
button, .history-item, .contact-card { touch-action: manipulation; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
[hidden] { display: none !important; }
svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
code { color: #bdeaff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }

.app-shell {
    width: min(1240px, calc(100% - 28px));
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding: env(safe-area-inset-top) 0 calc(24px + env(safe-area-inset-bottom));
}

.app-header {
    position: sticky;
    top: env(safe-area-inset-top);
    z-index: 50;
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 2px;
    background: linear-gradient(to bottom, rgba(2,7,13,.94), rgba(2,7,13,.77), transparent);
    backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; min-width: 0; gap: 12px; }
.brand-mark {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    border: 1px solid rgba(53,198,255,.38);
    border-radius: 16px;
    color: #c8f2ff;
    background: linear-gradient(145deg, rgba(53,198,255,.18), rgba(53,198,255,.035));
    box-shadow: inset 0 0 22px rgba(53,198,255,.08), 0 10px 30px rgba(0,0,0,.25);
}
.brand-mark svg { width: 25px; height: 25px; }
.brand-copy { display: grid; min-width: 0; gap: 2px; }
.brand-copy strong { font-size: clamp(17px, 2.6vw, 23px); letter-spacing: -.03em; white-space: nowrap; }
.brand-copy span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.header-status { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.status-chip {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(3,11,18,.72);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #657b8e; box-shadow: 0 0 0 4px rgba(101,123,142,.11); }
.status-chip[data-state="online"] .status-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(37,212,134,.11); }
.status-chip[data-state="connecting"] .status-dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(255,190,79,.12); animation: pulse 1.4s infinite; }
.status-chip[data-state="error"] .status-dot, .status-chip[data-state="offline"] .status-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(255,93,108,.10); }
.header-icon, .icon-button {
    width: 39px;
    height: 39px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(8,22,36,.78);
    color: #cbeeff;
    cursor: pointer;
}
.header-icon:hover, .icon-button:hover { border-color: var(--line-strong); background: rgba(23,69,99,.48); }
.header-icon svg { width: 19px; height: 19px; }

.system-banner {
    position: relative;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 12px;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(9,24,39,.95);
    box-shadow: 0 12px 34px rgba(0,0,0,.23);
}
.system-banner div:first-child { display: grid; gap: 2px; }
.system-banner span { color: var(--muted); font-size: 12px; }
.system-banner button { border: 0; border-radius: 10px; padding: 8px 12px; background: rgba(255,255,255,.08); cursor: pointer; }
.offline-banner { border-color: rgba(255,93,108,.30); }
.update-banner { border-color: rgba(53,198,255,.32); }
.banner-actions { display: flex; align-items: center; gap: 8px; }

.app-frame {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.app-nav {
    position: sticky;
    top: calc(var(--header-h) + env(safe-area-inset-top) + 12px);
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(5,15,25,.78);
    box-shadow: 0 18px 50px rgba(0,0,0,.25);
    backdrop-filter: blur(18px);
}
.nav-item {
    min-height: 68px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    padding: 8px 4px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.045); }
.nav-item.is-active { color: #e9faff; background: linear-gradient(145deg, rgba(53,198,255,.22), rgba(53,198,255,.07)); box-shadow: inset 0 0 0 1px rgba(53,198,255,.22); }

.app-content { min-width: 0; }
.app-view { display: none; animation: fadeIn .22s ease both; }
.app-view.is-active { display: block; }
.dialer-layout { display: grid; grid-template-columns: minmax(0, 720px) minmax(260px, 1fr); gap: 18px; align-items: start; }

.dialer-card, .dial-sidecard, .card-surface {
    border: 1px solid var(--line);
    background: linear-gradient(155deg, rgba(12,29,47,.94), rgba(5,15,25,.93));
    box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255,255,255,.035);
    backdrop-filter: blur(19px);
}
.dialer-card { padding: clamp(15px, 2.6vw, 24px); border-radius: var(--radius-xl); }
.dial-sidecard { position: sticky; top: calc(var(--header-h) + 14px); padding: 22px; border-radius: var(--radius-lg); }
.phone-screen {
    position: relative;
    min-height: 175px;
    overflow: hidden;
    padding: 16px 18px 18px;
    border: 1px solid rgba(137,185,222,.15);
    border-radius: 22px;
    background:
        radial-gradient(circle at 50% 115%, rgba(53,198,255,.15), transparent 50%),
        linear-gradient(180deg, rgba(53,198,255,.055), transparent 50%),
        rgba(2,9,16,.80);
}
.phone-screen::before {
    position: absolute;
    inset: 0;
    content: "";
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.018), transparent);
    transform: translateX(-100%);
    animation: scan 7s linear infinite;
}
.screen-topline { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
#accountLabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secure-indicator { flex: 0 0 auto; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 9px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.secure-indicator[data-state="ok"] { color: #9df2c8; border-color: rgba(37,212,134,.28); background: rgba(37,212,134,.08); }
.secure-indicator[data-state="error"] { color: #ffc2c8; border-color: rgba(255,93,108,.28); background: rgba(255,93,108,.08); }
.call-state { position: relative; z-index: 2; margin-top: 20px; color: var(--cyan); font-size: 10px; font-weight: 900; letter-spacing: .19em; text-align: center; text-transform: uppercase; }
.remote-identity { position: relative; z-index: 2; min-height: 42px; margin-top: 7px; overflow-wrap: anywhere; color: #f5fbff; font-size: clamp(24px, 4.8vw, 38px); font-weight: 770; letter-spacing: -.04em; text-align: center; }
.call-timer { position: relative; z-index: 2; margin-top: 5px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: center; }
.incoming-card { position: absolute; z-index: 5; inset: 10px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 18px; border: 1px solid rgba(53,198,255,.22); border-radius: 17px; background: rgba(3,12,20,.97); box-shadow: 0 28px 65px rgba(0,0,0,.54); }
.incoming-wave { width: 42px; height: 42px; border-radius: 50%; background: rgba(53,198,255,.15); box-shadow: 0 0 0 7px rgba(53,198,255,.06); animation: pulse 1.4s infinite; }
.incoming-copy { min-width: 0; }
.incoming-copy strong { display: block; margin-top: 4px; overflow: hidden; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.incoming-actions { display: flex; gap: 9px; }
.round-action { width: 45px; height: 45px; display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer; }
.round-action svg { width: 21px; height: 21px; }
.round-action.success { color: #032014; background: var(--green); }
.round-action.danger { color: #2b0206; background: var(--red); }

.favorite-strip { min-height: 0; display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; }
.favorite-strip:empty { display: none; }
.favorite-strip::-webkit-scrollbar { display: none; }
.favorite-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px 0 7px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.035); color: #dff5ff; cursor: pointer; font-size: 11px; font-weight: 800; }
.favorite-chip span { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; color: #032033; background: var(--cyan); font-size: 10px; }

.number-entry { margin-top: 14px; }
.number-row { display: grid; grid-template-columns: minmax(0,1fr) 52px; gap: 9px; }
input { width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid rgba(137,185,222,.18); border-radius: 14px; background: rgba(2,9,16,.76); color: var(--text); }
input::placeholder { color: #5d7488; }
#destination { min-height: 55px; text-align: center; font-size: 19px; font-weight: 700; letter-spacing: .02em; }
.backspace-button { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.035); cursor: pointer; }
.backspace-button svg { width: 20px; height: 20px; }
.backspace-button:disabled { opacity: .4; cursor: not-allowed; }

.dialpad { width: min(100%, 390px); display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 14px auto 0; }
.dialpad button { min-height: clamp(58px, 9vh, 72px); display: grid; place-items: center; align-content: center; gap: 1px; border: 1px solid rgba(137,185,222,.13); border-radius: 19px; background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018)); cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.025); }
.dialpad button:hover { border-color: rgba(53,198,255,.28); background: rgba(53,198,255,.08); }
.dialpad button:active { transform: scale(.96); }
.dialpad strong { font-size: clamp(22px, 4vw, 29px); font-weight: 650; line-height: 1; }
.dialpad span { color: var(--muted-2); font-size: 8px; font-weight: 900; letter-spacing: .15em; }
.primary-actions { display: flex; justify-content: center; margin-top: 14px; }
.call-button, .hangup-button { min-width: 170px; min-height: 54px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 23px; border: 0; border-radius: 999px; cursor: pointer; font-weight: 900; box-shadow: 0 14px 34px rgba(0,0,0,.28); }
.call-button { color: #032117; background: linear-gradient(135deg, #41e49a, #19bd70); }
.call-button:disabled { opacity: .35; cursor: not-allowed; filter: grayscale(.25); }
.hangup-button { color: #280307; background: linear-gradient(135deg, #ff7581, #ef3d4c); }
.call-button svg, .hangup-button svg { width: 22px; height: 22px; }
.in-call-controls { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin-top: 14px; }
.in-call-controls button { min-height: 59px; display: grid; place-items: center; align-content: center; gap: 3px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.035); cursor: pointer; }
.in-call-controls button[aria-pressed="true"] { color: #c9f4ff; border-color: rgba(53,198,255,.36); background: rgba(53,198,255,.13); }
.in-call-controls span { font-weight: 900; }
.in-call-controls small { color: var(--muted); font-size: 10px; }
.notice { min-height: 18px; margin: 13px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; text-align: center; }
.notice.success { color: #8ff0bf; }
.notice.error { color: #ffadb5; }

.eyebrow { color: var(--cyan); font-size: 9px; font-weight: 900; letter-spacing: .17em; text-transform: uppercase; }
.dial-sidecard h2 { margin: 7px 0 17px; font-size: 21px; letter-spacing: -.03em; }
.mini-account-details, .account-details, .health-grid { display: grid; gap: 10px; margin: 0; }
.mini-account-details div, .account-details div, .health-grid div { display: grid; gap: 3px; padding: 11px 0; border-bottom: 1px solid rgba(137,185,222,.10); }
.mini-account-details dt, .account-details dt, .health-grid dt { color: var(--muted); font-size: 10px; font-weight: 700; }
.mini-account-details dd, .account-details dd, .health-grid dd { margin: 0; overflow-wrap: anywhere; color: #dff3ff; font-size: 12px; font-weight: 760; }
.server-note { display: flex; justify-content: space-between; gap: 12px; margin-top: 15px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.026); color: var(--muted); font-size: 10px; }
.server-note strong { color: #dff6ff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; padding: 4px 2px; }
.page-heading h2 { margin: 4px 0 0; font-size: clamp(25px, 4vw, 34px); letter-spacing: -.04em; }
.page-heading p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.card-surface { padding: clamp(16px, 2.4vw, 23px); border-radius: var(--radius-lg); }
.history-list { min-height: 320px; display: grid; gap: 7px; align-content: start; }
.history-item { width: 100%; display: grid; grid-template-columns: 43px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 11px; border: 1px solid transparent; border-radius: 15px; background: rgba(255,255,255,.025); color: inherit; cursor: pointer; text-align: left; }
.history-item:hover { border-color: var(--line); background: rgba(53,198,255,.055); }
.history-icon { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 14px; color: #bfefff; background: rgba(53,198,255,.10); font-weight: 900; }
.history-main { display: grid; min-width: 0; gap: 4px; }
.history-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-main small { color: var(--muted); text-transform: capitalize; }
.history-meta { color: var(--muted); font-size: 9px; line-height: 1.45; text-align: right; white-space: pre-line; }
.empty-state { min-height: 250px; display: grid; place-items: center; color: var(--muted); text-align: center; }

.contacts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: 12px; }
.contact-card { position: relative; display: grid; gap: 13px; padding: 17px; border: 1px solid var(--line); border-radius: 19px; background: linear-gradient(145deg, rgba(13,32,51,.92), rgba(5,15,25,.92)); box-shadow: 0 17px 45px rgba(0,0,0,.22); }
.contact-card-top { display: flex; align-items: center; gap: 11px; }
.contact-avatar { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid rgba(53,198,255,.25); border-radius: 15px; color: #d8f6ff; background: rgba(53,198,255,.10); font-weight: 900; }
.contact-copy { min-width: 0; display: grid; gap: 3px; }
.contact-copy strong, .contact-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-copy span { color: var(--muted); font-size: 11px; }
.contact-actions { display: grid; grid-template-columns: 1fr auto auto; gap: 7px; }
.contact-actions button { min-height: 38px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.035); cursor: pointer; }
.contact-actions .contact-call { color: #062117; border: 0; background: var(--green); font-weight: 900; }
.contact-star { position: absolute; top: 12px; right: 13px; color: var(--amber); font-size: 15px; }

.account-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.deployment-card { grid-column: 1 / -1; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.section-title h3 { margin: 0; font-size: 17px; }
.soft-badge, .version-badge { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.025); font-size: 9px; font-weight: 800; }
.health-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 14px; }
.health-grid dd[data-state="ok"] { color: #8ff0bf; }
.health-grid dd[data-state="error"] { color: #ffadb5; }
.health-actions { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-top: 15px; }
.requirement-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.requirement-list li { display: grid; grid-template-columns: 32px minmax(0,1fr); align-items: center; gap: 11px; padding: 12px; border: 1px solid rgba(137,185,222,.10); border-radius: 14px; background: rgba(255,255,255,.022); }
.requirement-list li > span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 11px; color: #032031; background: var(--cyan); font-size: 11px; font-weight: 900; }
.requirement-list div { display: grid; gap: 3px; }
.requirement-list small { color: var(--muted); line-height: 1.45; }

.primary-button, .secondary-button, .text-button { min-height: 42px; border-radius: 12px; cursor: pointer; font-weight: 850; }
.primary-button { padding: 0 16px; border: 0; color: #032033; background: linear-gradient(135deg, #65d7ff, #21adee); box-shadow: 0 11px 25px rgba(0,156,230,.20); }
.primary-button.compact { min-height: 38px; padding: 0 13px; font-size: 11px; }
.primary-button.full { width: 100%; margin-top: 17px; }
.secondary-button { padding: 0 13px; border: 1px solid var(--line); background: rgba(255,255,255,.035); }
.text-button { min-height: 36px; padding: 0 9px; border: 0; background: transparent; color: #bfefff; }
.danger-text { color: #ff9da6; }

.modal-backdrop { position: fixed; z-index: 200; inset: 0; display: grid; place-items: center; padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); background: rgba(0,5,10,.76); backdrop-filter: blur(13px); }
.modal { width: min(680px,100%); max-height: min(850px, calc(100dvh - 28px)); overflow: auto; padding: clamp(18px,3vw,26px); border: 1px solid rgba(137,185,222,.22); border-radius: 25px; background: linear-gradient(155deg, #0c2135, #06121f); box-shadow: 0 34px 100px rgba(0,0,0,.62); }
.small-modal { width: min(480px,100%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.modal-header h2 { margin: 5px 0 0; font-size: 24px; letter-spacing: -.04em; }
.setup-intro { display: grid; grid-template-columns: 49px minmax(0,1fr); align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px; border: 1px solid rgba(53,198,255,.20); border-radius: 15px; background: rgba(53,198,255,.055); }
.setup-icon { display: grid; width: 49px; height: 49px; place-items: center; border-radius: 14px; color: #032033; background: var(--cyan); font-size: 10px; font-weight: 950; }
.setup-intro p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.form-grid.one-column { grid-template-columns: 1fr; }
.form-grid label { min-width: 0; }
.form-grid label.wide { grid-column: 1 / -1; }
.form-grid label > span { display: block; margin-bottom: 7px; color: #adc1d1; font-size: 10px; font-weight: 850; }
.form-grid small { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.checkbox-row { display: flex; align-items: center; gap: 9px; margin-top: 14px; color: #b7c9d7; font-size: 11px; }
.checkbox-row input { width: 17px; min-height: 17px; accent-color: var(--cyan); }
.privacy-note { margin-top: 12px; padding: 10px 12px; border-left: 2px solid var(--green); color: var(--muted); background: rgba(37,212,134,.045); font-size: 10px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.install-steps { display: grid; gap: 10px; }
.install-step { display: grid; grid-template-columns: 32px minmax(0,1fr); align-items: center; gap: 10px; }
.install-step > span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; color: #032033; background: var(--cyan); font-weight: 900; }
.install-step p { margin: 0; color: #c6d8e5; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .47; } }
@keyframes scan { 0% { transform: translateX(-100%); } 38%,100% { transform: translateX(100%); } }

@media (max-width: 900px) {
    .app-shell { width: min(100%, 780px); padding-left: 12px; padding-right: 12px; padding-bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); }
    .app-frame { display: block; }
    .app-nav { position: fixed; z-index: 100; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); left: 10px; top: auto; display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; padding: 6px; border-radius: 22px; background: rgba(4,14,23,.94); box-shadow: 0 20px 55px rgba(0,0,0,.55); }
    .nav-item { min-height: 57px; border-radius: 16px; }
    .nav-item svg { width: 21px; height: 21px; }
    .dialer-layout { grid-template-columns: 1fr; }
    .dial-sidecard { position: static; display: none; }
    .dialer-card { max-width: 650px; margin: 0 auto; }
    .account-grid { grid-template-columns: 1fr; }
    .deployment-card { grid-column: auto; }
}

@media (max-width: 620px) {
    :root { --header-h: 64px; }
    .app-shell { padding-left: 8px; padding-right: 8px; }
    .app-header { min-height: 64px; padding: 8px 2px; }
    .brand { gap: 9px; }
    .brand-mark { width: 41px; height: 41px; flex-basis: 41px; border-radius: 13px; }
    .brand-mark svg { width: 22px; height: 22px; }
    .brand-copy strong { font-size: 16px; }
    .brand-copy span { max-width: 145px; font-size: 9px; }
    .header-status { gap: 5px; }
    .status-chip { min-height: 32px; padding: 0 9px; font-size: 9px; }
    .network-pill { display: none; }
    .header-icon { width: 35px; height: 35px; border-radius: 11px; }
    .dialer-card { padding: 11px; border-radius: 22px; }
    .phone-screen { min-height: 150px; padding: 13px; border-radius: 18px; }
    .call-state { margin-top: 15px; }
    .remote-identity { min-height: 36px; font-size: clamp(22px, 8.4vw, 32px); }
    .dialpad { gap: 6px; margin-top: 10px; }
    .dialpad button { min-height: clamp(55px, 8.5vh, 67px); border-radius: 17px; }
    .dialpad strong { font-size: 24px; }
    .number-row { grid-template-columns: minmax(0,1fr) 48px; gap: 7px; }
    #destination { min-height: 50px; font-size: 17px; }
    .favorite-strip { margin-top: 9px; }
    .primary-actions { margin-top: 10px; }
    .call-button, .hangup-button { min-height: 50px; min-width: 160px; }
    .notice { margin-top: 9px; }
    .page-heading { align-items: flex-start; }
    .page-heading h2 { font-size: 27px; }
    .page-heading p { max-width: 290px; }
    .contacts-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid label.wide { grid-column: auto; }
    .modal { padding: 17px; border-radius: 21px; }
    .modal-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .modal-actions .primary-button:only-child { grid-column: 1 / -1; }
    .system-banner { padding: 11px 12px; }
    .system-banner span { font-size: 10px; }
}

@media (max-height: 720px) and (max-width: 620px) {
    .dialpad button { min-height: 52px; }
    .phone-screen { min-height: 132px; }
    .call-state { margin-top: 10px; }
    .favorite-strip { display: none; }
}

@media (display-mode: standalone) {
    .app-shell { min-height: 100dvh; }
}

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