/* Embedded conversations stay independent of the main page layout. */
.private-surface-embedded #communityPage.chat-popout main,.private-surface-embedded #communityPage.chat-popout .layout,.private-surface-embedded #communityPage.chat-popout .conversation-column,.private-surface-embedded #communityPage.chat-popout .chat{display:block!important;visibility:visible!important;width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;margin:0!important;padding:0!important;overflow:hidden!important}
.private-surface-embedded #communityPage.chat-popout #privatePanel{display:flex!important;visibility:visible!important;height:100dvh!important;max-height:none!important;min-height:0!important}
.private-surface-embedded #communityPage.chat-popout #dmWindowContent{display:flex!important;flex:1 1 auto;min-height:0;overflow:auto}
#dmChatDock .dm-chat-window{position:relative}
#dmChatDock .dm-surface-status{position:absolute;inset:0 0 auto;z-index:2;display:flex;align-items:center;gap:8px;padding:12px;background:#121b28;color:#dce7f5;font-size:13px;border-bottom:1px solid #314159}
#dmChatDock .dm-surface-status span{flex:1}
#dmChatDock .dm-surface-status button{padding:6px 10px}
#dmChatDock .dm-surface-status[hidden]{display:none!important}

/* Keep the message history scrollable and the composer inside the window. */
.private-surface-embedded #communityPage.chat-popout #privatePanel .dm-window-bar{flex:0 0 auto!important}
.private-surface-embedded #communityPage.chat-popout #dmWindowContent{flex-direction:column!important;box-sizing:border-box!important;overflow:hidden!important}
.private-surface-embedded #communityPage.chat-popout #dmMessages:not([hidden]){flex:1 1 0!important;min-height:0!important;overflow:auto!important}
.private-surface-embedded #communityPage.chat-popout #dmForm:not([hidden]){display:flex!important;flex:0 0 auto!important;min-height:44px;position:relative!important;visibility:visible!important}
.private-surface-embedded #communityPage.chat-popout #dmForm[hidden]{display:none!important}
.private-surface-embedded #communityPage.chat-popout #dmContacts,.private-surface-embedded #communityPage.chat-popout #dmHeading,.private-surface-embedded #communityPage.chat-popout #dmNotice{flex:0 0 auto!important}

#dmChatDock .dm-surface-status button{font:inherit;color:#dce7f5;background:#1b2a3d;border:1px solid #3a506b;border-radius:7px;cursor:pointer}

/* Restore the original private conversation palette. */
.private-surface-embedded #communityPage #privatePanel,
.private-surface-embedded #communityPage #dmWindowContent,
.private-surface-embedded #communityPage #dmMessages{background:#0f1722!important;color:#e8edf5!important}
.private-surface-embedded #communityPage #privatePanel .dm-window-bar{background:#121b28!important}

/* Match the compact Public chat composer and message actions. */
#communityPage #privatePanel #dmForm #dmEmoteToggle{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;flex:0 0 36px!important;width:36px!important;height:40px!important;min-width:36px!important;min-height:0!important;padding:7px!important;margin:0!important}
#communityPage #privatePanel #dmForm #dmEmoteToggle svg{width:18px!important;height:18px!important}
#communityPage #privatePanel #dmMessages :is(.message-action-bar>button,.own-message-controls>button,.message-reply,.reaction-add,.dm-delete){background:transparent!important;color:#8996ab!important;border:0!important;box-shadow:none!important}
#communityPage #privatePanel #dmMessages :is(.message-action-bar>button,.own-message-controls>button,.message-reply,.reaction-add,.dm-delete):is(:hover,:focus-visible){background:#263244!important;color:#e7edf3!important}

/* Conversation list controls use the same muted palette as chat. */
#communityPage #privatePanel #dmContacts .dm-contact-row{display:flex;align-items:center;gap:6px;margin:6px 0;min-width:0}
#communityPage #privatePanel #dmContacts .dm-contact{display:flex;align-items:center;gap:9px;flex:1 1 auto;min-width:0;width:0;box-sizing:border-box;padding:10px;margin:0;background:#121b28!important;color:#e8edf5!important;border:1px solid #28364a;border-radius:8px;text-align:left}
#communityPage #privatePanel #dmContacts .dm-avatar{display:flex;align-items:center;justify-content:center;flex:0 0 30px;width:30px;height:30px;border-radius:50%;background:#172231;color:#c6d2e2}
#communityPage #privatePanel #dmContacts .dm-preview{display:flex;flex:1;min-width:0;flex-direction:column;gap:2px}
#communityPage #privatePanel #dmContacts .dm-preview strong,#communityPage #privatePanel #dmContacts .dm-preview small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#communityPage #privatePanel #dmContacts .dm-preview small,#communityPage #privatePanel #dmContacts time{font-size:11px;color:#9caec5}
#communityPage #privatePanel #dmContacts .dm-conversation-close{display:inline-flex;align-items:center;justify-content:center;flex:0 0 28px;width:28px;height:28px;padding:5px;margin:0;background:transparent!important;color:#8996ab!important;border:0;border-radius:6px}
#communityPage #privatePanel #dmContacts :is(.dm-contact,.dm-conversation-close):is(:hover,:focus-visible){background:#263244!important;color:#e7edf3!important}

/* A continuous hit area connects each bubble to its tools above it. */
#communityPage #privatePanel #dmMessages>.dm-bubble::before{content:"";position:absolute;right:0;top:-28px;height:29px;width:max(100%,160px);background:transparent;pointer-events:none}
#communityPage #privatePanel #dmMessages>.dm-bubble.dm-actions-engaged :is(.message-action-bar,.message-action-bar>button,.own-message-controls,.reaction-add,.message-reply,.dm-delete){opacity:1!important;pointer-events:auto!important}
#communityPage #privatePanel #dmMessages :is(.own-message-controls,.message-action-bar,.message-reply){z-index:6}
#communityPage #privatePanel #dmMessages :is(.own-message-controls>button,.message-action-bar>button,.reaction-add,.message-reply,.dm-delete){touch-action:manipulation}

#communityPage #privatePanel #dmMessages>.dm-bubble:is(:hover,:focus-within,.dm-actions-engaged)::before{pointer-events:auto}
