/* A bounded messenger, independent of document length and message count. */
body:is(.private-chat-active,.community-active){overflow:hidden}
@media(min-width:901px){
 body:is(.private-chat-active,.community-active)>header{position:fixed;inset:var(--messenger-top,0px) 0 auto;box-sizing:border-box;z-index:70}
 body:is(.private-chat-active,.community-active)>#primary-navigation{position:fixed;inset:calc(var(--messenger-top,0px) + var(--messenger-header)) 0 auto;box-sizing:border-box;z-index:70}
 body:is(.private-chat-active,.community-active) #mainContainer{position:fixed;top:calc(var(--messenger-top,0px) + var(--messenger-header) + var(--messenger-nav));bottom:auto;height:calc(var(--messenger-height,100dvh) - var(--messenger-header) - var(--messenger-nav));left:0;right:0;min-height:0;overflow:hidden}
 body:is(.private-chat-active,.community-active) #navLoggedIn{max-height:100%;overflow:auto;box-sizing:border-box}
 body:is(.private-chat-active,.community-active) main{position:relative;min-height:0;min-width:0;padding:12px;display:flex;flex-direction:column;overflow:hidden}
 body:is(.private-chat-active,.community-active) #photo-verification-reminder{display:none}
 body:is(.private-chat-active,.community-active) main>footer{display:none}
 body.private-chat-active main>#chat-section,body.community-active main>#community-section{flex:1;height:auto;max-height:none;min-height:0;width:100%;margin:0;box-sizing:border-box;overflow:hidden;display:flex!important;flex-direction:column}
}
#chat-section .chat-split{flex:1;min-height:0;overflow:hidden}
#chat-section .chat-sidebar,#chat-section .chat-conversation{min-height:0;overflow:hidden}
#chat-section .chat-conversation{position:relative}
#chat-section .chat-sidebar>*{flex-shrink:0}
#chat-section .chat-sidebar #chat-matches-list{flex:1;min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain}
#chat-section #chat-messages{flex:1 1 0;height:auto;min-height:0;max-height:none;overflow-y:auto;overflow-x:hidden;overflow-anchor:none;scroll-behavior:auto}
#chat-section .chat-conversation>*:not(#chat-messages){flex-shrink:0}
#chat-section #chat-header{padding:6px 0}
#chat-section #chat-input-container{position:static;flex-shrink:0}
body.community-active main>#community-section>.eyebrow,body.community-active main>#community-section>h2{display:none}
#community-section .community-layout{flex:1;min-height:0;height:auto;display:flex;flex-direction:column;overflow:hidden}
#community-section .community-panel{position:relative;flex:1;min-height:0;height:auto;margin:0;overflow:hidden;box-sizing:border-box}
#community-section .community-panel>*:not(.community-messages){flex-shrink:0}
#community-section .community-messages{flex:1 1 0;min-height:0;max-height:none;overflow-y:auto;overflow-x:hidden;overflow-anchor:none;scroll-behavior:auto}
#community-section .community-messages>*{flex-shrink:0}
#community-section #community-status:empty{display:none}
.messenger-new{align-self:center;position:absolute;bottom:var(--composer-height,100px);z-index:3;border:0;border-radius:20px;background:#176c60;color:white;padding:8px 14px;min-height:40px;box-shadow:0 2px 10px #0002}
#chat-section .chat-new-messages{position:absolute;bottom:var(--composer-height,100px);z-index:3}
@media(max-width:900px){
 body.private-chat-active main>#chat-section,body.community-active main>#community-section{position:fixed;z-index:90;inset:auto 0;top:var(--messenger-top,0px);height:var(--messenger-height,100dvh);max-height:none;width:100%;max-width:none;margin:0;box-sizing:border-box;display:flex!important;flex-direction:column;background:var(--bg,#faf8f3);padding:4px 6px max(6px,env(safe-area-inset-bottom));border:0;border-radius:0;overflow:hidden}
 #chat-section .chat-split{display:flex;min-height:0}
 #chat-section .chat-sidebar{width:100%;border:0;padding:4px;box-sizing:border-box}
 #chat-section .chat-conversation{display:none;flex:1;min-height:0}
 #chat-section.has-conversation .chat-sidebar{display:none}
 #chat-section.has-conversation .chat-conversation{display:flex}
 #chat-section #chat-header,#community-section .community-header{padding-top:env(safe-area-inset-top)}
 #community-section .community-panel{padding:4px;border:0;border-radius:0}
}
/* Short conversations also end immediately above the composer. */
#chat-messages::before,#community-messages::before{content:"";margin-top:auto;flex:0 0 0}
#chat-section .chat-date-divider{flex-shrink:0}
#chat-section .chat-sidebar input,#chat-section .chat-sidebar select{margin:0}
