/* Shared table-chat and direct-message presentation. */
html body #board-chat-dialog #chat-messages,html body .direct-message-list{gap:0!important;overflow-anchor:none}
html body #board-chat-dialog #chat-messages:empty:before{content:attr(data-empty)}
.chat-date-divider{align-self:stretch;display:flex;align-items:center;gap:12px;margin:18px 0 14px;color:var(--muted);font-size:12px;line-height:1.4;text-align:center;white-space:nowrap}
.chat-date-divider:first-child{margin-top:4px}.chat-date-divider:before,.chat-date-divider:after{content:'';height:1px;flex:1;background:var(--line);opacity:.5}
html body .chat-row{position:relative;align-self:flex-start;max-width:88%;min-width:0;margin:9px 0 0;flex:none}
html body .chat-row.own{align-self:flex-end}html body .chat-row.is-grouped{margin-top:3px}
html body :is(#board-chat-dialog,.player-messages-dialog) .message-bubble{display:flow-root;max-width:none;margin:0;padding:9px 12px;border-radius:17px 17px 17px 5px;white-space:normal;line-height:1.45;font-size:14px;overflow-wrap:anywhere}
html body :is(#board-chat-dialog,.player-messages-dialog) .message-bubble.own{max-width:none;margin:0;padding:9px 12px;border-radius:17px 17px 5px 17px}
html body :is(#board-chat-dialog,.player-messages-dialog) .is-grouped .message-bubble{border-top-left-radius:5px}
html body :is(#board-chat-dialog,.player-messages-dialog) .is-grouped.own .message-bubble{border-top-left-radius:17px;border-top-right-radius:5px}
html body :is(#board-chat-dialog,.player-messages-dialog) .chat-body{display:inline;white-space:pre-wrap;overflow-wrap:anywhere}
html body :is(#board-chat-dialog,.player-messages-dialog) .chat-message-meta{float:right;display:inline-flex;align-items:center;justify-content:flex-end;gap:5px;margin:5px 0 -1px 12px;min-height:16px;color:var(--muted);font-size:12px;line-height:16px;white-space:nowrap}
html body :is(#board-chat-dialog,.player-messages-dialog) .chat-message-meta time{font-size:12px;line-height:16px;color:inherit;font-variant-numeric:tabular-nums}
html body .chat-message-meta .chat-receipt{position:static;display:inline-flex;align-items:center;line-height:1;width:auto;height:16px;color:var(--muted)}
html body .chat-message-meta .chat-receipt svg{height:16px;width:24px;stroke-width:1.65;fill:none;stroke:currentColor}
html body .chat-message-meta .chat-receipt.is-sent svg{width:16px}
.chat-message-meta .receipt-circle circle{fill:var(--panel);stroke:currentColor}
html body .chat-message-meta .chat-receipt.is-read{color:var(--accent)}
.chat-message-meta .is-read .receipt-circle circle{fill:currentColor}.chat-message-meta .is-read .receipt-circle path{stroke:var(--panel)}
html body .chat-row .chat-react-toggle{position:absolute;top:50%;right:-29px;display:grid;place-items:center;width:28px;min-width:28px;height:32px;min-height:32px;padding:5px;border:0;border-radius:50%;background:transparent;color:var(--muted);opacity:0;transform:translateY(-50%);transition:opacity .12s}
html body .chat-row.own .chat-react-toggle{right:auto;left:-29px}
.chat-react-toggle svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
html body .chat-row:hover .chat-react-toggle,html body .chat-row:focus-within .chat-react-toggle{opacity:1}
html body .chat-row.has-reactions{margin-bottom:16px}
html body .chat-reactions{position:relative;z-index:1;display:flex;justify-content:flex-end;gap:3px;flex-wrap:wrap;margin:-8px 5px -14px 0;padding:0 0 0 8px}.chat-row.own .chat-reactions{justify-content:flex-end}
html body .chat-reaction-chip{display:inline-flex;align-items:center;justify-content:center;gap:3px;min-width:32px;min-height:28px;padding:2px 8px;border:1px solid var(--line);border-radius:16px;background:var(--panel);font-size:14px;line-height:1.3;color:var(--ink)}
html body .chat-reaction-chip[aria-pressed=true]{background:color-mix(in srgb,var(--accent) 14%,var(--panel));border-color:var(--accent)}
.chat-reaction-picker{position:fixed;inset:auto;margin:0;padding:5px;max-width:calc(100vw - 16px);border:1px solid var(--line);border-radius:24px;background:var(--panel);color:var(--ink);box-shadow:0 5px 22px #0003}
.chat-reaction-picker:popover-open{display:flex;gap:2px}.chat-reaction-picker button{display:grid;place-items:center;width:40px;min-width:0;height:42px;min-height:42px;padding:4px;font-size:24px;line-height:1;background:transparent;border:0;border-radius:50%}.chat-reaction-picker button:hover,.chat-reaction-picker button[aria-pressed=true]{background:color-mix(in srgb,var(--accent) 20%,transparent)}
html body .chat-options{margin-left:auto;display:flex;align-items:center}
html body #board-chat-dialog .chat-options-toggle{display:grid;place-items:center;width:36px;min-width:36px;height:36px;min-height:36px;padding:7px;background:transparent;border:0;border-radius:8px}
.chat-options-toggle svg{width:22px;height:22px;fill:currentColor}.chat-options-toggle.is-muted{color:var(--accent)}
.chat-options-menu{min-width:160px;overflow:hidden;position:fixed;inset:auto;margin:0;padding:5px;border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--ink);box-shadow:0 6px 24px #0003}
html body #chat-mute.chat-mute-option{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:8px 13px;white-space:nowrap;border:0;font-size:14px;background:transparent;color:var(--ink)}
html body #chat-mute.chat-mute-option svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.6}
html body :is(#board-chat-dialog,.player-messages-dialog) .chat-gif-button{flex:none;display:grid;place-items:center;width:36px;min-width:36px;height:40px;min-height:40px;padding:4px;border:1px solid var(--line);border-radius:10px;background:transparent;color:var(--muted);font-size:12px;font-weight:700;letter-spacing:.02em}
.chat-gif-picker{position:fixed;inset:auto;margin:0;box-sizing:border-box;width:330px;max-width:calc(100vw - 16px);height:350px;max-height:calc(100dvh - 20px);padding:12px;border:1px solid var(--line);border-radius:16px;background:var(--panel);color:var(--ink);box-shadow:0 10px 40px #0004;overflow:hidden}
.chat-gif-picker:popover-open{display:flex;flex-direction:column;gap:8px}.gif-picker-heading{display:flex;align-items:center;justify-content:space-between;flex:none}.gif-picker-heading strong{font-size:15px}.gif-picker-heading button{width:30px;min-height:30px;height:30px;padding:0;background:none;font-size:22px;border:0}
.chat-gif-picker input{flex:none;box-sizing:border-box;width:100%;min-width:0;height:40px;padding:8px 12px;border:1px solid var(--line);border-radius:10px;color:var(--ink);background:var(--bg);font-size:16px}
.gif-results{display:grid;grid-auto-rows:max-content;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;min-height:0;overflow:auto;overscroll-behavior:contain}
.gif-results button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;height:auto;padding:5px;min-height:82px;background:var(--bg);border:1px solid transparent;border-radius:9px;overflow:hidden}.gif-results button:hover{border-color:var(--accent)}.gif-results img{display:block;width:100%;height:82px;object-fit:contain}.gif-load-failed{font-size:12px}
.gif-search-status{font-size:13px;color:var(--muted)}.gif-search-status:empty{display:none}.gif-provider{display:block;flex:none;font-size:12px;color:var(--muted);text-align:center;text-decoration:none;margin-top:auto;padding-top:3px}
.gif-provider img{display:block;width:160px;max-width:100%;height:auto;margin:auto;background:white;border-radius:3px;padding:2px 4px}.gif-result-credit{display:block;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:12px;color:var(--muted)}.chat-gif-credit{display:block;margin:1px 0 5px;font-size:12px;color:inherit;text-decoration:none;opacity:.8}.chat-gif-credit:hover{text-decoration:underline}
html body :is(#board-chat-dialog,.player-messages-dialog) .chat-gif-attachment{display:flex;align-items:center;gap:8px;padding:6px 10px;font-size:12px;color:var(--muted);min-width:0;flex:none}.chat-gif-attachment[hidden]{display:none!important}.chat-gif-attachment img{width:40px;height:40px;object-fit:contain}.chat-gif-attachment span{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.chat-gif-attachment button{width:32px;min-height:32px;padding:0;font-size:20px;background:none}
html body :is(#board-chat-dialog,.player-messages-dialog) .chat-gif-media{position:relative;display:block;width:180px;max-width:100%;min-height:0;margin:0 0 4px;padding:0;overflow:hidden;border:0;border-radius:10px;background:transparent}
.chat-gif-media img{display:block;width:100%;height:auto;max-height:200px;object-fit:contain}.chat-gif-media.is-paused:after{content:'▶';position:absolute;right:6px;bottom:6px;background:#0009;color:white;font-size:14px;padding:4px 8px;border-radius:14px}.chat-gif-error{font-size:13px;color:var(--muted)}
html body #board-chat-dialog .chat-controls,html body #toolbar-panel #board-chat-dialog .chat-controls{flex-direction:column;align-items:stretch}
html body .chat-delivery-status:empty{display:none}.direct-message-status:empty{display:none}
@media(prefers-reduced-motion:reduce){html body .chat-row .chat-react-toggle{transition:none}}
@media(max-height:450px){.chat-gif-picker{height:280px}.gif-results img{height:62px}.gif-results button{min-height:62px}.chat-gif-picker:popover-open{gap:5px;padding:8px}}

/* Long press belongs to reactions, including message timestamps and GIFs. */
html body .message-bubble,html body .chat-reactions,html body .chat-reaction-picker{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
html body .message-bubble{touch-action:pan-y}
html body .chat-gif-media img{-webkit-user-drag:none}
