:root {
  --bg-dark: #06070b;
  --bg-card: #12151f;
  --bg-panel: rgba(16, 19, 28, 0.92);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --text-main: #f3f5f9;
  --text-muted: #949db3;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-hover: #dc2626;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  max-width: 100%;
  height: 100%;
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Inter, sans-serif;
  overflow: hidden !important;
  overflow-x: hidden !important;
  overscroll-behavior: none !important;
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.hidden {
  display: none !important;
}

/* ==================== ПРОГРАММНОЕ УЛУЧШЕНИЕ ОСВЕЩЕНИЯ И КАЧЕСТВА ВИДЕО ==================== */
.light-mode-auto {
  -webkit-filter: brightness(1.18) contrast(1.1) saturate(1.15);
  filter: brightness(1.18) contrast(1.1) saturate(1.15);
}

.light-mode-sharp {
  -webkit-filter: brightness(1.12) contrast(1.26) saturate(1.14);
  filter: brightness(1.12) contrast(1.26) saturate(1.14);
}

.light-mode-denoise {
  -webkit-filter: brightness(1.14) contrast(1.22) saturate(1.3);
  filter: brightness(1.14) contrast(1.22) saturate(1.3);
}

.light-mode-night {
  -webkit-filter: brightness(1.58) contrast(1.18) saturate(1.24);
  filter: brightness(1.58) contrast(1.18) saturate(1.24);
}

.light-mode-off {
  -webkit-filter: none;
  filter: none;
}

/* ==================== МОДАЛЬНОЕ ОКНО ВХОДЯЩЕГО ЗВОНКА ==================== */
.incoming-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(6, 8, 14, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.incoming-card {
  background: linear-gradient(160deg, #161b29 0%, #0e111b 100%);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 24px;
  padding: 32px 26px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75);
}

.pulse-ring {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.18);
  border: 2px solid var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  animation: ringPulse 1.4s infinite ease-in-out;
}

@keyframes ringPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 18px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.incoming-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.incoming-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
}

.accept-call-btn {
  flex: 1;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}

.accept-call-btn:hover {
  filter: brightness(1.1);
}

.decline-call-btn {
  flex: 1;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}

.decline-call-btn:hover {
  filter: brightness(1.1);
}

/* ==================== ЛОББИ ==================== */
.lobby-screen {
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 10%, #172038 0%, #06070b 70%);
  overflow-y: auto;
  overflow-x: hidden !important;
  overscroll-behavior: none !important;
  touch-action: pan-y;
}

.lobby-card {
  width: 100%;
  max-width: 540px;
  margin: auto 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  cursor: pointer;
}

.brand-header h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.subtitle {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.admin-badge {
  margin-left: auto;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.55);
  color: #fde68a;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.6px;
}

/* ==================== РЕГИСТРАЦИЯ И ПРОФИЛЬ ==================== */
.auth-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: 10px;
}

.auth-tab {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.auth-tab.active {
  background: var(--accent);
  color: #fff;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-profile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  padding: 10px 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.user-profile-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.user-profile-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .user-profile-bar {
    padding: 8px 10px;
    gap: 8px;
  }
  .user-profile-left {
    width: 100%;
  }
  .user-profile-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .user-profile-actions .small-btn {
    padding: 5px 9px;
    font-size: 0.74rem;
  }
}

.user-profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.my-nick-badge {
  font-size: 0.98rem;
  font-weight: 700;
  color: #93c5fd;
  word-break: break-word;
}

.my-email-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  word-break: break-word;
}

/* ==================== ПРЕВЬЮ КАМЕРЫ В ЛОББИ (КАДРИРОВАНИЕ 25%) ==================== */
.lobby-preview-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050608;
  border-radius: 14px;
  overflow: hidden;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  isolation: isolate;
  transform: translateZ(0);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lobby-preview-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Кадрирование на 25% для обоих участников */
  -webkit-transform: scaleX(-1) scale(1.333);
  transform: scaleX(-1) scale(1.333);
  transform-origin: center center;
  transition: transform 0.25s ease;
}

.camera-off-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  background: #0c0f17;
  color: var(--text-muted);
  font-size: 0.92rem;
  z-index: 2;
  padding: 14px;
  text-align: center;
}

.lobby-preview-controls {
  position: absolute;
  bottom: 8px;
  left: 6px;
  right: 6px;
  transform: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 12px);
  z-index: 3;
  overflow: hidden;
}

.lobby-controls-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lobby-primary-row {
  justify-content: flex-start;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 2px;
}

.lobby-primary-row::-webkit-scrollbar {
  display: none;
}

@media (min-width: 480px) {
  .lobby-primary-row {
    justify-content: center;
  }
}

.lobby-secondary-row {
  justify-content: flex-start;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 2px;
}

.lobby-secondary-row::-webkit-scrollbar {
  display: none;
}

@media (min-width: 480px) {
  .lobby-secondary-row {
    justify-content: center;
  }
}

.icon-pill-btn {
  background: rgba(15, 18, 28, 0.85);
  backdrop-filter: blur(8px);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.icon-pill-btn:hover {
  background: rgba(30, 36, 54, 0.95);
}

.icon-pill-btn.off {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--danger);
  color: #fca5a5;
}

/* ==================== ПОЛЯ ВВОДА И КНОПКИ ==================== */
select,
input[type='text'],
input[type='email'],
input[type='password'] {
  width: 100%;
  background: #0b0d14;
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.86rem;
  outline: none;
  transition: border-color 0.15s;
}

select:focus,
input[type='text']:focus,
input[type='email']:focus,
input[type='password']:focus {
  border-color: var(--accent);
}

.lobby-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 11px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, transform 0.1s;
  white-space: nowrap;
}

.primary-btn:hover {
  background: var(--accent-hover);
}

.primary-btn:active {
  transform: scale(0.99);
}

.large-btn {
  padding: 13px 20px;
  font-size: 0.98rem;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.danger-btn {
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s;
}

.danger-btn:hover {
  background: var(--danger-hover);
}

.join-by-code-row {
  display: flex;
  gap: 8px;
}

.room-badge-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.role-pill {
  background: rgba(255, 255, 255, 0.12);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
}

/* ==================== КОНТАКТЫ И ЗВОНОК ПО НИКУ ==================== */
.contacts-panel {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contacts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: #93c5fd;
}

.contacts-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 400;
}

.call-by-nick-row {
  display: flex;
  gap: 8px;
}

.contacts-list {
  max-height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 7px 11px;
}

.contact-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 600;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #475569;
}

.online-dot.online {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.call-contact-btn {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
  border-radius: 8px;
  padding: 5px 11px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.call-contact-btn:hover {
  background: var(--success);
  color: #fff;
}

.empty-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0;
}

/* ==================== СКРЫТАЯ ПАНЕЛЬ АКТИВНЫХ КОМНАТ ДЛЯ АДМИНА ==================== */
.admin-rooms-panel {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fde68a;
}

.admin-rooms-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 160px;
  overflow-y: auto;
}

.admin-room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 10px;
  padding: 8px 11px;
  gap: 8px;
}

.admin-room-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-room-code {
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
}

.admin-room-peers {
  font-size: 0.75rem;
  color: #fde68a;
}

.stealth-join-btn {
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.6);
  color: #fde68a;
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.stealth-join-btn:hover {
  background: var(--warning);
  color: #000;
}

/* ==================== ОСНОВНОЙ ЭКРАН ЗВОНКА ==================== */
.call-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  background: #000;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  touch-action: none;
}

.remote-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

/* Размытый фон в стиле YouTube при несовпадении вертикального и горизонтального экранов */
.remote-ambient-bg {
  position: absolute;
  inset: -8%;
  width: 116% !important;
  height: 116% !important;
  object-fit: cover !important;
  filter: blur(32px) brightness(0.45) saturate(1.18) !important;
  -webkit-filter: blur(32px) brightness(0.45) saturate(1.18) !important;
  pointer-events: none !important;
  z-index: 0 !important;
  opacity: 0.92;
}

/* Контейнер кадрирования в собственных пропорциях видео (не срезает бока при повороте экрана!) */
.remote-crop-frame,
.split-crop-frame {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

#remoteVideo,
.remote-front-keep-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  transition: transform 0.2s ease;
}

.remote-front-keep-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.waiting-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 7, 11, 0.82);
  backdrop-filter: blur(8px);
  z-index: 10;
  padding: 20px;
}

.waiting-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 28px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.waiting-box h2 {
  font-size: 1.15rem;
}

.waiting-box p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.invite-box-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.invite-box {
  display: flex;
  gap: 8px;
  width: 100%;
}

.invite-box input {
  user-select: all;
}

.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(59, 130, 246, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.remote-cam-off {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #080a10;
  color: var(--text-muted);
  z-index: 5;
}

.avatar-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-bar-indicators {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 20;
  pointer-events: none;
}

.status-chip {
  background: rgba(12, 15, 24, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-main);
}

.status-chip.warning {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fecaca;
}

.status-chip.info {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.5);
  color: #bfdbfe;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
}

.dot.connected {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

/* ==================== ПРЕВЬЮ СВОЕЙ КАМЕРЫ (PiP С КАДРИРОВАНИЕМ 25%) ==================== */
.local-pip {
  position: fixed;
  bottom: 88px;
  right: 20px;
  background: #090b10;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  overflow: hidden;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  isolation: isolate;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  z-index: 30;
  cursor: grab;
  transition: width 0.2s ease, height 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.local-pip:active {
  cursor: grabbing;
}

.local-pip.size-s {
  width: 150px;
  height: 100px;
}

.local-pip.size-m {
  width: 230px;
  height: 145px;
}

.local-pip.size-l {
  width: 320px;
  height: 200px;
}

.local-pip.minimized,
body.is-portrait-screen .local-pip.minimized {
  width: 120px !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  aspect-ratio: auto !important;
  background: rgba(12, 16, 26, 0.88) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.local-pip.minimized video,
.local-pip.minimized canvas,
.local-pip.minimized .pip-cam-off,
.local-pip.minimized .local-dual-inset-box {
  display: none !important;
}

.local-pip.minimized .pip-label {
  bottom: 50%;
  transform: translateY(50%);
  left: 8px;
}

/* Вложенный фрейм 2-й камеры «одна в другой» внутри основного селфи-фрейма */
.local-dual-inset-box {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 40%;
  height: 40%;
  min-width: 46px;
  min-height: 62px;
  border-radius: 10px;
  border: 2px solid rgba(56, 189, 248, 0.92);
  background: #05070c;
  overflow: hidden;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  isolation: isolate;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.78);
  z-index: 45 !important;
  -webkit-transform: translate3d(0, 0, 2px);
  transform: translate3d(0, 0, 2px);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.local-dual-inset-box:active {
  -webkit-transform: translate3d(0, 0, 2px) scale(0.95);
  transform: translate3d(0, 0, 2px) scale(0.95);
}

.local-dual-inset-box video,
.local-dual-inset-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transform-origin: top center;
  pointer-events: none;
  display: block;
}

.local-dual-inset-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.local-dual-inset-badge {
  position: absolute;
  bottom: 3px;
  left: 4px;
  right: 4px;
  font-size: 0.56rem;
  font-weight: 700;
  text-align: center;
  background: rgba(0, 0, 0, 0.68);
  color: #e0f2fe;
  padding: 1px 4px;
  border-radius: 4px;
  z-index: 3;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#localVideo,
.local-front-keep-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  background: #000;
  pointer-events: none;
  /* По умолчанию участники видят себя кадрированными на 25%, не срезая макушку (top center) */
  -webkit-transform: scaleX(-1) scale(1.3333);
  transform: scaleX(-1) scale(1.3333);
  transform-origin: top center;
}

.local-front-keep-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
}

/* ==================== ВТОРАЯ КАРТИНКА (ДЛЯ СУПЕР-АДМИНА) ==================== */
.remote-secondary-pip {
  position: fixed;
  top: 64px;
  left: 20px;
  background: #07090e;
  border: 2px solid var(--accent);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.8);
  z-index: 32;
  cursor: grab;
  transition: width 0.2s ease, height 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remote-secondary-pip:active {
  cursor: grabbing;
}

.remote-secondary-pip.size-m {
  width: 300px;
  height: 210px;
}

.remote-secondary-pip.size-l {
  width: 440px;
  height: 310px;
}

.remote-secondary-pip.size-xl {
  width: 620px;
  height: 440px;
}

#remoteSecondaryVideo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.pip-toolbar.visible-bar {
  opacity: 1;
}

.pip-mini-btn.wide-btn {
  width: auto;
  padding: 0 8px;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.85);
  border-color: rgba(147, 197, 253, 0.4);
}

.pip-mini-btn.danger-mini-btn:hover {
  background: var(--danger);
}

.pip-cam-off {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  background: #10131c;
  color: var(--text-muted);
  font-size: 0.76rem;
  z-index: 55 !important;
  -webkit-transform: translate3d(0, 0, 3px);
  transform: translate3d(0, 0, 3px);
}

.pip-toolbar {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0.95;
  transition: opacity 0.18s;
  z-index: 65 !important;
  pointer-events: auto !important;
  -webkit-transform: translate3d(0, 0, 4px);
  transform: translate3d(0, 0, 4px);
}

.local-pip:hover .pip-toolbar,
.local-pip.minimized .pip-toolbar {
  opacity: 1;
}

.pip-mini-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(10, 12, 18, 0.8);
  color: #fff;
  font-size: 0.72rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pip-mini-btn:hover {
  background: var(--accent);
}

.pip-label {
  position: absolute;
  bottom: 6px;
  left: 8px;
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 7px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.85);
  pointer-events: none;
  z-index: 60 !important;
  -webkit-transform: translate3d(0, 0, 3px);
  transform: translate3d(0, 0, 3px);
}

