:root, :root[data-theme="light"] {
  --bg: #f2f2f7; --surface: #ffffff; --surface2: #e9e9eb; --text: #000; --muted: #8e8e93; --border: #d1d1d6;
  --accent: #007aff; --danger: #ff3b30; --ok: #34c759; --out: #007aff; --out-text: #fff; --in: #e9e9eb; --in-text: #000;
  --chat-bg: #ffffff; --overlay: rgba(0,0,0,.4);
}
:root[data-theme="dark"] {
  --bg: #000; --surface: #1c1c1e; --surface2: #2c2c2e; --text: #fff; --muted: #8e8e93; --border: #38383a;
  --accent: #0a84ff; --danger: #ff453a; --ok: #30d158; --out: #0a84ff; --out-text: #fff; --in: #262628; --in-text: #fff;
  --chat-bg: #000; --overlay: rgba(0,0,0,.6);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 17px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none; }
#app { height: 100dvh; display: flex; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: var(--text); }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 14px; }
.err { color: var(--danger); font-size: 15px; min-height: 20px; }

/* формы входа */
.auth { margin: auto; width: 100%; max-width: 360px; padding: 24px 16px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.auth h1 { font-size: 28px; margin: 8px 0; }
.auth img { width: 80px; margin: 0 auto; }
.field { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); outline: none; }
.field:focus { border-color: var(--accent); }
.btn { padding: 14px 16px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 600; }
.btn:disabled { opacity: .5; }
.btn.sec { background: var(--surface2); color: var(--text); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 8px 12px; font-size: 15px; border-radius: 10px; }

/* раскладка */
.sidebar { width: 100%; display: flex; flex-direction: column; background: var(--surface); }
.main { flex: 1; display: none; flex-direction: column; background: var(--chat-bg); min-width: 0; }
.app.open .sidebar { display: none; }
.app.open .main { display: flex; }
@media (min-width: 768px) {
  .sidebar { width: 340px; border-right: 1px solid var(--border); display: flex !important; }
  .main { display: flex; }
  .back { display: none !important; }
}
.app { display: flex; width: 100%; height: 100%; }
.bar { display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; min-height: 52px;
  border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(20px); }
.bar h2 { flex: 1; margin: 0; font-size: 17px; font-weight: 600; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .big { font-size: 28px; font-weight: 700; text-align: left; }
.icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--accent); font-size: 20px; flex: none; }
.icon:active { background: var(--surface2); }
.icon svg { width: 24px; height: 24px; }

