/* ═══ Видеозвонки ═══ */

.call-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur-thin)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur-thin)) saturate(150%);
  border-bottom: 2px solid var(--accent);
  padding: 0;
  animation: slideDown 0.3s ease;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.call-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid var(--border);
  gap: 8px;
  flex-shrink: 0;
}

.call-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.call-title {
  font: var(--font-callout);
  font-weight: 600;
  color: var(--text-primary);
}

.call-timer {
  font: var(--font-caption);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.call-status {
  font: var(--font-caption);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(46, 204, 113, 0.2);
  color: var(--success);
}

.call-controls {
  display: flex;
  gap: 4px;
  /* B-025.02 (Фаза 6 Заход 1): wrap чтобы hangup не уезжал за экран на мобилке */
  flex-wrap: wrap;
  justify-content: center;
}

/* Фаза 6 Заход 2 (B-025.03): иконки lucide внутри кнопок не должны перехватывать тач/клик —
   иначе на iOS Safari тап по svg не доходит до родительского button с onclick. */
.icon-btn > i,
.icon-btn > svg,
button > i[data-lucide],
button > svg.lucide,
.attach-action > i,
.attach-action > svg {
  pointer-events: none;
}

/* Фаза 6 Заход 2 (B-025.02): баннер звонка над списком сообщений — длинные имена должны переноситься,
   а не растягивать строку и не выталкивать кнопку «Присоединиться». */
.call-banner {
  flex-wrap: wrap;
  gap: 8px;
}
.call-banner-text {
  flex: 1 1 60%;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.call-banner-btn {
  flex: 0 0 auto;
}

@media (max-width: 768px) {
  .call-controls {
    padding: 6px 8px;
    gap: 6px;
  }
  /* красная «положить трубку» всегда последней при wrap */
  .call-btn.hangup { order: 99; }
}

.call-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.15);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.call-setting {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font: var(--font-caption);
  color: var(--text-secondary);
}

.call-select {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-xs);
  padding: 6px 8px;
  font: var(--font-caption);
}

.call-setting input[type="range"] {
  width: 100%;
}

.call-btn {
  background: var(--bg-hover);
  border: 2px solid transparent;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0.5;
  position: relative;
}

.call-btn.active {
  opacity: 1;
  background: rgba(10, 132, 255, 0.3);
  border-color: rgba(10, 132, 255, 0.5);
  box-shadow: 0 0 8px rgba(10, 132, 255, 0.3);
}

.call-btn.muted {
  opacity: 1;
  background: rgba(231, 76, 60, 0.15);
  border-color: rgba(231, 76, 60, 0.4);
}

.call-btn.muted::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 60%;
  background: var(--danger);
  transform: rotate(45deg);
  border-radius: 2px;
}

.call-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.call-btn.hangup {
  background: rgba(231, 76, 60, 0.3);
  border-color: rgba(231, 76, 60, 0.5);
  opacity: 1;
}

.call-btn.hangup:hover {
  background: rgba(231, 76, 60, 0.6);
  box-shadow: 0 0 12px rgba(231, 76, 60, 0.4);
}

.call-btn:hover:not(.disabled) {
  opacity: 1;
  background: var(--bg-hover);
  transform: scale(1.1);
}

/* ─── Индикатор screen share ─── */
.screen-share-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.15), rgba(231, 76, 60, 0.05));
  border-bottom: 1px solid rgba(231, 76, 60, 0.3);
  color: var(--danger);
  font: var(--font-caption);
  font-weight: 500;
  animation: pulseGlow 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulseGlow {
  0%, 100% { background: linear-gradient(135deg, rgba(231, 76, 60, 0.15), rgba(231, 76, 60, 0.05)); }
  50% { background: linear-gradient(135deg, rgba(231, 76, 60, 0.25), rgba(231, 76, 60, 0.1)); }
}

.screen-share-banner .stop-share-btn {
  padding: 3px 12px;
  border: 1px solid rgba(231, 76, 60, 0.5);
  border-radius: var(--radius-xs);
  background: rgba(231, 76, 60, 0.2);
  color: var(--danger);
  cursor: pointer;
  font: var(--font-caption);
  transition: all 0.2s;
}

.screen-share-banner .stop-share-btn:hover {
  background: rgba(231, 76, 60, 0.4);
}

/* ─── Секция участников (камеры) — сверху ─── */
.call-participants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.call-participants:empty {
  display: none;
}

/* ─── Карточка участника (камера) ─── */
.call-participant {
  position: relative;
  width: 160px;
  height: 120px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.call-participant.local {
  border-color: var(--accent);
}

/* ─── Аватарка (видна когда камера выключена) ─── */
.call-participant-avatar {
  font-size: 2.8rem;
  color: var(--text-primary);
  user-select: none;
  pointer-events: none;
  z-index: 1;
  line-height: 1;
}

.call-participant.has-video .call-participant-avatar {
  display: none;
}

/* ─── Видео участника ─── */
.call-participant video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s;
}

.call-participant.has-video video {
  opacity: 1;
}

/* ─── Лейбл участника ─── */
.call-participant-label {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font: var(--font-caption);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  pointer-events: none;
  z-index: 5;
  max-width: calc(100% - 16px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* (удалены мёртвые legacy-правила .call-participant.zoomed / .screen-sharing —
   эти классы в новой плиточной модели не выставляются; зум живёт на .screen-tile video) */

.call-volume {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 70px;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 5;
}

.call-participant:hover .call-volume {
  opacity: 0.9;
}

/* ═══ Настройки: звук ═══ */

.setting-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-sm {
  padding: 4px 10px;
  font: var(--font-caption);
  border-radius: var(--radius-sm);
}

/* ═══ Мобильные адаптации для новых элементов ═══ */

@media (max-width: 768px) {
  .emoji-picker {
    max-height: 250px;
  }
  
  .emoji-item {
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
  }
  
  .call-participants {
    max-height: 200px;
    overflow-y: auto;
  }
  
  .call-participant {
    width: 100px;
    height: 75px;
  }
  
  .call-btn {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
  
  .admin-keys-stats {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .admin-keys-actions {
    flex-direction: column;
  }
  
  .msg-quick-reactions {
    flex-wrap: wrap;
  }
  
  .invite-link-display {
    flex-wrap: wrap;
  }
}

/* ═══════════════════════════════════════════════════════
   Новые стили — сессии, звонки, непрочитанные, @mention
   ═══════════════════════════════════════════════════════ */

/* ─── Session replaced overlay ─────────────────────── */
.session-replaced-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  backdrop-filter: blur(6px);
}
.session-replaced-box {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur-thin)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur-thin)) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 2.5rem 3rem;
  text-align: center;
  max-width: 360px;
}
.session-replaced-box h2 {
  margin: 0.8rem 0 0.4rem;
  font-size: 1.3rem;
}
.session-replaced-box p {
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
}
.session-replaced-box .btn-primary {
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
}
.session-replaced-box .btn-primary:hover {
  background: var(--accent-hover);
}

/* ─── Call settings toggle ─────────────────────────── */
.call-settings.hidden {
  display: none;
}
#call-settings-panel {
  animation: slideDownFade 0.2s ease;
}
@keyframes slideDownFade {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 300px; }
}

/* ─── Peer media icons ─────────────────────────────── */
.peer-media-icons {
  position: absolute;
  bottom: 28px;
  left: 6px;
  display: flex;
  gap: 4px;
  z-index: 5;
}
.peer-icon {
  font-size: 0.85rem;
  opacity: 0.9;
  filter: none;
}
.peer-icon.off {
  opacity: 0.35;
  text-decoration: line-through;
}

/* ─── Peer avatar (camera off) — handled by .call-participant-avatar + .has-video ─── */

/* ─── Call banner (active call in room) ────────────── */
.call-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, rgba(48,209,88,0.15), rgba(10,132,255,0.1));
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font: var(--font-body);
  animation: pulse-bg 2s infinite;
}
@keyframes pulse-bg {
  0%, 100% { background-color: rgba(46, 204, 113, 0.1); }
  50% { background-color: rgba(46, 204, 113, 0.2); }
}
.call-banner .btn-sm {
  padding: 0.3rem 0.8rem;
  font: var(--font-caption);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* ─── Unread badge ─────────────────────────────────── */
.unread-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  margin-top: 4px;
}
.room-item.has-unread .room-name {
  font-weight: 700;
  color: #fff;
}
.room-item.has-unread .room-last-msg {
  color: var(--text-primary);
}