body.split-screen-active #localPipContainer {
  opacity: 0.01 !important;
  pointer-events: none !important;
  width: 2px !important;
  height: 2px !important;
  right: 0 !important;
  bottom: 0 !important;
  left: auto !important;
  top: auto !important;
  border: none !important;
  box-shadow: none !important;
  overflow: hidden !important;
  z-index: 9998 !important;
}

body.conference-grid-active #localPipContainer {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  right: 0 !important;
  bottom: 0 !important;
  left: auto !important;
  top: auto !important;
  border: none !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

body.conference-grid-active .remote-ambient-bg {
  display: none !important;
}

#lobbyBgModeBtn,
#bgPipModeBtn {
  display: none !important;
}

/* ==================== НИЖНЯЯ ПАНЕЛЬ КНОПОК ==================== */
.bottom-bar {
  position: fixed;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  background: rgba(14, 17, 26, 0.88);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  padding: 8px 12px;
  width: max-content;
  max-width: calc(100vw - 12px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.bottom-bar::-webkit-scrollbar {
  display: none;
}

.bottom-bar.auto-hidden,
.bottom-bar.manually-collapsed {
  opacity: 0;
  transform: translate(-50%, 28px);
  pointer-events: none;
}

.bar-btn.collapse-bar-btn {
  padding: 9px 12px;
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, 0.14);
}

.bar-btn.collapse-bar-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.expand-bottom-bar-btn {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 36;
  background: rgba(14, 17, 26, 0.78);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.76rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
  transition: all 0.2s ease;
}

.expand-bottom-bar-btn:hover {
  background: rgba(37, 99, 235, 0.85);
  border-color: rgba(147, 197, 253, 0.5);
  color: #fff;
}

.bar-group {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  width: max-content;
}

.bar-btn {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 0.81rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.bar-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.bar-btn.muted-state {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.55);
  color: #fecaca;
}

.bar-btn.locked-by-host {
  opacity: 0.5;
  cursor: not-allowed;
}

.bar-btn.primary-highlight {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.bar-btn.primary-highlight:hover {
  background: var(--accent-hover);
}

.bar-btn.noise-supp-active {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.55);
  color: #6ee7b7;
}

.bar-btn.noise-supp-active:hover {
  background: rgba(16, 185, 129, 0.28);
}

.bar-btn.light-enhance-active {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.55);
  color: #fde68a;
}

.bar-btn.light-enhance-active:hover {
  background: rgba(245, 158, 11, 0.28);
}

.bar-btn.hangup-btn {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.bar-btn.hangup-btn:hover {
  background: var(--danger-hover);
}

@media (max-width: 1024px) {
  .bottom-bar {
    padding: 6px 10px;
    max-width: calc(100vw - 10px);
    border-radius: 22px;
  }
  .bar-group {
    gap: 5px;
  }
  .bar-btn {
    padding: 8px 10px;
    font-size: 0.76rem;
  }
}

@media (max-width: 820px) {
  .bar-btn-text {
    display: none;
  }
  .bar-btn {
    padding: 9px 11px;
  }
  .local-pip.size-m {
    width: 135px;
    height: 100px;
  }
}

/* ==================== ВЕРТИКАЛЬНОЕ СВОЕ ИЗОБРАЖЕНИЕ ТОЛЬКО КОГДА САМА КАМЕРА ВЕРТИКАЛЬНАЯ (is-portrait-cam) ==================== */
body.is-portrait-cam .lobby-preview-box {
  aspect-ratio: 9 / 16;
  max-width: 280px;
  max-height: 50vh;
  margin: 0 auto;
}
body.is-portrait-cam .local-pip.size-s {
  width: 90px;
  height: 150px;
}
body.is-portrait-cam .local-pip.size-m {
  width: 120px;
  height: 200px;
}
body.is-portrait-cam .local-pip.size-l {
  width: 162px;
  height: 270px;
}
body.is-portrait-cam .my-secondary-pip.size-s {
  width: 90px;
  height: 150px;
}
body.is-portrait-cam .my-secondary-pip.size-m {
  width: 120px;
  height: 200px;
}
body.is-portrait-cam .my-secondary-pip.size-l {
  width: 162px;
  height: 270px;
}
body.is-portrait-cam .lobby-second-cam-box {
  width: 84px;
  height: 140px;
}

/* ==================== БОКОВОЙ ПУЛЬТ СУПЕР-АДМИНА ==================== */
.side-drawer {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: 390px;
  max-width: calc(100vw - 24px);
  background: var(--bg-panel);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.drawer-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-header h3 {
  font-size: 1.02rem;
}

.drawer-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-main);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.drawer-body {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.control-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.section-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #93c5fd;
  font-weight: 700;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.remote-action-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.remote-action-btn:hover {
  background: rgba(255, 255, 255, 0.11);
}

.remote-action-btn strong {
  display: block;
  font-size: 0.82rem;
}

.remote-action-btn small {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

.status-indicator.off {
  background: var(--danger);
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.82rem;
  color: var(--text-main);
  cursor: pointer;
}

.row-with-btn {
  display: flex;
  gap: 6px;
}

.small-btn {
  padding: 7px 10px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.full-width {
  width: 100%;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-row > button {
  flex: 1;
}

/* ==================== ЭКРАН ФЕЙК-ВЫХОДА ==================== */
.fake-left-screen {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: radial-gradient(circle at 50% 20%, #161f35 0%, #06070b 75%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.fake-left-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 32px 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

.fake-left-card h2 {
  font-size: 1.25rem;
}

.fake-left-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.inapp-notice {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(15, 19, 30, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== АВАТАРКИ УЧАСТНИКОВ ==================== */
.user-profile-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  pointer-events: auto;
}

.user-profile-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
  pointer-events: auto;
  position: relative;
  z-index: 15;
}

.user-avatar {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  aspect-ratio: 1 / 1;
  border-radius: 50% !important;
  object-fit: cover !important;
  overflow: hidden;
  border: 2px solid rgba(59, 130, 246, 0.75);
  background: #0f172a;
  flex-shrink: 0;
  cursor: pointer !important;
  pointer-events: auto !important;
  transition: transform 0.15s, border-color 0.15s;
}

.user-avatar:hover {
  transform: scale(1.06);
  border-color: #60a5fa;
}

.contact-avatar {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  aspect-ratio: 1 / 1;
  border-radius: 50% !important;
  object-fit: cover !important;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: #0f172a;
  flex-shrink: 0;
}

.room-peer-avatars {
  display: flex;
  align-items: center;
  margin-right: 4px;
}

.room-peer-avatar {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  aspect-ratio: 1 / 1;
  border-radius: 50% !important;
  object-fit: cover !important;
  overflow: hidden;
  border: 1.5px solid #fde68a;
  background: #0f172a;
  margin-left: -6px;
}

.room-peer-avatar:first-child {
  margin-left: 0;
}

.incoming-avatar-wrap {
  position: relative;
  width: 82px;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.incoming-avatar {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--success);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.5);
  background: #0f172a;
}

.pulse-ring-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  border: 2px solid #0e111b;
}

.remote-off-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(59, 130, 246, 0.5);
}

.avatar-picker-box {
  background: rgba(15, 20, 32, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.avatar-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #93c5fd;
  font-weight: 600;
}

.close-mini-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
}

.avatar-presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.avatar-preset-item {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.16);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.avatar-preset-item:hover,
.avatar-preset-item.selected {
  transform: scale(1.1);
  border-color: var(--accent);
}

.avatar-picker-footer {
  display: flex;
  justify-content: center;
}

.reg-avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 12px;
  border-radius: 10px;
}

.reg-avatar-controls {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.reg-avatar-label {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.reg-avatar-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ==================== ВЫБОР И ПЕРЕКЛЮЧЕНИЕ КАМЕР В ЛОББИ И В ЗВОНКЕ ==================== */
.lobby-device-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 12px;
  flex-wrap: wrap;
}

.device-select-col {
  flex: 1;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.device-select-col label {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}

.device-select-col select {
  padding: 6px 9px;
  font-size: 0.8rem;
}

.lobby-second-cam-box {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 120px;
  height: 85px;
  background: #000;
  border: 2px solid rgba(56, 189, 248, 0.92);
  border-radius: 10px;
  overflow: hidden;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  isolation: isolate;
  z-index: 4;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.65);
}

.lobby-second-cam-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transform-origin: top center;
}

.lobby-sec-label {
  position: absolute;
  bottom: 4px;
  left: 6px;
  font-size: 0.65rem;
  background: rgba(0, 0, 0, 0.7);
  color: #93c5fd;
  padding: 1px 5px;
  border-radius: 4px;
}

.pip-connect-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.pip-connect-btn:hover {
  background: var(--accent-hover);
}

/* ==================== СОБСТВЕННЫЙ ФРЕЙМ 2-Й КАМЕРЫ УЧАСТНИКА ==================== */
.my-secondary-pip {
  position: fixed;
  bottom: 88px;
  left: 20px;
  background: #080a10;
  border: 2px solid #38bdf8;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.75);
  z-index: 31;
  cursor: grab;
  transition: width 0.2s ease, height 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.my-secondary-pip:active {
  cursor: grabbing;
}

.my-secondary-pip.size-s {
  width: 165px;
  height: 110px;
}

.my-secondary-pip.size-m {
  width: 250px;
  height: 165px;
}

.my-secondary-pip.size-l {
  width: 360px;
  height: 240px;
}

#mySecondaryVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  pointer-events: none;
}

/* ==================== МЕНЮ ВЫБОРА КАМЕРЫ И МИКРОФОНА ВО ВРЕМЯ ЗВОНКА ==================== */
.call-device-menu {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  max-width: calc(100vw - 24px);
  background: rgba(14, 18, 29, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: 16px;
  padding: 14px;
  z-index: 45;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.call-device-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 700;
  color: #93c5fd;
}

.call-device-menu-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.call-device-menu-body label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==================== ВЕРХНЯЯ ПРАВАЯ КНОПКА ВЫХОДА НА ГЛАВНУЮ АДМИНА ==================== */
.top-right-actions {
  position: fixed;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 24px);
  overflow-x: auto;
  scrollbar-width: none;
  z-index: 95;
  pointer-events: auto;
}

.top-right-actions::-webkit-scrollbar {
  display: none;
}

.admin-home-btn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.96), rgba(217, 119, 6, 0.96));
  color: #090b10;
  border: 1px solid #fde68a;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  transition: transform 0.15s, filter 0.15s;
}

.admin-home-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.user-home-btn {
  background: rgba(15, 19, 30, 0.8);
  backdrop-filter: blur(8px);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.user-home-btn:hover {
  background: rgba(37, 99, 235, 0.8);
}

.waiting-actions-row {
  margin-top: 6px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.drawer-header-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==================== МУЛЬТИ-КАМЕРНАЯ ПАНЕЛЬ СУПЕР-АДМИНА (ВСЕ КАМЕРЫ СРАЗУ) ==================== */
.admin-all-cameras-dock {
  position: fixed;
  top: 58px;
  left: 16px;
  z-index: 33;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  padding: 6px;
  pointer-events: auto;
}

.admin-all-cameras-dock::-webkit-scrollbar {
  width: 4px;
}

.admin-all-cameras-dock::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}

.admin-cam-tile {
  position: relative;
  width: 210px;
  height: 132px;
  background: #080b12;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75);
  transition: transform 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-cam-tile:hover {
  transform: translateY(-2px);
  border-color: #60a5fa;
}

.admin-cam-tile.active-stage {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.45), 0 10px 28px rgba(0, 0, 0, 0.8);
}

.admin-cam-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  pointer-events: none;
}

.admin-cam-tile-header {
  position: absolute;
  top: 5px;
  left: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  z-index: 2;
  pointer-events: none;
}

.admin-cam-tile-user {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(6, 9, 15, 0.78);
  backdrop-filter: blur(6px);
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  max-width: 145px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-cam-tile-user img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
}

.admin-cam-tile-badge {
  background: rgba(245, 158, 11, 0.9);
  color: #000;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
}

.admin-cam-tile-footer {
  position: absolute;
  bottom: 5px;
  left: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}

.admin-cam-tile-label {
  font-size: 0.66rem;
  background: rgba(0, 0, 0, 0.72);
  color: #cbd5e1;
  padding: 2px 6px;
  border-radius: 5px;
}

.admin-cam-tile-fullscreen-btn {
  background: rgba(37, 99, 235, 0.88);
  color: #fff;
  border: 1px solid rgba(147, 197, 253, 0.45);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 0.66rem;
  font-weight: 700;
  cursor: pointer;
}

.admin-cam-tile-fullscreen-btn:hover {
  background: var(--accent);
}

.admin-cam-tile-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.72rem;
}

@media (max-width: 720px) {
  .admin-cam-tile {
    width: 148px;
    height: 96px;
  }
}

/* ==================== УПРАВЛЕНИЕ И ЗАКРЫТИЕ КОМНАТ АДМИНОМ ==================== */
.admin-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-room-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.close-room-btn {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.close-room-btn:hover {
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
}

.admin-close-room-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: #fff;
  border: 1px solid rgba(252, 165, 165, 0.4);
  border-radius: 10px;
  padding: 8px 13px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.admin-close-room-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.5);
}

/* ==================== 1) КАДРИРОВАНИЕ СВОЕГО СЕЛФИ У ВСЕХ (А ПОЛНЫЙ КАДР СОБЕСЕДНИКА — ТОЛЬКО У АДМИНА) ==================== */
.admin-cam-tile video {
  object-fit: contain;
}