.list { flex: 1; overflow-y: auto; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; width: 100%; text-align: left; }
.row:active, .row.active { background: var(--surface2); }
.row .t { flex: 1; min-width: 0; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: -10px; }
.row .n { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.row .p { color: var(--muted); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { background: var(--accent); color: #fff; border-radius: 10px; min-width: 20px; padding: 0 6px; font-size: 13px; text-align: center; line-height: 20px; }
.av { width: 48px; height: 48px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 19px; position: relative; }
.av.sm { width: 32px; height: 32px; font-size: 14px; }
.av.on::after { content: ""; position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); border: 2px solid var(--surface); }

/* сообщения */
.msgs { flex: 1; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.day { align-self: center; color: var(--muted); font-size: 12px; margin: 10px 0 4px; font-weight: 600; }
.m { display: flex; flex-direction: column; max-width: 78%; align-self: flex-start; margin-top: 6px; user-select: none; -webkit-user-select: none; }
.m.me { align-self: flex-end; align-items: flex-end; }
.m.cont { margin-top: 0; }
.m .who { font-size: 12px; color: var(--muted); margin: 0 12px 2px; }
.bub { background: var(--in); color: var(--in-text); padding: 7px 12px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; position: relative; }
.me .bub { background: var(--out); color: var(--out-text); }
.bub.emoji { background: none !important; font-size: 44px; line-height: 1.1; padding: 0 2px; }
.bub.media { padding: 3px; overflow: hidden; }
.bub.media img, .bub.media video { display: block; max-width: min(280px, 70vw); max-height: 360px; border-radius: 15px; }
.bub .time { font-size: 11px; opacity: .6; margin-left: 8px; float: right; margin-top: 6px; }
.bub.deleted { font-style: italic; opacity: .6; }
.call-msg { align-self: center; color: var(--muted); font-size: 13px; margin: 8px 0; background: var(--surface2); padding: 4px 12px; border-radius: 12px; }
.quote { border-left: 3px solid currentColor; padding: 2px 8px; margin-bottom: 4px; font-size: 14px; opacity: .85; border-radius: 2px; }
.quote b { display: block; font-size: 13px; }
.file { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.file .ic { width: 40px; height: 40px; border-radius: 10px; background: rgba(127,127,127,.25); display: grid; place-items: center; font-size: 20px; }
.voice { display: flex; align-items: center; gap: 8px; min-width: 200px; }
.voice audio { height: 36px; max-width: 240px; }
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 4px 0; }
.chip { background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; padding: 1px 8px; font-size: 15px; }
.chip.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.read { font-size: 11px; color: var(--muted); margin: 1px 6px 0; }
.typing { color: var(--muted); font-size: 13px; padding: 0 16px 4px; min-height: 18px; }

/* поле ввода */
.composer { padding: 6px 8px calc(env(safe-area-inset-bottom) + 6px); border-top: 1px solid var(--border); background: var(--surface); }
.composer .row2 { display: flex; align-items: flex-end; gap: 6px; }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--border); border-radius: 20px; padding: 8px 14px; max-height: 140px;
  background: var(--chat-bg); outline: none; line-height: 1.3; }
.send { background: var(--accent); color: #fff; }
.reply-bar { display: flex; align-items: center; gap: 8px; padding: 4px 8px 6px; font-size: 14px; }
.reply-bar div { flex: 1; border-left: 3px solid var(--accent); padding-left: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rec { color: var(--danger); flex: 1; padding: 8px; font-variant-numeric: tabular-nums; }

/* всплывашки */
.sheet-bg { position: fixed; inset: 0; background: var(--overlay); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 480px; border-radius: 14px 14px 0 0; padding: 12px 12px calc(env(safe-area-inset-bottom) + 12px);
  max-height: 85dvh; overflow-y: auto; animation: up .2s ease-out; }
@media (min-width: 768px) { .sheet-bg { align-items: center; } .sheet { border-radius: 14px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h3 { margin: 4px 4px 12px; font-size: 17px; text-align: center; }
.menu button { display: block; width: 100%; text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--border); }
.menu button:last-child { border: 0; }
.menu .danger { color: var(--danger); }
.quick { display: flex; justify-content: space-between; background: var(--surface2); border-radius: 26px; padding: 6px 10px; margin-bottom: 10px; }
.quick button { font-size: 30px; width: 44px; height: 44px; border-radius: 50%; }
.quick button:active { background: var(--border); transform: scale(1.2); }
em-emoji-picker { width: 100%; height: 380px; --rgb-background: transparent; }

.viewer { position: fixed; inset: 0; background: #000; z-index: 60; display: flex; align-items: center; justify-content: center; }
.viewer img, .viewer video { max-width: 100%; max-height: 100%; touch-action: pinch-zoom; }
.viewer .tools { position: absolute; top: calc(env(safe-area-inset-top) + 8px); right: 8px; display: flex; gap: 8px; }
.viewer .tools a, .viewer .tools button { color: #fff; background: rgba(255,255,255,.15); border-radius: 18px; padding: 8px 14px; text-decoration: none; }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 90px); transform: translateX(-50%); background: var(--surface2);
  color: var(--text); padding: 10px 16px; border-radius: 12px; z-index: 80; box-shadow: 0 4px 20px rgba(0,0,0,.25); max-width: 90vw; }
.empty { margin: auto; color: var(--muted); text-align: center; padding: 24px; }

/* звонок */
.call { position: fixed; inset: 0; z-index: 70; background: #111; color: #fff; display: flex; flex-direction: column; }
.call .grid { flex: 1; display: grid; gap: 4px; padding: calc(env(safe-area-inset-top) + 4px) 4px 4px; }
.call .grid.n2 { grid-template-rows: 1fr 1fr; }
.call .grid.n3, .call .grid.n4 { grid-template: 1fr 1fr / 1fr 1fr; }
@media (orientation: landscape) { .call .grid.n2 { grid-template: 1fr / 1fr 1fr; } }
.tile { position: relative; background: #222; border-radius: 12px; overflow: hidden; display: grid; place-items: center; min-height: 0; }
.tile video { width: 100%; height: 100%; object-fit: cover; }
.tile.self video { transform: scaleX(-1); }
.tile.self.back video { transform: none; }
.tile .nm { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.5); padding: 2px 8px; border-radius: 8px; font-size: 14px; }
.tile .av { width: 88px; height: 88px; font-size: 36px; }
.call .ctl { display: flex; justify-content: center; gap: 18px; padding: 16px 16px calc(env(safe-area-inset-bottom) + 20px); }
.call .ctl button { width: 60px; height: 60px; border-radius: 50%; background: rgba(255,255,255,.18); font-size: 24px; display: grid; place-items: center; }
.call .ctl button.off { background: #fff; color: #000; }
.call .ctl .end { background: #ff3b30; }
.call .ctl .ok { background: #34c759; }
.call .status { text-align: center; padding: 8px; opacity: .8; }
.ring { justify-content: center; align-items: center; gap: 12px; }
.ring .av { width: 120px; height: 120px; font-size: 48px; }
.ring h2 { margin: 8px 0 0; font-size: 28px; }
.help { text-align: left; font-size: 15px; }
.help ol { padding-left: 20px; }
select.field { appearance: none; }
.admin { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.card { background: var(--surface); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.card .line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card .line > span { flex: 1; min-width: 120px; }
.link { word-break: break-all; font-size: 14px; background: var(--surface2); padding: 8px; border-radius: 8px; }
.seg { display: flex; background: var(--surface2); border-radius: 9px; padding: 2px; }
.seg button { flex: 1; padding: 7px; border-radius: 7px; font-size: 15px; }
.seg button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.15); }

/* ===== Magickgram: фирменный слой ===== */
:root, :root[data-theme="light"] { --brand1: #5b8cff; --brand2: #a463ff; --brand3: #ff6fae;
  --out: linear-gradient(135deg, #4f8bff 0%, #7a6bff 100%); --chat-bg: #f7f7fb; }
:root[data-theme="dark"] { --out: linear-gradient(135deg, #3d7bff 0%, #7356ff 100%); --chat-bg: #0b0b0f; }
.main { background:
  radial-gradient(1200px 600px at 100% 0%, color-mix(in srgb, var(--brand2) 8%, transparent), transparent 60%),
  radial-gradient(900px 500px at 0% 100%, color-mix(in srgb, var(--brand1) 8%, transparent), transparent 60%), var(--chat-bg); }

/* вход */
.auth { min-height: 100dvh; justify-content: center; }
#app:has(.auth) { background: radial-gradient(800px 500px at 20% 0%, color-mix(in srgb, var(--brand1) 30%, transparent), transparent 70%),
  radial-gradient(700px 500px at 100% 100%, color-mix(in srgb, var(--brand3) 25%, transparent), transparent 70%), var(--bg); }
.auth .logo { width: 96px; height: 96px; border-radius: 24px; box-shadow: 0 12px 40px color-mix(in srgb, var(--brand2) 45%, transparent); animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
.auth h1 { font-size: 34px; font-weight: 800; letter-spacing: -.02em;
  background: linear-gradient(90deg, var(--brand1), var(--brand2), var(--brand3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth .field { background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(10px); }
.btn { background: linear-gradient(135deg, var(--brand1), var(--brand2)); box-shadow: 0 6px 20px color-mix(in srgb, var(--brand2) 30%, transparent); transition: transform .1s; }
.btn:active { transform: scale(.97); }
.btn.sec { box-shadow: none; } .btn.danger { background: var(--danger); box-shadow: none; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* пузыри с «хвостиком», как в iMessage */
.bub { box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.me .bub:not(.emoji):not(.media) { background: var(--out); }
.m:not(.cont) .bub:not(.emoji):not(.media)::before { content: ""; position: absolute; bottom: 0; width: 14px; height: 18px; }
.m:not(.me):not(.cont) .bub:not(.emoji):not(.media)::before { left: -5px; background: var(--in); border-bottom-right-radius: 14px 12px; clip-path: inset(0 0 0 0); }
.m.me:not(.cont) .bub:not(.emoji):not(.media)::before { right: -5px; background: #7a6bff; border-bottom-left-radius: 14px 12px; }
:root[data-theme="dark"] .m.me:not(.cont) .bub:not(.emoji):not(.media)::before { background: #7356ff; }
.m:not(.cont) .bub:not(.emoji):not(.media)::after { content: ""; position: absolute; bottom: 0; width: 10px; height: 18px; background: var(--chat-bg); }
.m:not(.me):not(.cont) .bub:not(.emoji):not(.media)::after { left: -10px; border-bottom-right-radius: 10px; }
.m.me:not(.cont) .bub:not(.emoji):not(.media)::after { right: -10px; border-bottom-left-radius: 10px; }
.m:last-child { animation: msgIn .25s cubic-bezier(.2,1.2,.4,1); }
@keyframes msgIn { from { transform: translateY(8px) scale(.96); opacity: 0; } }
.bub.media img { background: var(--surface2); width: min(280px, 70vw); height: auto; object-fit: cover; }
.bub.emoji { animation: pop .35s cubic-bezier(.2,1.6,.4,1); }
.chip { transition: transform .15s; } .chip:active { transform: scale(1.15); }
.reacts { animation: pop .25s ease-out; }

/* списки и шапки */
.sidebar .bar { border-bottom: 0; }
.row { transition: background .15s; border-radius: 0; }
.av { box-shadow: inset 0 -8px 16px rgba(0,0,0,.12); }
.live { color: var(--ok); font-size: 13px; font-weight: 600; }
.call-banner { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; color: #fff; font-size: 15px; text-align: left;
  background: linear-gradient(90deg, #22c55e, #16a34a); }
.call-banner b { margin-left: auto; background: rgba(255,255,255,.22); padding: 4px 12px; border-radius: 14px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.7); } 100% { box-shadow: 0 0 0 10px rgba(255,255,255,0); } }
.composer { background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(20px); }
.send { background: linear-gradient(135deg, var(--brand1), var(--brand2)); }
.empty { font-size: 15px; }

/* экран звонка */
.call { background: radial-gradient(900px 600px at 50% 0%, #2b2f6b, transparent 70%), radial-gradient(800px 600px at 50% 100%, #4a1d5c, transparent 70%), #0b0b12; }
.call .ctl button { backdrop-filter: blur(16px); transition: transform .1s, background .2s; }
.call .ctl button:active { transform: scale(.92); }
.tile { background: rgba(255,255,255,.06); }
.ring .av { animation: ringPulse 1.6s infinite; }
@keyframes ringPulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.35); } 100% { box-shadow: 0 0 0 36px rgba(255,255,255,0); } }
.sheet { box-shadow: 0 -10px 40px rgba(0,0,0,.25); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===== экран звонка v2: собеседник крупно, я — в окошке ===== */
.call { overflow: hidden; touch-action: none; }
.call .stage { position: absolute; inset: 0; display: grid; gap: 3px; background: #000; }
.call .stage.n2 { grid-template-rows: 1fr 1fr; }
.call .stage.n3, .call .stage.n4 { grid-template: 1fr 1fr / 1fr 1fr; }
.call .stage.n3 .tile:first-child { grid-column: 1 / -1; }
@media (orientation: landscape) { .call .stage.n2 { grid-template: 1fr / 1fr 1fr; } .call .stage.n3 { grid-template: 1fr 1fr / 1fr 1fr; } }
.call .tile { border-radius: 0; background: radial-gradient(120% 80% at 50% 30%, #2d3170 0%, #1a1440 55%, #0b0b12 100%); min-height: 0; }
.call .stage.n1 .tile { background: radial-gradient(120% 80% at 50% 25%, #3a3f8f 0%, #24185a 50%, #0b0b12 100%); }
.call .tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (orientation: landscape) { .call .stage.n1 .tile video { object-fit: contain; background: #000; } }
.call .tile .nm { left: 12px; bottom: auto; top: calc(env(safe-area-inset-top) + 70px); backdrop-filter: blur(10px); }
.call .stage.n2 .tile + .tile .nm, .call .stage.n4 .tile:nth-child(n+3) .nm { top: 12px; }
.who-big { display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 1; }
.who-big .av { width: 112px; height: 112px; font-size: 44px; box-shadow: 0 0 0 8px rgba(255,255,255,.06), 0 0 0 18px rgba(255,255,255,.03); }
.stage.n3 .who-big .av, .stage.n4 .who-big .av, .stage.n2 .who-big .av { width: 80px; height: 80px; font-size: 32px; }
.who-big .nm2 { font-size: 24px; font-weight: 600; }
.who-big .st { opacity: .65; font-size: 15px; }
.call .waiting { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(120% 80% at 50% 25%, #3a3f8f 0%, #24185a 50%, #0b0b12 100%); }
.call .waiting video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); filter: blur(18px) brightness(.55); }
.call .waiting .who-big .av { animation: ringPulse 1.6s infinite; }

.pip { position: absolute; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 120px); width: 112px; aspect-ratio: 3 / 4; border-radius: 16px;
  overflow: hidden; z-index: 3; box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.15); background: #222; touch-action: none;
  cursor: grab; transition: left .25s, right .25s, top .25s, bottom .25s; display: grid; place-items: center; }
@media (min-width: 768px) { .pip { width: 220px; aspect-ratio: 16 / 10; } }
.pip video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); pointer-events: none; }
.pip.back video { transform: none; }
.pip.novid { background: linear-gradient(135deg, #2b2f6b, #4a1d5c); }

.call .top { position: absolute; left: 0; right: 0; top: 0; z-index: 4; display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 24px; background: linear-gradient(rgba(0,0,0,.55), transparent); }
.call .top .ttl { flex: 1; text-align: center; display: flex; flex-direction: column; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.call .top .ttl b { font-size: 18px; } .call .top .ttl .dur { font-size: 14px; opacity: .8; font-variant-numeric: tabular-nums; }
.call .round { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.16); backdrop-filter: blur(16px); display: grid; place-items: center; color: #fff; }
.call .round svg { width: 22px; height: 22px; }
.call .ctl { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; gap: 14px; align-items: flex-start;
  padding: 28px 12px calc(env(safe-area-inset-bottom) + 18px); background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.call .ctl button { width: auto; height: auto; background: none; border-radius: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; color: #fff; }
.call .ctl .ic { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); backdrop-filter: blur(18px); transition: background .2s, transform .1s; }
.call .ctl .ic svg { width: 26px; height: 26px; }
.call .ctl button:active .ic { transform: scale(.92); }
.call .ctl .off .ic { background: #fff; color: #111; }
.call .ctl .end .ic { background: #ff3b30; }
.call .ctl .end svg { width: 30px; height: 30px; }
.call .ctl .lb { font-size: 11px; opacity: .85; }
@media (max-width: 360px) { .call .ctl { gap: 8px; } .call .ctl .ic { width: 52px; height: 52px; } }

/* свёрнутый звонок — плашка поверх чата */
.call.mini { inset: auto 12px calc(env(safe-area-inset-bottom) + 76px) auto; width: 150px; height: 200px; border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,.45); cursor: pointer; }
.call.mini .top, .call.mini .ctl, .call.mini .pip, .call.mini .tile .nm { display: none; }
.call.mini .who-big .av { width: 56px; height: 56px; font-size: 22px; box-shadow: none; } .call.mini .who-big .nm2 { font-size: 15px; } .call.mini .who-big .st { display: none; }

/* входящий */
.ring { background: radial-gradient(120% 80% at 50% 25%, #3a3f8f 0%, #24185a 50%, #0b0b12 100%); }
.ring .ctl { position: absolute; bottom: calc(env(safe-area-inset-bottom) + 40px); left: 0; right: 0; gap: 56px; }
.ring .ctl button { width: 72px; height: 72px; font-size: 28px; }
.call .ctl .end, .call .ctl .off { background: none; color: #fff; }
.ring .ctl button { display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.18); backdrop-filter: blur(18px); }
.ring .ctl button.end { background: #ff3b30; } .ring .ctl button.ok { background: #34c759; }
/* окна выбора и подсказки — поверх экрана звонка */
.sheet-bg { z-index: 90; } .toast { z-index: 95; }
/* окошко с собой: видео заполняет всю рамку */
.pip { display: block; }
.pip video { position: absolute; inset: 0; width: 100% !important; height: 100% !important; object-fit: cover; }
.pip.novid { display: grid; place-items: center; }