/* ─── Room icons (call, public) ────────────────────── */
.room-call-icon {
  font-size: 0.75rem;
  margin-right: 2px;
  animation: ringing 1s infinite;
}
@keyframes ringing {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(10deg); }
  75% { transform: rotate(-10deg); }
}
/* .room-public-icon — стили в P-09 (refine) выше, дубль удалён (цикл 2) */

/* ─── Room context menu (RMB) ──────────────────────── */
.room-context-menu {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  min-width: 200px;
  box-shadow: 0 4px 16px var(--shadow);
  z-index: 10000;
  overflow: hidden;
}
.room-context-menu .ctx-item {
  padding: 0.6rem 1rem;
  cursor: pointer;
  font: var(--font-body);
  transition: background var(--transition);
}
.room-context-menu .ctx-item:hover {
  background: var(--bg-hover);
}

/* ─── @Mention highlight ───────────────────────────── */
.mention {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}
.mention.mention-me {
  background: rgba(10, 132, 255, 0.2);
  border-radius: 3px;
  padding: 1px 3px;
}

/* ─── Mention autocomplete picker ──────────────────── */
.mention-picker {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur-thin)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur-thin)) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 -4px 16px var(--shadow);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  transition: background var(--transition);
}
.mention-item:hover {
  background: var(--bg-hover);
}
.mention-emoji {
  font-size: 1.2rem;
}

/* ─── Call owner controls ──────────────────────────── */
.call-peer-controls {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 2px;
  z-index: 5;
  opacity: 0;
  transition: opacity var(--transition);
}
.call-participant:hover .call-peer-controls {
  opacity: 1;
}
.call-peer-ctrl-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.call-peer-ctrl-btn:hover {
  background: rgba(231, 76, 60, 0.8);
}

/* ─── Mobile ───────────────────────────────────────── */
@media (max-width: 768px) {
  .session-replaced-box {
    padding: 1.5rem;
    margin: 1rem;
  }
  .mention-picker {
    max-height: 150px;
  }
  .res-grid {
    grid-template-columns: 1fr !important;
  }
  .notification-popup-container {
    top: max(0.5rem, env(safe-area-inset-top, 0px));
    right: 0.5rem;
    left: 0.5rem;
    max-width: none;
    width: auto;
  }
  .notification-popup {
    padding: 0.6rem 0.7rem;
  }
  .notif-popup-text {
    font-size: 0.78rem;
    -webkit-line-clamp: 1;
  }
}

/* ─── Resource monitor ─────────────────────────────── */
.res-header {
  padding: 0.6rem 0.8rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}
.res-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.6rem;
}
.res-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
}
.res-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}
.res-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.res-bar {
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  margin-top: 0.4rem;
  overflow: hidden;
}
.res-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s ease;
}
.res-bar-fill.heap {
  background: var(--success);
}
.res-chart {
  padding: 0.5rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.res-chart-wrap {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
}
.res-chart-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}
.res-svg {
  width: 100%;
  height: 50px;
}

/* Onboarding */
.onboarding-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000; animation: fadeIn .25s ease;
}
.onboarding-modal {
  background: var(--bg-secondary, #1e1e24); color: var(--text-primary, #fff);
  border-radius: 16px; padding: 28px; max-width: 480px; width: 92vw;
  box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: slideUp .3s ease;
}
.onboarding-modal h2 { margin: 0 0 8px; font-size: 22px; }
.onboarding-modal p { margin: 0 0 16px; opacity: .8; }
.onboarding-list { list-style: none; padding: 0; margin: 0 0 20px; }
.onboarding-list li { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 14px; line-height: 1.5; }
.onboarding-list li:last-child { border-bottom: none; }
.onboarding-close {
  display: block; width: 100%; padding: 12px; border: none;
  border-radius: 10px; background: var(--accent, #6366f1); color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer; transition: opacity .15s;
}
.onboarding-close:hover { opacity: .9; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }


/* Push status + iOS install instructions */
.push-status { font-weight:600; font-size:13px; margin-left:4px; }
.push-status.status-ok { color:#7ad97a; }
.push-status.status-warn { color:#f0b060; }
.push-status.status-err { color:#ff6b6b; }
.ios-install-steps { padding-left:22px; line-height:1.8; color:var(--text, #e4e4f0); }
.ios-install-steps li { margin-bottom:6px; }
.ios-install-steps .ios-icon { display:inline-block; padding:0 8px; background:rgba(255,255,255,.08); border-radius:6px; margin:0 2px; }
.ios-install-note { margin-top:14px; padding:10px 14px; background:rgba(120,160,255,.1); border-left:3px solid #6088ff; border-radius:6px; font-size:13px; display:flex; gap:8px; align-items:center; }

/* ═══════════════════════════════════════════════════════════
   c001 — Серия правок (8 багов): Apple-Glass слайдеры,
   view-режимы, перекомпоновка плитки звонка, яркость иконок,
   компактные публичные комнаты
   ═══════════════════════════════════════════════════════════ */

/* ─── View-modes (для тестирования из админки) ─── */
html.view-mobile-ios body,
body.view-mobile-ios,
html.view-mobile-android body,
body.view-mobile-android {
  max-width: 390px;
  margin: 0 auto !important;
  min-height: 100vh;
  box-shadow: 0 0 60px rgba(0,0,0,0.6);
  border-left: 6px solid #1a1a1a;
  border-right: 6px solid #1a1a1a;
  position: relative;
  overflow-x: hidden;
}
html.view-mobile-android body,
body.view-mobile-android { max-width: 412px; }

html.view-desktop body,
body.view-desktop {
  min-width: 1280px;
  margin: 0 auto;
}

/* Бейдж-индикатор сверху, чтобы было видно режим */
body.view-mobile-ios::before,
body.view-mobile-android::before,
body.view-desktop::before {
  content: '🍎 iOS preview';
  position: fixed;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  background: rgba(108,92,231,0.92);
  color: #fff;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
body.view-mobile-android::before { content: '🤖 Android preview'; background: rgba(76,175,80,0.92); }
body.view-desktop::before { content: '🖥 Desktop preview'; background: rgba(33,150,243,0.92); }

/* ─── Apple-Glass ползунки (глобально) ─── */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: rgba(255,255,255,0.08);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  transition: background 0.3s cubic-bezier(0.4,0,0.2,1), border-color 0.3s cubic-bezier(0.4,0,0.2,1);
}
input[type="range"]:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.14);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: linear-gradient(145deg, #ffffff 0%, #e8e8ee 100%);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.35),
    0 1px 2px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.9);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), box-shadow 0.25s cubic-bezier(0.4,0,0.2,1);
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.18);
  box-shadow:
    0 4px 12px rgba(108,92,231,0.5),
    0 2px 4px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,1);
}
input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.05);
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: linear-gradient(145deg, #ffffff 0%, #e8e8ee 100%);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.9);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}
input[type="range"]::-moz-range-thumb:hover { transform: scale(1.18); }
input[type="range"]::-moz-range-track {
  background: transparent;
  border: none;
  height: 6px;
}

/* ─── Звонок: яркие иконки кнопок (фикс «не видно в тёмной») ─── */
.call-btn {
  opacity: 0.92 !important;
  color: #ffffff !important;
}
.call-btn i,
.call-btn svg {
  color: #ffffff !important;
  stroke: currentColor !important;
}
.call-btn:hover {
  opacity: 1 !important;
}
.call-btn.disabled {
  opacity: 0.4 !important;
}

/* ─── Звонок: панель настроек не должна растягиваться ─── */
.call-settings-panel,
.call-settings,
#call-settings-panel {
  max-width: 100%;
  box-sizing: border-box;
}

/* ─── Звонок: плитка участника — громкость снизу, контролы сверху ─── */
.call-volume {
  position: absolute !important;
  top: auto !important;
  right: 8px !important;
  bottom: 8px !important;
  left: 8px !important;
  width: auto !important;
  max-width: none !important;
  height: 6px;
  z-index: 6;
  /* Apple-Glass для звонка */
  background: rgba(0,0,0,0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.4,0,0.2,1);
}
.call-participant:hover .call-volume,
.call-participant:focus-within .call-volume {
  opacity: 0.95 !important;
}
/* Контролы (мут/кик) — ровно сверху-справа, поверх всего */
.call-peer-controls {
  z-index: 7 !important;
}

/* ─── Публичные комнаты: вертикальная раскладка (c002 #5) ─── */
/* Имя комнаты — сверху, статус посередине, кнопка снизу. */
/* Кнопка не перекрывает название, всегда видно куда жмёшь. */
.public-room-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  padding: 0.7rem 0.85rem !important;
  gap: 0.45rem !important;
}
.public-room-info {
  flex: 0 0 auto;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.public-room-name {
  white-space: normal !important;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  line-height: 1.25;
  font-weight: 600;
}
.public-room-meta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.78rem;
  opacity: 0.75;
}
.public-room-item .btn-sm,
.public-room-item button {
  width: 100% !important;
  padding: 0.45rem 0.8rem !important;
  font-size: 0.85rem !important;
  flex-shrink: 0;
  min-width: 0;
  white-space: nowrap;
  text-align: center;
  margin-top: 0.15rem;
}

/* ─── Apple-Glass тумблер (c002 #4) ─── */
/* Используется в модалке создания комнаты вместо чекбокса. */
/* Стиль повторяет глянцевые контролы из настроек звонков. */
.apple-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.apple-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.apple-toggle-track {
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.32);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  flex-shrink: 0;
}
.apple-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #f3f3f5 100%);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
  transition: transform 0.25s cubic-bezier(0.4, 0.0, 0.2, 1), background 0.25s ease;
}
.apple-toggle input[type="checkbox"]:checked + .apple-toggle-track {
  background: linear-gradient(180deg, rgba(48, 209, 88, 0.95) 0%, rgba(40, 180, 75, 0.95) 100%);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18), 0 0 12px rgba(48, 209, 88, 0.35);
}
.apple-toggle input[type="checkbox"]:checked + .apple-toggle-track .apple-toggle-thumb {
  transform: translateX(18px);
}
.apple-toggle input[type="checkbox"]:focus-visible + .apple-toggle-track {
  outline: 2px solid rgba(0, 122, 255, 0.55);
  outline-offset: 2px;
}
.apple-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  line-height: 1.25;
}
.apple-toggle-label i,
.apple-toggle-label svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.85;
}

