:root {
  color-scheme: dark;
  --bg: #061116;
  --surface: #0d1d24;
  --surface-2: #132831;
  --line: #24414b;
  --text: #eef8f7;
  --muted: #8da8ad;
  --accent: #8bf06a;
  --accent-dark: #102a19;
  --danger: #ff665f;
  --warning: #f8c35c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; background: radial-gradient(circle at top, #12313a 0, var(--bg) 35%); color: var(--text); }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(100%, 520px); min-height: 100dvh; margin: auto; background: color-mix(in srgb, var(--bg) 92%, transparent); border-inline: 1px solid rgba(255,255,255,.04); padding-bottom: 84px; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.brand { display: flex; gap: 11px; align-items: center; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--accent); color: #071309; font-weight: 900; font-size: 20px; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); margin-top: 2px; }
.icon-button, .text-button { border: 0; background: transparent; color: var(--accent); padding: 10px; }
main { padding: 0 18px; }
.identity-card { display: flex; justify-content: space-between; align-items: center; min-height: 62px; padding: 14px 16px; background: rgba(13,29,36,.88); border: 1px solid var(--line); border-radius: 18px; color: var(--muted); font-size: 13px; }
.identity-card strong { color: var(--text); font-size: 14px; }
.status-dot { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 4px rgba(248,195,92,.1); }
.status-dot.online { background: var(--accent); box-shadow: 0 0 0 4px rgba(139,240,106,.1); }
.status-dot.error { background: var(--danger); box-shadow: 0 0 0 4px rgba(255,102,95,.1); }
.view { display: none; padding: 26px 2px 10px; }
.view.active { display: block; animation: enter .2s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } }
.call-panel { text-align: center; }
.eyebrow { margin: 4px 0 8px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.dial-display { width: 100%; border: 0; background: transparent; color: var(--text); text-align: center; font-size: clamp(34px, 11vw, 52px); letter-spacing: .04em; outline: none; }
.call-timer { height: 22px; margin: 4px 0 20px; color: var(--muted); }
.dialpad { display: grid; grid-template-columns: repeat(3, 74px); justify-content: center; gap: 12px 20px; }
.dial-key { width: 74px; height: 64px; border: 1px solid var(--line); border-radius: 21px; background: var(--surface); color: var(--text); font-size: 24px; font-weight: 650; transition: transform .1s, background .1s; }
.dial-key:active { transform: scale(.94); background: var(--surface-2); }
.dial-key small { display: block; color: var(--muted); font-size: 8px; letter-spacing: .12em; min-height: 10px; }
.call-actions { display: flex; justify-content: center; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.round-action { min-width: 72px; height: 48px; padding: 0 17px; border: 0; border-radius: 24px; color: #071309; background: var(--accent); font-weight: 800; }
.round-action.secondary { background: var(--surface-2); color: var(--text); }
.round-action.hangup { background: var(--danger); color: white; }
.round-action.answer { background: var(--accent); animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(139,240,106,0); } }
.hidden { display: none !important; }
h1 { font-size: 25px; margin: 0 0 6px; }
.section-copy { color: var(--muted); margin: 0 0 20px; line-height: 1.5; }
.service-list { display: grid; gap: 10px; }
.service-card { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); text-align: left; }
.service-card > span { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; background: var(--accent-dark); color: var(--accent); font-weight: 800; }
.service-card strong, .service-card small { display: block; }
.service-card small { margin-top: 4px; color: var(--muted); }
.drop-zone { display: grid; justify-items: center; gap: 7px; padding: 25px 14px; border: 1px dashed #42636d; border-radius: 18px; background: rgba(13,29,36,.62); text-align: center; }
.drop-zone.dragging { border-color: var(--accent); background: var(--accent-dark); }
.drop-zone span { color: var(--muted); font-size: 13px; }
.settings-form { display: grid; gap: 13px; margin-top: 22px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
input { min-height: 47px; width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; outline: none; background: var(--surface); color: var(--text); }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,240,106,.1); }
.form-actions, .dialog-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 6px; }
.primary-button, .secondary-button { min-height: 44px; padding: 10px 15px; border-radius: 12px; border: 1px solid var(--accent); font-weight: 800; }
.primary-button { background: var(--accent); color: #071309; }
.secondary-button { background: transparent; color: var(--text); border-color: var(--line); }
.bottom-nav { position: fixed; bottom: 0; left: 50%; z-index: 5; width: min(100%, 520px); min-height: 70px; display: grid; grid-template-columns: repeat(3, 1fr); transform: translateX(-50%); padding: 8px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); background: rgba(6,17,22,.92); border-top: 1px solid var(--line); backdrop-filter: blur(18px); }
.nav-item { border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; }
.nav-item.active { color: var(--accent); background: var(--accent-dark); }
dialog { width: min(calc(100% - 28px), 430px); border: 1px solid var(--line); border-radius: 20px; padding: 0; background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
.dialog-card { display: grid; gap: 13px; padding: 22px; }
.dialog-card h2, .dialog-card p { margin: 0; }
.dialog-card > p:not(.eyebrow,.error-message) { color: var(--muted); line-height: 1.45; }
.error-message { min-height: 18px; color: var(--danger); font-size: 13px; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 90px; max-width: calc(100% - 30px); transform: translate(-50%, 20px); padding: 12px 16px; border-radius: 12px; opacity: 0; pointer-events: none; background: var(--text); color: #071116; font-weight: 750; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 370px) {
  .dialpad { grid-template-columns: repeat(3, 64px); gap: 9px 14px; }
  .dial-key { width: 64px; height: 56px; }
}
@media (min-width: 700px) {
  body { padding: 24px 0; }
  .app-shell { min-height: calc(100dvh - 48px); border-radius: 28px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
}