/* ==================== 2) КНОПКИ В СТИЛЕ GOOGLE MEET (БЕЗ ЭМОДЗИ, ЧЁТКИЕ SVG) ==================== */
.gmeet-lobby-bar {
  background: rgba(32, 33, 36, 0.92);
  backdrop-filter: blur(12px);
  padding: 6px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

.gmeet-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: #3c4043;
  color: #e8eaed;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.16s ease, transform 0.12s ease, border-color 0.16s ease;
}

@media (max-width: 480px) {
  .gmeet-btn {
    height: 36px;
    padding: 0 9px;
    gap: 5px;
    font-size: 0.72rem;
  }
}

.gmeet-btn:hover {
  background: #4a4e52;
}

.gmeet-btn.is-off,
.gmeet-btn.muted {
  background: #ea4335 !important;
  border-color: #ea4335 !important;
  color: #ffffff !important;
}

.gmeet-btn.active-feature {
  background: #8ab4f8 !important;
  border-color: #8ab4f8 !important;
  color: #202124 !important;
}

.gmeet-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .gmeet-icon, .gmeet-icon svg {
    width: 17px !important;
    height: 17px !important;
  }
}

.gmeet-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* Нижняя панель звонка в стиле Google Meet в 2 ряда */
.gmeet-bottom-bar {
  background: rgba(32, 33, 36, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 24px !important;
  padding: 8px 12px !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 6px !important;
  max-width: calc(100vw - 12px) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.bottom-bar-primary-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  padding: 2px 2px;
}

.bottom-bar-primary-row::-webkit-scrollbar {
  display: none;
}

.bottom-bar-secondary-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  padding: 2px 2px;
}

.bottom-bar-secondary-row::-webkit-scrollbar {
  display: none;
}

.gmeet-bar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.gmeet-call-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 56px;
  height: 50px;
  padding: 4px 12px;
  border-radius: 25px;
  background: #3c4043;
  color: #e8eaed;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.16s ease, transform 0.12s ease, border-color 0.16s ease;
}

.gmeet-call-btn:hover {
  background: #4d5156;
}

.gmeet-call-btn:active {
  transform: scale(0.96);
}

.gmeet-call-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.gmeet-call-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.gmeet-call-label {
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.1px;
  white-space: nowrap;
  color: inherit;
}

/* Выключенный микрофон или камера — ярко-красная кнопка как в Google Meet */
.gmeet-call-btn.is-off,
.gmeet-call-btn.muted-state {
  background: #ea4335 !important;
  border-color: #ea4335 !important;
  color: #ffffff !important;
}

.gmeet-call-btn.is-off:hover,
.gmeet-call-btn.muted-state:hover {
  background: #d93025 !important;
}

/* Включенная дополнительная функция (Экран, 50/50, 2-я камера, Шумодав, Свет, В фоне) */
.gmeet-call-btn.active-feature,
.gmeet-call-btn.primary-highlight,
.gmeet-call-btn.noise-supp-active,
.gmeet-call-btn.light-enhance-active {
  background: #8ab4f8 !important;
  border-color: #8ab4f8 !important;
  color: #202124 !important;
}

.gmeet-call-btn.admin-drawer-btn {
  background: rgba(245, 158, 11, 0.24);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fde68a;
}

/* Красная овальная кнопка завершения вызова как в Google Meet */
.gmeet-hangup-btn {
  background: #ea4335 !important;
  border-color: #ea4335 !important;
  color: #ffffff !important;
  min-width: 68px;
  padding: 4px 18px;
}

.gmeet-hangup-btn:hover {
  background: #d93025 !important;
}

.gmeet-collapse-btn {
  min-width: 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 768px) {
  .gmeet-bottom-bar {
    bottom: calc(16px + env(safe-area-inset-bottom, 10px)) !important;
    padding: 8px 8px !important;
    gap: 6px !important;
    width: calc(100vw - 12px) !important;
    max-width: 430px !important;
    border-radius: 22px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  .bottom-bar-primary-row,
  .bottom-bar-secondary-row {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 5px !important;
    padding: 1px 2px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  .gmeet-call-label {
    display: none !important;
  }
  .gmeet-call-btn {
    min-width: 36px !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    gap: 0 !important;
    flex-shrink: 0 !important;
  }
  .bottom-bar-secondary-row .gmeet-call-btn {
    min-width: 34px !important;
    width: 34px !important;
    height: 34px !important;
  }
  .gmeet-call-icon,
  .gmeet-call-icon svg {
    width: 18px !important;
    height: 18px !important;
  }
  .gmeet-hangup-btn {
    min-width: 44px !important;
    width: 44px !important;
    height: 36px !important;
    padding: 0 !important;
    border-radius: 18px !important;
  }
  .gmeet-collapse-btn {
    min-width: 34px !important;
    width: 34px !important;
    height: 34px !important;
  }
  .expand-bottom-bar-btn {
    bottom: calc(16px + env(safe-area-inset-bottom, 10px)) !important;
  }
  .gmeet-btn span:not(.gmeet-icon) {
    display: none !important;
  }
  .gmeet-btn {
    width: 38px;
    padding: 0;
    border-radius: 50%;
  }
}

@media (max-width: 480px) {
  .user-profile-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .user-profile-actions {
    justify-content: flex-end;
    width: 100%;
  }
  .app-dl-btn {
    width: 100%;
  }
}

/* ==================== 4) СВОБОДНОЕ ПЕРЕМЕЩЕНИЕ, МЕНЬШИЕ РАЗМЕРЫ (XS/S) И ПРОЗРАЧНОСТЬ ВСЕХ ФРЕЙМОВ ==================== */
.local-pip.size-xs {
  width: 105px;
  height: 72px;
}

.my-secondary-pip.size-xs {
  width: 110px;
  height: 75px;
}

.remote-secondary-pip.size-xs {
  width: 140px;
  height: 96px;
}

.remote-secondary-pip.size-s {
  width: 210px;
  height: 145px;
}

body.is-portrait-cam .local-pip.size-xs,
body.is-portrait-cam .my-secondary-pip.size-xs {
  width: 68px;
  height: 112px;
}

.admin-cam-tile.portrait-tile {
  width: 112px !important;
  height: 192px !important;
  aspect-ratio: 9 / 16;
}

.admin-cam-tile.size-xs {
  width: 130px !important;
  height: 84px !important;
}

.admin-cam-tile.portrait-tile.size-xs {
  width: 82px !important;
  height: 142px !important;
}

.admin-cam-tile.size-s {
  width: 168px !important;
  height: 108px !important;
}

.admin-cam-tile.portrait-tile.size-s {
  width: 112px !important;
  height: 192px !important;
}

.admin-cam-tile.size-m {
  width: 220px !important;
  height: 140px !important;
}

.admin-cam-tile.portrait-tile.size-m {
  width: 142px !important;
  height: 244px !important;
}

.admin-cam-tile.size-l {
  width: 310px !important;
  height: 198px !important;
}

.admin-cam-tile.portrait-tile.size-l {
  width: 185px !important;
  height: 318px !important;
}

.admin-cam-tile.portrait-tile .admin-cam-tile-footer {
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  bottom: 4px;
  left: 4px;
  right: 4px;
}

.admin-cam-tile.portrait-tile .admin-cam-tile-label {
  text-align: center;
  font-size: 0.6rem;
  padding: 1px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-cam-tile.portrait-tile .admin-cam-tile-footer > div {
  width: 100%;
  display: flex;
  gap: 3px;
}

.admin-cam-tile.portrait-tile .admin-cam-tile-fullscreen-btn {
  font-size: 0.62rem;
  padding: 2px 4px;
  text-align: center;
  flex: 1;
}

.admin-cam-tile.portrait-tile .admin-cam-tile-header {
  top: 4px;
  left: 4px;
  right: 4px;
}

.admin-cam-tile.portrait-tile .admin-cam-tile-user {
  font-size: 0.62rem;
  padding: 1px 5px;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-cam-tile.floating-tile {
  position: fixed !important;
  z-index: 34 !important;
  cursor: grab;
}

.admin-cam-tile.floating-tile:active {
  cursor: grabbing;
}

.admin-cam-tile-controls {
  display: flex;
  align-items: center;
  gap: 3px;
  pointer-events: auto;
}

.admin-tile-mini-btn {
  background: rgba(15, 20, 30, 0.85);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 5px;
  width: 22px;
  height: 20px;
  font-size: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.admin-tile-mini-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* ==================== 5) РЕЖИМ СОВМЕСТНОЙ ТРАНСЛЯЦИИ 50 / 50 (SPLIT SCREEN) ==================== */
.split-screen-container {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: #05070c;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  gap: 4px;
  padding: 4px;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

/* На вертикальном экране по умолчанию делим пополам сверху и снизу */
@media (orientation: portrait) {
  .split-screen-container:not(.force-side-by-side) {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
}

.split-screen-container.force-side-by-side {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
}

.split-screen-container.force-top-bottom {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) !important;
}

.split-pane {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  background: #080b12;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.split-pane .split-crop-frame {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 2;
  touch-action: none;
  cursor: grab;
}

.split-pane .split-crop-frame:active {
  cursor: grabbing;
}

.split-pane video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform-origin: center center;
  background: transparent;
}

.split-pane video.fit-cover {
  object-fit: cover;
  object-position: center center;
}

.split-global-toolbar {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(59, 130, 246, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  max-width: calc(100vw - 16px);
  pointer-events: auto;
}

.split-global-pill {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f8fafc;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.split-global-pill:hover,
.split-global-pill.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #93c5fd;
  color: #ffffff;
}

.split-pane-bar {
  position: absolute;
  bottom: 10px;
  left: 8px;
  right: 8px;
  top: auto;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  pointer-events: auto;
}

.split-pane-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
}

.split-source-select {
  max-width: 150px;
  width: auto;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(12, 16, 26, 0.84);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fff;
}

.split-mini-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(12, 16, 26, 0.84);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.split-mini-btn:hover,
.split-mini-btn.active {
  background: var(--accent);
  border-color: #93c5fd;
}

/* Баннер активной демонстрации своего экрана */
.screen-share-active-banner {
  position: fixed;
  top: calc(54px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 88;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.94), rgba(15, 23, 42, 0.94));
  border: 1.5px solid rgba(74, 222, 128, 0.85);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.65);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  max-width: calc(100vw - 20px);
  pointer-events: auto;
}

.screen-share-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  flex-shrink: 0;
  animation: pulseRecDot 1.1s infinite ease-in-out;
}

.screen-share-stop-pill {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(254, 202, 202, 0.8);
  background: #dc2626;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.split-direction-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 8;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(32, 33, 36, 0.92);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.75);
}

.split-direction-btn:hover {
  background: var(--accent);
}

/* HTTPS Live Video Relay Fallback (когда UDP WebRTC блокируется VPN/CGNAT) */
.remote-relay-img,
.admin-tile-relay-img,
.split-relay-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
  background: transparent !important;
  transition: transform 0.2s ease;
}

/* ==================== БЛОКИ СКАЧИВАНИЯ ПРИЛОЖЕНИЙ (УЧАСТНИКИ И АДМИН) ==================== */
.app-install-banner {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-install-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #93c5fd;
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-install-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.app-install-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.app-dl-btn {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.app-dl-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.app-dl-btn.ios-btn {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.app-dl-btn.ios-btn:hover {
  background: var(--success);
  color: #fff;
}

.app-dl-btn.pc-btn {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
}

.app-dl-btn.pc-btn:hover {
  background: #8b5cf6;
  color: #fff;
}

/* Баннер Супер-Админа (золотистый стиль) */
.admin-install-banner {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.admin-install-banner .app-install-title {
  color: #fde68a;
}

.app-dl-btn.admin-btn {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fde68a;
}

.app-dl-btn.admin-btn:hover {
  background: var(--warning);
  color: #000;
}

/* ==================== 6) ВСПЛЫВАЮЩИЙ ЧАТ ЗВОНКА С ЭМОДЗИ И БЬЮТИ-ФИЛЬТРЫ ==================== */
.call-chat-drawer {
  position: fixed;
  bottom: 82px;
  right: 18px;
  width: 310px;
  max-width: calc(100vw - 24px);
  height: 280px;
  max-height: calc(100vh - 160px);
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  z-index: 55;
  overflow: hidden;
  animation: chatFadeIn 0.16s ease-out;
  pointer-events: auto;
}

@keyframes chatFadeIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
  .call-chat-drawer {
    right: 8px;
    left: 8px;
    width: auto;
    bottom: 74px;
    height: 210px;
    max-height: 38vh;
    background: rgba(11, 15, 25, 0.88);
  }
}

.chat-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.chat-drawer-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.82rem;
  color: #f1f5f9;
}

.chat-online-hint {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 400;
}

.call-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  scrollbar-width: thin;
}

.chat-empty-hint {
  text-align: center;
  color: #64748b;
  font-size: 0.74rem;
  margin: auto 0;
  padding: 10px;
}

.chat-msg {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-end !important;
  gap: 8px !important;
  max-width: 92% !important;
  margin-bottom: 8px !important;
  animation: chatMsgIn 0.15s ease-out;
}

.chat-msg.chat-msg-mine,
.chat-msg.mine {
  align-self: flex-end !important;
  flex-direction: row-reverse !important;
}

.chat-msg.chat-msg-other,
.chat-msg.theirs {
  align-self: flex-start !important;
  flex-direction: row !important;
}

.chat-msg-avatar {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  flex-shrink: 0 !important;
  border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
  display: block !important;
}

.chat-msg-bubble {
  display: flex !important;
  flex-direction: column !important;
  padding: 7px 12px !important;
  border-radius: 14px !important;
  word-break: break-word !important;
  font-size: 0.84rem !important;
  line-height: 1.35 !important;
  max-width: 100% !important;
}

.chat-msg.chat-msg-mine .chat-msg-bubble,
.chat-msg.mine .chat-msg-bubble {
  background: #2563eb !important;
  color: #fff !important;
  border-bottom-right-radius: 3px !important;
}

.chat-msg.chat-msg-other .chat-msg-bubble,
.chat-msg.theirs .chat-msg-bubble {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #e2e8f0 !important;
  border-bottom-left-radius: 3px !important;
}

.chat-msg-author,
.chat-msg-sender {
  font-size: 0.68rem !important;
  color: #93c5fd !important;
  font-weight: 600 !important;
  margin-bottom: 2px !important;
}

.chat-msg.chat-msg-other .chat-msg-author,
.chat-msg.theirs .chat-msg-sender {
  color: #cbd5e1 !important;
}

.chat-msg-text {
  font-size: 0.84rem !important;
  word-break: break-word !important;
  color: inherit !important;
}

.chat-msg-time {
  font-size: 0.6rem !important;
  opacity: 0.65 !important;
  align-self: flex-end !important;
  margin-top: 2px !important;
}

.call-chat-quick-emojis {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
}

.chat-emoji-btn {
  background: transparent;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 6px;
  transition: transform 0.1s, background 0.1s;
  flex-shrink: 0;
}

.chat-emoji-btn:hover,
.chat-emoji-btn:active {
  transform: scale(1.18);
  background: rgba(255, 255, 255, 0.12);
}

.call-chat-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.call-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 6px 12px;
  color: #fff;
  font-size: 0.82rem;
  outline: none;
  min-height: 32px;
}

