.chat-dock { position: fixed; z-index: 25; right: 12px; bottom: 0; display: flex; align-items: flex-end; gap: 5px; width: min(990px, calc(100vw - 24px)); pointer-events: none; }
.chat-dock[hidden], .chat-dock [hidden] { display: none !important; }
.chat-window { flex: 1; min-width: 0; border: 1px solid #76633c; background: #252a27; box-shadow: 0 0 0 2px #080b09; pointer-events: auto; color: #e4e0d3; font: 14px/1.4 Arial, sans-serif; }
.chat-window button, .chat-window input, .chat-window textarea { font: inherit; }
.chat-window button { cursor: pointer; }
.chat-window button:disabled { opacity: .55; cursor: wait; }
.chat-window button:focus-visible, .chat-window input:focus-visible, .chat-window textarea:focus-visible { outline: 2px solid #efd087; outline-offset: -2px; }
.chat-toggle { width: 100%; display: flex; align-items: center; gap: 8px; border: 0; border-top: 3px solid #8b7849; padding: 9px 10px; text-align: left; color: #f1e6c9; background: #34372e; font-weight: bold !important; }
.chat-global .chat-toggle { background: #244544; border-top-color: #59918a; }
.chat-private .chat-toggle { background: #273b4a; border-top-color: #617d91; }
.chat-toggle-symbol { margin-left: auto; }
.chat-toggle[aria-expanded=true] .chat-toggle-symbol { transform: rotate(180deg); }
.chat-badge { background: #c29a4b; color: #161b18; padding: 0 5px; min-width: 18px; text-align: center; font-size: 12px; }
.chat-window-body { height: min(420px, 65svh); display: flex; flex-direction: column; }
.chat-feed { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-feed-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #1a211e; }
.chat-feed-tools:empty { display: none; }
.chat-back, .chat-older { border: 0; color: #d6bf88; background: #1b221e; padding: 6px 8px; font-size: 12px !important; }
.chat-peer { overflow-wrap: anywhere; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 7px; overscroll-behavior: contain; scrollbar-color: #80714d #151c18; }
.chat-messages { list-style: none; margin: 0; padding: 0; }
.chat-message { padding: 6px 8px; margin-bottom: 5px; background: #171e1b; border-left: 2px solid #555c4c; overflow-wrap: anywhere; }
.chat-message.is-own { border-left-color: #78aba0; background: #20302b; }
.chat-message > a { color: #d8bb77; font-weight: bold; text-decoration: none; }
.chat-message > a:hover { text-decoration: underline; }
.chat-message time { color: #a9aea7; display: block; font-size: 12px; }
.chat-message p { margin: 3px 0 0; white-space: pre-wrap; }
.chat-status { margin: 8px; color: #beb7a4; font-size: 12px; }
.chat-compose { padding: 7px; border-top: 1px solid #545743; background: #202621; }
.chat-input { display: block; width: 100%; resize: none; color: #eee9db; background: #121915; border: 1px solid #5d604d; padding: 7px; box-sizing: border-box; }
.chat-compose-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; gap: 8px; }
.chat-counter { color: #abae9f; font-size: 12px; }
.chat-send, .chat-search button { color: #f0ddb1; background: #49402b; border: 1px solid #857044; padding: 5px 12px; }
.chat-new { background: #315653; color: #e8f3ec; border: 0; padding: 5px; }
.chat-search { display: flex; gap: 5px; padding: 8px; border-bottom: 1px solid #555b50; }
.chat-search input { width: 100%; min-width: 0; padding: 7px; color: #eee9db; background: #121915; border: 1px solid #5d604d; }
.chat-search-results { max-height: 35%; overflow-y: auto; flex-shrink: 0; }
.chat-player, .chat-conversation { display: block; width: 100%; text-align: left; padding: 10px; color: #e1d4b2; background: #242e29; border: 0; border-bottom: 1px solid #414c43; }
.chat-player:hover, .chat-conversation:hover { background: #35463c; }
.chat-inbox { flex: 1; overflow-y: auto; min-height: 0; }
.chat-preview { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #aeb5a9; font-size: 12px; margin-top: 3px; }
body:has(.chat-dock:not([hidden])) { padding-bottom: 48px; }
@media (max-width: 650px) {
  .chat-dock { right: 5px; width: calc(100vw - 10px); gap: 3px; }
  .chat-window-body { position: absolute; bottom: 44px; left: 0; right: 0; border: 1px solid #76633c; background: #252a27; height: min(430px, 65svh); }
  .chat-toggle { padding: 10px 6px; gap: 4px; font-size: 12px !important; min-height: 44px; }
}
