/* The group chat window (chat.js), on /tv/ and /community/. */
.chat [hidden] { display: none !important; }
.chat { display: flex; flex-direction: column; min-height: 0; background: var(--card); border: 1px solid var(--line-gold); border-radius: var(--radius); overflow: hidden; }
.chat-head { position: relative; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.chat-title-row { display: flex; align-items: center; gap: 10px; }
.chat .chat-title { margin: 0; font: 700 20px/1.2 var(--text); color: var(--gold); text-transform: none; letter-spacing: 0; }
.chat-state { padding: 2px 9px; border-radius: 999px; font: 700 12px/1.5 var(--text); letter-spacing: .06em; background: rgba(127, 209, 164, .14); color: #7fd1a4; }
.chat-state.is-paused { background: rgba(226, 177, 80, .14); color: var(--gold); }
.chat-who { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.chat-menu-btn { position: absolute; top: 12px; right: 12px; }
.chat-menu { margin-top: 10px; padding: 10px 12px; background: var(--card-hi); border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 6px; justify-items: start; }
.chat-menu-head { margin: 0; font-size: 13px; color: var(--muted); }
.chat-menu-row { margin: 0; display: flex; gap: 12px; align-items: center; }

.chat-log { flex: 1 1 0; min-height: 72px; overflow-y: auto; margin: 0; padding: 10px 16px; list-style: none; overscroll-behavior: contain; }
.chat-log:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.chat-msg { padding: 8px 0; border-bottom: 1px solid var(--line); }
.chat-msg:last-child { border-bottom: 0; }
.chat-msg-top { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 13px; }
.chat-name { color: var(--ink); font-size: 14px; }
.chat-msg.is-house .chat-name { color: var(--gold); }
.chat-tag { padding: 0 6px; border-radius: 6px; background: var(--gold-grad); color: #1a1205; font: 800 10px/1.6 var(--text); letter-spacing: .1em; }
.chat-you { color: var(--muted); font-size: 12px; }
.chat-time { margin-left: auto; color: var(--muted); font-size: 12px; }
.chat-text { margin: 2px 0 0; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-acts { margin: 2px 0 0; display: flex; gap: 14px; }
.chat-empty { margin: 0; padding: 24px 16px; color: var(--muted); text-align: center; }

.chat-foot { flex: 0 0 auto; max-height: 78%; overflow-y: auto; overscroll-behavior: contain; padding: 12px 16px 14px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, .25); }
.chat-form { display: grid; gap: 10px; }
.chat-field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.chat-field input, .chat-input { width: 100%; min-height: 44px; padding: 10px 12px; background: #0f0f12; color: var(--ink); border: 1px solid var(--line-gold); border-radius: 10px; font: 400 16px/1.35 var(--text); }
.chat-input { resize: none; }
.chat-field input:focus, .chat-input:focus { outline: 2px solid var(--gold); outline-offset: 0; }
.chat-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink); }
.chat-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--gold); }
.chat-row { margin: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.chat-compose .chat-row { justify-content: flex-end; }
.chat-count { margin-right: auto; font-size: 12px; color: var(--muted); }
.chat-send { min-width: 96px; }
.chat-send:disabled, .chat-form .btn:disabled { opacity: .55; cursor: default; }
.chat-signin { width: 100%; }
.chat-small { margin: 0; font-size: 12.5px; color: var(--muted); }
.chat-foot .chat-small { margin-top: 8px; }
.chat-note { margin: 6px 0 0; min-height: 1em; font-size: 13px; color: var(--muted); }
.chat-note:empty { display: none; }
.chat-note.is-bad { color: #ff8a7a; }
.chat-link { padding: 4px 0; min-height: 32px; background: none; border: 0; color: var(--gold); font: 600 13px/1.2 var(--text); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.chat-link.is-bad { color: #ff8a7a; }
.chat-acts .chat-link { min-height: 28px; color: var(--muted); font-weight: 500; }
.chat-acts .chat-link:hover, .chat-acts .chat-link:focus-visible { color: var(--gold); }

/* On the Community page. */
.community-chat { height: min(70vh, 560px); max-width: 760px; }
.community-tv { margin: 18px 0 0; }

/* Signing in: the form gets the whole window. */
.chat.is-form .chat-log, .chat.is-form .chat-empty { display: none; }
.chat.is-form .chat-foot { flex: 1 1 auto; max-height: none; border-top: 0; }