.call-chat-input:focus {
  border-color: #3b82f6;
  background: rgba(255, 255, 255, 0.12);
}

.chat-badge {
  position: absolute;
  top: 1px;
  right: 4px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 5px;
  min-width: 15px;
  text-align: center;
  line-height: 1.2;
}

/* Эффекты HD+ (Свет HD+, Резкость HD+, Контраст HD+, Ночной HD+) — кристальная чёткость без размытия */
.light-mode-auto {
  filter: brightness(1.1) contrast(1.06) saturate(1.08) !important;
}

.filter-sharp,
.light-mode-sharp {
  filter: contrast(1.16) brightness(1.04) saturate(1.08) !important;
}

.filter-denoise,
.light-mode-denoise {
  filter: contrast(1.12) brightness(1.06) saturate(1.15) !important;
}

.light-mode-night {
  filter: brightness(1.28) contrast(1.1) saturate(1.12) !important;
}

/* Скрытие гигантской аватарки при открытом чате и компактный стиль баннера выключенной камеры */
body.chat-drawer-open #remoteCameraOffBanner,
body.chat-drawer-open .remote-cam-off {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.remote-cam-off {
  position: absolute;
  inset: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(8, 10, 16, 0.88);
  backdrop-filter: blur(12px);
  padding: 16px 24px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  z-index: 5;
  max-width: 90vw;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.remote-cam-off .avatar-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Фикс гигантской аватарки в чате */
.chat-msg-avatar {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  flex-shrink: 0 !important;
}

/* Вертикальные фреймы в мульти-док панели Супер-Админа для участников со смартфона */
.admin-cam-tile.portrait-tile {
  width: 112px !important;
  height: 182px !important;
  aspect-ratio: 9 / 16 !important;
  overflow: hidden !important;
  transform: none !important;
}

.admin-cam-tile.portrait-tile video,
.admin-cam-tile.portrait-tile .admin-tile-relay-img,
.admin-cam-tile.portrait-tile canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Убираем аватарку из крошечной шапки видео-плитки, чтобы она никогда не закрывала видео */
.admin-cam-tile-user img {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Кадрирование в доке: применяется ТОЛЬКО к video/img внутри плитки, а НЕ к самой плитке и НЕ зеркалит текст! */
.admin-cam-tile.admin-tile-crop-guest,
.admin-cam-tile.admin-tile-crop-sensor {
  transform: none !important;
}

.admin-tile-crop-guest video,
.admin-tile-crop-guest .admin-tile-relay-img {
  object-fit: cover !important;
  object-position: center center !important;
  transform-origin: center center !important;
}

.admin-tile-crop-sensor video,
.admin-tile-crop-sensor .admin-tile-relay-img {
  object-fit: contain !important;
  object-position: center center !important;
  transform: none !important;
}

/* Выраженные крупные плашки для Супер-Админа при выключенной камере или микрофоне у собеседника */
.admin-media-alert-bar {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 42;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  max-width: 92vw;
}

.admin-big-alert-pill {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  animation: alertPulse 1.8s infinite ease-in-out;
}

.admin-big-alert-pill.cam-off-pill {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border: 2px solid #fca5a5;
}

.admin-big-alert-pill.mic-off-pill {
  background: linear-gradient(135deg, #d97706, #b45309);
  border: 2px solid #fde68a;
}

@keyframes alertPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.admin-tile-state-alerts {
  position: absolute;
  top: 22px;
  right: 3px;
  left: auto;
  z-index: 4;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px;
  max-width: calc(100% - 6px);
  pointer-events: none;
}

.admin-tile-alert-tag {
  background: rgba(220, 38, 38, 0.78);
  color: #fff;
  font-size: 0.54rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  text-align: center;
  line-height: 1.1;
  border: 1px solid rgba(252, 165, 165, 0.65);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.admin-tile-alert-tag.mic-tag {
  background: rgba(217, 119, 6, 0.78);
  border-color: rgba(253, 230, 138, 0.65);
}

/* Всплывающие сообщения чата прямо поверх видео, когда окно чата закрыто */
.video-floating-chat-overlay {
  position: fixed;
  bottom: 145px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 48;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(420px, 92vw);
  pointer-events: none;
}

.floating-video-chat-card {
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(96, 165, 250, 0.55);
  border-radius: 16px;
  padding: 10px 14px;
  color: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
  max-width: 100%;
  animation: chatFadeIn 0.2s ease-out;
}

.floating-video-chat-card img {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  flex-shrink: 0 !important;
}

.floating-video-chat-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.floating-video-chat-author {
  font-size: 0.75rem;
  font-weight: 700;
  color: #60a5fa;
}

.floating-video-chat-text {
  font-size: 0.92rem;
  font-weight: 500;
  color: #f8fafc;
  word-break: break-word;
}

.call-chat-drawer {
  z-index: 95 !important;
}

/* Равномерное распределение кнопок по рядам панели на всех экранах без выхода за границы */
.bottom-bar-primary-row,
.bottom-bar-secondary-row {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  gap: 6px !important;
  padding: 2px 4px !important;
  scrollbar-width: none !important;
}

/* ==================== НАГЛЯДНАЯ ПОДСКАЗКА ДЛЯ НОВЫХ ПОЛЬЗОВАТЕЛЕЙ И СТАТУС ПРОЧТЕНИЯ (v43) ==================== */
.onboarding-guide-bar {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(16, 185, 129, 0.1));
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: #e2e8f0;
  line-height: 1.35;
}

.onboarding-step {
  display: flex;
  align-items: center;
  gap: 8px;
}

.onboarding-badge {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-msg-time {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 5px !important;
  font-size: 0.64rem !important;
  opacity: 0.88 !important;
  align-self: flex-end !important;
  margin-top: 3px !important;
}

.chat-read-status {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.64rem;
}

.chat-read-status.is-read {
  color: #86efac !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.contact-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.contact-status-pill.is-online {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}

/* ==================== ОБНОВЛЕНИЕ v50: ПОЛНОЕ СКРЫТИЕ БЕЛЫХ СКРОЛЛОВ, НОВОЕ МЕНЮ КОНТАКТОВ, 50/50, КНОПКИ СВЕРНУТЬ/ПЕРЕЗАГРУЗИТЬ ==================== */

/* 13) Полностью убираем все белые полосы прокрутки во всём приложении */
*,
*::before,
*::after,
html,
body,
.lobby-screen,
.lobby-card,
.contacts-list,
.admin-rooms-list,
.call-chat-messages,
.side-drawer,
.drawer-body,
.bottom-bar-primary-row,
.bottom-bar-secondary-row {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

*::-webkit-scrollbar,
html::-webkit-scrollbar,
body::-webkit-scrollbar,
.lobby-screen::-webkit-scrollbar,
.lobby-card::-webkit-scrollbar,
.contacts-list::-webkit-scrollbar,
.admin-rooms-list::-webkit-scrollbar,
.call-chat-messages::-webkit-scrollbar,
.side-drawer::-webkit-scrollbar,
.drawer-body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

/* 12) Защита от выхода кнопок за экран на главной странице (Lobby) на любых телефонах */
.lobby-card {
  width: 100% !important;
  max-width: 580px !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

.brand-header {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.brand-header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
  margin-left: auto !important;
}

.header-quick-btn {
  padding: 6px 10px !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  border: 1px solid rgba(59, 130, 246, 0.5) !important;
  background: rgba(30, 41, 59, 0.85) !important;
  color: #93c5fd !important;
  border-radius: 9px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}

.header-quick-btn:hover {
  background: #2563eb !important;
  color: #fff !important;
}

.gmeet-lobby-bar {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 6px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

.lobby-controls-row,
.lobby-primary-row,
.lobby-secondary-row {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 6px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

.gmeet-lobby-bar .gmeet-btn {
  flex: 1 1 calc(25% - 6px) !important;
  min-width: 64px !important;
  max-width: 120px !important;
  padding: 6px 4px !important;
  box-sizing: border-box !important;
}

.lobby-device-bar,
.call-by-nick-row,
.join-by-code-row,
.user-profile-bar {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  flex-wrap: wrap !important;
}

.call-by-nick-row input,
.join-by-code-row input {
  flex: 1 1 160px !important;
  min-width: 0 !important;
}

.call-by-nick-row button,
.join-by-code-row button {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}

/* 11) Режим 50/50: запрет кнопок полного кадра для обычных пользователей + компактные ненавязчивые кнопочки для стрима блогеров */
body:not(.is-admin-user) #splitFitBtn1,
body:not(.is-admin-user) #splitFitBtn2 {
  display: none !important;
}

.split-pane-bar {
  position: absolute !important;
  top: auto !important;
  bottom: 8px !important;
  left: 8px !important;
  right: auto !important;
  width: auto !important;
  max-width: calc(100% - 16px) !important;
  z-index: 14 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  pointer-events: auto !important;
  box-sizing: border-box !important;
  opacity: 0.62;
  transition: opacity 0.2s ease;
}

.split-pane-bar:hover,
.split-pane-bar:focus-within,
.split-pane-bar:active {
  opacity: 1;
}

#splitPane1 .split-pane-bar {
  top: auto !important;
  bottom: 8px !important;
}

#splitPane2 .split-pane-bar {
  top: auto !important;
  bottom: 8px !important;
}

.split-source-select {
  flex: 0 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 118px !important;
  padding: 3px 8px !important;
  font-size: 0.66rem !important;
  font-weight: 600 !important;
  border-radius: 999px !important;
  text-overflow: ellipsis !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  background: rgba(11, 15, 25, 0.72) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
}

.split-mini-btn {
  flex: 0 0 24px !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 0.7rem !important;
  background: rgba(11, 15, 25, 0.72) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
}

.split-direction-btn {
  width: 32px !important;
  height: 32px !important;
  font-size: 0.88rem !important;
  opacity: 0.75;
}

.split-direction-btn:hover,
.split-direction-btn:active {
  opacity: 1;
}

/* 4) Верхние кнопки Перезагрузки, Обновления и Сворачивания в звонке (с четкими отступами без слипания!) */
.top-right-actions {
  position: fixed !important;
  top: calc(env(safe-area-inset-top, 0px) + 10px) !important;
  right: 10px !important;
  left: auto !important;
  max-width: calc(100vw - 20px) !important;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 8px !important;
  row-gap: 6px !important;
  z-index: 95 !important;
}

.top-right-actions button {
  margin: 0 !important;
  padding: 7px 11px !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
  flex-shrink: 0 !important;
}

@media (max-width: 540px) {
  .top-bar-indicators {
    top: calc(env(safe-area-inset-top, 0px) + 52px) !important;
    left: 10px !important;
  }
  .top-right-actions {
    top: calc(env(safe-area-inset-top, 0px) + 8px) !important;
    right: 8px !important;
    left: 8px !important;
    justify-content: flex-end !important;
    gap: 6px !important;
  }
  .top-right-actions button {
    padding: 6px 10px !important;
    font-size: 0.71rem !important;
  }
}

.call-top-util-btn {
  background: rgba(15, 23, 42, 0.92) !important;
  border: 1.5px solid rgba(96, 165, 250, 0.55) !important;
  color: #f8fafc !important;
}

.call-top-util-btn:hover {
  background: #2563eb !important;
  color: #fff !important;
}

.minimized-floating-bar {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: min(460px, calc(100vw - 16px));
  background: rgba(11, 15, 25, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(34, 197, 94, 0.75);
  border-radius: 999px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8);
}

.minimized-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.minimized-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  flex-shrink: 0;
}

.minimized-bar-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.minimized-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.minimized-action-btn {
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(30, 41, 59, 0.92);
  color: #f8fafc;
  cursor: pointer;
}

.minimized-action-btn.primary {
  background: #16a34a;
  border-color: #4ade80;
}

/* В свёрнутом режиме (кнопка «🗕 Свернуть») основное окно аккуратно сворачивается в компактную верхнюю панель,
   при этом видеоэлемент камеры остаётся активным (2x2px) для беспрерывной связи! */
body.app-minimized-mode #lobbyScreen {
  padding-top: 64px !important;
  align-items: flex-start !important;
}

body.app-minimized-mode .lobby-card {
  max-width: 460px !important;
  padding: 6px 10px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

body.app-minimized-mode .lobby-card > *:not(#returnToActiveCallBanner):not(.lobby-preview-box) {
  display: none !important;
}

body.app-minimized-mode .lobby-preview-box {
  position: fixed !important;
  right: 1px !important;
  bottom: 1px !important;
  left: auto !important;
  top: auto !important;
  width: 4px !important;
  height: 4px !important;
  min-height: 4px !important;
  opacity: 0.02 !important;
  pointer-events: none !important;
  overflow: hidden !important;
  z-index: 9998 !important;
}

body.app-minimized-mode.in-active-call #callScreen {
  display: block !important;
  position: fixed !important;
  top: auto !important;
  left: auto !important;
  right: 12px !important;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px) !important;
  width: 148px !important;
  height: 210px !important;
  border-radius: 16px !important;
  border: 2px solid #3b82f6 !important;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.85) !important;
  z-index: 9990 !important;
  overflow: hidden !important;
  background: #05070c !important;
  cursor: pointer !important;
}

body.app-minimized-mode.in-active-call #bottomBar,
body.app-minimized-mode.in-active-call #expandBottomBarBtn,
body.app-minimized-mode.in-active-call #hostControlDrawer,
body.app-minimized-mode.in-active-call .top-right-actions,
body.app-minimized-mode.in-active-call .top-bar-indicators,
body.app-minimized-mode.in-active-call #localPipContainer,
body.app-minimized-mode.in-active-call #adminAllCamerasDock {
  display: none !important;
}

/* Баннер быстрого возврата в активный разговор на главной странице */
.return-active-call-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.22), rgba(15, 23, 42, 0.95));
  border: 1.5px solid rgba(74, 222, 128, 0.55);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.return-call-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #dcfce7;
  min-width: 0;
}

