/* Finestre private flottanti: in basso a destra su computer, pannello dal basso su telefono. Colori da theme.css. */
.dm-dock { position: fixed; right: 1rem; bottom: 0; z-index: 1040; display: flex; flex-direction: row-reverse; align-items: flex-end; gap: .75rem; pointer-events: none; }
.dm-win { pointer-events: auto; width: 340px; height: min(480px, calc(100vh - 5rem)); display: flex; flex-direction: column; background: var(--wc-chat-bg); color: var(--wc-text); border: 1px solid var(--wc-border); border-bottom: 0; border-radius: var(--wc-radius) var(--wc-radius) 0 0; box-shadow: 0 12px 40px rgba(0, 0, 0, .18); overflow: hidden; }
.dm-win.minimized { height: auto; width: 240px; }
.dm-win.floating { position: fixed; resize: both; border-bottom: 1px solid var(--wc-border); border-radius: var(--wc-radius); min-width: 270px; min-height: 260px; box-shadow: 0 16px 48px rgba(0, 0, 0, .22); }
.dm-win.floating .dm-win-head { cursor: move; touch-action: none; }
.dm-win.floating .dm-win-head .win-btn { cursor: pointer; }
.dm-win.minimized .dm-win-body, .dm-win.minimized .dm-win-composer, .dm-win.minimized .dm-win-note { display: none; }
.dm-win-head { display: flex; align-items: center; gap: .5rem; padding: .5rem .5rem .5rem .65rem; background: var(--wc-surface); border-bottom: 1px solid var(--wc-border); cursor: pointer; user-select: none; }
.dm-win.flash .dm-win-head { background: var(--wc-accent-soft); }
.dm-win-title { flex: 1; min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-win-title .conv-status { font-weight: 500; font-size: .72rem; line-height: 1.15; }
.dm-win-actions { display: flex; gap: 2px; flex-shrink: 0; }
.win-btn { width: 1.9rem; height: 1.9rem; border: 0; border-radius: 10px; background: none; color: var(--wc-muted); display: inline-flex; align-items: center; justify-content: center; }
.win-btn:hover, .win-btn:focus-visible { background: var(--wc-accent-soft); color: var(--wc-accent-text); }
.win-btn .wc-icon { width: 1.05rem; height: 1.05rem; }
.dm-win-body { flex: 1; overflow-y: auto; padding: .4rem .65rem .6rem; background: var(--wc-chat-bg); overscroll-behavior: contain; }
.dm-win-note { font-size: .78rem; color: var(--wc-muted); padding: .3rem .7rem; border-top: 1px solid var(--wc-border); background: var(--wc-surface); }
.dm-win-composer { display: flex; gap: .35rem; align-items: flex-end; padding: .45rem .5rem; background: var(--wc-surface); border-top: 1px solid var(--wc-border); }
.dm-win-composer textarea { resize: none; max-height: 6rem; min-height: 2.4rem; overflow-y: hidden; border-radius: 20px; padding: .45rem 2.6rem .45rem .85rem; background: var(--wc-surface-2); border-color: transparent; line-height: 1.35; font-size: .92rem; }
.dm-win-composer textarea:focus { background: var(--wc-surface); }
.dm-win-composer .send-btn, .dm-win-composer .attach-btn { width: 2.4rem; height: 2.4rem; }
.dm-win-composer .emoji-btn { width: 2rem; height: 2rem; bottom: .2rem; }
.dm-win .pin-bar { padding: .35rem .7rem; font-size: .78rem; }
.dm-win .typing-line { padding: 0 .7rem; }
.dm-win .unread-pill { flex: 0 0 auto; }
@media (max-width: 991.98px) {
  .dm-dock { left: 0; right: 0; gap: 0; }
  .dm-win { width: 100%; height: 85vh; height: 85dvh; border-radius: 22px 22px 0 0; }
  .dm-win.minimized { display: none; }
  .dm-win-composer { padding-bottom: max(.45rem, env(safe-area-inset-bottom)); }
}
