.site-chat [x-cloak] { display: none !important; }
.chat-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.25rem; }
.chat-topics { align-self: start; }
.chat-topic { display: flex; align-items: center; justify-content: space-between; gap: .5rem; overflow-wrap: anywhere; }
.chat-topic > span:first-child { min-width: 0; }
.chat-unread-badge { flex-shrink: 0; min-width: 1.5rem; padding: .15rem .45rem; border-radius: 999px; background: #dc3545; color: #fff; font-size: .75rem; font-weight: 700; line-height: 1.25; text-align: center; }
.chat-panel { min-width: 0; }
.chat-messages { height: min(60vh, 640px); min-height: 280px; overflow-y: auto; position: relative; overscroll-behavior: contain; }
.chat-message { display: flex; gap: .75rem; padding: 1rem; border-bottom: 1px solid #ddd; scroll-margin: 1rem; }
.chat-message:focus, .chat-message:target { background: #fff3cd; outline: 2px solid #b07b16; outline-offset: -2px; }
.page .page-content img.chat-avatar {
    width: 40px;
    height: 40px;
    aspect-ratio: 1;
    flex: 0 0 40px;
    align-self: flex-start;
    object-fit: cover;
    border-radius: 50%;
}
.chat-message-body { flex: 1; min-width: 0; }
.chat-message-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; margin-left: auto; text-align: right; }
.chat-content { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-preview { display: block; max-width: 100%; margin-top: .5rem; }
img.chat-preview, video.chat-preview { max-height: 300px; object-fit: contain; }
.chat-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .75rem; margin-top: .5rem; }
.chat-actions button { padding: 0; font-size: .85rem; }
.chat-composer textarea { resize: vertical; min-height: 90px; }
.site-chat .chat-reply-quote { margin: .5rem 0; padding: .4rem .75rem; border-left: 3px solid var(--bs-primary, #0d6efd); border-radius: 0 .35rem .35rem 0; background: rgba(13, 110, 253, .06); font-size: .875rem; min-width: 0; overflow-wrap: anywhere; }
.chat-reply-quote a { display: block; color: inherit; text-decoration: none; }
.chat-reply-quote a:hover { text-decoration: underline; }
.chat-reply-quote strong { color: var(--bs-primary, #0d6efd); }
.chat-reply-excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.chat-reply-composer { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.chat-reply-composer .chat-reply-quote { flex: 1; }
.chat-reply-composer .btn-close { flex-shrink: 0; }
@media (max-width: 767px) {
    .chat-layout { grid-template-columns: minmax(0, 1fr); }
    .chat-topic-list { display: flex; flex-wrap: wrap; gap: .5rem; }
    .chat-message { padding: .75rem; gap: .5rem; }
}