.return-call-btn {
  background: #16a34a !important;
  border: 1px solid #86efac !important;
  color: #fff !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  flex-shrink: 0;
}

/* Прямая P2P передача файлов и фото в чате (без сервера) */
.p2p-attach-btn {
  padding: 6px 10px !important;
  font-size: 1rem !important;
  border-radius: 10px !important;
  background: rgba(37, 99, 235, 0.22) !important;
  border: 1px solid rgba(96, 165, 250, 0.45) !important;
  color: #93c5fd !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
}

.p2p-attach-btn:hover {
  background: #2563eb !important;
  color: #fff !important;
}

.p2p-file-progress-box {
  margin: 0 10px 6px 10px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(59, 130, 246, 0.4);
  font-size: 0.73rem;
  color: #93c5fd;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.p2p-progress-bar-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.p2p-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  transition: width 0.15s ease;
}

.chat-file-attachment {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-file-preview-img {
  max-width: 210px;
  max-height: 210px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
}

.chat-file-preview-video {
  max-width: 220px;
  max-height: 200px;
  border-radius: 10px;
  background: #000;
}

.chat-file-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.35);
  border: 1px solid rgba(96, 165, 250, 0.5);
  color: #f8fafc;
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
  width: fit-content;
}

/* 13) Новое современное раскрывающееся меню контактов */
.modern-contacts-menu {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(11, 15, 25, 0.96)) !important;
  border: 1px solid rgba(59, 130, 246, 0.28) !important;
  border-radius: 16px !important;
  padding: 12px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

.modern-contacts-header {
  cursor: pointer;
  user-select: none;
  padding: 4px 2px 8px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 10px;
}

.contacts-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  color: #f8fafc;
}

.contacts-count-badge {
  background: rgba(37, 99, 235, 0.28);
  border: 1px solid rgba(96, 165, 250, 0.45);
  color: #93c5fd;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
}

.contacts-menu-body.collapsed {
  display: none !important;
}

.modern-contacts-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 7px !important;
  max-height: 290px !important;
  overflow-y: auto !important;
  padding: 2px 0 !important;
}

.modern-contact-card {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 13px;
  padding: 8px 11px;
  transition: background 0.16s ease, border-color 0.16s ease;
  cursor: pointer;
}

.modern-contact-card:hover,
.modern-contact-card.expanded {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(59, 130, 246, 0.5);
}

.contact-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.contact-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.modern-contact-avatar-wrap,
.contact-avatar-wrap {
  position: relative;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  flex-shrink: 0;
}

.modern-contact-avatar,
.contact-avatar-sm {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
  border: 1.5px solid rgba(96, 165, 250, 0.5);
}

.modern-contact-dot,
.contact-online-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #64748b;
  border: 2px solid #0f172a;
}

.modern-contact-dot.is-online,
.contact-online-dot.is-online {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
}

.contact-text-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.contact-name-line {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.contact-nick-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #f8fafc;
}

.contact-last-msg {
  font-size: 0.72rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.contact-chevron {
  font-size: 0.78rem;
  color: #94a3b8;
  transition: transform 0.18s ease;
  flex-shrink: 0;
}

.modern-contact-card.expanded .contact-chevron {
  transform: rotate(180deg);
  color: #60a5fa;
}

.contact-expand-actions {
  display: none;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  gap: 6px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.modern-contact-card.expanded .contact-expand-actions {
  display: flex;
}

.contact-action-pill {
  flex: 1 1 calc(33.3% - 6px);
  min-width: 78px;
  padding: 7px 8px;
  border-radius: 9px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: transform 0.12s ease, background 0.15s ease;
}

.contact-action-pill.act-call {
  background: linear-gradient(135deg, #16a34a, #15803d);
  border-color: rgba(74, 222, 128, 0.45);
}

.contact-action-pill.act-chat {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: rgba(96, 165, 250, 0.45);
}

.contact-action-pill.act-room {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(148, 163, 184, 0.4);
}

.contact-action-pill:hover {
  filter: brightness(1.12);
}

/* Кнопка Свернуть НИКОГДА не делает чёрный экран на устройстве (только системное сворачивание/фоновый выход) */
body.app-stealth-minimized {
  cursor: default;
}

/* ==================== ЭКСКЛЮЗИВНАЯ КОМНАТА ДЛЯ СЕБЯ (БЬЮТИ-МАСКИ, ОМОЛОЖЕНИЕ, ЗАПИСЬ 20%) ==================== */
.solo-studio-btn {
  width: 100%;
  margin-top: 8px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid rgba(236, 72, 153, 0.55);
  background: linear-gradient(135deg, #db2777 0%, #9333ea 55%, #4f46e5 100%);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(219, 39, 119, 0.35);
  transition: transform 0.14s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.solo-studio-btn:hover {
  filter: brightness(1.09);
  box-shadow: 0 10px 28px rgba(219, 39, 119, 0.48);
}

.solo-studio-btn:active {
  transform: scale(0.985);
}

.studio-master-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center !important;
  z-index: 4;
  pointer-events: none;
  background: transparent;
}

/* В эксклюзивной комнате для себя кадрирование строго по середине 20% */
body.in-solo-studio #localVideo,
body.in-solo-studio #localFrontKeepCanvas,
body.in-solo-studio #localDualInsetVideo,
body.in-solo-studio #localDualInsetCanvas {
  object-position: center center !important;
  transform-origin: center center !important;
}

/* В комнате для съёмки себя селфи ВСЕГДА идёт на весь экран, а малый угловой фрейм #localPipContainer остаётся в углу 4x4px с положительным z-index, чтобы iOS WebKit не ставил камеру на паузу (onmute, hidden:false)! */
body.in-solo-studio:not(.is-stealth-admin-mode) #localPipContainer,
body.in-solo-studio:not(.is-stealth-admin-mode) #localPipContainer.studio-main-active {
  opacity: 0.02 !important;
  pointer-events: none !important;
  position: fixed !important;
  right: 1px !important;
  bottom: 1px !important;
  left: auto !important;
  top: auto !important;
  width: 4px !important;
  height: 4px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  border: none !important;
  box-shadow: none !important;
  overflow: hidden !important;
  z-index: 9998 !important;
}

body.in-solo-studio:not(.is-stealth-admin-mode) #waitingOverlay {
  display: none !important;
}

.studio-controls-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(134px + env(safe-area-inset-bottom, 0px));
  width: min(96vw, 560px);
  max-width: calc(100vw - 12px);
  box-sizing: border-box;
  background: rgba(11, 15, 27, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(236, 72, 153, 0.38);
  border-radius: 16px;
  padding: 8px 10px;
  z-index: 65;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.65);
}

body.bottom-bar-collapsed .studio-controls-bar {
  bottom: calc(52px + env(safe-area-inset-bottom, 0px));
}

.studio-top-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
}

.studio-slider-row {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 3px 6px;
  background: rgba(15, 23, 42, 0.55);
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.studio-record-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.6);
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.92), rgba(185, 28, 28, 0.92));
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
  transition: transform 0.14s ease, background 0.18s ease;
}

.studio-record-btn.is-recording {
  background: linear-gradient(135deg, #ef4444, #991b1b);
  border-color: #fca5a5;
  animation: studioRecPulse 1.3s infinite ease-in-out;
}

.studio-record-btn .rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffffff;
  display: inline-block;
  box-shadow: 0 0 6px #ffffff;
}

.studio-record-btn.is-recording .rec-dot {
  border-radius: 2px;
  background: #fef08a;
}

.studio-rec-timer {
  font-family: monospace;
  font-size: 0.76rem;
  font-weight: 800;
  color: #fef08a;
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 5px;
  border-radius: 6px;
}

@keyframes studioRecPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.65); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.studio-action-pill {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(74, 222, 128, 0.55);
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.studio-delete-pill {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.65);
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.studio-intensity-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  justify-content: space-between;
  width: 100%;
}

.studio-intensity-label {
  font-size: 0.73rem;
  color: #e2e8f0;
  white-space: nowrap;
  flex-shrink: 0;
}

.studio-intensity-slider {
  flex: 1;
  min-width: 90px;
  accent-color: #ec4899;
  cursor: pointer;
}

.studio-close-bar-btn {
  width: 24px;
  height: 24px;
  margin-left: auto;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.beauty-masks-carousel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
}

.beauty-mask-chip {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 6px 4px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(30, 41, 59, 0.85);
  color: #f1f5f9;
  font-size: 0.71rem;
  font-weight: 600;
  line-height: 1.15;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s ease;
}

.beauty-mask-chip:hover {
  background: rgba(51, 65, 85, 0.92);
}

.beauty-mask-chip.gpu-mask-chip {
  border-color: rgba(168, 85, 247, 0.65);
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.58), rgba(157, 23, 77, 0.48));
  color: #fdf4ff;
  font-weight: 700;
}

.beauty-mask-chip.active,
.beauty-mask-chip.gpu-mask-chip.active {
  background: linear-gradient(135deg, #ec4899, #7c3aed) !important;
  border-color: #f9a8d4 !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(236, 72, 153, 0.75) !important;
  transform: scale(1.03);
}

/* ==================== КОМПАКТНЫЙ ПОДВИЖНЫЙ ФРЕЙМ НАВИГАЦИИ И ФУНКЦИЙ ДЛЯ АДМИНА ==================== */
.admin-quick-nav-frame {
  position: fixed;
  top: 238px;
  left: 14px;
  width: 285px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(59, 130, 246, 0.48);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  z-index: 95;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  cursor: grab;
  transition: width 0.16s ease, opacity 0.16s ease;
}

.admin-quick-nav-frame.dragging {
  cursor: grabbing;
  box-shadow: 0 18px 44px rgba(37, 99, 235, 0.5);
  border-color: #60a5fa;
}

.admin-quick-nav-frame.size-s {
  width: 235px;
}

.admin-quick-nav-frame.size-m {
  width: 285px;
}

.admin-quick-nav-frame.size-l {
  width: 345px;
}

.admin-quick-nav-frame.minimized {
  width: auto !important;
  min-width: 175px;
}

.admin-quick-nav-frame.minimized .admin-quick-nav-body {
  display: none !important;
}

.admin-quick-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: linear-gradient(90deg, rgba(30, 58, 138, 0.65), rgba(15, 23, 42, 0.9));
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.admin-quick-nav-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
}

.admin-nav-rec-badge {
  background: #dc2626;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  animation: pulseRecDot 1.1s infinite ease-in-out;
}

@keyframes pulseRecDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.admin-quick-nav-win-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.admin-quick-nav-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.admin-nav-peers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 82px;
  overflow-y: auto;
}

.admin-nav-empty {
  font-size: 0.72rem;
  color: #94a3b8;
  padding: 2px 4px;
}

.admin-nav-peer-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

.admin-nav-peer-pill:hover {
  background: rgba(51, 65, 85, 0.95);
}

.admin-nav-peer-pill.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #93c5fd;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.45);
}

.admin-nav-controls-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.admin-nav-ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.85);
  color: #cbd5e1;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.14s ease;
}

.admin-nav-ctrl-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #ffffff;
}

.admin-nav-ctrl-btn .ctrl-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
  flex-shrink: 0;
}

.admin-nav-ctrl-btn.active-on {
  background: rgba(22, 163, 74, 0.24);
  border-color: rgba(74, 222, 128, 0.65);
  color: #dcfce7;
}

