#dropinOverlay{position:fixed; inset:0; z-index:9999; display:flex; align-items:center; justify-content:center;
    background:rgba(2,9,13,.82); backdrop-filter:blur(6px); padding:20px;}
  #dropinOverlay.hidden{display:none;}
  .di-card{width:100%; max-width:420px; background:rgba(13,42,56,.95); border:1px solid rgba(45,212,191,.35);
    border-radius:22px; padding:26px 22px; text-align:center; box-shadow:0 0 60px rgba(45,212,191,.18);}
  .di-title{font-size:22px; font-weight:800; margin-bottom:6px;}
  .di-sub{color:#9db8b3; font-size:14px; margin-bottom:14px;}
  .di-count{font-size:64px; font-weight:800; color:#2DD4BF; margin:8px 0 16px;}
  .di-btns{display:flex; gap:10px;}
  .di-btns button{flex:1; border:none; border-radius:14px; padding:15px; font-size:16px; font-weight:800; cursor:pointer; font-family:inherit;}
  #diAnswer{background:linear-gradient(135deg,#2DD4BF,#34D399); color:#04121a;}
  #diDecline{background:rgba(240,85,58,.16); color:#F0553A; border:1px solid rgba(240,85,58,.5);}
  #diRemote{width:100%; border-radius:16px; background:#000; margin-top:6px; max-height:46vh; object-fit:cover;}
  #diLocal{width:110px; height:146px; border-radius:12px; background:#000; object-fit:cover;
    position:absolute; right:26px; bottom:96px; border:1px solid rgba(45,212,191,.4);}
  .di-wrap{position:relative;}
  #diEnd{margin-top:14px; width:100%; border:none; border-radius:14px; padding:15px;
    font-size:16px; font-weight:800; cursor:pointer; font-family:inherit;
    background:linear-gradient(135deg,#F0553A,#F5B142); color:#04121a;}
  #diState{color:#9db8b3; font-size:14px; margin-top:10px; min-height:20px;}
  /* text messages */
  #dmOverlay{position:fixed; inset:0; z-index:9998; display:flex; align-items:flex-end; justify-content:center;
    background:rgba(2,9,13,.6);
    padding:max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));}
  #dmOverlay.hidden{display:none;}
  .dm-card{width:100%; max-width:420px; margin:0 auto; height:min(70vh,560px); display:flex; flex-direction:column;
    background:rgba(13,42,56,.97); border:1px solid rgba(45,212,191,.35); border-radius:20px; overflow:hidden;}
  /* settings */
  #setOverlay{position:fixed; inset:0; z-index:9998; display:flex; align-items:center; justify-content:center;
    background:rgba(2,9,13,.7);
    padding:max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));}
  #setOverlay.hidden{display:none;}
  .set-card{width:100%; max-width:360px; margin:0 auto; background:rgba(13,42,56,.97);
    border:1px solid rgba(45,212,191,.35); border-radius:20px; padding:20px;}
  .set-card .dm-head{padding:0 0 6px; border:none;}
  .set-row{margin:18px 0;}
  .set-row > label{display:block; font-weight:700; margin-bottom:10px; font-size:16px;}
  #setScale{width:100%; accent-color:#2DD4BF;}
  #setScaleVal{color:#2DD4BF;}
  .set-avatar{display:flex; align-items:center; gap:14px;}
  #setAvatarImg{width:76px; height:76px; border-radius:50%; border:2px solid rgba(45,212,191,.5);
    object-fit:cover; background:#06222e; flex:none;}
  #setAvatarBtn{border:none; border-radius:12px; padding:12px 16px; font-size:15px; font-weight:800;
    cursor:pointer; font-family:inherit; background:linear-gradient(135deg,#2DD4BF,#34D399); color:#04121a;}
  #setAvatarMsg{color:#9db8b3; font-size:13px; margin-top:8px; min-height:18px;}
  .tava{width:34px; height:34px; border-radius:50%; object-fit:cover; flex:none;
    border:1px solid rgba(45,212,191,.4); background:#06222e;}
  .dm-head{display:flex; align-items:center; justify-content:space-between; padding:14px 16px;
    border-bottom:1px solid rgba(45,212,191,.18); font-weight:800; font-size:17px;}
  .dm-head button{background:none; border:none; color:#9db8b3; font-size:18px; cursor:pointer; padding:6px;}
  .dm-msgs{flex:1; overflow-y:auto; padding:14px 12px; display:flex; flex-direction:column; gap:8px;}
  .dm-msg{max-width:78%; padding:10px 14px; border-radius:16px; font-size:15px; line-height:1.4;
    word-wrap:break-word; white-space:pre-wrap;}
  .dm-msg.me{align-self:flex-end; background:linear-gradient(135deg,#2DD4BF,#34D399); color:#04121a;
    border-bottom-right-radius:6px;}
  .dm-msg.them{align-self:flex-start; background:rgba(139,124,246,.22); border:1px solid rgba(139,124,246,.4);
    border-bottom-left-radius:6px;}
  .dm-emoji{display:flex; flex-wrap:wrap; gap:2px; padding:8px 10px; border-top:1px solid rgba(45,212,191,.18);
    max-height:120px; overflow-y:auto;}
  .dm-emoji.hidden{display:none;}
  .dm-emoji button{background:none; border:none; font-size:26px; padding:6px; cursor:pointer;}
  .dm-input{display:flex; gap:8px; padding:10px; border-top:1px solid rgba(45,212,191,.18); align-items:center;}
  .dm-input input{flex:1; border:1px solid rgba(45,212,191,.25); border-radius:12px; padding:12px;
    background:rgba(4,18,26,.7); color:#e8f6f3; font-size:15px; font-family:inherit;}
  .dm-input input:focus{outline:none; border-color:#2DD4BF;}
  .dm-input button{border:none; border-radius:12px; width:46px; height:46px; font-size:20px; cursor:pointer;
    background:rgba(45,212,191,.14); flex:none;}
  #dmSend{background:linear-gradient(135deg,#2DD4BF,#34D399); color:#04121a;}
  #dmBtn{position:relative;}
  #dmBtn.has-unread::after{content:""; position:absolute; top:6px; right:6px;
    width:10px; height:10px; border-radius:50%; background:#F0553A; border:2px solid #06222e;}
  #dmCount{position:absolute; top:2px; right:2px; min-width:20px; height:20px; border-radius:10px;
    background:#F0553A; color:#fff; font-size:12px; font-weight:800; display:none;
    align-items:center; justify-content:center; padding:0 5px; border:2px solid #06222e;}
  #dmCount.show{display:flex;}
  /* inbox: contact tabs */
  .dm-tabs{display:flex; gap:8px; padding:10px 12px 0;}
  .dm-tab{flex:1; border:1px solid rgba(45,212,191,.25); background:rgba(4,18,26,.5); color:#e8f6f3;
    border-radius:12px; padding:10px; font-size:15px; font-weight:700; cursor:pointer; font-family:inherit;
    position:relative;}
  .dm-tab.sel{background:linear-gradient(135deg,rgba(45,212,191,.25),rgba(139,124,246,.25));
    border-color:#2DD4BF;}
  .dm-tab .tdot{position:absolute; top:6px; right:8px; width:9px; height:9px; border-radius:50%;
    background:#F0553A; display:none;}
  .dm-tab .tdot.show{display:block;}
  .dm-tab .tlabel{display:flex; flex-direction:column; gap:2px;}
  .dm-tab .ttop{display:flex; align-items:center; gap:8px; font-weight:700;}
  .dm-tab .tsub{font-size:11px; font-weight:600; color:#9db8b3;}
  /* inbox: file cards */
  .dm-file{align-self:flex-start; max-width:82%; background:rgba(139,124,246,.14);
    border:1px solid rgba(139,124,246,.45); border-radius:14px; padding:10px 12px; font-size:14px;}
  .dm-file.me{align-self:flex-end; background:rgba(45,212,191,.12); border-color:rgba(45,212,191,.45);}
  .dm-file .fname{font-weight:700; word-break:break-all; margin-bottom:2px;}
  .dm-file .fsize{color:#9db8b3; font-size:12px; margin-bottom:8px;}
  .dm-file a{display:inline-block; background:linear-gradient(135deg,#2DD4BF,#34D399); color:#04121a;
    font-weight:800; border-radius:10px; padding:8px 16px; text-decoration:none; font-size:14px;}
  /* screen-edge flash on new message */
  #msgFlash{position:fixed; inset:0; z-index:9996; pointer-events:none; opacity:0;
    box-shadow:inset 0 0 0 7px rgba(45,212,191,.95), inset 0 0 70px rgba(139,124,246,.8);}
  #msgFlash.go{animation:msgflash 3.2s ease-out;}
  @keyframes msgflash{0%{opacity:0;}12%{opacity:1;}70%{opacity:1;}100%{opacity:0;}}
