/* TNT Studio — Chat Popup v3 CSS */
.cp-container{position:fixed;bottom:0;right:0;z-index:99990;pointer-events:none}
.cp-popup{position:fixed;width:420px;height:560px;display:flex;flex-direction:column;background:rgba(12,12,20,.98);border:1px solid rgba(255,107,26,.15);border-radius:14px;box-shadow:0 12px 48px rgba(0,0,0,.7),0 4px 16px rgba(0,0,0,.5);overflow:hidden;pointer-events:all;animation:cpUp .2s ease-out;backdrop-filter:blur(12px)}
@keyframes cpUp{from{opacity:0;transform:translateY(16px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:480px){.cp-popup{width:calc(100vw - 16px);height:60vh;right:8px!important;bottom:70px!important;border-radius:16px}}

/* Header */
.cp-header{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;background:rgba(15,15,28,.98);border-bottom:1px solid rgba(255,107,26,.12);flex-shrink:0;cursor:default}
.cp-h-left{display:flex;align-items:center;gap:10px;min-width:0}
.cp-h-av{position:relative;flex-shrink:0;width:40px;height:40px}
.cp-h-info{min-width:0}
.cp-h-name-row{display:flex;align-items:center;gap:4px}
.cp-h-name{font-size:14px;font-weight:700;color:rgba(255,255,255,.92);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cp-badge{color:#ff6b1a;font-size:11px;font-weight:700}
.cp-h-status{font-size:10px;margin-top:1px}
.cp-online{color:#22c55e;font-weight:500}
.cp-offline{color:rgba(255,255,255,.35)}
.cp-h-btns{display:flex;gap:2px}
.cp-hb{width:28px;height:28px;display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:rgba(255,255,255,.4);border-radius:6px;cursor:pointer;transition:all .12s}
.cp-hb:hover{background:rgba(255,255,255,.08);color:rgba(255,255,255,.8)}
.cp-hb-close:hover{background:rgba(239,68,68,.12);color:#ef4444}
.cp-dot{position:absolute;bottom:0;right:0;width:10px;height:10px;border-radius:50%;border:2px solid rgba(12,12,20,.98)}
.cp-dot-on{background:#22c55e}
.cp-dot-off{background:rgba(255,255,255,.2)}
.cp-verified{margin-left:2px}

/* Body — scrollable flex container (messages pin bottom, scrolls up) */
.cp-body{flex:1;overflow-y:scroll;padding:8px 10px;min-height:0;display:flex;flex-direction:column;scrollbar-width:thin;scrollbar-color:rgba(255,107,26,.5) rgba(255,255,255,.03)}
.cp-body::-webkit-scrollbar{width:6px}
.cp-body::-webkit-scrollbar-track{background:rgba(255,255,255,.03);border-radius:3px}
.cp-body::-webkit-scrollbar-thumb{background:rgba(255,107,26,.5);border-radius:3px}
.cp-body::-webkit-scrollbar-thumb:hover{background:rgba(255,107,26,.8)}
.cp-messages{display:flex;flex-direction:column;gap:4px;margin-top:auto}
.cp-empty{text-align:center;color:rgba(255,255,255,.3);padding:40px 12px;align-self:center}
.cp-empty-icon{font-size:32px;margin-bottom:8px}
.cp-empty-text{font-size:12px}

/* Date separator */
.cp-date-sep{text-align:center;margin:8px 0;font-size:10px;color:rgba(255,255,255,.3)}
.cp-date-sep span{background:rgba(255,255,255,.04);padding:2px 10px;border-radius:8px}

/* Messages */
.cp-msg{max-width:80%;padding:8px 11px;border-radius:14px;font-size:13px;line-height:1.4;word-break:break-word;animation:cpMsgIn .12s ease-out;position:relative}
@keyframes cpMsgIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
.cp-out{align-self:flex-end;background:#ff6b1a;color:#fff;border-bottom-right-radius:4px}
.cp-in{align-self:flex-start;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.05);color:rgba(255,255,255,.9);border-bottom-left-radius:4px}
.cp-deleted{align-self:center;background:none;border:none;padding:4px;opacity:.5}
.cp-del-text{font-size:11px;color:rgba(255,255,255,.4);font-style:italic}
.cp-mt{font-size:13px;line-height:1.4;word-wrap:break-word}
.cp-mm{display:flex;align-items:center;gap:3px;margin-top:3px}
.cp-time{font-size:9.5px;color:rgba(255,255,255,.35)}
.cp-out .cp-time{color:rgba(255,255,255,.55)}
.cp-edited{font-size:9px;color:rgba(255,255,255,.35);font-style:italic}
.cp-st{font-size:9px}
.cp-sending{color:rgba(255,255,255,.3)}
.cp-sent{color:rgba(255,255,255,.5)}
.cp-read{color:#22c55e}
.cp-fail{color:#ef4444;font-weight:700}
.cp-pin{position:absolute;top:2px;right:4px;font-size:9px}
.cp-fwd{font-size:9.5px;color:rgba(255,255,255,.4);margin-bottom:3px;font-style:italic}

/* Reply reference */
.cp-reply-ref{font-size:10.5px;color:rgba(255,255,255,.45);padding:3px 8px;margin-bottom:4px;border-left:2px solid rgba(255,107,26,.5);background:rgba(255,255,255,.03);border-radius:0 4px 4px 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cp-out .cp-reply-ref{border-left-color:rgba(255,255,255,.4);background:rgba(255,255,255,.08)}

/* Media */
.cp-media-img{max-width:100%;max-height:180px;border-radius:8px;margin-bottom:4px;object-fit:cover;cursor:pointer;transition:transform .15s}
.cp-media-img:hover{transform:scale(1.02)}
.cp-media-vid{max-width:100%;max-height:200px;border-radius:8px;margin-bottom:4px;background:#000}

/* Voice message */
.cp-voice{display:flex;align-items:center;gap:8px;padding:4px 0}
.cp-voice-play{width:30px;height:30px;border-radius:50%;border:none;background:rgba(255,255,255,.12);color:#fff;font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .1s}
.cp-voice-play:hover{background:rgba(255,107,26,.3)}
.cp-voice-wave{display:flex;align-items:center;gap:2px;flex:1;height:20px}
.cp-voice-wave span{width:3px;height:8px;background:rgba(255,255,255,.3);border-radius:2px;animation:cpWave 1.2s infinite ease-in-out}
.cp-voice-wave span:nth-child(2){animation-delay:.1s;height:14px}
.cp-voice-wave span:nth-child(3){animation-delay:.2s;height:10px}
.cp-voice-wave span:nth-child(4){animation-delay:.3s;height:18px}
.cp-voice-wave span:nth-child(5){animation-delay:.4s;height:12px}
.cp-voice-wave span:nth-child(6){animation-delay:.5s;height:16px}
.cp-voice-wave span:nth-child(7){animation-delay:.6s;height:8px}
.cp-voice-wave span:nth-child(8){animation-delay:.7s;height:12px}
@keyframes cpWave{0%,100%{transform:scaleY(1)}50%{transform:scaleY(1.8)}}
.cp-voice-dur{font-size:10px;color:rgba(255,255,255,.4);white-space:nowrap}

/* Call message */
.cp-call{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:10px;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.04)}
.cp-call-left{flex-shrink:0}
.cp-call-icon{font-size:18px}
.cp-call-info{flex:1;display:flex;flex-direction:column;gap:1px}
.cp-call-label{font-size:12px;font-weight:600}
.cp-call-meta{font-size:10px;color:rgba(255,255,255,.35)}
.cp-call-back{width:28px;height:28px;border-radius:50%;border:none;background:rgba(34,197,94,.12);color:#22c55e;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .12s;flex-shrink:0}
.cp-call-back:hover{background:rgba(34,197,94,.25);transform:scale(1.1)}
.cp-out .cp-call{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.1)}
.cp-out .cp-call-meta{color:rgba(255,255,255,.5)}
.cp-out .cp-call-back{background:rgba(255,255,255,.15);color:#fff}

/* Story reply */
.cp-story-reply{border-radius:8px;overflow:hidden}
.cp-story-label{font-size:10px;color:rgba(255,255,255,.5);margin-bottom:4px}

/* Reel share */
.cp-reel-share{display:flex;align-items:center;gap:8px;padding:6px 0}
.cp-reel-icon{font-size:20px}
.cp-reel-info{display:flex;flex-direction:column;gap:2px}
.cp-reel-label{font-size:11px;color:rgba(255,255,255,.5)}
.cp-reel-link{font-size:12px;color:#ff6b1a;text-decoration:none;font-weight:600}
.cp-reel-link:hover{text-decoration:underline}

/* File */
.cp-file{display:flex;align-items:center;gap:6px;padding:4px 0}
.cp-file-icon{font-size:16px}
.cp-file-name{font-size:12px;color:#ff6b1a;text-decoration:none}
.cp-file-name:hover{text-decoration:underline}

/* Link */
.cp-link{color:#60a5fa;text-decoration:none;word-break:break-all}
.cp-link:hover{text-decoration:underline}
.cp-out .cp-link{color:rgba(255,255,255,.9);text-decoration:underline}

/* Reactions */
.cp-rx{display:flex;gap:3px;margin-top:3px;flex-wrap:wrap}
.cp-rx-item{font-size:11px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.06);border-radius:10px;padding:1px 5px;cursor:default}

/* Typing indicator */
.cp-typing{display:flex;align-items:center;gap:6px;padding:4px 8px;font-size:11px;color:rgba(255,255,255,.4)}
.cp-typing-dots{display:flex;gap:3px}
.cp-typing-dots i{width:5px;height:5px;border-radius:50%;background:rgba(255,107,26,.6);animation:cpDot 1.4s infinite}
.cp-typing-dots i:nth-child(2){animation-delay:.2s}
.cp-typing-dots i:nth-child(3){animation-delay:.4s}
@keyframes cpDot{0%,100%{opacity:.3;transform:scale(.8)}50%{opacity:1;transform:scale(1.2)}}

/* Reply bar */
.cp-reply-bar{display:flex;align-items:center;justify-content:space-between;padding:6px 10px;border-top:1px solid rgba(255,255,255,.06);background:rgba(15,15,28,.98);flex-shrink:0}
.cp-reply-preview{display:flex;align-items:center;gap:6px;min-width:0;flex:1}
.cp-rp-label{font-size:10px;color:#ff6b1a;font-weight:600;white-space:nowrap}
.cp-rp-text{font-size:11px;color:rgba(255,255,255,.5);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cp-rp-x{width:20px;height:20px;border:none;background:rgba(255,255,255,.06);color:rgba(255,255,255,.5);border-radius:50%;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center}
.cp-rp-x:hover{background:rgba(239,68,68,.15);color:#ef4444}

/* Emoji tray */
.cp-emoji-tray{display:flex;flex-wrap:wrap;gap:2px;padding:8px;border-top:1px solid rgba(255,255,255,.06);background:rgba(15,15,28,.98);max-height:100px;overflow-y:auto;flex-shrink:0}
.cp-em{width:30px;height:30px;display:flex;align-items:center;justify-content:center;border:none;background:transparent;font-size:17px;cursor:pointer;border-radius:6px;transition:background .1s}
.cp-em:hover{background:rgba(255,255,255,.08);transform:scale(1.15)}

/* Compose */
.cp-compose{display:flex;align-items:flex-end;gap:4px;padding:8px 10px;border-top:1px solid rgba(255,255,255,.06);background:rgba(12,12,20,.98);flex-shrink:0}
.cp-cb{width:30px;height:30px;display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:rgba(255,255,255,.4);border-radius:50%;cursor:pointer;font-size:14px;transition:all .1s;flex-shrink:0}
.cp-cb:hover{color:rgba(255,255,255,.7);background:rgba(255,255,255,.06)}
.cp-input{flex:1;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.06);border-radius:18px;padding:7px 14px;font-size:12.5px;color:rgba(255,255,255,.9);resize:none;outline:none;min-height:32px;max-height:80px;line-height:1.35;transition:border-color .12s;font-family:inherit}
.cp-input:focus{border-color:rgba(255,107,26,.4)}
.cp-input::placeholder{color:rgba(255,255,255,.3)}
.cp-send{width:40px;height:40px;border-radius:50%;border:none;background:linear-gradient(135deg,#ff6b1a,#e8440a);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform .1s,box-shadow .1s;box-shadow:0 2px 8px rgba(255,107,26,.3);flex-shrink:0}
.cp-send:hover{transform:scale(1.08);box-shadow:0 4px 12px rgba(255,107,26,.4)}
.cp-send:active{transform:scale(.92)}

/* Context menu */
.cp-ctx{position:absolute;z-index:100}
.cp-ctx-menu{background:rgba(20,20,35,.98);border:1px solid rgba(255,255,255,.08);border-radius:10px;padding:4px;box-shadow:0 8px 32px rgba(0,0,0,.6);min-width:160px;backdrop-filter:blur(12px)}
.cp-ctx-menu button{display:flex;align-items:center;gap:8px;width:100%;padding:8px 12px;border:none;background:transparent;color:rgba(255,255,255,.8);font-size:12px;cursor:pointer;border-radius:6px;text-align:left;transition:background .1s}
.cp-ctx-menu button:hover{background:rgba(255,107,26,.1);color:#ff6b1a}

/* Reaction picker */
.cp-react-pick{position:absolute;top:-36px;left:50%;transform:translateX(-50%);display:flex;gap:2px;background:rgba(20,20,35,.98);border:1px solid rgba(255,255,255,.08);border-radius:20px;padding:4px 6px;box-shadow:0 4px 16px rgba(0,0,0,.5);z-index:10;animation:cpUp .15s ease-out}
.cp-react-pick button{width:28px;height:28px;border:none;background:transparent;font-size:16px;cursor:pointer;border-radius:50%;transition:transform .1s}
.cp-react-pick button:hover{transform:scale(1.3);background:rgba(255,255,255,.06)}

/* Bubble (minimized) */
.cp-bubble{position:fixed;pointer-events:all;cursor:pointer;animation:cpUp .2s ease-out}
.cp-bub-av{position:relative;width:48px;height:48px;border-radius:50%;overflow:visible}
.cp-bub-av img,.cp-bub-av .cp-av-init{border-radius:50%;border:2px solid rgba(255,107,26,.3);transition:border-color .15s,transform .15s}
.cp-bubble:hover .cp-bub-av img,.cp-bubble:hover .cp-bub-av .cp-av-init{border-color:#ff6b1a;transform:scale(1.05)}
.cp-bub-x{position:absolute;top:-4px;right:-4px;width:18px;height:18px;border-radius:50%;border:none;background:rgba(30,30,50,.9);color:rgba(255,255,255,.6);font-size:11px;cursor:pointer;display:none;align-items:center;justify-content:center;z-index:2}
.cp-bubble:hover .cp-bub-x{display:flex}
.cp-bub-x:hover{background:#ef4444;color:#fff}
.cp-has-new .cp-bub-av::after{content:'';position:absolute;top:-2px;right:-2px;width:12px;height:12px;background:#ff6b1a;border-radius:50%;border:2px solid rgba(12,12,20,.98);animation:cpPulse 1.5s infinite}
@keyframes cpPulse{0%,100%{transform:scale(1)}50%{transform:scale(1.2)}}

/* Image viewer */
.cp-viewer{position:fixed;inset:0;z-index:999909;display:flex;align-items:center;justify-content:center;animation:cpFadeIn .15s ease-out}
@keyframes cpFadeIn{from{opacity:0}to{opacity:1}}
.cp-viewer-bg{position:absolute;inset:0;background:rgba(0,0,0,.85);backdrop-filter:blur(8px)}
.cp-viewer-img{position:relative;max-width:90vw;max-height:90vh;border-radius:8px;box-shadow:0 12px 48px rgba(0,0,0,.5)}
.cp-viewer-x{position:absolute;top:16px;right:16px;width:36px;height:36px;border-radius:50%;border:none;background:rgba(255,255,255,.1);color:#fff;font-size:20px;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:1}
.cp-viewer-x:hover{background:rgba(239,68,68,.3)}

/* Avatar */
.cp-av-img{border-radius:50%;object-fit:cover}
.cp-av-init{border-radius:50%;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#ff6b1a,#e8440a);color:#fff;font-weight:700}

/* Drag over state */
.cp-dragover{border-color:rgba(255,107,26,.5)!important;background:rgba(255,107,26,.03)!important}
.cp-dragover::after{content:'Drop file here';position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(12,12,20,.8);color:#ff6b1a;font-size:14px;font-weight:600;z-index:50;border-radius:12px}
