.chat-page { max-width: 1100px; margin: 0 auto; padding: 55px max(4vw, 20px) 80px; }
.chat-page h1 { margin: 14px 0; font-size: clamp(2rem, 5vw, 3rem); }
.chat-page__lead { margin-bottom: 28px; color: var(--muted); line-height: 1.7; }
.chat, .chat-widget { color: var(--text); font: inherit; }
.chat [hidden], .chat-widget [hidden] { display: none !important; }
.chat { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.chat button, .chat textarea { font: inherit; }
.chat button, .chat-widget__toggle { cursor: pointer; }
.chat button:disabled { opacity: .5; cursor: default; }
.chat__header, .chat__actions, .chat__form-footer, .chat-widget__toggle { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; gap: 8px; }
.chat__header, .chat__form-footer { -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; }
.chat__header { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.chat__title { margin: 0; font-size: 1rem; }
.chat__status { margin: 5px 0 0; color: var(--muted); font-size: .73rem; line-height: 1.5; }
.chat__status--live { color: #a7d28d; }
.chat__link { color: var(--gold); font-size: .8rem; }
.chat__close { border: 0; background: transparent; color: var(--muted); font-size: 1.6rem !important; padding: 3px 8px; }
.chat__history { height: min(58vh, 620px); min-height: 240px; overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px; }
.chat__messages { list-style: none; padding: 0; margin: 0; }
.chat__message { padding: 13px 0; border-bottom: 1px solid var(--line); }
.chat__message:last-child { border-bottom: 0; }
.chat__meta { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: baseline; -ms-flex-align: baseline; align-items: baseline; gap: 12px; }
.chat__author { color: var(--gold); font-size: .83rem; overflow-wrap: anywhere; min-width: 0; }
.chat__message--own .chat__author { color: #a7d28d; }
.chat .chat__author--moderator { color: #5299f0; }
.chat__time { margin-left: auto; -ms-flex-negative: 0; flex-shrink: 0; color: var(--muted); font-size: .68rem; }
.chat__body { margin: 7px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .86rem; line-height: 1.65; }
.chat__empty { padding: 40px 0; text-align: center; color: var(--muted); line-height: 1.6; }
.chat__older { display: block; margin: 0 auto 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--gold); font-size: .75rem !important; }
.chat__new { display: block; margin: 0 auto 12px; padding: 8px 12px; border: 1px solid var(--gold); border-radius: 8px; background: var(--surface2); color: var(--gold); font-size: .75rem !important; }
.chat__form, .chat__login { padding: 16px 22px; border-top: 1px solid var(--line); }
.chat__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.chat__input { display: block; width: 100%; min-height: 68px; max-height: 180px; resize: vertical; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #111310; color: var(--text); font-size: .86rem !important; }
.chat__input:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.chat__form-footer { margin-top: 12px; }
.chat__hint { color: var(--muted); font-size: .69rem; line-height: 1.5; max-width: 250px; }
.chat__send { padding: 10px 15px; border: 0; border-radius: 8px; background: var(--gold); color: #171910; font-size: .8rem !important; font-weight: 700 !important; }
.chat__error { padding: 10px 22px; margin: 0; color: #ffb4a8; font-size: .8rem; line-height: 1.5; }
.chat__login p { color: var(--muted); font-size: .8rem; margin: 0 0 9px; line-height: 1.5; }
.chat-widget { position: fixed; right: 24px; bottom: 24px; z-index: 999; }
.chat-widget__toggle { margin-left: auto; border: 1px solid #ff980066; border-radius: 30px; padding: 14px 20px; background: var(--surface2); color: var(--gold); -webkit-box-shadow: 0 6px 30px #0006; box-shadow: 0 6px 30px #0006; font: inherit; font-size: .85rem; }
.chat-widget__badge { min-width: 22px; padding: 3px 5px; border-radius: 12px; background: var(--gold); color: #171910; font-size: .7rem; text-align: center; }
.chat-widget__panel { width: min(410px, calc(100vw - 32px)); margin-bottom: 12px; -webkit-box-shadow: 0 16px 60px #0008; box-shadow: 0 16px 60px #0008; border-radius: 16px; }
.chat--compact .chat__history { height: min(38vh, 340px); min-height: 150px; }
.chat--compact .chat__header, .chat--compact .chat__history, .chat--compact .chat__form, .chat--compact .chat__login { padding-left: 16px; padding-right: 16px; }
.chat--compact .chat__hint { max-width: 190px; }
@media (max-width: 600px) {
    .chat-widget { right: 16px; bottom: 16px; }
    .chat-widget__panel { max-height: calc(100dvh - 100px); overflow-y: auto; }
    .chat__header, .chat__history, .chat__form, .chat__login { padding-left: 14px; padding-right: 14px; }
    .chat__hint { max-width: 180px; }
    .chat__actions { gap: 6px; }
}
.chat__avatar { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; -ms-flex-negative: 0; flex-shrink: 0; border-radius: 50%; overflow: hidden; background: var(--surface2); color: var(--gold); font-size: .75rem; }
.chat__avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.chat__meta { -webkit-box-align: center; -ms-flex-align: center; align-items: center; }
.chat__quote { margin: 8px 0; padding: 8px 12px; border-left: 2px solid var(--gold); background: #ffffff05; color: var(--muted); font-size: .74rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.chat__message--deleted .chat__body { color: var(--muted); font-style: italic; }
.chat__reply-button { border: 0; padding: 5px 0; background: transparent; color: var(--gold); font-size: .7rem !important; }
.chat__reply-preview { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; gap: 10px; border-left: 2px solid var(--gold); padding-left: 10px; margin-bottom: 10px; }
.chat__reply-preview p { margin: 0; -webkit-box-flex: 1; -ms-flex: 1; flex: 1; color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.chat__emoji-wrap { position: relative; }
.chat__emoji-toggle { border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; background: transparent; color: var(--gold); font-size: 1.35rem !important; }
.chat__emoji-picker { position: absolute; bottom: calc(100% + 10px); left: 0; z-index: 2; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; width: 250px; max-width: calc(100vw - 90px); padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface2); -webkit-box-shadow: 0 5px 25px #0008; box-shadow: 0 5px 25px #0008; }
.chat__emoji { border: 0; border-radius: 5px; padding: 4px; background: transparent; font-size: 1.3rem !important; }
.chat__emoji:hover, .chat__emoji:focus-visible { background: #ffffff15; }
.chat--compact .chat__hint { max-width: 130px; }
.chat__availability, .chat__action-status { margin: 0; padding: 12px 20px; font-size: .8rem; line-height: 1.6; background: #ff98000d; color: var(--gold); }
.chat__message-actions { display: -webkit-box; display: -ms-flexbox; display: flex; gap: 12px; -ms-flex-wrap: wrap; flex-wrap: wrap; margin-top: 5px; }
.chat__moderate-button, .chat__settings-button { padding: 4px 0; border: 0; background: transparent; color: var(--muted); font-size: .7rem !important; }
.chat__moderate-button:hover { color: var(--gold); }
.chat__settings-button { padding: 6px; color: var(--gold); font-size: 1.2rem !important; }
.chat__actions { -ms-flex-wrap: wrap; flex-wrap: wrap; -webkit-box-pack: end; -ms-flex-pack: end; justify-content: flex-end; }
.chat-moderation { width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto; margin: auto; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; }
.chat-moderation::backdrop { background: #0009; }
.chat-moderation__heading, .chat-moderation__footer { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; gap: 15px; }
.chat-moderation__heading h3 { margin: 0; font-size: 1.1rem; }
.chat-moderation__target { margin: 12px 0; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.chat-moderation__field { display: block; margin: 16px 0; font-size: .85rem; }
.chat-moderation__field span { display: block; margin-bottom: 7px; }
.chat-moderation__field textarea, .chat-moderation__field select { display: block; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface2); color: var(--text); font: inherit; }
.chat-moderation__field textarea { resize: vertical; }
.chat-moderation__switches label { display: block; margin: 12px 0; font-size: .85rem; }
.chat-moderation [hidden] { display: none !important; }
@media (max-width: 1100px), (any-pointer: coarse) {
    .chat-moderation textarea, .chat-moderation select { font-size: 16px !important; }
}