/* ─── Update banner: кнопка действия (c002 #1) ─── */
.update-banner-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.update-banner-actions button {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.88rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.update-banner-actions .btn-update-now {
  background: linear-gradient(180deg, rgba(0, 122, 255, 0.95) 0%, rgba(0, 100, 220, 0.95) 100%);
  border-color: rgba(255, 255, 255, 0.28);
  font-weight: 600;
}

/* ─── Samsung Browser warning banner (Android push c001) ─── */
.samsung-browser-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  max-width: 92vw;
  width: 420px;
  z-index: 99998;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.95), rgba(244, 67, 54, 0.95));
  color: #fff;
  font-size: 0.85rem;
  line-height: 1.35;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: samsung-banner-in 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.samsung-browser-banner span { flex: 1; }
.samsung-browser-banner button {
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.samsung-browser-banner button:hover { background: rgba(255, 255, 255, 0.32); }
@keyframes samsung-banner-in {
  from { opacity: 0; transform: translate(-50%, 24px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ═══ [B-018] Звонок — glass + адаптив ═══════════════════════════════════════ */
/* Цель: 1) кнопки в шапке чата (позвонить/искать/инфо) — стеклянные как в боковой панели;
        2) внутри звонка — стекло на крупных кнопках, селектах оборудования и ползунках;
        3) убрать растягивание ползунков и баннера «Присоединиться» на всю ширину. */

/* ── Glass для трёх кнопок шапки чата ──────────────────────────────────────── */
.chat-header-actions .icon-btn {
  position: relative;
  isolation: isolate;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(255, 255, 255, 0.02) 100%
  );
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.45rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.18),
    0 1px 2px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.25s ease,
              box-shadow 0.25s ease,
              border-color 0.25s ease;
}
.chat-header-actions .icon-btn::before {
  content: '';
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 45%;
  border-radius: 9px 9px 0 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0));
  pointer-events: none;
  z-index: -1;
}
.chat-header-actions .icon-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(255,255,255,0.20) 0%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.04) 100%);
  border-color: rgba(255,255,255,0.20);
}
.chat-header-actions .icon-btn:active {
  transform: translateY(0) scale(0.96);
}

/* ── Glass для кнопок внутри звонка (mute/cam/screen/hangup) ───────────────── */
.call-btn {
  background: linear-gradient(135deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 2px 8px rgba(0,0,0,0.18);
}
.call-btn:hover:not(.disabled) {
  background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
  border-color: rgba(255,255,255,0.22);
}
/* состояния поверх стекла */
.call-btn.active {
  background: linear-gradient(135deg, rgba(10,132,255,0.45), rgba(10,132,255,0.20));
  border-color: rgba(10,132,255,0.55);
}
.call-btn.muted {
  background: linear-gradient(135deg, rgba(231,76,60,0.30), rgba(231,76,60,0.12));
  border-color: rgba(231,76,60,0.45);
}
.call-btn.hangup {
  background: linear-gradient(135deg, rgba(231,76,60,0.50), rgba(231,76,60,0.25));
  border-color: rgba(231,76,60,0.55);
}

/* ── Glass для селектов оборудования ───────────────────────────────────────── */
.call-select {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.call-select:hover,
.call-select:focus {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.22);
  outline: none;
}
.call-select option {
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* ── Стеклянные ползунки громкости/чувствительности ────────────────────────── */
.call-setting input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: transparent;
  cursor: pointer;
  margin: 6px 0;
}
.call-setting input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.22), rgba(255,255,255,0.08));
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
}
.call-setting input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.22), rgba(255,255,255,0.08));
  border: 1px solid rgba(255,255,255,0.12);
}
.call-setting input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover, #0a84ff));
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.45);
  transition: transform 0.15s ease;
}
.call-setting input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover, #0a84ff));
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.45);
}
.call-setting input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.15); }

/* ── Адаптив настроек звонка: не растягиваться, на узких — в одну колонку ── */
.call-setting {
  min-width: 0;
  max-width: 360px;
}
.call-setting input[type="range"] {
  width: 100%;
  max-width: 240px;
}
@media (max-width: 640px) {
  .call-settings {
    grid-template-columns: 1fr;
  }
  .call-setting,
  .call-setting input[type="range"] {
    max-width: 100%;
  }
}

/* ── Кнопка «Присоединиться» в баннере звонка — компактная pill ──────────── */
.call-banner {
  gap: 0.75rem;
  flex-wrap: wrap;
}
.call-banner-text {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  flex: 1 1 auto;
}
.call-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: auto;
  flex: 0 0 auto;
  padding: 0.4rem 0.9rem;
  font: var(--font-caption);
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--success, #30d158), #1faa46);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.30), 0 2px 8px rgba(0,0,0,0.20);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.call-banner-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 4px 12px rgba(0,0,0,0.25);
}
.call-banner-btn:active {
  transform: translateY(0) scale(0.97);
}
@media (max-width: 480px) {
  .call-banner-btn-label { display: none; } /* на узких экранах оставляем только иконку */
  .call-banner-btn { padding: 0.4rem 0.65rem; }
}




/* ═══ [B-020] Bundled UX fix: glass composer/room-buttons, slider anim, mobile-only emoji bar, file 2-button ═══ */

/* 1. Эмодзи-панель — только мобильная (на десктопе скрыть) */
@media (min-width: 769px) {
  #emoji-quick-bar.emoji-quick-bar { display: none !important; }
}

/* 2. Glass-эффект для composer (нижняя панель сообщения) — кнопки */
.message-input-area .icon-btn,
.message-input-area .send-btn,
.message-input-area .voice-btn,
.message-input-area .mobile-more-btn,
.message-input-area .secondary-btn,
.message-input-area label.icon-btn {
  background: rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.message-input-area .icon-btn:hover,
.message-input-area .send-btn:hover,
.message-input-area .voice-btn:hover,
.message-input-area .mobile-more-btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  transform: translateY(-1px);
}
.message-input-area .icon-btn:active,
.message-input-area .send-btn:active,
.message-input-area .voice-btn:active {
  transform: scale(0.94);
}
/* Send-кнопка — сохраняем акцентный цвет, но добавляем glass */
.message-input-area .send-btn {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.85), rgba(0, 90, 200, 0.85)) !important;
  border-color: rgba(255, 255, 255, 0.20) !important;
}
.message-input-area .send-btn:hover {
  background: linear-gradient(135deg, rgba(0, 132, 255, 0.95), rgba(0, 100, 220, 0.95)) !important;
}