.admin-nav-ctrl-btn.active-on .ctrl-dot {
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

.admin-nav-ctrl-btn.active-warn {
  background: rgba(220, 38, 38, 0.26);
  border-color: rgba(248, 113, 113, 0.72);
  color: #fee2e2;
}

.admin-nav-ctrl-btn.active-warn .ctrl-dot {
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}

/* ==================== ПОДВИЖНОЕ, СВОРАЧИВАЕМОЕ И ПРОЗРАЧНОЕ ОКНО ЧАТА ==================== */
.call-chat-drawer {
  touch-action: none;
  transition: width 0.16s ease, height 0.16s ease, opacity 0.16s ease;
}

.call-chat-drawer .chat-drawer-header {
  cursor: grab;
  user-select: none;
}

.call-chat-drawer.dragging .chat-drawer-header {
  cursor: grabbing;
}

.call-chat-drawer.size-s {
  width: 280px;
  height: 340px;
}

.call-chat-drawer.size-m {
  width: 340px;
  height: 440px;
}

.call-chat-drawer.size-l {
  width: 420px;
  height: 540px;
}

.call-chat-drawer.minimized {
  height: auto !important;
  min-height: 0 !important;
  max-height: 48px !important;
  width: 270px !important;
  overflow: hidden !important;
}

.call-chat-drawer.minimized .call-chat-messages,
.call-chat-drawer.minimized .call-chat-quick-emojis,
.call-chat-drawer.minimized .p2p-file-progress-box,
.call-chat-drawer.minimized .call-chat-input-row {
  display: none !important;
}

/* ==================== СТУДИЯ ПРЯМЫХ ТРАНСЛЯЦИЙ (YOUTUBE, TIKTOK, TWITCH, INSTAGRAM, FB, X, VK) ==================== */
.live-stream-drawer {
  position: fixed;
  top: 64px;
  right: 18px;
  width: 380px;
  max-width: calc(100vw - 20px);
  max-height: calc(100vh - 90px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1.5px solid rgba(239, 68, 68, 0.5);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.75);
  z-index: 120;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  touch-action: none;
  transition: width 0.16s ease, opacity 0.16s ease;
}

.live-stream-drawer.size-s {
  width: 320px;
}

.live-stream-drawer.size-m {
  width: 390px;
}

.live-stream-drawer.size-l {
  width: 470px;
}

.live-stream-drawer.minimized {
  height: auto !important;
  max-height: 48px !important;
  width: 290px !important;
}

.live-stream-drawer.minimized .live-stream-body {
  display: none !important;
}

.live-stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(90deg, rgba(153, 27, 27, 0.55), rgba(15, 23, 42, 0.95));
  border-bottom: 1px solid rgba(248, 113, 113, 0.25);
  cursor: grab;
  user-select: none;
}

.live-stream-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.83rem;
  font-weight: 800;
  color: #f8fafc;
  min-width: 0;
}

.live-stream-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.45);
  color: #cbd5e1;
}

.live-stream-badge.on-air {
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.7);
  animation: pulseRecDot 1.1s infinite ease-in-out;
}

.live-stream-timer {
  font-size: 0.74rem;
  font-family: monospace;
  font-weight: 700;
  color: #fca5a5;
}

.live-stream-win-btns {
  display: flex;
  align-items: center;
  gap: 5px;
}

.live-stream-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  max-height: calc(100vh - 150px);
}

.live-stream-clean-notice {
  font-size: 0.74rem;
  line-height: 1.35;
  color: #bbf7d0;
  background: rgba(22, 163, 74, 0.16);
  border: 1px solid rgba(74, 222, 128, 0.35);
  border-radius: 10px;
  padding: 7px 9px;
}

.live-stream-quick-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.live-stream-quick-modes .small-btn {
  font-size: 0.7rem;
  padding: 6px 7px;
  text-align: center;
}

.live-stream-platforms-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: #cbd5e1;
}

.live-stream-platforms-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 310px;
  overflow-y: auto;
  padding-right: 2px;
}

.stream-platform-card {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 11px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stream-platform-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stream-platform-check {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: #f8fafc;
}

.platform-badge {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 800;
}

.yt-badge { background: rgba(220, 38, 38, 0.25); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.45); }
.tt-badge { background: rgba(20, 184, 166, 0.22); color: #5eead4; border: 1px solid rgba(45, 212, 191, 0.45); }
.tw-badge { background: rgba(147, 51, 234, 0.25); color: #d8b4fe; border: 1px solid rgba(168, 85, 247, 0.45); }
.ig-badge { background: rgba(219, 39, 119, 0.25); color: #f9a8d4; border: 1px solid rgba(236, 72, 153, 0.45); }
.fb-badge { background: rgba(37, 99, 235, 0.25); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.45); }
.x-badge  { background: rgba(71, 85, 105, 0.4); color: #f1f5f9; border: 1px solid rgba(148, 163, 184, 0.45); }
.vk-badge { background: rgba(2, 132, 199, 0.25); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.45); }

.stream-platform-state {
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
}

.stream-platform-state.live {
  color: #4ade80;
}

.stream-platform-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.stream-platform-inputs input {
  font-size: 0.72rem;
  padding: 5px 7px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #f8fafc;
}

.live-go-btn {
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  font-weight: 800 !important;
  padding: 10px 14px !important;
}

.live-go-btn.streaming-active {
  background: linear-gradient(135deg, #059669, #047857) !important;
}

/* Режим «Чистый экран для стрима» (скрывает вообще все кнопки управления, оставляя только картинки камер) */
body.clean-stream-screen-mode #bottomBar,
body.clean-stream-screen-mode #expandBottomBarBtn,
body.clean-stream-screen-mode .top-bar-indicators,
body.clean-stream-screen-mode .top-right-actions,
body.clean-stream-screen-mode #adminMediaAlertBar,
body.clean-stream-screen-mode #videoFloatingChatOverlay,
body.clean-stream-screen-mode #adminAllCamerasDock,
body.clean-stream-screen-mode #adminQuickNavFrame,
body.clean-stream-screen-mode #hostControlDrawer,
body.clean-stream-screen-mode #callChatDrawer,
body.clean-stream-screen-mode #liveStreamDrawer,
body.clean-stream-screen-mode #studioControlsBar,
body.clean-stream-screen-mode #callDeviceMenu,
body.clean-stream-screen-mode #splitGlobalToolbar,
body.clean-stream-screen-mode #screenShareActiveBanner,
body.clean-stream-screen-mode .split-pane-bar,
body.clean-stream-screen-mode .pip-toolbar,
body.clean-stream-screen-mode .pip-label,
body.clean-stream-screen-mode #toastContainer {
  display: none !important;
}

.restore-clean-screen-btn {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 9999;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: rgba(248, 250, 252, 0.65);
  font-size: 0.7rem;
  cursor: pointer;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.restore-clean-screen-btn:hover {
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
}

/* ============================================================================
   ИНДИКАЦИЯ КОМНАТЫ И РЕЖИМА УЧАСТНИКА ДЛЯ СУПЕР-АДМИНА (В ДИАЛОГЕ С КЕМ-ТО ИЛИ В ОДИНОЧНОЙ)
   ============================================================================ */
.contact-admin-room-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
}

.contact-room-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.75);
  color: #cbd5e1;
}

.contact-room-badge.is-with-peers {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.65);
  color: #6ee7b7;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.contact-room-badge.is-solo {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
}

.contact-room-badge.is-solo-studio {
  background: rgba(168, 85, 247, 0.22);
  border-color: rgba(192, 132, 252, 0.6);
  color: #e9d5ff;
}

.contact-room-badge.is-solo-call {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(251, 191, 36, 0.55);
  color: #fde68a;
}

.contact-room-badge.is-offline {
  background: rgba(30, 41, 59, 0.55);
  border-color: rgba(100, 116, 139, 0.3);
  color: #94a3b8;
}

.contact-quick-stealth-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  background: rgba(124, 58, 237, 0.28);
  border: 1px solid rgba(167, 139, 250, 0.55);
  color: #ddd6fe;
  transition: background 0.15s ease, transform 0.1s ease;
}

.contact-quick-stealth-btn:hover {
  background: rgba(124, 58, 237, 0.48);
  color: #ffffff;
  transform: translateY(-1px);
}

.admin-room-header-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 3px;
}

.admin-room-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 700;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.admin-room-mode-badge.is-dialog {
  background: rgba(16, 185, 129, 0.24);
  border-color: rgba(16, 185, 129, 0.65);
  color: #6ee7b7;
}

.admin-room-mode-badge.is-solo {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
}

.admin-room-mode-badge.is-solo-studio {
  background: rgba(168, 85, 247, 0.24);
  border-color: rgba(192, 132, 252, 0.6);
  color: #e9d5ff;
}

.admin-room-mode-badge.is-solo-call {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(251, 191, 36, 0.55);
  color: #fde68a;
}

.admin-nav-room-status-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.admin-nav-room-id {
  font-size: 0.72rem;
  font-weight: 800;
  color: #60a5fa;
}

.admin-nav-room-mode-badge {
  font-size: 0.69rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #93c5fd;
}

.admin-nav-room-mode-badge.is-with-peers {
  background: rgba(16, 185, 129, 0.24);
  border-color: rgba(16, 185, 129, 0.65);
  color: #6ee7b7;
}

.admin-nav-room-mode-badge.is-solo-studio {
  background: rgba(168, 85, 247, 0.24);
  border-color: rgba(192, 132, 252, 0.6);
  color: #e9d5ff;
}

/* Скрытые экраны (#callScreen.hidden / #lobbyScreen.hidden) используют стандартный display: none,
   а <video> привязывается только к активному экрану через syncLocalPreviewVideoAttachment() */

