[hidden] { display: none !important; }
/* Олегатор ФМ — страница чата */
.chat-page { min-height: 100dvh; display: flex; flex-direction: column; }
.chat-page .header { position: sticky; }
.chat-layout { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 16px var(--gutter) 24px;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }

.chat-box { position: relative; display: flex; flex-direction: column; height: calc(100dvh - 100px); min-height: 460px; overflow: hidden; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat-head h1 { font-size: 1.15rem; margin: 0; }
.chat-online { color: var(--lime); font-weight: 800; font-size: .85rem; white-space: nowrap; }

.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.chat-empty { margin: auto; text-align: center; }
.chat-msg { display: flex; gap: 10px; align-items: flex-start; max-width: 86%; }
.chat-msg .ava { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 1.15rem;
  background: rgba(182,255,59,.08); border: 1px solid var(--line); }
.chat-bubble { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 7px 12px; min-width: 0; }
.chat-meta { display: flex; gap: 8px; align-items: baseline; font-size: .78rem; color: var(--muted); min-width: 0; }
.chat-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chat-meta time { flex: none; }
.chat-meta b { color: var(--text); font-size: .85rem; }
.chat-meta .badge { background: var(--amber); color: #1a1400; border-radius: 6px; padding: 0 6px; font-weight: 800; font-size: .68rem; }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-quote { border-left: 3px solid var(--lime-dim); padding: 2px 8px; margin: 4px 0; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.chat-quote b { color: var(--text); }
.chat-reply-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .78rem; padding: 0; margin-left: auto; white-space: nowrap; flex: none; }
.chat-reply-btn:hover { color: var(--lime); }
.chat-msg.is-mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.is-mine .chat-bubble { background: rgba(182,255,59,.12); border-color: var(--line-strong); border-radius: 14px 4px 14px 14px; }
.chat-msg.is-admin .chat-bubble { border-color: rgba(255,210,63,.55); }
.chat-share { display: flex; gap: 10px; align-items: center; margin-top: 4px; padding: 6px; border-radius: 10px; background: rgba(0,0,0,.25); }
.chat-share img { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; }
.chat-share small { display: block; color: var(--muted); }
.chat-track { align-self: center; display: flex; gap: 8px; align-items: center; font-size: .8rem; color: var(--muted);
  background: rgba(45,255,168,.06); border: 1px dashed rgba(45,255,168,.3); border-radius: 999px; padding: 4px 12px 4px 4px; max-width: 100%; }
.chat-track img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.chat-track span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-track b { color: var(--mint); }

.chat-new { position: sticky; bottom: 4px; align-self: center; z-index: 3; flex: none; }

.chat-form { border-top: 1px solid var(--line); padding: 10px 14px 12px; display: grid; gap: 8px; background: rgba(5,13,8,.5); }
.chat-profile, .chat-send { display: flex; gap: 8px; align-items: center; }
.chat-input { width: 100%; background: rgba(0,0,0,.35); border: 1px solid var(--line-strong); border-radius: 12px; padding: 9px 12px; color: var(--text); resize: none; }
.chat-input:focus { outline: none; border-color: var(--lime); }
.chat-nick { max-width: 220px; }
.chat-send textarea { max-height: 120px; }
.chat-avatar-btn { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(182,255,59,.08); font-size: 1.3rem; cursor: pointer; }
.chat-avatars { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-avatars button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: transparent; font-size: 1.2rem; cursor: pointer; }
.chat-avatars button[aria-pressed="true"] { border-color: var(--lime); background: rgba(182,255,59,.15); }
.chat-reply { display: flex; justify-content: space-between; gap: 8px; font-size: .82rem; color: var(--muted); border-left: 3px solid var(--lime); padding-left: 8px; }
.chat-reply span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-status { margin: 0; min-height: 1.2em; font-size: .82rem; color: var(--muted); }
.chat-status.is-error { color: var(--danger); }


.chat-side { display: grid; gap: 16px; position: sticky; top: 76px; }
.chat-side .card { padding: 16px; }
.chat-side h2 { font-size: 1rem; }
.chat-np .eyebrow { margin: 0 0 10px; font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.chat-np .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: var(--glow); }
.chat-np-row { display: flex; gap: 12px; align-items: center; min-width: 0; }
.chat-np-row img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; }
.chat-np-row b, .chat-np-row small { display: block; overflow-wrap: anywhere; }
.chat-people ul { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; max-height: 40vh; overflow: auto; }
.chat-people li { display: flex; gap: 8px; align-items: center; }
.chat-people li .badge { background: var(--amber); color: #1a1400; border-radius: 6px; padding: 0 6px; font-weight: 800; font-size: .68rem; }
.chat-rules { margin: 0 0 10px; }

@media (max-width: 860px) {
  .chat-layout { grid-template-columns: 1fr; padding-top: 8px; }
  .chat-side { position: static; order: -1; grid-template-columns: 1fr; }
  .chat-people { display: none; }
  .chat-np { padding: 10px 14px !important; }
  .chat-np .eyebrow { display: none; }
  .chat-np-row img { width: 40px; height: 40px; }
  .chat-box { height: calc(100dvh - 150px); }
  .chat-msg { max-width: 94%; }
}
@media (max-width: 480px) {
  .chat-back-text { display: none; }
  .chat-page .header { gap: 8px; }
  .chat-page .brand strong { font-size: .85rem; }
  .chat-page .brand small { display: none; }
  .chat-profile { flex-wrap: wrap; }
  .chat-nick { max-width: none; flex: 1; }
  .chat-profile [data-share] { width: 100%; }
  .chat-send .btn { padding: 10px 14px; }
}

.chat-page .header-actions .btn--lime { display: inline-flex; }

/* Внутри панели на главной (iframe): без шапки и своего плеера — играет плеер сайта */
.is-embed .chat-page .header, .is-embed .chat-page .bg, .is-embed [data-chat-audio] { display: none; }
.is-embed .chat-page { background: var(--bg-2); height: 100dvh; min-height: 0; overflow: hidden; }
.is-embed .chat-layout { display: flex; flex-direction: column; height: 100dvh; min-height: 0; max-width: none; padding: 8px; gap: 8px; }
.is-embed .chat-side { order: -1; position: static; }
.is-embed .chat-people { display: none; }
.is-embed .chat-np { padding: 8px 12px !important; }
.is-embed .chat-np .eyebrow { display: none; }
.is-embed .chat-np-row img { width: 40px; height: 40px; }
.is-embed .chat-box { flex: 1; height: auto; min-height: 0; }
.is-embed .chat-head { display: none; }
.is-embed .chat-msg { max-width: 94%; }

/* Длинные названия треков не должны распирать ленту */
.chat-box, .chat-side, .chat-list, .chat-form { min-width: 0; }
.is-embed .chat-box, .is-embed .chat-side { width: 100%; }
.chat-track { min-width: 0; }
.chat-np-row > div { min-width: 0; }
