*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Inter,system-ui,-apple-system,Segoe UI,Arial,sans-serif;background:#eef2f6;color:#18212b}a{color:inherit;text-decoration:none}button,input,textarea{font:inherit}.app-shell{display:grid;grid-template-columns:340px 1fr;height:100vh}.sidebar{background:#fff;border-right:1px solid #dfe5eb;overflow:auto}.sidebar.compact{padding-bottom:30px}.brand{height:76px;padding:14px 18px;display:flex;align-items:center;gap:12px;border-bottom:1px solid #edf0f3}.brand-logo{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:#229ed9;color:#fff;font-weight:800;font-size:22px}.brand b{display:block;font-size:18px}.brand small{display:block;color:#7a8794;margin-top:3px}.sidebar-actions{padding:14px 16px}.button{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:10px;padding:11px 16px;font-weight:700;cursor:pointer}.button.primary{background:#229ed9;color:#fff;width:100%}.button.small{padding:9px 13px}.button.auto{width:auto}.me-row{display:flex;align-items:center;justify-content:space-between}.me{display:flex;align-items:center;gap:10px}.me small{display:block;color:#7d8995}.icon-link{position:relative;font-size:22px}.icon-link em{position:absolute;right:-8px;top:-8px;background:#e64b4b;color:#fff;border-radius:10px;font-size:10px;padding:2px 5px;font-style:normal}.avatar{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:#dcecf5;color:#26729a;font-weight:800;flex:0 0 auto}.avatar.large{width:70px;height:70px;font-size:28px}.channels a{display:grid;grid-template-columns:34px 1fr auto;gap:10px;align-items:center;padding:13px 16px;border-top:1px solid #f1f3f5}.channels a:hover,.subchannel:hover{background:#f2f7fa}.channels b{display:block}.channels small{display:block;color:#7d8995;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px}.channels em{font-style:normal;background:#edf3f7;border-radius:14px;padding:2px 8px;color:#6c7883}.channel-icon{font-size:22px;color:#229ed9}.subchannel{display:block;padding:12px 18px;border-bottom:1px solid #f0f2f4}.main{min-width:0;overflow:auto}.topbar{min-height:76px;background:#fff;border-bottom:1px solid #dfe5eb;display:flex;justify-content:space-between;align-items:center;gap:18px;padding:12px 26px;position:sticky;top:0;z-index:3}.topbar h1{font-size:20px;margin:0}.topbar p{margin:4px 0 0;color:#77838f}.top-actions{display:flex;gap:16px}.link{color:#229ed9}.welcome{padding:35px}.welcome-card,.empty{background:#fff;border-radius:18px;padding:34px;box-shadow:0 8px 30px rgba(29,48,66,.06)}.topic-list{padding:20px;max-width:1100px;margin:auto}.subchips{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}.subchips a{background:#fff;border:1px solid #dfe7ed;border-radius:18px;padding:8px 12px;color:#317a9f}.topic-card{background:#fff;margin-bottom:8px;border-radius:12px;padding:14px 16px;display:flex;justify-content:space-between;gap:16px;align-items:center;border:1px solid #e7ebef}.topic-card:hover{border-color:#bfdcec;background:#fbfdff}.topic-main{min-width:0}.topic-card h3{margin:0 0 5px;font-size:16px}.topic-card p{margin:0;color:#7a8794;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:760px}.topic-count{text-align:center;color:#7a8794;min-width:52px}.topic-count b{display:block;color:#3d5362}.topic-count small{font-size:11px}.chat-page{height:100vh;display:grid;grid-template-rows:auto 1fr auto;background:linear-gradient(120deg,#dce8ee,#f1f4f6)}.chat-header{min-height:68px;background:#fff;display:grid;grid-template-columns:46px 1fr auto;align-items:center;padding:0 14px;border-bottom:1px solid #dce3e8}.chat-header b{display:block}.chat-header small{display:block;color:#7d8994;margin-top:3px}.back{font-size:28px;color:#229ed9}.header-actions{display:flex;align-items:center;gap:5px}.header-actions button{border:0;background:transparent;cursor:pointer;font-size:17px}.home-link{font-weight:900;color:#229ed9;margin-left:6px}.message-stream{overflow:auto;padding:22px max(18px,calc((100vw - 980px)/2))}.message{display:flex;gap:10px;align-items:flex-end;margin:9px 0}.message.pinned .bubble{border-left:3px solid #229ed9}.bubble{max-width:min(760px,80vw);background:#fff;padding:10px 13px;border-radius:14px 14px 14px 4px;box-shadow:0 1px 2px rgba(0,0,0,.08)}.pin-label{font-size:11px;color:#2288b8;margin-bottom:5px}.msg-meta{display:flex;gap:12px;align-items:center;margin-bottom:5px}.msg-meta b{color:#2288b8}.msg-meta time{font-size:11px;color:#89949e}.msg-text{white-space:normal;line-height:1.42;overflow-wrap:anywhere}.quoted{display:block;border-left:3px solid #229ed9;background:#f2f7fa;border-radius:5px;padding:6px 8px;margin:5px 0 8px}.quoted b,.quoted span{display:block;font-size:12px}.quoted span{color:#6d7a85;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.msg-actions{display:flex;gap:10px;margin-top:8px;flex-wrap:wrap}.msg-actions button{border:0;background:transparent;padding:2px;color:#6d7a85;cursor:pointer}.msg-actions button:hover,.msg-actions button.active{color:#229ed9}.msg-actions .danger:hover{color:#c53f3f}.composer{background:#fff;border-top:1px solid #dce3e8;padding:10px max(14px,calc((100vw - 900px)/2));display:grid;grid-template-columns:1fr 48px;gap:8px;position:relative}.composer textarea,.auth-card textarea{resize:vertical;min-height:44px;max-height:200px;border:1px solid #dfe5ea;border-radius:16px;padding:11px 16px;outline:none}.composer textarea{resize:none;border-radius:22px}.composer textarea:focus,.auth-card textarea:focus{border-color:#229ed9}.composer button{border:0;border-radius:50%;background:#229ed9;color:#fff;font-size:20px;cursor:pointer}.composer button:disabled{opacity:.5}.reply-box{grid-column:1/-1;background:#eef7fb;border-left:3px solid #229ed9;padding:7px 10px;border-radius:6px;color:#54707f;font-size:13px;cursor:pointer}.login-strip{text-align:center;background:#fff;padding:14px;border-top:1px solid #dce3e8;color:#229ed9}.auth-page{min-height:100vh;display:grid;place-items:center;background:#eaf0f4;padding:20px}.auth-card{width:min(420px,92vw);background:#fff;border-radius:20px;padding:26px;box-shadow:0 16px 50px rgba(32,52,68,.12)}.auth-card.wide{width:min(680px,94vw)}.auth-brand{border:0;padding:0 0 20px;height:auto}.auth-card h1{margin-top:0}.auth-card label{display:block;margin:13px 0;color:#495762;font-size:14px}.auth-card input{width:100%;margin-top:6px;border:1px solid #d9e0e6;border-radius:10px;padding:12px}.alert{background:#fff1f1;color:#a43d3d;padding:10px;border-radius:8px}.success{background:#effaf2;color:#317847;padding:10px;border-radius:8px}.muted,.muted-link{color:#7b8792}.muted-link{display:block;text-align:center;margin-top:15px}.profile-head{display:flex;align-items:center;gap:18px}.profile-head h1{margin:0}.page-title{display:flex;justify-content:space-between;gap:20px;align-items:center;margin-bottom:16px}.page-title h1{margin:0}.notice-card,.report-card{display:block;background:#fff;border:1px solid #e4e9ed;border-radius:12px;padding:14px 16px;margin-bottom:10px}.notice-card small{display:block;color:#7d8994;margin-top:5px}.stats-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:12px}.stat{background:#fff;border-radius:14px;padding:20px;text-align:center;border:1px solid #e6ebef}.stat b{display:block;font-size:28px}.stat span{font-size:12px;color:#788590}.admin-links{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:16px}.admin-links a{background:#fff;border:1px solid #e6ebef;border-radius:14px;padding:18px}.inline-actions{display:flex;gap:8px}.inline-actions button,.searchbar button{border:0;background:#229ed9;color:#fff;border-radius:8px;padding:8px 12px;cursor:pointer}.report-card blockquote{margin:10px 0;padding:10px 12px;border-left:3px solid #ccd8e0;background:#f7f9fa}.searchbar{display:flex;gap:8px;margin-bottom:14px}.searchbar input{flex:1;border:1px solid #d9e0e6;border-radius:9px;padding:10px 12px}.table-wrap{overflow:auto;background:#fff;border-radius:12px;border:1px solid #e5eaee}table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:10px 12px;border-bottom:1px solid #edf0f2;font-size:13px}th{background:#f7f9fa}.profile{}
@media(max-width:900px){.stats-grid{grid-template-columns:repeat(2,1fr)}.admin-links{grid-template-columns:1fr}}
@media(max-width:760px){.app-shell{grid-template-columns:1fr}.sidebar{border:0}.main{display:none}.sidebar.compact{display:none}.sidebar.compact+.main{display:block}.channels small{max-width:70vw}.chat-header{min-height:60px}.message-stream{padding:14px 10px}.bubble{max-width:84vw}.message .avatar{width:32px;height:32px;font-size:13px}.composer{padding:8px 10px}.topbar{padding:12px 16px}.topic-list{padding:12px}.topic-card p{max-width:65vw}.topbar .button{font-size:13px}.msg-actions{gap:7px}.msg-actions button{font-size:12px}.stats-grid{grid-template-columns:1fr 1fr}.page-title{align-items:flex-start}}
/* Stage 4 */
.avatar{overflow:hidden}.avatar img{width:100%;height:100%;object-fit:cover;display:block}.avatar.large{width:72px;height:72px;font-size:24px}.attachments{display:flex;gap:8px;flex-wrap:wrap;margin-top:9px}.attachment{display:flex;align-items:center;gap:8px;max-width:320px;padding:8px 10px;border:1px solid #dfe7ed;background:#f8fbfd;border-radius:10px;color:#3d5362}.attachment small{color:#7d8994}.attachment.image{padding:0;border:0;background:transparent}.attachment.image img{display:block;max-width:min(420px,70vw);max-height:420px;border-radius:12px;object-fit:contain}.composer{grid-template-columns:44px 1fr 48px}.attach-picker{display:grid;place-items:center;width:44px;height:44px;border-radius:50%;cursor:pointer;font-size:20px;color:#647786}.attach-picker:hover{background:#eef5f8}.attach-picker input{display:none}.file-preview{grid-column:1/-1;color:#72808b;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.search-result{display:block;background:#fff;border:1px solid #e3e9ed;border-radius:12px;padding:14px 16px;margin-bottom:9px}.search-result b,.search-result small{display:block}.search-result small{color:#7d8994;margin:4px 0}.search-result p{margin:6px 0 0;color:#44545f}.table-email{display:block;color:#7d8994;margin-top:3px}.user-actions{display:flex;gap:5px;align-items:center;min-width:430px}.user-actions input,.user-actions select{border:1px solid #d7e0e6;border-radius:7px;padding:7px}.user-actions input{width:150px}.user-actions button{border:0;background:#229ed9;color:#fff;border-radius:7px;padding:8px 10px;cursor:pointer}
@media(max-width:760px){.composer{grid-template-columns:40px 1fr 44px}.attach-picker{width:40px;height:40px}.attachment.image img{max-width:72vw}.user-actions{min-width:360px}}
/* Stage 5: live messages, typing, unread counters */
.typing-status{grid-column:1/-1;min-height:18px;padding:0 10px 2px;color:#6f8592;font-size:12px;font-style:italic}
.unread-badge{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:#229ed9;color:#fff;font-size:11px;font-style:normal;font-weight:800;vertical-align:middle;margin-left:6px}
.unread-badge[hidden]{display:none!important}
.channel-side{display:flex;align-items:center;gap:6px}.channel-side .unread-badge{margin:0}.channel-side em{margin:0}
.message.new-message{animation:vdaMessageIn .18s ease-out}@keyframes vdaMessageIn{from{opacity:.35;transform:translateY(5px)}to{opacity:1;transform:none}}
@media(max-width:760px){.unread-badge{min-width:19px;height:19px;font-size:10px}.typing-status{padding-left:6px}}
/* Stage 6: Telegram-like chat hierarchy */
.messenger-shell{display:grid;grid-template-columns:330px minmax(0,1fr);height:100vh;overflow:hidden}.messenger-sidebar{overflow:visible;position:relative;z-index:30}.messenger-sidebar .brand{position:relative}.sidebar-close{display:none;margin-left:auto;border:0;background:transparent;font-size:30px;color:#75838d;cursor:pointer}.stage6-channels{position:relative;overflow:visible}.channel-item{position:relative;border-top:1px solid #f1f3f5}.channel-item>.channel-link{border-top:0;min-height:62px}.channel-item.active>.channel-link{background:#eaf6fb}.channel-copy{min-width:0}.channel-item>.subchat-toggle{position:absolute;right:8px;top:16px;width:30px;height:30px;border:0;background:transparent;color:#7c8994;font-size:23px;cursor:pointer;z-index:2}.channel-item:has(.subchat-toggle)>.channel-link{padding-right:46px}.subchat-flyout{display:none;position:absolute;left:calc(100% - 6px);top:-1px;width:330px;max-height:70vh;overflow:auto;background:#fff;border:1px solid #dfe7ed;border-radius:12px;box-shadow:0 18px 45px rgba(27,49,67,.18);padding:7px;z-index:80}.channel-item:hover>.subchat-flyout,.channel-item.flyout-open>.subchat-flyout{display:block}.subchat-flyout .channel-item{border-top:0}.subchat-flyout .channel-link{border-radius:9px;padding:10px 12px}.subchat-flyout .channel-link:hover{background:#f2f7fa}.subchat-flyout .subchat-flyout{left:calc(100% - 2px);top:0}.flyout-title{padding:9px 10px 8px;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:#89949e;font-weight:800}.sidebar-backdrop{display:none}.chat-shell{grid-template-columns:330px minmax(0,1fr)}.stage6-chat{min-width:0}.mobile-menu{display:none;border:0;background:transparent;color:#229ed9;font-size:22px;cursor:pointer}.reaction-row{display:flex;gap:5px;flex-wrap:wrap;margin-top:8px}.reaction-btn{border:1px solid #dce6eb!important;background:#f8fbfc!important;border-radius:16px!important;padding:3px 8px!important;color:#536570!important}.reaction-btn.active{border-color:#7bc1e1!important;background:#e9f7fd!important;color:#1c7fae!important}.reaction-btn span{font-size:11px;font-weight:700}.forward-modal{position:fixed;inset:0;background:rgba(20,34,45,.45);z-index:200;display:grid;place-items:center;padding:18px}.forward-modal[hidden]{display:none}.forward-dialog{width:min(460px,94vw);max-height:76vh;background:#fff;border-radius:16px;box-shadow:0 24px 70px rgba(0,0,0,.24);overflow:hidden;display:grid;grid-template-rows:auto 1fr}.forward-head{display:flex;justify-content:space-between;align-items:center;padding:15px 17px;border-bottom:1px solid #e8edf0}.forward-head button{border:0;background:transparent;font-size:26px;cursor:pointer}.forward-channels{overflow:auto;padding:8px}.forward-channel{width:100%;border:0;background:#fff;text-align:left;padding:11px 12px;border-radius:10px;cursor:pointer}.forward-channel:hover{background:#eff7fa}.forward-channel b,.forward-channel small{display:block}.forward-channel small{color:#82909a;margin-top:2px}.welcome-main{min-width:0}.msg-actions .danger{color:#b65a5a}.message.removing{opacity:.3;transform:scale(.99)}
@media(max-width:900px){.messenger-shell,.chat-shell{grid-template-columns:290px minmax(0,1fr)}.subchat-flyout{width:290px}}
@media(max-width:760px){.messenger-shell,.chat-shell{display:block;height:100vh}.messenger-sidebar{position:fixed;left:0;top:0;bottom:0;width:min(88vw,340px);transform:translateX(-103%);transition:transform .2s ease;background:#fff;box-shadow:12px 0 40px rgba(0,0,0,.18);overflow:auto}.sidebar-open .messenger-sidebar{transform:translateX(0)}.sidebar-open .sidebar-backdrop{display:block;position:fixed;inset:0;background:rgba(12,25,34,.4);z-index:20}.sidebar-close,.mobile-menu{display:block}.subchat-flyout{position:static;width:auto;max-height:none;border:0;box-shadow:none;border-radius:0;padding:0 0 0 18px}.channel-item:hover>.subchat-flyout{display:none}.channel-item.flyout-open>.subchat-flyout{display:block}.subchat-flyout .subchat-flyout{position:static}.stage6-chat{height:100vh}.chat-header{grid-template-columns:42px 1fr auto}.welcome-main{display:block}.topbar{display:flex}.message-stream{padding-bottom:18px}}

/* Stage 6.1: inline subchats in the same left column */
.stage6-channels{overflow-y:auto!important;overflow-x:hidden!important}
.channel-item{position:relative!important}
.channel-item>.subchat-toggle{right:8px!important;top:16px!important;transform:rotate(-90deg);transition:transform .15s ease}
.channel-item.subchat-open>.subchat-toggle{transform:rotate(0deg)}
.subchat-flyout{display:none!important}
.subchat-inline{display:none;position:static;width:auto;max-height:none;overflow:visible;background:transparent;border:0;box-shadow:none;border-radius:0;padding:0}
.channel-item.subchat-open>.subchat-inline{display:block}
.subchat-inline .channel-item{border-top:0}
.subchat-inline .channel-link{min-height:50px;padding-top:8px;padding-bottom:8px;background:#fbfcfd}
.subchat-inline .channel-link:hover{background:#f2f7fa}
.channel-item.depth-1>.channel-link{padding-left:30px}
.channel-item.depth-2>.channel-link{padding-left:48px}
.channel-item.depth-3>.channel-link{padding-left:66px}
.channel-item.depth-4>.channel-link{padding-left:84px}
.channel-item.active>.channel-link{background:#eaf6fb!important}
@media(max-width:760px){.subchat-inline{padding-left:0}.channel-item.depth-1>.channel-link{padding-left:28px}.channel-item.depth-2>.channel-link{padding-left:44px}.channel-item.depth-3>.channel-link{padding-left:60px}}
/* Stage 7: WebRTC calls */
.call-modal,.incoming-call,.active-call-panel{position:fixed;z-index:1000}.call-modal{inset:0;background:rgba(15,23,42,.5);display:grid;place-items:center;padding:20px}.call-modal[hidden],.incoming-call[hidden],.active-call-panel[hidden]{display:none!important}.call-dialog{width:min(520px,100%);max-height:80vh;overflow:auto;background:#fff;border-radius:18px;box-shadow:0 24px 70px rgba(0,0,0,.28);padding:18px}.call-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.call-head button{border:0;background:transparent;font-size:28px;cursor:pointer}.call-user{display:grid;grid-template-columns:42px 1fr 42px 42px;gap:8px;align-items:center;padding:9px;border-radius:12px}.call-user:hover{background:#f3f6fb}.call-user>span{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;overflow:hidden;background:#dfe8f5}.call-user img{width:100%;height:100%;object-fit:cover}.call-user button,.call-control{border:0;border-radius:10px;padding:9px;background:#e8f1fb;cursor:pointer}.incoming-call{right:18px;top:18px;width:min(360px,calc(100% - 36px));background:#fff;border-radius:16px;box-shadow:0 18px 50px rgba(0,0,0,.25);padding:16px}.incoming-actions{display:flex;gap:8px;margin-top:12px}.incoming-actions button{flex:1;border:0;border-radius:10px;padding:10px;cursor:pointer}.incoming-actions .accept{background:#27ae60;color:#fff}.incoming-actions .decline{background:#e74c3c;color:#fff}.active-call-panel{right:18px;bottom:18px;width:min(430px,calc(100% - 36px));background:#172033;color:#fff;border-radius:18px;box-shadow:0 20px 60px rgba(0,0,0,.35);padding:14px}.call-panel-head{display:flex;justify-content:space-between;align-items:center;gap:10px}.call-controls{display:flex;gap:8px;margin-top:12px}.call-controls .end{background:#d94b4b;color:#fff}.call-media{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}.call-media video{width:100%;min-height:110px;max-height:220px;object-fit:cover;border-radius:12px;background:#0b1220}.call-media audio{width:100%;grid-column:1/-1}.header-actions button.call-header-btn{border:0;background:transparent;font-size:19px;cursor:pointer}.group-call-active{color:#27ae60}

/* Stage 8: presence, pinned messages, mentions, chat management */
.pinned-banner{display:flex;align-items:center;gap:10px;padding:9px 16px;background:#f5fbfe;border-bottom:1px solid #dceaf1;color:#314b5a;text-decoration:none;min-height:48px}.pinned-banner[hidden]{display:none}.pinned-banner>span{font-size:20px}.pinned-banner div{min-width:0;display:flex;flex-direction:column}.pinned-banner b{font-size:12px;color:#168bc0}.pinned-banner small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:70vw}.composer-text-wrap{position:relative;flex:1;min-width:0}.composer-text-wrap textarea{width:100%;display:block}.mention-suggest{position:absolute;left:0;bottom:calc(100% + 8px);width:min(340px,80vw);max-height:260px;overflow:auto;background:#fff;border:1px solid #dfe7ed;border-radius:12px;box-shadow:0 12px 35px rgba(20,50,70,.18);z-index:120;padding:5px}.mention-suggest[hidden]{display:none}.mention-item{display:flex;width:100%;align-items:center;gap:9px;border:0;background:#fff;padding:8px 10px;border-radius:8px;text-align:left;cursor:pointer}.mention-item:hover,.mention-item.active{background:#eef7fb}.mention-item .avatar{width:30px;height:30px;flex:0 0 30px}.mention-item img{width:100%;height:100%;border-radius:50%;object-fit:cover}.online-dot{width:8px;height:8px;border-radius:50%;background:#39b56d;display:inline-block;margin-right:4px}.admin-card{background:#fff;border:1px solid #e3e9ed;border-radius:14px;padding:16px;margin:16px 0}.admin-card h2{margin:0 0 12px}.channel-admin-form{display:flex;gap:10px;align-items:end;flex-wrap:wrap}.channel-admin-form label{display:flex;flex-direction:column;gap:5px;font-size:12px;color:#687781}.channel-admin-form input,.channel-admin-form select,.table-wrap input,.table-wrap select{border:1px solid #d6e0e6;border-radius:8px;padding:8px;background:#fff}.channel-admin-form .grow{flex:1;min-width:220px}.tiny-input{width:76px}.nowrap{white-space:nowrap}.danger-btn{color:#a43f3f}.notify-on{background:#e8f7fd!important;color:#1389bd!important}
@media(max-width:720px){.pinned-banner small{max-width:72vw}.channel-admin-form>*{width:100%}.channel-admin-form .grow{min-width:0}.table-wrap{overflow:auto}}
.channel-admin-list{display:grid;gap:10px;margin-top:14px}.channel-admin-row{display:grid;grid-template-columns:58px minmax(160px,1.2fr) minmax(150px,1fr) 90px 130px auto;gap:10px;align-items:end;background:#fff;border:1px solid #e2e9ed;border-radius:12px;padding:12px}.channel-admin-row label{display:flex;flex-direction:column;gap:5px;font-size:12px;color:#6b7982}.channel-admin-row input,.channel-admin-row select{width:100%;border:1px solid #d6e0e6;border-radius:8px;padding:8px;background:#fff}.channel-admin-id{font-weight:800;color:#72818b;align-self:center}.channel-admin-meta{display:flex;flex-direction:column;gap:4px;font-size:12px;color:#6e7c84;align-self:center}.channel-admin-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.channel-admin-actions button{padding:8px 9px}
@media(max-width:1000px){.channel-admin-row{grid-template-columns:45px 1fr 1fr}.channel-admin-meta,.channel-admin-actions{grid-column:2/-1}.channel-admin-actions{justify-content:flex-start}}@media(max-width:620px){.channel-admin-row{grid-template-columns:1fr}.channel-admin-row>*{grid-column:1!important}.channel-admin-id{justify-self:start}}
/* Stage 9: personal chats + refreshed admin */
.dm-sidebar-link{display:flex;align-items:center;gap:10px;margin:8px 10px 12px;padding:10px 12px;border-radius:12px;text-decoration:none;color:#284454;background:#f3f8fb}.dm-sidebar-link:hover{background:#e8f4fa}.dm-sidebar-link span{font-size:20px}.dm-sidebar-link b{flex:1}.dm-sidebar-link em{font-style:normal;background:#229ed9;color:#fff;min-width:22px;height:22px;border-radius:11px;display:grid;place-items:center;font-size:12px}.dm-home{min-width:0;overflow:hidden}.dm-layout{height:calc(100vh - 74px);display:grid;grid-template-columns:minmax(320px,440px) 1fr;background:#eef3f6}.dm-list-panel{background:#fff;border-right:1px solid #dde6eb;overflow:auto}.dm-search{display:flex;gap:8px;padding:14px;position:sticky;top:0;background:#fff;z-index:3;border-bottom:1px solid #edf1f3}.dm-search input{flex:1;border:1px solid #d8e2e7;border-radius:12px;padding:11px 13px}.dm-search button{border:0;background:#229ed9;color:#fff;border-radius:12px;padding:0 15px}.dm-person,.dm-dialog{display:flex;width:100%;align-items:center;gap:11px;padding:12px 14px;border:0;border-bottom:1px solid #f0f3f5;background:#fff;text-decoration:none;color:#243b49;text-align:left;cursor:pointer}.dm-person:hover,.dm-dialog:hover{background:#f4f9fc}.dm-person .avatar,.dm-dialog .avatar{width:46px;height:46px;flex:0 0 46px}.dm-dialog-copy{min-width:0;flex:1}.dm-dialog-copy b,.dm-dialog-copy small,.dm-person b,.dm-person small{display:block}.dm-dialog-copy small,.dm-person small{color:#7c8992;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:3px}.dm-placeholder{display:grid;place-items:center;text-align:center;color:#74838c}.dm-placeholder span{font-size:54px}.dm-placeholder h2{margin:10px 0 6px;color:#3d5563}.dm-message.mine{flex-direction:row-reverse}.dm-message.mine .bubble{background:#e7f7df}.dm-message.mine .msg-meta{justify-content:flex-end}.call-error{margin:10px 0;padding:10px 12px;border-radius:10px;background:#fff3cd;color:#7a5b00;font-size:13px}.admin-body{margin:0;background:#f4f7fa;color:#223746}.admin-shell{min-height:100vh;display:grid;grid-template-columns:250px 1fr}.admin-nav{background:#122534;color:#fff;padding:20px 14px;display:flex;flex-direction:column;gap:22px}.admin-brand{display:flex;align-items:center;gap:10px;color:#fff;text-decoration:none;padding:0 8px}.admin-brand span{width:38px;height:38px;border-radius:12px;background:#229ed9;display:grid;place-items:center;font-weight:900;font-size:20px}.admin-nav nav{display:grid;gap:5px}.admin-nav nav a,.admin-back{color:#c8d6df;text-decoration:none;padding:11px 13px;border-radius:10px}.admin-nav nav a:hover,.admin-nav nav a.active{background:#203b4d;color:#fff}.admin-back{margin-top:auto}.admin-main{padding:28px 32px;max-width:1400px;width:100%;box-sizing:border-box}.admin-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}.admin-top h1{margin:0;font-size:30px}.admin-top p{margin:5px 0 0;color:#72818b}.admin-status{background:#e9f8ef;color:#2b8b50;padding:8px 12px;border-radius:999px;font-size:13px}.admin-stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}.admin-stat-grid article{background:#fff;border:1px solid #e2e9ee;border-radius:16px;padding:18px;display:flex;gap:14px;align-items:center;box-shadow:0 5px 20px rgba(30,58,78,.04)}.admin-stat-grid article>span{width:46px;height:46px;border-radius:14px;background:#edf7fc;display:grid;place-items:center;font-size:22px}.admin-stat-grid b{display:block;font-size:26px}.admin-stat-grid small{color:#788690}.admin-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:22px}.admin-tile{display:grid;grid-template-columns:48px 1fr 24px;align-items:center;gap:14px;background:#fff;border:1px solid #e0e8ed;border-radius:16px;padding:19px;text-decoration:none;color:#263f4e}.admin-tile:hover{border-color:#a9d7eb;box-shadow:0 8px 24px rgba(41,91,120,.08)}.admin-tile>span{width:48px;height:48px;border-radius:14px;background:#f0f7fa;display:grid;place-items:center;font-size:23px}.admin-tile b,.admin-tile small{display:block}.admin-tile small{color:#76858e;margin-top:4px}.admin-tile i{font-style:normal;font-size:22px;color:#229ed9}.admin-page{max-width:1400px;margin:0 auto;padding:28px}.admin-page .page-title{background:#fff;border:1px solid #e1e8ed;border-radius:16px;padding:18px 20px;margin-bottom:16px}.admin-page .table-wrap,.admin-page .admin-card,.admin-page .channel-admin-row{box-shadow:0 6px 20px rgba(34,65,84,.04)}
@media(max-width:900px){.admin-shell{grid-template-columns:1fr}.admin-nav{position:static;flex-direction:row;align-items:center;overflow:auto}.admin-nav nav{display:flex}.admin-back{margin:0 0 0 auto;white-space:nowrap}.admin-stat-grid{grid-template-columns:1fr 1fr}.admin-main{padding:20px}.dm-layout{grid-template-columns:1fr}.dm-placeholder{display:none}}
@media(max-width:620px){.admin-nav{display:block}.admin-nav nav{display:flex;overflow:auto;margin-top:15px}.admin-back{display:block;margin-top:10px}.admin-stat-grid,.admin-grid{grid-template-columns:1fr}.admin-main{padding:14px}.dm-list-panel{border-right:0}.dm-message.mine{flex-direction:row}.dm-message.mine .avatar{visibility:hidden}}

/* Stage 10: group private chats, public profiles, registration */
.success-box{padding:11px 12px;border-radius:10px;background:#eaf8ef;color:#267a48;border:1px solid #caead5;margin:10px 0}.verify-icon{width:58px;height:58px;border-radius:50%;background:#e9f7fd;color:#229ed9;display:grid;place-items:center;font-size:32px;font-weight:900;margin:0 auto 14px}.group-create-page{overflow:auto}.group-create-card{max-width:860px;margin:22px auto;background:#fff;border:1px solid #e2e9ed;border-radius:18px;padding:18px}.group-title-label{display:flex;flex-direction:column;gap:7px;font-weight:700;margin-bottom:14px}.group-title-label input{border:1px solid #d6e0e6;border-radius:12px;padding:12px}.member-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:56vh;overflow:auto;margin:14px 0}.member-pick{display:flex;align-items:center;gap:10px;padding:10px;border:1px solid #e2e9ed;border-radius:12px;cursor:pointer}.member-pick:hover{background:#f6fafc}.member-pick input{width:18px;height:18px}.member-pick .avatar{width:42px;height:42px;flex:0 0 42px}.member-pick span:last-child{min-width:0}.member-pick b,.member-pick small{display:block}.member-pick small{color:#7b8992;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dm-person-row{display:flex;align-items:center;border-bottom:1px solid #eef2f4}.profile-mini-link{display:flex;align-items:center;gap:10px;padding:11px 14px;flex:1;text-decoration:none;color:#263e4c}.profile-mini-link .avatar{width:44px;height:44px;flex:0 0 44px}.profile-mini-link b,.profile-mini-link small{display:block}.profile-mini-link small{color:#7c8992}.mini-action{margin-right:12px;border:0;background:#eaf6fb;color:#168bc0;border-radius:10px;padding:8px 10px;cursor:pointer}.group-avatar{font-size:20px}.group-members-strip{display:flex;gap:10px;overflow:auto;padding:8px 14px;background:#fff;border-bottom:1px solid #e4ebef}.group-members-strip a{min-width:62px;text-align:center;text-decoration:none;color:#4a5d68}.group-members-strip .avatar{width:36px;height:36px;margin:0 auto 3px}.group-members-strip small{display:block;max-width:70px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.msg-meta a{text-decoration:none;color:inherit}.profile-public-page{overflow:auto}.public-profile-card{width:min(620px,calc(100% - 30px));margin:34px auto;background:#fff;border:1px solid #e1e8ed;border-radius:22px;padding:30px;text-align:center;box-shadow:0 12px 36px rgba(30,60,80,.07)}.public-profile-avatar{width:112px;height:112px;border-radius:50%;overflow:hidden;background:#dfeef5;display:grid;place-items:center;font-size:44px;font-weight:800;margin:0 auto 14px}.public-profile-avatar img{width:100%;height:100%;object-fit:cover}.public-profile-card h2{font-size:28px;margin:8px 0}.profile-role{display:inline-block;background:#eef7fb;color:#168bc0;padding:5px 10px;border-radius:999px;font-size:12px}.profile-bio{color:#546872;line-height:1.55}.profile-facts{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;color:#788790;font-size:13px;margin:14px 0 20px}.profile-actions{display:flex;gap:9px;justify-content:center;flex-wrap:wrap}.profile-actions form{margin:0}.sound-help{margin-top:10px;width:100%;border:0;border-radius:10px;padding:10px;background:#f0c85a;color:#463600;font-weight:800;cursor:pointer}.topbar>.button{margin-left:auto}
@media(max-width:680px){.member-picker{grid-template-columns:1fr}.public-profile-card{padding:22px 16px}.profile-actions{display:grid}.profile-actions>*{width:100%}.profile-actions form button{width:100%}}

/* ===== Stage 11 ===== */
.stage11-auth{background:radial-gradient(circle at 15% 15%,rgba(64,142,255,.16),transparent 32%),linear-gradient(135deg,#eef5fb,#f8fbfd 55%,#eef4f8)}
.auth-layout{width:min(980px,calc(100% - 32px));display:grid;grid-template-columns:1fr 1fr;gap:28px;align-items:stretch}
.auth-side{padding:42px;border-radius:28px;background:linear-gradient(145deg,#17283b,#0d1724);color:#fff;box-shadow:0 24px 70px rgba(20,40,65,.18)}
.auth-side h1{font-size:38px;margin:54px 0 12px}.auth-side>p{font-size:18px;line-height:1.6;color:#c8d6e5}.auth-points{display:grid;gap:14px;margin-top:34px;color:#dce8f3}.auth-card.modern{border:0;border-radius:28px;padding:34px;box-shadow:0 24px 70px rgba(20,40,65,.12);background:rgba(255,255,255,.96)}
.auth-card.modern h2{margin:0 0 8px;font-size:28px}.auth-subtitle{color:#6c7b8d;line-height:1.5;margin:0 0 22px}.auth-card label small{display:block;color:#7f8b99;margin-top:6px}.hp-field{position:absolute!important;left:-9999px!important;width:1px;height:1px;overflow:hidden}.verify-card{text-align:center}.verify-icon.ok{background:#dff7e8;color:#16834a}.verify-icon.bad{background:#ffe5e5;color:#b72e2e}.verify-icon.mail{background:#e6f0ff;color:#336fc4}
.profile-security-links{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;padding:24px}.settings-card{background:#fff;border:1px solid #e5ebf1;border-radius:20px;padding:22px;box-shadow:0 8px 30px rgba(31,52,73,.06)}.settings-card:last-child{grid-column:1/-1}.member-admin-list{display:grid;gap:8px}.member-admin-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid #edf1f5}.member-admin-row>a{display:flex;align-items:center;gap:10px;text-decoration:none;color:inherit}.member-admin-row small{display:block;color:#7b8795}.member-admin-row em{font-size:12px;color:#7b8795}.turn-config-list{display:grid;gap:12px;margin:12px 0 18px}.turn-config-list>div{display:grid;grid-template-columns:140px 1fr;gap:12px;align-items:center}.turn-config-list code{overflow-wrap:anywhere;background:#f2f5f8;padding:8px 10px;border-radius:10px}.turn-test-log{margin-top:16px;padding:16px;border-radius:14px;background:#f5f7f9;line-height:1.6}.turn-ok{color:#15824b}.turn-bad{color:#b83232}.stage11-result{text-align:center}
@media(max-width:760px){.auth-layout{grid-template-columns:1fr}.auth-side{display:none}.auth-card.modern{padding:24px;border-radius:22px}.profile-security-links{grid-template-columns:1fr}.settings-grid{grid-template-columns:1fr;padding:14px}.settings-card:last-child{grid-column:auto}.turn-config-list>div{grid-template-columns:1fr}}

/* ===== Stage 12: visual redesign + mobile stability ===== */
:root{--vda-blue:#2a8bdc;--vda-blue-dark:#176fb6;--vda-ink:#17212b;--vda-muted:#788895;--vda-line:#e7edf2;--vda-soft:#f5f8fb;--vda-card:#fff;--vda-shadow:0 14px 40px rgba(28,55,78,.08)}
html,body{width:100%;max-width:100%;overflow-x:hidden}.messenger-shell{grid-template-columns:318px minmax(0,1fr);background:#f4f7fa}.messenger-sidebar{background:#fff;border-right:1px solid var(--vda-line);overflow-y:auto!important;overflow-x:hidden!important}.brand{height:72px;padding:12px 14px;border-bottom:1px solid var(--vda-line);position:sticky!important;top:0;background:rgba(255,255,255,.96);backdrop-filter:blur(12px);z-index:5}.brand-home{display:flex;align-items:center;gap:11px;min-width:0;flex:1}.brand-logo{width:42px;height:42px;background:linear-gradient(145deg,#3aa8ef,#1f7fcc);box-shadow:0 7px 18px rgba(42,139,220,.22);font-size:20px}.brand b{font-size:17px;letter-spacing:-.01em}.brand small{font-size:12px;color:#8997a2}.sidebar-quick{padding:10px 10px 2px}.sidebar-home-link{display:grid;grid-template-columns:38px minmax(0,1fr) auto;align-items:center;gap:9px;padding:9px 10px;border-radius:12px;margin-bottom:3px;color:#31424f}.sidebar-home-link:hover{background:#f3f8fc}.sidebar-home-link .nav-ico{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:#edf6fc;color:var(--vda-blue-dark);font-size:18px}.sidebar-home-link b,.sidebar-home-link small{display:block}.sidebar-home-link b{font-size:14px}.sidebar-home-link small{font-size:11px;color:#87949e;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.nav-badge{font-style:normal;min-width:22px;height:22px;border-radius:11px;padding:0 6px;display:grid;place-items:center;background:var(--vda-blue);color:#fff;font-size:11px;font-weight:800}.sidebar-actions{padding:8px 12px 11px}.me-card{display:grid;grid-template-columns:42px minmax(0,1fr) 22px;align-items:center;gap:10px;padding:10px;border:1px solid var(--vda-line);border-radius:14px;background:linear-gradient(135deg,#fff,#f8fbfd)}.me-card:hover{border-color:#cfe2ef;box-shadow:0 5px 20px rgba(43,83,109,.07)}.me-card .avatar{width:42px;height:42px}.me-card-copy b,.me-card-copy small{display:block}.me-card-copy b{font-size:14px}.me-card-copy small{font-size:11px;color:#87949f;margin-top:2px}.me-card-arrow{font-size:24px;color:#a3afb7}.sidebar-register{display:block;text-align:center;color:var(--vda-blue);font-size:13px;margin-top:10px}.sidebar-section-title{display:flex;align-items:center;justify-content:space-between;padding:12px 16px 8px;color:#8a98a3;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.08em}.sidebar-section-title a{font-size:22px;line-height:1;color:#82919b}.stage6-channels{padding:0 8px 14px}.channel-item{border-top:0!important;margin:2px 0}.channel-item>.channel-link{min-height:52px!important;border-radius:12px;padding:8px 38px 8px 10px!important;grid-template-columns:32px minmax(0,1fr) auto!important;gap:8px!important}.channel-item>.channel-link:hover{background:#f2f7fb}.channel-item.active>.channel-link{background:linear-gradient(135deg,#eaf6ff,#f1f9ff)!important;color:#145f97}.channel-icon{width:30px;height:30px;border-radius:9px;display:grid;place-items:center;background:#eff6fa;font-size:15px!important;font-weight:900;color:#4c829e!important}.channel-item.active>.channel-link .channel-icon{background:#d8efff;color:#1476b9!important}.channels b{font-size:14px;line-height:1.25}.channels small{font-size:11px;max-width:190px!important;margin-top:2px}.unread-badge{font-style:normal;background:var(--vda-blue);color:#fff;border-radius:12px;min-width:22px;height:22px;padding:0 6px;display:grid;place-items:center;font-size:11px;font-weight:800}.channel-item>.subchat-toggle{right:6px!important;top:11px!important;width:30px!important;height:30px!important;border-radius:8px!important;font-size:20px!important}.channel-item>.subchat-toggle:hover{background:#edf5fa}.subchat-inline{margin-left:16px;padding-left:8px!important;border-left:1px solid #e4edf3}.channel-item.depth-1>.channel-link,.channel-item.depth-2>.channel-link,.channel-item.depth-3>.channel-link,.channel-item.depth-4>.channel-link{padding-left:8px!important}.channel-item.depth-1 .channel-icon,.channel-item.depth-2 .channel-icon,.channel-item.depth-3 .channel-icon{width:26px;height:26px;background:transparent;color:#8da1ae!important}.sidebar-footer{position:sticky;bottom:0;display:flex;gap:8px;justify-content:space-between;padding:10px 14px;background:rgba(255,255,255,.96);backdrop-filter:blur(12px);border-top:1px solid var(--vda-line);font-size:12px;color:#73838f}.sidebar-footer a:hover{color:var(--vda-blue)}
.stage12-topbar{min-height:72px;background:rgba(255,255,255,.94);backdrop-filter:blur(12px);padding:10px 24px}.topbar-title{display:flex;align-items:center;gap:10px}.mobile-brand-dot{display:none;width:34px;height:34px;border-radius:10px;background:var(--vda-blue);color:#fff;place-items:center;font-weight:900}.top-actions{align-items:center;gap:8px}.top-icon-link{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;background:#f1f6f9;color:#486270;font-size:22px}.top-icon-link:hover{background:#e7f2f9;color:var(--vda-blue)}.top-profile-link{padding:9px 13px;border-radius:11px;background:#edf6fc;color:#216f9f;font-weight:700;font-size:13px}.home-hero{min-height:390px;display:grid;grid-template-columns:minmax(0,1.08fr) minmax(320px,.92fr);gap:34px;align-items:center;padding:54px clamp(28px,6vw,86px);background:radial-gradient(circle at 80% 10%,rgba(70,160,225,.16),transparent 32%),linear-gradient(145deg,#f7fbfe,#edf5fa)}.eyebrow{display:block;font-size:11px;font-weight:900;letter-spacing:.14em;color:var(--vda-blue-dark);margin-bottom:10px}.home-hero h2{font-size:clamp(36px,4.2vw,62px);line-height:1.04;letter-spacing:-.045em;margin:0;color:#142534}.home-hero p{max-width:670px;color:#667986;font-size:16px;line-height:1.65;margin:20px 0 26px}.home-hero-actions{display:flex;gap:10px;flex-wrap:wrap}.button.ghost{background:#fff;color:#31546a;border:1px solid #dfe9ef}.button.ghost:hover{border-color:#bad6e6}.home-hero-art{display:grid;place-items:center}.hero-chat-card{width:min(390px,100%);height:270px;border-radius:28px;background:linear-gradient(155deg,#1f78b9,#2b9bdc);box-shadow:0 30px 70px rgba(28,94,139,.24);padding:26px;position:relative;overflow:hidden}.hero-chat-card:before{content:"";position:absolute;width:230px;height:230px;border-radius:50%;background:rgba(255,255,255,.08);right:-80px;top:-70px}.hero-chat-card>span{display:inline-block;width:8px;height:8px;border-radius:50%;background:rgba(255,255,255,.55);margin-right:5px}.hero-bubble{position:absolute;background:#fff;color:#38515f;border-radius:16px;padding:10px 14px;font-size:13px;box-shadow:0 7px 20px rgba(0,0,0,.1)}.hero-bubble.one{left:28px;top:72px}.hero-bubble.two{right:24px;top:130px;background:#dff3ff}.hero-bubble.three{left:52px;bottom:28px}.home-section{padding:34px clamp(22px,5vw,72px) 18px;background:#f6f8fa}.home-section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:18px}.home-section-head h3{font-size:26px;margin:0}.mobile-open-chats{display:none;border:0;background:#e9f4fb;color:#2276a8;border-radius:10px;padding:9px 12px;font-weight:700}.home-chat-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.home-chat-card{display:grid;grid-template-columns:48px minmax(0,1fr) 28px;align-items:center;gap:12px;background:#fff;border:1px solid #e5ebf0;border-radius:17px;padding:15px 16px;box-shadow:0 5px 20px rgba(35,68,91,.035)}.home-chat-card:hover{transform:translateY(-1px);border-color:#cfe2ef;box-shadow:0 9px 28px rgba(35,68,91,.07)}.home-chat-icon{width:46px;height:46px;border-radius:14px;background:#eef7fc;display:grid;place-items:center;font-size:21px}.home-chat-card b,.home-chat-card small{display:block}.home-chat-card b{font-size:15px}.home-chat-card small{color:#84919a;font-size:12px;margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.home-card-arrow{font-size:25px;color:#9dacb5}.home-info-strip{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;margin:22px clamp(22px,5vw,72px) 40px;border:1px solid #e5ebef;border-radius:18px;overflow:hidden;background:#e5ebef}.home-info-strip>div{background:#fff;padding:20px}.home-info-strip b,.home-info-strip small{display:block}.home-info-strip small{color:#83919a;margin-top:5px;font-size:12px}
.chat-header{min-height:66px!important;padding:8px 14px!important;background:rgba(255,255,255,.96);backdrop-filter:blur(12px);position:relative;z-index:6}.chat-header>div:nth-child(2){min-width:0}.chat-header>div:nth-child(2)>b,.chat-header>div:nth-child(2)>small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.header-actions{gap:3px}.header-actions>a,.header-actions>button{width:36px;height:36px;display:grid;place-items:center;border-radius:10px!important}.header-actions>a:hover,.header-actions>button:hover{background:#edf5fa}.home-link{font-size:0!important;margin-left:2px!important}.home-link:after{content:"⌂";font-size:21px;font-weight:400}.message-stream{scrollbar-width:thin}.composer{padding-bottom:max(10px,env(safe-area-inset-bottom))}
@media(max-width:980px){.messenger-shell{grid-template-columns:290px minmax(0,1fr)}.home-hero{grid-template-columns:1fr;padding:42px 34px}.home-hero-art{display:none}.home-chat-grid{grid-template-columns:1fr}}
@media(max-width:760px){html,body{height:100%;min-height:100dvh}.messenger-shell,.chat-shell{height:100dvh;min-height:100dvh;display:block}.messenger-sidebar{width:min(92vw,360px)!important;height:100dvh!important;bottom:auto!important;transform:translate3d(-104%,0,0);box-shadow:18px 0 48px rgba(15,36,52,.24);z-index:100!important}.sidebar-open .messenger-sidebar{transform:translate3d(0,0,0)}.sidebar-open{overflow:hidden}.sidebar-open .sidebar-backdrop{z-index:90!important;background:rgba(14,28,38,.48)!important;backdrop-filter:blur(2px)}.brand{height:66px}.sidebar-close{width:36px;height:36px;border-radius:10px;background:#f2f6f8;display:grid!important;place-items:center;line-height:1}.sidebar-quick{padding-top:8px}.sidebar-home-link{padding:8px}.stage6-channels{padding-bottom:84px}.sidebar-footer{position:fixed;left:0;bottom:0;width:min(92vw,360px);padding-bottom:max(12px,env(safe-area-inset-bottom))}.welcome-main{height:100dvh;overflow-y:auto!important;-webkit-overflow-scrolling:touch}.stage12-topbar{min-height:60px;padding:8px 11px;position:sticky;top:0;z-index:20}.mobile-menu{display:grid!important;place-items:center;width:40px;height:40px;border-radius:11px;background:#edf5fa;font-size:20px}.mobile-brand-dot{display:grid}.topbar-title h1{font-size:16px}.topbar-title p{font-size:11px;margin-top:1px}.top-actions .top-profile-link{display:none}.top-actions{margin-left:auto}.top-icon-link{width:36px;height:36px}.home-hero{min-height:auto;padding:34px 18px 30px}.home-hero h2{font-size:36px}.home-hero p{font-size:14px;margin:16px 0 22px}.home-hero-actions{display:grid;grid-template-columns:1fr 1fr}.home-hero-actions .button{width:100%}.home-section{padding:24px 14px 12px}.home-section-head h3{font-size:22px}.mobile-open-chats{display:block}.home-chat-grid{gap:8px}.home-chat-card{padding:12px;border-radius:14px}.home-chat-icon{width:42px;height:42px}.home-info-strip{grid-template-columns:1fr;margin:16px 14px 28px}.home-info-strip>div{padding:15px}.chat-page.stage6-chat{height:100dvh!important;min-height:100dvh;grid-template-rows:auto auto minmax(0,1fr) auto!important}.chat-header{min-height:58px!important;grid-template-columns:42px minmax(0,1fr) auto!important;padding:7px 8px!important;position:sticky;top:0}.header-actions{max-width:148px;overflow-x:auto;scrollbar-width:none}.header-actions::-webkit-scrollbar{display:none}.header-actions>a,.header-actions>button{flex:0 0 34px;width:34px;height:34px}.message-stream{min-height:0!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch;padding:12px 8px 14px!important}.message{gap:7px;margin:7px 0}.message .avatar{width:30px!important;height:30px!important;flex:0 0 30px}.bubble{max-width:calc(100vw - 54px)!important;padding:9px 11px;border-radius:13px 13px 13px 4px}.msg-meta{gap:7px;flex-wrap:wrap}.msg-meta b{font-size:13px}.msg-meta time{font-size:10px}.msg-text{font-size:14px;line-height:1.4}.msg-actions{gap:4px 8px;margin-top:7px}.msg-actions button{font-size:11px}.reaction-row{gap:3px}.reaction-btn{padding:2px 6px!important}.attachment.image img{max-width:calc(100vw - 78px)!important;max-height:52vh}.composer{position:sticky!important;bottom:0;z-index:10;grid-template-columns:38px minmax(0,1fr) 42px!important;gap:6px;padding:7px 8px max(7px,env(safe-area-inset-bottom))!important}.attach-picker{width:38px;height:38px}.composer textarea{min-height:40px!important;border-radius:20px;padding:9px 12px;font-size:16px}.composer>button[type=submit]{width:42px;height:42px}.typing-status,.reply-box,.file-preview{grid-column:1/-1}.pinned-banner{font-size:12px}.call-modal,.forward-modal{padding:8px}.call-dialog,.forward-dialog{width:100%!important;max-height:88dvh!important;border-radius:18px 18px 0 0;margin-top:auto}.active-call-panel{max-width:calc(100vw - 16px)!important;left:8px!important;right:8px!important;bottom:8px!important}.dm-layout{height:100dvh!important}.dm-list-panel{min-width:0}.public-profile-card{width:calc(100% - 20px);margin:14px auto}.settings-grid{padding:10px!important;gap:10px}.settings-card{padding:16px}.page-title{gap:10px}.table-wrap{border-radius:10px}.admin-page{padding:12px!important}}
@media(max-width:420px){.home-hero-actions{grid-template-columns:1fr}.home-hero h2{font-size:32px}.topbar-title p{display:none}.header-actions{max-width:112px}.chat-header small{font-size:10px}.bubble{max-width:calc(100vw - 48px)!important}.message .avatar{width:27px!important;height:27px!important;flex-basis:27px}.home-chat-card{grid-template-columns:42px minmax(0,1fr) 22px}.home-chat-icon{width:40px;height:40px}}


/* ===== Stage 12.2: Telegram-like chat list ===== */
.stage6-channels{padding:0 6px 18px!important}.stage6-channels .channel-item{margin:0!important;border:0!important}.stage6-channels .channel-link.telegram-channel{display:grid!important;grid-template-columns:48px minmax(0,1fr)!important;gap:11px!important;align-items:center!important;min-height:64px!important;padding:7px 9px!important;border-radius:10px!important;color:#17212b!important;text-decoration:none!important;position:relative!important}.stage6-channels .channel-link.telegram-channel:hover{background:#f4f6f8!important}.stage6-channels .channel-item.active>.channel-link.telegram-channel{background:#e7f3fb!important;color:#17212b!important}.telegram-avatar{width:48px!important;height:48px!important;min-width:48px!important;border-radius:50%!important;background:linear-gradient(145deg,#47b5e9,#2a8dcc)!important;color:#fff!important;display:grid!important;place-items:center!important;font-size:18px!important;font-weight:800!important;box-shadow:none!important}.channel-item.depth-1>.channel-link .telegram-avatar{width:40px!important;height:40px!important;min-width:40px!important;font-size:15px!important;background:linear-gradient(145deg,#88c8e8,#61add3)!important}.channel-item.depth-2>.channel-link .telegram-avatar,.channel-item.depth-3>.channel-link .telegram-avatar{width:36px!important;height:36px!important;min-width:36px!important;font-size:14px!important;background:#a9cfe2!important}.telegram-channel .channel-copy{min-width:0!important;display:block!important}.telegram-channel .channel-title-row{display:flex!important;align-items:center!important;gap:8px!important;min-width:0!important}.telegram-channel .channel-title-row b{font-size:14px!important;font-weight:700!important;line-height:1.25!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;min-width:0!important;flex:1!important}.telegram-channel .channel-copy small{display:block!important;margin-top:4px!important;color:#7b8790!important;font-size:12px!important;line-height:1.2!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;max-width:none!important}.telegram-channel .unread-badge{position:static!important;flex:0 0 auto!important;min-width:21px!important;height:21px!important;padding:0 6px!important;border-radius:11px!important;background:#42a5d8!important;color:#fff!important;font-size:11px!important}.telegram-subchats{display:block!important;margin:0 0 2px 26px!important;padding:0 0 0 14px!important;border-left:2px solid #edf1f4!important}.telegram-subchats>.channel-item>.channel-link.telegram-channel{min-height:54px!important;padding-top:5px!important;padding-bottom:5px!important}.telegram-subchats .telegram-channel .channel-copy small{font-size:11px!important}.stage6-channels .subchat-toggle{display:none!important}.stage6-channels .channel-item.depth-1,.stage6-channels .channel-item.depth-2,.stage6-channels .channel-item.depth-3{margin:0!important}.stage6-channels .channel-item.depth-1>.channel-link.telegram-channel{grid-template-columns:40px minmax(0,1fr)!important}.stage6-channels .channel-item.depth-2>.channel-link.telegram-channel,.stage6-channels .channel-item.depth-3>.channel-link.telegram-channel{grid-template-columns:36px minmax(0,1fr)!important}.sidebar-section-title{padding-bottom:6px!important}
@media(max-width:760px){.stage6-channels{padding-left:4px!important;padding-right:4px!important}.stage6-channels .channel-link.telegram-channel{min-height:62px!important;padding:7px 8px!important}.telegram-subchats{margin-left:22px!important;padding-left:10px!important}.telegram-avatar{width:46px!important;height:46px!important;min-width:46px!important}.channel-item.depth-1>.channel-link .telegram-avatar{width:38px!important;height:38px!important;min-width:38px!important}.stage6-channels .channel-item.depth-1>.channel-link.telegram-channel{grid-template-columns:38px minmax(0,1fr)!important}.telegram-channel .channel-title-row b{font-size:14px!important}.telegram-channel .channel-copy small{font-size:11px!important}}

/* ===== Stage 12.3: collapsible Telegram-like sidebar + polished chat header ===== */
.sidebar-title-actions{display:flex;align-items:center;gap:8px}.sidebar-title-actions button{border:0;background:transparent;color:#7d8c97;font-size:11px;font-weight:700;cursor:pointer;padding:4px 7px;border-radius:7px}.sidebar-title-actions button:hover{background:#edf5fa;color:#257da9}.sidebar-title-actions a{font-size:21px!important}
.channel-item[data-has-children="1"]>.channel-link .chat-group-toggle{cursor:pointer;position:relative;transition:transform .18s ease,box-shadow .18s ease}.channel-item[data-has-children="1"]>.channel-link .chat-group-toggle:after{content:"";position:absolute;right:2px;bottom:2px;width:9px;height:9px;border-radius:50%;background:#fff;border:2px solid #42a5d8;box-sizing:border-box}.channel-item[data-has-children="1"]>.channel-link .chat-group-toggle:hover{box-shadow:0 0 0 4px rgba(66,165,216,.12)!important}.channel-item.chat-group-collapsed>.telegram-subchats{display:none!important}.channel-item.has-active-child>.channel-link{background:#f6fbfe}.channel-item.has-active-child>.channel-link .telegram-avatar:after{background:#42a5d8;border-color:#fff}.telegram-subchats{animation:vdaSubchatIn .16s ease}@keyframes vdaSubchatIn{from{opacity:.4;transform:translateY(-3px)}to{opacity:1;transform:none}}

.telegram-chat-header{min-height:78px!important;padding:9px 16px!important;grid-template-columns:46px minmax(0,1fr) auto!important;border-bottom:1px solid #e4ebf0!important;box-shadow:0 1px 8px rgba(26,57,78,.045)}.chat-head-main{display:flex;align-items:center;gap:12px;min-width:0}.chat-head-avatar{width:46px;height:46px;flex:0 0 46px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(145deg,#40afe4,#278dc5);color:#fff;font-size:21px;font-weight:800;box-shadow:0 4px 14px rgba(34,142,197,.2)}.chat-head-copy{min-width:0}.chat-head-copy h1{margin:0;font-size:20px;line-height:1.2;font-weight:760;letter-spacing:-.015em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-head-meta{display:flex;align-items:center;gap:8px;margin-top:5px;color:#7c8c97;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-head-meta>span{overflow:hidden;text-overflow:ellipsis}.chat-locked{color:#a16e31!important}.telegram-header-actions{gap:7px!important;margin-left:12px}.telegram-header-actions .header-action{width:44px!important;height:44px!important;flex:0 0 44px;border:0;background:#f3f7fa;color:#405360;border-radius:13px!important;display:grid!important;place-items:center;position:relative;cursor:pointer;transition:background .15s ease,transform .15s ease,color .15s ease;text-decoration:none!important}.telegram-header-actions .header-action>span{font-size:20px;line-height:1}.telegram-header-actions .header-action>em{display:none}.telegram-header-actions .header-action:hover{background:#e6f2f9!important;color:#1f7da9;transform:translateY(-1px)}.telegram-header-actions .home-link{font-size:inherit!important;margin-left:2px!important}.telegram-header-actions .home-link:after{content:none!important}.telegram-header-actions .channel-mod{font-size:inherit!important}.telegram-header-actions .group-call-active{background:#e7f7ed!important;color:#218b4c!important}

@media(min-width:1180px){.telegram-header-actions .header-action{width:auto!important;min-width:44px;padding:0 11px;grid-template-columns:auto auto!important;gap:6px}.telegram-header-actions .header-action>em{display:block;font-style:normal;font-size:11px;font-weight:700}.telegram-header-actions .header-action>span{font-size:18px}}
@media(max-width:760px){.sidebar-title-actions button{font-size:10px}.telegram-chat-header{min-height:64px!important;padding:7px 8px!important;grid-template-columns:40px minmax(0,1fr) auto!important}.chat-head-avatar{width:38px;height:38px;flex-basis:38px;font-size:17px}.chat-head-main{gap:8px}.chat-head-copy h1{font-size:16px}.chat-head-meta{font-size:10px;margin-top:3px;max-width:44vw}.telegram-header-actions{gap:4px!important;margin-left:4px;max-width:132px!important;overflow-x:auto}.telegram-header-actions .header-action{width:36px!important;height:36px!important;flex:0 0 36px;border-radius:10px!important}.telegram-header-actions .header-action>span{font-size:17px}.telegram-header-actions .header-action>em{display:none!important}}
@media(max-width:420px){.chat-head-avatar{display:none}.chat-head-main{gap:0}.chat-head-meta{max-width:42vw}.telegram-header-actions{max-width:112px!important}}


/* Stage 12.3.3 — collapsible Telegram-style chat branches */
.stage6-channels .channel-item[data-has-children="1"]{position:relative!important}
.stage6-channels .chat-branch-toggle{position:absolute;left:42px;top:43px;z-index:4;width:20px;height:20px;border:2px solid #fff;border-radius:50%;display:grid;place-items:center;padding:0;background:#42a5d8;color:#fff;font:700 15px/1 Arial,sans-serif;cursor:pointer;box-shadow:0 1px 4px rgba(0,0,0,.16);transition:transform .15s ease,background .15s ease}
.stage6-channels .chat-branch-toggle:hover{background:#238fc7;transform:scale(1.06)}
.stage6-channels .chat-branch-toggle span{display:block;transform:translateY(-1px)}
.stage6-channels .channel-item.chat-group-collapsed > .telegram-subchats{display:none!important}
.stage6-channels .channel-item:not(.chat-group-collapsed) > .telegram-subchats{display:block!important}
.stage6-channels .channel-item.depth-1>.chat-branch-toggle{left:34px;top:35px;width:18px;height:18px;font-size:13px}
.stage6-channels .channel-item.depth-2>.chat-branch-toggle,.stage6-channels .channel-item.depth-3>.chat-branch-toggle{left:30px;top:31px;width:17px;height:17px;font-size:12px}
@media(max-width:760px){.stage6-channels .chat-branch-toggle{left:40px;top:41px}.stage6-channels .channel-item.depth-1>.chat-branch-toggle{left:32px;top:33px}}

/* ===== Stage 12.4: polished direct-message chat ===== */
body[data-dm-id] .chat-page{background:#dfeaf0;min-width:0}
body[data-dm-id] .chat-header{min-height:72px;padding:8px 16px;grid-template-columns:42px minmax(0,1fr) auto;border-bottom:1px solid #e4eaee;box-shadow:0 1px 8px rgba(22,52,72,.05)}
body[data-dm-id] .dm-title-block{min-width:0;padding-left:2px}
body[data-dm-id] .dm-title-block b{font-size:18px;line-height:1.2;font-weight:760;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body[data-dm-id] .dm-title-block small{margin-top:4px;font-size:12px;color:#82909a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body[data-dm-id] .header-actions{gap:7px}
body[data-dm-id] .header-actions>a,
body[data-dm-id] .header-actions>button{width:40px;height:40px;display:grid;place-items:center;border:0;border-radius:12px;background:#f2f6f8;color:#3f5360;font-size:18px;cursor:pointer;transition:.15s ease}
body[data-dm-id] .header-actions>a:hover,
body[data-dm-id] .header-actions>button:hover{background:#e5f2f8;color:#2184b3;transform:translateY(-1px)}
body[data-dm-id] .message-stream{padding-bottom:24px}
body[data-dm-id] .dm-message.mine{flex-direction:row-reverse}
body[data-dm-id] .dm-message.mine .bubble{background:#e8f7df;border-radius:15px 15px 4px 15px}
body[data-dm-id] .dm-message.mine .msg-meta{justify-content:flex-end}

/* DM composer must not inherit the public-chat attachment column. */
body[data-dm-id] #dmComposer{display:grid!important;grid-template-columns:minmax(0,1fr) 52px!important;grid-template-rows:auto!important;align-items:end!important;gap:10px!important;padding:10px clamp(12px,5vw,72px)!important;background:#fff!important;border-top:1px solid #dce4e9!important;box-shadow:0 -3px 16px rgba(28,60,80,.045)!important}
body[data-dm-id] #dmComposer #dmReplyBox{grid-column:1/-1!important;margin:0 0 2px!important}
body[data-dm-id] #dmComposer #dmContent{grid-column:1!important;width:100%!important;min-width:0!important;min-height:50px!important;max-height:160px!important;margin:0!important;padding:13px 18px!important;border:1px solid #d9e2e7!important;border-radius:25px!important;background:#f6f8fa!important;font-size:15px!important;line-height:22px!important;resize:none!important;outline:none!important;box-shadow:none!important}
body[data-dm-id] #dmComposer #dmContent:focus{background:#fff!important;border-color:#55add5!important;box-shadow:0 0 0 3px rgba(48,157,207,.10)!important}
body[data-dm-id] #dmComposer>button[type="submit"]{grid-column:2!important;width:50px!important;height:50px!important;min-width:50px!important;min-height:50px!important;padding:0!important;margin:0!important;align-self:end!important;border:0!important;border-radius:50%!important;background:#2a9ed3!important;color:#fff!important;font-size:22px!important;line-height:1!important;display:grid!important;place-items:center!important;box-shadow:0 4px 13px rgba(42,158,211,.28)!important;cursor:pointer!important;transition:transform .15s ease,background .15s ease!important}
body[data-dm-id] #dmComposer>button[type="submit"]:hover{background:#188fc7!important;transform:scale(1.04)!important}
body[data-dm-id] #dmComposer>button[type="submit"]:active{transform:scale(.96)!important}

@media(max-width:760px){
 body[data-dm-id] .chat-header{min-height:62px;padding:7px 9px;grid-template-columns:38px minmax(0,1fr) auto}
 body[data-dm-id] .dm-title-block b{font-size:16px}
 body[data-dm-id] .header-actions{gap:4px;max-width:144px;overflow-x:auto}
 body[data-dm-id] .header-actions>a,body[data-dm-id] .header-actions>button{width:36px;height:36px;flex:0 0 36px;border-radius:10px;font-size:16px}
 body[data-dm-id] #dmComposer{grid-template-columns:minmax(0,1fr) 46px!important;gap:7px!important;padding:8px 9px calc(8px + env(safe-area-inset-bottom))!important}
 body[data-dm-id] #dmComposer #dmContent{min-height:46px!important;padding:11px 15px!important;border-radius:23px!important;font-size:16px!important}
 body[data-dm-id] #dmComposer>button[type="submit"]{width:46px!important;height:46px!important;min-width:46px!important;min-height:46px!important;font-size:20px!important}
 body[data-dm-id] .message-stream{padding:12px 8px 18px!important}
 body[data-dm-id] .dm-message .bubble{max-width:82vw!important}
}

/* ===== Stage 13: chat descriptions + private access groups ===== */
.channel-about{margin:10px 16px 0;border:1px solid #dbe7f0;border-radius:14px;background:#fff;box-shadow:0 3px 14px rgba(30,80,120,.05);overflow:hidden}.channel-about summary{list-style:none;display:flex;align-items:center;gap:9px;padding:10px 14px;cursor:pointer;color:#276b94}.channel-about summary::-webkit-details-marker{display:none}.channel-about summary b{font-size:14px}.channel-about summary small{margin-left:auto;color:#8a99a5}.channel-about-body{padding:0 14px 14px;line-height:1.55;color:#34495a;border-top:1px solid #eef4f8;padding-top:12px}.private-chat-notice{margin:8px 16px 0;padding:8px 12px;border-radius:12px;background:#fff7df;color:#7a5b00;font-size:13px;border:1px solid #f0dfaa}.telegram-channel .channel-title-row b:after{content:''}.channel-item.private .telegram-avatar{box-shadow:inset 0 0 0 2px rgba(255,255,255,.45)}
.stage13-channel-form textarea,.stage13-channel-row textarea{width:100%;resize:vertical}.stage13-channel-row{grid-template-columns:54px minmax(160px,1fr) minmax(150px,.8fr) 80px minmax(220px,1.35fr) 120px minmax(180px,.9fr) minmax(160px,.9fr) auto!important;align-items:end}.privacy-check{display:flex!important;align-items:center;gap:7px;white-space:nowrap}.privacy-check input{width:auto!important}.channel-groups select,.stage13-channel-form select[multiple]{min-height:70px}.access-group-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:14px}.access-group-card{margin:0}.access-group-head{display:grid;grid-template-columns:1fr 1.4fr auto;gap:8px}.access-group-stats{display:flex;gap:12px;color:#6e7f8c;font-size:13px;margin:10px 0}.member-chips{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0}.member-chip{display:inline-flex;align-items:center;background:#eef6fb;border-radius:999px;padding:3px 5px 3px 10px;gap:5px}.member-chip button{border:0;background:transparent;cursor:pointer;font-size:18px;line-height:1}.access-add-member{display:flex;gap:8px;margin:10px 0}.access-add-member select{flex:1}.admin-error{padding:12px 14px;border-radius:10px;background:#fff0f0;color:#a12a2a;margin:12px 0}
@media(max-width:900px){.stage13-channel-row{grid-template-columns:1fr!important}.access-group-head{grid-template-columns:1fr}.channel-about{margin:8px 10px 0}.private-chat-notice{margin:7px 10px 0}.channel-about summary small{display:none}}

/* Stage 13.1 — polished admin channels + search */
.channels-admin-page{max-width:1280px;margin:0 auto;padding:30px 28px 60px}.channels-admin-hero{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;margin-bottom:22px}.channels-admin-hero h1{margin:4px 0 8px;font-size:34px;letter-spacing:-.03em}.channels-admin-hero p{margin:0;color:#72808d;max-width:700px}.admin-eyebrow{text-transform:uppercase;letter-spacing:.12em;font-size:11px;font-weight:800;color:#2b96cf}.channels-admin-top-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}.admin-soft-btn,.admin-back-btn{display:inline-flex;align-items:center;justify-content:center;height:42px;padding:0 14px;border-radius:12px;background:#fff;border:1px solid #dfe8ef;font-weight:700;color:#344a59;box-shadow:0 3px 12px rgba(31,62,82,.04)}.admin-soft-btn:hover,.admin-back-btn:hover{background:#f4f9fc}.admin-back-btn{color:#1d7eae}.admin-stat-grid.channel-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:18px}.admin-stat-card{background:#fff;border:1px solid #e2eaf0;border-radius:16px;padding:16px 18px;box-shadow:0 6px 22px rgba(31,62,82,.045)}.admin-stat-card span,.admin-stat-card small{display:block;color:#7b8994}.admin-stat-card b{display:block;font-size:27px;margin:4px 0 1px}.admin-card{background:#fff;border:1px solid #e1e9ef;border-radius:18px;padding:20px;box-shadow:0 8px 28px rgba(31,62,82,.045);margin-bottom:18px}.admin-section-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.admin-section-head>div{display:flex;align-items:center;gap:11px}.admin-section-head h2,.channel-browser-head h2{margin:0;font-size:20px}.admin-section-head p,.channel-browser-head p{margin:4px 0 0;color:#82909b;font-size:13px}.admin-section-icon{width:38px;height:38px;border-radius:12px;background:#eaf6fc;color:#258dc2;display:grid;place-items:center;font-size:23px}.channel-create-grid,.channel-edit-grid{display:grid;grid-template-columns:minmax(200px,1.1fr) minmax(190px,1fr) 100px minmax(220px,1.3fr);gap:14px;align-items:start}.channel-create-grid label,.channel-edit-grid label{display:block}.channel-create-grid label>span:first-child,.channel-edit-grid label>span:first-child{display:block;font-size:12px;font-weight:800;color:#657581;margin-bottom:6px}.channel-create-grid input,.channel-create-grid select,.channel-create-grid textarea,.channel-edit-grid input,.channel-edit-grid select,.channel-edit-grid textarea{width:100%;border:1px solid #dbe5ec;border-radius:11px;background:#fbfdfe;padding:10px 11px;outline:none;transition:border-color .15s,box-shadow .15s}.channel-create-grid input:focus,.channel-create-grid select:focus,.channel-create-grid textarea:focus,.channel-edit-grid input:focus,.channel-edit-grid select:focus,.channel-edit-grid textarea:focus{border-color:#4ba9d7;box-shadow:0 0 0 3px rgba(75,169,215,.12);background:#fff}.wide-field{grid-column:span 2}.admin-multi-select{min-height:104px}.field-help{display:block;color:#98a4ad;font-size:11px;margin-top:5px}.privacy-switch{display:flex!important;align-items:center;gap:10px;padding:10px 12px;border:1px solid #e2e9ee;border-radius:12px;background:#f9fbfc;min-height:58px}.privacy-switch input{position:absolute;opacity:0;width:1px!important}.fake-switch{width:40px;height:23px;border-radius:999px;background:#cbd5dc;position:relative;flex:0 0 auto;transition:.2s}.fake-switch:after{content:"";position:absolute;width:17px;height:17px;top:3px;left:3px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.18);transition:.2s}.privacy-switch input:checked+.fake-switch{background:#35a4d9}.privacy-switch input:checked+.fake-switch:after{transform:translateX(17px)}.privacy-switch b{display:block;font-size:13px}.privacy-switch small{display:block;color:#8a98a3;font-size:11px;margin-top:2px}.create-submit{display:flex;align-items:end;height:100%}.create-submit .button{min-height:44px}.channel-browser-head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:14px}.channel-search-wrap{width:min(420px,100%);height:46px;background:#f7fafc;border:1px solid #dfe7ed;border-radius:14px;display:flex;align-items:center;gap:8px;padding:0 10px}.channel-search-wrap>span{font-size:22px;color:#6b7c88}.channel-search-wrap input{flex:1;border:0;background:transparent;outline:none;min-width:0}.channel-search-wrap button{border:0;background:transparent;color:#81909a;font-size:22px;cursor:pointer;visibility:hidden}.channel-filter-row{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}.channel-filter{border:1px solid #dee7ed;background:#fff;border-radius:999px;padding:7px 12px;cursor:pointer;color:#5f707c;font-weight:700;font-size:12px}.channel-filter.active{background:#e9f6fc;border-color:#bde0ef;color:#227ca8}.pretty-channel-list{display:grid;gap:10px}.channel-editor-card{background:#fbfdfe;border:1px solid #e1e9ef;border-radius:15px;overflow:hidden}.channel-editor-card[hidden]{display:none!important}.channel-editor-summary{display:grid;grid-template-columns:46px minmax(0,1fr) auto;gap:12px;align-items:center;padding:12px 14px}.channel-admin-avatar{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(145deg,#45b3e7,#2a91c9);color:#fff;font-weight:800;font-size:18px}.channel-editor-title{min-width:0}.channel-title-line{display:flex;align-items:center;gap:7px;min-width:0}.channel-title-line h3{margin:0;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.channel-editor-title p{margin:4px 0 0;color:#85939e;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.status-pill{font-size:10px;font-weight:800;padding:3px 7px;border-radius:999px;white-space:nowrap}.status-pill.private{background:#fff2d8;color:#8a6400}.status-pill.locked{background:#f1f3f5;color:#687782}.channel-edit-toggle{border:0;background:#eaf5fb;color:#227fae;border-radius:10px;padding:8px 12px;font-weight:800;cursor:pointer}.channel-editor-body{display:none;border-top:1px solid #e7edf2;padding:16px;background:#fff}.channel-editor-card.open .channel-editor-body{display:block}.channel-editor-footer{display:flex;justify-content:space-between;align-items:center;gap:14px;border-top:1px solid #edf1f4;margin-top:15px;padding-top:14px}.channel-meta-pills{display:flex;flex-wrap:wrap;gap:6px}.channel-meta-pills span{background:#f1f5f8;color:#70808b;border-radius:999px;padding:5px 9px;font-size:11px}.channel-editor-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.admin-secondary-btn,.admin-danger-btn,.admin-save-btn{border:0;border-radius:10px;padding:9px 12px;font-weight:800;cursor:pointer}.admin-secondary-btn{background:#edf3f6;color:#526571}.admin-danger-btn{background:#fff0f0;color:#b23b3b}.admin-save-btn{background:#229ed9;color:#fff}.channel-search-empty{text-align:center;padding:28px;color:#7e8c96}.search-page-body{background:#eef3f7;min-height:100vh}.search-page-shell{max-width:980px;margin:0 auto;padding:28px 20px 60px}.search-page-head{display:flex;gap:14px;align-items:flex-start;margin-bottom:20px}.search-back{width:42px;height:42px;border-radius:13px;background:#fff;border:1px solid #dfe8ef;display:grid;place-items:center;font-size:22px;color:#287fa9}.search-page-head h1{margin:4px 0 5px;font-size:28px}.search-page-head p{margin:0;color:#7f8e99}.modern-searchbar{display:grid;grid-template-columns:28px 1fr auto;gap:8px;align-items:center;background:#fff;border:1px solid #dfe7ed;border-radius:16px;padding:8px 9px 8px 13px;box-shadow:0 6px 22px rgba(31,62,82,.045);margin-bottom:18px}.modern-searchbar>span{font-size:22px;color:#6f808b}.modern-searchbar input{border:0;outline:0;background:transparent;font-size:16px;min-width:0}.modern-searchbar button{border:0;border-radius:11px;background:#229ed9;color:#fff;padding:10px 18px;font-weight:800;cursor:pointer}.search-intro{background:#fff;border:1px solid #e0e8ee;border-radius:18px;text-align:center;padding:48px 25px;color:#72818c}.search-intro-icon{width:66px;height:66px;margin:0 auto 14px;border-radius:50%;display:grid;place-items:center;background:#eaf6fc;font-size:29px}.search-intro h2{color:#273743;margin:0 0 8px}.search-intro p{max-width:560px;margin:0 auto;line-height:1.55}.search-results-head{display:flex;gap:8px;align-items:center;margin:15px 2px 10px;color:#73838e;font-size:13px}.modern-search-results{display:grid;gap:9px}.modern-search-result{display:grid;grid-template-columns:44px minmax(0,1fr) 24px;gap:11px;align-items:start;background:#fff;border:1px solid #e1e9ef;border-radius:15px;padding:13px 14px;transition:.15s}.modern-search-result:hover{border-color:#b8dceb;box-shadow:0 6px 18px rgba(38,107,144,.07);transform:translateY(-1px)}.search-result-avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:#dff1fa;color:#247fa9;font-weight:800}.search-result-copy{min-width:0}.search-result-top{display:flex;align-items:center;gap:7px;min-width:0}.search-result-top b{color:#253540}.search-result-top span{color:#3b8fb7;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.search-result-top time{margin-left:auto;color:#91a0aa;font-size:11px;white-space:nowrap}.search-result-copy p{margin:7px 0 0;color:#4f606c;line-height:1.45;word-break:break-word}.search-result-arrow{align-self:center;color:#9aa8b1;font-size:24px}
@media(max-width:980px){.channel-create-grid,.channel-edit-grid{grid-template-columns:1fr 1fr}.wide-field{grid-column:1/-1}.admin-stat-grid.channel-stats{grid-template-columns:repeat(2,1fr)}}
@media(max-width:700px){.channels-admin-page{padding:18px 12px 45px}.channels-admin-hero,.channel-browser-head,.channel-editor-footer{flex-direction:column;align-items:stretch}.channels-admin-hero h1{font-size:27px}.channels-admin-top-actions{justify-content:flex-start}.admin-stat-grid.channel-stats{grid-template-columns:1fr 1fr}.channel-create-grid,.channel-edit-grid{grid-template-columns:1fr}.wide-field{grid-column:auto}.channel-search-wrap{width:100%}.channel-editor-summary{grid-template-columns:42px minmax(0,1fr) auto;padding:10px}.channel-admin-avatar{width:40px;height:40px}.channel-title-line{flex-wrap:wrap}.channel-editor-actions{justify-content:stretch}.channel-editor-actions button{flex:1}.search-page-shell{padding:18px 10px 40px}.search-page-head h1{font-size:23px}.modern-searchbar{grid-template-columns:24px 1fr}.modern-searchbar button{grid-column:1/-1;width:100%}.modern-search-result{grid-template-columns:38px minmax(0,1fr);}.search-result-avatar{width:36px;height:36px}.search-result-arrow{display:none}.search-result-top{flex-wrap:wrap}.search-result-top time{margin-left:0;width:100%}}

/* Stage 13.2 — user quick menu */
.user-trigger{cursor:pointer;border:0;font:inherit}.message .avatar.user-trigger{padding:0;overflow:hidden;transition:transform .15s,box-shadow .15s}.message .avatar.user-trigger:hover{transform:translateY(-1px);box-shadow:0 0 0 3px rgba(34,158,217,.18)}.user-name-trigger{border:0;background:transparent;padding:0;color:inherit;cursor:pointer;font:inherit}.user-name-trigger:hover b{color:#1687bd}.user-popover{position:fixed;z-index:10050;width:min(320px,calc(100vw - 20px));background:#fff;border:1px solid #dfe8ee;border-radius:18px;box-shadow:0 18px 55px rgba(22,48,65,.22);padding:16px}.user-popover[hidden]{display:none!important}.user-popover-close{position:absolute;right:10px;top:8px;width:32px;height:32px;border:0;border-radius:50%;background:#f0f4f7;color:#687985;font-size:22px;cursor:pointer}.user-popover-head{display:flex;align-items:center;gap:12px;padding-right:34px}.user-popover-avatar{width:58px;height:58px;border-radius:50%;background:linear-gradient(145deg,#41b5e8,#258dc5);color:#fff;display:grid;place-items:center;overflow:hidden;font-size:23px;font-weight:800;flex:0 0 auto}.user-popover-avatar img{width:100%;height:100%;object-fit:cover}.user-popover-head b{display:block;font-size:17px;color:#21323e}.user-popover-head span{display:block;margin-top:3px;color:#7b8b96;font-size:12px}.user-popover-bio{margin:12px 0 0;padding:10px 11px;background:#f7fafc;border-radius:12px;color:#4c5e6a;line-height:1.45;font-size:13px}.user-popover-facts{display:grid;gap:4px;margin-top:11px;color:#788893;font-size:12px}.user-popover-private-note{margin-top:11px;padding:9px 10px;border-radius:11px;background:#f1f6f9;color:#63747f;font-size:11px;line-height:1.4}.user-popover-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:13px}.user-popover-action{min-height:40px;border:1px solid #dce6ec;border-radius:11px;background:#fff;color:#334b5a;display:flex;align-items:center;justify-content:center;text-align:center;padding:8px 10px;font-weight:800;font-size:12px;cursor:pointer;text-decoration:none}.user-popover-action:hover{background:#f4f9fc}.user-popover-action.primary{background:#229ed9;border-color:#229ed9;color:#fff}.user-popover-loading{padding:28px 8px;text-align:center;color:#7b8b96}.group-members-strip .avatar.user-trigger{border:0;padding:0}
@media(max-width:700px){.user-popover{left:10px!important;right:10px!important;bottom:10px!important;top:auto!important;width:auto;border-radius:20px}.user-popover-actions{grid-template-columns:1fr 1fr}.user-popover-action{min-height:44px;font-size:13px}}

/* ===== Stage 13.3: richer public profiles ===== */
.profile-editor{max-width:920px!important;padding:28px!important}.profile-privacy-note{font-size:13px;color:#7c8a99;margin:5px 0 0}.profile-edit-section{margin-top:22px;padding:22px;border:1px solid #e4ebf2;border-radius:18px;background:#fff}.profile-edit-section h2{margin:0 0 12px;font-size:20px}.profile-edit-section label small,.section-title-row p{display:block;color:#7b8998;font-weight:400;font-size:13px;margin:4px 0 10px}.section-title-row{display:flex;justify-content:space-between;gap:18px;align-items:flex-start}.section-title-row h2,.section-title-row p{margin-top:0}.profile-count{background:#eef6fb;color:#299bc8;border-radius:999px;padding:5px 10px;font-size:12px;font-weight:700}.profile-edit-gallery{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:14px 0}.profile-edit-photo{position:relative;aspect-ratio:1/1;border-radius:14px;overflow:hidden;background:#eef3f6}.profile-edit-photo img{width:100%;height:100%;object-fit:cover}.profile-photo-delete{position:absolute;right:6px;top:6px;width:28px;height:28px;border:0;border-radius:50%;background:#17212bcc;color:white;font-size:20px;line-height:1;cursor:pointer}.profile-photo-upload{display:flex!important;align-items:center;justify-content:center;padding:16px;border:1.5px dashed #91c9df;border-radius:14px;color:#229aca!important;background:#f5fbfe;cursor:pointer}.profile-photo-upload input{display:none}.profile-links-editor{display:grid;gap:9px}.profile-link-row{display:grid;grid-template-columns:minmax(140px,.35fr) 1fr;gap:10px}.profile-link-row input{margin:0!important}.profile-save-button{margin-top:22px;width:100%}.button.subtle{background:#eef6fa;color:#287fa2;border:0}.profile-public-wrap{max-width:980px;width:100%;margin:0 auto;padding:34px 26px 60px}.profile-public-main{max-width:none!important}.profile-public-section{background:#fff;border:1px solid #e4ebf2;border-radius:20px;padding:22px;margin-top:16px;box-shadow:0 8px 30px rgba(27,65,82,.04)}.profile-public-section h3{margin:0 0 16px;font-size:18px}.profile-public-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.profile-public-links a{display:grid;grid-template-columns:34px 1fr;grid-template-rows:auto auto;column-gap:9px;text-decoration:none;color:#17212b;background:#f7fafc;border:1px solid #e5edf3;border-radius:14px;padding:12px}.profile-public-links a>span{grid-row:1/3;align-self:center;font-size:20px}.profile-public-links small{color:#82909d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.profile-gallery{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}.profile-gallery a{display:block;aspect-ratio:1/1;border-radius:14px;overflow:hidden;background:#edf3f6}.profile-gallery img{width:100%;height:100%;object-fit:cover;transition:transform .2s ease}.profile-gallery a:hover img{transform:scale(1.035)}.profile-privacy-public{margin-top:16px;padding:12px 15px;border-radius:14px;background:#f3f7fa;color:#6f7e8b;font-size:13px;text-align:center}
@media(max-width:700px){.profile-editor{padding:16px!important}.profile-edit-section{padding:16px}.profile-edit-gallery{grid-template-columns:repeat(3,minmax(0,1fr))}.profile-link-row{grid-template-columns:1fr}.profile-public-wrap{padding:18px 12px 40px}.profile-public-links{grid-template-columns:1fr}.profile-gallery{grid-template-columns:repeat(3,minmax(0,1fr))}}


/* ===== Stage 14: calls ===== */
.call-v14{
  width:min(520px,calc(100vw - 28px))!important;
  border-radius:26px!important;
  padding:18px!important;
  background:linear-gradient(165deg,#172235 0%,#0d1624 100%)!important;
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 30px 90px rgba(0,0,0,.42)!important;
}
.call-v14 .call-panel-head{align-items:center}
.call-v14 .call-panel-head b{font-size:18px;letter-spacing:-.2px}
.call-v14 .call-panel-head span{font-size:11px;color:#9eb3c8;background:rgba(255,255,255,.07);padding:5px 8px;border-radius:99px}
.call-status{display:grid;grid-template-columns:10px 1fr auto auto;gap:8px;align-items:center;margin:10px 0 4px;color:#c8d5e2;font-size:12px}
.call-status strong{font-weight:600;color:#fff}
.call-status small{color:#8fa5b9}
.call-status time{font-variant-numeric:tabular-nums;color:#c8d5e2}
.call-status-dot{width:8px;height:8px;border-radius:50%;background:#f1c40f;box-shadow:0 0 0 4px rgba(241,196,15,.12)}
.call-status[data-phase="connected"] .call-status-dot{background:#37d67a;box-shadow:0 0 0 4px rgba(55,214,122,.13)}
.call-status[data-phase="failed"] .call-status-dot,.call-status[data-phase="ended"] .call-status-dot{background:#ff6b6b;box-shadow:0 0 0 4px rgba(255,107,107,.12)}
.call-v14 .call-media{display:block!important;margin-top:12px}
.call-v14 #remoteMedia{display:grid;gap:10px}
.remote-media-card{position:relative;overflow:hidden;border-radius:20px;background:#101a28;min-height:150px;border:1px solid rgba(255,255,255,.06)}
.remote-media-card.video{min-height:260px}
.remote-media-card video{display:block;width:100%;height:min(52vh,360px);object-fit:cover;background:#07101a;border-radius:20px}
.remote-media-card audio{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.remote-audio-avatar{width:84px;height:84px;margin:28px auto 12px;border-radius:50%;display:grid;place-items:center;font-size:34px;background:linear-gradient(145deg,#2c9fd0,#2779c8);box-shadow:0 14px 38px rgba(31,132,189,.25)}
.remote-audio-badge{text-align:center;color:#dce7f1;font-size:13px;padding:0 12px 24px}
.call-v14 #localVideo{position:absolute!important;right:28px;top:104px;width:112px!important;height:150px!important;min-height:0!important;z-index:3;border:2px solid rgba(255,255,255,.55);box-shadow:0 10px 30px rgba(0,0,0,.35);object-fit:cover}
.call-v14 .call-controls{justify-content:center;gap:12px;margin-top:16px}
.call-v14 .call-control{width:48px;height:48px;padding:0;border-radius:50%;display:grid;place-items:center;font-size:18px;background:rgba(255,255,255,.09);color:#fff;transition:.18s ease}
.call-v14 .call-control:hover{background:rgba(255,255,255,.16);transform:translateY(-1px)}
.call-v14 .call-control.end{width:auto;min-width:132px;border-radius:24px;padding:0 18px;background:#ef5350}
.call-v14 .call-control.end:hover{background:#e53935}
.call-v14 .sound-help{width:100%;margin-top:10px;border:0;border-radius:12px;padding:10px 12px;background:#2d8fca;color:white;font-weight:600;cursor:pointer}
.incoming-call-v14{
  width:min(390px,calc(100vw - 24px))!important;
  right:16px!important;top:16px!important;
  border-radius:22px!important;padding:18px!important;
  box-shadow:0 25px 75px rgba(15,35,52,.3)!important;
  border:1px solid #e6eef4;
}
.incoming-call-v14 .incoming-icon{width:54px;height:54px;border-radius:50%;display:grid;place-items:center;font-size:24px;background:#eaf7ff;color:#188ec3;margin-bottom:12px;animation:callPulse 1.4s infinite}
.incoming-call-v14>b{font-size:13px;color:#728597;font-weight:600}
.incoming-call-v14 #incomingText{display:flex;flex-direction:column;gap:2px;margin-top:5px}
.incoming-call-v14 #incomingText strong{font-size:18px;color:#132333}
.incoming-call-v14 #incomingText small{font-size:12px;color:#7d8d9d}
.incoming-call-v14 .incoming-actions{gap:10px;margin-top:16px}
.incoming-call-v14 .incoming-actions button{height:44px;border-radius:14px;font-weight:700}
.incoming-call-v14 .incoming-actions .accept{background:#35b86b}
.incoming-call-v14 .incoming-actions .decline{background:#f2f5f7;color:#d64c4c}
.call-dialog .call-user>div{min-width:0}
.call-dialog .call-user>div b{display:block}
.call-dialog .call-user>div small{display:block;color:#8a9aa8;font-size:11px;margin-top:2px}
.call-dialog .call-user button{width:40px;height:40px;padding:0;border-radius:50%;display:grid;place-items:center}
@keyframes callPulse{0%,100%{box-shadow:0 0 0 0 rgba(39,161,210,.18)}50%{box-shadow:0 0 0 10px rgba(39,161,210,0)}}
@media(max-width:760px){
  .call-v14{left:8px!important;right:8px!important;bottom:max(8px,env(safe-area-inset-bottom))!important;width:auto!important;border-radius:22px!important}
  .call-v14 #localVideo{right:18px;top:104px;width:88px!important;height:118px!important}
  .remote-media-card.video{min-height:220px}
  .remote-media-card video{height:min(45vh,320px)}
  .call-status{grid-template-columns:10px 1fr auto}
  .call-status small{display:none}
  .incoming-call-v14{left:10px!important;right:10px!important;top:max(10px,env(safe-area-inset-top))!important;width:auto!important}
}


/* ===== Stage 16: group audio/video calls ===== */
.group-call-chooser[hidden]{display:none!important}
.group-call-chooser{position:fixed;inset:0;z-index:12000;background:rgba(9,20,32,.48);backdrop-filter:blur(4px);display:grid;place-items:center;padding:18px}
.group-call-chooser-card{position:relative;width:min(520px,100%);background:#fff;border-radius:26px;padding:28px;box-shadow:0 32px 100px rgba(7,26,42,.3);text-align:center}
.group-call-chooser-close{position:absolute;right:16px;top:14px;width:36px;height:36px;border:0;border-radius:50%;background:#f1f5f8;color:#6a7a89;font-size:22px;cursor:pointer}
.group-call-chooser-icon{width:72px;height:72px;margin:0 auto 12px;border-radius:24px;display:grid;place-items:center;background:linear-gradient(145deg,#e9f7ff,#dff2ff);font-size:34px}
.group-call-chooser-card h3{margin:0;color:#152535;font-size:22px}
.group-call-chooser-card>p{margin:7px 0 20px;color:#718293;font-size:13px}
.group-call-options{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.group-call-options button{border:1px solid #e0eaf1;background:#f8fbfd;border-radius:18px;padding:18px 12px;display:flex;flex-direction:column;align-items:center;gap:4px;cursor:pointer;transition:.18s}
.group-call-options button:hover{border-color:#79c8ec;background:#eef9fe;transform:translateY(-1px)}
.group-call-options span{font-size:27px}.group-call-options b{font-size:14px;color:#203141}.group-call-options small{font-size:11px;color:#8394a3}
.group-call-live{margin-top:14px}.group-call-live button{width:100%;height:46px;border:0;border-radius:14px;background:#2ba3dc;color:#fff;font-weight:700;cursor:pointer}
.group-call-roster{margin:8px 0 12px;padding:10px;border:1px solid rgba(255,255,255,.08);border-radius:16px;background:rgba(255,255,255,.04)}
.group-roster-head{display:flex;align-items:center;justify-content:space-between;color:#dce9f4;margin-bottom:8px}.group-roster-head b{font-size:13px}.group-roster-head span{font-size:11px;color:#93a8ba}
.group-roster-list{display:flex;gap:7px;overflow-x:auto;padding-bottom:2px}
.group-roster-user{flex:0 0 auto;display:flex;align-items:center;gap:6px;padding:5px 9px 5px 5px;border-radius:999px;background:rgba(255,255,255,.07);color:#cbd9e5;font-size:11px;border:1px solid transparent;transition:.15s}
.group-roster-user.speaking{border-color:#41dc83;background:rgba(65,220,131,.12);color:#fff}
.group-roster-avatar{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;overflow:hidden;background:#2b91c7;color:#fff;font-weight:700}.group-roster-avatar img{width:100%;height:100%;object-fit:cover}
.group-peer-card.speaking{box-shadow:0 0 0 3px rgba(65,220,131,.75),0 18px 45px rgba(0,0,0,.2)}
.group-peer-card .speak-dot{width:7px;height:7px;border-radius:50%;display:inline-block;background:#75899a;margin-right:6px}.group-peer-card.speaking .speak-dot{background:#41dc83;box-shadow:0 0 0 4px rgba(65,220,131,.12)}
.call-v14:has(.group-peer-card.video) #remoteMedia{grid-template-columns:repeat(2,minmax(0,1fr))}
.header-action.group-call-active{background:#e7f8ef!important;color:#15864b!important}
@media(max-width:760px){
  .group-call-chooser-card{padding:24px 16px;border-radius:22px}.group-call-options{grid-template-columns:1fr}
  .call-v14:has(.group-peer-card.video) #remoteMedia{grid-template-columns:1fr}
  .group-peer-card.video{min-height:190px}.group-peer-card video{height:220px}
}


/* ===== Stage 17: LiveKit SFU group calls ===== */
.livekit-call-panel{width:min(920px,calc(100vw - 28px))!important}
.livekit-route{display:grid;grid-template-columns:10px auto 1fr auto;align-items:center;gap:8px;margin:9px 0 10px;color:#c9d7e4;font-size:12px}
.livekit-route .livekit-dot{width:8px;height:8px;border-radius:50%;background:#35d47b;box-shadow:0 0 0 4px rgba(53,212,123,.12)}
.livekit-route b{color:#fff}.livekit-route small{color:#8ea4b7}.livekit-route time{font-variant-numeric:tabular-nums}
.livekit-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}
.livekit-tile{position:relative;min-height:190px;border-radius:18px;background:linear-gradient(145deg,#132134,#0d1826);overflow:hidden;border:1px solid rgba(255,255,255,.07);display:grid;place-items:center;transition:.18s}
.livekit-tile.speaking{box-shadow:0 0 0 3px rgba(55,216,125,.8),0 16px 36px rgba(0,0,0,.22)}
.livekit-video-slot{position:absolute;inset:0}.livekit-video-slot video{width:100%;height:100%;object-fit:cover;display:block}
.livekit-avatar{width:78px;height:78px;border-radius:50%;display:grid;place-items:center;font-size:30px;font-weight:800;color:#fff;background:linear-gradient(145deg,#38a9dc,#3477c8);box-shadow:0 12px 30px rgba(0,0,0,.18)}
.livekit-tile.has-video .livekit-avatar{display:none}
.livekit-tile-meta{position:absolute;left:9px;right:9px;bottom:9px;display:flex;align-items:center;gap:6px;padding:7px 9px;border-radius:12px;background:rgba(8,17,27,.67);backdrop-filter:blur(7px);color:#fff;font-size:11px}
.livekit-tile-meta b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.livekit-tile-meta small{margin-left:auto;color:#dce7ef}
.livekit-speaking-dot{width:7px;height:7px;border-radius:50%;background:#8495a5}.livekit-tile.speaking .livekit-speaking-dot{background:#37d87d;box-shadow:0 0 0 4px rgba(55,216,125,.13)}
.livekit-roster{margin:8px 0 10px;padding:9px;border-radius:15px;background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.07)}
.livekit-roster-head{display:flex;justify-content:space-between;color:#dbe7f1;font-size:12px;margin-bottom:7px}.livekit-roster-head span{color:#8fa5b8}
.livekit-roster-list{display:flex;gap:7px;overflow-x:auto}
.livekit-roster-user{flex:0 0 auto;display:flex;align-items:center;gap:6px;padding:5px 9px 5px 5px;border-radius:999px;background:rgba(255,255,255,.07);color:#d5e1eb;font-size:11px;border:1px solid transparent}
.livekit-roster-user.speaking{border-color:#37d87d;background:rgba(55,216,125,.12)}
.livekit-roster-user>span{width:25px;height:25px;border-radius:50%;display:grid;place-items:center;background:#248fc5;color:#fff;font-weight:800}
@media(max-width:760px){
 .livekit-call-panel{width:auto!important}
 .livekit-grid{grid-template-columns:1fr 1fr;gap:7px}
 .livekit-tile{min-height:145px}
 .livekit-avatar{width:58px;height:58px;font-size:23px}
}
@media(max-width:430px){
 .livekit-grid{grid-template-columns:1fr}
 .livekit-tile{min-height:190px}
}


/* ===== Stage 17.1: larger chat header/actions + mobile readability ===== */
.chat-header{
  min-height:74px;
  padding:12px 16px!important;
}
.chat-header-main{gap:12px!important}
.chat-header-avatar{
  width:46px!important;height:46px!important;font-size:18px!important
}
.chat-title-wrap h1,
.chat-title-wrap .chat-title{
  font-size:22px!important;line-height:1.15!important
}
.chat-title-wrap .chat-subtitle,
.chat-header-meta{
  font-size:13px!important;line-height:1.35!important
}
.chat-header-actions{gap:8px!important;flex-wrap:wrap}
.header-action{
  min-width:48px!important;height:46px!important;padding:0 12px!important;
  border-radius:14px!important;font-size:17px!important;gap:7px!important
}
.header-action span{font-size:19px!important;line-height:1!important}
.header-action em{
  font-size:12px!important;font-style:normal!important;font-weight:700!important;white-space:nowrap
}
#groupCallBtn{
  min-width:128px!important;height:50px!important;padding:0 16px!important;
  background:#eaf7ff!important;color:#147eaf!important;border-color:#cdeaf7!important;
  font-weight:800!important
}
#groupCallBtn span{font-size:21px!important}
#groupCallBtn.group-call-active{
  background:#e7f8ef!important;color:#157f49!important;border-color:#c6efd7!important
}
.message-bubble,.message-content,.message-text{
  font-size:15px!important;line-height:1.52!important
}
.message-meta,.message-time{font-size:11.5px!important}
.message-actions button,.message-action{
  min-height:34px!important;padding:6px 9px!important;font-size:12px!important
}
.chat-composer,.message-composer{
  gap:8px!important;padding:10px 12px!important
}
.chat-composer textarea,.message-composer textarea{
  min-height:50px!important;max-height:160px!important;font-size:15px!important;
  line-height:1.4!important;padding:13px 14px!important;border-radius:16px!important
}
.sidebar-chat-row,.chat-list-item{min-height:58px!important}
.sidebar-chat-avatar,.chat-list-avatar{
  width:42px!important;height:42px!important;font-size:15px!important
}
.sidebar-chat-name,.chat-list-title{font-size:14px!important}
.sidebar-chat-subtitle,.chat-list-subtitle{font-size:11.5px!important}

@media(max-width:760px){
  html{font-size:17px}
  body{font-size:16px!important;-webkit-text-size-adjust:100%}
  .app-shell,.layout,.chat-layout{min-height:100dvh!important}

  .mobile-topbar{min-height:58px!important;padding:8px 10px!important}
  .mobile-menu-btn,.sidebar-toggle{
    width:46px!important;height:46px!important;font-size:22px!important
  }

  .sidebar{width:min(92vw,370px)!important}
  .sidebar-brand{padding:14px!important}
  .sidebar-actions{padding:10px!important}
  .sidebar-actions a,.sidebar-actions button{
    min-height:46px!important;font-size:14px!important;border-radius:13px!important
  }
  .sidebar-chat-row,.chat-list-item{
    min-height:68px!important;padding:10px!important;border-radius:14px!important
  }
  .sidebar-chat-avatar,.chat-list-avatar{
    width:50px!important;height:50px!important;font-size:18px!important;flex:0 0 50px!important
  }
  .sidebar-chat-name,.chat-list-title{
    font-size:15.5px!important;line-height:1.22!important
  }
  .sidebar-chat-subtitle,.chat-list-subtitle{
    font-size:12.5px!important;line-height:1.3!important
  }
  .sidebar-subchat,.subchat-row{
    min-height:50px!important;font-size:14px!important;padding-top:9px!important;padding-bottom:9px!important
  }

  .chat-header{
    position:sticky!important;top:0;z-index:40;min-height:auto!important;
    padding:10px 10px 8px!important;background:rgba(255,255,255,.97)!important;
    backdrop-filter:blur(12px);border-bottom:1px solid #e7eef4
  }
  .chat-header-main{align-items:center!important;gap:9px!important}
  .chat-header-avatar{width:46px!important;height:46px!important;flex:0 0 46px!important}
  .chat-title-wrap{min-width:0;flex:1}
  .chat-title-wrap h1,.chat-title-wrap .chat-title{
    font-size:19px!important;line-height:1.15!important;white-space:nowrap;
    overflow:hidden;text-overflow:ellipsis
  }
  .chat-title-wrap .chat-subtitle,.chat-header-meta{
    font-size:12.5px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
  }

  .chat-header-actions{
    width:100%!important;display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:8px!important;margin-top:10px!important
  }
  .header-action{
    width:100%!important;min-width:0!important;height:54px!important;padding:5px 6px!important;
    border-radius:14px!important;display:flex!important;flex-direction:column!important;
    align-items:center!important;justify-content:center!important;gap:3px!important
  }
  .header-action span{font-size:22px!important}
  .header-action em{
    display:block!important;font-size:11px!important;max-width:100%;overflow:hidden;text-overflow:ellipsis
  }
  #groupCallBtn{
    grid-column:span 2!important;height:58px!important;flex-direction:row!important;
    gap:8px!important;font-size:15px!important
  }
  #groupCallBtn span{font-size:25px!important}
  #groupCallBtn em{font-size:13px!important}

  .chat-description-toggle,.chat-about-toggle{
    min-height:44px!important;font-size:13.5px!important;padding:10px 12px!important
  }

  .messages,.message-list,.chat-messages{padding:10px 8px 106px!important}
  .message-row{margin:8px 0!important;gap:7px!important}
  .message-avatar{width:38px!important;height:38px!important;flex:0 0 38px!important}
  .message-bubble,.message-content{
    max-width:90%!important;padding:11px 12px!important;border-radius:16px!important;
    font-size:16px!important;line-height:1.5!important
  }
  .message-author{font-size:13.5px!important}
  .message-meta,.message-time{font-size:11.5px!important}
  .message-actions{gap:5px!important;flex-wrap:wrap!important}
  .message-actions button,.message-action{
    min-height:36px!important;font-size:12px!important;padding:7px 9px!important;border-radius:10px!important
  }
  .reaction,.reaction-btn{
    min-height:34px!important;font-size:14px!important;padding:6px 9px!important
  }

  .chat-composer,.message-composer{
    position:sticky!important;bottom:0;z-index:45;background:rgba(255,255,255,.98)!important;
    backdrop-filter:blur(12px);border-top:1px solid #e4edf3;
    padding:8px max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))!important;
    gap:7px!important;align-items:flex-end!important
  }
  .chat-composer textarea,.message-composer textarea{
    min-height:56px!important;max-height:135px!important;font-size:16px!important;
    padding:14px!important;border-radius:18px!important
  }
  .chat-composer .send-btn,.message-composer .send-btn,
  .chat-composer button[type="submit"],.message-composer button[type="submit"]{
    width:52px!important;height:52px!important;min-width:52px!important;min-height:52px!important;
    border-radius:50%!important;padding:0!important;font-size:21px!important
  }
  .chat-composer .attach-btn,.message-composer .attach-btn{
    width:46px!important;height:46px!important;min-width:46px!important;border-radius:50%!important;font-size:19px!important
  }
  .reply-preview,.composer-reply{font-size:13px!important}

  .call-v14,.livekit-call-panel{
    left:6px!important;right:6px!important;bottom:max(6px,env(safe-area-inset-bottom))!important;
    width:auto!important;max-height:92dvh!important;overflow:auto!important;
    padding:14px!important;border-radius:22px!important
  }
  .call-panel-head b{font-size:18px!important}
  .livekit-grid{grid-template-columns:1fr!important}
  .livekit-tile{min-height:220px!important}
  .livekit-tile-meta{font-size:12.5px!important;padding:9px 10px!important}
  .call-v14 .call-controls{
    position:sticky;bottom:0;padding-top:10px;
    background:linear-gradient(to top,#0d1624 70%,rgba(13,22,36,0))
  }
  .call-v14 .call-control{
    width:54px!important;height:54px!important;font-size:21px!important
  }
  .call-v14 .call-control.end{
    min-width:145px!important;height:54px!important;font-size:13.5px!important
  }

  .group-call-chooser{padding:10px!important}
  .group-call-chooser-card{padding:24px 16px!important}
  .group-call-chooser-card h3{font-size:21px!important}
  .group-call-options button{
    min-height:96px!important;font-size:14.5px!important
  }
  .group-call-options span{font-size:31px!important}

  input,select,textarea,button{font-size:16px}
}

@media(max-width:390px){
  .chat-header-actions{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  #groupCallBtn{grid-column:span 3!important}
  .message-bubble,.message-content{max-width:92%!important}
}


/* =========================================================
   Stage 17.5 — robust mobile + home fix
   ========================================================= */

/* CRITICAL: old Stage 1 rule hid every .main below 760px.
   The home page uses <main class="main home-main">, so it vanished.
*/
@media(max-width:760px){
  body.vda-home .main,
  body.vda-home .home-main,
  .home-shell > .home-main {
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
  }
}

/* Mobile is driven by html.vda-mobile as well as width.
   This catches Android even when Chrome reports a "desktop-ish" viewport.
*/
html.vda-mobile,
html.vda-mobile body {
  width:100%!important;
  max-width:100%!important;
  min-height:100dvh!important;
  margin:0!important;
  font-size:18px!important;
  -webkit-text-size-adjust:110%!important;
  overflow-x:hidden!important;
}

html.vda-mobile body {
  line-height:1.45!important;
}

html.vda-mobile .messenger-shell.chat-shell,
html.vda-mobile .messenger-shell.home-shell {
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  min-height:100dvh!important;
  height:100dvh!important;
  overflow:hidden!important;
}

/* Drawer sidebar */
html.vda-mobile .messenger-sidebar {
  display:block!important;
  position:fixed!important;
  z-index:1200!important;
  top:0!important;
  left:0!important;
  bottom:0!important;
  width:min(92vw,400px)!important;
  max-width:400px!important;
  height:100dvh!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  background:#fff!important;
  transform:translateX(-105%)!important;
  transition:transform .2s ease!important;
  box-shadow:12px 0 40px rgba(0,0,0,.22)!important;
  visibility:visible!important;
  opacity:1!important;
}

html.vda-mobile body.sidebar-open .messenger-sidebar {
  transform:translateX(0)!important;
}

html.vda-mobile .sidebar-backdrop {
  display:none!important;
}

html.vda-mobile body.sidebar-open .sidebar-backdrop {
  display:block!important;
  position:fixed!important;
  inset:0!important;
  z-index:1190!important;
  background:rgba(12,25,34,.48)!important;
}

/* Sidebar content larger */
html.vda-mobile .messenger-sidebar .brand {
  min-height:76px!important;
  padding:14px!important;
}
html.vda-mobile .messenger-sidebar .sidebar-close {
  display:block!important;
  width:46px!important;
  height:46px!important;
  font-size:32px!important;
}
html.vda-mobile .messenger-sidebar .channel-item>.channel-link {
  min-height:72px!important;
  padding:10px 48px 10px 11px!important;
}
html.vda-mobile .messenger-sidebar .channel-icon {
  width:48px!important;
  height:48px!important;
  min-width:48px!important;
  font-size:19px!important;
}
html.vda-mobile .messenger-sidebar .channel-copy b,
html.vda-mobile .messenger-sidebar .channels b {
  font-size:17px!important;
}
html.vda-mobile .messenger-sidebar .channel-copy small,
html.vda-mobile .messenger-sidebar .channels small {
  font-size:14px!important;
  line-height:1.32!important;
  max-width:240px!important;
}
html.vda-mobile .messenger-sidebar .channel-item>.subchat-toggle,
html.vda-mobile .messenger-sidebar .chat-branch-toggle {
  width:38px!important;
  height:38px!important;
  top:17px!important;
  right:6px!important;
  font-size:25px!important;
  z-index:5!important;
}
html.vda-mobile .subchat-inline .channel-link {
  min-height:58px!important;
  font-size:15px!important;
}

/* CHAT PAGE */
html.vda-mobile .chat-page.stage6-chat {
  display:grid!important;
  grid-template-rows:auto auto auto minmax(0,1fr) auto!important;
  width:100%!important;
  height:100dvh!important;
  min-height:100dvh!important;
  overflow:hidden!important;
  visibility:visible!important;
  opacity:1!important;
}

html.vda-mobile .chat-header.telegram-chat-header {
  display:grid!important;
  grid-template-columns:56px minmax(0,1fr)!important;
  grid-template-areas:"menu main" "actions actions"!important;
  gap:10px!important;
  align-items:center!important;
  width:100%!important;
  min-height:0!important;
  padding:10px!important;
  background:#fff!important;
  border-bottom:1px solid #dfe8ee!important;
  overflow:visible!important;
}

html.vda-mobile .chat-header .mobile-menu {
  grid-area:menu!important;
  display:grid!important;
  place-items:center!important;
  width:54px!important;
  height:54px!important;
  min-width:54px!important;
  border-radius:16px!important;
  background:#e7f4fb!important;
  color:#147eae!important;
  font-size:28px!important;
  padding:0!important;
}

html.vda-mobile .chat-head-main {
  grid-area:main!important;
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  min-width:0!important;
}
html.vda-mobile .chat-head-avatar {
  width:52px!important;
  height:52px!important;
  flex:0 0 52px!important;
  font-size:22px!important;
}
html.vda-mobile .chat-head-copy h1 {
  font-size:21px!important;
  line-height:1.15!important;
}
html.vda-mobile .chat-head-meta {
  font-size:14px!important;
}

html.vda-mobile .header-actions.telegram-header-actions {
  grid-area:actions!important;
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:9px!important;
  width:100%!important;
  max-width:none!important;
  overflow:visible!important;
}
html.vda-mobile .telegram-header-actions .header-action {
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  min-width:0!important;
  height:66px!important;
  padding:6px 4px!important;
  border:1px solid #d9e6ed!important;
  border-radius:16px!important;
  background:#f5f9fb!important;
  color:#3d5362!important;
  gap:4px!important;
  visibility:visible!important;
  opacity:1!important;
}
html.vda-mobile .telegram-header-actions .header-action>span {
  font-size:27px!important;
}
html.vda-mobile .telegram-header-actions .header-action>em {
  display:block!important;
  font-size:13px!important;
  line-height:1.05!important;
  font-style:normal!important;
  font-weight:800!important;
}
html.vda-mobile .telegram-header-actions #groupCallBtn {
  grid-column:span 2!important;
  height:70px!important;
  flex-direction:row!important;
  gap:10px!important;
  background:#e4f5ff!important;
  color:#117cac!important;
  border-color:#b2ddf0!important;
}
html.vda-mobile .telegram-header-actions #groupCallBtn>span {font-size:32px!important}
html.vda-mobile .telegram-header-actions #groupCallBtn>em {font-size:15px!important}

/* Messages */
html.vda-mobile .message-stream {
  display:block!important;
  min-height:0!important;
  width:100%!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:12px 8px 18px!important;
}
html.vda-mobile article.message {
  display:flex!important;
  gap:8px!important;
  margin:10px 0!important;
}
html.vda-mobile article.message>.avatar {
  width:42px!important;
  height:42px!important;
  flex:0 0 42px!important;
  font-size:16px!important;
}
html.vda-mobile article.message .bubble {
  max-width:calc(100vw - 64px)!important;
  padding:13px 14px!important;
  border-radius:18px 18px 18px 6px!important;
}
html.vda-mobile article.message .msg-meta b {font-size:15px!important}
html.vda-mobile article.message .msg-meta time {font-size:12px!important}
html.vda-mobile article.message .msg-text {
  font-size:24px!important;
  line-height:1.5!important;
}
html.vda-mobile article.message .reaction-btn {
  min-height:38px!important;
  padding:6px 11px!important;
  font-size:15px!important;
}
html.vda-mobile article.message .msg-actions button {
  min-height:38px!important;
  padding:7px 10px!important;
  font-size:13px!important;
}

/* Composer */
html.vda-mobile form.composer {
  display:grid!important;
  grid-template-columns:50px minmax(0,1fr) 60px!important;
  gap:8px!important;
  align-items:end!important;
  width:100%!important;
  padding:10px 9px max(10px,env(safe-area-inset-bottom))!important;
  background:#fff!important;
  border-top:1px solid #dfe8ee!important;
}
html.vda-mobile form.composer .attach-picker {
  width:50px!important;
  height:50px!important;
  font-size:24px!important;
}
html.vda-mobile form.composer textarea {
  min-height:62px!important;
  max-height:150px!important;
  padding:16px!important;
  border-radius:20px!important;
  font-size:18px!important;
  line-height:1.4!important;
}
html.vda-mobile form.composer>button[type=submit] {
  width:60px!important;
  height:60px!important;
  min-width:60px!important;
  min-height:60px!important;
  border-radius:50%!important;
  font-size:25px!important;
  padding:0!important;
}

/* Calls */
html.vda-mobile .active-call-panel,
html.vda-mobile .call-v14,
html.vda-mobile .livekit-call-panel {
  left:6px!important;
  right:6px!important;
  bottom:max(6px,env(safe-area-inset-bottom))!important;
  width:auto!important;
  max-width:none!important;
  max-height:94dvh!important;
  overflow-y:auto!important;
}
html.vda-mobile .livekit-grid {grid-template-columns:1fr!important}
html.vda-mobile .livekit-tile {min-height:235px!important}
html.vda-mobile .call-control {
  width:60px!important;
  height:60px!important;
  font-size:23px!important;
}

/* HOME PAGE — never hide on narrow screens */
html.vda-mobile body.vda-home {
  overflow-y:auto!important;
}
html.vda-mobile body.vda-home .home-shell {
  height:auto!important;
  min-height:100dvh!important;
  overflow:visible!important;
}
html.vda-mobile body.vda-home .main.home-main {
  display:block!important;
  width:100%!important;
  min-height:100dvh!important;
  visibility:visible!important;
  opacity:1!important;
  overflow:visible!important;
}
html.vda-mobile .home-topbar {
  min-height:68px!important;
  padding:9px 10px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
}
html.vda-mobile .home-menu-button {
  display:grid!important;
  place-items:center!important;
  width:52px!important;
  height:52px!important;
  min-width:52px!important;
  font-size:26px!important;
}
html.vda-mobile .home-wordmark b {font-size:17px!important}
html.vda-mobile .home-wordmark small {font-size:12px!important}
html.vda-mobile .home-content {
  width:100%!important;
  padding:12px!important;
}
html.vda-mobile .home-welcome-card {
  display:block!important;
  padding:22px 16px!important;
}
html.vda-mobile .home-welcome-copy h1 {
  font-size:30px!important;
  line-height:1.1!important;
}
html.vda-mobile .home-welcome-copy p {
  font-size:17px!important;
  line-height:1.55!important;
}
html.vda-mobile .home-preview {
  margin-top:18px!important;
  min-height:220px!important;
}
html.vda-mobile .home-welcome-actions {
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:10px!important;
}
html.vda-mobile .home-welcome-actions a {
  min-height:52px!important;
  font-size:16px!important;
}
html.vda-mobile .home-section-title-row {
  align-items:flex-end!important;
  gap:10px!important;
}
html.vda-mobile .home-section-title-row h2 {
  font-size:24px!important;
}
html.vda-mobile .home-all-chats {
  min-height:46px!important;
  padding:0 14px!important;
  font-size:14px!important;
}
html.vda-mobile .home-cards-grid {
  grid-template-columns:1fr!important;
  gap:10px!important;
}
html.vda-mobile .home-room-card {
  min-height:82px!important;
  padding:13px!important;
}
html.vda-mobile .home-room-icon {
  width:50px!important;
  height:50px!important;
  font-size:23px!important;
}
html.vda-mobile .home-room-copy b {font-size:16px!important}
html.vda-mobile .home-room-copy small {font-size:13px!important}
html.vda-mobile .home-feature-row {
  grid-template-columns:1fr!important;
  gap:10px!important;
}
html.vda-mobile .home-feature-row>div {
  min-height:86px!important;
}
html.vda-mobile .home-icon-button {
  width:48px!important;
  height:48px!important;
  font-size:22px!important;
}
html.vda-mobile .home-user-button,
html.vda-mobile .home-signin-button {
  min-height:46px!important;
  padding:0 14px!important;
  font-size:14px!important;
}

@media(max-width:430px){
  html.vda-mobile .header-actions.telegram-header-actions {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  html.vda-mobile .telegram-header-actions #groupCallBtn {
    grid-column:1/-1!important;
  }
}


/* =========================================================
   Stage 17.6.1 — composer layout hotfix + audio
   Keeps Stage 17.5 mobile layout intact.
   ========================================================= */

/* Desktop composer: attachment | microphone | text | send */
form.composer{
  grid-template-columns:46px 46px minmax(0,1fr) 54px!important;
  gap:8px!important;
  align-items:end!important;
}
form.composer>.attach-picker{
  grid-column:1!important;
  grid-row:auto!important;
  width:46px!important;
  height:46px!important;
  align-self:end!important;
}
form.composer>.voice-record-btn{
  grid-column:2!important;
  grid-row:auto!important;
  width:46px!important;
  height:46px!important;
  min-width:46px!important;
  align-self:end!important;
}
form.composer>.composer-text-wrap{
  grid-column:3!important;
  min-width:0!important;
}
form.composer>button[type="submit"]{
  grid-column:4!important;
  width:54px!important;
  height:54px!important;
  min-width:54px!important;
  align-self:end!important;
}
form.composer>.typing-status,
form.composer>.reply-box,
form.composer>.file-preview{
  grid-column:1/-1!important;
}

/* Hide textarea's native resize handle; it looked like stray arrows in the screenshot. */
form.composer textarea{
  resize:none!important;
  width:100%!important;
}

/* Voice record controls */
.voice-record-btn{
  border:0!important;
  border-radius:50%!important;
  background:#e8f6fd!important;
  color:#147eae!important;
  font-size:21px!important;
  cursor:pointer!important;
  display:grid!important;
  place-items:center!important;
  padding:0!important;
}
.voice-record-btn:hover{background:#d9f0fb!important}
.voice-record-btn.recording{
  background:#ffeded!important;
  color:#d33434!important;
  animation:vdaVoicePulse 1s infinite;
}
@keyframes vdaVoicePulse{50%{opacity:.48;transform:scale(.92)}}

.voice-record-panel{
  display:flex;
  align-items:center;
  gap:8px;
  padding:9px 14px;
  background:#fff4f4;
  border-top:1px solid #ffd6d6;
  color:#973838;
  font-size:13px;
}
.voice-record-panel[hidden]{display:none!important}
.voice-record-panel button{
  margin-left:auto;
  border:0;
  background:transparent;
  color:#bd3030;
  font-weight:800;
  cursor:pointer;
}
.voice-rec-dot{
  width:9px;height:9px;border-radius:50%;background:#df3838;
  animation:vdaVoicePulse 1s infinite;
}

/* Voice message player */
.voice-message-player{
  margin:8px 0 2px;
  width:min(390px,100%);
  padding:10px 11px;
  border:1px solid #d4e7f0;
  border-radius:15px;
  background:#eef8fc;
}
.voice-player-title,
.voice-message-player>div{
  display:flex;
  align-items:center;
  gap:7px;
  margin-bottom:7px;
}
.voice-player-title span,
.voice-message-player>div span{font-size:20px}
.voice-player-title b,
.voice-message-player>div b{font-size:12px;color:#365565}
.voice-message-player audio{
  display:block;
  width:100%;
  height:42px;
}

/* Yandex Disk audio player */
.ya-audio-card{
  margin-top:10px;
  width:min(520px,100%);
  padding:11px;
  border:1px solid #dbe7ee;
  border-radius:15px;
  background:#f8fbfd;
}
.ya-audio-head{display:flex;align-items:center;gap:9px;margin-bottom:8px}
.ya-audio-head>span{font-size:24px}
.ya-audio-head div{min-width:0}
.ya-audio-head b{
  display:block;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}
.ya-audio-head small{display:block;margin-top:2px;color:#7e909f;font-size:11px}
.ya-audio-card audio{display:block;width:100%;height:42px}
.ya-audio-open{
  display:inline-block;margin-top:7px;font-size:11px;color:#2185b5;text-decoration:none
}
.ya-audio-error{border-color:#f0d5d5;background:#fff8f8}

/* Admin / Logout: brighter and larger */
.messenger-sidebar a[href*="/admin"],
.messenger-sidebar a[href*="admin.php"]{
  min-height:50px!important;
  padding:0 16px!important;
  border-radius:14px!important;
  background:#dff3ff!important;
  color:#0878ae!important;
  border:1px solid #acdcef!important;
  font-size:15px!important;
  font-weight:900!important;
  box-shadow:0 5px 14px rgba(18,121,171,.12)!important;
}
.messenger-sidebar a[href*="logout"],
.messenger-sidebar a[href*="signout"]{
  min-height:50px!important;
  padding:0 16px!important;
  border-radius:14px!important;
  background:#ffecec!important;
  color:#c72f2f!important;
  border:1px solid #ffc4c4!important;
  font-size:15px!important;
  font-weight:900!important;
  box-shadow:0 5px 14px rgba(190,50,50,.10)!important;
}

/* Mobile composer remains a single clean row with four controls. */
html.vda-mobile form.composer{
  grid-template-columns:50px 50px minmax(0,1fr) 60px!important;
  gap:7px!important;
}
html.vda-mobile form.composer>.attach-picker{
  grid-column:1!important;
  width:50px!important;height:50px!important;
}
html.vda-mobile form.composer>.voice-record-btn{
  grid-column:2!important;
  width:50px!important;height:50px!important;min-width:50px!important;
  font-size:23px!important;
}
html.vda-mobile form.composer>.composer-text-wrap{grid-column:3!important}
html.vda-mobile form.composer>button[type="submit"]{
  grid-column:4!important;
  width:60px!important;height:60px!important;min-width:60px!important;
}
html.vda-mobile .voice-message-player,
html.vda-mobile .ya-audio-card{
  width:100%!important;
  max-width:100%!important;
}
html.vda-mobile .voice-message-player audio,
html.vda-mobile .ya-audio-card audio{height:48px!important}
html.vda-mobile .messenger-sidebar a[href*="/admin"],
html.vda-mobile .messenger-sidebar a[href*="admin.php"],
html.vda-mobile .messenger-sidebar a[href*="logout"],
html.vda-mobile .messenger-sidebar a[href*="signout"]{
  min-height:56px!important;
  font-size:17px!important;
  border-radius:16px!important;
}

@media(max-width:430px){
  html.vda-mobile form.composer{
    grid-template-columns:44px 44px minmax(0,1fr) 54px!important;
    gap:5px!important;
  }
  html.vda-mobile form.composer>.attach-picker,
  html.vda-mobile form.composer>.voice-record-btn{
    width:44px!important;height:44px!important;min-width:44px!important;
  }
  html.vda-mobile form.composer>button[type="submit"]{
    width:54px!important;height:54px!important;min-width:54px!important;
  }
}


/* =========================================================
   Stage 17.6.4 — mobile voice stop + fixed sidebar footer
   ========================================================= */

/* Sidebar is now a true 3-part layout:
   brand/profile = top, channels = scrolling middle, Admin/Logout = fixed bottom. */
.messenger-sidebar{
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
}
.messenger-sidebar .stage6-channels{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain;
  padding-bottom:10px!important;
}
.messenger-sidebar .sidebar-footer{
  position:relative!important;
  left:auto!important;
  right:auto!important;
  bottom:auto!important;
  z-index:30!important;
  flex:0 0 auto!important;
  margin-top:auto!important;
  padding:12px 14px max(12px,env(safe-area-inset-bottom))!important;
  background:#fff!important;
  border-top:1px solid #dfe8ee!important;
  box-shadow:0 -8px 20px rgba(33,62,80,.08)!important;
}

/* Make both footer buttons large, bright and equal-width. */
.messenger-sidebar .sidebar-footer a{
  flex:1 1 0!important;
  min-width:0!important;
  min-height:52px!important;
  padding:0 12px!important;
  border-radius:15px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:15px!important;
  line-height:1.15!important;
  font-weight:900!important;
  text-align:center!important;
}
.messenger-sidebar .sidebar-footer a[href*="/admin"]{
  background:#dff3ff!important;
  color:#0878ae!important;
  border:1px solid #acdcef!important;
}
.messenger-sidebar .sidebar-footer a[href*="logout"]{
  background:#ffecec!important;
  color:#c72f2f!important;
  border:1px solid #ffc4c4!important;
}

/* Explicit recording controls. */
.voice-record-panel{
  display:grid!important;
  grid-template-columns:auto auto minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:9px!important;
  padding:10px 12px!important;
}
.voice-record-panel[hidden]{display:none!important}
.voice-rec-label{
  min-width:0;
  font-weight:700;
}
.voice-rec-actions{
  display:flex;
  align-items:center;
  gap:7px;
  margin-left:auto;
}
.voice-rec-actions button{
  margin:0!important;
  min-height:38px!important;
  padding:0 12px!important;
  border-radius:11px!important;
  font-size:12px!important;
  font-weight:900!important;
  cursor:pointer!important;
}
#voiceStop{
  background:#dff3ff!important;
  color:#0878ae!important;
  border:1px solid #addcf0!important;
}
#voiceCancel{
  background:#fff!important;
  color:#c13a3a!important;
  border:1px solid #f0caca!important;
}

/* Mobile drawer keeps footer permanently visible at the bottom. */
html.vda-mobile .messenger-sidebar{
  display:flex!important;
  flex-direction:column!important;
  height:100dvh!important;
  max-height:100dvh!important;
  overflow:hidden!important;
}
html.vda-mobile .messenger-sidebar .stage6-channels{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow-y:auto!important;
  padding-bottom:12px!important;
}
html.vda-mobile .messenger-sidebar .sidebar-footer{
  position:relative!important;
  flex:0 0 auto!important;
  width:100%!important;
  margin:0!important;
  padding:10px 12px max(12px,env(safe-area-inset-bottom))!important;
}
html.vda-mobile .messenger-sidebar .sidebar-footer a{
  min-height:58px!important;
  font-size:17px!important;
  border-radius:16px!important;
}

/* On phones, recording controls are stacked cleanly and Stop is obvious. */
html.vda-mobile .voice-record-panel{
  grid-template-columns:auto auto minmax(0,1fr)!important;
  gap:8px!important;
  padding:10px!important;
}
html.vda-mobile .voice-rec-actions{
  grid-column:1/-1!important;
  width:100%!important;
  display:grid!important;
  grid-template-columns:minmax(0,1.7fr) minmax(0,1fr)!important;
  gap:8px!important;
}
html.vda-mobile .voice-rec-actions button{
  width:100%!important;
  min-height:48px!important;
  font-size:14px!important;
  border-radius:13px!important;
}
html.vda-mobile #voiceStop{
  background:#199fd5!important;
  color:#fff!important;
  border-color:#199fd5!important;
}


/* =========================================================
   Stage 17.8 — LiveKit group-call E2EE
   ========================================================= */
.e2ee-modal[hidden]{display:none!important}
.e2ee-modal{
  position:fixed;
  inset:0;
  z-index:15000;
  display:grid;
  place-items:center;
  padding:18px;
  background:rgba(6,18,29,.58);
  backdrop-filter:blur(6px);
}
.e2ee-card{
  position:relative;
  width:min(540px,100%);
  padding:28px;
  border-radius:26px;
  background:#fff;
  box-shadow:0 32px 100px rgba(0,0,0,.30);
  color:#233442;
}
.e2ee-close{
  position:absolute;
  right:15px;top:13px;
  width:38px;height:38px;
  border:0;border-radius:50%;
  background:#f0f4f7;
  font-size:23px;
  cursor:pointer;
}
.e2ee-lock{
  width:72px;height:72px;
  display:grid;place-items:center;
  margin:0 auto 12px;
  border-radius:23px;
  background:#e5f8ed;
  font-size:34px;
}
.e2ee-card h3{
  margin:0;
  text-align:center;
  font-size:23px;
}
.e2ee-explain{
  margin:8px auto 20px;
  max-width:430px;
  text-align:center;
  color:#718494;
  font-size:13px;
  line-height:1.5;
}
.e2ee-label{
  display:block;
  margin-bottom:6px;
  font-size:12px;
  font-weight:800;
  color:#526675;
}
.e2ee-input-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 48px;
  gap:7px;
}
.e2ee-input-row input{
  width:100%;
  height:50px;
  padding:0 13px;
  border:1px solid #cfdee6;
  border-radius:14px;
  font:600 15px/1.2 ui-monospace,SFMono-Regular,Consolas,monospace;
}
.e2ee-input-row button{
  border:1px solid #cfdee6;
  border-radius:14px;
  background:#f5f9fb;
  cursor:pointer;
}
.e2ee-tools{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:9px;
}
.e2ee-tools button{
  min-height:42px;
  border:1px solid #d7e5ec;
  border-radius:12px;
  background:#f6fafc;
  color:#345365;
  font-weight:800;
  cursor:pointer;
}
.e2ee-fingerprint{
  margin-top:10px;
  padding:8px 10px;
  border-radius:10px;
  background:#edf8f2;
  color:#23754a;
  text-align:center;
  font:800 12px/1.2 ui-monospace,SFMono-Regular,Consolas,monospace;
}
.e2ee-warning{
  margin-top:12px;
  padding:10px 11px;
  border-radius:12px;
  background:#fff7e8;
  color:#7d5a17;
  font-size:12px;
  line-height:1.45;
}
.e2ee-continue{
  width:100%;
  min-height:50px;
  margin-top:14px;
  border:0;
  border-radius:14px;
  background:#1a9c5d;
  color:#fff;
  font-weight:900;
  font-size:14px;
  cursor:pointer;
}
.e2ee-status-badge{
  width:100%;
  min-height:38px;
  margin:0 0 10px;
  padding:7px 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  border:1px solid rgba(73,218,139,.22);
  border-radius:12px;
  background:rgba(45,185,108,.10);
  color:#bff5d6;
  cursor:default;
}
.e2ee-status-badge b{font-size:12px}
.e2ee-status-badge span{
  font:700 10px/1.2 ui-monospace,SFMono-Regular,Consolas,monospace;
  color:#8eddb1;
}
html.vda-mobile .e2ee-modal{padding:10px}
html.vda-mobile .e2ee-card{
  padding:24px 16px;
  border-radius:22px;
}
html.vda-mobile .e2ee-card h3{font-size:21px}
html.vda-mobile .e2ee-explain{font-size:14px}
html.vda-mobile .e2ee-input-row input{font-size:16px;height:54px}
html.vda-mobile .e2ee-tools{grid-template-columns:1fr}
html.vda-mobile .e2ee-tools button{min-height:48px;font-size:14px}
html.vda-mobile .e2ee-continue{min-height:54px;font-size:15px}


/* ===== Stage 17.9: choose ordinary vs E2EE group call ===== */
.call-security-options{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:16px;
}
.call-security-options button{
  min-height:132px;
  padding:18px 14px;
  border:1px solid #d8e5ec;
  border-radius:18px;
  background:#f7fafc;
  color:#2d4554;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  text-align:center;
}
.call-security-options button:hover{
  border-color:#7fc9e9;
  background:#eef9fe;
  transform:translateY(-1px);
}
.call-security-options span{font-size:31px}
.call-security-options b{font-size:15px}
.call-security-options small{font-size:11px;line-height:1.4;color:#758998}
html.vda-mobile .call-security-options{grid-template-columns:1fr}
html.vda-mobile .call-security-options button{min-height:104px}


/* =========================================================
   Stage 17.10 — call + chat simultaneously
   ========================================================= */
.call-panel-head{position:relative}
.call-minimize-btn{
  margin-left:auto!important;
  width:38px!important;height:38px!important;min-width:38px!important;
  padding:0!important;border:1px solid rgba(255,255,255,.12)!important;
  border-radius:12px!important;background:rgba(255,255,255,.08)!important;
  color:#e6eef5!important;font-size:24px!important;line-height:1!important;
  cursor:pointer!important
}
.call-minimize-btn:hover{background:rgba(255,255,255,.14)!important}

.mini-call-bar[hidden]{display:none!important}
.mini-call-bar{
  position:fixed;z-index:11000;right:18px;bottom:18px;
  width:min(430px,calc(100vw - 36px));min-height:64px;
  display:flex;align-items:center;gap:8px;padding:8px;
  border:1px solid #cfe1ea;border-radius:18px;
  background:rgba(255,255,255,.96);backdrop-filter:blur(12px);
  box-shadow:0 18px 48px rgba(20,52,73,.22)
}
.mini-call-main{
  flex:1 1 auto;min-width:0;min-height:48px;padding:6px 8px;border:0;
  background:transparent;color:#233746;display:flex;align-items:center;
  gap:9px;text-align:left;cursor:pointer
}
.mini-call-status-dot{
  width:10px;height:10px;flex:0 0 10px;border-radius:50%;
  background:#35c879;box-shadow:0 0 0 5px rgba(53,200,121,.12)
}
.mini-call-copy{display:block;min-width:0}
.mini-call-copy b{
  display:block;font-size:13px;line-height:1.2;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis
}
.mini-call-copy small{
  display:block;margin-top:3px;color:#718796;font-size:10.5px;line-height:1.2;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}
.mini-call-actions{flex:0 0 auto;display:flex;gap:6px}
.mini-call-actions button{
  width:42px;height:42px;border:1px solid #dbe6ec;border-radius:50%;
  background:#f5f9fb;color:#37505f;font-size:17px;cursor:pointer
}
.mini-call-actions button.off{background:#eef1f3;color:#8997a0}
.mini-call-actions button.danger{
  border-color:#ffd0d0;background:#fff0f0;color:#ca3333
}
.mini-call-actions button:disabled{opacity:.45;cursor:not-allowed}

html.vda-mobile .mini-call-bar{
  left:7px;right:7px;bottom:max(7px,env(safe-area-inset-bottom));
  width:auto;min-height:70px;border-radius:18px;padding:8px
}
html.vda-mobile body.call-is-minimized form.composer{
  margin-bottom:82px!important
}
html.vda-mobile .mini-call-copy b{font-size:14px}
html.vda-mobile .mini-call-copy small{font-size:11px}
html.vda-mobile .mini-call-actions{gap:5px}
html.vda-mobile .mini-call-actions button{
  width:44px;height:44px;font-size:18px
}
@media(max-width:430px){
  html.vda-mobile .mini-call-bar{gap:5px}
  html.vda-mobile .mini-call-main{padding-left:5px;padding-right:4px}
  html.vda-mobile .mini-call-copy small{max-width:150px}
  html.vda-mobile .mini-call-actions button{width:40px;height:40px}
}


/* =========================================================
   Stage 17.11 — persistent group call across chat navigation
   ========================================================= */
.persistent-call-bar{
  z-index:12000!important;
}
.persistent-call-bar .mini-call-main{
  max-width:280px;
}
.call-window-body{
  min-height:100dvh;
  margin:0;
  background:#eef5f8;
  overflow-x:hidden;
}
.call-window-shell{
  width:100%;
  min-height:100dvh;
  padding:12px;
  box-sizing:border-box;
}
.call-window-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
  padding:10px 12px;
  border:1px solid #d8e5eb;
  border-radius:16px;
  background:#fff;
}
.call-window-top div{min-width:0}
.call-window-top b{
  display:block;
  color:#263d4b;
  font-size:15px;
}
.call-window-top small{
  display:block;
  margin-top:2px;
  max-width:240px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#718694;
}
.call-window-top>button{
  min-height:42px;
  padding:0 13px;
  border:0;
  border-radius:12px;
  background:#199fd5;
  color:#fff;
  font-weight:800;
  cursor:pointer;
}
.call-window-panel{
  position:relative!important;
  inset:auto!important;
  width:100%!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
  border-radius:20px!important;
}
.call-window-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:10px;
  padding:8px 10px;
  color:#748794;
  font-size:11px;
}
.call-window-footer button{
  min-height:38px;
  padding:0 12px;
  border:1px solid #d7e4ea;
  border-radius:11px;
  background:#fff;
  color:#356074;
  font-weight:800;
  cursor:pointer;
}
.call-window-body .group-call-chooser{
  position:fixed!important;
  z-index:13000!important;
}
.call-window-body.call-is-minimized{
  overflow:hidden;
}
.call-window-body.call-is-minimized .call-window-top,
.call-window-body.call-is-minimized .call-window-footer{
  display:none;
}
.call-window-body.call-is-minimized .mini-call-bar{
  left:7px!important;
  right:7px!important;
  top:7px!important;
  bottom:auto!important;
  width:auto!important;
}
@media(max-width:600px){
  .call-window-shell{padding:7px}
  .call-window-top{
    align-items:flex-start;
    flex-direction:column;
  }
  .call-window-top>button{width:100%}
  .call-window-footer{
    flex-direction:column;
    align-items:stretch;
  }
  .call-window-footer button{width:100%}
}

/* Stage 17.11.1 — personal call chooser */
.call-user-load-error{
  padding:16px;
  border:1px solid #f0d0d0;
  border-radius:12px;
  background:#fff5f5;
  color:#a43b3b;
  line-height:1.45;
}
.call-user-load-error small{color:#7f5a5a}

/* Stage 18.1 — production readiness */
.production-checks{display:grid;gap:10px}.production-check{display:grid;grid-template-columns:38px minmax(0,1fr);gap:10px;padding:13px;border:1px solid #dbe6eb;border-radius:14px;background:#fff}.production-check-icon{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;font-weight:900}.production-check.ok .production-check-icon{background:#e6f8ee;color:#23844f}.production-check.bad .production-check-icon{background:#fff0e9;color:#c65a2b}.production-check p{margin:3px 0 0;color:#627785;word-break:break-word}.production-check small{display:block;margin-top:5px;color:#a0623e;line-height:1.4}.production-steps{padding-left:22px;line-height:1.65}.production-steps li+li{margin-top:5px}


/* =========================================================
   Stage 19 — Backups
   ========================================================= */
.backup-create-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}
.backup-create-card>div{min-width:0}
.backup-create-card form{flex:0 0 auto}
.backup-success,.backup-error{
  padding:12px 14px;
  border-radius:12px;
  font-weight:800;
}
.backup-success{background:#e8f8ef;color:#227a49;border:1px solid #bfe8d0}
.backup-error{background:#fff0f0;color:#ad3737;border:1px solid #f1caca}
.backup-list{display:grid;gap:10px}
.backup-item{
  display:grid;
  grid-template-columns:42px minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  padding:13px;
  border:1px solid #dce7ec;
  border-radius:15px;
  background:#fff;
}
.backup-item-icon{
  width:40px;height:40px;display:grid;place-items:center;
  border-radius:12px;background:#f3f8fa;font-size:18px
}
.backup-item-main{min-width:0}
.backup-item-main>b{
  display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap
}
.backup-item-main small{
  display:block;margin-top:3px;color:#748895;line-height:1.4
}
.backup-item-main span{
  display:block;margin-top:4px;font-size:11px;color:#55717f
}
.backup-item-actions{display:flex;gap:7px}
.backup-item-actions form{margin:0}
.backup-item-actions button{
  min-height:38px;padding:0 11px;border:1px solid #d4e2e8;
  border-radius:10px;background:#f7fafb;color:#315668;font-weight:800;cursor:pointer
}
.backup-item-actions button.danger{
  background:#fff1f1;color:#bd3939;border-color:#f1cccc
}
@media(max-width:760px){
  .backup-create-card{align-items:stretch;flex-direction:column}
  .backup-create-card form,.backup-create-card button{width:100%}
  .backup-item{grid-template-columns:38px minmax(0,1fr)}
  .backup-item-actions{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr}
  .backup-item-actions button{width:100%}
}


/* =========================================================
   Stage 20 — Security log
   ========================================================= */
.security-stat-grid{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}
.security-stat-grid article{
  padding:14px;border:1px solid #dbe6eb;border-radius:14px;background:#fff;
}
.security-stat-grid article b{display:block;font-size:24px;color:#274554}
.security-stat-grid article small{display:block;margin-top:3px;color:#718590}
.security-stat-grid article.critical{border-color:#f0c0c0;background:#fff5f5}
.security-stat-grid article.critical b{color:#bd3434}
.security-ip-list{display:flex;flex-wrap:wrap;gap:8px}
.security-ip-list a{
  display:flex;gap:8px;align-items:center;padding:8px 10px;
  border:1px solid #d8e5eb;border-radius:11px;background:#f7fafb;
  color:#315768;text-decoration:none
}
.security-ip-list span{font-size:11px;color:#788b96}
.security-filter{
  display:grid;grid-template-columns:minmax(180px,1.5fr) minmax(130px,.7fr) minmax(180px,1fr) minmax(130px,.7fr) auto auto;
  gap:8px;align-items:center
}
.security-filter input,.security-filter select{
  width:100%;min-height:42px;padding:0 10px;border:1px solid #d5e2e8;border-radius:11px;background:#fff
}
.security-events{display:grid;gap:8px}
.security-event{
  display:grid;grid-template-columns:38px minmax(0,1fr);gap:10px;
  padding:12px;border:1px solid #dce7ec;border-radius:13px;background:#fff
}
.security-event.sev-warning{border-left:4px solid #e8a331}
.security-event.sev-critical{border-left:4px solid #d54949;background:#fffafa}
.security-event-level{
  width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:#f2f7f9
}
.security-event-title{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.security-event-title span{
  font-size:10px;padding:3px 7px;border-radius:999px;background:#eef4f6;color:#5f7581;text-transform:uppercase;font-weight:900
}
.sev-critical .security-event-title span{background:#ffe3e3;color:#ad2f2f}
.sev-warning .security-event-title span{background:#fff0d6;color:#a16814}
.security-event-meta{margin-top:3px;font-size:11px;color:#748995;line-height:1.5}
.security-event-meta a{color:#3d7894}
.security-event-path{
  margin-top:5px;padding:5px 7px;border-radius:7px;background:#f4f7f8;
  font:11px/1.35 ui-monospace,SFMono-Regular,Consolas,monospace;color:#4d6571;word-break:break-all
}
.security-event details{margin-top:7px}
.security-event summary{cursor:pointer;color:#547282;font-size:11px;font-weight:800}
.security-event pre{
  margin:7px 0 0;padding:9px;max-height:240px;overflow:auto;border-radius:8px;
  background:#17232b;color:#e4edf2;font-size:11px;white-space:pre-wrap;word-break:break-word
}
.security-next{margin-top:12px;text-align:center}
@media(max-width:900px){
  .security-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .security-filter{grid-template-columns:1fr 1fr}
}
@media(max-width:560px){
  .security-stat-grid{grid-template-columns:1fr 1fr}
  .security-filter{grid-template-columns:1fr}
  .security-event{grid-template-columns:30px minmax(0,1fr);padding:10px}
  .security-event-level{width:28px;height:28px}
}


/* =========================================================
   Stage 21 — Notification center
   ========================================================= */
.notification-nav-link .nav-ico{font-size:18px}
.notification-live-badge[hidden]{display:none!important}
.notification-home-button{position:relative}
.notification-home-button .notification-live-badge{
  position:absolute;right:-5px;top:-5px;min-width:18px;height:18px;padding:0 4px;
  display:grid;place-items:center;border-radius:999px;background:#e54848;color:#fff;
  font-size:10px;font-style:normal;font-weight:900;box-shadow:0 0 0 2px #fff
}
.notifications-main{min-width:0}
.notification-topbar{gap:12px}
.notification-top-actions{margin-left:auto;display:flex;align-items:center;gap:7px}
.notification-top-actions form{margin:0}
.notification-top-actions button{
  min-height:40px;padding:0 12px;border:1px solid #d4e3e9;border-radius:12px;
  background:#fff;color:#365d70;font-weight:800;cursor:pointer
}
.notification-toolbar{
  display:flex;align-items:center;gap:8px;padding:12px 18px;border-bottom:1px solid #e0e9ed;background:#fff
}
.notification-toolbar>a{
  min-height:36px;padding:0 12px;display:flex;align-items:center;gap:7px;border-radius:999px;
  color:#526d7b;text-decoration:none;font-weight:800;font-size:12px
}
.notification-toolbar>a.active{background:#e6f5fb;color:#1685b3}
.notification-toolbar>a b{
  min-width:19px;height:19px;padding:0 5px;display:grid;place-items:center;border-radius:999px;
  background:#e64747;color:#fff;font-size:10px
}
.notification-toolbar select{
  margin-left:auto;min-height:38px;padding:0 11px;border:1px solid #d6e4ea;border-radius:11px;background:#fff
}
.notification-feed{padding:14px 18px 24px;display:grid;gap:9px}
.notification-card{
  display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;
  border:1px solid #dfe8ed;border-radius:16px;background:#fff;overflow:hidden
}
.notification-card.unread{border-color:#a9dcef;background:#f5fcff;box-shadow:0 5px 18px rgba(33,133,173,.07)}
.notification-card-link{
  min-width:0;padding:13px 8px 13px 13px;display:grid;grid-template-columns:46px minmax(0,1fr);
  gap:11px;align-items:center;text-decoration:none;color:inherit
}
.notification-icon{
  width:44px;height:44px;display:grid;place-items:center;border-radius:14px;
  background:#eef7fa;font-size:21px
}
.notification-card.unread .notification-icon{background:#dff4fc}
.notification-copy{min-width:0}
.notification-title-row{display:flex;align-items:center;gap:7px}
.notification-title-row b{font-size:13px;color:#294657}
.notification-title-row i{
  padding:2px 6px;border-radius:999px;background:#1c9ed1;color:#fff;
  font-size:9px;font-style:normal;font-weight:900;text-transform:uppercase
}
.notification-text{display:block;margin-top:3px;color:#4c6572;font-size:12.5px;line-height:1.4}
.notification-meta{display:block;margin-top:5px;color:#82949e;font-size:10.5px}
.notification-card-actions{display:flex;align-items:center;gap:5px;padding-right:10px}
.notification-card-actions button{
  width:34px;height:34px;border:1px solid #dbe6eb;border-radius:10px;background:#f7fafb;
  color:#55727f;font-size:16px;cursor:pointer
}
.notification-card-actions button:last-child:hover{background:#fff0f0;color:#be3a3a;border-color:#f1cccc}
.notification-empty{padding:60px 20px;text-align:center}
.notification-empty>span{display:block;font-size:42px;margin-bottom:10px}
.notification-empty>b{font-size:18px}
.notification-empty>p{max-width:430px;margin:7px auto;color:#78909c;line-height:1.45}
.notification-footer-actions{padding:0 18px 25px;text-align:center}
.notification-footer-actions button{
  min-height:40px;padding:0 13px;border:1px solid #e0e7ea;border-radius:11px;background:#fff;color:#6b7c85;cursor:pointer
}
.notification-settings-modal[hidden]{display:none!important}
.notification-settings-modal{
  position:fixed;inset:0;z-index:16000;display:grid;place-items:center;padding:16px;
  background:rgba(9,24,34,.54);backdrop-filter:blur(5px)
}
.notification-settings-card{
  width:min(620px,100%);max-height:min(760px,92dvh);overflow:auto;padding:20px;
  border-radius:22px;background:#fff;box-shadow:0 28px 90px rgba(0,0,0,.28)
}
.notification-settings-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.notification-settings-head b{display:block;font-size:19px}
.notification-settings-head small{display:block;margin-top:3px;color:#78909d}
.notification-settings-head>button{
  width:38px;height:38px;border:0;border-radius:50%;background:#eff4f6;font-size:22px;cursor:pointer
}
.notification-pref-table{margin-top:16px;border:1px solid #dde7eb;border-radius:15px;overflow:hidden}
.notification-pref-header,.notification-pref-row{
  display:grid;grid-template-columns:minmax(0,1fr) 70px 70px;align-items:center
}
.notification-pref-header{padding:8px 12px;background:#f4f8fa;color:#6f848f;font-size:10px;font-weight:900;text-transform:uppercase}
.notification-pref-header span:not(:first-child){text-align:center}
.notification-pref-row{min-height:51px;padding:0 12px;border-top:1px solid #edf1f3;font-size:12.5px;font-weight:700}
.notification-pref-row label{display:flex;justify-content:center;cursor:pointer}
.notification-pref-row input{position:absolute;opacity:0}
.notification-pref-row i{
  width:38px;height:22px;padding:2px;border-radius:999px;background:#cfdade;position:relative;transition:.18s
}
.notification-pref-row i:after{
  content:"";position:absolute;width:18px;height:18px;left:2px;top:2px;border-radius:50%;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.22);transition:.18s
}
.notification-pref-row input:checked+i{background:#2aa5d4}
.notification-pref-row input:checked+i:after{left:18px}
.notification-settings-save{width:100%;margin-top:14px;min-height:48px}
@media(max-width:700px){
  .notification-toolbar{padding:10px;overflow:auto}
  .notification-toolbar select{min-width:160px}
  .notification-feed{padding:10px}
  .notification-card-link{grid-template-columns:39px minmax(0,1fr);padding:11px 5px 11px 10px}
  .notification-icon{width:38px;height:38px;border-radius:12px;font-size:18px}
  .notification-card-actions{padding-right:6px;gap:3px}
  .notification-card-actions button{width:31px;height:31px}
  .notification-pref-header,.notification-pref-row{grid-template-columns:minmax(0,1fr) 58px 58px}
}


/* =========================================================
   Stage 22 — Advanced search
   ========================================================= */
.advanced-search-main{min-width:0;background:#f5f8fa;overflow-y:auto}
.advanced-search-topbar{background:#fff;border-bottom:1px solid #e0e9ed}
.advanced-search-box{
  position:relative;padding:16px 18px;background:#fff;border-bottom:1px solid #e0e9ed
}
.advanced-search-input-wrap{
  position:relative;display:grid;grid-template-columns:38px minmax(0,1fr) auto;
  align-items:center;max-width:1000px;margin:0 auto
}
.advanced-search-input-wrap>span{
  position:absolute;left:13px;z-index:2;font-size:17px;pointer-events:none
}
.advanced-search-input-wrap>input{
  grid-column:1/3;width:100%;height:52px;padding:0 14px 0 42px;
  border:1px solid #cfdde4;border-radius:15px 0 0 15px;background:#f8fbfc;
  font-size:15px;outline:none
}
.advanced-search-input-wrap>input:focus{border-color:#55b7dc;background:#fff;box-shadow:0 0 0 3px rgba(46,158,203,.08)}
.advanced-search-input-wrap>button{
  height:52px;padding:0 22px;border:0;border-radius:0 15px 15px 0;
  background:#169dd1;color:#fff;font-weight:900;cursor:pointer
}
.search-live-suggest{
  position:absolute;left:0;right:0;top:58px;z-index:8000;
  max-height:440px;overflow:auto;padding:6px;border:1px solid #d6e4ea;border-radius:15px;
  background:#fff;box-shadow:0 18px 50px rgba(29,66,87,.18)
}
.search-live-suggest[hidden]{display:none!important}
.search-live-suggest>a{
  display:grid;grid-template-columns:34px minmax(0,1fr);gap:9px;align-items:center;
  padding:9px 10px;border-radius:10px;color:#294958;text-decoration:none
}
.search-live-suggest>a:hover{background:#f0f8fb}
.search-live-suggest>a>span:first-child{font-size:17px;text-align:center}
.search-live-suggest b,.search-live-suggest small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.search-live-suggest b{font-size:12px}.search-live-suggest small{margin-top:2px;color:#758995;font-size:10.5px}
.search-live-suggest .search-suggest-all{
  display:block;margin-top:4px;padding:10px;text-align:center;background:#eff8fc;color:#157eaa;font-weight:900
}
.advanced-search-scopes{
  max-width:1000px;margin:11px auto 0;display:flex;gap:6px;overflow:auto
}
.advanced-search-scopes a{
  flex:0 0 auto;min-height:34px;padding:0 12px;display:flex;align-items:center;border-radius:999px;
  color:#657b87;text-decoration:none;font-size:11.5px;font-weight:900
}
.advanced-search-scopes a.active{background:#e2f4fb;color:#1385b2}
.advanced-search-filters{max-width:1000px;margin:11px auto 0}
.advanced-search-filters summary{cursor:pointer;color:#526d7b;font-size:12px;font-weight:900}
.advanced-search-filter-grid{
  display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px;margin-top:10px;padding:12px;
  border:1px solid #dce7ec;border-radius:14px;background:#f8fbfc
}
.advanced-search-filter-grid label>span{display:block;margin-bottom:5px;color:#6c818c;font-size:10px;font-weight:900;text-transform:uppercase}
.advanced-search-filter-grid input:not([type=checkbox]),.advanced-search-filter-grid select{
  width:100%;height:40px;padding:0 9px;border:1px solid #d2e0e6;border-radius:10px;background:#fff
}
.search-check{display:flex;align-items:center;gap:8px;padding-top:18px}
.search-check input{width:18px;height:18px}
.search-check span{margin:0!important;text-transform:none!important;font-size:11px!important}
.search-author-field{position:relative}
.search-author-suggest{
  position:absolute;left:0;right:0;top:65px;z-index:7000;padding:5px;border:1px solid #d7e4ea;border-radius:12px;background:#fff;box-shadow:0 12px 34px rgba(20,54,73,.16)
}
.search-author-suggest[hidden]{display:none!important}
.search-author-suggest button{
  width:100%;min-height:38px;padding:5px 7px;display:flex;align-items:center;gap:8px;border:0;border-radius:8px;background:#fff;text-align:left;cursor:pointer
}
.search-author-suggest button:hover{background:#f0f8fb}
.search-author-suggest button span{width:28px;height:28px;display:grid;place-items:center;border-radius:50%;background:#e8f2f6;overflow:hidden}
.search-author-suggest img{width:100%;height:100%;object-fit:cover}
.advanced-search-summary{
  padding:12px 18px;display:flex;gap:9px;align-items:center;flex-wrap:wrap;background:#edf4f7;border-bottom:1px solid #dce7ec;color:#637984;font-size:11px
}
.advanced-search-summary b{color:#294b5a}
.advanced-search-summary span{padding:4px 8px;border-radius:999px;background:#fff}
.search-welcome{
  max-width:780px;margin:60px auto;padding:30px 20px;text-align:center;color:#45606d
}
.search-welcome.compact{margin:25px auto}
.search-welcome-icon{font-size:46px}
.search-welcome h2{margin:10px 0 7px;color:#294754}
.search-welcome>p{max-width:610px;margin:0 auto;color:#738895;line-height:1.55}
.search-welcome-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:24px}
.search-welcome-cards div{padding:17px;border:1px solid #dce7ec;border-radius:15px;background:#fff}
.search-welcome-cards span,.search-welcome-cards b,.search-welcome-cards small{display:block}
.search-welcome-cards span{font-size:25px}.search-welcome-cards b{margin-top:6px}.search-welcome-cards small{margin-top:4px;color:#7a8d97}
.search-section{padding:17px 18px;border-bottom:1px solid #e0e9ed;background:#f5f8fa}
.search-section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.search-section-head>div{display:flex;align-items:center;gap:8px}.search-section-head h2{margin:0;font-size:15px}
.search-section-head>b{min-width:26px;height:26px;padding:0 7px;display:grid;place-items:center;border-radius:999px;background:#e1eef3;color:#54717f;font-size:10px}
.search-channel-grid,.search-user-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:8px}
.search-channel-card,.search-user-card{
  min-width:0;padding:10px;display:grid;grid-template-columns:42px minmax(0,1fr) auto;gap:9px;align-items:center;
  border:1px solid #dce7ec;border-radius:13px;background:#fff;color:#294754;text-decoration:none
}
.search-user-card{grid-template-columns:42px minmax(0,1fr)}
.search-channel-card:hover,.search-user-card:hover{border-color:#9ed2e5;box-shadow:0 5px 18px rgba(31,110,142,.07)}
.search-channel-avatar,.search-user-avatar{
  width:40px;height:40px;display:grid;place-items:center;border-radius:50%;background:#dff2f9;color:#147ca7;font-weight:900;overflow:hidden
}
.search-user-avatar img{width:100%;height:100%;object-fit:cover}
.search-channel-card b,.search-channel-card small,.search-user-card b,.search-user-card small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.search-channel-card small,.search-user-card small{margin-top:3px;color:#7b8e98;font-size:10.5px}
.search-channel-card i{font-style:normal}
.advanced-message-results{display:grid;gap:7px}
.advanced-message-result{
  display:grid;grid-template-columns:42px minmax(0,1fr) 24px;gap:10px;align-items:center;
  padding:11px;border:1px solid #dde7eb;border-radius:14px;background:#fff;color:#294754;text-decoration:none
}
.advanced-message-result:hover{border-color:#99d0e4;background:#fbfeff}
.advanced-message-result .search-result-avatar{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:#e5f1f5;overflow:hidden}
.advanced-message-result .search-result-avatar img{width:100%;height:100%;object-fit:cover}
.advanced-message-result .search-result-copy{min-width:0}
.advanced-message-result .search-result-top{display:flex;gap:7px;align-items:center;flex-wrap:wrap;font-size:10.5px}
.advanced-message-result .search-result-top em{font-style:normal;color:#1b8aba}.advanced-message-result time{margin-left:auto;color:#84959e}
.advanced-message-text{display:block;margin-top:5px;color:#4c6572;font-size:12.5px;line-height:1.45;white-space:normal}
.advanced-message-result small{display:block;margin-top:5px;color:#7c9099}
.search-result-arrow{color:#9aaab2;font-size:22px}
.search-file-list{display:grid;gap:7px}
.search-file-card{
  display:grid;grid-template-columns:42px minmax(0,1fr) 38px;gap:10px;align-items:center;padding:10px;
  border:1px solid #dde7eb;border-radius:13px;background:#fff;color:#294754;text-decoration:none
}
.search-file-card:hover{border-color:#9ed2e5}
.search-file-icon{width:40px;height:40px;display:grid;place-items:center;border-radius:11px;background:#edf4f7;font-size:20px}
.search-file-copy{min-width:0}.search-file-copy b,.search-file-copy small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.search-file-copy small{margin-top:4px;color:#7a8e98;font-size:10.5px}
.search-file-chat{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:#eef7fa;color:#2185ac}
@media(max-width:900px){
  .advanced-search-filter-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:700px){
  .advanced-search-box,.search-section{padding-left:10px;padding-right:10px}
  .advanced-search-input-wrap{grid-template-columns:32px minmax(0,1fr) 58px}
  .advanced-search-input-wrap>input{height:48px;font-size:14px}
  .advanced-search-input-wrap>button{height:48px;padding:0 10px;font-size:0}
  .advanced-search-input-wrap>button:after{content:"🔎";font-size:16px}
  .advanced-search-filter-grid{grid-template-columns:1fr}
  .search-check{padding-top:4px}
  .search-welcome{margin:25px auto}
  .search-welcome-cards{grid-template-columns:1fr}
  .search-channel-grid,.search-user-grid{grid-template-columns:1fr}
  .advanced-message-result{grid-template-columns:36px minmax(0,1fr) 18px;padding:9px}
  .advanced-message-result .search-result-avatar{width:34px;height:34px}
  .advanced-message-result time{width:100%;margin:0}
}


/* =========================================================
   Stage 23 — Media / Files / Links / Voice
   ========================================================= */
.media-hub-main{min-width:0;background:#f5f8fa;overflow-y:auto}
.media-hub-topbar{background:#fff;border-bottom:1px solid #dfe9ed;gap:10px}
.media-back{
  width:38px;height:38px;display:grid;place-items:center;border-radius:50%;
  background:#f0f5f7;color:#385d6e;text-decoration:none;font-size:21px;font-weight:800
}
.media-search-link{
  margin-left:auto;min-height:38px;padding:0 12px;display:flex;align-items:center;border-radius:11px;
  background:#eef7fa;color:#257ca1;text-decoration:none;font-size:12px;font-weight:900
}
.media-tabs{
  position:sticky;top:0;z-index:100;display:grid;grid-template-columns:repeat(4,1fr);
  border-bottom:1px solid #dfe8ec;background:rgba(255,255,255,.96);backdrop-filter:blur(12px)
}
.media-tabs a{
  min-height:58px;display:flex;gap:7px;align-items:center;justify-content:center;
  border-bottom:3px solid transparent;color:#667d89;text-decoration:none;font-size:12px
}
.media-tabs a span{font-size:17px}.media-tabs a.active{border-bottom-color:#209fce;color:#167fa8;background:#f5fcff}
.media-hub-content{padding:14px 16px 30px}
.media-empty{padding:70px 18px;text-align:center;color:#718690}
.media-empty>span{display:block;font-size:44px}.media-empty>b{display:block;margin-top:10px;font-size:18px;color:#385562}
.media-empty p{max-width:430px;margin:7px auto 0;line-height:1.45}
.media-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:9px}
.media-tile{
  position:relative;min-width:0;border:1px solid #dce7eb;border-radius:15px;background:#fff;overflow:hidden
}
.media-preview{
  position:relative;width:100%;aspect-ratio:1/1;border:0;padding:0;background:#e9f0f3;overflow:hidden;cursor:zoom-in
}
.media-preview img,.media-preview video{width:100%;height:100%;object-fit:cover;display:block}
.media-play{
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  width:48px;height:48px;display:grid;place-items:center;border-radius:50%;background:rgba(0,0,0,.6);color:#fff;font-size:18px
}
.media-tile-info{padding:8px 9px 2px;min-width:0}
.media-tile-info b,.media-tile-info small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.media-tile-info b{font-size:11.5px;color:#365662}.media-tile-info small{margin-top:2px;font-size:9.5px;color:#83959d}
.media-tile-actions{display:flex;gap:5px;padding:6px 8px 9px}
.media-tile-actions a,.media-tile-actions button,.media-file-actions a,.media-file-actions button,.media-voice-actions a,.media-voice-actions button{
  width:34px;height:32px;display:grid;place-items:center;border:1px solid #dce6ea;border-radius:9px;background:#f7fafb;color:#55727f;text-decoration:none;cursor:pointer
}
.media-tile-actions button,.media-file-actions button,.media-voice-actions button{margin-left:auto;color:#b24040;background:#fff3f3;border-color:#efd0d0}
.media-file-list,.media-link-list,.media-voice-list{display:grid;gap:8px;max-width:1050px;margin:0 auto}
.media-file-row,.media-link-row,.media-voice-row{
  display:grid;align-items:center;gap:10px;padding:10px;border:1px solid #dce7eb;border-radius:14px;background:#fff
}
.media-file-row{grid-template-columns:minmax(0,1fr) auto}
.media-file-open{min-width:0;display:grid;grid-template-columns:44px minmax(0,1fr);gap:10px;align-items:center;color:inherit;text-decoration:none}
.media-file-icon{width:42px;height:42px;display:grid;place-items:center;border-radius:12px;background:#eef4f7;font-size:21px}
.media-file-copy,.media-link-copy{min-width:0}
.media-file-copy b,.media-file-copy small,.media-link-copy a,.media-link-copy small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.media-file-copy b{font-size:12.5px;color:#355361}.media-file-copy small,.media-link-copy small{margin-top:4px;color:#82949c;font-size:10px}
.media-file-actions,.media-voice-actions{display:flex;gap:5px}
.media-link-row{grid-template-columns:40px minmax(0,1fr) 36px}
.media-link-icon{width:38px;height:38px;display:grid;place-items:center;border-radius:11px;background:#eef7fa}
.media-link-copy a{color:#1b82ac;font-size:12px;text-decoration:none}
.media-link-message{width:34px;height:34px;display:grid;place-items:center;border-radius:9px;background:#eef7fa;color:#2185ac;text-decoration:none}
.media-voice-row{grid-template-columns:42px minmax(0,1fr) auto}
.media-voice-avatar{width:40px;height:40px;display:grid;place-items:center;border-radius:50%;background:#dff2f9;color:#167da6;font-weight:900}
.media-voice-main{min-width:0}
.media-voice-main>div{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:5px}
.media-voice-main b{font-size:11.5px;color:#345360}.media-voice-main small{color:#85969e;font-size:9.5px}
.media-voice-main audio{width:min(520px,100%);height:36px}
.media-viewer[hidden]{display:none!important}
.media-viewer{
  position:fixed;inset:0;z-index:20000;background:rgba(7,14,19,.94);display:grid;grid-template-rows:58px minmax(0,1fr)
}
.media-viewer-open{overflow:hidden}
.media-viewer-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 16px;color:#fff;background:rgba(0,0,0,.25)}
.media-viewer-bar b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.media-viewer-bar>div{display:flex;gap:8px}.media-viewer-bar a,.media-viewer-bar button{
  width:40px;height:40px;display:grid;place-items:center;border:0;border-radius:11px;background:rgba(255,255,255,.12);color:#fff;text-decoration:none;font-size:20px;cursor:pointer
}
.media-viewer-stage{min-width:0;min-height:0;display:grid;place-items:center;padding:12px 70px 28px}
.media-viewer-stage img,.media-viewer-stage video{max-width:100%;max-height:100%;object-fit:contain;border-radius:6px}
.media-viewer-nav{
  position:absolute;top:50%;transform:translateY(-50%);width:48px;height:64px;border:0;border-radius:13px;background:rgba(255,255,255,.12);color:#fff;font-size:42px;cursor:pointer
}
.media-viewer-nav.prev{left:12px}.media-viewer-nav.next{right:12px}
@media(max-width:700px){
  .media-hub-content{padding:8px}
  .media-tabs a{min-height:50px;gap:4px;font-size:10.5px}.media-tabs a span{font-size:15px}
  .media-gallery{grid-template-columns:repeat(3,minmax(0,1fr));gap:3px}
  .media-tile{border-radius:7px}
  .media-tile-info{display:none}
  .media-tile-actions{position:absolute;right:3px;bottom:3px;padding:0;background:rgba(0,0,0,.35);border-radius:8px}
  .media-tile-actions a,.media-tile-actions button{width:28px;height:28px;border:0;background:transparent;color:#fff}
  .media-file-row{grid-template-columns:minmax(0,1fr)}
  .media-file-actions{justify-content:flex-end}
  .media-link-row{grid-template-columns:34px minmax(0,1fr) 30px;padding:8px}
  .media-voice-row{grid-template-columns:34px minmax(0,1fr);padding:8px}
  .media-voice-avatar{width:32px;height:32px}
  .media-voice-actions{grid-column:1/-1;justify-content:flex-end}
  .media-viewer-stage{padding:8px}
  .media-viewer-nav{width:40px;height:52px;font-size:34px;background:rgba(0,0,0,.35)}
  .media-viewer-nav.prev{left:5px}.media-viewer-nav.next{right:5px}
  .media-search-link{font-size:0}.media-search-link:after{content:"🔎";font-size:16px}
}

/* Stage 24 — moderation */
.moderation-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:14px}.moderation-stats article{padding:14px;border:1px solid #dbe6eb;border-radius:14px;background:#fff}.moderation-stats b{display:block;font-size:24px;color:#304f5e}.moderation-stats small{color:#758994}
.moderation-settings-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;align-items:end}.moderation-settings-grid label>span{display:block;margin-bottom:5px;font-size:10px;font-weight:900;color:#6d828d;text-transform:uppercase}.moderation-settings-grid input[type=number]{width:100%;height:40px;padding:0 9px;border:1px solid #d5e2e8;border-radius:10px}
.moderation-switch{grid-column:span 2;min-height:40px;display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid #dce7eb;border-radius:11px;background:#f8fbfc}.moderation-switch>span{margin:0!important;text-transform:none!important;font-size:11.5px!important}.moderation-settings-divider{grid-column:1/-1;margin-top:4px;padding-top:10px;border-top:1px solid #e5ecef;font-size:12px;font-weight:900;color:#385a6a}
.moderation-term-add{display:grid;grid-template-columns:180px minmax(0,1fr) auto;gap:8px;margin:12px 0}.moderation-term-add select,.moderation-term-add input{height:42px;padding:0 10px;border:1px solid #d6e3e8;border-radius:10px;background:#fff}.moderation-terms{display:flex;flex-wrap:wrap;gap:7px}.moderation-term{display:flex;align-items:center;gap:6px;padding:6px 7px;border:1px solid #ead4d4;border-radius:999px;background:#fff6f6}.moderation-term.allow{border-color:#cde7d7;background:#f1fbf5}.moderation-term small{color:#87979e}.moderation-term form{margin:0}.moderation-term button{width:24px;height:24px;border:0;border-radius:50%;background:rgba(0,0,0,.07)}
.moderation-event-list,.moderation-warning-list{display:grid;gap:8px}.moderation-event-list article{display:grid;grid-template-columns:120px minmax(0,1fr) auto;gap:10px;align-items:start;padding:10px;border:1px solid #dce7eb;border-radius:12px}.moderation-event-code{padding:5px 7px;border-radius:8px;background:#fff1df;color:#9a6416;font:10px ui-monospace,monospace;text-align:center}.moderation-event-list small{display:block;margin-top:3px;color:#80929b;font-size:10px}.moderation-event-list p{margin:6px 0 0;color:#526a76;font-size:11.5px}.moderation-event-list button{min-height:34px;padding:0 9px;border:1px solid #e2c87d;border-radius:9px;background:#fff8df;color:#906817}.moderation-warning-list article{display:grid;grid-template-columns:30px minmax(0,1fr);gap:8px;padding:10px;border:1px solid #e4e9eb;border-radius:11px}.moderation-warning-list p{margin:3px 0;color:#506976}.moderation-warning-list small{color:#82949d}
.report-tabs{display:flex;gap:7px;margin-bottom:12px}.report-tabs a{padding:8px 11px;border-radius:999px;background:#eef4f6;color:#58717e;text-decoration:none;font-size:11px;font-weight:900}.report-tabs a.active{background:#dff3fb;color:#147ea9}.report-queue{display:grid;gap:10px}.report-queue-card{padding:14px;border:1px solid #dce7eb;border-radius:15px;background:#fff}.report-card-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.report-card-head small{display:block;margin-top:3px;color:#81939c}.report-card-head>span{padding:4px 8px;border-radius:999px;background:#eef3f5;font-size:10px}.report-card-meta{margin-top:8px;color:#627984;font-size:11px}.report-details{margin-top:8px;padding:8px 10px;border-radius:9px;background:#f5f8fa}.report-queue-card blockquote{margin:9px 0;padding:10px;border-left:3px solid #badbe8;background:#f8fbfc}.report-resolution-form>input:not([type=hidden]){width:100%;height:40px;padding:0 10px;border:1px solid #d5e2e8;border-radius:10px}.report-resolution-form>div{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.report-resolution-form button{min-height:36px;padding:0 9px;border:1px solid #d9e3e7;border-radius:9px;background:#f7fafb}.report-resolution-form button.danger{background:#fff0f0;color:#b83b3b;border-color:#f0cccc}.report-resolved{margin-top:9px;color:#71858f;font-size:11px}
.report-modal[hidden]{display:none!important}.report-modal{position:fixed;inset:0;z-index:18000;display:grid;place-items:center;padding:15px;background:rgba(8,22,31,.55);backdrop-filter:blur(5px)}.report-dialog{width:min(520px,100%);padding:18px;border-radius:20px;background:#fff;box-shadow:0 25px 80px rgba(0,0,0,.25)}.report-dialog-head{display:flex;justify-content:space-between}.report-dialog-head b,.report-dialog-head small{display:block}.report-dialog-head small{margin-top:3px;color:#7b8e98}.report-dialog-head button{width:36px;height:36px;border:0;border-radius:50%;background:#eef3f5;font-size:20px}.report-dialog label{display:block;margin-top:13px}.report-dialog label>span{display:block;margin-bottom:5px;font-size:10px;font-weight:900;text-transform:uppercase;color:#6e828d}.report-dialog select,.report-dialog textarea{width:100%;padding:9px;border:1px solid #d5e2e8;border-radius:10px;background:#fff;resize:vertical}.report-dialog-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:14px}.report-dialog-actions button{min-height:40px;padding:0 12px;border:1px solid #d8e3e8;border-radius:10px;background:#f7fafb;font-weight:800}.report-dialog-actions button.primary{background:#188fbd;color:#fff;border-color:#188fbd}
@media(max-width:800px){.moderation-stats{grid-template-columns:1fr 1fr}.moderation-settings-grid{grid-template-columns:1fr 1fr}.moderation-event-list article{grid-template-columns:1fr}.moderation-term-add{grid-template-columns:1fr}}@media(max-width:520px){.moderation-settings-grid{grid-template-columns:1fr}.moderation-switch{grid-column:auto}}


/* =========================================================
   Stage 24.1 — compact sidebar / more room for chats
   ========================================================= */

/* The sidebar is a fixed-height flex column. Only the chat list scrolls. */
.messenger-sidebar{
  display:flex!important;
  flex-direction:column!important;
  height:100dvh!important;
  max-height:100dvh!important;
  overflow:hidden!important;
}

/* Smaller brand block. */
.messenger-sidebar .brand{
  flex:0 0 auto!important;
  min-height:58px!important;
  padding:8px 10px!important;
}
.messenger-sidebar .brand-logo{
  width:38px!important;
  height:38px!important;
  min-width:38px!important;
  font-size:18px!important;
}
.messenger-sidebar .brand b{font-size:15px!important}
.messenger-sidebar .brand small{font-size:10px!important;margin-top:1px!important}

/* Four main actions become a compact toolbar instead of four tall cards. */
.messenger-sidebar .sidebar-quick--compact{
  flex:0 0 auto!important;
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:5px!important;
  padding:6px 8px!important;
  margin:0!important;
  border-bottom:1px solid #edf2f4!important;
}
.messenger-sidebar .sidebar-quick--compact .sidebar-home-link{
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:0!important;
  min-height:44px!important;
  height:44px!important;
  margin:0!important;
  padding:0!important;
  border-radius:11px!important;
  background:#f4f8fa!important;
}
.messenger-sidebar .sidebar-quick--compact .sidebar-home-link:hover{
  background:#eaf5fa!important;
}
.messenger-sidebar .sidebar-quick--compact .sidebar-home-link>.nav-ico{
  width:34px!important;
  height:34px!important;
  min-width:34px!important;
  margin:0!important;
  border-radius:10px!important;
  font-size:17px!important;
}
.messenger-sidebar .sidebar-quick--compact .sidebar-home-link>span:nth-child(2){
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  overflow:hidden!important;
  clip:rect(0 0 0 0)!important;
  clip-path:inset(50%)!important;
  white-space:nowrap!important;
}
.messenger-sidebar .sidebar-quick--compact .nav-badge{
  position:absolute!important;
  top:-3px!important;
  right:-3px!important;
  z-index:3!important;
  min-width:18px!important;
  height:18px!important;
  padding:0 4px!important;
  display:grid!important;
  place-items:center!important;
  margin:0!important;
  border:2px solid #fff!important;
  border-radius:999px!important;
  font-size:9px!important;
  line-height:1!important;
}

/* Profile/search area: search already lives in the toolbar, so hide duplicate search card. */
.messenger-sidebar .sidebar-actions--compact{
  flex:0 0 auto!important;
  padding:5px 8px!important;
  margin:0!important;
}
.messenger-sidebar .sidebar-actions--compact>.sidebar-home-link[href="/search.php"]{
  display:none!important;
}
.messenger-sidebar .sidebar-actions--compact .me-card{
  min-height:46px!important;
  padding:5px 7px!important;
  border-radius:11px!important;
  margin:0!important;
}
.messenger-sidebar .sidebar-actions--compact .me-card .avatar{
  width:36px!important;
  height:36px!important;
  min-width:36px!important;
  font-size:14px!important;
}
.messenger-sidebar .sidebar-actions--compact .me-card-copy b{font-size:12.5px!important}
.messenger-sidebar .sidebar-actions--compact .me-card-copy small{font-size:9.5px!important;margin-top:1px!important}
.messenger-sidebar .sidebar-actions--compact .me-card-arrow{font-size:18px!important}

/* "Chats" caption is compact. */
.messenger-sidebar .sidebar-section-title{
  flex:0 0 auto!important;
  min-height:29px!important;
  padding:5px 10px 4px!important;
  font-size:10px!important;
}
.messenger-sidebar .sidebar-section-title a{
  width:28px!important;
  height:25px!important;
  display:grid!important;
  place-items:center!important;
  font-size:18px!important;
}

/* This is now the dominant area of the sidebar. */
.messenger-sidebar .stage6-channels{
  flex:1 1 auto!important;
  min-height:120px!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain!important;
  padding:0 5px 6px!important;
  scrollbar-gutter:stable;
}

/* Slightly denser chat rows, while keeping touch targets comfortable. */
.messenger-sidebar .stage6-channels .channel-link.telegram-channel{
  min-height:52px!important;
  padding:5px 7px!important;
  grid-template-columns:40px minmax(0,1fr)!important;
  gap:8px!important;
}
.messenger-sidebar .stage6-channels .channel-icon{
  width:40px!important;
  height:40px!important;
  min-width:40px!important;
  font-size:15px!important;
}
.messenger-sidebar .stage6-channels .channel-copy b{
  font-size:13.5px!important;
  line-height:1.15!important;
}
.messenger-sidebar .stage6-channels .channel-copy small{
  font-size:10.5px!important;
  line-height:1.2!important;
  margin-top:2px!important;
  max-width:none!important;
}
.messenger-sidebar .stage6-channels .channel-item.depth-1>.channel-link.telegram-channel{
  grid-template-columns:34px minmax(0,1fr)!important;
  min-height:46px!important;
  padding-left:12px!important;
}
.messenger-sidebar .stage6-channels .channel-item.depth-1 .channel-icon{
  width:34px!important;height:34px!important;min-width:34px!important;font-size:13px!important;
}
.messenger-sidebar .stage6-channels .channel-item.depth-2>.channel-link.telegram-channel,
.messenger-sidebar .stage6-channels .channel-item.depth-3>.channel-link.telegram-channel{
  grid-template-columns:30px minmax(0,1fr)!important;
  min-height:42px!important;
  padding-left:18px!important;
}
.messenger-sidebar .stage6-channels .channel-item.depth-2 .channel-icon,
.messenger-sidebar .stage6-channels .channel-item.depth-3 .channel-icon{
  width:30px!important;height:30px!important;min-width:30px!important;font-size:12px!important;
}

/* Reposition + / − controls for smaller rows. */
.messenger-sidebar .stage6-channels .chat-branch-toggle{
  left:34px!important;
  top:32px!important;
  width:18px!important;
  height:18px!important;
  font-size:12px!important;
}
.messenger-sidebar .stage6-channels .channel-item.depth-1>.chat-branch-toggle{
  left:34px!important;
  top:28px!important;
  width:17px!important;
  height:17px!important;
  font-size:11px!important;
}
.messenger-sidebar .stage6-channels .channel-item.depth-2>.chat-branch-toggle,
.messenger-sidebar .stage6-channels .channel-item.depth-3>.chat-branch-toggle{
  left:37px!important;
  top:25px!important;
  width:16px!important;
  height:16px!important;
  font-size:10px!important;
}

/* Admin/logout stay visible, but no longer consume ~70px each. */
.messenger-sidebar .sidebar-footer{
  flex:0 0 auto!important;
  width:100%!important;
  display:flex!important;
  gap:6px!important;
  margin:0!important;
  padding:6px 8px max(7px,env(safe-area-inset-bottom))!important;
  border-top:1px solid #dfe8ee!important;
  background:#fff!important;
  box-shadow:0 -5px 14px rgba(33,62,80,.06)!important;
}
.messenger-sidebar .sidebar-footer a,
.messenger-sidebar a[href*="/admin"],
.messenger-sidebar a[href*="admin.php"],
.messenger-sidebar a[href*="logout"],
.messenger-sidebar a[href*="signout"]{
  min-height:40px!important;
  height:40px!important;
  padding:0 9px!important;
  border-radius:11px!important;
  font-size:12px!important;
  line-height:1!important;
}

/* Mobile keeps the same compact structure. */
@media(max-width:760px){
  .messenger-sidebar .brand{
    min-height:56px!important;
    padding:7px 9px!important;
  }
  .messenger-sidebar .sidebar-close{
    width:38px!important;
    height:38px!important;
    font-size:25px!important;
  }
  .messenger-sidebar .sidebar-quick--compact{
    padding:5px 7px!important;
    gap:4px!important;
  }
  .messenger-sidebar .sidebar-quick--compact .sidebar-home-link{
    min-height:42px!important;
    height:42px!important;
  }
  .messenger-sidebar .sidebar-actions--compact{
    padding:4px 7px!important;
  }
  .messenger-sidebar .sidebar-actions--compact .me-card{
    min-height:44px!important;
  }
  .messenger-sidebar .sidebar-section-title{
    min-height:27px!important;
    padding:4px 9px!important;
  }
  .messenger-sidebar .stage6-channels{
    min-height:150px!important;
  }
  .messenger-sidebar .stage6-channels .channel-link.telegram-channel{
    min-height:50px!important;
    padding:5px 7px!important;
  }
  .messenger-sidebar .stage6-channels .channel-copy b{
    font-size:13.5px!important;
  }
  .messenger-sidebar .stage6-channels .channel-copy small{
    font-size:10.5px!important;
  }
  .messenger-sidebar .sidebar-footer{
    padding:5px 7px max(7px,env(safe-area-inset-bottom))!important;
  }
  .messenger-sidebar .sidebar-footer a,
  .messenger-sidebar a[href*="/admin"],
  .messenger-sidebar a[href*="admin.php"],
  .messenger-sidebar a[href*="logout"],
  .messenger-sidebar a[href*="signout"]{
    min-height:40px!important;
    height:40px!important;
    font-size:12px!important;
  }
}


/* =========================================================
   Stage 25 — Persistent personal calls
   ========================================================= */
.personal-call-window{margin:0;min-height:100dvh;background:#0d1720;color:#fff;overflow:hidden}
.personal-call-shell{height:100dvh;display:grid;grid-template-rows:auto minmax(0,1fr) auto auto auto;background:radial-gradient(circle at 50% 15%,#274a5b 0,#152732 35%,#0c151d 78%)}
.personal-call-top{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;background:rgba(5,13,18,.45);backdrop-filter:blur(12px)}
.personal-call-person{display:flex;align-items:center;gap:10px;min-width:0}.personal-call-person>span:last-child{min-width:0}.personal-call-person b,.personal-call-person small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.personal-call-person small{margin-top:2px;color:#a9bec9;font-size:11px}
.personal-call-avatar{width:42px;height:42px;display:grid;place-items:center;border-radius:50%;background:#2f708d;color:#fff;font-weight:900;overflow:hidden}.personal-call-avatar img{width:100%;height:100%;object-fit:cover}.personal-call-avatar.large{width:100px;height:100px;font-size:38px;box-shadow:0 15px 50px rgba(0,0,0,.25)}
#personalReturnChat{width:40px;height:40px;border:0;border-radius:12px;background:rgba(255,255,255,.1);color:#fff;font-size:18px;cursor:pointer}
.personal-call-stage{position:relative;min-height:0;display:grid;place-items:center;overflow:hidden}
#personalRemoteVideo{width:100%;height:100%;object-fit:contain;background:#050a0e}
#personalRemoteVideo:not([src]){display:none}
.personal-call-audio-face{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:13px}.personal-call-audio-face[hidden]{display:none!important}.personal-call-audio-face>b{font-size:20px}
#personalLocalVideo{position:absolute;right:14px;bottom:14px;width:min(32vw,180px);aspect-ratio:3/4;object-fit:cover;border-radius:15px;background:#000;border:2px solid rgba(255,255,255,.2);box-shadow:0 12px 35px rgba(0,0,0,.35)}
.personal-call-quality{position:absolute;left:12px;top:12px;display:flex;align-items:center;gap:7px;padding:6px 9px;border-radius:999px;background:rgba(0,0,0,.45);font-size:10px}.personal-call-quality span{width:8px;height:8px;border-radius:50%;background:#99a8af}.personal-call-quality[data-level=good] span{background:#49d687}.personal-call-quality[data-level=mid] span{background:#ffc353}.personal-call-quality[data-level=bad] span{background:#ff6565}
.personal-call-info{display:flex;justify-content:center;gap:12px;padding:7px;color:#a9bdc7;font-size:10px;background:rgba(0,0,0,.18)}
.personal-device-panel{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;padding:9px 12px;background:#101e27}.personal-device-panel[hidden]{display:none!important}.personal-device-panel label span{display:block;margin-bottom:4px;color:#9fb4bf;font-size:9px;text-transform:uppercase;font-weight:900}.personal-device-panel select{width:100%;height:36px;padding:0 7px;border:1px solid #33505e;border-radius:9px;background:#172c37;color:#fff}
.personal-call-error{padding:8px 12px;background:#6f2020;color:#fff;text-align:center;font-size:11px}.personal-call-error[hidden]{display:none!important}
.personal-call-controls{display:flex;justify-content:center;gap:9px;padding:12px max(12px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom));background:rgba(5,13,18,.62);backdrop-filter:blur(12px)}
.personal-call-controls button{width:50px;height:50px;border:0;border-radius:50%;background:#263944;color:#fff;font-size:20px;cursor:pointer}.personal-call-controls button.off{background:#694042}.personal-call-controls button.active{background:#1d7fa8}.personal-call-controls button.end{background:#e34a4a}
.personal-persistent-bar{z-index:15000}.personal-persistent-bar .mini-call-status-dot{background:#48d58a}.personal-call-active .composer{margin-bottom:64px}
.call-history-main{overflow-y:auto;background:#f5f8fa}.call-history-tabs{display:flex;gap:7px;padding:11px 16px;background:#fff;border-bottom:1px solid #e0e8ec;overflow:auto}.call-history-tabs a{flex:0 0 auto;padding:8px 11px;border-radius:999px;background:#eef4f6;color:#5e7581;text-decoration:none;font-size:11px;font-weight:900}.call-history-tabs a.active{background:#dff3fb;color:#147ea9}
.call-history-list{padding:12px 16px;display:grid;gap:8px}.call-history-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:12px;align-items:center;padding:11px;border:1px solid #dce7eb;border-radius:14px;background:#fff}.call-history-row.missed{border-left:4px solid #e45a5a}.call-history-person{min-width:0;display:flex;align-items:center;gap:9px;color:inherit;text-decoration:none}.call-history-person .avatar{width:42px;height:42px;min-width:42px}.call-history-person b,.call-history-person small{display:block}.call-history-person small{margin-top:3px;color:#7b8e98}.call-history-meta{text-align:right}.call-history-meta b,.call-history-meta small{display:block}.call-history-meta small{margin-top:3px;color:#83949d}.call-history-actions{display:flex;gap:5px}.call-history-actions button{width:36px;height:36px;border:1px solid #d6e3e8;border-radius:10px;background:#f4f9fb;cursor:pointer}
.dm-top-actions{display:flex;gap:7px}
@media(max-width:700px){.personal-device-panel{grid-template-columns:1fr}.personal-call-avatar.large{width:86px;height:86px}.personal-call-controls{gap:7px}.personal-call-controls button{width:47px;height:47px}.call-history-list{padding:8px}.call-history-row{grid-template-columns:minmax(0,1fr) auto}.call-history-meta{grid-column:1/2;text-align:left;padding-left:51px;margin-top:-8px}.call-history-actions{grid-column:2;grid-row:1/3}.dm-top-actions .button:first-child{font-size:0}.dm-top-actions .button:first-child:after{content:"☎";font-size:16px}}


/* =========================================================
   Stage 26 — PWA
   ========================================================= */
.pwa-install-banner{
  position:fixed;left:50%;bottom:max(16px,env(safe-area-inset-bottom));z-index:22000;
  width:min(720px,calc(100% - 24px));transform:translateX(-50%);
  display:grid;grid-template-columns:48px minmax(0,1fr) auto 36px;gap:10px;align-items:center;
  padding:10px 10px 10px 12px;border:1px solid #cfe0e8;border-radius:18px;
  background:rgba(255,255,255,.97);box-shadow:0 20px 70px rgba(27,66,86,.22);backdrop-filter:blur(14px)
}
.pwa-install-banner[hidden]{display:none!important}
.pwa-install-icon{width:46px;height:46px;border-radius:13px;overflow:hidden;background:#e8f5fa}
.pwa-install-icon img{width:100%;height:100%;display:block}
.pwa-install-copy{min-width:0}.pwa-install-copy b,.pwa-install-copy small{display:block}.pwa-install-copy b{font-size:13px;color:#294a59}.pwa-install-copy small{margin-top:3px;color:#758a95;font-size:10.5px;line-height:1.35}
.pwa-install-banner button{min-height:38px;border:0;border-radius:10px;cursor:pointer;font-weight:900}.pwa-install-banner button.primary{padding:0 12px;background:#229ed9;color:#fff}.pwa-install-banner button.close{width:36px;background:#eef4f6;color:#5e7580;font-size:20px}
.pwa-update-toast{
  position:fixed;right:14px;bottom:max(14px,env(safe-area-inset-bottom));z-index:22500;
  width:min(390px,calc(100% - 28px));display:flex;gap:10px;align-items:center;padding:12px;
  border-radius:15px;background:#17313e;color:#fff;box-shadow:0 18px 55px rgba(0,0,0,.28)
}
.pwa-update-toast span{min-width:0;flex:1}.pwa-update-toast b,.pwa-update-toast small{display:block}.pwa-update-toast small{margin-top:2px;color:#b8cad2;font-size:10px}
.pwa-update-toast button{min-height:36px;padding:0 10px;border:0;border-radius:9px;background:#229ed9;color:#fff;font-weight:900;cursor:pointer}
.pwa-push-compact{
  position:absolute;right:44px;top:9px;margin:0!important;z-index:5
}
.pwa-push-compact button{
  width:32px!important;height:32px!important;min-height:32px!important;padding:0!important;border:1px solid #d7e5ea!important;border-radius:10px!important;background:#f4f9fb!important;color:#486976!important;font-size:14px!important;cursor:pointer
}
.pwa-push-compact button.enabled{background:#e8f8ef!important;color:#23834d!important;border-color:#c4e8d2!important}
.home-feature-install{
  appearance:none;border:0;text-align:left;font:inherit;color:inherit;cursor:pointer;background:transparent
}
.home-feature-install>span,.home-feature-install>b,.home-feature-install>small{display:block}
@media(max-width:700px){
  .pwa-install-banner{grid-template-columns:42px minmax(0,1fr) 34px;padding:9px}
  .pwa-install-icon{width:40px;height:40px}
  .pwa-install-banner button.primary{grid-column:2/3;width:100%;margin-top:2px}
  .pwa-install-banner button.close{grid-column:3;grid-row:1}
  .pwa-install-copy{grid-column:2/3}
  .pwa-update-toast{left:10px;right:10px;bottom:max(10px,env(safe-area-inset-bottom));width:auto}
}
@media(display-mode:standalone){
  body{overscroll-behavior-y:none}
  .pwa-install-banner{display:none!important}
}

/* Stage 27 — performance */
.older-messages-wrap{flex:0 0 auto;text-align:center;padding:7px 10px;background:#f5f8fa;border-bottom:1px solid #e5ecef}.older-messages-wrap[hidden]{display:none!important}.older-messages-wrap button{min-height:34px;padding:0 12px;border:1px solid #d5e3e9;border-radius:999px;background:#fff;color:#487080;font-size:11px;font-weight:900;cursor:pointer}.older-messages-wrap button:disabled{opacity:.6}.message-stream article.message{content-visibility:auto;contain-intrinsic-size:90px}.attachments img{content-visibility:auto}
.performance-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:14px}.performance-stats article{padding:14px;border:1px solid #dbe6eb;border-radius:14px;background:#fff}.performance-stats b{display:block;font-size:23px;color:#304f5e}.performance-stats small{color:#748892}
.performance-checks{display:grid;gap:8px}.performance-checks>div{display:grid;grid-template-columns:30px minmax(0,1fr) auto;gap:8px;align-items:center;padding:9px;border:1px solid #dce7eb;border-radius:11px}.performance-checks>div>span{width:27px;height:27px;display:grid;place-items:center;border-radius:50%;font-weight:900}.performance-checks .ok>span{background:#e6f8ed;color:#27844e}.performance-checks .bad>span{background:#fff0e4;color:#ba6427}.performance-checks small{color:#7e9099}.performance-table{overflow:auto}.performance-table table{width:100%;border-collapse:collapse}.performance-table th,.performance-table td{padding:8px 9px;border-bottom:1px solid #e7edef;text-align:left;font-size:11px}.performance-table th{color:#6f838d;text-transform:uppercase;font-size:9px}@media(max-width:700px){.performance-stats{grid-template-columns:1fr 1fr}.performance-checks>div{grid-template-columns:28px minmax(0,1fr)}.performance-checks small{grid-column:2}}


/* =========================================================
   Stage 28 — Final production audit
   ========================================================= */
.final-audit-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:14px}
.final-audit-summary article{padding:15px;border:1px solid #dbe6eb;border-radius:14px;background:#fff}
.final-audit-summary b{display:block;font-size:26px;color:#345260}.final-audit-summary small{color:#768a94}
.final-audit-summary .ok{border-color:#cce8d7}.final-audit-summary .bad{border-color:#efc7c7}.final-audit-summary .warn{border-color:#ecdcae}
.admin-status.ready{background:#e8f8ef!important;color:#267c4a!important}.admin-status.not-ready{background:#fff0f0!important;color:#b33d3d!important}
.final-audit-list{display:grid;gap:8px}.final-audit-list article{display:grid;grid-template-columns:36px minmax(0,1fr);gap:10px;padding:11px;border:1px solid #dce7eb;border-radius:12px;background:#fff}
.final-audit-list article.ok{border-color:#cee8d8;background:#fbfffc}.final-audit-list article.critical{border-color:#efc9c9;background:#fffafa}.final-audit-list article.warning{border-color:#eadcac;background:#fffdf7}
.final-audit-icon{width:32px;height:32px;display:grid;place-items:center;border-radius:50%;background:#edf3f5;font-weight:900}.final-audit-list .ok .final-audit-icon{background:#e5f8ed;color:#26824d}.final-audit-list .critical .final-audit-icon{background:#ffe7e7;color:#bd3e3e}.final-audit-list .warning .final-audit-icon{background:#fff4d8;color:#9b6b11}
.final-audit-list b{font-size:12.5px}.final-audit-list p{margin:3px 0 0;color:#617985;font-size:11px}.final-audit-list small{display:block;margin-top:5px;color:#a05a2f;font-size:10px}
.final-smoke-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.final-smoke-grid label{display:flex;gap:8px;align-items:flex-start;padding:10px;border:1px solid #dde7eb;border-radius:11px;background:#f9fbfc;font-size:11.5px}.final-smoke-grid input{width:17px;height:17px;flex:0 0 auto;margin-top:1px}
.final-audit-next ol{padding-left:20px}.final-audit-next li{margin:7px 0;line-height:1.45}
@media(max-width:700px){.final-audit-summary{grid-template-columns:1fr 1fr}.final-smoke-grid{grid-template-columns:1fr}}


/* =========================================================
   Stage 28.1 — Emoji picker
   ========================================================= */
.emoji-trigger{
  flex:0 0 auto;
  width:42px;
  height:42px;
  min-width:42px;
  padding:0;
  display:grid;
  place-items:center;
  border:0;
  border-radius:11px;
  background:transparent;
  color:#425f6d;
  font-size:21px;
  cursor:pointer;
  transition:background .15s ease,transform .12s ease;
}
.emoji-trigger:hover{background:#edf5f8}
.emoji-trigger:active{transform:scale(.94)}
.emoji-picker{
  position:fixed;
  z-index:26000;
  width:min(360px,calc(100vw - 24px));
  max-height:430px;
  display:grid;
  grid-template-rows:auto auto minmax(0,1fr) auto;
  overflow:hidden;
  border:1px solid #d6e3e9;
  border-radius:18px;
  background:#fff;
  box-shadow:0 22px 70px rgba(27,61,78,.24);
}
.emoji-picker[hidden]{display:none!important}
.emoji-picker-head{
  min-height:46px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:8px 10px 7px 14px;
  border-bottom:1px solid #e7eef1;
}
.emoji-picker-head b{font-size:13px;color:#355562}
.emoji-close{
  width:32px;height:32px;padding:0;border:0;border-radius:9px;
  background:#f0f5f7;color:#58717c;font-size:20px;cursor:pointer;
}
.emoji-tabs{
  display:flex;
  gap:4px;
  padding:6px 7px;
  overflow-x:auto;
  border-bottom:1px solid #edf2f4;
  background:#fafcfd;
}
.emoji-tabs button{
  flex:1 0 40px;
  min-width:40px;
  height:36px;
  padding:0;
  border:0;
  border-radius:9px;
  background:transparent;
  font-size:18px;
  cursor:pointer;
}
.emoji-tabs button:hover{background:#eef5f8}
.emoji-tabs button.active{background:#dff2f9}
.emoji-grid{
  display:grid;
  grid-template-columns:repeat(8,minmax(0,1fr));
  gap:2px;
  padding:8px;
  overflow-y:auto;
  overscroll-behavior:contain;
}
.emoji-item{
  aspect-ratio:1;
  min-height:38px;
  padding:0;
  border:0;
  border-radius:9px;
  background:transparent;
  font-size:23px;
  line-height:1;
  cursor:pointer;
}
.emoji-item:hover{background:#edf6f9}
.emoji-item:active{transform:scale(.9)}
.emoji-picker-footer{
  padding:7px 10px;
  border-top:1px solid #edf2f4;
  background:#fafcfd;
  color:#81939c;
  font-size:9.5px;
  text-align:center;
}
.dm-composer .emoji-trigger{align-self:center}

@media(max-width:700px){
  .emoji-trigger{
    width:40px;
    height:40px;
    min-width:40px;
    font-size:20px;
  }
  .emoji-picker{
    left:8px!important;
    right:8px!important;
    bottom:max(8px,env(safe-area-inset-bottom))!important;
    top:auto!important;
    width:auto!important;
    max-height:min(56vh,460px);
    border-radius:18px 18px 14px 14px;
  }
  .emoji-grid{
    grid-template-columns:repeat(7,minmax(0,1fr));
  }
  .emoji-item{
    min-height:42px;
    font-size:24px;
  }
}


/* =========================================================
   Stage 28.3 — group call bar must never cover composer
   ========================================================= */

/* On ordinary site pages the active group-call bar is pinned near the
   upper-right corner instead of over the message composer. */
body:not(.call-window-body) .persistent-call-bar--safe{
  left:auto!important;
  right:12px!important;
  top:72px!important;
  bottom:auto!important;
  width:min(390px,calc(100vw - 24px))!important;
  min-height:56px!important;
  padding:6px!important;
  border-radius:15px!important;
  pointer-events:auto!important;
}

/* Stage 17.11 used this extra bottom margin to make room for the old
   bottom-docked call bar. It is no longer needed and was pushing/covering
   the send area on some layouts. */
html.vda-mobile body.call-is-minimized:not(.call-window-body) form.composer,
body.call-is-minimized:not(.call-window-body) form.composer{
  margin-bottom:0!important;
}

/* Keep the active call panel compact. */
body:not(.call-window-body) .persistent-call-bar--safe .mini-call-main{
  min-width:0!important;
  max-width:none!important;
  flex:1 1 auto!important;
}
body:not(.call-window-body) .persistent-call-bar--safe .mini-call-actions{
  flex:0 0 auto!important;
}

/* The actual call-room's own minimized UI keeps its original behaviour. */
.call-window-body.call-is-minimized .persistent-call-bar--safe{
  left:7px!important;
  right:7px!important;
  top:7px!important;
  bottom:auto!important;
  width:auto!important;
}

/* Mobile: place the bar directly below the top/header area. It can cover a
   small part of message history, but never the text box or Send button. */
@media(max-width:760px){
  html.vda-mobile body:not(.call-window-body) .persistent-call-bar--safe,
  body:not(.call-window-body) .persistent-call-bar--safe{
    left:7px!important;
    right:7px!important;
    top:62px!important;
    bottom:auto!important;
    width:auto!important;
    min-height:54px!important;
    padding:5px!important;
  }
  body:not(.call-window-body) .persistent-call-bar--safe .mini-call-copy small{
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
}

/* Extra safeguard: no invisible call layer is allowed to intercept clicks
   around the composer. */
body:not(.call-window-body) .composer{
  position:relative!important;
  z-index:12001!important;
}


/* =========================================================
   Stage 28.4 — distinguish call microphone from voice message mic
   ========================================================= */
.persistent-call-bar--safe .call-audio-control,
.persistent-call-bar--safe #miniMic{
  position:relative!important;
  background:#e8f4fb!important;
  border:1px solid #b9dcea!important;
  color:#176f98!important;
}
.persistent-call-bar--safe .call-audio-control::after,
.persistent-call-bar--safe #miniMic::after{
  content:"☎";
  position:absolute;
  right:-4px;
  bottom:-4px;
  width:16px;
  height:16px;
  display:grid;
  place-items:center;
  border:2px solid #fff;
  border-radius:50%;
  background:#229ed9;
  color:#fff;
  font-size:8px;
  line-height:1;
}
.persistent-call-bar--safe .call-audio-control.off,
.persistent-call-bar--safe #miniMic.off{
  background:#fff0f0!important;
  border-color:#efcaca!important;
  color:#b53f3f!important;
}


/* =========================================================
   Stage 28.5 — single-row composer + help page
   ========================================================= */
.composer--single-row{
  display:grid!important;
  grid-template-columns:42px 42px minmax(0,1fr) 42px 46px!important;
  grid-template-areas:
    "attach emoji text voice send"
    "reply reply reply reply reply"
    "preview preview preview preview preview"!important;
  align-items:end!important;
  gap:6px!important;
}
.composer--single-row .attach-picker{grid-area:attach!important;margin:0!important;align-self:end!important}
.composer--single-row .emoji-trigger{grid-area:emoji!important;margin:0!important;align-self:end!important}
.composer--single-row .composer-text-wrap{grid-area:text!important;min-width:0!important;margin:0!important}
.composer--single-row #voiceBtn{grid-area:voice!important;margin:0!important;align-self:end!important}
.composer--single-row .send-btn{grid-area:send!important;margin:0!important;align-self:end!important}
.composer--single-row .reply-box{grid-area:reply!important}
.composer--single-row .attachment-preview,
.composer--single-row #attachmentPreview{grid-area:preview!important}
.composer--single-row .attach-picker,
.composer--single-row .emoji-trigger,
.composer--single-row #voiceBtn,
.composer--single-row .send-btn{
  width:42px!important;min-width:42px!important;height:42px!important;
}
.composer--single-row .send-btn{width:46px!important;min-width:46px!important}
@media(max-width:760px){
  .composer--single-row{
    grid-template-columns:38px 38px minmax(0,1fr) 38px 42px!important;
    gap:4px!important;padding-left:6px!important;padding-right:6px!important;
  }
  .composer--single-row .attach-picker,
  .composer--single-row .emoji-trigger,
  .composer--single-row #voiceBtn{
    width:38px!important;min-width:38px!important;height:40px!important;font-size:19px!important;
  }
  .composer--single-row .send-btn{width:42px!important;min-width:42px!important;height:40px!important}
  .composer--single-row .composer-text-wrap textarea{min-height:40px!important}
}

.chat-help-link{
  min-height:34px;display:inline-flex;align-items:center;gap:4px;padding:0 9px;
  border:1px solid #d7e4e9;border-radius:9px;background:#f7fafb;color:#54717e;
  text-decoration:none;font-size:10.5px;font-weight:900;
}
.chat-help-link:hover{background:#edf6f9}

/* Help page */
.help-page{background:#eef4f7}
.help-main{overflow:auto;background:#f4f8fb;padding-bottom:40px}
.help-main--guest{min-height:100vh}
.help-hero{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:28px clamp(18px,4vw,54px);background:linear-gradient(135deg,#193b4a,#2b6f88);color:#fff}
.help-hero h1{margin:4px 0 8px;font-size:clamp(27px,4vw,44px);line-height:1.08}
.help-hero p{max-width:720px;margin:0;color:#cbe0e8;line-height:1.5}
.help-eyebrow{font-size:10px;font-weight:900;letter-spacing:.18em;color:#8fd4ee}
.help-toc{position:sticky;top:0;z-index:50;display:flex;gap:6px;padding:9px clamp(14px,3vw,40px);overflow:auto;background:rgba(255,255,255,.96);border-bottom:1px solid #dce7eb;backdrop-filter:blur(10px)}
.help-toc a{flex:0 0 auto;padding:7px 10px;border-radius:999px;background:#edf4f6;color:#54717d;text-decoration:none;font-size:10.5px;font-weight:900}
.help-section{margin:18px clamp(12px,3vw,36px);padding:22px;border:1px solid #dbe6eb;border-radius:20px;background:#fff;box-shadow:0 8px 28px rgba(46,79,96,.06)}
.help-section-head{display:flex;gap:12px;align-items:flex-start;margin-bottom:16px}
.help-section-head>span{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:#229ed9;color:#fff;font-weight:900}
.help-section-head h2{margin:0;font-size:20px;color:#294a59}.help-section-head p{margin:4px 0 0;color:#748994}
.help-two-col{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,.9fr);gap:18px;align-items:center}
.help-copy p{color:#526c79;line-height:1.55}.help-copy h3{margin:12px 0 4px;color:#345565}
.help-step-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.help-step-grid article{padding:14px;border:1px solid #e0e9ed;border-radius:14px;background:#f9fbfc}
.help-step-icon{font-size:26px}.help-step-grid h3{margin:7px 0 4px;color:#345565}.help-step-grid p{margin:0;color:#687f8a;font-size:11px;line-height:1.45}
.help-numbered{display:grid;gap:9px}.help-numbered article{display:grid;grid-template-columns:34px minmax(0,1fr);gap:10px;padding:11px;border:1px solid #e0e9ed;border-radius:13px}
.help-numbered article>b{width:30px;height:30px;display:grid;place-items:center;border-radius:50%;background:#e3f3fa;color:#167ca8}
.help-numbered h3{margin:0 0 3px}.help-numbered p{margin:0;color:#687f8a}
.help-note{margin:12px 0 0;padding:10px 12px;border-radius:11px;background:#fff8df;color:#80631c;font-size:11px}
.help-visual{border:1px solid #d9e6eb;border-radius:16px;background:#f7fafb;overflow:hidden}
.mock-chat{min-height:280px;display:grid;grid-template-columns:115px minmax(0,1fr)}
.mock-chat aside{padding:12px;background:#fff;border-right:1px solid #dce7eb}.mock-chat aside>b{font-size:18px}
.mock-icon-row{margin:10px 0;padding:7px;border-radius:9px;background:#edf5f8}
.mock-chat aside strong,.mock-chat aside i{display:block;margin-top:8px;font-style:normal;font-size:10px}.mock-chat aside i{padding:6px;border-radius:7px;background:#f5f8fa}
.mock-main{padding:12px;position:relative}.mock-top{display:flex;justify-content:space-between;padding-bottom:9px;border-bottom:1px solid #dce7eb;font-weight:900}
.mock-bubble{max-width:72%;margin-top:13px;padding:9px 11px;border-radius:13px;font-size:11px}.mock-bubble.left{background:#fff}.mock-bubble.right{margin-left:auto;background:#dff2fb}
.mock-compose{position:absolute;left:10px;right:10px;bottom:10px;padding:9px;border-radius:11px;background:#fff;border:1px solid #dce7eb;font-size:11px}.mock-compose em{color:#8a9aa2;font-style:normal}
.composer-demo{display:grid;grid-template-columns:42px 42px minmax(0,1fr) 42px 46px;gap:6px;align-items:center;margin-top:14px;padding:10px}
.composer-demo button,.composer-demo div{height:42px;border:1px solid #d8e5ea;border-radius:10px;background:#fff}.composer-demo button{font-size:20px}.composer-demo div{display:flex;align-items:center;padding:0 12px;color:#8999a1}.composer-demo .send{background:#229ed9;color:#fff;border-color:#229ed9}
.group-demo{padding:18px}.group-card{display:grid;grid-template-columns:50px minmax(0,1fr) auto;gap:10px;align-items:center;padding:12px;border-radius:13px;background:#fff;border:1px solid #dbe6eb}
.group-avatar{width:48px;height:48px;display:grid;place-items:center;border-radius:50%;background:#dff2fa;font-size:25px}
.group-card b,.group-card small{display:block}.group-card small{color:#83949c}.group-card button{padding:8px 10px;border:0;border-radius:9px;background:#229ed9;color:#fff}
.group-members{display:flex;gap:7px;margin-top:12px}.group-members span{width:36px;height:36px;display:grid;place-items:center;border-radius:50%;background:#edf3f5;font-weight:900}
.call-demo{padding:22px;background:linear-gradient(160deg,#173644,#0d1e27);color:#fff}
.call-person{text-align:center}.call-person>span{width:84px;height:84px;margin:0 auto 10px;display:grid;place-items:center;border-radius:50%;background:#2b7797;font-size:34px;font-weight:900}
.call-person b,.call-person small{display:block}.call-person small{margin-top:4px;color:#a9c1cb}
.call-controls{display:flex;justify-content:center;gap:8px;margin-top:20px}.call-controls button{position:relative;width:46px;height:46px;border:0;border-radius:50%;background:#294653;color:#fff;font-size:19px}
.call-controls button i{position:absolute;right:-3px;bottom:-3px;width:16px;height:16px;display:grid;place-items:center;border-radius:50%;background:#229ed9;font-size:8px;font-style:normal}.call-controls .hang{background:#e64f4f}
.call-mini{margin-top:18px;padding:9px;border-radius:10px;background:rgba(255,255,255,.08);text-align:center;font-size:10px}
.notify-demo{padding:14px}.notify-demo>div{padding:11px;border-bottom:1px solid #e1e9ed}.notify-demo b,.notify-demo small{display:block;margin-left:28px}.notify-demo small{color:#81929b}
.notify-demo button{width:100%;margin-top:12px;min-height:40px;border:0;border-radius:10px;background:#229ed9;color:#fff;font-weight:900}
.help-admin-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}
.help-admin-grid a{padding:13px;border:1px solid #dce7eb;border-radius:13px;background:#f9fbfc;color:inherit;text-decoration:none}
.help-admin-grid span,.help-admin-grid b,.help-admin-grid small{display:block}.help-admin-grid span{font-size:24px}.help-admin-grid b{margin-top:6px;color:#355565}.help-admin-grid small{margin-top:3px;color:#7e9099;line-height:1.35}
.admin-demo{display:grid;grid-template-columns:145px minmax(0,1fr);margin-top:14px;min-height:180px}
.admin-demo-side{padding:14px;background:#183948;color:#fff;font-weight:900}.admin-demo-side span{display:block;margin-top:9px;color:#bfd6df;font-size:10px}
.admin-demo-main{padding:16px}.admin-demo-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:14px}.admin-demo-cards i{padding:12px;border-radius:10px;background:#fff;border:1px solid #dde7eb;font-style:normal;font-size:10px}
.help-footer{display:flex;justify-content:space-between;gap:12px;margin:22px clamp(14px,3vw,40px);padding:14px 0;color:#718690;font-size:10px}
@media(max-width:900px){.help-two-col{grid-template-columns:1fr}.help-step-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.help-admin-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){
  .help-hero{display:block;padding:20px 14px}.help-hero .button{margin-top:14px}
  .help-section{margin:10px 8px;padding:15px;border-radius:15px}
  .help-step-grid{grid-template-columns:1fr}.help-admin-grid{grid-template-columns:1fr 1fr}
  .mock-chat{grid-template-columns:88px minmax(0,1fr)}
  .composer-demo{grid-template-columns:36px 36px minmax(0,1fr) 36px 40px;gap:4px}
  .composer-demo button,.composer-demo div{height:38px}
  .admin-demo{grid-template-columns:105px minmax(0,1fr)}.admin-demo-cards{grid-template-columns:1fr}
  .help-footer{display:block}.help-footer span{display:block;margin-top:4px}
}


/* =========================================================
   Stage 28.5.2 — visible Help link on home page
   ========================================================= */
.home-help-button{
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  gap:6px;
  border-color:#b9dce9!important;
  background:#edf8fc!important;
  color:#176f98!important;
  font-weight:900!important;
}
.home-help-button:hover{background:#dff2f9!important}

.home-help-card{
  margin:18px auto;
  width:min(980px,calc(100% - 28px));
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:16px 18px;
  border:1px solid #cfe2ea;
  border-radius:18px;
  background:linear-gradient(135deg,#f8fcfe,#edf8fc);
  box-shadow:0 10px 30px rgba(38,88,109,.08);
}
.home-help-card>div{display:flex;align-items:center;gap:12px}
.home-help-card>div>span{
  width:46px;height:46px;display:grid;place-items:center;
  border-radius:14px;background:#229ed9;color:#fff;font-size:23px
}
.home-help-card b,.home-help-card small{display:block}
.home-help-card b{font-size:14px;color:#315260}
.home-help-card small{margin-top:3px;color:#738994;line-height:1.4}
@media(max-width:700px){
  .home-help-card{display:block;padding:14px}
  .home-help-card .button{width:100%;margin-top:12px}
}


/* =========================================================
   Stage 29.1 — User agreement
   ========================================================= */
.home-legal-footer{
  display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:wrap;
  margin:20px 14px 8px;padding:14px 10px;border-top:1px solid #dce7eb;
  color:#718690;font-size:10.5px
}
.home-legal-footer a{color:#527584;text-decoration:none;font-weight:800}
.home-legal-footer a:hover{text-decoration:underline}

.terms-consent{
  display:flex!important;align-items:flex-start!important;gap:8px!important;
  margin:4px 0 2px!important;padding:10px!important;border:1px solid #dbe6eb!important;
  border-radius:11px!important;background:#f8fbfc!important
}
.terms-consent input{width:18px!important;height:18px!important;min-width:18px!important;margin:1px 0 0!important}
.terms-consent span{font-size:10.5px;line-height:1.45;color:#617985}
.terms-consent a{color:#177fa9;font-weight:900}

.legal-page{background:#f2f7f9}
.legal-main{overflow:auto;background:#f4f8fb;padding-bottom:36px}
.legal-main--guest{min-height:100vh}
.legal-hero{
  display:flex;justify-content:space-between;align-items:flex-start;gap:18px;
  padding:28px clamp(16px,4vw,52px);background:linear-gradient(135deg,#183b4a,#296b84);color:#fff
}
.legal-hero h1{margin:4px 0 8px;font-size:clamp(28px,4vw,43px)}
.legal-hero p{margin:0;color:#c8dfe8}
.legal-kicker{font-size:10px;font-weight:900;letter-spacing:.16em;color:#8fd4ed}
.legal-document{
  width:min(980px,calc(100% - 28px));margin:18px auto;padding:26px clamp(16px,4vw,42px);
  border:1px solid #dbe6eb;border-radius:20px;background:#fff;box-shadow:0 8px 30px rgba(39,76,94,.06)
}
.legal-meta{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;padding-bottom:14px;border-bottom:1px solid #e4ecef;color:#7b8e98;font-size:10px}
.legal-document section{padding:15px 0;border-bottom:1px solid #edf2f4}
.legal-document h2{margin:0 0 9px;color:#2d5060;font-size:17px}
.legal-document p,.legal-document li{color:#526d79;line-height:1.62;font-size:12px}
.legal-document p{margin:7px 0}.legal-document ul{margin:8px 0;padding-left:22px}.legal-document li{margin:5px 0}
.legal-document a{color:#167ea9}
.legal-final{margin-top:20px;padding:14px;border-radius:12px;background:#eaf7fc;color:#315867;line-height:1.5}
.legal-footer{display:flex;justify-content:center;gap:14px;flex-wrap:wrap;width:min(980px,calc(100% - 28px));margin:0 auto;color:#708690;font-size:10px}
.legal-footer a{color:#527584;text-decoration:none;font-weight:800}
.help-footer a{color:#527584;text-decoration:none;font-weight:800}
@media(max-width:700px){
  .legal-hero{display:block;padding:20px 14px}.legal-hero .button{margin-top:14px}
  .legal-document{width:calc(100% - 16px);padding:16px 14px;border-radius:15px}
}


/* =========================================================
   Stage 30.1 — mobile chat overhaul
   Bigger controls + stable composer + full-screen sidebar.
   ========================================================= */
html.vda-mobile{--vda-vh:100dvh;--vda-keyboard-offset:0px}
@media (max-width:900px){
  html.vda-mobile body,
  html.vda-mobile .messenger-shell.chat-shell,
  html.vda-mobile .messenger-shell.home-shell,
  html.vda-mobile .dm-layout{height:var(--vda-vh)!important;min-height:var(--vda-vh)!important}

  html.vda-mobile .messenger-sidebar{
    width:100vw!important;max-width:100vw!important;height:var(--vda-vh)!important;min-height:var(--vda-vh)!important;
    padding-bottom:14px!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch;background:#fff!important
  }
  html.vda-mobile .sidebar-backdrop{background:rgba(12,24,34,.52)!important}
  html.vda-mobile .brand{height:auto!important;min-height:84px!important;padding:16px 16px 12px!important}
  html.vda-mobile .brand-home .brand-logo{width:52px!important;height:52px!important;font-size:24px!important}
  html.vda-mobile .brand-home b{font-size:28px!important;line-height:1.1}
  html.vda-mobile .brand-home small{font-size:15px!important;margin-top:4px!important}
  html.vda-mobile .sidebar-close{width:44px!important;height:44px!important;font-size:30px!important;border-radius:14px!important}
  html.vda-mobile .sidebar-quick{padding:8px 14px 2px!important}
  html.vda-mobile .sidebar-home-link,
  html.vda-mobile .me-card{min-height:72px!important;padding:14px 16px!important;border-radius:18px!important}
  html.vda-mobile .sidebar-home-link .nav-ico{width:44px!important;height:44px!important;font-size:22px!important}
  html.vda-mobile .sidebar-home-link b,
  html.vda-mobile .me-card-copy b{font-size:18px!important;line-height:1.2}
  html.vda-mobile .sidebar-home-link small,
  html.vda-mobile .me-card-copy small{font-size:14px!important;line-height:1.35}
  html.vda-mobile .sidebar-section-title{padding:14px 18px 10px!important;font-size:13px!important}
  html.vda-mobile .sidebar-section-title span{font-size:13px!important;letter-spacing:.16em}
  html.vda-mobile .sidebar-section-title a{font-size:24px!important}
  html.vda-mobile .stage6-channels{padding:0 10px 12px!important}
  html.vda-mobile .channel-item{margin-bottom:6px!important}
  html.vda-mobile .channel-item>.channel-link{min-height:76px!important;padding:12px 14px!important;border-radius:18px!important;gap:12px!important;border:1px solid #e6eef3!important;background:#fff!important}
  html.vda-mobile .channel-icon.telegram-avatar{width:50px!important;height:50px!important;min-width:50px!important;font-size:22px!important}
  html.vda-mobile .channel-copy b,
  html.vda-mobile .channels b{font-size:18px!important;line-height:1.2!important}
  html.vda-mobile .channel-copy small,
  html.vda-mobile .channels small{font-size:14px!important;line-height:1.35!important;max-width:none!important;display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal!important;overflow:hidden!important}
  html.vda-mobile .chat-branch-toggle{width:42px!important;height:42px!important;border-radius:14px!important;font-size:24px!important}
  html.vda-mobile .subchat-inline .channel-link{padding-left:24px!important}
  html.vda-mobile .sidebar-footer{position:sticky!important;left:auto!important;bottom:0!important;width:auto!important;margin:8px 10px 0!important;padding:14px 0 calc(4px + env(safe-area-inset-bottom))!important;background:linear-gradient(to top,#fff 72%,rgba(255,255,255,.82))!important}
  html.vda-mobile .sidebar-footer a{min-height:52px!important;font-size:18px!important;border-radius:16px!important;display:flex!important;align-items:center;justify-content:center}

  html.vda-mobile .chat-page.stage6-chat{
    display:flex!important;flex-direction:column!important;height:var(--vda-vh)!important;min-height:var(--vda-vh)!important;
    overflow:hidden!important;background:linear-gradient(180deg,#f3f8fb 0%,#edf3f7 100%)!important
  }
  html.vda-mobile .chat-header.telegram-chat-header{
    display:grid!important;grid-template-columns:44px minmax(0,1fr)!important;align-items:start!important;
    gap:10px!important;min-height:auto!important;padding:10px 10px 12px!important;background:#fff!important
  }
  html.vda-mobile .chat-head-main{gap:10px!important;align-items:center!important}
  html.vda-mobile .chat-head-avatar{width:44px!important;height:44px!important;font-size:22px!important}
  html.vda-mobile .chat-head-copy h1{font-size:22px!important;line-height:1.2!important}
  html.vda-mobile .chat-head-meta{font-size:13px!important;line-height:1.35!important;flex-wrap:wrap!important}
  html.vda-mobile .header-actions.telegram-header-actions{
    grid-column:1/-1!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;max-width:none!important;overflow:visible!important
  }
  html.vda-mobile .telegram-header-actions .header-action{
    min-height:58px!important;height:auto!important;padding:10px 12px!important;border-radius:16px!important;background:#f4f9fc!important;border:1px solid #deeaef!important;justify-content:flex-start!important;gap:10px!important
  }
  html.vda-mobile .telegram-header-actions .header-action>span{font-size:24px!important;min-width:24px!important}
  html.vda-mobile .telegram-header-actions .header-action>em{font-size:14px!important;white-space:normal!important;line-height:1.2!important}
  html.vda-mobile .channel-about,
  html.vda-mobile .private-chat-notice,
  html.vda-mobile .pinned-banner,
  html.vda-mobile .older-messages-wrap{margin:0 10px!important;border-radius:14px!important}
  html.vda-mobile .channel-about{margin-top:8px!important}
  html.vda-mobile .channel-about summary{padding:12px 14px!important;font-size:15px!important}
  html.vda-mobile .channel-about-body{padding:0 14px 14px!important;font-size:14px!important;line-height:1.5!important}

  html.vda-mobile .message-stream{
    flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;
    padding:12px 10px 124px!important;scroll-padding-bottom:124px!important
  }
  html.vda-mobile article.message{gap:8px!important;margin:10px 0!important;align-items:flex-end!important}
  html.vda-mobile article.message>.avatar{width:36px!important;height:36px!important;min-width:36px!important;font-size:15px!important}
  html.vda-mobile article.message .bubble{max-width:calc(100vw - 66px)!important;padding:12px 12px 10px!important;border-radius:16px 16px 16px 6px!important}
  html.vda-mobile article.message .msg-meta b{font-size:15px!important}
  html.vda-mobile article.message .msg-meta time{font-size:12px!important}
  html.vda-mobile article.message .msg-text{font-size:16px!important;line-height:1.46!important}
  html.vda-mobile article.message .msg-actions{gap:6px 10px!important}
  html.vda-mobile article.message .msg-actions button{font-size:13px!important}
  html.vda-mobile .attachment.image img{max-width:calc(100vw - 98px)!important}

  html.vda-mobile form.composer.composer--single-row{
    position:sticky!important;bottom:0!important;z-index:25!important;grid-template-columns:40px 40px minmax(0,1fr) 40px 48px!important;
    grid-template-areas:"attach emoji text voice send" "reply reply reply reply reply" "preview preview preview preview preview"!important;
    align-items:center!important;gap:6px!important;padding:10px 8px calc(10px + env(safe-area-inset-bottom))!important;margin-top:auto!important;
    background:rgba(255,255,255,.98)!important;border-top:1px solid #dbe7ee!important;box-shadow:0 -10px 22px rgba(17,42,57,.08)!important
  }
  html.vda-mobile form.composer.composer--single-row .attach-picker{grid-area:attach!important}
  html.vda-mobile form.composer.composer--single-row .emoji-trigger{grid-area:emoji!important}
  html.vda-mobile form.composer.composer--single-row .composer-text-wrap{grid-area:text!important;min-width:0!important}
  html.vda-mobile form.composer.composer--single-row .voice-record-btn{grid-area:voice!important}
  html.vda-mobile form.composer.composer--single-row>button[type=submit]{grid-area:send!important}
  html.vda-mobile form.composer.composer--single-row .attach-picker,
  html.vda-mobile form.composer.composer--single-row .emoji-trigger,
  html.vda-mobile form.composer.composer--single-row .voice-record-btn{
    width:40px!important;min-width:40px!important;height:40px!important;border-radius:50%!important;font-size:22px!important
  }
  html.vda-mobile form.composer.composer--single-row>button[type=submit]{width:48px!important;min-width:48px!important;height:48px!important;font-size:20px!important}
  html.vda-mobile form.composer.composer--single-row textarea{min-height:46px!important;max-height:132px!important;padding:11px 14px!important;border-radius:22px!important;font-size:16px!important;line-height:1.35!important}
  html.vda-mobile form.composer.composer--single-row .reply-box,
  html.vda-mobile form.composer.composer--single-row .file-preview{grid-column:1/-1!important}
  html.vda-mobile .voice-record-panel{position:sticky!important;bottom:calc(68px + env(safe-area-inset-bottom))!important;left:0;right:0;z-index:24!important;margin:0!important;border-radius:14px 14px 0 0!important}

  html.vda-mobile body.sidebar-open .chat-page.stage6-chat .message-stream,
  html.vda-mobile body.sidebar-open .chat-page.stage6-chat form.composer,
  html.vda-mobile body.sidebar-open .chat-page.stage6-chat .voice-record-panel,
  html.vda-mobile body.sidebar-open .chat-page.stage6-chat .pinned-banner,
  html.vda-mobile body.sidebar-open .chat-page.stage6-chat .older-messages-wrap,
  html.vda-mobile body.sidebar-open .chat-page.stage6-chat .channel-about,
  html.vda-mobile body.sidebar-open .chat-page.stage6-chat .private-chat-notice{visibility:hidden!important;pointer-events:none!important}

  html.vda-mobile body.keyboard-open .messenger-sidebar{height:var(--vda-vh)!important;min-height:var(--vda-vh)!important}
  html.vda-mobile .dm-composer{
    position:sticky!important;bottom:0!important;z-index:25!important;padding:10px 8px calc(10px + env(safe-area-inset-bottom))!important;
    background:rgba(255,255,255,.98)!important;border-top:1px solid #dbe7ee!important;box-shadow:0 -10px 22px rgba(17,42,57,.08)!important
  }
}


/* =========================================================
   Stage 30.3 — mobile sidebar footer always visible
   ========================================================= */
@media (max-width:900px){
  html.vda-mobile .messenger-sidebar{
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
    padding-bottom:0!important;
  }

  html.vda-mobile .messenger-sidebar>.brand,
  html.vda-mobile .messenger-sidebar>.sidebar-quick,
  html.vda-mobile .messenger-sidebar>.sidebar-actions,
  html.vda-mobile .messenger-sidebar>.sidebar-section-title{
    flex:0 0 auto!important;
  }

  /* Only the chat list scrolls. Admin / Logout stay visible at the bottom. */
  html.vda-mobile .messenger-sidebar>.stage6-channels{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
    padding-bottom:12px!important;
  }

  html.vda-mobile .messenger-sidebar>.sidebar-footer{
    position:relative!important;
    inset:auto!important;
    flex:0 0 auto!important;
    width:auto!important;
    margin:0!important;
    padding:10px 10px calc(10px + env(safe-area-inset-bottom))!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    background:#fff!important;
    border-top:1px solid #dbe6eb!important;
    box-shadow:0 -8px 18px rgba(25,55,72,.08)!important;
    z-index:130!important;
  }

  html.vda-mobile .messenger-sidebar>.sidebar-footer a{
    min-height:50px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:10px 12px!important;
    border-radius:14px!important;
    background:#f1f7fa!important;
    border:1px solid #dbe7ed!important;
    color:#365966!important;
    font-size:16px!important;
    font-weight:900!important;
    text-align:center!important;
  }

  html.vda-mobile .messenger-sidebar>.sidebar-footer a[href*="/admin/"]{
    background:#e9f6fc!important;
    color:#137ea9!important;
    border-color:#c9e5f1!important;
  }

  html.vda-mobile .messenger-sidebar>.sidebar-footer a[href*="logout"]{
    background:#fff1f1!important;
    color:#a74444!important;
    border-color:#f0d1d1!important;
  }

  /* When the drawer is open, the composer must not remain above it. */
  html.vda-mobile body.sidebar-open .chat-page.stage6-chat form.composer,
  html.vda-mobile body.sidebar-open .chat-page.stage6-chat .voice-record-panel,
  html.vda-mobile body.sidebar-open .dm-composer{
    display:none!important;
  }

  html.vda-mobile body.sidebar-open .chat-page.stage6-chat{
    overflow:hidden!important;
  }
}

/* Very short phone screens: keep footer usable, reduce nonessential vertical space. */
@media (max-width:900px) and (max-height:680px){
  html.vda-mobile .messenger-sidebar .brand{min-height:68px!important;padding:10px 12px!important}
  html.vda-mobile .messenger-sidebar .brand-home .brand-logo{width:44px!important;height:44px!important}
  html.vda-mobile .messenger-sidebar .brand-home b{font-size:22px!important}
  html.vda-mobile .messenger-sidebar .brand-home small{font-size:12px!important}
  html.vda-mobile .messenger-sidebar .sidebar-home-link,
  html.vda-mobile .messenger-sidebar .me-card{min-height:60px!important;padding:10px 12px!important}
  html.vda-mobile .messenger-sidebar>.sidebar-footer a{min-height:46px!important;font-size:15px!important}
}


/* =========================================================
   Stage 30.4 — mobile composer bottom-lock
   Fixes composer drifting upward after Stage 30.3.
   ========================================================= */
@media (max-width:900px){
  html.vda-mobile .chat-page.stage6-chat{
    display:flex!important;
    flex-direction:column!important;
    height:var(--vda-vh,100dvh)!important;
    min-height:var(--vda-vh,100dvh)!important;
    max-height:var(--vda-vh,100dvh)!important;
    overflow:hidden!important;
  }

  /* Message list is the ONLY growing part of the chat. */
  html.vda-mobile .chat-page.stage6-chat>.message-stream{
    flex:1 1 0!important;
    min-height:0!important;
    height:auto!important;
    overflow-y:auto!important;
    padding-bottom:14px!important;
  }

  /* Critical fix:
     composer participates in flex layout instead of sticky/fixed positioning.
     Therefore it always stays directly at the bottom of the visible chat. */
  html.vda-mobile .chat-page.stage6-chat>form.composer,
  html.vda-mobile .chat-page.stage6-chat>form.composer.composer--single-row{
    position:relative!important;
    inset:auto!important;
    top:auto!important;
    right:auto!important;
    bottom:auto!important;
    left:auto!important;
    flex:0 0 auto!important;
    width:100%!important;
    margin:0!important;
    transform:none!important;
    z-index:25!important;
    grid-template-columns:40px 40px minmax(0,1fr) 40px 48px!important;
    grid-template-areas:
      "attach emoji text voice send"
      "reply reply reply reply reply"
      "preview preview preview preview preview"!important;
    align-items:center!important;
    gap:6px!important;
    padding:10px 8px calc(10px + env(safe-area-inset-bottom))!important;
    background:#fff!important;
    border-top:1px solid #dbe7ee!important;
    box-shadow:0 -8px 20px rgba(17,42,57,.08)!important;
  }

  html.vda-mobile .chat-page.stage6-chat>form.composer .attach-picker{grid-area:attach!important}
  html.vda-mobile .chat-page.stage6-chat>form.composer .emoji-trigger{grid-area:emoji!important}
  html.vda-mobile .chat-page.stage6-chat>form.composer .composer-text-wrap{grid-area:text!important;min-width:0!important}
  html.vda-mobile .chat-page.stage6-chat>form.composer .voice-record-btn{grid-area:voice!important}
  html.vda-mobile .chat-page.stage6-chat>form.composer>button[type=submit]{grid-area:send!important}

  html.vda-mobile .chat-page.stage6-chat>form.composer .attach-picker,
  html.vda-mobile .chat-page.stage6-chat>form.composer .emoji-trigger,
  html.vda-mobile .chat-page.stage6-chat>form.composer .voice-record-btn{
    width:40px!important;
    min-width:40px!important;
    height:40px!important;
    min-height:40px!important;
    margin:0!important;
  }

  html.vda-mobile .chat-page.stage6-chat>form.composer>button[type=submit]{
    width:48px!important;
    min-width:48px!important;
    height:48px!important;
    min-height:48px!important;
    margin:0!important;
  }

  html.vda-mobile .chat-page.stage6-chat>form.composer textarea{
    width:100%!important;
    min-height:46px!important;
    max-height:120px!important;
    margin:0!important;
    font-size:16px!important;
  }

  /* Voice recording panel becomes a normal row immediately above composer. */
  html.vda-mobile .chat-page.stage6-chat>.voice-record-panel{
    position:relative!important;
    inset:auto!important;
    flex:0 0 auto!important;
    width:100%!important;
    margin:0!important;
    transform:none!important;
    z-index:24!important;
  }

  /* DM uses the same bottom-lock principle. */
  html.vda-mobile .chat-page.stage6-chat>form.dm-composer{
    position:relative!important;
    inset:auto!important;
    flex:0 0 auto!important;
    width:100%!important;
    margin:0!important;
    transform:none!important;
  }

  /* Sidebar remains above the chat, and composer is completely removed
     while the drawer is open. */
  html.vda-mobile body.sidebar-open .chat-page.stage6-chat>form.composer,
  html.vda-mobile body.sidebar-open .chat-page.stage6-chat>.voice-record-panel{
    display:none!important;
  }
}
