*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{--wa-green:#25D366;--wa-dark:#128C7E;--wa-darker:#075E54;--wa-bg:#ECE5DD;--wa-panel:#F0F2F5;--wa-white:#FFFFFF;--wa-border:#E9EDEF;--wa-text:#111B21;--wa-sub:#667781;--wa-blue:#53BDEB;--wa-red:#EA0038;--wa-out:#D9FDD3;--sw:380px;}
html,body{height:100%;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:#111B21;color:var(--wa-text);overflow:hidden;}
/* --app-h is set in JS from visualViewport.height so the layout shrinks when the
   mobile soft keyboard opens, keeping the message input visible. dvh/vh are
   progressive fallbacks for browsers without the JS handler. */
#auth{display:flex;height:100vh;height:100dvh;height:var(--app-h,100dvh);align-items:center;justify-content:center;background:linear-gradient(160deg,var(--wa-darker),#1a1a2e);}
.auth-card{background:#fff;border-radius:16px;padding:2.5rem 2rem;width:380px;box-shadow:0 20px 60px rgba(0,0,0,.4);}
.auth-logo{display:flex;align-items:center;gap:10px;justify-content:center;margin-bottom:1.8rem;}
.auth-logo span{font-size:1.4rem;font-weight:700;color:var(--wa-darker);}
.tab-row{display:flex;border-radius:8px;overflow:hidden;border:1.5px solid var(--wa-border);margin-bottom:1.4rem;}
.tab{flex:1;padding:10px;background:#f8f9fa;border:none;cursor:pointer;font-size:14px;font-weight:500;color:var(--wa-sub);transition:all .2s;}
.tab.active{background:var(--wa-dark);color:#fff;}
.auth-card input{display:block;width:100%;padding:11px 14px;margin-bottom:12px;border:1.5px solid var(--wa-border);border-radius:8px;font-size:15px;outline:none;transition:border-color .2s;}
.auth-card input:focus{border-color:var(--wa-dark);}
.btn-wa{width:100%;padding:12px;background:var(--wa-green);color:#fff;border:none;border-radius:8px;font-size:15px;font-weight:600;cursor:pointer;transition:background .2s;}
.btn-wa:hover{background:var(--wa-dark);}.btn-wa:disabled{background:#a8e6c1;cursor:not-allowed;}
.auth-err{color:#e53e3e;font-size:13px;text-align:center;min-height:18px;margin-top:8px;}
.auth-note{font-size:12px;color:var(--wa-sub);text-align:center;margin-top:12px;line-height:1.6;}
#app{display:flex;height:100vh;height:100dvh;height:var(--app-h,100dvh);}
#sidebar{width:var(--sw);min-width:var(--sw);background:var(--wa-white);display:flex;flex-direction:column;border-right:1px solid var(--wa-border);}
#main{flex:1;display:flex;flex-direction:column;background:var(--wa-bg);position:relative;overflow:hidden;}
.s-hdr{display:flex;align-items:center;gap:10px;padding:10px 16px;background:var(--wa-panel);border-bottom:1px solid var(--wa-border);}
.s-av{width:40px;height:40px;border-radius:50%;background:var(--wa-dark);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:15px;cursor:pointer;flex-shrink:0;overflow:hidden;}
.s-av img{width:100%;height:100%;object-fit:cover;}
.s-title{flex:1;font-size:20px;font-weight:700;}
.s-acts{display:flex;gap:2px;}
.icon-btn{width:36px;height:36px;border-radius:50%;border:none;background:none;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--wa-sub);font-size:20px;transition:background .15s;}
.icon-btn:hover{background:var(--wa-border);}
.s-srch{padding:8px 12px;background:var(--wa-panel);}
.srch-bx{display:flex;align-items:center;gap:8px;background:var(--wa-white);border-radius:8px;padding:7px 12px;border:1px solid var(--wa-border);}
.srch-bx input{border:none;outline:none;flex:1;font-size:14px;background:transparent;}
.s-tabs{display:flex;border-bottom:1px solid var(--wa-border);}
.s-tab{flex:1;padding:12px;text-align:center;font-size:13px;font-weight:600;color:var(--wa-sub);cursor:pointer;border-bottom:3px solid transparent;transition:all .2s;letter-spacing:.4px;}
.s-tab.active{color:var(--wa-dark);border-color:var(--wa-dark);}
#chat-list{flex:1;overflow-y:auto;}
.ci{display:flex;align-items:center;gap:12px;padding:10px 16px;cursor:pointer;border-bottom:1px solid #f5f6f6;transition:background .1s;user-select:none;}
.ci:hover,.ci.active{background:#f5f6f6;}
.ci-av{width:49px;height:49px;border-radius:50%;background:var(--wa-dark);color:#fff;display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:700;flex-shrink:0;overflow:hidden;position:relative;}
.ci-av img{width:100%;height:100%;object-fit:cover;}
.on-dot{position:absolute;bottom:1px;right:1px;width:13px;height:13px;border-radius:50%;background:var(--wa-green);border:2px solid #fff;}
.ci-body{flex:1;min-width:0;}
.ci-top{display:flex;justify-content:space-between;align-items:center;}
.ci-name{font-weight:600;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:170px;}
.ci-time{font-size:12px;color:var(--wa-sub);white-space:nowrap;}
.ci-bot{display:flex;justify-content:space-between;align-items:center;margin-top:2px;}
.ci-prev{font-size:14px;color:var(--wa-sub);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px;}
.ubadge{background:var(--wa-green);color:#fff;border-radius:50%;min-width:20px;height:20px;font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center;padding:0 4px;}
#empty-state{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;}
.es-icon{font-size:5rem;opacity:.25;}
#empty-state h2{font-size:2rem;font-weight:300;}.e2e-note{font-size:12px;color:var(--wa-sub);display:flex;align-items:center;gap:5px;}
#empty-state p{color:var(--wa-sub);font-size:14px;text-align:center;max-width:340px;line-height:1.8;}
#chat-view{display:none;flex-direction:column;height:100%;}#chat-view.open{display:flex;}
.ch-hdr{display:flex;align-items:center;gap:12px;padding:10px 16px;background:var(--wa-panel);border-bottom:1px solid var(--wa-border);flex-shrink:0;}
.ch-av{width:40px;height:40px;border-radius:50%;background:var(--wa-dark);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:15px;overflow:hidden;flex-shrink:0;cursor:pointer;}
.ch-av img{width:100%;height:100%;object-fit:cover;}
.ch-info{flex:1;min-width:0;cursor:pointer;}.ch-name{font-weight:600;font-size:16px;}.ch-status{font-size:13px;color:var(--wa-sub);}
.ch-acts{display:flex;gap:2px;}
#msgs{flex:1;overflow-y:auto;padding:8px 5%;display:flex;flex-direction:column;gap:1px;background-color:var(--wa-bg);}
.mw{display:flex;flex-direction:column;margin:1px 0;}.mw.me{align-items:flex-end;}.mw.them{align-items:flex-start;}
.bbl{max-width:65%;min-width:80px;padding:6px 10px 4px 9px;border-radius:8px;position:relative;box-shadow:0 1px 0.5px rgba(11,20,26,.12);cursor:context-menu;}
.mw.me .bbl{background:var(--wa-out);border-bottom-right-radius:2px;}.mw.them .bbl{background:var(--wa-white);border-bottom-left-radius:2px;}
.bbl-txt{font-size:14.5px;line-height:1.5;color:var(--wa-text);word-break:break-word;white-space:pre-wrap;}
.bbl-foot{display:flex;align-items:center;justify-content:flex-end;gap:3px;margin-top:1px;}
.msg-time{font-size:11px;color:var(--wa-sub);}.ticks{font-size:12px;}.t-s{color:var(--wa-sub);}.t-r{color:var(--wa-blue);}
.del-msg{color:var(--wa-sub);font-style:italic;font-size:14px;}
.media-bbl{max-width:280px;cursor:pointer;border-radius:6px;overflow:hidden;}
.media-bbl img,.media-bbl video{width:100%;display:block;}
.audio-bbl{display:flex;align-items:center;gap:8px;padding:4px 2px;}
.doc-bbl{display:flex;align-items:center;gap:8px;padding:6px;background:rgba(0,0,0,.05);border-radius:6px;cursor:pointer;}
.doc-ico{font-size:26px;}.doc-nm{font-size:13px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:130px;}.doc-sz{font-size:11px;color:var(--wa-sub);}
.rply{background:rgba(0,0,0,.06);border-left:4px solid var(--wa-dark);border-radius:4px;padding:5px 8px;margin-bottom:4px;cursor:pointer;}
.rply .rr-nm{color:var(--wa-dark);font-weight:600;font-size:12px;}.rply .rr-tx{color:var(--wa-sub);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.fwd{font-size:11px;color:var(--wa-sub);font-style:italic;margin-bottom:3px;}
.rxns{display:flex;gap:2px;flex-wrap:wrap;margin-top:3px;}
.rxn{background:rgba(0,0,0,.08);border-radius:10px;padding:2px 6px;font-size:13px;cursor:pointer;user-select:none;}
.rxn:hover{transform:scale(1.15);}
.date-div{text-align:center;margin:8px 0;font-size:12px;color:var(--wa-sub);}
.date-div span{background:rgba(255,255,255,.85);padding:4px 12px;border-radius:7px;box-shadow:0 1px 1px rgba(0,0,0,.06);}
.sys-msg{text-align:center;color:var(--wa-sub);font-size:12px;padding:4px 14px;background:rgba(255,255,255,.8);border-radius:7px;align-self:center;margin:6px 0;}
.typing-bbl{padding:10px 14px;}.tdots{display:flex;gap:4px;align-items:center;}
.tdots span{width:8px;height:8px;border-radius:50%;background:var(--wa-sub);animation:bnc 1.2s infinite;}
.tdots span:nth-child(2){animation-delay:.2s;}.tdots span:nth-child(3){animation-delay:.4s;}
@keyframes bnc{0%,80%,100%{transform:translateY(0)}40%{transform:translateY(-7px)}}
#rply-bar{display:none;align-items:center;gap:10px;padding:8px 14px;background:var(--wa-panel);border-top:1px solid var(--wa-border);flex-shrink:0;}
#rply-bar.open{display:flex;}
.rb-cnt{flex:1;background:rgba(0,0,0,.05);border-left:4px solid var(--wa-dark);border-radius:4px;padding:5px 10px;}
.rb-nm{font-size:12px;font-weight:600;color:var(--wa-dark);}.rb-tx{font-size:13px;color:var(--wa-sub);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
#input-area{display:flex;align-items:flex-end;gap:8px;padding:8px 10px;background:var(--wa-panel);border-top:1px solid var(--wa-border);flex-shrink:0;position:relative;}
#attach-btn{width:42px;height:42px;border-radius:50%;background:none;border:none;cursor:pointer;color:var(--wa-sub);font-size:22px;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
#attach-btn:hover{color:var(--wa-dark);}
.input-box{flex:1;display:flex;align-items:flex-end;background:var(--wa-white);border-radius:24px;padding:8px 14px;border:1px solid var(--wa-border);min-height:42px;}
#msg-input{flex:1;border:none;outline:none;font-size:15px;resize:none;max-height:100px;font-family:inherit;background:transparent;color:var(--wa-text);}
#emoji-btn{background:none;border:none;cursor:pointer;font-size:20px;padding:0 4px;flex-shrink:0;}
#send-btn{width:52px;height:52px;border-radius:50%;background:var(--wa-green);color:#fff;border:none;cursor:pointer;font-size:22px;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:background .2s;}
#send-btn:hover{background:var(--wa-dark);}#send-btn:disabled{background:#a8e6c1;}
.ctx-menu{position:fixed;background:#fff;border-radius:8px;box-shadow:0 4px 20px rgba(0,0,0,.2);z-index:1000;min-width:160px;overflow:hidden;display:none;}
.ctx-menu.open{display:block;}
.ctx-item{padding:11px 18px;cursor:pointer;font-size:14px;display:flex;align-items:center;gap:10px;}
.ctx-item:hover{background:#f5f6f6;}.ctx-item.danger{color:var(--wa-red);}
.emoji-tray{position:absolute;bottom:70px;left:10px;background:#fff;border-radius:12px;box-shadow:0 4px 20px rgba(0,0,0,.2);padding:12px;display:none;z-index:100;width:300px;}
.emoji-tray.open{display:block;}
#gif-btn{background:none;border:1.5px solid var(--wa-border);border-radius:14px;cursor:pointer;font-size:11px;font-weight:800;letter-spacing:.5px;color:var(--wa-sub);padding:4px 7px;flex-shrink:0;line-height:1;transition:all .15s;height:26px;align-self:center;}
#gif-btn:hover{color:var(--wa-dark);border-color:var(--wa-dark);}
#gif-modal{display:none;position:fixed;inset:0;background:rgba(17,27,33,.6);z-index:6000;align-items:center;justify-content:center;padding:18px;}
.gif-card{background:#fff;border-radius:16px;box-shadow:0 24px 70px rgba(0,0,0,.35);padding:18px;width:min(460px,94vw);max-height:80vh;display:flex;flex-direction:column;}
.gif-card .profile-head{margin-bottom:12px;}
.gif-search-bx{display:flex;align-items:center;gap:8px;background:var(--wa-panel);border-radius:18px;padding:7px 12px;color:var(--wa-sub);margin-bottom:10px;}
.gif-search-bx input{flex:1;border:none;outline:none;background:transparent;font-size:14px;color:var(--wa-text);}
.gif-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;overflow-y:auto;flex:1;min-height:140px;}
.gif-cell{border:none;background:#f5f6f6;border-radius:8px;overflow:hidden;cursor:pointer;padding:0;aspect-ratio:1/1;}
.gif-cell img{width:100%;height:100%;object-fit:cover;display:block;}
.gif-cell:hover{outline:2px solid var(--wa-dark);}
.gif-status{grid-column:1/-1;text-align:center;color:var(--wa-sub);font-size:13px;line-height:1.6;padding:24px 8px;}
.gif-credit{text-align:center;font-size:10px;color:var(--wa-sub);margin-top:8px;letter-spacing:.5px;}
.emoji-grid{display:flex;flex-wrap:wrap;gap:3px;max-height:180px;overflow-y:auto;}
.ebtn{font-size:22px;cursor:pointer;border:none;background:none;padding:3px;border-radius:4px;line-height:1;}
.ebtn:hover{background:#f5f6f6;}
.attach-tray{position:absolute;bottom:70px;left:10px;background:#fff;border-radius:12px;box-shadow:0 4px 20px rgba(0,0,0,.2);padding:14px;display:none;z-index:100;}
.attach-tray.open{display:block;}
.attach-grid{display:flex;gap:16px;flex-wrap:wrap;}
.att-item{display:flex;flex-direction:column;align-items:center;gap:5px;cursor:pointer;}
.att-circ{width:50px;height:50px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:22px;}
.att-lbl{font-size:11px;color:var(--wa-sub);}
.notif-banner{position:fixed;top:0;left:50%;transform:translateX(-50%) translateY(-100%);background:#fff;border-radius:0 0 12px 12px;padding:10px 18px;box-shadow:0 4px 12px rgba(0,0,0,.15);z-index:9999;display:flex;align-items:center;gap:12px;cursor:pointer;max-width:380px;width:90%;transition:transform .3s;}
.notif-banner.show{transform:translateX(-50%) translateY(0);}
.nb-av{width:40px;height:40px;border-radius:50%;background:var(--wa-dark);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;flex-shrink:0;}
.nb-body{flex:1;min-width:0;}.nb-name{font-weight:600;font-size:14px;}.nb-txt{font-size:13px;color:var(--wa-sub);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
#img-viewer{display:none;position:fixed;inset:0;background:rgba(0,0,0,.93);z-index:2000;align-items:center;justify-content:center;}
#img-viewer.open{display:flex;}
#img-viewer img,#img-viewer video{max-width:90vw;max-height:90vh;object-fit:contain;border-radius:4px;}
.iv-close{position:absolute;top:16px;right:20px;color:#fff;font-size:32px;cursor:pointer;line-height:1;background:none;border:none;}
.rxn-picker{position:fixed;background:#fff;border-radius:24px;padding:6px 10px;box-shadow:0 4px 20px rgba(0,0,0,.2);z-index:1001;display:none;gap:6px;}
.rxn-picker.open{display:flex;}
.rxn-pick-btn{font-size:22px;cursor:pointer;border:none;background:none;padding:2px;border-radius:50%;transition:transform .1s;}
.rxn-pick-btn:hover{transform:scale(1.3);}
::-webkit-scrollbar{width:5px;}::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:10px;}
@media(max-width:768px){:root{--sw:100vw;}#main{display:none;}#main.mob{display:flex;}#sidebar.mob-hide{display:none;}}

/* Secure archive + logout */
.logout-btn{font-size:18px;color:var(--wa-red);}
.logout-btn:hover{background:rgba(234,0,56,.10);}
.ci.locked .ci-name::after{content:' 🔐';font-size:12px;color:var(--wa-sub);}
.lock-badge{display:inline-flex;align-items:center;gap:4px;font-size:11px;color:var(--wa-sub);}
.archive-lock{align-self:center;max-width:360px;margin:auto;text-align:center;background:rgba(255,255,255,.92);border-radius:14px;padding:24px 22px;box-shadow:0 6px 22px rgba(11,20,26,.12);color:var(--wa-text);}
.archive-lock .lock-ico{font-size:40px;margin-bottom:10px;}
.archive-lock h3{font-size:18px;margin-bottom:8px;}
.archive-lock p{font-size:13px;color:var(--wa-sub);line-height:1.6;margin-bottom:14px;}
.archive-lock button{border:none;border-radius:999px;background:var(--wa-dark);color:#fff;padding:10px 16px;font-weight:600;cursor:pointer;}
.archive-lock button:hover{background:var(--wa-darker);}
#input-area.locked{opacity:.55;pointer-events:none;}

/* Profile display-name editor */
#profile-modal{display:none;position:fixed;inset:0;background:rgba(17,27,33,.55);z-index:3000;align-items:center;justify-content:center;padding:18px;}
#unlock-modal{display:none;position:fixed;inset:0;background:rgba(17,27,33,.6);z-index:6000;align-items:center;justify-content:center;padding:18px;}
#unlock-modal.open{display:flex;}
.unlock-card{max-width:380px;width:100%;}
.unlock-card label{display:block;font-size:13px;font-weight:600;margin:8px 0 4px;color:var(--wa-sub);}
.unlock-card input{display:block;width:100%;padding:11px 14px;border:1.5px solid var(--wa-border);border-radius:8px;font-size:15px;outline:none;}
.unlock-card input:focus{border-color:var(--wa-dark);}
#profile-modal.open{display:flex;}
.profile-card{width:min(420px,94vw);background:#fff;border-radius:16px;box-shadow:0 24px 70px rgba(0,0,0,.35);padding:22px;}
.profile-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;}
.profile-head h3{font-size:20px;font-weight:700;color:var(--wa-text);}
.profile-head button{border:none;background:none;font-size:22px;cursor:pointer;color:var(--wa-sub);}
.profile-avatar{width:72px;height:72px;border-radius:50%;background:var(--wa-dark);color:#fff;display:flex;align-items:center;justify-content:center;font-size:28px;font-weight:800;margin:0 auto 16px;}
.profile-card label{display:block;margin:12px 0 6px;font-size:13px;font-weight:700;color:var(--wa-sub);}
.profile-card input,.profile-card textarea{width:100%;border:1.5px solid var(--wa-border);border-radius:10px;padding:10px 12px;font:inherit;outline:none;resize:none;}
.profile-card input:focus,.profile-card textarea:focus{border-color:var(--wa-dark);}
.profile-sub{font-size:12px;color:var(--wa-sub);margin-top:6px;line-height:1.5;}

/* Read receipts + narrow-phone header fixes */
.receipt{display:inline-flex;align-items:center;gap:2px;vertical-align:middle;margin-left:2px;}
.receipt.read{color:var(--wa-blue);font-weight:600;}
.read-label{font-size:10.5px;line-height:1;color:var(--wa-blue);margin-left:2px;letter-spacing:.1px;}
.ci-prev .receipt{margin-right:4px;margin-left:0;}
.ci-prev .read-label{font-size:10px;}
.ch-acts{flex-shrink:0;}

@media(max-width:768px){
  html,body{height:100dvh;max-width:100vw;overflow:hidden;}
  #app{height:100dvh;width:100vw;max-width:100vw;overflow:hidden;}
  #sidebar,#main{width:100vw;min-width:0;max-width:100vw;}
  .s-hdr{padding:9px 12px;}
  .s-acts{flex-shrink:0;}
  .ch-hdr{gap:8px;padding:8px 8px;min-width:0;max-width:100vw;overflow:hidden;}
  #back-btn{display:flex!important;flex-shrink:0;}
  .ch-av{width:34px;height:34px;font-size:13px;}
  .ch-info{flex:1 1 auto;min-width:58px;overflow:hidden;}
  .ch-name{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .ch-status{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .ch-acts{flex:0 0 auto;max-width:46vw;display:flex;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;gap:1px;padding-bottom:1px;scrollbar-width:none;}
  .ch-acts::-webkit-scrollbar{display:none;}
  .ch-acts .icon-btn{width:32px;height:32px;min-width:32px;font-size:17px;}
  #msgs{padding:8px 10px;}
  .bbl{max-width:86%;}
  #input-area{padding:8px 8px;gap:6px;}
  .input-box{min-width:0;padding:8px 10px;}
  #send-btn{width:44px;height:44px;min-width:44px;}
  #attach-btn{width:38px;height:38px;min-width:38px;}
  #emoji-btn{min-width:32px;}
  .emoji-tray{width:min(300px,calc(100vw - 20px));left:8px;}
  .attach-tray{left:8px;right:8px;}
}
@media(max-width:380px){
  .ch-hdr{gap:6px;padding:7px 6px;}
  .ch-av{width:32px;height:32px;}
  .ch-info{min-width:48px;}
  .ch-acts{max-width:42vw;}
  .ch-acts .icon-btn{width:30px;height:30px;min-width:30px;font-size:16px;}
}

/* ==========================================================
   Spaceship Ultra-Premium Chatbox Theme
   Applied on top of the original chat functionality.
   ========================================================== */
:root{
  --wa-green:#67e8f9;
  --wa-dark:#38bdf8;
  --wa-darker:#0f172a;
  --wa-bg:#020617;
  --wa-panel:rgba(15,23,42,.72);
  --wa-white:rgba(255,255,255,.075);
  --wa-border:rgba(255,255,255,.11);
  --wa-text:#f8fafc;
  --wa-sub:#94a3b8;
  --wa-blue:#67e8f9;
  --wa-red:#fb7185;
  --wa-out:linear-gradient(135deg,#22d3ee 0%,#3b82f6 52%,#8b5cf6 100%);
  --sp-card:rgba(15,23,42,.74);
  --sp-soft:rgba(255,255,255,.06);
  --sp-soft-2:rgba(255,255,255,.095);
  --sp-glow:0 24px 80px rgba(37,99,235,.22);
  --sp-border:1px solid rgba(255,255,255,.12);
}
html,body{
  background:
    radial-gradient(circle at 12% 0%,rgba(59,130,246,.40),transparent 34%),
    radial-gradient(circle at 88% 12%,rgba(139,92,246,.28),transparent 32%),
    linear-gradient(135deg,#020617 0%,#07111f 48%,#020617 100%);
  color:var(--wa-text);
}
body::before{
  content:'';
  position:fixed;
  inset:0;
  pointer-events:none;
  opacity:.20;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.035) 1px,transparent 1px);
  background-size:44px 44px;
  mask-image:radial-gradient(circle at center,black 0%,transparent 76%);
}
#auth{
  background:
    radial-gradient(circle at top left,rgba(34,211,238,.28),transparent 34%),
    radial-gradient(circle at bottom right,rgba(139,92,246,.26),transparent 30%),
    linear-gradient(145deg,#020617,#0f172a 55%,#020617);
}
.auth-card{
  width:min(430px,92vw);
  border:var(--sp-border);
  border-radius:30px;
  background:linear-gradient(145deg,rgba(15,23,42,.86),rgba(15,23,42,.58));
  color:#fff;
  box-shadow:0 28px 100px rgba(0,0,0,.52),0 0 80px rgba(37,99,235,.16);
  backdrop-filter:blur(22px);
}
.auth-logo{justify-content:flex-start;margin-bottom:1.55rem;}
.brand-mark,.s-av,.ci-av,.ch-av,.profile-avatar,.nb-av{
  background:linear-gradient(135deg,#22d3ee 0%,#3b82f6 52%,#8b5cf6 100%)!important;
  color:#fff;
  box-shadow:0 14px 30px rgba(37,99,235,.25);
}
.brand-mark{
  width:54px;height:54px;border-radius:19px;
  display:flex;align-items:center;justify-content:center;
  font-size:28px;line-height:1;
  border:1px solid rgba(255,255,255,.18);
}
.brand-copy{display:flex;flex-direction:column;gap:2px;}
.auth-logo span{color:#fff;font-size:1.6rem;letter-spacing:-.035em;}
.brand-copy small{color:#93c5fd;font-size:12px;font-weight:700;letter-spacing:.02em;text-transform:uppercase;}
.tab-row{background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.10);border-radius:18px;padding:5px;}
.tab{border-radius:14px;background:transparent;color:#94a3b8;font-weight:800;}
.tab.active{background:linear-gradient(135deg,#22d3ee,#3b82f6,#8b5cf6);color:#fff;box-shadow:0 12px 30px rgba(59,130,246,.22);}
.auth-card input,.profile-card input,.profile-card textarea{
  background:rgba(255,255,255,.075);
  border:1px solid rgba(255,255,255,.13);
  color:#fff;
  border-radius:17px;
}
.auth-card input::placeholder,.profile-card input::placeholder,.profile-card textarea::placeholder,#msg-input::placeholder,.srch-bx input::placeholder{color:#64748b;}
.auth-card input:focus,.profile-card input:focus,.profile-card textarea:focus{
  border-color:rgba(103,232,249,.72);
  box-shadow:0 0 0 4px rgba(34,211,238,.12);
}
.btn-wa,#send-btn,.archive-lock button{
  background:linear-gradient(135deg,#22d3ee,#3b82f6,#8b5cf6)!important;
  color:#fff;
  border:0;
  box-shadow:0 14px 35px rgba(59,130,246,.24);
}
.btn-wa{border-radius:17px;font-weight:850;letter-spacing:.01em;}
.auth-note{color:#94a3b8;}
#app{
  height:100vh;
  padding:18px;
  gap:0;
  background:transparent;
}
#sidebar{
  border:var(--sp-border);
  border-right:1px solid rgba(255,255,255,.10);
  background:rgba(2,6,23,.68);
  backdrop-filter:blur(24px);
  border-radius:30px 0 0 30px;
  overflow:hidden;
  box-shadow:var(--sp-glow);
}
#main{
  border:var(--sp-border);
  border-left:0;
  background:linear-gradient(145deg,rgba(2,6,23,.66),rgba(15,23,42,.46));
  border-radius:0 30px 30px 0;
  overflow:hidden;
  box-shadow:var(--sp-glow);
}
.s-hdr,.s-srch,.ch-hdr,#input-area,#rply-bar{
  background:rgba(15,23,42,.70);
  border-color:rgba(255,255,255,.10);
  backdrop-filter:blur(18px);
}
.s-hdr{padding:16px 16px 14px;gap:12px;}
.s-title{display:flex;flex-direction:column;line-height:1.05;color:#fff;}
.s-title span{font-size:22px;font-weight:900;letter-spacing:-.04em;}
.s-title small{margin-top:5px;color:#7dd3fc;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.07em;}
.s-acts{gap:7px;}
.icon-btn{
  background:rgba(255,255,255,.065);
  border:1px solid rgba(255,255,255,.10);
  color:#cbd5e1;
  border-radius:15px;
  font-size:18px;
}
.icon-btn:hover{background:rgba(255,255,255,.12);color:#fff;transform:translateY(-1px);}
.logout-btn{color:#fda4af;}
.logout-btn:hover{background:rgba(251,113,133,.14);}
.s-srch{padding:12px 14px;}
.srch-bx{
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.11);
  border-radius:18px;
  color:#94a3b8;
  padding:11px 13px;
}
.srch-bx input{color:#fff;}
.s-tabs{padding:0 12px 10px;border:0;gap:8px;background:rgba(15,23,42,.70);}
.s-tab{
  border:1px solid rgba(255,255,255,.10);
  border-radius:999px;
  padding:9px 11px;
  color:#94a3b8;
  background:rgba(255,255,255,.045);
  font-size:11px;
}
.s-tab.active{
  color:#e0f2fe;
  border-color:rgba(103,232,249,.32);
  background:rgba(34,211,238,.12);
}
#chat-list{padding:10px;}
.ci{
  border:1px solid rgba(255,255,255,.09);
  background:rgba(255,255,255,.045);
  border-radius:22px;
  margin-bottom:9px;
  padding:12px;
  transition:transform .18s ease,background .18s ease,border-color .18s ease,box-shadow .18s ease;
}
.ci:hover,.ci.active{
  transform:translateY(-1px);
  background:rgba(34,211,238,.10);
  border-color:rgba(103,232,249,.24);
  box-shadow:0 16px 32px rgba(8,47,73,.20);
}
.ci-av,.s-av,.ch-av{border-radius:17px;border:1px solid rgba(255,255,255,.17);}
.ci-name,.ch-name{color:#fff;font-weight:850;letter-spacing:-.015em;}
.ci-time,.ci-prev,.ch-status,.msg-time,.doc-sz,.att-lbl{color:#94a3b8;}
.on-dot{background:#34d399;border-color:#020617;box-shadow:0 0 0 4px rgba(52,211,153,.12);}
.ubadge{
  background:linear-gradient(135deg,#22d3ee,#60a5fa);
  color:#020617;
  font-weight:900;
}
#empty-state{
  background:
    radial-gradient(circle at 50% 35%,rgba(59,130,246,.24),transparent 32%),
    linear-gradient(145deg,rgba(2,6,23,.18),rgba(15,23,42,.14));
  color:#fff;
}
.es-icon{
  width:112px;height:112px;border-radius:36px;
  display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,rgba(34,211,238,.18),rgba(139,92,246,.18));
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 24px 70px rgba(37,99,235,.18);
  font-size:4.25rem;opacity:1;
}
#empty-state h2{font-weight:900;font-size:2.35rem;letter-spacing:-.055em;}
#empty-state p{color:#cbd5e1;max-width:520px;}
.e2e-note{
  color:#a5f3fc;
  border:1px solid rgba(103,232,249,.22);
  background:rgba(34,211,238,.10);
  border-radius:999px;
  padding:9px 14px;
  font-weight:800;
}
.ch-hdr{padding:14px 18px;gap:13px;}
.ch-av{width:48px;height:48px;font-size:17px;}
.ch-info{line-height:1.15;}
.ch-status{margin-top:5px;font-size:12px;}
#msgs{
  gap:10px;
  padding:24px clamp(14px,5vw,64px);
  background:
    radial-gradient(circle at 20% 10%,rgba(34,211,238,.12),transparent 26%),
    radial-gradient(circle at 86% 72%,rgba(139,92,246,.13),transparent 28%),
    linear-gradient(145deg,rgba(2,6,23,.35),rgba(15,23,42,.18));
}
#msgs::before{
  content:'';
  position:absolute;
  inset:0;
  pointer-events:none;
}
.bbl{
  border:1px solid rgba(255,255,255,.10);
  border-radius:24px;
  padding:11px 13px 8px;
  max-width:min(72%,720px);
  box-shadow:0 18px 45px rgba(0,0,0,.22);
  backdrop-filter:blur(12px);
}
.mw.me .bbl{
  background:linear-gradient(135deg,#22d3ee 0%,#3b82f6 52%,#8b5cf6 100%);
  border-color:rgba(255,255,255,.18);
  border-bottom-right-radius:7px;
  color:#fff;
}
.mw.them .bbl{
  background:rgba(255,255,255,.075);
  border-bottom-left-radius:7px;
}
.mw.me .bbl-txt,.mw.me .msg-time,.mw.me .ticks,.mw.me .receipt,.mw.me .read-label{color:rgba(255,255,255,.86);}
.bbl-txt{color:#f8fafc;font-size:14.8px;}
.bbl-foot{margin-top:6px;}
.rply,.rb-cnt{
  background:rgba(255,255,255,.09);
  border-left-color:#67e8f9;
  border-radius:13px;
}
.rply .rr-nm,.rb-nm{color:#a5f3fc;}
.rply .rr-tx,.rb-tx{color:#cbd5e1;}
.fwd{color:#bae6fd;}
.rxns .rxn,.rxn{
  background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.10);
}
.date-div span,.sys-msg{
  background:rgba(15,23,42,.76);
  border:1px solid rgba(255,255,255,.10);
  color:#cbd5e1;
  border-radius:999px;
  box-shadow:0 12px 35px rgba(0,0,0,.20);
}
.sys-msg{padding:8px 16px;}
#input-area{padding:14px;gap:10px;}
.input-box{
  background:rgba(255,255,255,.075);
  border:1px solid rgba(255,255,255,.12);
  border-radius:22px;
  min-height:52px;
  padding:10px 15px;
}
#msg-input{color:#fff;font-size:15px;}
#emoji-btn,#attach-btn{
  width:46px;height:46px;min-width:46px;
  border-radius:17px;
  background:rgba(255,255,255,.065);
  border:1px solid rgba(255,255,255,.10);
  color:#cbd5e1;
}
#emoji-btn:hover,#attach-btn:hover{background:rgba(255,255,255,.12);color:#fff;}
#send-btn{width:52px;height:52px;border-radius:18px;}
.emoji-tray,.attach-tray,.ctx-menu,.rxn-picker,.notif-banner,.profile-card,.archive-lock{
  background:rgba(15,23,42,.92)!important;
  color:#f8fafc;
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 24px 80px rgba(0,0,0,.45);
  backdrop-filter:blur(22px);
}
.emoji-tray,.attach-tray,.ctx-menu,.notif-banner{border-radius:22px;}
.ebtn:hover,.ctx-item:hover{background:rgba(255,255,255,.10);}
.ctx-item.danger{color:#fda4af;}
.doc-bbl{background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.10);border-radius:16px;}
.media-bbl,.media-bbl img,.media-bbl video{border-radius:18px;}
.archive-lock{
  max-width:430px;
  border-radius:30px;
  padding:30px 26px;
}
.archive-lock .lock-ico{
  width:72px;height:72px;margin:0 auto 16px;border-radius:24px;
  display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,rgba(251,191,36,.18),rgba(59,130,246,.18));
  border:1px solid rgba(255,255,255,.12);
}
.archive-lock h3{color:#fff;font-size:22px;letter-spacing:-.035em;}
.archive-lock p{color:#cbd5e1;}
#input-area.locked{opacity:.60;filter:saturate(.45);}
.profile-card{border-radius:30px;}
.profile-head h3{color:#fff;}
.profile-head button{color:#cbd5e1;}
.profile-sub,.profile-card label{color:#94a3b8;}
.notif-banner{top:14px;border-radius:22px;}
.read-label,.receipt.read{color:#bfdbfe;}
::-webkit-scrollbar-thumb{background:rgba(148,163,184,.42);}
@media(max-width:768px){
  #app{padding:0;height:100dvh;}
  #sidebar,#main{border-radius:0;border-left:0;border-right:0;border-top:0;border-bottom:0;}
  #chat-list{padding:8px;}
  #msgs{padding:14px 10px;}
  .bbl{max-width:86%;}
  .s-title small{display:none;}
  .ch-hdr{padding:10px 8px;}
  .ch-av{width:38px;height:38px;border-radius:14px;}
  .ch-acts .icon-btn{border-radius:13px;}
  #input-area{padding:10px 8px;}
  #emoji-btn,#attach-btn{width:40px;height:40px;min-width:40px;}
  #send-btn{width:44px;height:44px;border-radius:15px;}
}


/* ==========================================================
   Spaceship Ultra-Premium Chatbox V2 — closer to the sample
   ========================================================== */
#app{padding:22px;background:transparent;}
#sidebar{width:390px;min-width:390px;background:rgba(2,6,23,.74);border-radius:32px 0 0 32px;}
#main{background:linear-gradient(145deg,rgba(2,6,23,.72),rgba(15,23,42,.52));border-radius:0 32px 32px 0;}
.s-hdr{padding:18px 18px 15px;background:rgba(2,6,23,.42);}
.s-av{width:46px;height:46px;border-radius:18px;}
.s-title span{font-size:24px;}
.s-title small{color:#93c5fd;}
.s-premium-cards{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:0 14px 13px;background:rgba(15,23,42,.70);}
.sp-mini-card{border-radius:20px;border:1px solid rgba(255,255,255,.12);padding:12px 12px 11px;box-shadow:0 18px 40px rgba(0,0,0,.16);}
.sp-mini-card strong{display:block;font-size:12px;color:#e0f2fe;line-height:1.1;}
.sp-mini-card small{display:block;margin-top:5px;color:#93c5fd;font-size:10.5px;line-height:1.25;}
.sp-mini-card.secure{background:linear-gradient(145deg,rgba(16,185,129,.16),rgba(34,211,238,.07));border-color:rgba(110,231,183,.20);}
.sp-mini-card.timezone{background:linear-gradient(145deg,rgba(34,211,238,.16),rgba(59,130,246,.08));border-color:rgba(125,211,252,.22);}
.ci{min-height:76px;gap:13px;border-radius:24px;background:rgba(255,255,255,.045);}
.ci-av{width:50px;height:50px;border-radius:18px;}
.ci.active{background:rgba(34,211,238,.12);box-shadow:0 18px 46px rgba(59,130,246,.16),inset 0 0 0 1px rgba(103,232,249,.12);}
.ch-hdr{min-height:78px;background:rgba(2,6,23,.46);}
.ch-av{width:52px;height:52px;border-radius:20px;}
.ch-name{font-size:17px;}
.ch-status.typing-status{color:#67e8f9;font-weight:800;letter-spacing:.01em;}
#msgs{position:relative;gap:12px;padding:28px clamp(18px,5vw,72px);}
.mw{margin:0;}
.bbl{max-width:min(76%,760px);border-radius:26px;padding:12px 14px 9px;}
.mw.me .bbl{border-bottom-right-radius:8px;}
.mw.them .bbl{border-bottom-left-radius:8px;background:rgba(255,255,255,.085);}
.bbl-txt{font-size:15px;line-height:1.58;}
.bbl-foot{gap:5px;margin-top:7px;}
.receipt{display:inline-flex;align-items:center;justify-content:center;margin-left:2px;min-width:18px;}
.receipt .ticks{font-size:13px;font-weight:900;letter-spacing:-3px;font-family:Arial, Helvetica, sans-serif;}
.receipt.sent .ticks,.receipt.delivered .ticks{color:#cbd5e1;}
.receipt.read .ticks,.mw.me .receipt.read .ticks,.ci-prev .receipt.read .ticks{color:#22d3ee!important;text-shadow:0 0 10px rgba(34,211,238,.45);}
.mw.me .receipt.sent .ticks,.mw.me .receipt.delivered .ticks{color:rgba(255,255,255,.74);}
.read-label{display:none!important;}
.typing-row .bbl,.typing-bbl{display:flex;align-items:center;gap:10px;min-width:112px;padding:11px 14px!important;}
.typing-text{color:#cbd5e1;font-size:13px;font-weight:700;}
.tdots span{background:#67e8f9;box-shadow:0 0 10px rgba(103,232,249,.30);}
#input-area{padding:16px;background:rgba(2,6,23,.52);}
.input-box{border-radius:24px;min-height:54px;background:rgba(255,255,255,.08);}
#send-btn{font-size:22px;}
@media(max-width:768px){#app{padding:0}#sidebar{width:100vw;min-width:0;border-radius:0}.s-premium-cards{padding:0 10px 10px}.sp-mini-card{border-radius:17px;padding:10px}#main{border-radius:0}.ch-hdr{min-height:60px}.bbl{max-width:86%}}


/* ==========================================================
   Spaceship Calls + Wallpaper
   ========================================================== */
#msgs.has-wallpaper{
  background-image:
    linear-gradient(145deg,rgba(2,6,23,.74),rgba(15,23,42,.54)),
    var(--chat-wallpaper);
  background-size:cover;
  background-position:center;
  background-attachment:local;
}
#msgs.has-wallpaper::after{
  content:'';
  position:absolute;
  inset:0;
  pointer-events:none;
  background:radial-gradient(circle at 20% 10%,rgba(34,211,238,.13),transparent 28%),radial-gradient(circle at 86% 72%,rgba(139,92,246,.14),transparent 30%);
}
#msgs.has-wallpaper > *{position:relative;z-index:1;}
.call-modal{display:none;position:fixed;inset:0;z-index:5000;align-items:flex-start;justify-content:center;padding:18px;background:rgba(2,6,23,.70);backdrop-filter:blur(20px);overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y;}
.call-modal.open{display:flex;}
.call-card{width:min(980px,96vw);max-height:calc(100dvh - 36px);overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;border-radius:34px;border:1px solid rgba(255,255,255,.14);background:linear-gradient(145deg,rgba(15,23,42,.94),rgba(2,6,23,.92));box-shadow:0 35px 100px rgba(0,0,0,.55);padding:22px;text-align:center;color:#f8fafc;}
.call-orbit{width:72px;height:72px;border-radius:26px;margin:0 auto 10px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#22d3ee,#3b82f6,#8b5cf6);box-shadow:0 22px 70px rgba(59,130,246,.35);font-size:28px;font-weight:900;}
.call-kicker{display:inline-flex;border:1px solid rgba(103,232,249,.24);background:rgba(34,211,238,.10);color:#a5f3fc;border-radius:999px;padding:6px 12px;font-size:12px;font-weight:850;letter-spacing:.04em;text-transform:uppercase;}
.call-card h3{margin:10px 0 4px;font-size:24px;letter-spacing:-.04em;}
.call-card p{margin:0 0 12px;color:#cbd5e1;font-size:14px;}
.call-video-grid{position:relative;display:block;margin:12px auto;border-radius:26px;overflow:hidden;background:#020617;border:1px solid rgba(255,255,255,.12);box-shadow:inset 0 0 0 1px rgba(255,255,255,.04);width:100%;max-width:920px;aspect-ratio:16/9;max-height:min(58dvh,520px);}
.call-video-grid.voice-only{display:none;}
.call-video-grid video{background:#020617;object-fit:contain;}
#remote-video{position:absolute;inset:0;width:100%;height:100%;border:0;border-radius:0;}
#local-video{position:absolute;right:14px;bottom:14px;width:min(230px,31%);height:auto;aspect-ratio:16/9;border:1px solid rgba(255,255,255,.24);border-radius:18px;box-shadow:0 16px 44px rgba(0,0,0,.45);background:#020617;z-index:2;}
#remote-audio{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none;}
.call-camera-controls{display:none;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;margin:8px auto 10px;color:#cbd5e1;font-size:12px;}
.call-camera-controls label{font-weight:900;color:#e2e8f0;}
.call-camera-controls select{max-width:min(360px,86vw);border:1px solid rgba(148,163,184,.28);border-radius:999px;background:rgba(2,6,23,.70);color:#f8fafc;padding:9px 12px;outline:none;}
.call-mini-btn{border:1px solid rgba(255,255,255,.14);border-radius:999px;background:rgba(255,255,255,.10);color:#fff;font-weight:900;padding:9px 12px;cursor:pointer;}
.call-actions{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:12px;}
.call-btn{border:0;border-radius:999px;padding:12px 18px;font-weight:900;color:#fff;cursor:pointer;box-shadow:0 12px 35px rgba(0,0,0,.25);}
.call-btn:disabled{opacity:.48;cursor:not-allowed;box-shadow:none;}
.call-btn.accept{background:linear-gradient(135deg,#10b981,#22c55e);}
.call-btn.mute,.call-btn.video,.call-btn.speaker,.call-btn.share{background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.12);}
.call-btn.end{background:linear-gradient(135deg,#ef4444,#be123c);}
.call-note{margin-top:13px;color:#94a3b8;font-size:12px;line-height:1.45;}
.call-chat-panel{margin-top:16px;border:1px solid rgba(148,163,184,.20);background:rgba(15,23,42,.55);border-radius:22px;padding:12px;text-align:left;}
.call-chat-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px;color:#f8fafc;font-size:13px;font-weight:900;}
.call-chat-head small{color:#94a3b8;font-size:11px;font-weight:700;}
.call-chat-log{height:150px;overflow-y:auto;border-radius:16px;background:rgba(2,6,23,.50);padding:10px;display:flex;flex-direction:column;gap:7px;}
.call-chat-empty{color:#94a3b8;text-align:center;font-size:12px;line-height:1.45;margin:auto;}
.call-chat-msg{max-width:88%;border-radius:16px;padding:8px 10px;font-size:13px;line-height:1.35;color:#e2e8f0;word-break:break-word;}
.call-chat-msg.me{align-self:flex-end;background:linear-gradient(135deg,rgba(34,211,238,.22),rgba(59,130,246,.25));border:1px solid rgba(125,211,252,.22);}
.call-chat-msg.them{align-self:flex-start;background:rgba(255,255,255,.09);border:1px solid rgba(255,255,255,.10);}
.call-chat-msg small{display:block;opacity:.65;font-size:10px;margin-top:3px;}
.call-chat-media{display:block;border:0;background:transparent;padding:0;margin:0;cursor:pointer;max-width:180px;}
.call-chat-media img{display:block;max-width:180px;max-height:160px;border-radius:12px;object-fit:contain;background:rgba(2,6,23,.65);}
.call-chat-compose{display:flex;align-items:center;gap:8px;margin-top:9px;position:relative;}
.call-chat-compose input{flex:1;min-width:0;border:1px solid rgba(148,163,184,.25);border-radius:999px;background:rgba(2,6,23,.55);color:#f8fafc;outline:none;padding:10px 13px;font-size:13px;}
.call-chat-compose input::placeholder{color:#94a3b8;}
.call-chat-compose button{border:0;border-radius:999px;background:linear-gradient(135deg,#22d3ee,#3b82f6);color:#fff;font-weight:900;padding:0 15px;cursor:pointer;min-height:38px;}
.call-chat-compose .call-chat-tool{background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.12);padding:0 10px;min-width:40px;}
.call-emoji-tray{position:absolute;left:0;bottom:48px;width:min(340px,88vw);max-height:210px;overflow-y:auto;background:#fff;border-radius:18px;box-shadow:0 18px 55px rgba(0,0,0,.35);padding:12px;display:none;z-index:4;}
.call-emoji-tray.open{display:block;}
@supports not (height:100dvh){.call-card{max-height:calc(100vh - 36px);}.call-video-grid{max-height:min(58vh,520px);}}
@media(max-width:700px){.call-modal{padding:10px}.call-card{width:96vw;max-height:calc(100dvh - 20px);padding:16px;border-radius:26px}.call-orbit{width:58px;height:58px;border-radius:22px;font-size:22px}.call-card h3{font-size:21px}.call-video-grid{aspect-ratio:9/16;max-height:52dvh;margin:10px auto}.call-video-grid video{object-fit:contain}#local-video{width:38%;right:10px;bottom:10px;border-radius:14px}.call-camera-controls{gap:6px}.call-camera-controls select{width:100%;max-width:100%;font-size:12px}.call-chat-log{height:128px}.call-btn{padding:11px 13px;font-size:13px}.call-chat-compose{gap:6px}.call-chat-compose button{padding:0 11px}.ch-acts{max-width:52vw;}}