/* ==================== ВЫРАВНИВАНИЕ МЕНЮ, ШАПКИ, АДМИН-ПАНЕЛИ И НИЖНИХ КНОПОК НА IPHONE (v72) ==================== */
/* 1. Шапка карточки (.brand-header): логотип + заголовок в первой строке, кнопки быстрых действий — аккуратно во второй строке без сплющивания подзаголовка */
.brand-header {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 10px 12px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.brand-header > div:not(.brand-logo):not(.brand-header-actions) {
  flex: 1 1 210px !important;
  min-width: 190px !important;
}

.brand-header .subtitle {
  line-height: 1.3 !important;
  white-space: normal !important;
  word-break: normal !important;
}

.brand-header .admin-badge {
  margin-left: auto !important;
  flex-shrink: 0 !important;
  order: 2 !important;
}

.brand-header .brand-header-actions {
  order: 3 !important;
  width: 100% !important;
  margin-left: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
}

.brand-header .header-quick-btn {
  flex: 1 1 auto !important;
  text-align: center !important;
  justify-content: center !important;
}

/* 2. Панель «Активные комнаты на сервере» (.admin-panel-header): заголовок сверху, 4 кнопки — аккуратным рядом/сеткой строго внутри жёлтой рамки */
.admin-rooms-panel {
  overflow: hidden !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

.admin-panel-header {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.admin-panel-header > span {
  display: block !important;
  width: 100% !important;
  line-height: 1.3 !important;
}

.admin-panel-header-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.admin-panel-header-actions > button {
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 6px 8px !important;
  font-size: 0.74rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-align: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

/* 3. Кнопки на превью камеры в лобби (.gmeet-lobby-bar) — строго внутри рамки на iPhone и всех смартфонах */
.lobby-preview-controls.gmeet-lobby-bar {
  left: 8px !important;
  right: 8px !important;
  bottom: 8px !important;
  width: auto !important;
  max-width: calc(100% - 16px) !important;
  padding: 6px 8px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.gmeet-lobby-bar .lobby-primary-row {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 5px !important;
  width: 100% !important;
}

.gmeet-lobby-bar .lobby-secondary-row {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 5px !important;
  width: 100% !important;
}

.gmeet-lobby-bar .gmeet-btn {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 34px !important;
  padding: 0 6px !important;
  border-radius: 999px !important;
  font-size: 0.72rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  box-sizing: border-box !important;
}

@media (max-width: 480px) {
  .gmeet-lobby-bar .gmeet-btn {
    height: 32px !important;
    padding: 0 4px !important;
    font-size: 0.66rem !important;
  }
  .gmeet-lobby-bar .gmeet-btn span:not(.gmeet-icon) {
    display: inline !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

/* 4. Нижняя панель в комнате звонка (#bottomBar .gmeet-bottom-bar) и панель Бьюти-масок (#studioControlsBar) на iPhone */
.studio-controls-bar {
  max-width: calc(100vw - 12px) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.studio-top-row {
  flex-wrap: wrap !important;
  gap: 5px !important;
  box-sizing: border-box !important;
}

@media (max-width: 480px) {
  .gmeet-bottom-bar {
    width: calc(100vw - 10px) !important;
    max-width: calc(100vw - 10px) !important;
    padding: 6px 6px !important;
    gap: 5px !important;
    border-radius: 20px !important;
  }
  .bottom-bar-primary-row,
  .bottom-bar-secondary-row {
    gap: 4px !important;
    padding: 1px !important;
  }
  .bottom-bar-primary-row .gmeet-call-btn:not(.gmeet-hangup-btn) {
    min-width: 34px !important;
    width: 34px !important;
    height: 34px !important;
  }
  .bottom-bar-secondary-row .gmeet-call-btn,
  .bottom-bar-secondary-row .gmeet-collapse-btn {
    min-width: 31px !important;
    width: 31px !important;
    height: 31px !important;
  }
  .bottom-bar-secondary-row .gmeet-call-icon,
  .bottom-bar-secondary-row .gmeet-call-icon svg {
    width: 16px !important;
    height: 16px !important;
  }
  .gmeet-hangup-btn {
    min-width: 42px !important;
    width: 42px !important;
    height: 34px !important;
  }
  .beauty-masks-carousel {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
  }
  .lobby-device-bar {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }
  .lobby-device-bar .device-connect-btn {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }
}

/* ==================== ПОДВИЖНАЯ ПАНЕЛЬ РЕЖИМА 50/50 (ЧТОБЫ ИМЯ СОБЕСЕДНИКА НЕ ПЕРЕКРЫВАЛО КНОПКИ) ==================== */
.split-global-toolbar {
  cursor: grab !important;
  touch-action: none !important;
  z-index: 68 !important;
  user-select: none !important;
}

.split-global-toolbar:active {
  cursor: grabbing !important;
}

.split-pane-bar {
  cursor: grab !important;
  touch-action: none !important;
  z-index: 66 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 6px 10px !important;
  max-width: calc(100% - 14px) !important;
  background: rgba(10, 14, 24, 0.88) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(96, 165, 250, 0.4) !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65) !important;
}

.split-pane-bar:active {
  cursor: grabbing !important;
}

.split-pane-bar .split-source-select {
  max-width: 220px !important;
  width: 100% !important;
  text-overflow: ellipsis !important;
}

.split-pane-bar .split-pane-tools {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 4px !important;
}

@media (max-width: 900px) {
  .remote-ambient-bg {
    display: none !important;
    filter: none !important;
    -webkit-filter: none !important;
  }
}

#localFrontKeepCanvas {
  z-index: 2 !important;
  pointer-events: none !important;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.local-dual-inset-box,
#localDualInsetBox {
  z-index: 32 !important;
  pointer-events: auto !important;
}

.pip-cam-off,
#localPipOffOverlay,
#lobbyCameraOffOverlay {
  z-index: 38 !important;
  background: #0f172a !important;
}

.pip-label {
  z-index: 40 !important;
}

.pip-toolbar {
  z-index: 45 !important;
  pointer-events: auto !important;
  opacity: 1 !important;
}

#studioDeleteProjectBtn,
#adminNavDeleteRecBtn {
  display: none !important;
}

#studioControlsBar {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

#studioControlsBar.hidden {
  display: none !important;
}

.studio-top-row,
.studio-bar-top {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  width: 100% !important;
  position: relative !important;
}

.studio-top-row > *,
.studio-bar-top > * {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
}

.studio-close-bar-btn {
  margin-left: auto !important;
}

.studio-slider-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  position: static !important;
  margin-top: 2px !important;
  box-sizing: border-box !important;
}

.studio-intensity-wrap,
#studioIntensityWrap {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  width: 100% !important;
  flex: 1 1 100% !important;
  order: 10 !important;
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  flex-wrap: nowrap !important;
  box-sizing: border-box !important;
}

.studio-intensity-slider {
  flex: 1 1 110px !important;
  min-width: 80px !important;
}

.chat-msg-delete-btn {
  background: transparent;
  border: none;
  color: rgba(248, 113, 113, 0.78);
  font-size: 0.78rem;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.chat-msg-delete-btn:hover,
.chat-msg-delete-btn:active {
  opacity: 1;
  background: rgba(239, 68, 68, 0.18);
}

/* ==========================================================================
   КОМПАКТНЫЕ СПИСКИ КОМНАТ И КОНТАКТОВ + БЕЙДЖИ СТРАН (v81)
   ========================================================================== */
.admin-rooms-panel {
  padding: 8px 10px !important;
}

.admin-rooms-list {
  gap: 5px !important;
  max-height: 210px !important;
  overflow-y: auto !important;
}

.admin-room-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 6px 8px !important;
  padding: 5px 8px !important;
  border-radius: 9px !important;
  min-height: 0 !important;
}

.admin-room-info {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

.admin-room-header-line {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
  width: 100% !important;
}

.admin-room-code {
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
}

.admin-room-mode-badge {
  font-size: 0.65rem !important;
  padding: 1px 6px !important;
  border-radius: 999px !important;
  line-height: 1.2 !important;
}

.admin-room-peers {
  display: inline-flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  font-size: 0.72rem !important;
}

.room-peer-chip {
  padding: 1px 6px 1px 2px !important;
  font-size: 0.68rem !important;
  gap: 3px !important;
  line-height: 1.15 !important;
}

.room-peer-avatar {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
}

.room-peer-country,
.contact-country-badge {
  display: inline-flex !important;
  align-items: center !important;
  font-size: 0.64rem !important;
  font-weight: 700 !important;
  color: #fde68a !important;
  background: rgba(245, 158, 11, 0.16) !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  border-radius: 999px !important;
  padding: 1px 6px !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
}

.admin-room-actions {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 4px !important;
  margin-left: auto !important;
}

.admin-room-actions .call-join-btn,
.admin-room-actions .stealth-join-btn,
.admin-room-actions .admin-reload-room-btn,
.admin-room-actions .close-room-btn {
  padding: 3px 7px !important;
  font-size: 0.68rem !important;
  border-radius: 6px !important;
  line-height: 1.15 !important;
  min-height: 24px !important;
  white-space: nowrap !important;
}

.admin-room-actions .call-join-btn {
  background: #2563eb !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}

.admin-room-actions .admin-reload-room-btn {
  border-color: rgba(16, 185, 129, 0.5) !important;
  color: #6ee7b7 !important;
}

/* Компактные карточки сохранённых комнат и контактов */
.modern-contacts-list {
  gap: 5px !important;
  max-height: 240px !important;
}

.modern-contact-card {
  padding: 5px 8px !important;
  border-radius: 10px !important;
}

.modern-contact-row,
.contact-main-row.contact-card-summary {
  padding: 2px 3px !important;
  gap: 6px !important;
  min-height: 0 !important;
}

.contact-admin-room-row {
  margin-top: 2px !important;
  gap: 4px !important;
}

.contact-room-badge {
  font-size: 0.64rem !important;
  padding: 1px 6px !important;
}

.contact-quick-stealth-btn {
  font-size: 0.64rem !important;
  padding: 1px 6px !important;
}

/* ==================== ОБНОВЛЕНИЕ v88: УЗКИЕ ПОЛОСКИ КОНТАКТОВ (ОНЛАЙН / ОФЛАЙН), ПАПКИ МАСОК И ФОНОВ, КОНФЕРЕНЦИИ И СЕТКА GOOGLE MEET ==================== */

/* 1. Узкие однострочные полоски контактов на главной странице с разделением В сети / Не в сети */
.contacts-group-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}

.contacts-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 8px;
  letter-spacing: 0.02em;
}

.contacts-group-header.online-header {
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.32);
}

.contacts-group-toggle-btn {
  width: 100%;
  cursor: pointer;
  background: rgba(30, 41, 59, 0.75);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
  transition: background 0.15s ease;
}

.contacts-group-toggle-btn:hover {
  background: rgba(51, 65, 85, 0.85);
}

.contacts-group-arrow {
  font-size: 0.7rem;
  opacity: 0.85;
}

.contacts-group-list,
.contacts-strips-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.contact-strip-card {
  padding: 4px 8px !important;
  border-radius: 9px !important;
  background: rgba(15, 23, 42, 0.82) !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  transition: border-color 0.15s ease, background 0.15s ease;
  box-sizing: border-box !important;
}

.contact-strip-card.is-online,
.contact-strip-card.is-online-strip {
  border-color: rgba(16, 185, 129, 0.42) !important;
  background: linear-gradient(90deg, rgba(6, 78, 59, 0.28), rgba(15, 23, 42, 0.88)) !important;
}

.contact-strip-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  min-height: 28px !important;
  width: 100% !important;
  cursor: pointer !important;
}

.contact-strip-left {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
}

.strip-status-dot {
  width: 7px !important;
  height: 7px !important;
  min-width: 7px !important;
  min-height: 7px !important;
  border-radius: 50% !important;
  background: #64748b !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
}

.strip-status-dot.is-online {
  background: #22c55e !important;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.75) !important;
}

.strip-avatar,
.room-peer-avatar,
.contact-strip-card .contact-avatar {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  flex-shrink: 0 !important;
  align-self: center !important;
  display: inline-block !important;
}

.strip-nick {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  color: #f8fafc !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.2 !important;
  flex-shrink: 0 !important;
  max-width: 145px !important;
}

.strip-status-text {
  font-size: 0.65rem !important;
  color: #94a3b8 !important;
  white-space: nowrap !important;
}

.contact-strip-right {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 4px !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
}

.strip-quick-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  height: 24px !important;
  min-width: 26px !important;
  padding: 0 6px !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  background: rgba(30, 41, 59, 0.9) !important;
  color: #f1f5f9 !important;
  cursor: pointer !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
}

.strip-call-btn,
.call-strip-btn {
  background: rgba(16, 185, 129, 0.22) !important;
  border-color: rgba(16, 185, 129, 0.5) !important;
}

.strip-chat-btn.has-unread {
  background: rgba(239, 68, 68, 0.28) !important;
  border-color: rgba(248, 113, 113, 0.75) !important;
  color: #fecaca !important;
}

.strip-stealth-btn,
.stealth-strip-btn {
  background: rgba(124, 58, 237, 0.24) !important;
  border-color: rgba(167, 139, 250, 0.5) !important;
}

.reload-strip-btn {
  background: rgba(14, 165, 233, 0.2) !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
}

.del-strip-btn {
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: rgba(248, 113, 113, 0.45) !important;
  color: #fca5a5 !important;
}

.contact-strip-msg-hint {
  font-size: 0.66rem !important;
  color: #93c5fd !important;
  padding: 1px 6px !important;
  background: rgba(37, 99, 235, 0.14) !important;
  border: 1px solid rgba(59, 130, 246, 0.25) !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 170px !important;
  line-height: 1.2 !important;
}

.contact-expand-actions {
  display: none !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 5px !important;
  margin-top: 6px !important;
  padding-top: 6px !important;
  border-top: 1px solid rgba(148, 163, 184, 0.14) !important;
}

.contact-strip-card.expanded .contact-expand-actions {
  display: flex !important;
}

.contact-action-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 4px 9px !important;
  border-radius: 7px !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  background: rgba(30, 41, 59, 0.9) !important;
  color: #f1f5f9 !important;
  cursor: pointer !important;
}

/* 2. Папки бьюти-масок, 18+ масок и виртуальных фонов + удобная навигация */
.studio-nav-back-btn {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  color: #ffffff !important;
  border: 1px solid rgba(147, 197, 253, 0.65) !important;
  font-weight: 800 !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  font-size: 0.72rem !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4) !important;
}

.studio-folder-title-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.3);
  white-space: nowrap;
}

.studio-folder-title-badge.active-mask-badge {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.55);
}

.studio-reset-mask-btn {
  background: rgba(51, 65, 85, 0.85) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
  font-size: 0.7rem !important;
}

.studio-reset-mask-btn.active-reset {
  background: rgba(220, 38, 38, 0.28) !important;
  color: #fca5a5 !important;
  border-color: rgba(248, 113, 113, 0.65) !important;
}

.beauty-folders-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
  padding: 2px 0;
}

.beauty-folder-card {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #f8fafc;
  cursor: pointer;
  text-align: left;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.beauty-folder-card:hover {
  border-color: rgba(96, 165, 250, 0.65);
  background: rgba(37, 99, 235, 0.22);
}

.beauty-folder-card.has-active-mask {
  border-color: #34d399;
  background: rgba(16, 185, 129, 0.22);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.funny-folder-card {
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.55), rgba(30, 41, 59, 0.9));
  border-color: rgba(251, 191, 36, 0.5);
}

.spicy-folder-card {
  background: linear-gradient(135deg, rgba(131, 24, 67, 0.55), rgba(30, 41, 59, 0.9));
  border-color: rgba(244, 114, 182, 0.45);
}

.spicy-anim-folder-card {
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.65), rgba(109, 40, 217, 0.65));
  border-color: rgba(251, 113, 133, 0.65);
  box-shadow: 0 0 12px rgba(225, 29, 72, 0.28);
}

.bg-folder-card {
  background: linear-gradient(135deg, rgba(3, 105, 161, 0.5), rgba(30, 41, 59, 0.9));
  border-color: rgba(56, 189, 248, 0.45);
}

/* В одиночной комнате (#studio-*) интерфейс конференции всегда полностью скрыт */
body.in-solo-studio #adminNavMeetRow,
body.in-solo-studio #drawerMeetControlSection,
body.in-solo-studio #toggleGridModeBtn,
body.in-solo-studio #raiseHandBtn,
body.in-solo-studio #conferenceGridContainer {
  display: none !important;
}

.folder-card-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.folder-card-title {
  font-size: 0.7rem;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-card-count {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.65);
  color: #94a3b8;
}

.face-swap-tools-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 2px 0;
}

.beauty-back-chip {
  background: rgba(37, 99, 235, 0.28) !important;
  border-color: rgba(96, 165, 250, 0.65) !important;
  color: #bfdbfe !important;
  font-weight: 800 !important;
}

.spicy-chip {
  border-color: rgba(244, 114, 182, 0.45) !important;
}

.bg-chip {
  border-color: rgba(56, 189, 248, 0.45) !important;
}

/* 3. Многопользовательские Конференции и сетка Google Meet */
.conference-btn {
  background: linear-gradient(135deg, #0284c7, #2563eb) !important;
  color: #ffffff !important;
  border: 1px solid rgba(125, 211, 252, 0.5) !important;
  font-weight: 800 !important;
}

.conference-grid-container {
  position: absolute;
  inset: 0;
  z-index: 26;
  background: #060913;
  display: flex;
  flex-direction: column;
  padding: 52px 10px 108px;
  box-sizing: border-box;
  overflow: hidden;
}

.conference-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 10px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.24);
  backdrop-filter: blur(10px);
}

.conference-top-left,
.conference-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.conf-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.conf-floor-badge {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.55);
}

.conf-hands-badge {
  background: rgba(245, 158, 11, 0.24);
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.6);
}

.conf-top-btn {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(30, 41, 59, 0.9);
  color: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, 0.35);
  cursor: pointer;
}

.conference-tiles-grid {
  flex: 1 1 auto;
  display: grid;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 0;
  align-items: stretch;
  justify-items: stretch;
}

.conference-tiles-grid.grid-count-1 {
  grid-template-columns: 1fr;
}

.conference-tiles-grid.grid-count-2 {
  grid-template-columns: repeat(2, 1fr);
}

