/* 3am.chat — чат как приложение: сайдбар + сцена, композер прибит к низу.
   Токены только из site.css. Никаких внешних ресурсов. */

/* ============================================================
   1. Каркас страницы: /chat не скроллится, скроллится только лента
   ============================================================ */

body.page-chat {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
body.page-chat > main {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
/* футер сайта на странице-приложении мешает; юридические ссылки продублированы
   в сайдбаре, в верхней полосе сцены и под кнопкой старта */
body.page-chat .site-footer { display: none; }

.chat-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.chat-app {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
}

/* ============================================================
   2. Сайдбар — «ночные знакомые»
   ============================================================ */

.side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: rgba(9, 12, 28, 0.5);
}
.side-head { padding: 16px 18px 8px; flex: none; }
.side-title {
  margin: 0;
  font: 800 12px/1.3 var(--body);
  font-variation-settings: normal;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.side-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 12px 14px;
}
.side-foot {
  flex: none;
  border-top: 1px solid var(--line);
  padding: 12px 16px 14px;
}
.side-foot .fine { margin: 10px 0 0; }

.friends-list { display: grid; gap: 2px; }
.friend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--r-sm);
  transition: background 0.15s ease;
}
.friend-row:hover { background: rgba(233, 236, 255, 0.04); }
.friend-row .avatar { width: 40px; height: 40px; border-radius: 12px; }
.friend-who { flex: 1 1 auto; min-width: 0; }
.friend-nick,
.friend-who b {
  display: flex;
  align-items: center;
  gap: 7px;
  font: 700 15px/1.3 var(--body);
  color: var(--ink);
  overflow-wrap: anywhere;
}
.friend-sub,
.friend-since,
.friend-last { font-size: 12.5px; color: var(--ink-faint); line-height: 1.35; }
.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-faint);
  flex: none;
}
.online-dot.on,
.friend-row.online .online-dot {
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(143, 217, 182, 0.14);
}
.friend-acts { display: flex; align-items: center; gap: 6px; flex: none; }
.btn-x {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  border: 1px solid transparent;
  background: none;
  color: var(--ink-faint);
  cursor: pointer;
  font: 700 16px/1 var(--body);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.btn-x:hover { color: var(--rose); border-color: rgba(242, 154, 154, 0.35); }
/* подтверждение удаления и служебные ответы сайдбара */
.btn-mini.confirm { color: var(--rose); border-color: rgba(242, 154, 154, 0.45); }
.side-note {
  margin: 10px 0 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(21, 27, 56, 0.6);
  color: var(--ink-dim);
  font-size: 13px;
  line-height: 1.4;
}

.friends-empty {
  color: var(--ink-faint);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 6px 8px 16px;
}

.push-plate {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 11px;
  text-align: left;
  background: rgba(11, 14, 32, 0.5);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 14px;
  color: var(--ink-dim);
  cursor: pointer;
  font: 600 14px/1.35 var(--body);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.push-plate:hover { border-color: var(--amber); color: var(--ink); }
.push-plate svg { flex: none; color: var(--amber); margin-top: 1px; }
.push-copy { min-width: 0; }
.push-plate small { display: block; font-weight: 400; color: var(--ink-faint); margin-top: 3px; font-size: 12.5px; }
.push-plate.on { border-color: rgba(143, 217, 182, 0.4); }
.push-plate.on svg { color: var(--mint); }

/* ============================================================
   3. Сцена
   ============================================================ */

.stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.stage-top {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 12, 28, 0.4);
}
.stage-tag {
  margin: 0 auto 0 0;
  font-size: 12.5px;
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stage-tag a { color: var(--ink-dim); }
.stage-tag a:hover { color: var(--amber); }

.side-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  flex: none;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--sky-2);
  color: var(--ink-dim);
  font: 700 13.5px/1 var(--body);
  cursor: pointer;
}
.side-toggle:hover { color: var(--moon); border-color: var(--ink-faint); }
.side-toggle svg { flex: none; }

