:root{color-scheme:light;--bg:#f5f7fb;--panel:#fff;--text:#1e293b;--muted:#718096;--line:#e8edf4;--brand:#4f46e5;--tint:#eef2ff;--hover:#f1f5f9;--shadow:0 16px 50px #1e293b0b}*{box-sizing:border-box}html,body{height:100%;margin:0}body{font:14px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text);display:flex;flex-direction:column;height:100dvh}body.dark{color-scheme:dark;--bg:#0b1120;--panel:#131e30;--text:#e2e8f0;--muted:#94a3b8;--line:#253146;--tint:#25274b;--hover:#1d293c;--shadow:0 16px 50px #0002}[hidden]{display:none!important}button,input,textarea{font:inherit}button{cursor:pointer;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--text);padding:9px 13px;transition:background .15s}button:hover{background:var(--hover)}button:disabled{opacity:.45;cursor:default}button.primary{background:var(--brand);color:#fff;border-color:var(--brand)}button.primary:hover{background:#4338ca}button.danger{background:#dc3545;color:#fff;border:0}button.selected{background:var(--tint);color:var(--brand)}:focus-visible{outline:3px solid #818cf8;outline-offset:2px}input,textarea{border:1px solid var(--line);border-radius:10px;padding:11px 13px;background:var(--bg);color:var(--text);min-width:0}input:not([type=checkbox]):not([type=file]){width:100%}textarea{resize:vertical}small{color:var(--muted);font-size:12px}h1,h2,h3,p{margin-top:0}h1{font-size:30px;letter-spacing:-1px;line-height:1.15}h2{font-size:18px;letter-spacing:-.3px}h3{font-size:14px;margin-top:25px}.app-header{min-height:66px;display:flex;align-items:center;gap:20px;justify-content:space-between;padding:10px 24px;background:var(--panel);border-bottom:1px solid var(--line);flex-shrink:0}.brand{display:flex;gap:10px;align-items:center}.brand strong{font-size:15px;letter-spacing:-.3px}.brand strong span{color:var(--brand)}.brand small{display:block;font-size:10px}.brand-icon{font-size:25px;color:white;background:linear-gradient(35deg,#4f46e5,#9494ff);width:36px;height:36px;text-align:center;border-radius:12px}.mode{display:flex;padding:4px;background:var(--bg);border-radius:12px;gap:3px;margin-left:auto}.mode button{border:0;font-size:12px;background:transparent}.mode button.selected{background:var(--panel);box-shadow:0 1px 5px #0001;color:var(--brand)}#error:empty{display:none}#error,#offline,#update-bar{padding:9px 24px;background:var(--tint);color:var(--text);flex-shrink:0;max-height:90px;overflow:auto}#error{border-left:3px solid #e87957;cursor:pointer}.auth{display:grid;grid-template-columns:1fr 1fr;gap:60px;max-width:1050px;margin:auto;padding:50px 30px;width:100%;overflow:auto}.auth-intro{padding:35px 10px}.eyebrow{font-size:10px;letter-spacing:2px;color:var(--brand);font-weight:750}.auth h1{font-size:clamp(36px,4vw,54px);margin-top:24px;line-height:1.1}.auth p,.page p{color:var(--muted)}.auth-art{display:flex;margin-top:40px;gap:18px;align-items:center}.auth-art span{width:60px;height:60px;border-radius:23px;background:#dce3fb;color:#4f46e5;display:grid;place-items:center;font-size:24px;transform:rotate(-10deg)}.auth-art span:nth-child(2){width:80px;height:80px;background:var(--brand);color:white;transform:rotate(8deg)}.card{background:var(--panel);border:1px solid var(--line);padding:28px;border-radius:20px;box-shadow:var(--shadow);min-width:0}.card label{display:block;margin:18px 0 12px;font-size:12px;font-weight:600}.card label input{display:block;margin-top:7px}.card small{display:block;margin-top:16px}.card button{margin:4px 4px 4px 0}#auth-form{max-width:430px}#auth-form h2{font-size:26px;margin:16px 0 6px}#auth-form button{width:100%;margin-top:14px}#workspace{display:flex;flex:1;min-height:0}.sidebar{width:320px;flex-shrink:0;background:var(--panel);border-right:1px solid var(--line);display:flex;flex-direction:column}.profile{display:flex;align-items:center;gap:12px;padding:22px 20px}.profile small{display:block;font-size:11px}.profile button{margin-left:auto;font-size:21px;padding:2px 10px}.avatar{display:grid;place-items:center;width:40px;height:40px;border-radius:14px;background:var(--tint);color:var(--brand);font-size:17px;flex-shrink:0}.side-search{padding:0 18px}.side-search input{border:0;font-size:12px}.side-heading{display:flex;align-items:center;justify-content:space-between;padding:20px 20px 10px}.side-heading span{font-size:10px;color:var(--muted);letter-spacing:1.4px}.side-heading button{border:0;font-size:11px;color:var(--brand);padding:4px}#rooms{overflow:auto;padding:6px 10px;flex:1}#rooms button{display:flex;align-items:center;gap:12px;text-align:left;width:100%;border:0;border-radius:14px;padding:14px 10px;margin-bottom:4px}#rooms button .room-copy{min-width:0;flex:1}#rooms strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}#rooms small{display:block;font-size:11px;margin-top:3px}#rooms .badge{background:var(--brand);color:#fff;font-size:10px;min-width:20px;text-align:center;border-radius:8px;padding:2px 5px}.sidebar-footer{display:flex;align-items:center;justify-content:space-between;font-size:10px;color:var(--muted);padding:14px 18px;border-top:1px solid var(--line)}.sidebar-footer button{font-size:11px;padding:6px}#conversation{flex:1;min-width:0;display:flex;flex-direction:column}.toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.chat-header{background:var(--panel);border-bottom:1px solid var(--line);padding:16px 24px;flex-shrink:0}.chat-title{flex:1;min-width:0}.chat-title h2{font-size:16px;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-title small{font-size:11px}#back{display:none}.searchbar{padding:10px 24px;border-bottom:1px solid var(--line)}.searchbar input{width:200px!important;flex:1;max-width:320px;font-size:12px;padding:7px 10px}.searchbar button{font-size:11px;padding:7px 10px}#messages{flex:1;overflow:auto;padding:30px 32px;display:flex;flex-direction:column;gap:17px;min-height:0}.empty{margin:auto;text-align:center;color:var(--muted)}.empty>span{font-size:48px;color:#a5b4fc}.empty h2{color:var(--text);margin:16px 0 8px}.empty p{font-size:13px}.message{align-self:flex-start;max-width:min(80%,640px);padding:13px 16px;border-radius:4px 16px 16px 16px;background:var(--panel);border:1px solid var(--line);overflow-wrap:anywhere;box-shadow:0 2px 3px #00002}.message.own{align-self:flex-end;border-radius:16px 4px 16px 16px;background:var(--brand);color:white;border-color:transparent}.message small{display:block;font-size:10px}.message.own small{color:#d6dbff}.message p{white-space:pre-wrap;margin:6px 0 10px}.message button{font-size:10px;background:transparent;border:0;color:inherit;padding:3px 6px;opacity:.85}.message button:hover{background:#80808020;opacity:1}.message img{display:block;max-width:100%;max-height:300px;border-radius:9px;margin-top:10px}.quote{border-left:2px solid #a5b4fc;padding-left:8px;font-size:11px;margin-top:6px}#typing,#reply{padding:0 24px}#send{margin:0 24px 20px;background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:10px;box-shadow:var(--shadow)}#send textarea{width:100%;border:0;background:transparent;min-height:56px;max-height:180px;resize:none}#send .composer-actions{flex-wrap:nowrap;font-size:12px}#send button[type=submit]{margin-left:auto;white-space:nowrap}.attachment{position:relative;overflow:hidden;cursor:pointer;flex-shrink:0;padding:9px;border-radius:9px;background:var(--bg)}.attachment input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%}#file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:180px;font-size:10px;color:var(--muted)}.page{padding:36px;overflow:auto;flex:1}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:20px}.page h1{margin:10px 0}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin:24px 0}.stat{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:22px}.stat strong{display:block;font-size:28px;margin-top:8px}.admin-grid{display:grid;grid-template-columns:1.2fr 1fr;gap:24px;max-width:1200px}.person-row{display:flex;align-items:center;gap:12px;padding:13px 0;border-bottom:1px solid var(--line);flex-wrap:wrap}.person-row .person-info{flex:1;min-width:100px}.person-row small{margin:0}.person-row button{font-size:11px}#network-info code{display:block;overflow-wrap:anywhere;font-size:12px;margin:12px 0}dialog{background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:20px;padding:28px;width:min(460px,94vw);max-height:85dvh;box-shadow:0 24px 100px #0003}dialog::backdrop{background:#0f172a70;backdrop-filter:blur(4px)}dialog label{display:block;margin:12px 0}dialog label input:not([type=checkbox]){display:block;margin-top:6px}#user-picker{max-height:240px;overflow:auto;margin:20px 0}#call{position:fixed;bottom:16px;right:16px;width:min(660px,calc(100vw - 32px));max-height:75dvh;overflow:auto;background:var(--panel);padding:20px;border:1px solid var(--line);border-radius:20px;box-shadow:0 16px 70px #0004;z-index:5}#call h2{margin:0}#videos{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:15px 0}#videos video{width:100%;max-height:220px;border-radius:12px;background:#0b1120}#videos>div{min-width:0}#call button{font-size:11px}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-thumb{background:#94a3b850;border-radius:10px}@media(min-width:1500px){.sidebar{width:370px}}@media(max-width:760px){.app-header{padding:9px 12px;gap:8px;min-height:62px}.brand strong{font-size:12px}.brand small{font-size:9px}.brand-icon{width:30px;height:30px;font-size:21px}.mode{gap:0}.mode button{padding:7px;font-size:10px}#theme{padding:7px}.sidebar{width:100%;border:0}#conversation{display:none}body.chat-open .sidebar{display:none}body.chat-open #conversation{display:flex}#back{display:block}.chat-header{padding:12px;gap:7px}.chat-header>.avatar{display:none}.chat-header button{font-size:11px;padding:8px}.chat-title small{font-size:10px}.searchbar{padding:8px 12px;gap:5px}.searchbar input{width:100px!important}.searchbar button{font-size:10px}#messages{padding:20px 14px}.message{max-width:90%}#send{margin:0 10px max(10px,env(safe-area-inset-bottom))}.composer-actions{gap:4px}#record{font-size:10px;padding:8px 5px}#file-name{max-width:65px}.auth{display:block;padding:28px 18px;margin:0 auto}.auth-intro{padding:0}.auth-intro h1{font-size:32px;margin:12px 0}.auth-art{display:none}.auth-intro p{font-size:12px}#auth-form{max-width:none;margin-top:24px}.page{padding:22px 14px}.stats{grid-template-columns:repeat(2,1fr);gap:10px}.stat{padding:15px}.admin-grid{grid-template-columns:1fr;gap:15px}.card{padding:23px}.page-heading{align-items:flex-start}#call{bottom:max(10px,env(safe-area-inset-bottom));padding:14px}.app-header .brand-icon{display:none}}@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

select{font:inherit;background:var(--bg);color:var(--text);border:1px solid var(--line);border-radius:9px;padding:10px;width:100%;margin-top:6px}fieldset{border:1px solid var(--line);border-radius:12px;padding:15px;margin:18px 0}#storage-dialog{width:min(570px,94vw)}#storage-dialog p,#storage-dialog small{font-size:12px;color:var(--muted)}
.admin-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:24px 0}.admin-tabs button.selected{background:var(--brand);color:white}.setup-card{margin:20px 0}.setup-card h2{margin-top:12px}.setup-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.setup-grid button{text-align:left;padding:20px;background:var(--bg)}.setup-grid small{display:block;font-size:11px}.ice-row{padding:20px 0;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:20px;flex-wrap:wrap}.ice-copy{flex:1;min-width:200px}.ice-copy small,.ice-copy code{display:block;overflow-wrap:anywhere;font-size:12px}.ice-copy code{margin:7px 0}.ice-row button{font-size:12px}details{margin:20px 0}summary{cursor:pointer;font-weight:600;margin-bottom:12px}#ice-options label{display:block;margin:12px 0}#ice-dialog{width:min(570px,94vw)}#ice-dialog textarea{width:100%;margin-top:6px}#ice-dialog small,#ice-dialog p{color:var(--muted);font-size:12px}#ice-diagnostics{border-left:3px solid var(--brand);padding-left:14px;margin:15px 0}#ice-diagnostics:empty{display:none}.dialog-error{background:var(--tint);border-left:3px solid #e87957;padding:10px;margin:12px 0}#send-status{display:block;padding:2px 8px}#start-conversation{margin-top:18px}#share-dialog .toolbar{margin-top:18px}@media(max-width:760px){.setup-grid{grid-template-columns:1fr}.setup-grid button{padding:14px}.admin-tabs{gap:5px}.admin-tabs button{font-size:12px;padding:8px 10px}.chat-header #members{font-size:0;padding:8px}.chat-header #members:after{content:'Люди';font-size:11px}}
/* FamilyCall 1.4: familiar messenger layout, original FamilyCall identity. */
body.telegram-ui{--brand:#3390ec;--tint:#e9f3fc;--bg:#f4f4f5;--text:#18222d;--muted:#7d8b99;--line:#ebedef;font-size:14px}body.telegram-ui.dark{--brand:#6ab3f3;--tint:#22394e;--bg:#17212b;--panel:#17212b;--text:#eef5fb;--muted:#8b9baa;--line:#263441;--hover:#202e3c}body.telegram-ui .app-header{min-height:52px;padding:6px 18px}.brand-icon{background:var(--brand);border-radius:50%;box-shadow:none}.mode{background:transparent}.mode button{font-size:12px}.mode button.selected{box-shadow:none;background:var(--tint)}.sidebar{width:340px}.profile{padding:16px 18px}.profile .avatar{width:44px;height:44px}.profile small{font-size:12px}.profile button{border:0;background:transparent;color:var(--brand)}.side-search input{border-radius:24px!important;background:var(--bg);font-size:14px;padding:12px 17px!important}.side-heading{padding:13px 20px 5px}.side-heading span{letter-spacing:0;font-size:12px}.side-heading button{font-size:12px}#rooms{padding:5px 8px}#rooms button{padding:11px 10px;gap:12px;border-radius:10px;margin:0}#rooms button.selected{background:var(--brand);color:white}#rooms button.selected small,#rooms button.selected time{color:#e5f1ff}.avatar{border-radius:50%;background:var(--avatar-color,#68a4dc);color:#fff;width:49px;height:49px;font-size:21px}#rooms .room-copy{overflow:hidden}#rooms .room-top{display:flex;gap:10px;align-items:center}#rooms .room-top strong{flex:1;font-size:14px;font-weight:650}#rooms time{font-size:11px;color:var(--muted);flex-shrink:0}#rooms small{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#rooms .badge{border-radius:20px;min-width:22px;padding:2px 6px;background:#5bb978}#rooms button.selected .badge{background:#fff;color:var(--brand)}#conversation{background-color:#dbe7d5;background-image:radial-gradient(ellipse at 20% 20%,#eff3d8aa,transparent 55%),radial-gradient(ellipse at 90% 80%,#acd5b355,transparent 55%)}.dark #conversation{background:#0e1621}.chat-header{padding:9px 20px;min-height:62px;gap:12px}.chat-header .avatar{height:40px;width:40px;font-size:19px;background:#87bd97}.chat-title h2{font-size:15px}.chat-title small{font-size:12px}.chat-header button{border:0;color:var(--muted);background:transparent!important;padding:8px}.chat-header button:hover{color:var(--brand);background:var(--tint)!important}.svg-icon{display:inline-flex;width:23px;height:23px;align-items:center;justify-content:center;vertical-align:middle;flex-shrink:0}.svg-icon svg{width:100%;height:100%}.chat-header .icon-label,#new-room .icon-label,#send-button .icon-label,#record .icon-label,#record-circle .icon-label,#emoji-button .icon-label,#attach-poll .icon-label,#attach-geo .icon-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.searchbar{background:var(--panel)}#messages{padding:22px max(24px,calc((100% - 760px)/2));gap:7px}.message{padding:9px 28px 6px 12px;max-width:80%;border:0;border-radius:12px 12px 12px 3px;box-shadow:0 1px 2px #00000013;position:relative;min-width:100px;color:#18222d}.message.own{background:#eeffde;color:#18222d;border-radius:12px 12px 3px 12px}.dark .message{background:#182533;color:#eef5fb}.dark .message.own{background:#2b5278;color:#fff}.message p{font-size:14px;line-height:1.45;margin:2px 0 4px}.message .sender-name{font-size:12px;font-weight:650;color:#3c8baf;margin-bottom:3px}.message .message-time{font-size:10px;color:#77906a;text-align:right;line-height:1.3;margin-top:3px}.dark .message .message-time{color:#a4c3df}.message button{opacity:1}.message .file-card{display:block;background:#3390ec13;padding:12px;border-radius:10px;font-size:12px;text-align:left;max-width:100%;overflow-wrap:anywhere;margin:5px 0}.message audio{max-width:100%;width:280px;height:38px;margin:8px 0}.date-divider{align-self:center;border-radius:20px;padding:3px 12px;font-size:11px;background:#7d947e90;color:#fff;margin:10px 0}.message-actions{position:absolute;right:3px;top:3px;margin:0;z-index:1}.message-actions[open]{z-index:4}.message-actions summary{list-style:none;cursor:pointer;line-height:20px;font-size:18px;padding:0 4px;color:#829181;margin:0}.message-actions summary::-webkit-details-marker{display:none}.action-list{position:absolute;right:0;top:25px;width:200px;padding:7px;border-radius:12px;background:var(--panel);color:var(--text);box-shadow:0 7px 30px #0003;display:grid;gap:2px}.message .action-list>button{text-align:left;font-size:13px;padding:9px;border-radius:6px}.message .action-list button:hover{background:var(--tint)}.reaction-picker{display:flex;gap:0;justify-content:space-between}.message .reaction-picker button{font-size:17px;padding:4px}.quote{background:#3390ec10;padding:7px 9px;border-left:3px solid #3390ec;border-radius:4px;color:var(--muted);margin-bottom:6px}#send{position:relative;display:flex;align-items:center;gap:8px;padding:9px 12px;margin:0 max(18px,calc((100% - 760px)/2)) 16px;border:0;border-radius:14px;flex-wrap:wrap;box-shadow:0 1px 4px #0001}#text{order:1;flex:1;min-width:100px;width:auto!important;min-height:42px!important;max-height:150px;padding:10px 5px!important;resize:none}#send .composer-actions{display:contents}#send .attachment{order:0;background:transparent;padding:6px;font-size:22px;width:32px}#emoji-button{order:2;border:0;padding:6px;color:var(--muted);background:transparent}#record{order:3;border:0;padding:7px;color:var(--muted);background:transparent}#send-button{order:4;border-radius:50%;background:var(--brand);color:#fff;border:0;width:43px;height:43px;padding:10px;margin:0!important}#file-name{order:5;max-width:calc(100% - 60px);font-size:12px}#remove-file{order:6;border:0;padding:2px 8px;color:var(--muted)}#send-status{order:7;flex-basis:100%;font-size:11px;padding:0}#send-status:empty{display:none}#emoji-picker{position:absolute;right:0;bottom:100%;background:var(--panel);padding:8px;border-radius:12px;box-shadow:0 5px 25px #0002;z-index:5}#emoji-picker button{border:0;font-size:23px;padding:5px}#voice-panel,#upload-panel{margin:0 max(18px,calc((100% - 760px)/2)) 8px;padding:12px 15px;background:var(--panel);border-radius:12px;flex-shrink:0}#voice-panel{border-left:3px solid #e45664}.voice-line{display:flex;gap:9px;align-items:center;flex-wrap:wrap}#voice-label{flex:1;font-size:12px}#voice-time{font-variant-numeric:tabular-nums}.record-dot{width:9px;height:9px;border-radius:50%;background:#e45664}#voice-panel[data-state=recording] .record-dot{animation:recording-pulse 1s infinite}#voice-panel[data-state=ready] .record-dot{background:#56ae74}#voice-preview{width:100%;height:36px;margin-top:10px}#voice-stop,#voice-cancel{font-size:12px;padding:5px 9px;border:0}#upload-label{display:block;font-size:12px;color:var(--muted);overflow-wrap:anywhere}#upload-progress{display:block;width:100%;height:7px;margin-top:8px;accent-color:var(--brand)}#upload-panel[data-state=error]{border-left:3px solid #e45664}#call{background:#182431;color:#f5f9fc;width:min(740px,calc(100vw - 32px));border:1px solid #354656;padding:20px;box-shadow:0 16px 80px #0006}#call small{color:#a8bbca}#call h2{font-size:16px}#videos{gap:12px}#videos .tile{background:#233444;border-radius:14px;overflow:hidden;position:relative}#videos video{max-height:250px;border-radius:0}#videos .tile p{margin:0;padding:6px 12px;font-size:12px}.call-controls{justify-content:center;gap:12px;padding-top:8px;flex-wrap:wrap!important}#call .call-controls button{background:#314455;color:white;border:0;border-radius:14px;padding:11px 10px;min-width:86px;display:flex;flex-direction:column;align-items:center;gap:6px}#call .call-controls .icon-label{font-size:10px;max-width:95px}#call .call-controls .svg-icon{width:25px;height:25px}#call .call-controls button.control-off{background:#653e48}#call .call-controls button.control-active{background:#297fa9}#call .call-controls #hangup{background:#e54d5f}#call .call-controls button:disabled{opacity:.4}@keyframes recording-pulse{50%{opacity:.35}}@media(max-width:760px){.telegram-ui .app-header{padding:5px 10px;min-height:46px}.brand small{display:none}.sidebar{width:100%}#messages{padding:14px 12px}.message{max-width:88%}.chat-header{padding:8px 10px;gap:3px}.chat-header button{padding:7px}.chat-header #members:after{content:none}.chat-header #members{padding:7px}.chat-title{padding-left:4px}.chat-title h2{font-size:14px}.chat-title small{font-size:11px}#send{margin:0 8px max(8px,env(safe-area-inset-bottom));padding:6px 8px;gap:3px}#text{font-size:16px}#send-button{width:38px;height:38px;padding:8px}#voice-panel,#upload-panel{margin:0 8px 7px;padding:10px}.voice-line{gap:6px}#voice-label{min-width:150px}#call{padding:14px;max-height:85dvh}.call-controls{gap:7px}#call .call-controls button{min-width:70px;flex:1;padding:9px 6px}.action-list{width:185px}#emoji-button{padding:5px}}@media(prefers-reduced-motion:reduce){.record-dot{animation:none!important}}
/* 1.5: native messenger voice cards, mentions and personal profiles */
.voice-message{display:flex;align-items:center;gap:10px;width:300px;max-width:100%;padding:7px 0}.voice-message audio{display:none}.voice-message .voice-play{display:grid;place-items:center;border:0;border-radius:50%;width:44px;height:44px;flex-shrink:0;padding:11px;background:var(--brand);color:#fff}.voice-body{min-width:0;flex:1}.voice-wave{height:31px;position:relative;display:flex;align-items:center}.voice-bars{width:100%;height:27px;display:flex;gap:2px;align-items:center;pointer-events:none}.voice-bars i{display:block;flex:1;min-width:1px;border-radius:3px;background:#8fb99c}.voice-bars i.played{background:var(--brand)}.voice-bars.no-wave{height:3px;background:#8fb99c;border-radius:3px}.voice-wave input[type=range]{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;opacity:0;cursor:pointer}.voice-wave input:focus-visible{opacity:.6}.voice-info{display:flex;align-items:center;gap:7px}.voice-info small{flex:1;font-variant-numeric:tabular-nums}.message .voice-info button{font-size:11px;padding:1px 5px;border:0;background:transparent;color:var(--brand)}.voice-speed{font-weight:700}.message .mention-link,.message .profile-link{display:inline;padding:0!important;margin:0;border:0;background:transparent!important;color:var(--brand);font:inherit;text-align:left}.message .sender-name{font-size:12px!important;font-weight:650!important}.message p a{color:var(--brand);overflow-wrap:anywhere}.message.mentions-me{outline:2px solid #3390ec88;outline-offset:1px}.avatar img,.profile-picture img{width:100%;height:100%;object-fit:cover;border-radius:50%}#my-avatar>.avatar{width:100%;height:100%;font:inherit}#my-avatar{cursor:pointer}#mention-picker{position:absolute;bottom:100%;left:0;right:0;max-height:310px;overflow:auto;background:var(--panel);padding:6px;border-radius:12px;box-shadow:0 5px 24px #0002;z-index:8}#mention-picker button{display:flex;align-items:center;width:100%;gap:10px;border:0;text-align:left;padding:8px}#mention-picker small{margin-left:auto}#mention-picker .avatar{width:32px;height:32px;font-size:15px}.profile-picture{width:96px;height:96px;margin:10px auto 20px}.profile-picture>.avatar{width:96px;height:96px;font-size:35px}#profile-dialog{width:min(440px,calc(100vw - 24px))}#profile-form label{display:block;margin:14px 0 6px}#profile-form input,#profile-form textarea{display:block;width:100%;margin-top:5px}#profile-form small{display:block}#profile-read p{white-space:pre-wrap;overflow-wrap:anywhere;margin-top:15px}.dark .voice-bars i{background:#7aa0bb}.dark .voice-bars i.played{background:#b3e1ff}@media(max-width:480px){.voice-message{width:245px}.voice-message .voice-play{width:40px;height:40px;padding:10px}.voice-bars{gap:1px}}

#chat-avatar{padding:0!important;border:0;background:transparent}#chat-avatar:disabled{opacity:1}#chat-avatar .avatar{margin:0}

#group-dialog{width:min(520px,calc(100vw - 16px));max-height:min(92dvh,920px);padding:0;flex-direction:column;overflow:hidden}
#group-dialog[open]{display:flex}
#group-dialog:not([open]){display:none}
#group-dialog>h2{margin:0;padding:16px 18px 10px;font-size:17px;flex-shrink:0}
#group-dialog .group-shell{flex:1;min-height:0;overflow:auto;padding:0 14px 12px;-webkit-overflow-scrolling:touch}
#group-dialog .group-section{margin:8px 0;border:1px solid var(--line);border-radius:12px;padding:0;background:var(--bg)}
#group-dialog .group-section>summary{list-style:none;cursor:pointer;font-weight:650;font-size:14px;padding:12px 14px;margin:0;user-select:none}
#group-dialog .group-section>summary::-webkit-details-marker{display:none}
#group-dialog .group-section[open]>summary{border-bottom:1px solid var(--line)}
#group-dialog .group-section>form,#group-dialog .group-section>#group-perms,#group-dialog .group-section>#group-people,#group-dialog .group-section>#group-add-row,#group-dialog .group-section>#group-links,#group-dialog .group-section>#group-link-result,#group-dialog .group-section>#group-requests,#group-dialog .group-section>#group-bans,#group-dialog .group-section>.group-hint,#group-dialog .group-section>.group-sub,#group-dialog .group-section>.group-audit-wrap,#group-dialog .group-section>#group-invite-form{padding:10px 14px}
#group-dialog label,#sfu-dialog label{display:block;margin:10px 0}
#group-dialog select,#sfu-dialog input:not([type=checkbox]){max-width:100%}
#group-dialog .group-hint{font-size:12px;color:var(--muted);margin:6px 14px 10px}
#group-dialog .group-sub{font-size:13px;margin:12px 14px 4px;color:var(--muted)}
#group-dialog .group-sticky-save{position:sticky;bottom:0;padding:10px 0 4px;background:linear-gradient(transparent,var(--bg) 28%);z-index:2}
#group-dialog .group-sticky-save .primary{width:100%}
#group-dialog .person-row{display:flex;align-items:flex-start;gap:10px;flex-wrap:wrap;border-bottom:1px solid var(--line);padding:10px 0}
#group-dialog .person-row:last-child{border-bottom:0}
#group-dialog .person-info{flex:1;min-width:120px;display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}
#group-dialog .person-name{border:0;background:transparent;padding:0;color:var(--text);font-weight:600;text-align:left}
#group-dialog .person-actions{display:flex;flex-wrap:wrap;gap:6px;width:100%}
#group-dialog .person-row button{font-size:12px}
#group-dialog .role-badge{display:inline-block;font-size:11px;font-weight:650;padding:2px 8px;border-radius:999px;background:var(--tint);color:var(--brand);line-height:1.4}
#group-dialog .role-badge.role-owner{background:#fff3d6;color:#9a6b00}
#group-dialog .role-badge.role-admin{background:#e7f3ff;color:#1a6fb5}
#group-dialog .role-badge.role-moderator{background:#eef7e8;color:#3a7a2c}
#group-dialog .role-badge.role-member{background:var(--hover);color:var(--muted)}
#group-dialog .role-control{display:flex;align-items:center;gap:8px;margin:0;min-width:min(100%,200px)}
#group-dialog .role-label{font-size:12px;font-weight:650;color:var(--muted);flex-shrink:0}
#group-dialog .role-select{width:auto;min-width:140px;margin:0;padding:7px 10px;font-size:13px}
#group-dialog .muted-note{width:100%;margin:0}
#group-dialog .group-footer{flex-shrink:0;padding:10px 14px 14px;border-top:1px solid var(--line);gap:8px}
#group-dialog .group-audit-wrap{margin:8px 14px 12px;border:0;background:transparent}
#group-audit{max-height:180px;overflow:auto;font-size:12px}
#group-add-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
#group-add-row select{flex:1;min-width:140px;margin:0}
body.telegram-ui #group-dialog{border-radius:14px}
body.telegram-ui #group-dialog .group-section{border-radius:10px;background:var(--panel)}
body.telegram-ui #group-dialog .group-sticky-save{background:linear-gradient(transparent,var(--panel) 28%)}
body.telegram-ui.dark #group-dialog .role-badge.role-owner{background:#3a3218;color:#f0d78c}
body.telegram-ui.dark #group-dialog .role-badge.role-admin{background:#1e3348;color:#8ec7f0}
body.telegram-ui.dark #group-dialog .role-badge.role-moderator{background:#243528;color:#9dcf8a}
@media(max-width:760px){
 #group-dialog{width:calc(100vw - 8px);max-height:94dvh;border-radius:12px}
 #group-dialog>h2{padding:14px 14px 8px;font-size:16px}
 #group-dialog .group-shell{padding:0 10px 10px}
 #group-dialog .group-section>summary{padding:11px 12px;font-size:14px}
 #group-dialog .role-control{width:100%}
 #group-dialog .role-select{flex:1}
 #group-dialog .person-actions button{flex:1;min-width:calc(50% - 6px)}
}
#sfu-dialog label{display:block;margin:12px 0}
#sfu-dialog{width:min(530px,calc(100vw - 24px))}#videos>audio{width:0;height:0;position:absolute}#videos:has(> :nth-child(7)){grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}#videos:has(> :nth-child(7)) video{max-height:140px}

/* live voice waveform + video notes + call polish */
#voice-live-wave{display:none;height:28px;flex:1;min-width:72px;align-items:flex-end;gap:2px}
#voice-panel[data-state=recording] #voice-live-wave,#voice-panel[data-state=ready] #voice-live-wave{display:flex}
#voice-live-wave i{display:block;flex:1;min-width:2px;border-radius:2px;background:var(--brand);opacity:.85;height:4px;transition:height .08s linear}
.voice-bars{align-items:flex-end!important}
.voice-bars i{align-self:flex-end}
.video-note{width:220px;max-width:70vw;display:grid;gap:6px;justify-items:start;margin:4px 0}
.video-note-frame{position:relative;width:220px;height:220px;max-width:70vw;max-height:70vw;border-radius:50%;overflow:hidden;background:#111;box-shadow:0 0 0 3px var(--brand)}
.video-note-frame video{width:100%;height:100%;object-fit:cover;display:block;background:#000}
.video-note-play{position:absolute;inset:0;margin:auto;width:56px;height:56px;border:0;border-radius:50%;background:#0008;color:#fff;display:grid;place-items:center;padding:14px;z-index:2}
.video-note-ring{position:absolute;inset:0;border-radius:50%;pointer-events:none;background:conic-gradient(var(--brand) var(--progress,0%),transparent 0);mask:radial-gradient(farthest-side,transparent calc(100% - 4px),#000 calc(100% - 3px));-webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 4px),#000 calc(100% - 3px))}
.video-note-time{font-variant-numeric:tabular-nums;font-size:12px;color:var(--muted)}
.circle-overlay{position:fixed;inset:0;z-index:40;background:#0b1220e6;display:grid;place-items:center;gap:16px;padding:24px}
.circle-overlay[hidden]{display:none!important}
.circle-overlay video{width:min(320px,80vw);height:min(320px,80vw);border-radius:50%;object-fit:cover;background:#000;box-shadow:0 0 0 4px #3390ec,0 20px 60px #0008;transform:scaleX(-1)}
.circle-overlay-ui{display:flex;gap:10px;align-items:center;flex-wrap:wrap;justify-content:center;color:#fff}
.circle-overlay-ui button{border:0;border-radius:999px;padding:10px 16px;background:#3390ec;color:#fff}
#circle-cancel{background:#e54d5f}
#videos{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px}
#videos .tile.speaking{box-shadow:0 0 0 3px #56ae74,0 8px 24px #0004}
#call-quality{margin-left:8px;opacity:.85}
#record-circle{order:3;border:0;padding:7px;color:var(--muted);background:transparent}
#send #record{order:3}
@media(max-width:480px){.video-note,.video-note-frame{width:180px;height:180px}}

/* Approach A: Telegram visual identity */
body.telegram-ui{--brand:#3390ec;--tint:#e7f3ff;--bg:#ffffff;--panel:#ffffff;--text:#0e1621;--muted:#707579;--line:#dfe3e6;--hover:#f4f4f5;--bubble-own:#effdde;--bubble-peer:#ffffff;--chat-bg:#90b39c;--checks:#4fae4e;--checks-read:#4fae4e;--select:#c4e1ff}
body.telegram-ui.dark{--brand:#6ab3f3;--tint:#242f3d;--bg:#0e1621;--panel:#17212b;--text:#f5f5f5;--muted:#8b9aab;--line:#0e1621;--hover:#242f3d;--bubble-own:#2b5278;--bubble-peer:#182533;--chat-bg:#0e1621;--checks:#72bcfd;--checks-read:#72bcfd;--select:#2b5278}
body.telegram-ui button.primary{background:var(--brand);border-color:var(--brand)}
body.telegram-ui button.primary:hover{background:#2481cc}
body.telegram-ui.dark button.primary:hover{background:#5aa3e8}
body.telegram-ui :focus-visible{outline-color:#3390ec88}
body.telegram-ui .brand-icon{background:var(--brand)!important;background-image:none!important;border-radius:50%}
body.telegram-ui .auth-art span{background:#d6ebff;color:#3390ec}
body.telegram-ui .auth-art span:nth-child(2){background:var(--brand);color:#fff}
body.telegram-ui .empty>span{color:#3390ec}
body.telegram-ui .sidebar{background:var(--panel);border-right:1px solid var(--line)}
body.telegram-ui #rooms{padding:0}
body.telegram-ui #rooms button{padding:8px 12px;gap:12px;border-radius:0;margin:0;min-height:70px;align-items:center}
body.telegram-ui #rooms button:hover{background:var(--hover)}
body.telegram-ui #rooms button.selected{background:var(--select)!important;color:var(--text)!important}
body.telegram-ui #rooms button.selected small,
body.telegram-ui #rooms button.selected time{color:var(--muted)!important}
body.telegram-ui #rooms .avatar{width:54px;height:54px;font-size:22px;border-radius:50%}
body.telegram-ui #rooms .room-top{gap:8px;margin-bottom:2px}
body.telegram-ui #rooms .room-top strong{font-size:15px;font-weight:600;letter-spacing:-.1px}
body.telegram-ui #rooms time{font-size:12px;color:var(--muted)}
body.telegram-ui #rooms .room-preview{display:flex;align-items:center;gap:8px;min-width:0}
body.telegram-ui #rooms .room-preview small{flex:1;min-width:0;font-size:13px;margin:0;color:var(--muted)}
body.telegram-ui #rooms .badge{margin-left:auto;background:#4dcd5e;border-radius:11px;min-width:20px;padding:1px 6px;font-size:12px;font-weight:600;line-height:18px}
body.telegram-ui #rooms button.selected .badge{background:#4dcd5e;color:#fff}
body.telegram-ui #conversation{background:var(--chat-bg);background-image:none}
body.telegram-ui #messages{
  background-color:transparent;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cg fill='%23000000' fill-opacity='0.045'%3E%3Ccircle cx='24' cy='36' r='2'/%3E%3Ccircle cx='72' cy='18' r='1.5'/%3E%3Cpath d='M110 40c6 0 10 5 8 10l-8 18-8-18c-2-5 2-10 8-10z'/%3E%3Ccircle cx='168' cy='52' r='2'/%3E%3Cpath d='M200 28h14v2h-14zm4-4h2v14h-2z'/%3E%3Ccircle cx='40' cy='100' r='1.8'/%3E%3Cpath d='M80 88l10 6-10 6-4-12z'/%3E%3Ccircle cx='140' cy='110' r='2'/%3E%3Cpath d='M190 95c4-1 8 2 7 6l-6 12-8-4c-4-2-2-8 7-14z'/%3E%3Ccircle cx='28' cy='170' r='2'/%3E%3Cpath d='M70 160c5 2 6 8 2 11l-12 6 2-14c1-4 5-5 8-3z'/%3E%3Ccircle cx='130' cy='180' r='1.6'/%3E%3Cpath d='M175 155h16l-8 14z'/%3E%3Ccircle cx='210' cy='190' r='2'/%3E%3Cpath d='M48 210c6 0 9 5 6 9l-10 8-4-12c-1-4 3-5 8-5z'/%3E%3Ccircle cx='100' cy='220' r='1.5'/%3E%3Cpath d='M150 205l12 3-3 12-9-15z'/%3E%3C/g%3E%3C/svg%3E");
  background-size:240px 240px;background-repeat:repeat;padding:12px max(16px,calc((100% - 760px)/2)) 18px;gap:6px
}
body.telegram-ui.dark #messages{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cg fill='%23ffffff' fill-opacity='0.035'%3E%3Ccircle cx='24' cy='36' r='2'/%3E%3Ccircle cx='72' cy='18' r='1.5'/%3E%3Cpath d='M110 40c6 0 10 5 8 10l-8 18-8-18c-2-5 2-10 8-10z'/%3E%3Ccircle cx='168' cy='52' r='2'/%3E%3Cpath d='M200 28h14v2h-14zm4-4h2v14h-2z'/%3E%3Ccircle cx='40' cy='100' r='1.8'/%3E%3Cpath d='M80 88l10 6-10 6-4-12z'/%3E%3Ccircle cx='140' cy='110' r='2'/%3E%3Cpath d='M190 95c4-1 8 2 7 6l-6 12-8-4c-4-2-2-8 7-14z'/%3E%3Ccircle cx='28' cy='170' r='2'/%3E%3Cpath d='M70 160c5 2 6 8 2 11l-12 6 2-14c1-4 5-5 8-3z'/%3E%3Ccircle cx='130' cy='180' r='1.6'/%3E%3Cpath d='M175 155h16l-8 14z'/%3E%3Ccircle cx='210' cy='190' r='2'/%3E%3Cpath d='M48 210c6 0 9 5 6 9l-10 8-4-12c-1-4 3-5 8-5z'/%3E%3Ccircle cx='100' cy='220' r='1.5'/%3E%3Cpath d='M150 205l12 3-3 12-9-15z'/%3E%3C/g%3E%3C/svg%3E")
}
body.telegram-ui .chat-header{background:var(--panel);border-bottom:1px solid var(--line);box-shadow:0 1px 0 #00000008}
body.telegram-ui .message{background:var(--bubble-peer);color:var(--text);border:0;border-radius:12px 12px 12px 4px;padding:6px 28px 5px 10px;box-shadow:0 1px 1px #00000014;max-width:min(75%,560px);min-width:96px}
body.telegram-ui .message.own{background:var(--bubble-own);border-radius:12px 12px 4px 12px;color:var(--text)}
body.telegram-ui.dark .message.own{color:#fff}
body.telegram-ui .message .message-time{display:inline-flex;align-items:baseline;justify-content:flex-end;gap:4px;float:right;clear:both;margin:4px 0 0 10px;font-size:11px;line-height:1.2;color:#8a9a8b;white-space:nowrap;max-width:calc(100% - 4px)}
body.telegram-ui.dark .message .message-time{color:#7ea0bc}
body.telegram-ui .message.own .message-time{color:#6ea07a}
body.telegram-ui.dark .message.own .message-time{color:#91b4d1}
body.telegram-ui .msg-checks{display:inline-flex;flex-shrink:0;align-items:center;font-size:13px;letter-spacing:-1.5px;color:var(--checks);font-weight:500;line-height:1;transform:translateY(.5px)}
body.telegram-ui .msg-checks.is-read{color:var(--checks-read)}
body.telegram-ui .date-divider{background:#00000040;backdrop-filter:blur(6px);font-weight:500}
body.telegram-ui #send{margin:0 10px max(10px,env(safe-area-inset-bottom));padding:6px 8px;border-radius:22px;background:var(--panel);box-shadow:0 1px 3px #00000018;align-items:flex-end;gap:4px}
body.telegram-ui #text{min-height:40px!important;padding:10px 8px!important;font-size:15px;line-height:1.35}
body.telegram-ui #send .attachment,#emoji-button,#record,#record-circle{order:unset}
body.telegram-ui #send .attachment{order:0;font-size:20px;padding:8px;color:var(--muted)}
body.telegram-ui #text{order:1}
body.telegram-ui #emoji-button{order:2;padding:8px;font-size:20px}
body.telegram-ui #record-circle{order:3;width:38px;height:38px;border-radius:50%;padding:7px;color:var(--muted);opacity:.9}
body.telegram-ui #record{order:4}
body.telegram-ui #send-button{order:5;width:46px;height:46px;padding:11px;border-radius:50%;box-shadow:none}
body.telegram-ui #record.mic-fab,#send.composer-mic-mode #record{width:46px;height:46px;border-radius:50%;padding:11px;background:var(--brand)!important;color:#fff!important;border:0}
body.telegram-ui #record.mic-fab:hover{background:#2481cc!important}
body.telegram-ui #send.composer-send-mode #record-circle{opacity:.55}
body.telegram-ui #voice-panel,#upload-panel{margin:0 10px 6px;border-radius:16px;border-left:0;box-shadow:0 1px 3px #00000014}
body.telegram-ui #voice-panel[data-state=recording]{background:var(--panel);border:1px solid #e4566433}
body.telegram-ui .voice-message{gap:12px;width:280px;padding:4px 0 2px}
body.telegram-ui .voice-message .voice-play{width:48px;height:48px;padding:12px;background:#5bbe71!important;color:#fff!important;box-shadow:none}
body.telegram-ui .message.own .voice-message .voice-play{background:#5bbe71!important;color:#fff!important}
body.telegram-ui .voice-wave{height:34px}
body.telegram-ui .voice-bars{height:32px;gap:2.5px;align-items:flex-end!important}
body.telegram-ui .voice-bars i{min-width:2.5px;min-height:4px;border-radius:2px;background:#a8d5b0;align-self:flex-end;flex:1 1 0}
body.telegram-ui .voice-bars i.played{background:#4fae4e}
body.telegram-ui .message.own .voice-bars i{background:#9cc9a8}
body.telegram-ui .message.own .voice-bars i.played{background:#4fae4e}
body.telegram-ui.dark .voice-bars i{background:#6a8fa6}
body.telegram-ui.dark .voice-bars i.played{background:#72bcfd}
body.telegram-ui.dark .message.own .voice-bars i{background:#7aa3bc}
body.telegram-ui.dark .message.own .voice-bars i.played{background:#9fd0ff}
body.telegram-ui .voice-duration{display:block;font-size:12px;font-variant-numeric:tabular-nums;color:var(--muted);line-height:1.2}
body.telegram-ui .voice-meta{display:flex;align-items:center;gap:8px;margin-top:2px;min-height:18px}
body.telegram-ui .voice-info{justify-content:flex-end;gap:6px;margin:0;margin-left:auto}
body.telegram-ui .voice-info .voice-speed{font-size:12px;color:var(--brand)}
body.telegram-ui .video-note,.video-note-frame{width:200px;height:200px;max-width:68vw;max-height:68vw}
body.telegram-ui .video-note{height:auto;display:grid}
body.telegram-ui .video-note-frame{box-shadow:0 0 0 2px rgba(0,0,0,.12);background:#000}
body.telegram-ui .video-note-ring{mask:radial-gradient(farthest-side,transparent calc(100% - 3px),#000 calc(100% - 2px));-webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 3px),#000 calc(100% - 2px));background:conic-gradient(#fff var(--progress,0%),transparent 0);opacity:.95}
body.telegram-ui .message.own .video-note-ring{background:conic-gradient(#fff var(--progress,0%),transparent 0)}
body.telegram-ui .video-note-play{width:52px;height:52px;padding:13px;background:#00000066}
/* A call card soft-style superseded by Approach C fullscreen */
@media(max-width:760px){
 body.telegram-ui #rooms button{min-height:66px;padding:7px 10px}
 body.telegram-ui #rooms .avatar{width:50px;height:50px}
 body.telegram-ui #messages{padding:10px 8px 14px}
 body.telegram-ui #send{margin:0 6px max(6px,env(safe-area-inset-bottom))}
 body.telegram-ui #record.mic-fab,body.telegram-ui #send-button{width:42px;height:42px;padding:9px}
 body.telegram-ui .voice-message{width:240px}
 body.telegram-ui .video-note,.video-note-frame{width:180px;height:180px}
}
/* Approach B: Telegram hold-to-record strip */
#record,#record-circle{touch-action:none;-webkit-user-select:none;user-select:none}
.voice-rec-strip{display:flex;flex-direction:column;gap:6px;border-left:3px solid #e45664;background:var(--panel);border-radius:18px;padding:8px 12px!important}
.voice-rec-strip .voice-line{flex-wrap:nowrap;gap:8px;align-items:center}
.voice-rec-strip #voice-label{flex:0 1 auto;font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:28vw}
.voice-hint,.circle-hint{font-size:12px;color:var(--muted);white-space:nowrap}
.voice-hint[data-zone=cancel],.circle-hint[data-zone=cancel]{color:#e54d5f;font-weight:600}
.voice-hint[data-zone=lock],.circle-hint[data-zone=lock]{color:var(--brand);font-weight:600}
#voice-panel.voice-cancel-zone{border-left-color:#e54d5f;background:#fff1f2}
#voice-panel.voice-lock-zone,#voice-panel.voice-locked{border-left-color:var(--brand)}
#voice-cancel{border:0;background:transparent;color:var(--muted);font-size:18px;line-height:1;padding:4px 8px;border-radius:50%}
#voice-stop,#voice-send{border:0;border-radius:999px;padding:6px 12px;font-size:12px}
#voice-send{background:var(--brand);color:#fff}
#voice-stop{background:var(--tint);color:var(--brand)}
#voice-preview{width:100%;height:36px;margin-top:4px}
.circle-overlay.circle-cancel-zone{box-shadow:inset 0 0 0 4px #e54d5f}
.circle-overlay.circle-lock-zone{box-shadow:inset 0 0 0 4px var(--brand)}
#circle-send{background:#56ae74}
#record.recording-hold,#record-circle.recording-hold{color:#e45664}
/* —— Telegram-like fullscreen call (Approach C) —— */
#call.call-overlay,#call{
  position:fixed;inset:0;top:0;right:0;bottom:0;left:0;width:100%;max-width:none;height:100%;max-height:none;
  margin:0;padding:0;border:0;border-radius:0;overflow:hidden;
  background:#0e1621;color:#eef5fb;z-index:50;
  display:flex;flex-direction:column;
  box-shadow:none;
}
#call[hidden]{display:none!important}
#call .call-top{
  flex:0 0 auto;display:flex;align-items:flex-start;justify-content:center;
  padding:max(14px,env(safe-area-inset-top)) 20px 8px;text-align:center;z-index:2;
  background:linear-gradient(180deg,#0e1621f2,#0e162100);
}
#call .call-top-text{max-width:min(520px,92vw)}
#call #call-title,#call h2{
  margin:0;font-size:17px;font-weight:600;letter-spacing:.01em;color:#f4f8fb;
}
#call .call-meta{
  display:flex;flex-wrap:wrap;gap:6px 12px;justify-content:center;align-items:center;margin-top:4px;
}
#call .call-meta small,#call #call-status,#call #call-quality,#call #call-timer{
  color:#8fa3b5;font-size:13px;opacity:1;margin:0;
}
#call #call-timer{font-variant-numeric:tabular-nums;color:#c5d4e0}
#call #call-quality{opacity:.75}
#call .sfu-pages{
  flex:0 0 auto;display:flex;align-items:center;justify-content:center;gap:12px;
  padding:4px 16px;z-index:2;
}
#call .sfu-pages button{
  width:36px;height:36px;border:0;border-radius:50%;background:#243447;color:#eef5fb;padding:0;min-width:0;font-size:16px;
}
#call .sfu-pages span{color:#a8bbca;font-size:13px}
#call .call-stage,#videos{
  flex:1 1 auto;min-height:0;margin:0;padding:8px 12px 110px;
  display:grid;place-items:center;gap:12px;
  grid-template-columns:1fr;position:relative;overflow:hidden;
}
#call.call-group .call-stage,#call.call-group #videos{
  align-content:center;justify-items:stretch;
  grid-template-columns:repeat(auto-fit,minmax(140px,1fr));
  place-items:stretch;padding-bottom:120px;
}
#call #videos>audio{width:0;height:0;position:absolute;pointer-events:none}
#call .tile{
  position:relative;background:#172533;border-radius:16px;overflow:hidden;
  min-width:0;width:100%;max-width:100%;aspect-ratio:16/10;
  box-shadow:0 8px 28px #0005;
}
#call .tile video{
  width:100%;height:100%;max-height:none;object-fit:cover;border-radius:0;background:#0b121a;display:block;
}
#call .tile p{
  position:absolute;left:10px;bottom:8px;margin:0;padding:3px 10px;border-radius:999px;
  font-size:12px;background:#0e1621a8;color:#eef5fb;backdrop-filter:blur(6px);
}
#call .tile.speaking{box-shadow:0 0 0 3px #56ae74,0 10px 32px #0006}
#call .tile.audio-tile{
  aspect-ratio:1;max-width:min(280px,70vw);max-height:min(280px,70vw);margin:auto;
  background:transparent;box-shadow:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;
}
#call .tile.audio-tile video{position:absolute;width:0;height:0;opacity:0;pointer-events:none}
#call .call-avatar-wrap{
  width:min(168px,42vw);height:min(168px,42vw);border-radius:50%;
  display:grid;place-items:center;position:relative;
}
#call .call-avatar-wrap::before,#call .call-avatar-wrap::after{
  content:"";position:absolute;inset:0;border-radius:50%;border:2px solid #56ae7488;
  opacity:0;pointer-events:none;
}
#call .tile.speaking .call-avatar-wrap::before{
  animation:call-pulse 1.6s ease-out infinite;
}
#call .tile.speaking .call-avatar-wrap::after{
  animation:call-pulse 1.6s ease-out .45s infinite;
}
@keyframes call-pulse{
  0%{transform:scale(1);opacity:.55}
  100%{transform:scale(1.45);opacity:0}
}
#call .call-avatar-wrap .avatar{
  width:100%;height:100%;font-size:clamp(36px,10vw,64px);border-radius:50%;
  box-shadow:0 0 0 3px #243447,0 16px 40px #0006;
}
#call .call-avatar-wrap .avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%}
#call .tile.audio-tile p{position:static;background:transparent;padding:0;color:#c5d4e0;font-size:15px}
#call.call-audio:not(.call-group) .tile.is-local:not(:only-child){
  position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);opacity:0;pointer-events:none;
}
#call.call-video:not(.call-group) .tile:not(.local-pip){
  position:absolute;inset:0;width:100%;height:100%;max-width:none;border-radius:0;aspect-ratio:auto;z-index:0;
}
#call.call-video:not(.call-group) .tile:not(.local-pip) p{left:16px;bottom:120px}
#call.call-video:not(.call-group) .local-pip,#call .tile.local-pip{
  position:absolute;right:max(14px,env(safe-area-inset-right));bottom:max(108px,calc(env(safe-area-inset-bottom) + 96px));
  width:min(132px,28vw);aspect-ratio:3/4;z-index:3;border-radius:14px;
  box-shadow:0 8px 28px #0008;border:1px solid #ffffff22;overflow:hidden;
}
#call .tile.local-pip p{font-size:10px;padding:2px 7px}
#call .call-controls{
  position:absolute;left:0;right:0;bottom:0;z-index:5;
  display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:14px;
  padding:18px 16px max(22px,env(safe-area-inset-bottom));
  background:linear-gradient(0deg,#0e1621f5 55%,#0e162100);
}
#call .call-controls button{
  width:58px;height:58px;min-width:58px;flex:0 0 auto;padding:0;margin:0;
  border:0;border-radius:50%;background:#2b3a4a;color:#fff;
  display:inline-flex;align-items:center;justify-content:center;
  box-shadow:0 6px 18px #0005;transition:background .15s,transform .12s;
}
#call .call-controls button:hover{background:#36485c}
#call .call-controls button:active{transform:scale(.96)}
#call .call-controls .icon-label{display:none}
#call .call-controls .svg-icon{width:26px;height:26px;display:grid;place-items:center}
#call .call-controls .svg-icon svg{width:26px;height:26px}
#call .call-controls button.control-off{background:#5a3a42}
#call .call-controls button.control-active{background:#2a6f96}
#call .call-controls #hangup,#call .call-controls button.danger{
  background:#e5394a;width:64px;height:64px;min-width:64px;
}
#call .call-controls #hangup:hover{background:#c92f3e}
#call .call-controls button:disabled{opacity:.35}
#call.call-connecting #call-status{color:#7eb6e8}
#call.call-active #call-status{color:#7dcea0}
@media(max-width:480px){
  #call .call-stage,#call #videos{padding-bottom:128px}
  #call .call-controls{gap:8px;padding:14px 8px max(18px,env(safe-area-inset-bottom));flex-wrap:wrap;justify-content:center}
  #call .call-controls button{width:46px;height:46px;min-width:46px}
  #call .call-controls #hangup,#call .call-controls button.danger{width:54px;height:54px;min-width:54px;order:10}
  #call.call-video:not(.call-group) .local-pip,#call .tile.local-pip{bottom:max(120px,calc(env(safe-area-inset-bottom) + 108px));width:min(112px,30vw);right:max(10px,env(safe-area-inset-right))}
  #call .tile.audio-tile{max-width:min(240px,72vw);max-height:min(240px,72vw)}
  #call .call-avatar-wrap{width:min(140px,40vw);height:min(140px,40vw)}
  #call.call-group .call-stage,#call.call-group #videos{grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:8px;padding-bottom:136px}
}
@media(max-width:360px){
  #call .call-controls{gap:6px;padding-inline:6px}
  #call .call-controls button{width:42px;height:42px;min-width:42px}
  #call .call-controls #hangup,#call .call-controls button.danger{width:50px;height:50px;min-width:50px}
}
#call .tile:not(.audio-tile) .call-avatar-wrap{display:none}
#call.call-video:not(.call-group) #videos{display:block;padding:0 0 100px}

/* 1.8.2 polish */
#voice-panel.voice-rec-strip:not([hidden]){display:flex!important}
#voice-live-wave i{min-height:3px}
body.telegram-ui #record.recording-hold{background:#e45664!important;color:#fff!important}
body.telegram-ui #record.recording-hold.mic-fab{box-shadow:0 0 0 4px #e4566433}

.news-pin{margin-left:.4rem;color:var(--brand);font-weight:600;font-size:.75rem;text-transform:uppercase;letter-spacing:.04em}.news-room strong{font-weight:700}#rooms button.news-room{order:-1;background:var(--tint)}.news-readonly{margin:0 12px 8px;padding:10px 12px;border-radius:12px;background:var(--tint);color:var(--muted);font-size:.9rem}#admin-news textarea{width:100%;resize:vertical}

/* 1.9.0 polls + geolocation */
.poll-card,.location-card{
  min-width:min(260px,72vw);max-width:320px;margin:2px 0 4px;padding:12px 12px 10px;
  border-radius:14px;background:#fff;border:1px solid #e3e8ee;box-shadow:0 1px 2px #0000000a;
}
body.dark .poll-card,body.dark .location-card,body.telegram-ui.dark .poll-card,body.telegram-ui.dark .location-card{
  background:#1e2a36;border-color:#2b3a48;
}
.poll-card>strong,.location-card>strong{display:block;font-size:15px;font-weight:600;margin-bottom:10px;line-height:1.35}
.poll-options{display:flex;flex-direction:column;gap:6px}
.poll-option{
  position:relative;display:block;width:100%;text-align:left;padding:10px 12px;border-radius:12px;
  border:1px solid #dfe5ec;background:transparent;overflow:hidden;color:inherit;
}
body.telegram-ui .poll-option{border-color:#d7e0ea}
body.telegram-ui.dark .poll-option{border-color:#314354}
.poll-option:hover{background:#f3f7fb}
body.telegram-ui.dark .poll-option:hover{background:#243443}
.poll-bar{
  position:absolute;inset:0 auto 0 0;background:#3390ec22;border-radius:12px;pointer-events:none;
  transition:width .25s ease;
}
body.telegram-ui.dark .poll-bar{background:#6ab3f333}
.poll-option.is-mine{border-color:#3390ec}
.poll-option.is-mine .poll-bar{background:#3390ec33}
.poll-option-top{position:relative;display:flex;justify-content:space-between;gap:10px;align-items:baseline;z-index:1}
.poll-label{font-weight:500}
.poll-meta{color:var(--muted);font-size:12px;white-space:nowrap}
.poll-voters{position:relative;z-index:1;display:block;margin-top:4px;color:var(--muted);font-size:12px}
.poll-footer{display:block;margin-top:8px;color:var(--muted);font-size:12px}
.location-card small{display:block;color:var(--muted);margin-bottom:10px}
.location-actions{display:flex;flex-wrap:wrap;gap:8px}
.location-actions a,.location-open{
  display:inline-flex;align-items:center;justify-content:center;padding:8px 12px;border-radius:10px;
  background:var(--brand);color:#fff!important;text-decoration:none;font-weight:600;font-size:13px;
}
.location-actions a:not(.location-open){background:transparent;color:var(--brand)!important;border:1px solid var(--line)}
body.telegram-ui #attach-poll,body.telegram-ui #attach-geo{
  order:0;border:0;background:transparent;color:var(--muted);padding:8px;width:38px;height:38px;
  display:inline-flex;align-items:center;justify-content:center;border-radius:10px;flex-shrink:0;
}
body.telegram-ui #attach-poll .svg-icon,body.telegram-ui #attach-geo .svg-icon{width:22px;height:22px}
body.telegram-ui #attach-poll:hover,body.telegram-ui #attach-geo:hover{background:var(--hover);color:var(--text)}
#poll-dialog{max-width:420px;width:calc(100vw - 32px)}
#poll-dialog #poll-options{display:flex;flex-direction:column;gap:8px;margin:8px 0}
#poll-dialog #poll-add-option{margin-bottom:8px}
.message.has-poll .poll-card,.message.has-location .location-card{margin-top:2px}

/* Approach A: unread jump FAB, reactions, emoji grid, circle icon-only */
.messages-shell{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}
.messages-shell #messages{flex:1;min-height:0}
#jump-latest{
  position:absolute;right:14px;bottom:14px;z-index:4;
  width:42px;height:42px;padding:0;margin:0;border:0;border-radius:50%;
  background:var(--panel,#fff);color:var(--brand,#3390ec);
  font-size:22px;line-height:1;box-shadow:0 2px 10px #0000002e;
  display:grid;place-items:center;
}
#jump-latest:hover{background:var(--tint,#e9f3fc)}
body.telegram-ui #jump-latest{background:var(--panel);color:var(--brand);box-shadow:0 1px 8px #00000033}
#emoji-picker{
  display:grid;grid-template-columns:repeat(8,1fr);gap:2px;
  max-width:min(320px,72vw);max-height:220px;overflow:auto;
  padding:8px;border-radius:14px;
}
#emoji-picker[hidden]{display:none!important}
#emoji-picker button{border:0;background:transparent;font-size:22px;padding:6px;line-height:1;border-radius:8px}
#emoji-picker button:hover{background:var(--hover,#f1f5f9)}
.message{position:relative}
.react-float{
  position:absolute;left:50%;top:-14px;transform:translate(-50%,-100%);
  z-index:6;display:flex;gap:2px;padding:4px 6px;border-radius:22px;
  background:var(--panel,#fff);box-shadow:0 4px 18px #0000002a;white-space:nowrap;
}
.message.own .react-float{left:auto;right:8px;transform:translateY(-100%)}
.react-float button{border:0;background:transparent;font-size:22px;padding:4px 5px;border-radius:50%;line-height:1}
.react-float button:hover{background:var(--tint,#e9f3fc);transform:scale(1.12)}
.react-chips{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}
.react-chip{border:0;border-radius:12px;padding:2px 8px;font-size:13px;background:var(--tint,#e9f3fc);color:var(--text);line-height:1.4}
.react-chip.mine{background:var(--brand,#3390ec);color:#fff}
body.telegram-ui .react-chip{background:#0000000d}
body.telegram-ui .react-chip.mine{background:var(--brand);color:#fff}
body.telegram-ui.dark .react-chip{background:#ffffff14}
#record-circle .icon-label{display:none!important}
#jump-latest .svg-icon,#jump-latest svg{width:22px;height:22px;display:block}

#brand-icon.has-image{padding:0;overflow:hidden;border-radius:8px;display:inline-flex;align-items:center;justify-content:center}
#brand-icon.has-image img{width:28px;height:28px;object-fit:cover;display:block;border-radius:8px}
.branding-colors{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.branding-icons{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:12px 0}
.branding-preview{width:72px;height:72px;border-radius:16px;object-fit:cover;border:1px solid var(--line);margin-top:8px;background:var(--panel)}
#branding-card .toolbar{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
@media(max-width:640px){.branding-colors,.branding-icons{grid-template-columns:1fr}}

#notify-prompt-dialog{width:min(420px,94vw);border:0;border-radius:16px;padding:22px;background:var(--panel);color:var(--text);box-shadow:var(--shadow)}
#notify-prompt-dialog::backdrop{background:#0b1220aa}
#notify-prompt-dialog h2{margin:0 0 10px;font-size:1.25rem}
#notify-prompt-dialog .toolbar{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}
.notify-benefits{margin:12px 0;padding-left:1.2rem;color:var(--muted)}
.notify-prefs{display:flex;flex-direction:column;gap:10px;margin:14px 0}
.notify-prefs label.check{display:flex;align-items:center;gap:10px;font-weight:600}
.notify-prefs small{color:var(--muted);margin:-4px 0 4px 28px}
.quiet-hours{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-left:28px}
#notify-settings-card .toolbar{margin-top:12px;display:flex;flex-wrap:wrap;gap:8px}