.conference-tiles-grid.grid-count-4 {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.conference-tiles-grid.grid-count-6 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.conference-tiles-grid.grid-count-many {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  grid-auto-rows: minmax(120px, 1fr);
}

@media (max-width: 640px) {
  .conference-tiles-grid.grid-count-2 {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, 1fr);
  }
  .conference-tiles-grid.grid-count-6 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
  }
  .beauty-folders-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.conf-peer-tile {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #0f172a;
  border: 2px solid rgba(148, 163, 184, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
}

.conf-peer-tile.is-floor-speaker {
  border-color: #10b981;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.45);
}

.conf-peer-tile.is-hand-raised {
  border-color: #f59e0b;
}

.conf-tile-video,
.conf-tile-relay-img {
  position: absolute !important;
  inset: 0 !important;
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  transform-origin: center center !important;
  -webkit-transform-origin: center center !important;
  display: block;
}

.conf-tile-video.hidden,
.conf-tile-relay-img.hidden,
.conf-tile-avatar-box.hidden {
  display: none !important;
}

.conf-tile-video {
  z-index: 1;
}

.conf-tile-relay-img {
  z-index: 2;
}

.conf-tile-avatar-box {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #1e293b 0%, #0f172a 100%);
}

.conf-tile-avatar-img {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(148, 163, 184, 0.4);
}

.conf-tile-top-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 4;
}

.conf-tile-floor-badge {
  background: rgba(16, 185, 129, 0.92);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.conf-tile-hand-badge {
  background: rgba(245, 158, 11, 0.95);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  margin-left: auto;
}

.conf-tile-bottom-bar {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 9px;
  background: rgba(9, 13, 22, 0.78);
  backdrop-filter: blur(6px);
  z-index: 4;
}

.conf-tile-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conf-tile-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.conf-tile-mini-btn {
  padding: 2px 6px;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.85);
  color: #fff;
  border: 1px solid rgba(147, 197, 253, 0.5);
  cursor: pointer;
}

.conf-tile-mini-btn.active-floor {
  background: rgba(16, 185, 129, 0.9);
  border-color: #6ee7b7;
}

.admin-nav-meet-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 3px 6px;
  background: rgba(15, 23, 42, 0.65);
  border-radius: 8px;
  margin-bottom: 4px;
}

.admin-nav-stealth-btn.is-stealth-active,
.conf-top-btn.is-stealth-active {
  background: rgba(124, 58, 237, 0.32) !important;
  border-color: rgba(167, 139, 250, 0.65) !important;
  color: #ddd6fe !important;
}

.admin-nav-stealth-btn.is-visible-active,
.conf-top-btn.is-visible-active {
  background: rgba(16, 185, 129, 0.28) !important;
  border-color: rgba(52, 211, 153, 0.65) !important;
  color: #6ee7b7 !important;
}

.admin-floor-select {
  flex: 1 1 130px;
  min-width: 110px;
  height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.95);
  color: #f8fafc;
  border: 1px solid rgba(96, 165, 250, 0.45);
  font-size: 0.68rem;
  font-weight: 700;
}

/* ==================== ОБНОВЛЕНИЕ v91: ИДЕАЛЬНОЕ ВЫРАВНИВАНИЕ НА IPHONE И ОТКЛЮЧЕНИЕ ФЕЙКОВОГО ЭКРАНА СВОРАЧИВАНИЯ ==================== */
#minimizedFloatingBar,
.minimized-floating-bar {
  display: none !important;
}

.modern-contacts-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 6px 8px !important;
}

.modern-contacts-title {
  display: inline-flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

.contacts-count-badge,
#contactsCountBadge,
#savedRoomsCountBadge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  width: auto !important;
  min-width: 24px !important;
  height: 22px !important;
  padding: 0 8px !important;
  border-radius: 999px !important;
  line-height: 1 !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
}

.contact-strip-card .contact-room-badge {
  display: inline-flex !important;
  align-items: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 140px !important;
  flex-shrink: 1 !important;
  line-height: 1.15 !important;
}

.lobby-actions .large-btn,
.lobby-actions .primary-btn,
#createRoomBtn,
#createConferenceBtn,
#openSoloStudioBtn {
  white-space: normal !important;
  text-align: center !important;
  line-height: 1.28 !important;
  height: auto !important;
  min-height: 46px !important;
  padding: 11px 14px !important;
  word-break: break-word !important;
  box-sizing: border-box !important;
}

@media (max-width: 480px) {
  .contact-strip-left {
    gap: 4px !important;
  }
  .contact-strip-card .strip-nick {
    max-width: 108px !important;
    font-size: 0.74rem !important;
    flex-shrink: 1 !important;
  }
  .contact-strip-card .contact-room-badge {
    max-width: 86px !important;
    font-size: 0.6rem !important;
    padding: 1px 5px !important;
  }
  .contact-strip-right {
    gap: 3px !important;
  }
  .strip-quick-btn {
    min-width: 24px !important;
    height: 23px !important;
    padding: 0 5px !important;
  }
}

/* ==================== ВСТРОЕННЫЙ ТЕЛЕСУФЛЁР (ДЛЯ ЧТЕНИЯ ТЕКСТА ПОД КАМЕРОЙ) ==================== */
.teleprompter-overlay {
  position: fixed;
  top: calc(env(safe-area-inset-top, 8px) + 46px);
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 560px);
  max-height: 54vh;
  background: rgba(8, 12, 22, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.72);
  z-index: 420;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #f8fafc;
  user-select: none;
}

.teleprompter-overlay.floating-dragged {
  transform: none;
}

.teleprompter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 10px;
  background: rgba(15, 23, 42, 0.88);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  cursor: move;
  flex-wrap: wrap;
}

.teleprompter-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #e0f2fe;
}

.teleprompter-badge {
  font-size: 0.64rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}

.teleprompter-badge.is-playing {
  background: rgba(16, 185, 129, 0.28);
  border: 1px solid rgba(52, 211, 153, 0.6);
  color: #6ee7b7;
}

.teleprompter-win-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.prompter-ctrl-btn {
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(30, 41, 59, 0.88);
  color: #f8fafc;
  cursor: pointer;
  line-height: 1.1;
}

.prompter-ctrl-btn.play-btn {
  background: linear-gradient(135deg, #059669, #0284c7);
  border-color: rgba(52, 211, 153, 0.65);
}

.prompter-ctrl-btn.danger-btn {
  background: rgba(220, 38, 38, 0.28);
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
}

.teleprompter-speed-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: rgba(15, 23, 42, 0.65);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  font-size: 0.73rem;
  color: #cbd5e1;
}

.teleprompter-speed-bar input[type='range'] {
  flex: 1;
  accent-color: #38bdf8;
  cursor: pointer;
}

.prompter-sync-admin-btn {
  padding: 4px 9px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 7px;
  border: 1px solid rgba(168, 85, 247, 0.65);
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.teleprompter-edit-box {
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.teleprompter-edit-box textarea {
  width: 100%;
  min-height: 90px;
  max-height: 180px;
  background: #090d16;
  color: #f8fafc;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.88rem;
  line-height: 1.4;
  resize: vertical;
  box-sizing: border-box;
}

.teleprompter-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.teleprompter-viewport {
  position: relative;
  height: 200px;
  max-height: 36vh;
  overflow-y: auto;
  padding: 36px 16px 90px;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
}

.teleprompter-eye-guide {
  position: sticky;
  top: 28px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.85), transparent);
  pointer-events: none;
  z-index: 2;
}

.teleprompter-scroll-content {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.48;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
  white-space: pre-wrap;
  word-break: break-word;
  text-align: center;
}

.teleprompter-scroll-content.mirrored {
  transform: scaleX(-1);
}

/* ==================== ANTIGRAVITY: МЕССЕНДЖЕР-КНОПКИ ЗВОНКА (АУДИО + ВИДЕО), МАРШРУТ ЗВУКА И МАСКИ ==================== */
body:not(.has-native-audio-route) .native-route-only {
  display: none !important;
}

body.is-ios-singlecam #toggleMySecondCamBtn,
body.is-ios-singlecam #lobbySecondCamBtn {
  display: none !important;
}

.msg-dual-call-btn,
.accept-call-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  white-space: nowrap;
}

.msg-call-svg {
  flex-shrink: 0;
  vertical-align: middle;
}

.audio-handset-btn,
#lobbyScreen .audio-handset-btn {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #ffffff !important;
  border: 1px solid rgba(52, 211, 153, 0.65) !important;
  font-weight: 600 !important;
}

.audio-handset-btn:hover,
#lobbyScreen .audio-handset-btn:hover {
  filter: brightness(1.06);
}

.accept-call-btn.video-call-btn {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  color: #ffffff !important;
  border: 1px solid rgba(96, 165, 250, 0.65) !important;
}

.strip-quick-btn.audio-strip-btn,
#lobbyScreen .strip-quick-btn.audio-strip-btn {
  background: #e6f7f0 !important;
  border-color: #9ce0c4 !important;
  color: #097954 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.strip-quick-btn.call-strip-btn,
#lobbyScreen .strip-quick-btn.call-strip-btn {
  background: #e8f2ff !important;
  border-color: #b4d4fb !important;
  color: #0b63ce !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.contact-action-pill.act-audio-call,
#lobbyScreen .contact-action-pill.act-audio-call {
  background: #e6f7f0 !important;
  border-color: #9ce0c4 !important;
  color: #086f4d !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}

.contact-action-pill.act-call,
#lobbyScreen .contact-action-pill.act-call {
  background: #e8f2ff !important;
  border-color: #b4d4fb !important;
  color: #0b63ce !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}

#mobileAudioRouteBtn.route-earpiece {
  background: rgba(13, 148, 136, 0.34) !important;
  border-color: rgba(94, 234, 212, 0.72) !important;
  color: #ccfbf1 !important;
}

#mobileAudioRouteBtn.route-speaker {
  background: rgba(37, 99, 235, 0.28) !important;
  border-color: rgba(96, 165, 250, 0.65) !important;
  color: #dbeafe !important;
}

.beauty-mask-chip.antigravity-mask-chip {
  border-color: rgba(244, 114, 182, 0.55);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.14);
}




/* r32: text buttons retain their intrinsic width; toolbar wrapping prevents collisions. */
.brand-header-actions,.top-right-actions,#adminRoomsPanel .admin-panel-header-actions{display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:8px!important;min-width:0;max-width:100%;}
.teltv-pill-nav-btn{display:inline-flex!important;align-items:center!important;justify-content:center;gap:6px!important;width:auto!important;max-width:none!important;min-width:max-content!important;height:36px!important;min-height:36px!important;padding:0 12px!important;white-space:nowrap!important;overflow:visible!important;flex:0 0 auto!important;box-sizing:border-box;}
.teltv-pill-nav-btn svg{width:20px;height:20px;flex-shrink:0;}
.teltv-pill-nav-btn.hidden{display:none!important;}
#lobbyScreen .lobby-preview-controls.gmeet-lobby-bar{display:flex!important;flex-direction:column!important;gap:6px!important;padding:6px!important;box-sizing:border-box;width:100%;min-width:0;}
#lobbyScreen .gmeet-lobby-bar .lobby-controls-row{display:grid!important;gap:4px!important;width:100%!important;min-width:0;overflow:visible!important;padding:0!important;}
#lobbyScreen .gmeet-lobby-bar .lobby-primary-row{grid-template-columns:repeat(3,minmax(0,1fr));}
#lobbyScreen .gmeet-lobby-bar .lobby-secondary-row{grid-template-columns:repeat(2,minmax(0,1fr));}
#lobbyScreen .gmeet-lobby-bar .gmeet-btn{display:flex!important;align-items:center!important;justify-content:center!important;gap:3px!important;width:100%!important;min-width:0!important;max-width:none!important;padding:0 3px!important;font-size:clamp(.74rem,2.8vw,.80rem)!important;white-space:nowrap!important;overflow:visible!important;text-overflow:clip!important;}
#lobbyScreen .gmeet-lobby-bar .gmeet-btn.hidden{display:none!important;}
#lobbyScreen .gmeet-lobby-bar .gmeet-label{min-width:0!important;white-space:nowrap!important;overflow:visible!important;text-overflow:clip!important;}
#lobbyScreen .gmeet-lobby-bar .gmeet-icon{flex:0 0 16px!important;width:16px!important;}
#lobbyScreen .gmeet-lobby-bar .gmeet-icon svg{width:16px;height:16px;}
#localCamSelect,#localMicSelect{padding-right:28px!important;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;max-width:100%;}
@media(max-width:360px){#lobbyScreen .gmeet-lobby-bar .gmeet-btn{flex-direction:column!important;gap:1px!important;padding:3px 1px!important;height:auto!important;min-height:44px!important;}}

/* A DOM-only hint, never composited into recorded video. */
#teltvBareSkinNotice{position:fixed;z-index:10050;left:50%;bottom:150px;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 32px);box-sizing:border-box;padding:10px 14px;border-radius:12px;background:rgba(20,25,34,.8);color:#fff;font:500 13px/1.4 system-ui;text-align:center;pointer-events:none;opacity:0;visibility:hidden;transition:opacity 200ms,visibility 200ms;}
#teltvBareSkinNotice.visible{opacity:1;visibility:visible;}

#teltvBackgroundCallNotice{position:fixed;bottom:14px;left:50%;transform:translateX(-50%);z-index:10040;max-width:calc(100vw - 32px);width:560px;box-sizing:border-box;margin:0;padding:10px 14px;border-radius:10px;background:rgba(20,25,34,.9);color:white;font:13px/1.4 system-ui;text-align:center;pointer-events:none;}

#teltvZebraOverlayCanvas{position:absolute!important;pointer-events:none;z-index:4;transition:opacity 200ms;filter:drop-shadow(0 0 1px rgba(255,196,46,.55));}