/* 3. Glass-эффект для кнопок в окне настроек комнаты */
#btn-toggle-public,
#btn-leave-room,
#modal-room-info .modal-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, background 0.2s ease;
}
#btn-toggle-public:hover,
#modal-room-info .modal-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  transform: translateY(-1px);
}
#btn-leave-room {
  background: linear-gradient(135deg, rgba(255, 69, 58, 0.20), rgba(200, 40, 40, 0.20)) !important;
  border-color: rgba(255, 100, 100, 0.30) !important;
}
#btn-leave-room:hover {
  background: linear-gradient(135deg, rgba(255, 69, 58, 0.35), rgba(200, 40, 40, 0.35)) !important;
}

/* 4. Range slider — glass+glow thumb (B-021): прозрачный с подсветкой и явно видимый */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 0 10px rgba(0, 122, 255, 0.55),
    0 0 18px rgba(0, 122, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  cursor: pointer;
}
input[type="range"]:hover::-webkit-slider-thumb {
  transform: scale(1.18);
  background: rgba(255, 255, 255, 0.28);
  box-shadow:
    0 0 16px rgba(0, 122, 255, 0.85),
    0 0 28px rgba(0, 122, 255, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.25);
  background: rgba(255, 255, 255, 0.34);
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 0 10px rgba(0, 122, 255, 0.55),
    0 0 18px rgba(0, 122, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
input[type="range"]:hover::-moz-range-thumb,
input[type="range"]:active::-moz-range-thumb {
  transform: scale(1.18);
  box-shadow:
    0 0 16px rgba(0, 122, 255, 0.85),
    0 0 28px rgba(0, 122, 255, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* 5. Voice progress — видимая полоска с самого начала (избавляет от ощущения «лага») */
.voice-progress-fill { min-width: 3px; }

/* B-021: Preview блок (предпросмотр голосовых/кружков перед отправкой) */
.recording-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  margin: 0.4rem 0;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.recording-preview audio,
.recording-preview video {
  flex: 1;
  min-width: 0;
  border-radius: 10px;
}
.recording-preview video {
  max-width: 140px;
  max-height: 140px;
  background: #000;
}
.recording-preview .preview-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.2s ease;
}
.recording-preview .preview-btn:hover {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.14);
}
.recording-preview .preview-btn.preview-discard {
  color: #ff6b6b;
}
.recording-preview .preview-btn.preview-discard:hover {
  background: rgba(255, 107, 107, 0.18);
  box-shadow: 0 0 12px rgba(255, 107, 107, 0.4);
}
.recording-preview .preview-btn.preview-send {
  background: rgba(0, 122, 255, 0.22);
  border-color: rgba(0, 122, 255, 0.55);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 122, 255, 0.45);
}
.recording-preview .preview-btn.preview-send:hover {
  background: rgba(0, 122, 255, 0.4);
  box-shadow: 0 0 18px rgba(0, 122, 255, 0.7);
}

/* 6. Файл-сообщение — две кнопки (Открыть / Скачать) + перенос длинных имён */
.msg-file {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 100%;
  overflow: hidden;
  padding: 0.6rem 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}
.msg-file-info {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.msg-file-name {
  word-break: break-all;
  overflow-wrap: anywhere;
  max-width: 100%;
  font-weight: 500;
}
.msg-file-actions {
  display: flex;
  gap: 0.35rem;
  flex: 0 0 auto;
}
.msg-file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}
.msg-file-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}
.msg-file-btn:active { transform: scale(0.92); }
.msg-file-btn i { width: 18px; height: 18px; }

/* На мобильных — гарантировать, что сообщение не выходит за рамки чата */
@media (max-width: 768px) {
  .message { max-width: 100%; overflow: hidden; }
  .msg-content { max-width: 100%; }
  .msg-file { flex-wrap: wrap; }
}

/* ═══ [B-022.06] (c003) Mobile composer: «+» больше не уезжает за край ═══
   Проблема: на узких экранах (≤480px) контейнер .message-input-area мог
   выходить за viewport (overflow родителя), и кнопка «+» (она первая в flex-
   ряду слева) скрывалась за левым краем. Также при увеличении высоты textarea
   align-items:flex-end + min-height кнопок давал визуальное смещение.
   Решение: жёстко фиксируем ширину контейнера, гарантируем shrink:0 у всех
   кнопок, ограничиваем рост textarea и оставляем «+» всегда в потоке. */
@media (max-width: 768px) {
  .message-input-area {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;          /* страховка от случайного выезда */
    flex-wrap: nowrap;
  }
  .message-input-area > * {
    flex-shrink: 0;              /* кнопки не сжимаются */
  }
  .message-input-area .input-wrapper {
    flex: 1 1 auto;
    min-width: 0;                /* textarea сжимается, кнопки нет */
  }
  .message-input-area .mobile-more-btn {
    order: -1;                   /* «+» всегда первая слева */
    margin-right: 0.1rem;
  }
  /* iOS safe-area по горизонтали (для устройств с notch в landscape) */
  .message-input-area {
    padding-left:  max(0.5rem, env(safe-area-inset-left));
    padding-right: max(0.5rem, env(safe-area-inset-right));
  }
}

/* На очень узких экранах (≤360px) дополнительно ужимаем кнопки */
@media (max-width: 360px) {
  .message-input-area { gap: 0.25rem; }
  .message-input-area .icon-btn,
  .message-input-area .voice-btn,
  .message-input-area .send-btn,
  .message-input-area .mobile-more-btn {
    min-width: 38px;
    min-height: 38px;
    font-size: 1.15rem;
  }
}

/* ═══ [B-022.05] (c003) Desktop: ограничить ширину сообщений и input до 800px ═══
   На широких мониторах (>1024px) сообщения и поле ввода растягиваются по всей
   ширине chat-area, что ухудшает читаемость (длинные строки). Центрируем
   контент по аналогии с Telegram/WhatsApp Web: max-width 800px по центру. */
