/* All chat rooms share a bounded message viewport and a visible composer. */
#modal[open]:has(#staff-chat),#modal[open]:has(#notice-discussion-detail),#modal[open]:has(#task-note-form){display:flex!important;flex-direction:column!important;height:min(760px,calc(var(--conversation-viewport-height,100dvh) - 20px))!important;max-height:calc(var(--conversation-viewport-height,100dvh) - 20px)!important;width:min(720px,calc(100% - 16px));max-width:calc(100% - 16px);box-sizing:border-box;overflow:hidden!important;padding:0!important;top:calc(var(--conversation-viewport-top,0px) + var(--conversation-viewport-height,100dvh)/2)!important;bottom:auto!important;margin:0 auto!important;transform:translateY(-50%)}
#modal:has(#staff-chat)>.modal-head,#modal:has(#notice-discussion-detail)>.modal-head,#modal:has(#task-note-form)>.modal-head{flex:0 0 auto;padding:10px 14px 6px!important;gap:8px}
#modal:has(#staff-chat)>.modal-head button{min-height:44px;min-width:44px}
#staff-chat,#collab-chat-pane{display:flex!important;flex-direction:column!important;flex:1 1 0!important;height:auto!important;min-height:0!important;min-width:0;overflow:hidden!important}
#staff-chat .chat-top{flex:none;padding:4px 12px}
#staff-chat .chat-room-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
#staff-chat .chat-room-tabs .btn{padding:6px 2px!important;min-height:44px;font-size:12px!important;min-width:0}
#staff-chat .chat-online{margin-top:6px;font-size:12px;max-height:76px;overflow:auto}
#staff-chat .chat-online small{font-size:11px}
#staff-chat .chat-audience{flex:none;padding:4px 12px 6px;font-size:11px;line-height:1.4;margin:0}
#staff-chat .chat-scroll{flex:1 1 0!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden;padding:12px!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable}
#staff-chat .chat-message{max-width:92%;margin-bottom:12px}
#staff-chat .chat-message p{overflow-wrap:anywhere;word-break:normal;font-size:16px;padding:9px 11px}
#staff-chat .chat-meta,#staff-chat .chat-meta time,#staff-chat .chat-audience,#staff-chat .chat-online,#staff-chat .chat-compose-footer small{color:#244337!important;-webkit-text-fill-color:#244337!important;opacity:1!important}
#staff-chat #chat-compose{flex:0 0 auto!important;padding:8px 12px!important;margin:0!important;background:#fff;max-height:48%;overflow-y:auto;overscroll-behavior:contain}
#staff-chat #chat-body{display:block;box-sizing:border-box;width:100%;height:64px!important;min-height:64px!important;max-height:96px!important;margin:0!important;padding:8px!important;font-size:16px!important;resize:none;overflow-y:auto}
#staff-chat .chat-targets{margin:4px 0;font-size:12px}
#staff-chat .chat-targets>summary{padding:4px 0}
#staff-chat .chat-targets[open]{max-height:100px;overflow-y:auto}
#staff-chat .chat-compose-footer{margin-top:4px}
#staff-chat .chat-compose-footer button{min-height:44px}
#staff-chat #chat-status{min-height:0;margin:4px 0 0;font-size:12px}
#staff-chat #chat-status:empty{display:none}
/* Keep task and notice comment forms visible while their history scrolls. */
#notice-discussion-detail,.task-conversation{display:flex!important;flex-direction:column!important;flex:1 1 0!important;min-height:0!important;overflow:hidden!important;padding:8px 12px!important}
.notice-detail-scroll,.task-detail-scroll{flex:1 1 0;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding-bottom:10px}
#notice-discussion-detail>[data-notice-comment-form],.task-conversation>#task-note-form{flex:none;border-top:1px solid #c5d5c9;padding-top:8px;background:#fff;margin:0;max-height:45%;overflow:auto}
#notice-comment-body,#task-note{height:64px!important;min-height:64px!important;max-height:96px!important;font-size:16px!important;resize:none;overflow:auto;box-sizing:border-box}
#task-note-form .field{margin-bottom:6px;gap:3px}
.notice-comment-footer{margin-top:4px;align-items:center;gap:6px;flex-wrap:nowrap!important}
.notice-comment-footer small{font-size:11px;flex:1!important;color:#244337!important;-webkit-text-fill-color:#244337!important}
[data-notice-comment-status]:empty{display:none}
#notice-discussion-detail label,.task-conversation label{color:#244337!important;-webkit-text-fill-color:#244337!important;opacity:1!important}
.conversation-compact-height #staff-chat .chat-audience,.conversation-compact-height #staff-chat .chat-online,.conversation-compact-height #staff-chat .chat-compose-footer small{display:none}
.conversation-compact-height #staff-chat #chat-compose{max-height:none;padding:6px 10px!important}
.conversation-compact-height #staff-chat #chat-body{height:44px!important;min-height:44px!important}
.conversation-compact-height #staff-chat .chat-compose-footer{justify-content:flex-end}
.conversation-compact-height #staff-chat .chat-targets[open]{max-height:65px}