.stage-body {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  position: relative;
  display: flex;
}
.stage-body > section {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

/* ============================================================
   4. Комната ожидания
   ============================================================ */

.panel-wait {
  display: flex;
  overflow-y: auto;
  padding: 26px 20px 40px;
}
.wait-col {
  margin: auto;
  width: min(620px, 100%);
  text-align: center;
}
#wait-title { font-size: clamp(26px, 3.4vw, 34px); color: var(--moon); margin-bottom: 6px; }
.panel-sub { color: var(--ink-dim); margin-bottom: 20px; }
#start { display: flex; width: 100%; max-width: 340px; margin-inline: auto; }
.cta-agree { margin-inline: auto; }
.avg-wait { color: var(--ink-faint); font-size: 14.5px; margin: 14px 0 0; }
#queue-slow { text-align: left; margin: 16px auto 0; max-width: 460px; }

.wait-vignette { margin: 22px auto 0; max-width: 340px; }
.wait-vignette svg,
.search-scene svg { display: block; width: 100%; height: auto; }
.search-scene { margin: 0 auto; max-width: 340px; }

/* карточки под сценой */
.wait-card {
  margin-top: 18px;
  text-align: left;
  background: rgba(11, 14, 32, 0.45);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
}
.sub-h {
  font: 800 12px/1 var(--body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 12px;
}
.sub-h .hint { text-transform: none; letter-spacing: 0; font-weight: 600; }

.id-row { display: flex; gap: 10px; align-items: center; }
.id-row input {
  flex: 1;
  font: 600 16.5px/1.4 var(--body);
  color: var(--ink);
  background: var(--sky-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 12px 15px;
  min-width: 0;
}
.id-row input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-glow);
}
.dice {
  flex: none;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--sky-2);
  color: var(--amber);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, border-color 0.15s ease;
}
.dice:hover { border-color: var(--amber); transform: rotate(-20deg); }