@media (min-width: 1024px) {
  .messages-list,
  .message-input-area {
    max-width: 800px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  /* messages-container остаётся 100% (фон/скролл на всю ширину),
     центрируется внутренний messages-list */
  .messages-container {
    align-items: stretch;        /* контейнер flex-column — элементы во всю ширину родителя */
  }
}

/* ═══ [B-022.08] (c003) iOS hold-guards: запрет нативного callout/selection ═══
   На iOS долгое удержание открывает системное меню "Copy / Look up", лупу
   увеличения и сине-выделение текста. Это ломает наш UX:
     • запись голосового / видео-кружка (удержание voice-btn)
     • тап-и-удержать на сообщении (наш будущий action-menu)
     • плеер войса/видео (тап = play, удержание = ничего)
   Решение: отключаем -webkit-touch-callout, user-select и блокируем длинные
   тапы у соответствующих элементов. Текст в сообщениях остаётся выделяемым
   через двойной тап (это родное поведение iOS при user-select:text). */

/* Кнопка записи: полный запрет — нативное меню тут особенно мешает */
#btn-voice,
#btn-video-circle,
.voice-record-btn,
.record-btn-active {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

/* Плееры голосовых и видео-кружков — запрет hold-меню */
.voice-player,
.voice-bars,
.voice-bar,
.video-circle,
.video-circle-msg,
.msg-video-circle {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Сообщения: оборачивающий контейнер не показывает callout
   (для медиа/файлов), но текст внутри .msg-text остаётся выделяемым */
.message,
.msg-content,
.msg-file,
.msg-image,
.msg-video {
  -webkit-touch-callout: none;
}
.msg-text {
  /* Текст по-прежнему можно выделить (двойной тап на iOS) */
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* Изображения и видео в сообщениях: запрет drag-and-drop сохранения
   (на iOS — open in new tab/save image popup) */
.msg-image img,
.msg-video video,
.msg-video-circle video {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: auto;          /* клик/тап работают */
}

/* ════════════════════════════════════════════════════════════════════
   B-022.09 (c003): Фуллскрин-просмотр видео-кружочка
   Тап по кружку открывает большой круг по центру с blur-фоном.
   ════════════════════════════════════════════════════════════════════ */
.vc-fs {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  animation: vcFsIn 0.18s ease-out;
}
.vc-fs.hidden { display: none; }
@keyframes vcFsIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.vc-fs-stage {
  position: relative;
  width: 70vmin;
  height: 70vmin;
  max-width: 560px;
  max-height: 560px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 3px solid var(--accent);
}

.vc-fs-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.vc-fs-progress {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: rotate(-90deg);
  overflow: visible;
}
.vc-fs-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 2;
}
.vc-fs-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear;
  filter: drop-shadow(0 0 8px rgba(0, 122, 255, 0.6));
}

.vc-fs-close {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.vc-fs-close:hover { background: rgba(0, 0, 0, 0.65); }
.vc-fs-close i { width: 22px; height: 22px; }

/* ========================================================================== */
/* B-022.10 (c003): Sticky mini-плеер голосовых + триммер концов               */
/* ========================================================================== */

/* --- Sticky mini-плеер (виден пока играет голосовое и пользователь скроллит) --- */
.voice-mini-player {
  position: fixed;
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 86vw;
  padding: 8px 10px 8px 8px;
  background: var(--bg-secondary, #1f2933);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 900;
  font-size: 13px;
  color: var(--text, #e6edf3);
  animation: vmpIn 0.18s ease-out;
}
.voice-mini-player.hidden { display: none; }
@keyframes vmpIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.vmp-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent, #2ea7ff);
  color: #fff;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.vmp-play i { width: 16px; height: 16px; }
.vmp-progress {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  min-width: 100px;
}
.vmp-fill {
  height: 100%;
  background: var(--accent, #2ea7ff);
  width: 0%;
  transition: width 0.08s linear;
}
.vmp-time {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  opacity: 0.85;
  white-space: nowrap;
}
.vmp-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text, #e6edf3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}
.vmp-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.08); }
.vmp-close i { width: 14px; height: 14px; }

/* --- Триммер голосового перед отправкой --- */
.voice-trim {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 48px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 4px 8px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.voice-trim-wave {
  position: absolute;
  inset: 4px 8px;
  pointer-events: none;
}
.voice-trim-wave .vw-bar { fill: rgba(255, 255, 255, 0.35); }
.voice-trim-wave .vw-bar.in-range { fill: var(--accent, #2ea7ff); }
.voice-trim-mask {
  position: absolute;
  top: 4px;
  bottom: 4px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 4px;
  pointer-events: none;
}
.voice-trim-mask.left  { left: 8px; }
.voice-trim-mask.right { right: 8px; }
.voice-trim-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14px;
  background: var(--accent, #2ea7ff);
  border-radius: 4px;
  cursor: ew-resize;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  touch-action: none;
}
.voice-trim-handle::before {
  content: '';
  width: 2px;
  height: 18px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 1px;
}
.voice-trim-cursor {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: #fff;
  pointer-events: none;
  display: none;
  z-index: 1;
}
.voice-trim.playing .voice-trim-cursor { display: block; }
.voice-trim-time {
  position: absolute;
  bottom: -18px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted, rgba(255, 255, 255, 0.6));
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.recording-preview .voice-trim-play {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent, #2ea7ff);
  color: #fff;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.voice-trim-play i { width: 18px; height: 18px; }

/* ─── B-023.01 / B-023.02 (c004): модалка «Информация о комнате» ─────────
   Раньше весь .modal-content скроллился целиком — кнопки «Покинуть/Закрыть»
   уезжали ниже видимой области. Теперь скроллится только список участников,
   а footer (кнопки) прибит к низу с разделителем. */
#modal-room-info .modal-content {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden; /* override .modal-wide overflow-y:auto */
}
#modal-room-info .modal-content > h4 {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}
#modal-room-info #info-members-list.members-list {
  max-height: none;          /* override общего max-height: 200px */
  flex: 1 1 auto;
  min-height: 80px;
  overflow-y: auto;
  padding-right: 4px;        /* воздух для скроллбара */
}
#modal-room-info .modal-actions {
  flex-shrink: 0;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

/* ═══ [B-023.18] (c004) Стеклянные кнопки во ВСЕХ модалках ═══════════════
   .btn-secondary уже использует glass-bg, но .btn-primary (синяя) и
   .btn-danger (красная) выглядели сплошными — несовместимо со стеклянной
   эстетикой остального UI. Добавляем blur-фон и тонкий glass-border, при этом
   сохраняем акцентный цвет (через полупрозрачную заливку).                  */
.modal-actions .btn-primary,
.modal-actions .btn-secondary,
.modal-actions .btn-danger {
  backdrop-filter: blur(var(--glass-blur-thin)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur-thin)) saturate(160%);
  border: 1px solid var(--glass-border);
  transition: var(--transition);
}
.modal-actions .btn-primary {
  background: rgba(10, 132, 255, 0.65);
}
.modal-actions .btn-primary:hover {
  background: rgba(10, 132, 255, 0.85);
}
.modal-actions .btn-danger {
  background: rgba(220, 53, 69, 0.55);
}
.modal-actions .btn-danger:hover {
  background: rgba(220, 53, 69, 0.78);
}
/* btn-secondary уже наследует --glass-bg, оставляем как есть, только
   синхронизируем border-radius с primary/danger для визуальной целостности. */
.modal-actions .btn-secondary,
.modal-actions .btn-danger {
  border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
   B-023.03: Voice Recorder Modal (новая голосовая модалка с волной)
   + Desktop-only video button (скрыта на мобиле)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .desktop-only-btn { display: none !important; }
}

.voice-rec-modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  animation: vrFadeIn 0.18s ease-out;
}
.voice-rec-modal.hidden { display: none; }

@keyframes vrFadeIn { from { opacity: 0; } to { opacity: 1; } }

.voice-rec-card {
  background: linear-gradient(135deg, rgba(40, 44, 60, 0.85), rgba(28, 32, 46, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 24px;
  padding: 2.5rem 2rem 2rem;
  display: flex; flex-direction: column; align-items: center; gap: 1.25rem;
  min-width: 280px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  animation: vrCardIn 0.22s ease-out;
}
@keyframes vrCardIn { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.vr-mic-wrap {
  position: relative; width: 140px; height: 140px;
  display: flex; align-items: center; justify-content: center;
}

.vr-ring {
  position: absolute; inset: 10px;
  border-radius: 50%;
  border: 2px solid rgba(99, 179, 237, 0.55);
  background: radial-gradient(circle, rgba(99, 179, 237, 0.12), transparent 70%);
  transform: scale(1);
  transition: transform 0.08s ease-out;
  pointer-events: none;
}

.vr-mic-big {
  position: relative; width: 96px; height: 96px;
  border-radius: 50%; border: none;
  background: linear-gradient(135deg, #4a90e2, #2d6cb6);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(74, 144, 226, 0.45);
  cursor: default; pointer-events: none;
}
.vr-mic-big i, .vr-mic-big svg { width: 40px; height: 40px; }

.vr-time {
  font-size: 1.5rem; font-weight: 600; color: #fff;
  font-variant-numeric: tabular-nums; letter-spacing: 0.05em;
}

.vr-hint {
  font-size: 0.85rem; color: rgba(255, 255, 255, 0.55);
  text-align: center; margin: 0;
}

.vr-actions { display: flex; gap: 1.5rem; margin-top: 0.5rem; }

.vr-btn {
  width: 60px; height: 60px; border-radius: 50%; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s;
}
.vr-btn i, .vr-btn svg { width: 24px; height: 24px; }
.vr-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.vr-btn:active { transform: translateY(0); }

.vr-cancel {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  box-shadow: 0 6px 18px rgba(231, 76, 60, 0.40);
}

.vr-pause {
  background: linear-gradient(135deg, #f1c40f, #d4a307);
  box-shadow: 0 6px 18px rgba(241, 196, 15, 0.40);
}

.vr-send {
  background: linear-gradient(135deg, #4a90e2, #2d6cb6);
  box-shadow: 0 6px 18px rgba(74, 144, 226, 0.40);
}

/* ─────────────────────────────────────────────────────────────────
   Liquid Glass overrides (Apple-style)
   Исправляет невалидный backdrop-filter: blur(var(--glass-blur)),
   где переменная сама уже содержит blur() — браузер раньше игнорировал.
   Здесь задаём корректный синтаксис + добавляем тонкую "стеклянную"
   подсветку сверху (highlight) и более глубокую тень.
   ───────────────────────────────────────────────────────────────── */
:root {
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --glass-bg-strong: rgba(28, 32, 46, 0.62);
  --glass-bg-menu:   rgba(28, 32, 46, 0.72);
  --glass-shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.55);
}

/* Основной модальный контейнер */
.modal-content {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: var(--glass-shadow-lg), var(--glass-highlight);
}

/* Карточка диктофона / кружка — реальное «жидкое стекло» */
.voice-rec-card {
  background:
    linear-gradient(135deg, rgba(40, 44, 60, 0.55), rgba(28, 32, 46, 0.55));
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: var(--glass-shadow-lg), var(--glass-highlight);
}

/* Контекстные меню сообщений и комнат */
.msg-context-menu,
.room-context-menu {
  background: var(--glass-bg-menu);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), var(--glass-highlight);
}

/* Меню упоминаний (@) */
.mention-picker {
  background: var(--glass-bg-menu);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), var(--glass-highlight);
}

/* Полноэкранный просмотр видео — затемнение чуть глубже,
   чтобы стекло поверх читалось контрастнее */
.video-fullscreen-overlay {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

/* Слегка усиливаем затемнение фона под модалками */
.modal {
  background: rgba(0, 0, 0, 0.66);
}


/* ═════════════════════════════════════════════════════════════════════
   P-05: Mobile gesture polish
   ─────────────────────────────────────────────────────────────────────
   На мобильном long-press в браузере сразу выделяет текст и показывает
   системную лупу — это конфликтует с нашим жестовым меню. Отключаем
   только на тач-устройствах, чтобы на десктопе можно было копировать
   текст обычным выделением.
   ═════════════════════════════════════════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {
  .msg-bubble,
  .message {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
  }
}

/* ─── P-06: Пилюля «к новым сообщениям» ───────────────── */
.scroll-to-bottom-pill {
  position: absolute;
  right: 1rem;
  /* поднимаем над reply-bar / input-area; точное смещение задаём через CSS-переменную */
  bottom: var(--scroll-pill-bottom, 5rem);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  background: var(--bg-elevated, rgba(30, 30, 36, 0.92));
  color: var(--text-primary, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 30;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.scroll-to-bottom-pill:hover {
  background: var(--bg-elevated-hover, rgba(45, 45, 52, 0.95));
}
.scroll-to-bottom-pill:active {
  transform: translateY(0) scale(0.94);
}
.scroll-to-bottom-pill.hidden {
  /* без display:none, чтобы плавно убирать */
  display: flex;
  opacity: 0;
  transform: translateY(8px) scale(0.85);
  pointer-events: none;
}
.scroll-to-bottom-pill i,
.scroll-to-bottom-pill svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}
.pill-counter {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--accent, #4a9eff);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(74, 158, 255, 0.45);
}
.pill-counter.hidden {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   ЗВОНОК — полноэкранный оверлей (редизайн). Заменяет старую полосу над чатом.
   Главная сцена + лента превью + своё видео PiP + нижняя панель + свёртывание.
   Правила скоупятся под .call-overlay и идут последними в файле, поэтому
   перекрывают старые .call-* стили без их удаления.
   ═══════════════════════════════════════════════════════════════════════ */
.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  flex-direction: column;
  background: rgba(8, 10, 14, 0.97);
  /* P5: без backdrop-filter — фон оверлея непрозрачный, размывать нечего, а
     полноэкранный blur сильно греет GPU. */
  animation: callOverlayIn 0.22s ease;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
@keyframes callOverlayIn { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: none; } }

/* ── Верхняя строка: таймер/статус + свернуть ── */
.call-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 16px; flex-shrink: 0;
}
.call-top-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.call-top .call-title { color: #fff; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.call-top .call-timer { color: rgba(255, 255, 255, 0.65); font-variant-numeric: tabular-nums; }
.call-top .call-status {
  font-size: 0.78rem; padding: 2px 9px; border-radius: 9px;
  background: rgba(46, 204, 113, 0.18); color: #2ecc71; white-space: nowrap;
}
.call-top-btn {
  width: 40px; height: 40px; flex-shrink: 0; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.1); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
.call-top-btn:hover { background: rgba(255, 255, 255, 0.2); }

/* ── Тело: сцена + сетка/лента ── */
.call-body {
  position: relative; flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 8px; padding: 0 12px;
}
.call-stage {
  flex: 1; min-height: 0; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.call-overlay:not(.has-stage) .call-stage { display: none; }

/* Галерея равных плиток (когда выделять некого) */
.call-grid {
  display: grid; gap: 8px; justify-content: center;
  /* safe center: если плиток больше, чем влезает (особенно в альбомной), не центрируем
     с переполнением (это давало клиппинг/наезд), а течём сверху и скроллим.
     align-items: center не даёт плиткам растягиваться против aspect-ratio (тоже наезд). */
  align-content: safe center; align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  flex: 1; min-height: 0; overflow-y: auto; padding: 6px 0;
}
/* В режиме сцены сетка превращается в горизонтальную ленту превью */
.call-overlay.has-stage .call-grid {
  display: flex; flex: 0 0 auto; flex-wrap: nowrap;
  overflow-x: auto; overflow-y: hidden; gap: 8px; padding: 2px 0 8px;
  grid-template-columns: none;
}
.call-overlay.has-stage .call-grid:empty { display: none; }
/* В 1-на-1 в ленте остаётся только своё видео (PiP, вне потока) — прячем пустую ленту,
   чтобы не висела тонкая полоса сбоку/снизу. */
.call-overlay.has-stage:not(.has-thumbs) .call-grid { display: none; }

/* ── Карточка участника ── */
/* Жёсткий сброс геометрии: гасим старые правила .call-participant (фикс. 160×120,
   screen-sharing 280×180, order:-1, zoomed inset), которые иначе «протекают»
   через пропуски свойств и ломают раскладку. Дальше задаём размеры по состояниям. */
.call-overlay .call-participant {
  position: relative; inset: auto;
  width: auto; height: auto; max-width: none; min-width: 0; min-height: 0;
  order: 0; flex: 0 0 auto; margin: 0;
  overflow: hidden; cursor: pointer;
  background: #15171c; border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, transform 0.15s;
}
.call-overlay:not(.has-stage) .call-participant { width: 100%; height: auto; aspect-ratio: 4 / 3; }
.call-overlay .call-participant.local { border-color: rgba(10, 132, 255, 0.55); }

/* Главная сцена */
.call-overlay .call-participant.is-stage {
  width: 100%; height: 100%; border-width: 0; border-radius: 16px;
}
/* Камера на сцене — cover (заполняет, без чёрных полос по бокам);
   демонстрация экрана — contain (важно не обрезать содержимое). */
/* P6: на сцене показываем видео целиком (contain) — без сильной обрезки, особенно
   когда соотношение сторон видео не совпадает с экраном (портрет в альбомной). */
.call-overlay .call-participant.is-stage video { object-fit: contain; }
.call-overlay .call-participant.is-stage .call-participant-avatar { font-size: 4.5rem; }

/* Превью в ленте */
.call-overlay .call-participant.is-thumb {
  flex: 0 0 auto; width: 116px; height: 86px; aspect-ratio: auto;
}
.call-overlay .call-participant.is-thumb:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.3); }

/* Видео и аватар внутри карточки */
.call-overlay .call-participant video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 0.25s; z-index: 2;
}
.call-overlay .call-participant.has-video video { opacity: 1; }
.call-overlay .call-participant-avatar {
  font-size: 2.2rem; z-index: 1; user-select: none; pointer-events: none; color: #fff;
}
.call-overlay .call-participant-label {
  position: absolute; left: 6px; bottom: 6px; z-index: 5;
  max-width: calc(100% - 12px); padding: 2px 8px; border-radius: 7px;
  background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.72rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Постоянный аудио-сток — без влияния на раскладку */
.call-overlay .call-participant audio.peer-audio { display: none; }

/* ─── P5: антиперегрев. Во время звонка глушим дорогой backdrop-filter (за
   полноэкранным оверлеем всё равно ничего значимого нет) — это резко снижает
   нагрузку на GPU и нагрев телефона. У элементов звонка свои фоны, вид не страдает. */
body.in-call .call-overlay,
body.in-call .call-overlay * {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
/* P5: гасим бесконечные декоративные анимации (перерисовки) во время звонка. */
body.in-call .screen-share-banner,
body.in-call .call-banner,
body.in-call .room-call-icon,
body.in-call .call-mini-dot { animation: none !important; }

/* P6: в альбомной ориентации на телефоне портретное видео при object-fit:cover
   обрезалось почти наполовину. Показываем целиком (вписываем масштабированием). */
@media (max-width: 920px) and (orientation: landscape) {
  .call-overlay .call-participant video { object-fit: contain; }
  /* В альбомной короткий экран: плитки текут сверху и скроллятся, БЕЗ наезда друг на
     друга (раньше align-content:center + aspect-ratio давали переполнение/наложение). */
  .call-overlay .call-grid {
    align-content: start; align-items: start; grid-auto-rows: min-content;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }
  .call-overlay:not(.has-stage) .call-participant { aspect-ratio: 16 / 10; max-height: 44vh; }
}

/* ─── P4: плитка трансляции — обычная плитка среди всех, но стоит первой и не
   главенствует. Фокус (увеличение) выбирает сам пользователь тапом по плитке. */
.call-overlay .call-participant.screen-tile { order: -1; }
.call-overlay .call-participant.screen-tile video {
  object-fit: contain; background: #000; opacity: 1;
}
/* P5: GPU-слой только когда реально зумим (а не весь звонок) — меньше нагрев. */
.call-overlay .call-participant.screen-tile video.zoomed { will-change: transform; cursor: grab; }
.call-overlay .call-participant.screen-tile .call-participant-label { background: rgba(231, 76, 60, 0.85); }
.call-overlay .call-participant.screen-tile.local .call-participant-label { background: rgba(39, 174, 96, 0.85); }

/* Минимальный статус-бейдж: маленький значок «микрофон выключен» в углу плитки.
   (Старые .peer-media-icons / .call-peer-controls / .call-volume больше не
   создаются — всё ушло в меню действий, см. ниже.) */
.call-overlay .peer-status {
  position: absolute; top: 6px; right: 6px; z-index: 6;
  width: 22px; height: 22px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  background: rgba(231, 76, 60, 0.92); color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.call-overlay .peer-status.visible { display: flex; }
.call-overlay .peer-status i { width: 13px; height: 13px; }
.call-overlay .call-participant.is-stage .peer-status { width: 30px; height: 30px; top: 12px; right: 12px; }
.call-overlay .call-participant.is-stage .peer-status i { width: 17px; height: 17px; }

/* ── Меню действий с участником (ПКМ / долгий тап) ── */
.call-peer-menu-backdrop { position: fixed; inset: 0; z-index: 4400; background: transparent; }
.call-peer-menu {
  position: fixed; z-index: 4500; min-width: 230px; max-width: 88vw;
  padding: 6px; border-radius: 14px;
  background: rgba(28, 30, 36, 0.98); backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  animation: callMenuIn 0.14s ease;
}
@keyframes callMenuIn { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }
.call-peer-menu-head {
  padding: 8px 10px 10px; font-weight: 600; color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08); margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.call-peer-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 10px; border: none; border-radius: 9px; cursor: pointer;
  background: transparent; color: #fff; font-size: 0.92rem; text-align: left;
}
.call-peer-menu-item:hover { background: rgba(255, 255, 255, 0.1); }
.call-peer-menu-item.danger { color: #ff6b5e; }
.call-peer-menu-item.danger:hover { background: rgba(231, 76, 60, 0.18); }
.call-peer-menu-item i { width: 18px; height: 18px; flex-shrink: 0; }
.call-peer-menu-vol {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  color: rgba(255, 255, 255, 0.8);
}
.call-peer-menu-vol i { width: 18px; height: 18px; flex-shrink: 0; }
.call-peer-menu-vol input[type="range"] { flex: 1; min-width: 0; accent-color: #0a84ff; }
.call-peer-menu-vol-val { width: 38px; text-align: right; font-variant-numeric: tabular-nums; font-size: 0.82rem; }

/* ── Радиальное меню по зажатию (камера фронт/тыл, громкость микрофона) ──
   Apple-стиль: объёмное матовое стекло (glassmorphism) + пружинные анимации.
   Камера-капельки «выезжают» из центра кнопки (--fx/--fy) и раздвигаются. */
.call-radial { position: fixed; inset: 0; z-index: 4600; pointer-events: none; }

/* Попап громкости микрофона (залипающий, со стандартным слайдером) */
.call-mic-backdrop { position: fixed; inset: 0; pointer-events: auto; background: transparent; }
.call-mic-panel {
  position: fixed; pointer-events: auto;
  width: 240px; max-width: 92vw; padding: 14px 16px; border-radius: 16px; color: #fff;
  background:
    radial-gradient(120% 80% at 50% 12%, rgba(255,255,255,0.22), rgba(255,255,255,0.05) 60%),
    linear-gradient(160deg, rgba(28,30,36,0.96), rgba(20,22,28,0.96));
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 14px 36px rgba(0,0,0,0.55);
  transform: translateY(10px) scale(0.96); opacity: 0;
  transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), opacity 0.18s;
}
.call-radial.open .call-mic-panel { transform: none; opacity: 1; }
.call-radial.closing .call-mic-panel { transform: translateY(10px) scale(0.96); opacity: 0; }
.call-mic-panel-title { font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.call-mic-panel-title i { width: 16px; height: 16px; }
.call-mic-panel-row { display: flex; align-items: center; gap: 12px; }
.call-mic-slider { flex: 1; min-width: 0; }
.call-mic-val { width: 44px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.85rem; }

.call-radial-item {
  position: fixed; width: 66px; height: 66px; border-radius: 50%; pointer-events: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: #fff; font-size: 0.6rem; font-weight: 600;
  /* Объёмное стекло */
  background:
    radial-gradient(120% 80% at 50% 18%, rgba(255,255,255,0.35), rgba(255,255,255,0.06) 60%),
    linear-gradient(160deg, rgba(255,255,255,0.16), rgba(255,255,255,0.05));
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.28);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.5),
    inset 0 -8px 16px rgba(0,0,0,0.22),
    0 12px 30px rgba(0,0,0,0.45);
  /* Старт: в центре кнопки камеры (вектор --fx/--fy) и схлопнут */
  transform: translate(var(--fx, 0), var(--fy, 0)) scale(0.2);
  opacity: 0;
  transition:
    transform 0.34s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.22s ease,
    background 0.15s, box-shadow 0.15s;
}
.call-radial.open .call-radial-item { transform: translate(0, 0) scale(1); opacity: 1; }
.call-radial.closing .call-radial-item { transform: translate(var(--fx, 0), var(--fy, 0)) scale(0.2); opacity: 0; }
.call-radial.open .call-radial-item.active {
  transform: translate(0, 0) scale(1.16);
  background:
    radial-gradient(120% 80% at 50% 18%, rgba(255,255,255,0.45), rgba(10,132,255,0.25) 55%),
    linear-gradient(160deg, rgba(10,132,255,0.7), rgba(10,132,255,0.4));
  border-color: rgba(255,255,255,0.55);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.6),
    0 0 0 4px rgba(10,132,255,0.22),
    0 14px 34px rgba(0,0,0,0.5);
}
.call-radial-item i { width: 23px; height: 23px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35)); }
.call-radial-item span { text-shadow: 0 1px 2px rgba(0,0,0,0.4); }

/* ── Шкала громкости микрофона ── */
.call-radial-scale {
  position: fixed; border-radius: 30px; pointer-events: auto;
  background:
    radial-gradient(120% 60% at 50% 6%, rgba(255,255,255,0.28), rgba(255,255,255,0.05) 55%),
    linear-gradient(160deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04));
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.26);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.45), 0 14px 34px rgba(0,0,0,0.5);
  transform: scaleY(0.25); transform-origin: bottom; opacity: 0;
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.22s ease;
}
.call-radial.open .call-radial-scale { transform: scaleY(1); opacity: 1; }
.call-radial.closing .call-radial-scale { transform: scaleY(0.25); opacity: 0; }
.call-radial-scale-track {
  position: absolute; left: 7px; right: 7px; top: 7px; bottom: 7px;
  border-radius: 24px; overflow: hidden; background: rgba(0,0,0,0.18);
}
.call-radial-scale-fill {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(0deg, #0a84ff 0%, #4f8cff 60%, #6aa6ff 100%);
  /* «водная поверхность» сверху + внутренний блик */
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.55),
    inset 0 -10px 20px rgba(0,0,0,0.18),
    0 0 14px rgba(10,132,255,0.45);
  /* БЕЗ transition по height: заливка следует за пальцем мгновенно, иначе
     визуал «догоняет» и кажется, что скорость то быстрая, то медленная. */
}
.call-radial-scale-knob {
  position: absolute; left: 50%; width: 32px; height: 32px; border-radius: 50%; z-index: 3;
  /* Влажная «капля»: яркий блик-spec слева-сверху + лёгкое затемнение снизу */
  background:
    radial-gradient(circle at 35% 28%, #ffffff 0%, #eef3ff 38%, #cdddff 72%, #aac6ff 100%);
  border: 1px solid rgba(255,255,255,0.85);
  box-shadow:
    0 4px 12px rgba(0,0,0,0.5),
    inset 0 2px 2px rgba(255,255,255,0.95),
    inset 0 -3px 5px rgba(40,90,180,0.35);
  transform: translateX(-50%);
  /* bottom — мгновенно (следует за пальцем), а «захват»/тень — плавно. */
  transition:
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.18s;
}
.call-radial-scale-knob::after {
  /* блестящая «капелька» света на кружке */
  content: ''; position: absolute; left: 24%; top: 18%; width: 32%; height: 26%;
  border-radius: 50%; background: rgba(255,255,255,0.9); filter: blur(0.5px);
}
/* Кружок «схвачен» сразу при открытии — выделен синим ореолом, чуть «разбухает» */
.call-radial-scale-knob.grabbed {
  transform: translateX(-50%) scale(1.22);
  box-shadow:
    0 0 0 8px rgba(10,132,255,0.3),
    0 6px 16px rgba(0,0,0,0.5),
    inset 0 2px 2px rgba(255,255,255,0.95),
    inset 0 -3px 5px rgba(40,90,180,0.35);
}
.call-radial-scale-val {
  position: absolute; left: 0; right: 0; top: -26px; z-index: 4;
  text-align: center; color: #fff; font-size: 0.8rem; font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

/* Мобильный нижний лист */
@media (max-width: 640px) {
  .call-peer-menu-backdrop { background: rgba(0, 0, 0, 0.5); }
  .call-peer-menu {
    left: 0 !important; right: 0; top: auto !important; bottom: 0;
    min-width: 0; max-width: none; width: 100%;
    border-radius: 18px 18px 0 0; padding: 8px 10px calc(14px + env(safe-area-inset-bottom, 0));
    animation: callSheetIn 0.2s ease;
  }
  @keyframes callSheetIn { from { transform: translateY(100%); } to { transform: none; } }
  .call-peer-menu-head { font-size: 1.05rem; text-align: center; }
  .call-peer-menu-item { padding: 14px 12px; font-size: 1rem; }
}

/* ── Нижняя панель управления ── */
.call-bottom {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 14px 12px calc(14px + env(safe-area-inset-bottom, 0)); flex-shrink: 0;
}
.call-overlay .call-btn {
  width: 54px; height: 54px; flex-shrink: 0; border-radius: 50%; cursor: pointer; opacity: 1;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  /* Единое Apple-стекло (как у капелек/шкалы): матовость + объёмный блик. */
  background:
    radial-gradient(120% 80% at 50% 16%, rgba(255,255,255,0.30), rgba(255,255,255,0.05) 62%),
    linear-gradient(160deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
  backdrop-filter: blur(22px) saturate(175%);
  -webkit-backdrop-filter: blur(22px) saturate(175%);
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.42), inset 0 -7px 14px rgba(0,0,0,0.2), 0 8px 22px rgba(0,0,0,0.38);
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s, border-color 0.2s;
  /* Чтобы зажатие-жест (камера/микрофон) не перехватывался браузером под
     скролл/зум и не терялся коннект с пальцем. */
  touch-action: none;
}
.call-overlay .call-btn:hover { transform: scale(1.07); border-color: rgba(255,255,255,0.38); }
/* Активное/мут/hangup — то же стекло, но тонированное цветом */
.call-overlay .call-btn.active {
  background:
    radial-gradient(120% 80% at 50% 16%, rgba(255,255,255,0.4), rgba(10,132,255,0.3) 55%),
    linear-gradient(160deg, rgba(10,132,255,0.7), rgba(10,132,255,0.42));
  border-color: rgba(255,255,255,0.42);
}
.call-overlay .call-btn.muted {
  background:
    radial-gradient(120% 80% at 50% 16%, rgba(255,255,255,0.4), rgba(231,76,60,0.3) 55%),
    linear-gradient(160deg, rgba(231,76,60,0.72), rgba(231,76,60,0.42));
  border-color: rgba(255,255,255,0.42);
}
.call-overlay .call-btn.disabled { opacity: 0.4; cursor: not-allowed; }
.call-overlay .call-btn.hangup {
  background:
    radial-gradient(120% 80% at 50% 16%, rgba(255,255,255,0.45), rgba(231,76,60,0.4) 50%),
    linear-gradient(160deg, #ff5a4d, #d63a2e);
  border-color: rgba(255,255,255,0.4);
}
.call-overlay .call-btn.hangup:hover { filter: brightness(1.08); }
.call-overlay .call-btn i { width: 23px; height: 23px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3)); }

/* Настройки — нижняя «шторка» над панелью кнопок */
.call-overlay .call-settings {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px; padding: 14px 16px; flex-shrink: 0;
  background: rgba(0, 0, 0, 0.35); border-top: 1px solid rgba(255,255,255,0.08);
}
.call-overlay .call-settings.hidden { display: none; }
.call-overlay .call-setting { display: flex; flex-direction: column; gap: 5px; font-size: 0.78rem; color: rgba(255,255,255,0.7); }
.call-overlay .call-select { background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.14); border-radius: 9px; padding: 7px 10px; }
.call-overlay .screen-share-banner {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 7px 12px; flex-shrink: 0; color: #ff6b5e;
  background: rgba(231, 76, 60, 0.12); border-top: 1px solid rgba(231,76,60,0.3);
}
.call-overlay .stop-share-btn { padding: 3px 12px; border: 1px solid rgba(231,76,60,0.5); border-radius: 8px; background: rgba(231,76,60,0.2); color: #ff8a7e; cursor: pointer; }

/* ── Свёрнутое состояние: плавающая плашка поверх чата ── */
.call-mini { display: none; }
.call-overlay.minimized {
  /* Плашку «вернуться в звонок» крепим ПОД хедер приложения (раньше она висела у
     самого верха и перекрывала кнопки хедера, а в notch-зоне — была недоступна).
     Смещение зеркалит padding-top хедера (max(0.75rem, inset)) + его высоту. */
  inset: auto;
  top: calc(max(0.75rem, env(safe-area-inset-top, 0px)) + 52px);
  left: 50%; transform: translateX(-50%);
  width: min(92vw, 360px); height: auto; padding: 0;
  background: transparent; backdrop-filter: none; animation: none; pointer-events: none;
}
/* Прячем всё, КРОМЕ плашки. БЕЗ !important: иначе оно перебивало показ .call-mini
   (у которого !important не было) → свёрнутый звонок было не вернуть. У правила
   .call-mini ниже выше специфичность, поэтому оно и так выигрывает. */
.call-overlay.minimized > *:not(.call-mini) { display: none; }
.call-overlay.minimized > .call-mini {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 11px 16px; border-radius: 999px; cursor: pointer; pointer-events: auto;
  background: linear-gradient(135deg, rgba(48, 209, 88, 0.96), rgba(10, 132, 255, 0.94));
  color: #fff; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
.call-mini-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; flex-shrink: 0; animation: callMiniPulse 1.4s infinite; }
@keyframes callMiniPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.call-mini-text { flex: 1; font-weight: 600; font-size: 0.9rem; min-width: 0; }
.call-mini-hangup { width: 34px; height: 34px; flex-shrink: 0; border: none; border-radius: 50%; background: rgba(255, 255, 255, 0.25); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.call-mini-hangup:hover { background: rgba(255, 255, 255, 0.4); }
.call-mini-hangup i { width: 17px; height: 17px; }

/* ── Адаптив: телефоны ── */
@media (max-width: 640px) {
  .call-overlay .call-settings { grid-template-columns: 1fr; }
  .call-overlay .call-btn { width: 50px; height: 50px; }
  .call-bottom { gap: 10px; }
  .call-overlay .call-participant.is-thumb { width: 96px; height: 72px; }
  .call-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
}

/* ═══════════════════════════════════════════════════════════════════════
   iOS: нативное выделение текста / «callout» при долгом тапе мешало жестам
   (долгий тап по плиткам звонка, спискам и т.п. подсвечивал/выделял UI).
   Глушим выделение по умолчанию ПО ВСЕМУ приложению и возвращаем его только
   там, где реально нужно копировать: текст сообщений и поля ввода.
   ═══════════════════════════════════════════════════════════════════════ */
html {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
/* Где выделение НУЖНО (копирование текста в чате, ввод) */
input,
textarea,
select,
[contenteditable="true"],
.msg-text,
.msg-bubble,
.msg-reply,
.dm-last,
.selectable {
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  -ms-user-select: text;
  user-select: text;
}
