/* Non-modal chat dock: only the compact window receives pointer input. */
.chat-shell-overlay.chat-popup {
 position:fixed !important; inset:auto !important; inset-inline-end:24px !important;
 bottom:0 !important; width:min(390px,calc(100vw - 24px)) !important;
 height:min(580px,var(--chat-popup-room,calc(100dvh - 96px))) !important;
 min-height:0 !important; display:block !important; background:transparent !important;
 backdrop-filter:none !important; -webkit-backdrop-filter:none !important; pointer-events:none;
 z-index:2600;
}
.chat-shell-overlay.chat-popup .chat-shell {
 width:100% !important; height:100% !important; min-height:0; position:relative;
 pointer-events:auto; border:1px solid var(--border-color,var(--line)); border-bottom:0;
 border-radius:14px 14px 0 0; overflow:hidden; transform:none !important;
 box-shadow:0 4px 30px rgba(0,0,0,.3);
}
.chat-popup .chat-shell-head { gap:4px; padding:6px; min-height:52px !important; flex:none; }
.chat-popup .chat-shell-peer {order:0; min-width:0; flex:1; gap:6px;}
.chat-popup .chat-shell-peer img,.chat-popup .inbox-group-avatar {width:30px;height:30px;flex:0 0 30px;}
.chat-popup .chat-shell-peer div {min-width:0;}
.chat-popup .chat-shell-peer b,.chat-popup .chat-shell-peer small {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.chat-popup .chat-follow-btn {display:none;}
.chat-popup .chat-options-btn {order:1;}
.chat-popup [data-chat-minimize] {order:2;}
.chat-popup [data-chat-full] {order:3;}
.chat-popup [data-chat-close] {order:4;}
.chat-popup .chat-popup-control,.chat-popup .chat-options-btn,.chat-popup .chat-shell-back {
 appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 36px;
 min-width:36px;min-height:44px;width:36px;height:44px;padding:0;border:0;border-radius:8px;
 background:transparent;color:var(--text-primary,var(--text));font-size:22px;text-decoration:none;cursor:pointer;
}
.chat-popup-control[hidden] {display:none !important;}
.chat-popup-control:disabled {opacity:.4;cursor:default;}
.chat-popup-control:focus-visible {outline:2px solid var(--btn-bg-primary);outline-offset:-3px;}
.chat-popup .active-chat-messages {min-height:44px;flex:1 1 0;overscroll-behavior:contain;}
.chat-popup .chat-compose {flex-shrink:0;max-height:65%;overflow-y:auto;overscroll-behavior:contain;}
.chat-popup .chat-options-panel {position:absolute;inset:0;}
.chat-popup .chat-options-sheet {max-height:100%;width:100%;}
.chat-shell-overlay.chat-popup.is-minimized {height:56px !important;}
.chat-popup.is-minimized .chat-shell > :not(.chat-shell-head) {display:none !important;}
.chat-popup.is-minimized .chat-shell-head {height:55px;}
@media(max-width:768px){
 .chat-shell-overlay.chat-popup {inset-inline-end:8px !important;width:calc(100vw - 16px) !important;
 bottom:max(var(--chat-popup-keyboard,0px),calc(76px + env(safe-area-inset-bottom))) !important;
 height:min(560px,var(--chat-popup-room,calc(100dvh - 96px))) !important;}
 .chat-popup .chat-shell-peer small {display:none;}
 .chat-popup .chat-shell-head {padding:4px;}
 .chat-popup .chat-popup-control,.chat-popup .chat-options-btn,.chat-popup .chat-shell-back {min-width:36px;flex-basis:36px;}
}
@media(prefers-reduced-motion:reduce){.chat-popup,.chat-popup .chat-shell {transition:none !important;}}

@media(max-width:768px){
 .chaabi-preview-popover[data-preview-type="messages"]{display:grid !important;max-height:calc(100dvh - 100px);}
 .chaabi-preview-popover[data-preview-type="messages"] .chaabi-preview-list{min-height:0;max-height:none;}
}
