#chat-call-start,#chat-video-start { width:40px;min-width:40px;height:40px;padding:8px;flex:0 0 40px;color:var(--theme-text,#edf0f5); }
#chat-call-start svg,#chat-video-start svg { width:22px;height:22px; }
.conversation-header > .conversation-menu-wrap { display:flex;flex:0 0 auto;align-items:center;gap:6px; }
#chat-call-start:disabled,#chat-video-start:disabled { opacity:.35; }
.call-panel { position:fixed;z-index:90;right:24px;bottom:calc(100px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:14px;width:min(430px,calc(100vw - 32px));height:min(650px,calc(100dvh - 128px));box-sizing:border-box;isolation:isolate;overflow:auto;padding:22px;border:1px solid #8793a466;border-radius:28px;color:#f3f5f8;background:#242a32;box-shadow:0 20px 65px #0008,inset 0 1px #dce6f422;text-align:center;font:15px/1.45 system-ui,sans-serif; }
.call-panel[hidden],.call-panel [hidden],.call-bar[hidden] { display:none!important; }
.call-backdrop { position:absolute;inset:0;overflow:hidden;z-index:-1;pointer-events:none;background:radial-gradient(ellipse at 50% 18%,#b9c6da44,transparent 65%),#20262f; }
.call-backdrop img { width:100%;height:100%;object-fit:cover;filter:blur(20px) saturate(.6);transform:scale(1.15);opacity:.47; }
.call-backdrop::after { content:"";position:absolute;inset:0;background:linear-gradient(135deg,#20263066,#171d2480); }
.call-panel > header { display:flex;flex:0 0 auto;align-items:center;justify-content:space-between;gap:12px;color:#d4dae4;text-align:left;font-size:16px; }
.call-panel > header button { width:36px;height:36px;min-height:36px;padding:0;font-size:26px;border:0;background:transparent;color:inherit;border-radius:10px; }
.call-panel .call-center { display:flex;flex:1 1 0;flex-direction:column;align-items:center;justify-content:safe center;min-height:0;gap:10px;overflow:auto; }
.call-peer-card { box-sizing:border-box;width:min(280px,100%);padding:22px 24px 24px;border:1px solid #d5deef40;border-radius:28px;background:linear-gradient(135deg,#ffffff19,#d0d9ef0a);box-shadow:inset 0 1px #ffffff0a; }
.call-panel .call-avatar { display:grid;place-items:center;width:128px;height:128px;margin:18px auto 14px;border-radius:30px;overflow:hidden;border:1px solid #ffffff50;background:#5361767a;box-shadow:0 9px 22px #0003;font-size:48px; }
.call-avatar img { width:100%;height:100%;object-fit:cover; }
.call-panel h2 { margin:0;color:inherit;font-size:30px;line-height:1.2;font-weight:750;overflow-wrap:anywhere; }
#call-peer-tag { margin:6px 0 0;color:#d1d6e1;font-size:18px;overflow-wrap:anywhere; }
#call-state { min-height:28px;margin:0;font-size:22px;font-weight:600;line-height:1.3; }
#call-quality { min-height:18px;margin:0;color:#d1d6e1;font-size:12px; }
#call-error { max-width:100%;margin:0;color:#ffd2da;font-size:13px;overflow-wrap:anywhere; }
.call-actions { display:flex;flex:0 0 auto;flex-wrap:wrap;justify-content:center;gap:12px;padding:13px;border:1px solid #b6c6dc44;border-radius:26px;background:linear-gradient(145deg,#c5d7f21a,#1d243655); }
.call-panel button { min-height:48px;cursor:pointer;font:inherit; }
.call-actions button,#call-play-audio { display:flex;align-items:center;justify-content:center;gap:9px;flex:1 1 0;min-width:0;padding:13px 10px;border:1px solid #b6c6dc3d;border-radius:20px;background:linear-gradient(145deg,#b0c2dd30,#63769312);color:#f3f5f8;font-size:14px;font-weight:600; }
.call-actions svg { width:23px;height:23px;flex:0 0 23px;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round; }
.call-actions button span { min-width:0; }
#call-mute { order:1; } #call-camera { order:2; } #call-hangup { order:3; } #call-camera-switch { order:4;flex-basis:100%; } #call-speaker { order:5;flex-basis:100%; }
.call-actions .call-danger { background:linear-gradient(140deg,#e13d60,#b6163e);border-color:#ff729259;color:white;box-shadow:inset 0 1px #ffbcc72b; }
.call-actions .call-accept,#call-play-audio { background:linear-gradient(140deg,#2a9e7a,#197356);border-color:#7fdfbd66;color:white; }
.call-actions button[aria-pressed="true"] { background:#d8e5f344;outline:2px solid #d8e5f3;outline-offset:-2px; }
.call-actions button:hover { filter:brightness(1.13); }
.call-panel :is(button,select,input):focus-visible,.call-bar:focus-visible { outline:2px solid #b9cbea;outline-offset:3px; }
.call-panel button:disabled { opacity:.5;cursor:wait; }
#call-audio-settings { flex:0 0 auto;margin:0;text-align:left;color:#d1d6e1;font-size:12px; }
#call-audio-settings summary { cursor:pointer;text-align:center; }
#call-audio-settings label { display:grid;gap:6px;margin:12px 0 0;color:inherit;font-size:13px; }
#call-audio-settings select { width:100%;min-width:0;padding:9px;border:1px solid #8793a455;border-radius:10px;background:#2b3342;color:#f3f5f8;font:inherit; }
.call-bar { position:fixed;z-index:89;bottom:calc(88px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);max-width:calc(100vw - 24px);padding:11px 20px;border:1px solid var(--theme-border,#514663);border-radius:24px;background:var(--theme-panel,#20242c);color:var(--theme-text,#edf0f5);box-shadow:0 4px 24px #0004;font:600 14px/1.4 system-ui;overflow-wrap:anywhere;cursor:pointer; }
.call-privacy-setting { display:grid;gap:10px;margin-top:18px;color:inherit;font-size:14px; }
.call-privacy-setting select { min-width:0;width:100%;padding:9px;border:1px solid var(--theme-border,#514663);border-radius:10px;background:var(--theme-surface,#2b303a);color:var(--theme-text,#edf0f5);font:inherit; }
html.pixel-night-mobile .call-panel { inset:0;width:100%;height:100dvh;max-height:none;padding:calc(16px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));border:0;border-radius:0; }
html.pixel-night-mobile .call-center { flex:1 1 0; }
@media(max-width:380px) { .call-panel .call-actions button { font-size:12px;gap:6px;padding:12px 8px; } .call-actions svg { width:20px;height:20px;flex-basis:20px; } }
@media(max-height:640px) { .call-panel { gap:10px;padding:16px; } .call-peer-card { padding:14px 18px; } .call-panel .call-avatar { width:88px;height:88px;border-radius:24px;margin:10px auto; } .call-panel h2 { font-size:25px; } #call-state { font-size:18px; } #call-peer-tag { font-size:16px; } .call-actions { padding:9px;gap:8px; } .call-actions button { padding:10px 8px; } }
@media(prefers-reduced-motion:no-preference) { .call-panel:not([hidden]) { animation:call-appear 180ms ease-out; } @keyframes call-appear { from { opacity:0;translate:0 8px; } to { opacity:1;translate:0; } } }

/* Video occupies the call surface; controls never reserve a strip below it. */
.call-panel.has-video { display:block;width:min(680px,calc(100vw - 32px));height:min(780px,calc(100dvh - 128px));padding:0;overflow:hidden; }
.has-video .call-center { position:absolute;inset:0;display:block;overflow:hidden; }
.has-video .call-video-stage { position:absolute;inset:0;width:100%;height:100%;min-height:0;max-height:none;aspect-ratio:auto;border:0;border-radius:inherit;overflow:hidden;background:#10141c; }
#call-remote-video,#call-local-video { position:absolute;object-fit:cover;background:#10141c;pointer-events:none; }
#call-remote-video { z-index:0; }
#call-local-video { z-index:2; }
.local-main #call-remote-video { z-index:2; }
.local-main #call-local-video { z-index:0; }
#call-remote-video,.local-main #call-local-video { inset:0;width:100%;height:100%;max-height:none;border:0;border-radius:0;box-shadow:none; }
#call-local-video,.local-main #call-remote-video,#call-video-swap { inset:auto 14px calc(130px + env(safe-area-inset-bottom)) auto;width:clamp(84px,24%,152px);height:auto;aspect-ratio:3/4;max-height:30%;border:1px solid #ffffff55;border-radius:16px;box-shadow:0 4px 24px #0006;transition:bottom 160ms ease; }
#call-local-video.mirrored { transform:scaleX(-1); }
.local-main #call-local-video { inset:0;width:100%;height:100%;aspect-ratio:auto;max-height:none;border:0;border-radius:0;box-shadow:none; }
#call-video-swap { position:absolute;z-index:3;min-height:0;padding:0;background:transparent;border-color:transparent;cursor:pointer;box-shadow:none; }
#call-surface-toggle { position:absolute;inset:0;z-index:1;width:100%;height:100%;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;cursor:pointer;touch-action:manipulation; }
#call-video-placeholder { position:absolute;inset:30%;display:grid;place-items:center;color:#becadd;font-size:14px;pointer-events:none; }
.call-panel > header { display:grid;grid-template-columns:1fr auto 1fr;gap:8px; }
.call-panel #call-minimize { display:flex;align-items:center;gap:3px;justify-self:start;width:auto;padding:0 4px;min-height:36px;font-size:14px; }
#call-minimize svg,#call-expand svg { width:23px;height:23px;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round; }
#call-expand { justify-self:end; }
#call-title { font-size:12px;opacity:.8; }
.has-video > header { position:absolute;inset:0 0 auto;z-index:4;padding:calc(12px + env(safe-area-inset-top)) 14px 26px;background:linear-gradient(#0009,transparent);color:white; }
.has-video .call-peer-card { position:absolute;inset:calc(72px + env(safe-area-inset-top)) 16px auto;display:flex;flex-direction:column;gap:5px;width:auto;padding:0;border:0;background:none;box-shadow:none;pointer-events:none;text-shadow:0 2px 12px #000b; }
.has-video .call-peer-card .call-avatar,.has-video #call-peer-tag { display:none; }
.has-video .call-peer-card h2 { order:0;margin:0;color:white;font-size:25px; }
.has-video #call-state { order:1;min-height:20px;margin:0;color:white;font-size:15px; }
.has-video #call-quality { position:absolute;inset:calc(133px + env(safe-area-inset-top)) 16px auto;pointer-events:none;text-shadow:0 1px 8px #000b; }
.has-video #call-error { position:absolute;inset:auto 16px calc(116px + env(safe-area-inset-bottom));z-index:4;max-height:90px;overflow:auto;padding:10px;border-radius:12px;background:#161b26e8; }
#call-controls { display:flex;flex-wrap:nowrap;align-items:start;gap:8px;padding:8px 0;border:0;border-radius:0;background:none; }
#call-controls button { display:flex;flex:1 1 0;flex-direction:column;align-items:center;justify-content:start;gap:7px;min-width:0;min-height:74px;margin:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;color:white;font-size:11px;line-height:1.2; }
#call-controls button svg { box-sizing:border-box;flex:none;width:clamp(44px,12vw,56px);height:clamp(44px,12vw,56px);padding:14px;border-radius:50%;background:#63636b99;stroke:currentColor;box-shadow:0 2px 12px #0002; }
#call-controls button span { max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center;font-size:clamp(10px,2.8vw,12px); }
#call-controls button[aria-pressed="true"] { outline:0;background:none; }
#call-controls button[aria-pressed="true"] svg { color:#30343c;background:#fff; }
#call-controls #call-hangup svg { background:#ff3b30;color:white; }
#call-controls #call-camera-switch { order:0;flex-basis:0; }
#call-controls #call-camera { order:1; }
#call-controls #call-mute { order:2; }
#call-controls #call-speaker { order:3;flex-basis:0; }
#call-controls #call-hangup { order:4; }
.has-video #call-controls { position:absolute;inset:auto 0 0;z-index:4;padding:26px 16px calc(20px + env(safe-area-inset-bottom));background:linear-gradient(transparent,#0009); }
.has-video #call-incoming { position:absolute;inset:auto 16px calc(20px + env(safe-area-inset-bottom));z-index:4; }
.has-video #call-play-audio { position:absolute;left:50%;top:50%;z-index:5;translate:-50% -50%; }
.has-video #call-audio-settings { position:absolute;top:calc(55px + env(safe-area-inset-top));right:14px;z-index:5;margin:0; }
.has-video #call-audio-settings summary { display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:#2c303b99;list-style:none;font-size:0; }
.has-video #call-audio-settings summary::after { content:"⋯";font-size:24px;line-height:1; }
.has-video #call-audio-settings summary::-webkit-details-marker { display:none; }
.has-video #call-audio-settings[open] { box-sizing:border-box;width:min(260px,calc(100% - 28px));max-height:calc(100% - 180px);overflow:auto;padding:14px;border:1px solid #ffffff33;border-radius:16px;background:#232a38f5; }
.has-video #call-audio-settings[open] summary { width:100%;font-size:13px;background:none; }
.has-video #call-audio-settings[open] summary::after { display:none; }
.has-video :is(header,.call-peer-card,#call-controls,#call-quality,#call-error,#call-audio-settings,#call-play-audio) { transition:opacity 160ms ease,visibility 160ms; }
.has-video.controls-hidden :is(header,.call-peer-card,#call-controls,#call-quality,#call-error,#call-audio-settings,#call-play-audio) { opacity:0;visibility:hidden;pointer-events:none; }
.has-video.controls-hidden #call-local-video,.has-video.controls-hidden.local-main #call-remote-video,.has-video.controls-hidden #call-video-swap { bottom:calc(18px + env(safe-area-inset-bottom)); }
.has-video.controls-hidden.local-main #call-local-video { bottom:0; }
.call-panel.call-expanded { inset:0;width:100%;height:100dvh;max-height:none;border:0;border-radius:0; }
html.pixel-night-mobile .call-panel.has-video { inset:0;width:100%;height:100dvh;max-height:none;padding:0;border:0;border-radius:0; }
html.pixel-night-mobile #call-expand { display:none; }
.call-panel.call-mobile { inset:0;width:100%;height:100dvh;max-height:none;border:0;border-radius:0;padding:calc(16px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left)); }
.call-panel.call-mobile.has-video { padding:0; }
.call-mobile #call-expand { display:none; }
@media(prefers-reduced-motion:reduce) { .has-video :is(header,.call-peer-card,#call-controls,#call-quality,#call-error,#call-audio-settings,#call-play-audio),#call-local-video,#call-remote-video,#call-video-swap { transition:none; } }
.call-camera-dialog { box-sizing:border-box;width:min(420px,calc(100vw - 24px));max-height:calc(100dvh - 32px);padding:24px;overflow:auto;border:1px solid var(--theme-border,#68758d);border-radius:24px;background:var(--theme-panel,#252b36);color:var(--theme-text,#edf0f5);box-shadow:0 20px 80px #0008;font:15px/1.45 system-ui,sans-serif; }
.call-camera-dialog::backdrop { background:#070c18aa; }
.call-camera-dialog form { display:grid;gap:12px; }
.call-camera-dialog h2 { margin:0 0 10px;font-size:23px;color:inherit; }
.call-camera-dialog p { margin:0;color:inherit; }
.call-camera-dialog #call-camera-error:empty { display:none; }
.call-camera-dialog label { display:block;margin-bottom:8px; }
.call-camera-dialog select { box-sizing:border-box;width:100%;padding:12px;border:1px solid var(--theme-border,#75819a);border-radius:12px;background:var(--theme-surface,#202633);color:inherit;font:inherit; }
.call-camera-dialog form>div { display:flex;flex-wrap:wrap;gap:10px;justify-content:flex-end; }
.call-camera-dialog button { min-height:44px;padding:10px 15px;border:1px solid var(--theme-border,#75819a);border-radius:12px;color:inherit;background:var(--theme-surface,#303a4b);cursor:pointer;font:inherit; }
.call-camera-dialog button[type="submit"] { background:#4b6cad;color:white; }
.call-camera-dialog button:disabled { opacity:.5;cursor:wait; }
#call-camera-error { color:var(--theme-danger,#e57394);font-size:14px; }




@media(max-width:380px) { #chat-call-start,#chat-video-start { width:34px;min-width:34px;height:36px;flex-basis:34px;padding:6px; } }
