.chat-room, .chat-closed { max-width: 940px; margin-inline: auto; }
.chat-room { padding: clamp(18px, 3vw, 30px); }
.chat-header { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 18px; }
.chat-header h2 { margin: 3px 0 6px; color: #172b36; }
.chat-room-date { margin: 3px 0 0; color: #075d65; font-weight: 750; }
.chat-presence { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 16px; padding: 10px 12px; border: 1px solid #cde5df; border-radius: 13px; background: #f0faf7; color: #24464c; font-size: .84rem; }
.chat-presence > strong { color: #075d65; }
.chat-presence-people { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-presence-person { padding: 4px 8px; border-radius: 999px; background: #fff; border: 1px solid #b5dfd1; font-weight: 650; }
.chat-presence-person > span { color: #00a77f; }
.chat-presence-empty { color: #526874; }
.chat-room-note { margin: 0 0 12px; color: #526874; font-size: .9rem; }
.chat-online-dot { color: #00a77f; font-size: 22px; }
.chat-room-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 14px; }
.chat-room-tab { flex: 0 0 auto; border: 1px solid #bfdfe2; border-radius: 12px; padding: 9px 12px; background: #eef8f9; color: #075a62; font-weight: 700; cursor: pointer; }
.chat-room-tab.is-active { background: #086b72; color: white; border-color: #086b72; }
.chat-stream { height: clamp(360px, 58vh, 620px); min-height: 300px; max-height: min(64vh, 620px); margin-bottom: 14px; overflow-y: auto; padding: 18px; border: 1px solid #d9e8e9; border-radius: 18px; background: #f6fafb; scroll-behavior: smooth; }
.chat-empty { text-align: center; color: #526874; padding: 70px 10px; }
.chat-line { display: flex; margin: 7px 0; }
.chat-line-own { justify-content: flex-end; }
.chat-bubble { max-width: min(78%, 540px); padding: 10px 13px; border: 1px solid #c4d9ed; border-radius: 15px 15px 15px 4px; background: #eaf4ff; color: #17303e; box-shadow: 0 2px 6px #0b39440a; }
.chat-line-own .chat-bubble { border-radius: 15px 15px 4px 15px; }
.chat-speaker-1 { background: #eff5df; border-color: #d4e5a6; }
.chat-speaker-2 { background: #fff1e8; border-color: #f0cfb2; }
.chat-speaker-3 { background: #f2eefd; border-color: #d6c9f0; }
.chat-speaker-4 { background: #e7f6ef; border-color: #b9e4d1; }
.chat-speaker-5 { background: #fff2f5; border-color: #ecc4ce; }
.chat-bubble-head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; margin-bottom: 4px; }
.chat-bubble-head strong { color: #074e59; font-size: .85rem; }
.chat-bubble-head time { color: #536b76; font-size: .72rem; white-space: nowrap; }
.chat-bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.chat-mention { color: #075d65; font-weight: 800; background: #d8f3ee; border-radius: 4px; padding: 0 2px; }
.chat-delivery { display: block; margin-top: 4px; color: #526874; font-size: .7rem; text-align: right; }
.chat-tools { margin: 12px 0; }
.chat-quick-toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 45px; padding: 8px 15px 8px 9px; border: 1px solid #77c9c8; border-radius: 13px; background: #e4f5f4; color: #075d65; font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 2px 0 #c1e6e3; }
.chat-quick-toggle:hover, .chat-quick-toggle:focus-visible, .chat-quick-toggle[aria-expanded="true"] { background: #d2eeeb; border-color: #008f90; outline-color: #008f90; }
.chat-plus { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: #08737a; color: #fff; font-size: 23px; font-weight: 500; line-height: 1; }
.chat-topic-groups { display: grid; gap: 10px; padding: 13px 0 5px; }
.chat-topic-groups[hidden] { display: none; }
.chat-topic-groups h3 { font-size: .78rem; color: #526874; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 5px; }
.chat-topic-groups section > div { display: flex; flex-wrap: wrap; gap: 7px; }
.chat-topic-groups button { border: 1px solid #a7d6d6; background: #e8f8f8; color: #075d65; border-radius: 999px; padding: 7px 10px; cursor: pointer; font-weight: 650; }
.chat-topic-groups button:hover, .chat-topic-groups button:focus-visible { background: #cceff0; }
.chat-compose { position: relative; display: flex; align-items: stretch; gap: 9px; width: 100%; }
.chat-mention-options { position: absolute; z-index: 5; left: 0; right: 60px; bottom: calc(100% + 7px); display: grid; gap: 2px; max-height: 200px; overflow-y: auto; padding: 5px; border: 1px solid #a8d4d3; border-radius: 12px; background: #fff; box-shadow: 0 8px 24px #17303e24; }
.chat-mention-options[hidden] { display: none; }
.chat-mention-options button { border: 0; border-radius: 8px; padding: 9px; background: transparent; color: #075d65; font: inherit; text-align: left; cursor: pointer; }
.chat-mention-options button:hover, .chat-mention-options button:focus-visible { background: #e4f5f4; }
.chat-compose textarea { display: block; flex: 1 1 auto; width: 100%; min-width: 0; box-sizing: border-box; resize: vertical; border: 1px solid #bed4d8; border-radius: 14px; padding: 10px 12px; background: white; color: #172b36; font: inherit; }
.chat-compose textarea:focus-visible { outline: 2px solid #008e99; outline-offset: 1px; }
.chat-send { flex: 0 0 51px; border: 0; border-radius: 14px; color: white; background: #007f89; font-size: 21px; cursor: pointer; }
.chat-send:disabled { opacity: .5; cursor: wait; }
.chat-status { display: block; box-sizing: border-box; width: 100%; min-height: 1.4em; margin: 7px 0 0; padding: 0; text-align: left; color: #526874; font-size: .85rem; }
.chat-closed { text-align: center; padding: 48px 24px; }
.chat-closed-icon { font-size: 2.6rem; }
.chat-closed p { color: #526874; }
@media (max-width: 600px) {
  .chat-room { padding: 16px; }
  .chat-header h2 { font-size: 1.35rem; }
  .chat-quick-toggle { width: 100%; }
  .chat-stream { height: clamp(320px, 50vh, 560px); min-height: 0; max-height: 62vh; padding: 10px; }
  .chat-bubble { max-width: 88%; }
  .chat-room-tab { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