/* аватар: пресетная иконка + цвет фона либо своё фото (после премодерации) */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: var(--moon);
  background: #2e3565;
  flex: none;
  overflow: hidden;
}
.av-indigo { background: #2e3565; }
.av-plum { background: #4a2e5c; }
.av-teal { background: #1e4d4c; }
.av-amber { background: #5c431f; }
.av-rose { background: #5a2e3a; }
.av-forest { background: #2c4a33; }
.av-slate { background: #37415a; }
.av-midnight { background: #1a2040; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

.avatar-btn {
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: none;
  cursor: pointer;
  flex: none;
  transition: border-color 0.15s ease;
}
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { border-color: var(--amber); }

.avatar-picker { margin-top: 14px; }
.picker-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.picker-grid .avatar { cursor: pointer; border: 2px solid transparent; }
.picker-grid .avatar.on { border-color: var(--amber); }
.picker-colors { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.picker-colors button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}
.picker-colors button.on { border-color: var(--amber); }

.photo-box {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.photo-note { flex-basis: 100%; color: var(--ink-faint); font-size: 12.5px; margin: 4px 0 0; }
.photo-note.pending { color: var(--amber); }
.photo-note.live { color: var(--mint); }

.topic-hint { color: var(--ink-faint); font-size: 13.5px; margin: 12px 0 0; }
.fine { color: var(--ink-faint); font-size: 13px; margin: 0; line-height: 1.5; }

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font: 600 13.5px/1.2 var(--body);
  color: var(--ink-dim);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 15px;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.sound-toggle:hover { border-color: var(--ink-faint); color: var(--moon); }
.sound-toggle svg { flex: none; }
.sound-toggle[aria-pressed="false"] { opacity: 0.55; }
.sound-toggle[aria-pressed="false"] .sound-waves { display: none; }

/* ============================================================
   5. Сцена поиска — окно, кот, кружка, пинг
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {
  .sc-star { animation: sc-twinkle 4.6s ease-in-out infinite; }
  .sc-s2 { animation-duration: 5.6s; animation-delay: 1.3s; }
  .sc-s3 { animation-duration: 6.4s; animation-delay: 2.6s; }
  .sc-win { animation: sc-twinkle 7s ease-in-out infinite; }
  .sc-w2 { animation-duration: 9s; animation-delay: 2.1s; }
  .sc-w3 { animation-duration: 8s; animation-delay: 4.3s; }
  @keyframes sc-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

  .sc-tail {
    transform-box: fill-box;
    transform-origin: 6% 84%;
    animation: sc-tail 3.6s ease-in-out infinite;
  }
  @keyframes sc-tail { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(9deg); } }

  .sc-eyes {
    transform-box: fill-box;
    transform-origin: 50% 50%;
    animation: sc-blink 6.5s ease-in-out infinite;
  }
  @keyframes sc-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.08); } }

  .sc-steam { animation: sc-steam 4.4s ease-in-out infinite; }
  .sc-st2 { animation-delay: 1.6s; }
  @keyframes sc-steam {
    0%, 100% { opacity: 0.2; transform: translateY(2px); }
    50% { opacity: 0.6; transform: translateY(-4px); }
  }

  .sc-glow { animation: sc-glow 4s ease-in-out infinite; }
  @keyframes sc-glow { 0%, 100% { opacity: 0.12; } 50% { opacity: 0.26; } }

  .sc-ping {
    transform-box: fill-box;
    transform-origin: 50% 50%;
    animation: sc-ping 2.7s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
  }
  .sc-p2 { animation-delay: 0.9s; }
  .sc-p3 { animation-delay: 1.8s; }
  @keyframes sc-ping {
    0% { transform: scale(0.45); opacity: 0; }
    12% { opacity: 0.42; }
    100% { transform: scale(2.1); opacity: 0; }
  }
}
.sc-ping { opacity: 0; }
.sc-glow { opacity: 0.16; }

/* ============================================================
   6. Показ найденного собеседника
   ============================================================ */

.reveal {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: rgba(7, 10, 24, 0.88);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.reveal-card { max-width: 340px; }
.reveal .avatar {
  width: 96px;
  height: 96px;
  border-radius: 28px;
  box-shadow: 0 0 0 1px var(--line-strong), 0 18px 60px -12px var(--amber-glow);
}
.reveal-nick {
  font: 560 26px/1.2 var(--display);
  font-variation-settings: "opsz" 60;
  color: var(--moon);
  margin-top: 16px;
  overflow-wrap: anywhere;
}
.reveal-note { color: var(--ink-dim); font-size: 15px; margin: 6px 0 0; }

@media (prefers-reduced-motion: no-preference) {
  .reveal .avatar { animation: reveal-pop 0.34s cubic-bezier(0.2, 0.8, 0.3, 1.1) both; }
  .reveal-nick { animation: reveal-up 0.3s ease 0.1s both; }
  .reveal-note { animation: reveal-up 0.3s ease 0.16s both; }
  @keyframes reveal-pop {
    from { transform: scale(0.8); opacity: 0; box-shadow: 0 0 0 1px var(--line-strong), 0 0 0 rgba(255, 182, 92, 0); }
    to { transform: none; opacity: 1; }
  }
  @keyframes reveal-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* ============================================================
   7. Разговор
   ============================================================ */

.panel-chat { display: flex; flex-direction: column; }

.chat-top {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px max(16px, calc((100% - 900px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(9, 12, 28, 0.5);
}
.peer-meta { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1 1 190px; }
.peer-meta .avatar { width: 42px; height: 42px; border-radius: 13px; }
.peer-who { min-width: 0; }
.peer-name { font: 700 16.5px/1.25 var(--body); color: var(--moon); overflow-wrap: anywhere; }
.peer-status { font-size: 12.5px; color: var(--ink-faint); }
.peer-status.live { color: var(--mint); }

.chat-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  font: 700 13px/1 var(--body);
  color: var(--ink-dim);
  background: var(--sky-2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 13px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.btn-mini:hover { color: var(--moon); border-color: var(--ink-faint); }
.btn-mini.warn:hover { color: var(--rose); border-color: var(--rose); }
.btn-mini.friend { color: var(--amber); border-color: rgba(255, 182, 92, 0.4); }
.btn-mini.friend:hover { border-color: var(--amber); color: var(--moon); }
.btn-mini.on { color: var(--mint); border-color: rgba(143, 217, 182, 0.45); }
.btn-mini[disabled] { opacity: 0.5; cursor: default; }

.msgs {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px max(16px, calc((100% - 900px) / 2));
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.day-sep {
  align-self: center;
  margin: 10px 0 4px;
  padding: 6px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(11, 14, 32, 0.6);
  color: var(--ink-faint);
  font: 800 11px/1 var(--body);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.m-row { display: flex; flex-direction: column; max-width: 78%; }
.m-row.me { align-self: flex-end; align-items: flex-end; }
.m-row.peer { align-self: flex-start; align-items: flex-start; }
.bubble {
  padding: 10px 15px;
  border-radius: 16px;
  font-size: 15.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.m-row.peer .bubble {
  background: var(--sky-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-bottom-left-radius: 6px;
}
.m-row.me .bubble {
  background: linear-gradient(180deg, rgba(255, 182, 92, 0.16), rgba(255, 182, 92, 0.10));
  border: 1px solid rgba(255, 182, 92, 0.28);
  color: var(--ink);
  border-bottom-right-radius: 6px;
}
.m-time { font-size: 11.5px; color: var(--ink-faint); margin-top: 3px; padding: 0 4px; }
.m-sys {
  align-self: center;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-faint);
  background: rgba(21, 27, 56, 0.55);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  max-width: 92%;
}
.m-sys.warn { color: var(--rose); border-color: rgba(242, 154, 154, 0.35); }
.m-sys.good { color: var(--mint); border-color: rgba(143, 217, 182, 0.35); }

.typing {
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 max(16px, calc((100% - 900px) / 2)) 8px;
  color: var(--ink-faint);
  font-size: 13px;
}
.typing-dots { display: inline-flex; gap: 4px; }
.typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-faint);
  display: inline-block;
}
@media (prefers-reduced-motion: no-preference) {
  .typing-dots i { animation: t-bounce 1.2s ease-in-out infinite; }
  .typing-dots i:nth-child(2) { animation-delay: 0.15s; }
  .typing-dots i:nth-child(3) { animation-delay: 0.3s; }
  @keyframes t-bounce { 0%, 60%, 100% { transform: none; opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }
}

/* ---------- композер ---------- */

.composer {
  flex: none;
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px max(16px, calc((100% - 900px) / 2));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(9, 12, 28, 0.55);
}
.composer textarea {
  flex: 1 1 auto;
  resize: none;
  font: 400 16px/1.45 var(--body);
  color: var(--ink);
  background: var(--sky-2);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 12px 15px;
  min-height: 46px;
  max-height: 140px;
  min-width: 0;
  overflow-y: auto;
  /* полосы прокрутки в поле ввода не показываем никогда */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.composer textarea::-webkit-scrollbar { display: none; width: 0; height: 0; }
.composer textarea:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-glow);
}
.emoji-btn {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--sky-2);
  color: var(--ink-dim);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.emoji-btn:hover, .emoji-btn[aria-expanded="true"] { border-color: var(--amber); }
.send {
  flex: none;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--amber), var(--amber-deep));
  color: var(--amber-ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}
.send:hover { transform: translateY(-1px); }
.send:disabled { opacity: 0.45; cursor: default; transform: none; }

.emoji-panel {
  position: absolute;
  bottom: calc(100% - 4px);
  left: max(16px, calc((100% - 900px) / 2));
  z-index: 8;
  width: min(336px, calc(100% - 32px));
  max-height: 232px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 10px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
}
.emoji-panel button {
  font-size: 19px;
  line-height: 1;
  padding: 8px 0;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  color: inherit;
}
.emoji-panel button:hover { background: rgba(255, 182, 92, 0.14); }

/* ============================================================
   8. Закрытая сессия
   ============================================================ */

.panel-center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  overflow-y: auto;
}
.panel-center h2 { color: var(--moon); }
.panel-center p { color: var(--ink-dim); }

/* ============================================================
   9. Тосты: заявка в друзья и «постучались»
   ============================================================ */

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 55;
  width: min(390px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--amber);
  border-radius: var(--r-md);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.toast .avatar { width: 42px; height: 42px; border-radius: 13px; }
.toast-text { flex: 1 1 auto; margin: 0; font-size: 14.5px; color: var(--ink-dim); overflow-wrap: anywhere; }
.toast-text b { color: var(--moon); }
.toast-actions { display: flex; flex-direction: column; gap: 7px; flex: none; }
.toast-actions .btn { padding: 9px 16px; font-size: 13.5px; }
/* если пришли оба — второй встаёт над первым */
.toast:not([hidden]) ~ .toast { bottom: 116px; }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in 0.3s ease both; }
  @keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}

/* ============================================================
   10. Модал жалобы
   ============================================================ */

.report-card { text-align: left; }
.report-card h2 { text-align: center; }
.report-card > p { text-align: center; }
.report-opts { display: grid; gap: 9px; margin: 18px 0 14px; }
.report-opts label {
  display: flex;
  gap: 11px;
  align-items: center;
  background: var(--sky-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  color: var(--ink-dim);
  font-size: 15px;
  cursor: pointer;
}
.report-opts label:has(input:checked) {
  border-color: var(--amber);
  color: var(--ink);
  background: rgba(255, 182, 92, 0.08);
}
.report-opts input { accent-color: var(--amber); width: 17px; height: 17px; flex: none; }
.report-card textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  font: 400 15px/1.5 var(--body);
  color: var(--ink);
  background: var(--sky-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  margin-bottom: 16px;
}

/* ============================================================
   11. Узкие экраны: сайдбар уезжает за край
   ============================================================ */

@media (max-width: 900px) {
  .chat-app { grid-template-columns: minmax(0, 1fr); }
  .side-toggle { display: inline-flex; }

  .side {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 45;
    width: min(300px, 80vw);
    border-right: 1px solid var(--line-strong);
    background: linear-gradient(180deg, var(--sky-2), var(--sky-1));
    box-shadow: var(--shadow);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  /* открытие — какой бы хук ни выбрал клиент */
  .side.open,
  .chat-app.side-open .side,
  body.side-open .side { transform: none; }
  .chat-app:has(#side-toggle[aria-expanded="true"]) .side { transform: none; }

  .chat-app::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 44;
    background: rgba(5, 7, 18, 0.62);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .chat-app.side-open::after,
  body.side-open .chat-app::after { opacity: 1; }
  .chat-app:has(.side.open)::after,
  .chat-app:has(#side-toggle[aria-expanded="true"])::after { opacity: 1; }

  .side .btn-mini, .side .push-plate, .side .sound-toggle { min-height: 44px; }
  .btn-x { width: 40px; height: 40px; }
}

@media (max-width: 620px) {
  .stage-top { padding: 6px 12px; }
  .stage-tag { font-size: 12px; }
  .panel-wait { padding: 20px 14px 34px; }
  .wait-card { padding: 15px; }
  .chat-top { padding: 9px 12px; gap: 8px; }
  .msgs { padding: 14px 12px; gap: 9px; }
  .m-row { max-width: 88%; }
  .typing { padding: 0 12px 7px; }
  .composer { padding-left: 12px; padding-right: 12px; }
  .emoji-panel { left: 12px; width: calc(100% - 24px); grid-template-columns: repeat(7, 1fr); }
  .chat-actions .btn-mini { min-height: 40px; }
  .toast {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
  .toast:not([hidden]) ~ .toast { bottom: calc(172px + env(safe-area-inset-bottom)); }
  .toast-actions { flex-direction: row; }
  .reveal .avatar { width: 84px; height: 84px; border-radius: 24px; }
}

@media (max-width: 380px) {
  .side-toggle span { display: none; }
  .side-toggle { padding: 8px 11px; }
}
