:root{
  --brand:#0aa884;--brand-dark:#087b68;--brand-soft:#d9fdd3;--ink:#111b21;--ink2:#202c33;--ink3:#2a3942;
  --text:#e9edef;--muted:#8696a0;--muted2:#667781;--line:#d8dfE3;--paper:#efeae2;--white:#fff;
  --app-bg:#f0f2f5;--sidebar:#fff;--sidebar-hover:#f5f6f6;--bubble-in:#fff;--bubble-out:#d9fdd3;--bubble-text:#111b21;
  --shadow:0 16px 48px rgba(11,20,26,.16);--safe-bottom:max(0px,env(safe-area-inset-bottom));
}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;background:#dfe3e5;color:#111b21;-webkit-tap-highlight-color:transparent}button,input,select,textarea{font:inherit}button{cursor:pointer}button,a{touch-action:manipulation}button:disabled{opacity:.6;cursor:not-allowed}[hidden]{display:none!important}img,video{max-width:100%}

/* AUTH */
.auth-shell{min-height:100dvh;position:relative;overflow:hidden;background:radial-gradient(circle at 13% 15%,#d6fff1 0,transparent 29%),radial-gradient(circle at 90% 78%,#d9f2ff 0,transparent 27%),linear-gradient(135deg,#fbfdfd,#edf7f3 58%,#fafcfc)}.auth-ambient{position:absolute;border-radius:50%;filter:blur(13px);opacity:.55;pointer-events:none}.ambient-one{width:380px;height:380px;background:#a9ead5;top:-180px;right:-100px}.ambient-two{width:280px;height:280px;background:#bedff3;left:-100px;bottom:-110px}.auth-topbar{height:74px;max-width:1220px;margin:auto;display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:relative;z-index:2}.brand-mini{display:flex;align-items:center;gap:10px;color:#14342d;text-decoration:none;font-size:19px}.brand-mark{width:38px;height:38px;border-radius:12px;background:linear-gradient(145deg,#20d49b,#0b8c72);display:inline-grid;place-items:center;color:#fff;font-weight:900;box-shadow:0 8px 24px #00a88444}.brand-mark.hero{width:92px;height:92px;border-radius:28px;font-size:44px}.admin-link{color:#0a6d5c;text-decoration:none;font-weight:700;background:#fff;border:1px solid #d9e8e4;padding:10px 15px;border-radius:12px;box-shadow:0 5px 18px #0b493b0d}.auth-wrap{max-width:1180px;margin:0 auto;padding:38px 28px 70px;display:grid;grid-template-columns:1.05fr .78fr;gap:82px;align-items:center;position:relative;z-index:2}.security-pill{display:inline-flex;align-items:center;gap:8px;background:#fff;color:#13745f;border:1px solid #dcebe6;padding:9px 13px;border-radius:999px;font-size:13px;font-weight:800;box-shadow:0 8px 24px rgba(16,90,74,.08)}.security-pill span{background:#d9f7ee;border-radius:50%;width:21px;height:21px;display:grid;place-items:center}.auth-copy h1{font-size:54px;line-height:1.02;letter-spacing:-2.5px;margin:22px 0 17px;color:#17352e;max-width:650px}.auth-copy h1 span{color:#0b997d}.auth-copy>p{font-size:18px;line-height:1.65;color:#55736b;max-width:620px}.phone-preview{width:min(470px,90%);margin-top:28px;background:#111b21;border-radius:24px;overflow:hidden;box-shadow:0 25px 70px rgba(8,58,47,.25);border:6px solid #202c33;transform:rotate(-1.5deg)}.preview-head{height:64px;background:#202c33;color:#e9edef;display:flex;align-items:center;gap:10px;padding:10px 14px}.mini-avatar{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:#00a884;color:#fff;font-weight:900}.preview-head div{flex:1}.preview-head small{display:block;color:#93a3ab;margin-top:2px}.preview-chat-bg{min-height:215px;padding:18px;background:#efeae2;background-image:radial-gradient(#d9d2c8 1px,transparent 1px);background-size:18px 18px}.mini-bubble{max-width:72%;padding:9px 10px;border-radius:9px;background:#fff;font-size:13px;margin-bottom:10px;box-shadow:0 1px 1px #00000010}.mini-bubble.right{margin-left:auto;background:#d9fdd3}.mini-bubble small{float:right;margin:5px 0 0 8px;color:#667781;font-size:10px}.mini-media{display:flex;align-items:center;gap:10px;background:#fff;padding:10px;border-radius:10px;max-width:82%;margin-bottom:10px}.mini-media .play{width:36px;height:36px;border-radius:50%;background:#0aa884;color:#fff;display:grid;place-items:center}.mini-media div{flex:1}.mini-media small{display:block;color:#667781;font-size:10px}.trust-row{display:flex;gap:30px;margin-top:26px}.trust-row div{display:flex;flex-direction:column}.trust-row b{color:#17352e}.trust-row span{color:#6b817b;font-size:12px;margin-top:4px}.auth-card{background:#fff;border:1px solid #dce8e5;border-radius:28px;padding:34px 34px 28px;box-shadow:0 32px 80px rgba(14,73,60,.15);max-width:455px;width:100%;justify-self:end}.auth-logo{text-align:center;margin-bottom:10px}.auth-logo span{width:78px;height:78px;border-radius:25px;display:inline-grid;place-items:center;background:linear-gradient(145deg,#20d49b,#087d68);color:#fff;font-weight:900;font-size:34px;box-shadow:0 15px 30px #0aa88438;border:6px solid #edfff9}.step-label{font-size:10px;font-weight:900;letter-spacing:1.5px;color:#0a8e75;margin-top:8px}.auth-card h2{margin:8px 0 8px;font-size:28px;color:#16372f}.subcopy{margin:0 0 23px;color:#70827d;line-height:1.55;font-size:14px}.auth-card label{display:block;font-size:12px;font-weight:800;color:#314b45;margin-bottom:7px}.phone-field{height:54px;border:1.5px solid #d4dfdc;border-radius:13px;display:grid;grid-template-columns:116px 1fr;overflow:hidden;background:#fff}.phone-field:focus-within{border-color:#0aa884;box-shadow:0 0 0 3px #0aa88418}.phone-field select,.phone-field input{border:0;outline:0;background:transparent;padding:0 12px;color:#1f3933}.phone-field select{border-right:1px solid #e4ebe9}.primary-btn{width:100%;margin-top:15px;border:0;border-radius:13px;background:linear-gradient(145deg,#0daf8b,#07836b);color:#fff;padding:15px 17px;font-weight:800;display:flex;justify-content:space-between;box-shadow:0 10px 22px #0aa8842f}.secure-note{display:flex;gap:10px;background:#f4fbf8;border:1px solid #e0f0ea;border-radius:13px;padding:12px;margin-top:15px}.secure-note b,.secure-note small{display:block}.secure-note b{font-size:12px;color:#315148}.secure-note small{font-size:10.5px;color:#71867f;margin-top:3px;line-height:1.4}.text-btn,.link-btn{border:0;background:transparent;color:#0a8b73;font-weight:800;padding:0}.otp-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:8px}.otp-digit{width:100%;aspect-ratio:1;border:1.5px solid #d4dfdc;border-radius:11px;text-align:center;font-size:24px;font-weight:800;outline:0}.otp-digit:focus{border-color:#0aa884;box-shadow:0 0 0 3px #0aa88418}.resend-row{text-align:center;margin-top:17px;color:#74857f;font-size:12px}.auth-message{min-height:20px;margin-top:12px;font-size:12px;color:#0a8a72;text-align:center}.auth-message.error{color:#cf4949}.terms{font-size:10px;text-align:center;color:#98a6a1;margin-top:12px;line-height:1.45}

/* APP SHELL */
.messenger-shell{height:100dvh;width:100%;display:grid;grid-template-columns:64px 410px minmax(0,1fr);background:var(--app-bg);overflow:hidden}.app-rail{background:#f0f2f5;border-right:1px solid #d7dde0;display:flex;flex-direction:column;align-items:center;padding:10px 0 12px;z-index:30}.rail-logo{width:40px;height:40px;border-radius:12px;background:linear-gradient(145deg,#12b990,#087c69);display:grid;place-items:center;color:#fff;font-weight:900;margin:2px 0 14px}.rail-main{display:flex;flex-direction:column;gap:4px;align-items:center;width:100%}.rail-bottom{margin-top:auto;display:flex;flex-direction:column;align-items:center;gap:7px;width:100%}.rail-btn{width:48px;height:48px;border:0;border-radius:14px;background:transparent;color:#54656f;display:grid;place-items:center;position:relative}.rail-btn span{font-size:22px}.rail-btn em{display:none}.rail-btn:hover,.rail-btn.active{background:#dfe5e7;color:#0b141a}.rail-btn.active:before{content:"";position:absolute;left:-8px;width:3px;height:24px;border-radius:4px;background:#0aa884}.rail-avatar{width:36px;height:36px;border:0;border-radius:50%;background:#0aa884;color:#fff;font-weight:800}.side-panel{min-width:0;background:var(--sidebar);border-right:1px solid #d7dde0;display:flex;flex-direction:column;height:100dvh}.side-header{height:64px;display:flex;align-items:center;justify-content:space-between;padding:0 16px;border-bottom:1px solid #edf0f2}.side-header h1{margin:0;font-size:22px;letter-spacing:-.5px}.side-header small{display:none;color:#8696a0}.side-actions{display:flex;gap:2px}.side-actions button,.thread-actions button,.icon-btn{width:38px;height:38px;border-radius:50%;border:0;background:transparent;color:#54656f;font-size:20px;display:grid;place-items:center}.side-actions button:hover,.thread-actions button:hover,.icon-btn:hover{background:#f0f2f5}.section-body{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain}.workspace{position:relative;min-width:0;height:100dvh;background:#efeae2;overflow:hidden}.empty-pane{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#f7f8fa;border-bottom:6px solid #0aa884;text-align:center;color:#54656f}.empty-pane h2{font-weight:400;font-size:30px;color:#41525d;margin:26px 0 8px}.empty-pane p{max-width:520px;font-size:13px;line-height:1.55}.e2e{margin-top:20px;font-size:12px;color:#8696a0}.empty-visual{position:relative}.orbit{position:absolute;border:1px dashed #0aa88440;border-radius:50%;inset:-25px}.orbit.two{inset:-52px;opacity:.5}

/* LISTS / CHATS */
.search-box{margin:8px 12px 5px;height:39px;border-radius:10px;background:#f0f2f5;display:flex;align-items:center;gap:10px;padding:0 12px;color:#667781}.search-box input{border:0;outline:0;background:transparent;min-width:0;flex:1;font-size:13px}.filter-tabs{display:flex;gap:7px;padding:4px 12px 8px}.filter-tabs button{border:0;background:#f0f2f5;border-radius:16px;color:#54656f;padding:7px 12px;font-size:12px}.filter-tabs button.active{background:#e7fce9;color:#008069}.list-section-title{padding:12px 17px 7px;color:#008069;font-size:12px;font-weight:800}.chat-item{min-height:72px;display:flex;align-items:center;padding:8px 12px;gap:11px;cursor:pointer;position:relative}.chat-item:after{content:"";position:absolute;left:74px;right:0;bottom:0;height:1px;background:#eef0f1}.chat-item:hover,.chat-item.active{background:#f0f2f5}.avatar{width:49px;height:49px;flex:0 0 49px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(145deg,#7ed9c0,#0aa884);color:#fff;font-weight:800;letter-spacing:.3px;overflow:hidden}.avatar.gray{background:linear-gradient(145deg,#aebcc3,#71828b)}.avatar.community{border-radius:14px;background:linear-gradient(145deg,#12b990,#087e69)}.chat-content{min-width:0;flex:1}.chat-row{display:flex;justify-content:space-between;gap:8px;align-items:center}.chat-row b{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600}.chat-row time{font-size:11px;color:#667781;white-space:nowrap}.chat-preview{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#667781;font-size:12px;margin-top:4px;min-width:0}.chat-preview>span:first-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.unread{min-width:19px;height:19px;padding:0 5px;border-radius:999px;background:#25d366;color:#fff;display:grid;place-items:center;font-size:10px;font-weight:800}.empty-list{padding:55px 25px;text-align:center;color:#8696a0}.empty-list .big{font-size:38px;margin-bottom:10px}.empty-list b{display:block;color:#41525d;margin-bottom:6px}.section-card{margin:11px 12px;border-radius:13px;background:#fff;border:1px solid #edf0f1;overflow:hidden}.section-card-title{padding:12px 14px 7px;font-size:12px;color:#008069;font-weight:800}.simple-row{display:flex;align-items:center;gap:12px;padding:12px 14px;min-height:62px;cursor:pointer;border-top:1px solid #f0f2f3}.simple-row:first-of-type{border-top:0}.simple-row:hover{background:#f7f8f8}.simple-row .row-icon{width:42px;height:42px;border-radius:50%;background:#e7fce9;color:#008069;display:grid;place-items:center;font-size:19px}.simple-row .row-copy{flex:1;min-width:0}.simple-row b,.simple-row small{display:block}.simple-row small{color:#8696a0;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.simple-row .chev{color:#a3afb5}.setting-switch{width:42px;height:24px;border-radius:13px;background:#c9d1d5;position:relative;transition:.2s}.setting-switch:after{content:"";position:absolute;width:18px;height:18px;border-radius:50%;background:#fff;left:3px;top:3px;box-shadow:0 1px 4px #0003;transition:.2s}.setting-switch.on{background:#0aa884}.setting-switch.on:after{left:21px}.profile-card{padding:24px 18px 20px;text-align:center;border-bottom:1px solid #eef1f2}.profile-card .avatar{width:82px;height:82px;margin:auto;font-size:26px}.profile-card h3{margin:12px 0 2px}.profile-card p{margin:0;color:#8696a0;font-size:12px}.plan-badge{display:inline-block;margin-top:8px;padding:4px 8px;border-radius:999px;background:#e7fce9;color:#008069;font-size:10px;font-weight:900}.plan-badge.premium{background:#fff2cc;color:#8a6500}.status-ring{width:53px;height:53px;border-radius:50%;padding:2px;background:conic-gradient(#0aa884 0 88%,#d7e1de 88%);flex:0 0 53px}.status-ring .avatar{width:49px;height:49px;border:2px solid white}.status-add{position:relative}.status-add:after{content:"+";position:absolute;right:-1px;bottom:-1px;width:19px;height:19px;border-radius:50%;background:#0aa884;color:#fff;border:2px solid #fff;display:grid;place-items:center;font-weight:900;font-size:12px}

/* THREAD */
.thread-pane{height:100%;display:flex;flex-direction:column;background:#efeae2;background-image:radial-gradient(#d8d0c5 1px,transparent 1px);background-size:20px 20px}.thread-header{height:64px;flex:0 0 64px;background:#f0f2f5;display:flex;align-items:center;padding:0 10px;gap:8px;border-bottom:1px solid #dfe3e5;z-index:10}.back-chat{display:none}.thread-identity{border:0;background:transparent;display:flex;align-items:center;gap:10px;min-width:0;flex:1;text-align:left;padding:0}.thread-identity .avatar{width:42px;height:42px;flex-basis:42px}.thread-title{min-width:0}.thread-title b,.thread-title small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.thread-title b{font-size:14px}.thread-title small{font-size:11px;color:#667781;margin-top:2px}.thread-actions{display:flex;align-items:center;gap:1px}.messages{flex:1;overflow:auto;padding:18px clamp(16px,7vw,85px) 24px;scroll-behavior:smooth}.day-separator{width:max-content;margin:4px auto 13px;background:#fff;padding:6px 11px;border-radius:7px;color:#667781;font-size:10px;box-shadow:0 1px 2px #0002}.protection-notice{width:max-content;max-width:82%;margin:0 auto 13px;background:#ffeecd;padding:7px 11px;border-radius:7px;color:#6f5c33;font-size:10px;text-align:center;box-shadow:0 1px 2px #0001}.bubble{width:max-content;max-width:68%;min-width:100px;background:var(--bubble-in);color:var(--bubble-text);margin:3px 0 3px;clear:both;border-radius:8px;padding:6px 8px 5px;box-shadow:0 1px 1px #0002;position:relative;float:left}.bubble.mine{float:right;background:var(--bubble-out)}.bubble:after{content:"";display:block;clear:both}.bubble .sender{font-size:11px;font-weight:800;color:#009588;margin-bottom:3px}.bubble p{margin:0;font-size:13.5px;line-height:1.38;white-space:pre-wrap;overflow-wrap:anywhere}.bubble-time{float:right;font-size:9.5px;color:#667781;margin:5px 0 -2px 10px}.bubble .reply-quote{border-left:3px solid #0aa884;background:#00000008;border-radius:5px;padding:5px 7px;margin:0 0 5px;font-size:11px;color:#667781}.bubble .msg-tools{position:absolute;right:3px;top:2px;border:0;background:linear-gradient(90deg,transparent,#fff 30%);opacity:0;padding:2px 5px 3px 14px;border-radius:8px;color:#667781}.bubble.mine .msg-tools{background:linear-gradient(90deg,transparent,#d9fdd3 30%)}.bubble:hover .msg-tools{opacity:1}.protected-media{width:min(360px,48vw);position:relative;border-radius:7px;overflow:hidden;background:#101820;margin-bottom:5px}.protected-media img,.protected-media video{display:block;width:100%;max-height:360px;object-fit:cover}.protected-media audio{display:block;width:100%;background:#fff}.watermark{position:absolute;right:7px;top:7px;background:#0008;color:#fff;padding:4px 7px;border-radius:5px;font-size:9px;pointer-events:none}.media-overlay{position:absolute;left:0;right:0;bottom:0;padding:8px;display:flex;align-items:center;justify-content:space-between;gap:8px;background:linear-gradient(transparent,#000b);color:#fff;font-size:10px}.download-btn,.locked-btn{background:#ffffffde;color:#123;text-decoration:none;padding:5px 8px;border-radius:8px;font-weight:800;font-size:9px}.locked-btn{opacity:.9}.file-card{display:flex;align-items:center;gap:10px;background:#f0f2f5;border-radius:7px;padding:9px 10px;min-width:240px}.file-card i{font-style:normal;font-size:25px}.file-card div{min-width:0;flex:1}.file-card b,.file-card small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-card small{font-size:10px;color:#667781}.file-card a{text-decoration:none;color:#008069;font-size:11px;font-weight:800}.composer{min-height:62px;background:#f0f2f5;display:flex;align-items:center;gap:6px;padding:8px 10px calc(8px + var(--safe-bottom));position:relative;z-index:12}.composer input{min-width:0;flex:1;border:0;outline:0;background:#fff;border-radius:10px;padding:12px 13px;font-size:13px}.composer-icon,.send-btn{width:38px;height:38px;flex:0 0 38px;border:0;border-radius:50%;background:transparent;color:#54656f;font-size:20px}.send-btn{background:#0aa884;color:#fff;font-size:16px}.mic-btn.recording{background:#e14c4c;color:#fff;animation:pulse 1s infinite}@keyframes pulse{50%{transform:scale(1.08)}}.announcement-composer{padding:15px;background:#f0f2f5;text-align:center;color:#667781;font-size:12px}.reply-bar{background:#f0f2f5;padding:7px 60px 7px 52px;position:relative;z-index:11}.reply-bar>div{background:#fff;border-left:4px solid #0aa884;border-radius:7px;padding:6px 9px}.reply-bar b,.reply-bar span{display:block;font-size:11px}.reply-bar span{color:#667781;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.reply-bar button{position:absolute;right:20px;top:16px;border:0;background:transparent;color:#667781;font-size:20px}.thread-search{height:50px;background:#fff;display:flex;align-items:center;gap:9px;padding:6px 12px;border-bottom:1px solid #edf0f2}.thread-search input{flex:1;border:0;outline:0;background:#f0f2f5;border-radius:9px;padding:9px 11px}.thread-search button{border:0;background:transparent;font-size:22px;color:#667781}.emoji-picker{position:absolute;left:12px;bottom:70px;width:310px;max-height:245px;overflow:auto;background:#fff;border-radius:14px;box-shadow:var(--shadow);padding:12px;display:grid;grid-template-columns:repeat(7,1fr);gap:3px;z-index:40}.emoji-picker button{border:0;background:transparent;font-size:22px;padding:6px;border-radius:8px}.emoji-picker button:hover{background:#f0f2f5}.attach-sheet{position:absolute;left:42px;bottom:70px;width:210px;background:#fff;border-radius:14px;box-shadow:var(--shadow);padding:8px;z-index:40}.attach-sheet button{width:100%;border:0;background:transparent;display:flex;align-items:center;gap:12px;padding:10px;border-radius:9px;text-align:left}.attach-sheet button:hover{background:#f0f2f5}.attach-sheet i{font-style:normal;width:34px;height:34px;border-radius:50%;background:#e7fce9;color:#008069;display:grid;place-items:center}.attach-sheet span{font-size:13px}.thread-pane:after{content:"";display:block;clear:both}

/* DRAWER / MENUS / MODAL */
.info-drawer{width:360px;background:#f0f2f5;border-left:1px solid #d8dfe2;height:100dvh;overflow:auto}.info-drawer>header{height:64px;background:#fff;display:flex;align-items:center;gap:18px;padding:0 14px;border-bottom:1px solid #edf0f1}.info-drawer>header button{border:0;background:transparent;font-size:24px;color:#667781}.info-profile{background:#fff;text-align:center;padding:25px 20px;margin-bottom:10px}.info-profile .avatar{width:90px;height:90px;margin:auto;font-size:27px}.info-profile h3{margin:12px 0 4px}.info-profile p{color:#667781;margin:0;font-size:12px}.info-block{background:#fff;margin-bottom:10px;padding:15px}.info-block h4{font-size:11px;color:#008069;margin:0 0 10px}.member-chip{display:flex;align-items:center;gap:9px;padding:7px 0}.member-chip .avatar{width:36px;height:36px;flex-basis:36px;font-size:11px}.member-chip b,.member-chip small{display:block}.member-chip small{font-size:10px;color:#8696a0}.floating-menu{position:fixed;background:#fff;border-radius:9px;box-shadow:var(--shadow);min-width:190px;padding:7px;z-index:90}.floating-menu button,.floating-menu a{display:flex;width:100%;border:0;background:transparent;text-decoration:none;color:#111b21;padding:10px 12px;border-radius:7px;text-align:left;font-size:13px}.floating-menu button:hover,.floating-menu a:hover{background:#f0f2f5}.modal{position:fixed;inset:0;background:#0b141aa8;z-index:100;display:grid;place-items:center;padding:18px}.modal-card{width:min(460px,100%);max-height:86dvh;overflow:auto;background:#fff;border-radius:18px;box-shadow:0 30px 90px #0006;position:relative;padding:22px}.modal-close{position:absolute;right:12px;top:10px;border:0;background:#f0f2f5;border-radius:50%;width:32px;height:32px;font-size:20px}.modal h2{margin:3px 35px 4px 0}.modal-sub{margin:0 0 15px;color:#667781;font-size:12px}.contact-list{margin:0 -10px}.contact-item{display:flex;align-items:center;gap:10px;padding:10px;border-radius:10px;cursor:pointer}.contact-item:hover{background:#f0f2f5}.contact-item .avatar{width:44px;height:44px;flex-basis:44px}.contact-item div{min-width:0;flex:1}.contact-item b,.contact-item small{display:block}.contact-item small{font-size:11px;color:#667781;margin-top:3px}.modal-input{width:100%;border:1px solid #d8dfe2;border-radius:10px;padding:11px 12px;outline:0;margin:8px 0}.modal-input:focus{border-color:#0aa884}.toast{position:fixed;z-index:150;left:50%;bottom:82px;transform:translateX(-50%);background:#202c33;color:#fff;padding:9px 14px;border-radius:8px;font-size:12px;box-shadow:var(--shadow);max-width:min(90vw,420px);text-align:center}

/* STATUS + CALLS */
.status-viewer{position:fixed;inset:0;background:#0b141af2;z-index:110;display:grid;place-items:center}.status-card-view{width:min(430px,100%);height:min(780px,100dvh);background:linear-gradient(145deg,#0e3d35,#0b141a);position:relative;color:#fff;overflow:hidden}.status-progress{height:4px;margin:8px 9px;background:#ffffff50;border-radius:5px}.status-progress i{display:block;width:72%;height:100%;background:#fff;border-radius:5px}.status-card-view header{height:58px;display:flex;align-items:center;gap:10px;padding:0 12px}.status-card-view header .avatar{width:40px;height:40px;flex-basis:40px}.status-card-view header div{flex:1}.status-card-view header b,.status-card-view header small{display:block}.status-card-view header small{font-size:10px;color:#b9c4c8}.status-card-view header button{border:0;background:transparent;color:#fff;font-size:24px}.status-card-view #statusContent{height:calc(100% - 125px);display:grid;place-items:center;padding:25px;text-align:center;font-size:22px;line-height:1.5}.status-reply{position:absolute;left:0;right:0;bottom:0;padding:10px 12px calc(10px + var(--safe-bottom));display:flex;gap:7px;background:#0005}.status-reply input{flex:1;border:1px solid #ffffff60;background:#ffffff15;color:#fff;border-radius:22px;padding:10px 14px;outline:0}.status-reply button{width:42px;border:0;border-radius:50%;background:#0aa884;color:#fff}.call-overlay{position:fixed;inset:0;background:#111b21;z-index:130;color:#fff;overflow:hidden}.call-bg{position:absolute;inset:0;background:radial-gradient(circle at 50% 30%,#1e7565,#111b21 55%,#070b0e)}.call-top{position:absolute;top:0;left:0;right:0;z-index:2;display:flex;align-items:center;justify-content:space-between;padding:18px}.call-top button{border:0;background:#ffffff12;color:#fff;width:40px;height:40px;border-radius:50%;font-size:20px}.call-person{position:absolute;inset:72px 0 140px;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:2}.call-avatar{width:132px;height:132px;border-radius:50%;background:linear-gradient(145deg,#6dd5bc,#0aa884);display:grid;place-items:center;font-size:42px;font-weight:900;box-shadow:0 20px 60px #0006}.call-person h2{font-size:28px;margin:18px 0 4px}.call-person p{color:#c8d2d6;margin:0}.call-person video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.call-controls{position:absolute;bottom:26px;left:50%;transform:translateX(-50%);z-index:3;display:flex;gap:13px;background:#202c33dd;padding:12px;border-radius:28px}.call-controls button{width:62px;height:62px;border:0;border-radius:50%;background:#ffffff15;color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:20px}.call-controls button small{font-size:8px;margin-top:2px}.call-controls .end-call{background:#e13f3f}.call-controls button.off{background:#fff;color:#111b21}

.mobile-nav{display:none}

/* DARK THEME */
body.dark{--app-bg:#111b21;--sidebar:#111b21;--sidebar-hover:#202c33;--line:#2a3942;--bubble-in:#202c33;--bubble-out:#005c4b;--bubble-text:#e9edef}body.dark .messenger-shell{background:#0b141a}body.dark .app-rail,body.dark .side-panel,body.dark .side-header,body.dark .search-box,body.dark .filter-tabs button,body.dark .section-card,body.dark .simple-row,body.dark .profile-card,body.dark .thread-header,body.dark .composer,body.dark .announcement-composer,body.dark .info-drawer,body.dark .info-profile,body.dark .info-block,body.dark .modal-card,body.dark .floating-menu{background:#111b21;color:#e9edef;border-color:#2a3942}body.dark .search-box input,body.dark .composer input,body.dark .thread-search,body.dark .thread-search input,body.dark .modal-input{background:#202c33;color:#e9edef;border-color:#2a3942}body.dark .chat-item:hover,body.dark .chat-item.active,body.dark .simple-row:hover,body.dark .contact-item:hover,body.dark .rail-btn:hover,body.dark .rail-btn.active{background:#202c33}body.dark .chat-item:after,body.dark .simple-row,body.dark .side-header{border-color:#202c33}body.dark .chat-row b,body.dark .section-card b,body.dark .profile-card h3,body.dark .modal h2{color:#e9edef}body.dark .workspace,body.dark .thread-pane{background-color:#0b141a;background-image:radial-gradient(#213039 1px,transparent 1px)}body.dark .empty-pane{background:#202c33;color:#8696a0}body.dark .empty-pane h2{color:#e9edef}body.dark .day-separator{background:#182229;color:#8696a0}body.dark .bubble .msg-tools{background:linear-gradient(90deg,transparent,#202c33 30%);color:#8696a0}body.dark .bubble.mine .msg-tools{background:linear-gradient(90deg,transparent,#005c4b 30%)}body.dark .reply-bar{background:#111b21}body.dark .reply-bar>div{background:#202c33}body.dark .file-card{background:#111b21}body.dark .mobile-nav{background:#111b21;border-color:#2a3942}

@media(max-width:1100px){.messenger-shell{grid-template-columns:56px 350px minmax(0,1fr)}.protected-media{width:min(330px,55vw)}.info-drawer{position:absolute;right:0;z-index:50;box-shadow:-8px 0 30px #0002}}
@media(max-width:800px){
  body{overflow:hidden}.auth-topbar{height:62px;padding:0 16px}.brand-mini b{font-size:15px}.admin-link{font-size:11px;padding:8px 10px}.auth-wrap{display:block;padding:16px 15px 32px}.auth-copy{display:none}.auth-card{margin:18px auto 0;padding:27px 20px 22px;border-radius:24px}.auth-shell{background:linear-gradient(180deg,#087d68 0,#0a8f77 25%,#eff7f4 25%,#f8fbfa 100%)}.auth-logo span{width:68px;height:68px;border-width:5px}.auth-card h2{font-size:25px}.phone-field{grid-template-columns:105px 1fr}.otp-grid{gap:6px}
  .messenger-shell{display:block;height:100dvh;background:#fff}.app-rail{display:none}.side-panel{height:calc(100dvh - 66px - var(--safe-bottom));border:0;width:100%}.side-header{height:58px;background:#fff;padding:0 13px}.side-header h1{font-size:22px}.side-actions button{width:36px;height:36px}.section-body{padding-bottom:8px}.workspace{position:fixed;inset:0 0 calc(66px + var(--safe-bottom)) 0;height:auto;z-index:20;pointer-events:none;background:#fff}.workspace .thread-pane{pointer-events:auto}.empty-pane{display:none!important}.thread-pane{position:absolute;inset:0;height:auto}.thread-header{height:58px;flex-basis:58px;padding:0 5px;background:#f0f2f5}.back-chat{display:grid;font-size:31px;width:34px;height:38px}.thread-identity .avatar{width:39px;height:39px;flex-basis:39px}.thread-title b{font-size:13px}.thread-title small{font-size:9px}.thread-actions button{width:33px;height:36px;font-size:17px}.messages{padding:12px 8px 18px}.bubble{max-width:85%;font-size:13px}.bubble .msg-tools{opacity:.6}.protected-media{width:min(310px,74vw)}.composer{min-height:59px;padding:7px 6px calc(7px + var(--safe-bottom))}.composer-icon{width:34px;flex-basis:34px}.composer input{padding:11px 10px}.send-btn{width:37px;flex-basis:37px}.mobile-nav{position:fixed;display:flex;left:0;right:0;bottom:0;height:calc(66px + var(--safe-bottom));padding-bottom:var(--safe-bottom);background:#fff;border-top:1px solid #e7ebed;z-index:70}.mobile-nav-btn{flex:1;border:0;background:transparent;color:#667781;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;position:relative}.mobile-nav-btn span{font-size:20px}.mobile-nav-btn em{font-size:8.5px;font-style:normal}.mobile-nav-btn.active{color:#008069}.mobile-nav-btn.active:before{content:"";position:absolute;top:7px;width:34px;height:25px;border-radius:14px;background:#d9fdd3;z-index:-1}.info-drawer{position:fixed;inset:0 0 calc(66px + var(--safe-bottom)) 0;width:auto;height:auto;z-index:80}.floating-menu{z-index:95}.emoji-picker{left:6px;right:6px;width:auto;bottom:64px;grid-template-columns:repeat(8,1fr)}.attach-sheet{left:8px;bottom:64px}.modal{align-items:end;padding:0 0 calc(66px + var(--safe-bottom))}.modal-card{width:100%;max-height:80dvh;border-radius:20px 20px 0 0;padding:20px}.toast{bottom:calc(78px + var(--safe-bottom))}.status-card-view{width:100%;height:100dvh}.call-controls{bottom:calc(22px + var(--safe-bottom));gap:9px}.call-controls button{width:58px;height:58px}.thread-search{height:48px}.reply-bar{padding-left:12px;padding-right:48px}
  .mobile-thread-open .side-panel,.mobile-thread-open .mobile-nav{display:none}.mobile-thread-open .workspace{bottom:0}.mobile-thread-open .thread-pane{position:fixed;inset:0;z-index:75}.mobile-thread-open .info-drawer{bottom:0}
}
@media(max-width:390px){.thread-actions #voiceCallBtn{display:none}.section-card{margin-left:8px;margin-right:8px}.chat-item{padding-left:9px;padding-right:9px}.otp-digit{font-size:20px}.call-controls{gap:7px}.call-controls button{width:54px;height:54px}}

/* v3.1 OTP service state */
.otp-mode-badge{display:inline-flex;align-items:center;justify-content:center;max-width:100%;margin:0 auto 16px;padding:7px 11px;border-radius:999px;font-size:10px;font-weight:850;letter-spacing:.35px;background:#eef3f1;color:#60736d;border:1px solid #dbe5e2}
.otp-mode-badge.live{background:#e7f9f3;color:#08785f;border-color:#bfeada}.otp-mode-badge.demo{background:#fff7df;color:#8a6200;border-color:#f4df99}.otp-mode-badge.warning{background:#ffeded;color:#a32e2e;border-color:#f2c4c4}.resend-row button:disabled{opacity:.55;cursor:not-allowed}
@media(max-width:600px){.otp-mode-badge{font-size:9px;margin-bottom:12px}.auth-card{border-radius:22px 22px 0 0}}

/* v3.2 additions */
.ticks{font-size:11px;color:#667781;margin-left:2px;letter-spacing:-2px}.ticks.read{color:#53bdeb}.modal-action{width:100%;border:0;background:#f7faf9;border-radius:14px;padding:12px;display:flex;align-items:center;gap:12px;text-align:left;margin:10px 0 14px;color:#17352e}.modal-action>span{width:42px;height:42px;display:grid;place-items:center;border-radius:50%;background:var(--brand-soft);font-size:20px}.modal-action div{flex:1}.modal-action b,.modal-action small{display:block}.modal-action small{font-size:11px;color:#667781;margin-top:3px}.modal-action em{font-style:normal;font-size:22px;color:#8696a0}.modal-check-list{max-height:340px;overflow:auto;border:1px solid #e1e8e6;border-radius:14px;margin:12px 0}.check-contact{display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid #edf1ef;cursor:pointer}.check-contact:last-child{border-bottom:0}.check-contact input{accent-color:var(--brand);width:18px;height:18px}.check-contact>span:last-child{display:flex;flex-direction:column;min-width:0}.check-contact b{font-size:13px}.check-contact small{font-size:10px;color:#667781}.member-toggle,.drawer-action{border:0;border-radius:10px;background:var(--brand-soft);color:var(--brand-dark);padding:8px 10px;font-weight:800;font-size:10px}.drawer-action{width:100%;margin:0 0 10px}.capture-shield{position:fixed;inset:0;z-index:99999;background:#071a17f4;color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:10px;padding:30px}.capture-shield>div{font-size:46px}.capture-shield b{font-size:22px}.capture-shield span{font-size:12px;color:#bed5cf;max-width:360px}.capture-blur .protected-media{filter:blur(18px);transition:filter .12s}.protected-media img,.protected-media video{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}@media print{body>*{display:none!important}body:after{content:'Protected member content cannot be printed from this portal.';display:block!important;padding:40px;font:700 18px system-ui;color:#111}}
body.dark .modal-action{background:#202c33;color:#e9edef}body.dark .modal-action small,body.dark .check-contact small{color:#8696a0}body.dark .modal-check-list{border-color:#2a3942}body.dark .check-contact{border-color:#2a3942}

/* =========================================================
   V3.3 MOBILE APP LAYOUT FIX
   Fixes the mobile blank screen caused by the workspace
   layer sitting above the chat list. Also makes the mobile
   experience behave like a real standalone messenger.
   ========================================================= */
:root{--safe-top:max(0px,env(safe-area-inset-top));--mobile-nav-h:68px}
@media(max-width:800px){
  html,body{width:100%;height:100%;min-height:100%;overflow:hidden;background:#fff;overscroll-behavior:none}
  body{position:fixed;inset:0}
  #messengerView.messenger-shell{position:fixed;inset:0;width:100%;height:100%;min-height:100%;display:block;overflow:hidden;background:#fff}

  /* Main mobile list is the default visible screen. */
  .side-panel{position:fixed;z-index:30;left:0;right:0;top:0;bottom:calc(var(--mobile-nav-h) + var(--safe-bottom));width:100%;height:auto;min-height:0;border:0;background:var(--sidebar);display:flex;flex-direction:column;overflow:hidden}
  .side-header{height:calc(64px + var(--safe-top));min-height:calc(64px + var(--safe-top));flex:0 0 calc(64px + var(--safe-top));padding:var(--safe-top) 12px 0 16px;background:linear-gradient(135deg,var(--brand-dark),var(--brand));border:0;color:#fff;box-shadow:0 1px 0 rgba(0,0,0,.08);position:relative;z-index:3}
  .side-header h1{font-size:23px;font-weight:750;letter-spacing:-.45px;color:#fff;line-height:1.05}
  .side-header small{display:block;color:rgba(255,255,255,.78);font-size:10px;margin-top:3px;max-width:165px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .side-actions{gap:0}
  .side-actions button{width:39px;height:39px;color:#fff;border-radius:50%;font-size:19px}
  .side-actions button:active{background:rgba(255,255,255,.14)}
  .section-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior-y:contain;background:#fff;padding:0 0 12px}

  /* IMPORTANT: workspace must not cover the mobile list until a chat is opened. */
  .workspace{display:none!important;pointer-events:none!important}
  body.mobile-thread-open .workspace{display:block!important;pointer-events:auto!important;position:fixed;z-index:85;inset:0;width:100%;height:100%;background:#efeae2;overflow:hidden}
  body.mobile-thread-open .side-panel,body.mobile-thread-open .mobile-nav{display:none!important}
  body.mobile-thread-open .thread-pane{display:flex!important;position:absolute!important;z-index:1;inset:0!important;width:100%;height:100%;min-height:0;background:#efeae2;background-image:radial-gradient(#d8d0c5 1px,transparent 1px);background-size:20px 20px}

  /* WhatsApp-style mobile list controls. */
  .search-box{height:43px;margin:10px 11px 7px;border-radius:12px;background:#f0f2f5;padding:0 13px;gap:9px}
  .search-box input{font-size:14px}
  .filter-tabs{gap:7px;padding:1px 11px 9px;overflow-x:auto;white-space:nowrap;scrollbar-width:none}
  .filter-tabs::-webkit-scrollbar{display:none}
  .filter-tabs button{flex:0 0 auto;padding:7px 13px;border-radius:18px;font-size:12px}
  .chat-item{min-height:77px;padding:8px 12px;gap:11px;background:#fff}
  .chat-item:active{background:#f2f4f5}
  .chat-item:after{left:73px;background:#eef1f2}
  .avatar{width:51px;height:51px;flex-basis:51px;font-size:14px}
  .chat-row b{font-size:15.5px;font-weight:650}
  .chat-row time{font-size:10.5px}
  .chat-preview{font-size:12.5px;margin-top:4px}
  .unread{min-width:20px;height:20px;font-size:10px}
  .empty-list{padding:48px 22px 28px}
  .section-card{margin:10px 10px;border-radius:14px;border-color:#edf0f1;box-shadow:0 1px 0 rgba(17,27,33,.02)}
  .simple-row{min-height:65px;padding:11px 13px}
  .simple-row .row-icon{width:43px;height:43px;font-size:19px}
  .profile-card{padding:25px 18px 22px;background:#fff}

  /* Full-screen conversation. */
  .thread-header{height:calc(59px + var(--safe-top));min-height:calc(59px + var(--safe-top));flex-basis:calc(59px + var(--safe-top));padding:var(--safe-top) 4px 0 4px;background:#f0f2f5;border-bottom:1px solid #dde2e4;gap:3px}
  .back-chat{display:grid!important;width:36px;height:40px;font-size:31px;line-height:1;color:#41525d}
  .thread-identity{gap:7px}
  .thread-identity .avatar{width:40px;height:40px;flex-basis:40px}
  .thread-title b{font-size:14px}
  .thread-title small{font-size:9.5px}
  .thread-actions{gap:0}
  .thread-actions button{width:34px;height:38px;font-size:17px}
  .messages{flex:1;min-height:0;padding:12px 8px 18px;overflow-y:auto;-webkit-overflow-scrolling:touch}
  .bubble{max-width:87%;font-size:13px;border-radius:8px}
  .bubble p{font-size:13.5px}
  .bubble .msg-tools{opacity:.45}
  .protected-media{width:min(320px,78vw)}
  .protected-media img,.protected-media video{max-height:52dvh}
  .composer{min-height:60px;flex:0 0 auto;padding:7px 6px calc(7px + var(--safe-bottom));gap:4px;background:#f0f2f5}
  .composer-icon{width:35px;height:35px;flex-basis:35px;font-size:19px}
  .composer input{padding:11px 10px;border-radius:20px;font-size:14px}
  .send-btn{width:39px;height:39px;flex-basis:39px}
  .announcement-composer{flex:0 0 auto;padding:13px 12px;font-size:11px}
  .reply-bar{flex:0 0 auto;padding:6px 48px 6px 10px}
  .thread-search{height:48px;flex:0 0 48px}

  /* Bottom app navigation stays visible on list screens only. */
  .mobile-nav{position:fixed;left:0;right:0;bottom:0;z-index:70;display:flex;height:calc(var(--mobile-nav-h) + var(--safe-bottom));padding:0 2px var(--safe-bottom);background:#fff;border-top:1px solid #e2e7e9;box-shadow:0 -1px 4px rgba(17,27,33,.03)}
  .mobile-nav-btn{min-width:0;flex:1;border:0;background:transparent;color:#667781;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;position:relative;padding:4px 1px}
  .mobile-nav-btn span,.mobile-nav-btn em{position:relative;z-index:2}
  .mobile-nav-btn span{font-size:21px;line-height:24px}
  .mobile-nav-btn em{font-size:10px;font-style:normal;white-space:nowrap}
  .mobile-nav-btn.active{color:var(--brand-dark);font-weight:700}
  .mobile-nav-btn.active:before{content:"";position:absolute;z-index:1;top:8px;width:44px;height:28px;border-radius:16px;background:var(--brand-soft)}

  .info-drawer{position:fixed;z-index:100;inset:0;width:100%;height:100%;background:#f0f2f5}
  .info-drawer>header{height:calc(59px + var(--safe-top));padding:var(--safe-top) 14px 0}
  .floating-menu{z-index:120;max-width:calc(100vw - 16px)}
  .emoji-picker{position:fixed;z-index:120;left:6px;right:6px;bottom:68px;width:auto;max-height:38dvh;grid-template-columns:repeat(8,1fr)}
  .attach-sheet{position:fixed;z-index:120;left:8px;bottom:68px;width:220px;max-width:calc(100vw - 16px)}
  .modal{z-index:130;align-items:end;padding:0}
  .modal-card{width:100%;max-height:82dvh;border-radius:22px 22px 0 0;padding:22px 18px calc(20px + var(--safe-bottom));overflow:auto}
  .toast{z-index:160;bottom:calc(80px + var(--safe-bottom));max-width:calc(100vw - 30px)}
  body.mobile-thread-open .toast{bottom:calc(72px + var(--safe-bottom))}

  /* Better small-screen login. */
  .auth-shell{min-height:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch}
  .auth-topbar{height:calc(60px + var(--safe-top));padding:var(--safe-top) 14px 0}
  .auth-wrap{padding:12px 14px 28px}
  .auth-card{margin:10px auto 0;padding:24px 18px 20px;max-width:430px}
}
@media(max-width:420px){
  :root{--mobile-nav-h:66px}
  .side-header h1{font-size:22px}.side-header small{max-width:145px}.side-actions button{width:36px;height:36px}
  .chat-item{min-height:74px}.avatar{width:49px;height:49px;flex-basis:49px}.chat-item:after{left:71px}
  .mobile-nav-btn em{font-size:9px}.mobile-nav-btn span{font-size:20px}
  .thread-actions #voiceCallBtn{display:none}.protected-media{width:min(305px,82vw)}
}
@media(max-width:350px){
  .thread-actions #videoCallBtn{display:none}.side-actions #cameraBtn{display:none}.filter-tabs button{padding:6px 10px}
}

/* v3.6 presence, live status and WebRTC calls */
.presence-wrap{position:relative}.presence-dot{position:absolute;right:0;bottom:1px;width:11px;height:11px;border-radius:50%;background:#19c37d;border:2px solid #fff}.status-plus{border:0;background:var(--brand);color:#fff;width:34px;height:34px;border-radius:50%;font-size:22px;line-height:34px;display:grid;place-items:center}.status-media{display:block;max-width:100%;max-height:68vh;object-fit:contain;border-radius:12px}.status-text{font-size:29px;font-weight:800;line-height:1.35;max-width:92%;white-space:pre-wrap}.remote-video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:1;background:#0b141a}.call-person{z-index:3}.call-person .local-video{position:absolute;right:16px;bottom:16px;left:auto;top:auto;width:120px;height:170px;object-fit:cover;border-radius:16px;border:2px solid #ffffff66;box-shadow:0 8px 30px #0006;z-index:5}.incoming-actions{position:absolute;left:50%;bottom:calc(34px + var(--safe-bottom));transform:translateX(-50%);z-index:6;display:flex;gap:46px}.incoming-actions button{width:72px;height:72px;border:0;border-radius:50%;color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:25px;box-shadow:0 10px 28px #0004}.incoming-actions button small{font-size:9px;margin-top:3px}.incoming-actions .reject-call{background:#e13f3f;transform:rotate(135deg)}.incoming-actions .reject-call small{transform:rotate(-135deg)}.incoming-actions .accept-call{background:#19a974}.call-privacy-note{position:absolute;left:50%;bottom:6px;transform:translateX(-50%);z-index:7;font-size:9px;color:#c5d2cf;text-align:center;width:min(620px,90%);opacity:.85}.managed-notice{font-size:11px;line-height:1.5;background:#fff8df;border:1px solid #f0dda2;color:#765700;border-radius:10px;padding:10px;margin:8px}
@media(max-width:800px){.call-person .local-video{width:92px;height:130px;right:10px;bottom:8px}.incoming-actions{bottom:calc(42px + var(--safe-bottom))}.call-privacy-note{bottom:4px;font-size:8px}.status-text{font-size:25px}.presence-dot{width:10px;height:10px}}
body.free-protected #messengerView{-webkit-user-select:none;user-select:none}


/* v3.7 additions */
.ticks.read{color:#10a56e!important;font-weight:800}.ticks.delivered{color:#7a8b91!important}.recording-notice{position:absolute;top:78px;left:50%;transform:translateX(-50%);background:#b42318;color:white;padding:7px 13px;border-radius:999px;font-weight:800;font-size:12px;z-index:50;box-shadow:0 6px 18px #0004}.phone-search-row{display:flex;gap:8px;align-items:center}.phone-search-row .modal-input{margin:0;flex:1}.primary-btn.compact{width:auto;margin:0;padding:12px 18px}.warning-inline{padding:10px 12px;background:#fff1f0;border:1px solid #ffc9c4;border-radius:10px;color:#9b1c13;margin-top:8px}.tiny-avatar{width:34px;height:34px;border-radius:50%;object-fit:cover}.profile-edit-avatar{width:90px;height:90px;border-radius:50%;overflow:hidden;background:var(--brand-soft);display:grid;place-items:center;font-size:30px;font-weight:800;margin:0 auto 14px}.profile-edit-avatar img,#railProfile img{width:100%;height:100%;object-fit:cover;border-radius:50%}.drawer-action.dangerish{color:#b42318}.uploading-pulse{animation:pulse .8s infinite alternate}@keyframes pulse{to{opacity:.55}}
@media(max-width:800px){.emoji-picker{left:8px;right:8px;bottom:72px;max-height:220px;overflow:auto;grid-template-columns:repeat(7,1fr)}.attach-sheet{left:10px;right:10px;bottom:72px;grid-template-columns:repeat(4,1fr)}.phone-search-row{align-items:stretch}.primary-btn.compact{min-width:82px}.recording-notice{top:64px;white-space:nowrap}}

/* AapKon v3.9 brand + media reliability UI */
:root{--brand:#6c4cf1;--brand-dark:#4b2dbd;--brand-soft:#eee9ff;--bubble-out:#eee9ff}
.auth-shell{background:radial-gradient(circle at 13% 15%,#eee9ff 0,transparent 31%),radial-gradient(circle at 90% 78%,#e1e8ff 0,transparent 28%),linear-gradient(135deg,#fff,#f5f2ff 58%,#fbfbff)}
.ambient-one{background:#d8cfff}.ambient-two{background:#cdd8ff}.brand-mark,.auth-logo span,.rail-logo{background:linear-gradient(145deg,#8068ff,#4b2dbd);box-shadow:0 10px 28px #6c4cf13d}.auth-copy h1 span,.step-label,.text-btn,.link-btn,.list-section-title{color:var(--brand)}.primary-btn{background:linear-gradient(145deg,#8068ff,#4b2dbd);box-shadow:0 10px 22px #6c4cf133}.phone-field:focus-within,.otp-digit:focus{border-color:var(--brand);box-shadow:0 0 0 3px #6c4cf118}.mini-avatar,.mini-media .play,.rail-avatar{background:var(--brand)}.empty-pane{border-bottom-color:var(--brand)}.rail-btn.active:before{background:var(--brand)}.filter-tabs button.active{background:var(--brand-soft);color:var(--brand-dark)}
.phone-help{font-size:11px;color:#7b8190;margin:7px 2px 0;line-height:1.45}.phone-help b{color:#4b2dbd}.country-mini{min-width:104px;padding:8px;border:1px solid #d9d7e7;border-radius:10px;background:#fff;color:#29313a}.avatar img,.rail-avatar img,.profile-photo img,.thread-avatar img,.status-avatar img,.group-avatar img{width:100%;height:100%;object-fit:cover;border-radius:inherit;display:block}.voice-record-bar{display:flex;align-items:center;gap:10px;background:#fff;border-top:1px solid #e4e6ea;padding:9px 12px;min-height:56px}.voice-record-bar .record-dot{width:10px;height:10px;background:#e64545;border-radius:50%;animation:aapPulse 1s infinite}.voice-record-bar .record-label{font-weight:800;color:#e64545}.voice-record-bar .record-time{font-variant-numeric:tabular-nums;color:#59636b}.voice-record-bar .record-spacer{flex:1}.voice-record-bar button{border:0;border-radius:999px;padding:9px 14px;font-weight:800}.voice-record-bar .cancel-record{background:#f0f2f5;color:#4b5560}.voice-record-bar .send-record{background:var(--brand);color:#fff}@keyframes aapPulse{50%{opacity:.35;transform:scale(.85)}}
.attachment-preview{display:flex;flex-direction:column;gap:12px}.attachment-preview .preview-media{background:#111b21;border-radius:14px;overflow:hidden;min-height:140px;display:grid;place-items:center}.attachment-preview .preview-media img,.attachment-preview .preview-media video{max-height:52vh;width:100%;object-fit:contain}.attachment-preview .preview-media audio{width:90%;margin:28px}.attachment-preview .file-preview-icon{font-size:54px;color:#fff;padding:34px}.attachment-preview textarea{width:100%;min-height:76px;resize:vertical;border:1px solid #d9dde3;border-radius:12px;padding:11px;outline:0}.attachment-preview textarea:focus{border-color:var(--brand);box-shadow:0 0 0 3px #6c4cf115}.attachment-preview-actions{display:flex;justify-content:flex-end;gap:9px}.attachment-preview-actions button{border:0;border-radius:10px;padding:10px 15px;font-weight:800}.attachment-preview-actions .send{background:var(--brand);color:white}.attachment-preview-actions .cancel{background:#eef0f2;color:#44505a}.install-link{display:flex;align-items:center;gap:12px;padding:13px;border:1px solid #e1def5;border-radius:14px;background:#f8f6ff;margin:10px 0}.install-link .emoji{font-size:27px}.profile-main{display:flex;align-items:center;gap:13px}.profile-main .profile-photo{width:58px;height:58px;border-radius:50%;overflow:hidden;background:var(--brand);color:#fff;display:grid;place-items:center;font-weight:900;font-size:20px}.profile-main .profile-copy{min-width:0;flex:1}.profile-main .profile-copy b{display:block;font-size:16px}.profile-main .profile-copy small{display:block;color:#79858e;margin-top:3px}.ticks.read{color:#18a979!important}.message-media audio{width:min(320px,100%)}
@media(max-width:720px){.voice-record-bar{position:relative;z-index:12;padding-bottom:calc(9px + var(--safe-bottom))}.attachment-preview .preview-media img,.attachment-preview .preview-media video{max-height:43vh}.phone-help{text-align:left}.auth-card{padding:24px 20px 21px}.phone-field{grid-template-columns:105px 1fr}.brand-mark.hero{width:76px;height:76px;border-radius:24px;font-size:32px}.auth-copy h1{font-size:36px}.mobile-nav button.active{color:var(--brand)}}
.voice-record-bar .voice-pulse{color:#e64545;animation:aapPulse 1s infinite}.voice-record-bar #cancelVoiceNote,.voice-record-bar #sendVoiceNote{border:0;border-radius:999px;width:40px;height:40px;display:grid;place-items:center}.voice-record-bar #cancelVoiceNote{background:#eef0f2;color:#4a5560}.voice-record-bar #sendVoiceNote{background:var(--brand);color:#fff}.voice-record-bar b{font-size:12px}.voice-record-bar time{margin-left:auto;font-variant-numeric:tabular-nums;color:#6b7580}.attachment-preview>img,.attachment-preview>video{display:block;width:100%;max-height:52vh;object-fit:contain;border-radius:13px;background:#111}.attachment-preview.file{padding:18px;border:1px solid #e0ddec;border-radius:13px;background:#faf9ff;align-items:center;text-align:center}.attachment-preview.file audio{width:100%}.big-file-icon{font-size:46px}.attachment-actions{display:flex;gap:9px;justify-content:flex-end;margin-top:13px}.attachment-actions .drawer-action{width:auto}.attachment-actions .primary-btn{width:auto;margin:0;gap:12px}.upload-progress{margin-top:10px;padding:10px;border-radius:10px;background:#f1edff;color:#4b2dbd;font-size:11px;font-weight:700}
/* v4.0 Linked devices / QR scanner */
.linked-list{margin-top:16px;border:1px solid #ebe8f5;border-radius:16px;overflow:hidden}.linked-device{display:flex;align-items:center;gap:12px;padding:13px 14px;border-bottom:1px solid #eeeaf6}.linked-device:last-child{border-bottom:0}.linked-device .row-copy{flex:1}.linked-device .row-copy b,.linked-device .row-copy small{display:block}.linked-device .row-copy small{color:#81808f;margin-top:3px;font-size:11px}.unlink-device{border:0;background:#fff0f0;color:#c44242;border-radius:10px;padding:8px 10px;font-weight:800}.qr-scanner{position:relative;margin:14px 0;border-radius:20px;overflow:hidden;background:#111;aspect-ratio:1/1}.qr-scanner video{width:100%;height:100%;object-fit:cover;display:block}.scan-frame{position:absolute;inset:14%;border:3px solid #fff;border-radius:22px;box-shadow:0 0 0 999px #0005}.scan-frame:before,.scan-frame:after{content:"";position:absolute;width:42px;height:42px;border-color:#7e65ff}.scan-frame:before{left:-3px;top:-3px;border-left:5px solid #7e65ff;border-top:5px solid #7e65ff;border-radius:14px 0 0 0}.scan-frame:after{right:-3px;bottom:-3px;border-right:5px solid #7e65ff;border-bottom:5px solid #7e65ff;border-radius:0 0 14px 0}.scanner-status{text-align:center;color:#6e6b7c;font-size:12px;min-height:20px}.manual-link{margin:14px 0;padding:12px;background:#f7f5ff;border-radius:14px}.manual-link label{display:block;font-size:11px;font-weight:800;color:#605d71;margin-bottom:8px}.manual-link>div{display:flex;gap:8px}.manual-link input{flex:1;min-width:0;border:1px solid #ded8f8;border-radius:10px;padding:11px 12px;font-size:18px;letter-spacing:2px;outline:0}.manual-link button{border:0;border-radius:10px;padding:0 14px;background:var(--brand);color:#fff;font-weight:800}
