/* ====================================================
   SyncStream - SQUAP (d.html) Inspired Glassmorphism Design System
   ==================================================== */

:root {
  --page: #111113;
  --bg-surface: rgba(20, 20, 24, 0.9);
  --glass-blur: blur(20px);
  --font-sans: 'Sora', 'Vazirmatn', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', 'Vazirmatn', system-ui, -apple-system, sans-serif;
  --font-persian: 'Vazirmatn', system-ui, -apple-system, sans-serif;

  --text-main: rgba(255, 255, 255, 0.9);
  --text-primary: rgba(255, 255, 255, 0.95);
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.65);
  --text-dim: rgba(255, 255, 255, 0.4);
  --border-subtle: rgba(255, 255, 255, 0.07);

  --glass-bg: rgba(10, 10, 12, 0.62);
  --glass-bg-card: rgba(14, 15, 20, 0.68);
  --glass-bg-elevated: rgba(22, 24, 32, 0.72);
  --glass-bg-input: rgba(8, 8, 10, 0.85);

  --glass-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08), inset 0 -1px 1px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 0, 0, 0.45);
  --glass-card-shadow: 0 0 28px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.08);

  --axis-bg: #08090e;
  --axis-line: rgba(255, 255, 255, 0.04);
  --axis-tick: rgba(255, 255, 255, 0.8);
  --theme-transition-ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* Accent: SQUAP Electric Blue (default) */
  --accent-main: #3650fd;
  --accent-main-glow: rgba(54, 80, 253, 0.3);
  --accent-glow: rgba(68, 92, 254, 0.8);
  --accent-glow-subtle: rgba(68, 92, 254, 0.28);
  --theme-btn-border: rgba(68, 92, 254, 0.4);
  --theme-badge-bg: rgba(68, 92, 254, 0.14);
  --theme-badge-color: #7c9dff;
  --theme-badge-border: rgba(68, 92, 254, 0.28);
  --glow: var(--accent-glow);

  /* Functional Status Tokens */
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.4);
  --accent-red: #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.35);
  --accent-amber: #f59e0b;

  /* SQUAP Rounded Tokens */
  --radius-pill: 9999px;
  --radius-2xl: 24px;
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;

  /* Subtitle Custom Variables */
  --sub-font: 'Vazirmatn', sans-serif;
  --sub-font-size: 20px;
  --sub-color: #fde047;
  --sub-bg: rgba(0, 0, 0, 0.75);
  --sub-shadow: 0 2px 4px rgba(0,0,0,0.95), 0 0 2px rgba(0,0,0,0.95);
  --sub-bottom: 36px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-persian);
  -webkit-tap-highlight-color: transparent !important;
}

html, body {
  height: 100%;
  height: 100dvh;
  background: var(--page);
  color: var(--text-main);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ── Minimal Axis Background (d.html) ── */
#axis-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--axis-bg);
  overflow: hidden;
}
.axis-h {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--my, 50%);
  height: 1px;
  background: linear-gradient(to right, transparent, var(--axis-line) 20%, rgba(68,92,254,0.12) 50%, var(--axis-line) 80%, transparent);
  pointer-events: none;
}
.axis-v {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--mx, 50%);
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--axis-line) 20%, rgba(68,92,254,0.12) 50%, var(--axis-line) 80%, transparent);
  pointer-events: none;
}
.corner-tick {
  position: absolute;
  width: 14px;
  height: 14px;
  opacity: 0.25;
}
.corner-tick::before, .corner-tick::after {
  content: "";
  position: absolute;
  background: var(--axis-tick);
}
.corner-tick::before { top: 6px; left: 0; right: 0; height: 1px; }
.corner-tick::after { left: 6px; top: 0; bottom: 0; width: 1px; }
.tick-tl { top: 14px; left: 14px; }
.tick-tr { top: 14px; right: 14px; }
.tick-bl { bottom: 14px; left: 14px; }
.tick-br { bottom: 14px; right: 14px; }

/* ── Custom Sleek Minimal Scrollbars ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-main);
}

/* ====================================================
   CURSOR TRACKING BORDER GLOW (SQUAP HALO SYSTEM)
   ==================================================== */
@media (min-width: 861px) {
  .app-header::after,
  .custom-player::after,
  .desktop-media-bar::after,
  .meet-tile::after,
  .voice-stage-controls-bar::after,
  .sidebar-column::after,
  .modal-card::after,
  .fullscreen-chat-modal-card::after {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    border-radius: inherit !important;
    pointer-events: none !important;
    padding: 1px !important;
    opacity: 0 !important;
    transition: opacity 0.28s ease !important;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0) !important;
    -webkit-mask-composite: xor !important;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0) !important;
    mask-composite: exclude !important;
    background: radial-gradient(300px circle at var(--x, 50%) var(--y, 50%),
      var(--accent-glow) 0%,
      var(--accent-glow-subtle) 45%,
      transparent 75%) !important;
    filter: drop-shadow(0 0 6px var(--accent-glow)) drop-shadow(0 0 14px var(--accent-glow-subtle)) !important;
    z-index: 10 !important;
  }
  .app-header:hover::after,
  .custom-player:hover::after,
  .desktop-media-bar:hover::after,
  .meet-tile:hover::after,
  .voice-stage-controls-bar:hover::after,
  .sidebar-column:hover::after,
  .modal-card:hover::after,
  .fullscreen-chat-modal-card:hover::after {
    opacity: 1 !important;
  }
}

/* ====================================================
   LOBBY / MODALS (SQUAP 24PX GLASS CARD)
   ==================================================== */
.modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  z-index: 10005;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateZ(0);
}

.modal-overlay.hidden,
.modal-overlay[hidden],
body > .modal-overlay.hidden {
  display: none !important;
}

.modal-card {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl);
  box-shadow: var(--glass-card-shadow);
  padding: 28px 24px;
  width: 100%;
  max-width: 440px;
  margin: auto !important;
  flex-shrink: 0;
  animation: modalScaleIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
  transform: translateZ(0);
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: translateY(18px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  width: 100%;
  flex-shrink: 0;
}
.title-with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--theme-badge-color);
}
.title-with-icon h2 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.01em;
}
.title-with-icon i {
  width: 18px;
  height: 18px;
  color: var(--accent-main);
  flex-shrink: 0;
}
.btn-close-modal {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  flex-shrink: 0;
  outline: none;
}
.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}
.btn-close-modal i {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.brand-icon {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, var(--accent-main), #6366f1);
  border-radius: var(--radius-xl);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(54, 80, 253, 0.4);
}

.brand h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.02em;
}
.brand p { font-size: 13px; color: var(--text-muted); margin-top: 4px; margin-bottom: 16px; }

.invite-room-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(68, 92, 254, 0.18), rgba(168, 85, 247, 0.18));
  border: 1px solid rgba(68, 92, 254, 0.4);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 18px;
  animation: fadeInDown 0.3s ease;
  text-align: right;
}
.invite-banner-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(68, 92, 254, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a855f7;
  flex-shrink: 0;
}
.invite-banner-icon i {
  width: 20px;
  height: 20px;
}
.invite-banner-text {
  display: flex;
  flex-direction: column;
  text-align: right;
  gap: 2px;
}
.invite-banner-text span {
  font-size: 0.76rem;
  color: var(--text-muted);
}
.invite-banner-text strong {
  font-size: 0.95rem;
  color: #fff;
  font-weight: 700;
}

.input-group {
  margin-bottom: 14px;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.input-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 9px 14px;
  transition: all 0.2s ease;
  min-width: 0;
}

.input-field.compact { padding: 6px 12px; border-radius: var(--radius-pill); min-width: 0; }
.input-field:focus-within {
  border-color: var(--accent-main);
  box-shadow: 0 0 0 2px var(--theme-badge-border);
}
.input-field i { color: var(--theme-badge-color); width: 16px; height: 16px; flex-shrink: 0; }
.input-field input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  width: 100%;
  min-width: 0;
}
.input-field input::placeholder { color: var(--text-dim); }

.input-with-button { display: flex; gap: 8px; }

.input-with-toggle {
  position: relative;
}
.btn-eye-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.btn-eye-toggle:hover {
  color: var(--text-main);
}
.btn-eye-toggle i {
  width: 15px;
  height: 15px;
}
.field-hint {
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 2px;
  line-height: 1.3;
}

.input-field.error-shake {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.4) !important;
  animation: shake 0.35s ease-in-out;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.room-privacy-badge {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
  box-sizing: border-box;
  flex-shrink: 0;
}
.room-privacy-badge.public {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.15);
}
.room-privacy-badge.public:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: #22c55e;
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.35);
}
.room-privacy-badge.private {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
}
.room-privacy-badge.private:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.35);
}
.room-privacy-badge i {
  width: 15px;
  height: 15px;
}

.btn-secondary {
  background: var(--glass-bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-pill);
  padding: 0 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-main);
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-main), #6366f1);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(54, 80, 253, 0.35);
  transition: all 0.2s ease;
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(54, 80, 253, 0.5);
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.btn-primary:active { transform: scale(0.98); }

/* ====================================================
   FIXED FLOATING TOP NAVBAR (.nav / .app-header)
   ==================================================== */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
}

.app-header {
  position: fixed !important;
  top: 15px !important;
  left: 20px !important;
  right: 20px !important;
  height: 54px !important;
  border-radius: 9999px !important;
  background: var(--glass-bg) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow: var(--glass-shadow) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 18px !important;
  z-index: 100 !important;
  box-sizing: border-box !important;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  z-index: 2;
}

.room-tag {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--glass-bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 3px 6px;
  height: 34px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}
.room-tag:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.room-tag-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.room-tag-action-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}
.room-tag-action-btn:active {
  transform: scale(0.92);
}

.room-tag-action-btn i {
  width: 15px;
  height: 15px;
  stroke-width: 2.1px;
  pointer-events: none;
}

/* Expandable Room Name Drawer */
/* Expandable Room Name Drawer */
.room-id-drawer {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, margin 0.3s ease;
  margin: 0;
  display: inline-flex;
  align-items: center;
}
.room-id-drawer.expanded {
  max-width: 140px;
  opacity: 1;
  margin: 0 4px;
}

.room-id-drawer .tag-code {
  font-weight: 700;
  color: var(--text-main);
  font-size: 11.5px;
  white-space: nowrap;
  max-width: 10ch;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 4px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
}
.room-id-drawer .tag-code:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}
.room-id-drawer .tag-code:active {
  transform: scale(0.95);
}

/* Room Status Icons (Crown & Lock - shown when room-tag is expanded, clean icons without circular badge) */
.room-status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, margin 0.3s ease;
  margin: 0;
  pointer-events: none;
  flex-shrink: 0;
}
.room-status-icons.expanded {
  max-width: 80px;
  opacity: 1;
  margin: 0 4px;
  pointer-events: auto;
}

.room-status-icon {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  user-select: none;
}
.room-status-icon:hover {
  transform: scale(1.18);
}
.room-status-icon:active {
  transform: scale(0.92);
}

.room-status-icon.room-host-icon,
.room-host-badge {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  padding: 0 !important;
  color: #fbbf24 !important;
}
.room-status-icon.room-host-icon i,
.room-host-badge i {
  width: 16px !important;
  height: 16px !important;
  color: #fbbf24 !important;
  filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.5));
}

.room-status-icon.room-privacy-icon,
.room-privacy-badge {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  padding: 0 !important;
}
.room-privacy-badge.public,
.room-privacy-icon.public {
  color: #22c55e !important;
}
.room-privacy-badge.public i,
.room-privacy-icon.public i {
  width: 15px !important;
  height: 15px !important;
  color: #22c55e !important;
}
.room-privacy-badge.private,
.room-privacy-icon.private {
  color: #ef4444 !important;
}
.room-privacy-badge.private i,
.room-privacy-icon.private i {
  width: 15px !important;
  height: 15px !important;
  color: #ef4444 !important;
}

/* Nav Actions Group (Desktop vs Mobile) */
.nav-actions-group {
  display: flex;
  align-items: center;
  position: relative;
}
.mobile-menu-trigger {
  display: none !important;
}
.nav-pill-drawer {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Voice Quick Join Pill */
.btn-voice-pill {
  background: var(--glass-bg-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 0 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  height: 34px;
  box-sizing: border-box;
  user-select: none;
}
.btn-voice-pill:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.btn-voice-pill i { 
  width: 15px; 
  height: 15px; 
  color: var(--text-muted); 
  flex-shrink: 0; 
  stroke-width: 2.1px;
  transition: color 0.2s ease;
}
.btn-voice-pill:hover i {
  color: #ffffff;
}

/* Standalone Voice Mic Button in Header */
.btn-head-icon.voice-head-mic-btn {
  color: #10b981;
}
.btn-head-icon.voice-head-mic-btn:hover {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}
.btn-head-icon.voice-head-mic-btn.muted {
  color: #ef4444;
}
.btn-head-icon.voice-head-mic-btn.muted:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Standalone Voice Leave Button in Header (Same color as other buttons, NOT red) */
.btn-head-icon.voice-head-leave-btn {
  color: var(--text-muted);
}
.btn-head-icon.voice-head-leave-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-head-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  box-sizing: border-box;
}
.btn-head-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: var(--accent-main);
}
.btn-head-icon i { width: 14px; height: 14px; color: var(--theme-badge-color); flex-shrink: 0; }
.btn-head-icon.muted { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); border-color: var(--accent-red); }
.btn-head-icon.danger { color: var(--text-muted); }
.btn-head-icon.danger:hover { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); border-color: var(--accent-red); }
.btn-head-icon.danger i { color: inherit; }

.users-counter {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--glass-bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
  box-sizing: border-box;
  user-select: none;
}
.users-counter:hover {
  border-color: var(--accent-main);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}
.users-counter i { width: 14px; height: 14px; color: var(--theme-badge-color); flex-shrink: 0; }

/* ====================================================
   APP MAIN GRID (SQUAP FLOATING THEATER + SIDEBAR)
   ==================================================== */
.app-main-grid {
  position: fixed !important;
  top: 84px !important;
  left: 20px !important;
  right: 20px !important;
  bottom: 15px !important;
  display: grid;
  grid-template-columns: 1fr 370px;
  gap: 16px;
  overflow: visible;
  z-index: 10;
}

/* THEATER COLUMN */
.theatre-column {
  display: flex;
  flex-direction: column;
  gap: 15px;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

/* VIDEO PLAYER CONTAINER (SQUAP 24PX GLASS PANEL) */
.custom-player {
  position: relative;
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  max-height: 100%;
  background: #000000;
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glass-shadow);
}

#main-video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: black;
  display: block;
}

/* SUBTITLE OVERLAY */
.custom-subtitle-overlay {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: var(--sub-bottom);
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  z-index: 24;
  text-align: center;
  direction: rtl;
}

.custom-subtitle-overlay span {
  font-family: var(--sub-font);
  font-size: var(--sub-font-size);
  color: var(--sub-color);
  background-color: var(--sub-bg);
  text-shadow: var(--sub-shadow);
  padding: 4px 14px;
  border-radius: var(--radius-sm);
  line-height: 1.5;
  white-space: pre-line;
  max-width: 95%;
  display: inline-block;
}
.custom-subtitle-overlay span:empty { display: none; }

/* FULLSCREEN FLOATING VOICE PILL */
.fullscreen-voice-pill {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 40;
}
.fs-pill-btn {
  background: rgba(54, 80, 253, 0.2);
  border: 1px solid var(--accent-main);
  color: var(--theme-badge-color);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.fs-pill-btn.muted {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--accent-red);
  color: var(--accent-red);
}
.fs-speakers-avatars { display: flex; align-items: center; gap: 4px; }
.fs-speaker-chip {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--glass-bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fs-speaker-chip.speaking {
  border-color: var(--accent-main);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* FULLSCREEN ON-SCREEN CHAT BUBBLES */
.fullscreen-chat-overlay {
  position: absolute;
  top: 60px;
  right: 16px;
  width: 280px;
  max-height: 240px;
  overflow-y: hidden;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 38;
}
.fs-chat-bubble {
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  color: white;
  animation: fsBubbleFade 6s forwards;
  max-width: 90%;
  align-self: flex-start;
}
@keyframes fsBubbleFade {
  0% { opacity: 0; transform: translateY(10px); }
  10% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px); }
}
.fs-chat-username { font-weight: 700; color: var(--theme-badge-color); margin-left: 4px; }

/* FULLSCREEN CENTERED CHAT MODAL */
.fullscreen-chat-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}
.fullscreen-chat-modal-card {
  width: 100%;
  max-width: 420px;
  height: 380px;
  max-height: 80vh;
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.fs-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}
.fs-modal-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--theme-badge-color);
}
.fs-modal-title i { width: 15px; height: 15px; }
.btn-close-fs-modal {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
}
.btn-close-fs-modal:hover { color: white; }

.fs-modal-chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  padding: 10px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}

.fs-modal-chat-form {
  padding: 10px 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--glass-bg-input);
  flex-shrink: 0;
}
.fs-modal-chat-form input {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 8px 12px;
  color: white;
  font-size: 13px;
  outline: none;
}
.fs-modal-chat-form input:focus { border-color: var(--accent-main); }

@media (max-width: 960px), (hover: none) and (pointer: coarse) {
  .fs-modal-chat-form input {
    font-size: 16px !important; /* Prevents mobile browser auto-zoom on input focus */
  }
}

/* FULLSCREEN LEFT SIDE DOCK (VERTICAL REACTIONS + CHAT TRIGGER) */
.fullscreen-left-dock {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  user-select: none;
  opacity: 1;
  transition: opacity 0.35s ease, transform 0.25s ease;
}
.fullscreen-left-dock.idle-dim {
  opacity: 0.28;
}
.fullscreen-left-dock:hover,
.fullscreen-left-dock.interacting {
  opacity: 1 !important;
}
.fullscreen-left-dock.hidden {
  display: none !important;
}

/* FULLSCREEN FLOATING CHAT TRIGGER BUTTON */
.fullscreen-chat-trigger-btn {
  background: rgba(10, 10, 16, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  color: white;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  transition: all 0.2s ease;
  user-select: none;
}
.fullscreen-chat-trigger-btn:hover {
  background: var(--accent-main);
  border-color: var(--accent-main);
  transform: scale(1.1);
}
.fullscreen-chat-trigger-btn i {
  width: 18px;
  height: 18px;
  color: var(--theme-badge-color);
}
.fullscreen-chat-trigger-btn:hover i {
  color: white;
}

/* FULLSCREEN MODAL EMOJI TRAY */
.fs-chat-emoji-tray {
  bottom: 46px !important;
  right: 0 !important;
  left: 0 !important;
  width: 100% !important;
}

/* Double-Tap Touch Seek Indicator Container */
.seek-ripple-container {
  position: absolute;
  top: 0;
  bottom: 50px;
  width: 35%;
  pointer-events: none;
  z-index: 22;
  display: flex;
  align-items: center;
  justify-content: center;
}
.seek-ripple-container.left { right: 0; }
.seek-ripple-container.right { left: 0; }

.seek-ripple-indicator {
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.7);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.seek-ripple-indicator.active { opacity: 1; transform: scale(1.1); }

/* Center Splash */
.center-play-splash {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  z-index: 25;
  pointer-events: none;
}

/* On-Player Action HUD Banner */
.player-action-banner {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 15, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-pill);
  padding: 8px 20px;
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 35;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 15px rgba(68, 92, 254, 0.3);
  animation: actionBannerPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  white-space: nowrap;
}
.player-action-banner.hidden {
  display: none;
}
@keyframes actionBannerPop {
  0% { opacity: 0; transform: translateX(-50%) translateY(-12px) scale(0.9); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* Empty Placeholder */
.video-placeholder {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, #151824, #08090e);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 16px;
  z-index: 10;
}
.placeholder-icon {
  width: 48px;
  height: 48px;
  background: var(--theme-badge-bg);
  border: 1px solid var(--theme-badge-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-badge-color);
  margin-bottom: 4px;
}
.video-placeholder h3 { font-size: 15px; font-weight: 700; }
.video-placeholder p { font-size: 12.5px; color: var(--text-dim); max-width: 320px; line-height: 1.5; }

/* Vertical Scrollable Floating Reactions Bar */
.floating-emojis-bar {
  background: rgba(10, 10, 16, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 30;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  box-sizing: border-box;
}

.emojis-scroll-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 36px;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior: contain;
  contain: paint layout;
}
.emojis-scroll-track::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.quick-react-btn {
  flex-shrink: 0;
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  box-sizing: border-box;
  border-radius: 50%;
  transition: transform 0.1s ease, background 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  user-select: none;
}
.quick-react-btn:hover {
  transform: scale(1.22);
  background: rgba(255, 255, 255, 0.16);
}
.quick-react-btn:active {
  transform: scale(0.95);
}

/* Floating Reactions Container & Exact Original Animation from watch-party */
.reaction-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 38;
}

.floating-reaction {
  position: absolute;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  user-select: none;
  animation: floatUp 1.8s forwards;
}

.floating-reaction .reaction-emoji {
  font-size: 28px;
  line-height: 1;
}

.floating-reaction .reaction-username {
  font-size: 11px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 10px;
  padding: 1px 7px;
  margin-top: 2px;
  white-space: nowrap;
  font-family: 'Vazirmatn', sans-serif;
  border: none;
  box-shadow: none;
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(0.6);
  }
  50% {
    opacity: 0.9;
    transform: translateY(-100px) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translateY(-200px) scale(1.3);
  }
}

/* ====================================================
   PLAYER CONTROLS OVERLAY (SQUAP GLASS BOTTOM BAR)
   ==================================================== */
.player-controls-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(10, 10, 12, 0.95) 0%, rgba(10, 10, 12, 0.5) 65%, transparent 100%);
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 35;
  direction: ltr;
  transition: opacity 0.3s, transform 0.3s;
}
.player-controls-overlay.autohide { opacity: 0; pointer-events: none; transform: translateY(8px); }

.timeline-container {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: height 0.15s;
  touch-action: none;
}
.timeline-container::before {
  content: '';
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: 0;
  right: 0;
}
.timeline-container:hover { height: 8px; }
.timeline-buffer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-pill);
}
.timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--accent-main);
  box-shadow: 0 0 10px var(--accent-glow);
  border-radius: var(--radius-pill);
}
.timeline-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s;
  pointer-events: none;
}
.timeline-container:hover .timeline-thumb { transform: translate(-50%, -50%) scale(1); }
@media (hover: none), (max-width: 860px) {
  .timeline-thumb { transform: translate(-50%, -50%) scale(1); }
}
.timeline-tooltip {
  position: absolute;
  bottom: 14px;
  left: 0;
  transform: translateX(-50%);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: white;
  display: none;
}

.controls-row { display: flex; align-items: center; justify-content: space-between; }
.controls-left, .controls-right { display: flex; align-items: center; gap: 4px; }

.btn-ctrl-touch {
  background: transparent;
  border: none;
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  position: relative;
  touch-action: manipulation;
}
.btn-ctrl-touch:active {
  transform: scale(0.92);
}
.btn-ctrl-touch:hover { background: rgba(255, 255, 255, 0.12); }

.volume-container { display: flex; align-items: center; gap: 4px; }
.volume-slider { width: 0px; height: 4px; accent-color: var(--accent-main); cursor: pointer; transition: width 0.2s; opacity: 0; }
.volume-container:hover .volume-slider { width: 60px; opacity: 1; }

.time-display {
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  margin-left: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
  font-variant-numeric: tabular-nums;
}
.time-sep { color: var(--text-dim); }

.sub-menu-wrapper { position: relative; }

.sub-popover {
  position: absolute;
  bottom: 46px;
  right: 0;
  background: rgba(14, 18, 28, 0.94);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 12px 14px;
  min-width: 240px;
  max-width: min(300px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  z-index: 60;
  direction: rtl;
  animation: popoverFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.sub-popover.hidden {
  display: none !important;
  pointer-events: none !important;
}

/* HLS Multi-Quality Popover Menu */
.quality-menu-wrapper { position: relative; }
.quality-menu-wrapper.hidden { display: none !important; }

.ctrl-quality-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(54, 80, 253, 0.25);
  color: var(--accent-main);
  border: 1px solid rgba(54, 80, 253, 0.4);
  padding: 1px 5px;
  border-radius: 4px;
  margin-right: 4px;
  letter-spacing: 0.5px;
}

.quality-popover {
  position: absolute;
  bottom: 46px;
  right: 0;
  background: rgba(14, 18, 28, 0.94);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 12px 14px;
  min-width: 200px;
  max-width: min(260px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  z-index: 60;
  direction: rtl;
  animation: popoverFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.quality-popover.hidden {
  display: none !important;
  pointer-events: none !important;
}

.quality-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  color: var(--text-primary);
}

.quality-stream-type {
  font-size: 10px;
  font-weight: 600;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.quality-options-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.quality-opt-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
  text-align: right;
  direction: rtl;
}

.quality-opt-btn:hover {
  background: rgba(54, 80, 253, 0.15);
  border-color: rgba(54, 80, 253, 0.35);
  color: white;
}

.quality-opt-btn.active {
  background: var(--accent-main);
  border-color: var(--accent-main);
  color: white;
  font-weight: 700;
  box-shadow: 0 0 12px var(--accent-glow);
}

/* PWA Install Button */
.pwa-install-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(54, 80, 253, 0.2), rgba(124, 58, 237, 0.2));
  border: 1px solid rgba(54, 80, 253, 0.4);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  margin-top: 10px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(54, 80, 253, 0.2);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-install-pill:hover {
  background: linear-gradient(135deg, rgba(54, 80, 253, 0.35), rgba(124, 58, 237, 0.35));
  border-color: var(--accent-main);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(54, 80, 253, 0.35);
}

.pwa-install-pill.hidden {
  display: none !important;
}

.sub-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  color: var(--text-primary);
}
.btn-text-action {
  background: rgba(54, 80, 253, 0.14);
  border: 1px solid rgba(54, 80, 253, 0.28);
  color: var(--accent-main);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  transition: all 0.15s ease;
}
.btn-text-action:hover {
  background: var(--accent-main);
  color: white;
}
.btn-text-action:active {
  transform: scale(0.95);
}

.popover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}
.btn-toggle-active {
  background: var(--glass-bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-toggle-active.active {
  background: var(--theme-badge-bg);
  color: var(--theme-badge-color);
  border-color: var(--accent-main);
}
.btn-toggle-active:active {
  transform: scale(0.94);
}

.offset-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.offset-controls button {
  background: var(--glass-bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  min-width: 38px;
  transition: all 0.12s ease;
}
.offset-controls button:active {
  transform: scale(0.92);
}
#sub-offset-val {
  min-width: 32px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ====================================================
   DESKTOP COMPACT MEDIA BAR (SQUAP 24PX GLASS CARD)
   ==================================================== */
.desktop-media-bar {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl);
  box-shadow: var(--glass-shadow);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  container-type: inline-size;
  container-name: mediabar;
}

.media-bar-input-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.btn-action-icon {
  background: var(--glass-bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-pill);
  padding: 6px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s;
  height: 34px;
  flex-shrink: 0;
  box-sizing: border-box;
}
.btn-action-icon:hover { border-color: var(--accent-main); background: rgba(255, 255, 255, 0.08); }
.btn-action-icon i { width: 14px; height: 14px; color: var(--theme-badge-color); flex-shrink: 0; }

.btn-clear-media {
  color: var(--text-muted);
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.08);
}
.btn-clear-media i {
  color: #f87171 !important;
}
.btn-clear-media:hover {
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  background: rgba(239, 68, 68, 0.16) !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}

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

.proxy-switch-compact {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}
.proxy-switch-compact input { display: none; }
.proxy-switch-compact input:checked + .switch-slider-sm { background: var(--accent-main); box-shadow: 0 0 8px var(--accent-glow); }
.proxy-switch-compact input:checked + .switch-slider-sm::before { transform: translateX(12px); background: white; }

.switch-slider-sm {
  width: 28px;
  height: 16px;
  background: var(--glass-bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  position: relative;
  transition: all 0.2s;
  flex-shrink: 0;
}
.switch-slider-sm::before {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 12px;
  height: 12px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.2s;
}
.switch-label-sm { font-size: 11px; color: var(--text-muted); font-weight: 600; white-space: nowrap; transition: opacity 0.2s; }

.btn-play-compact {
  background: linear-gradient(135deg, var(--accent-main), #6366f1);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 4px 14px rgba(54, 80, 253, 0.35);
  height: 34px;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-play-compact i { width: 14px; height: 14px; flex-shrink: 0; }
.btn-play-compact:hover { transform: translateY(-1px); filter: brightness(1.06); }

/* RESPONSIVE FLUID MEDIA BAR (Container Queries & Media Fallbacks) */
@container mediabar (max-width: 950px) {
  .btn-action-icon span {
    display: none !important;
  }
  .btn-action-icon {
    padding: 0 9px;
    min-width: 34px;
  }
}

@container mediabar (max-width: 820px) {
  .switch-label-sm {
    display: none !important;
  }
  .desktop-media-bar {
    gap: 6px;
    padding: 6px 10px;
  }
  .media-bar-input-group {
    gap: 4px;
  }
  .media-bar-actions {
    gap: 6px;
  }
}

@container mediabar (max-width: 680px) {
  .btn-play-compact span {
    display: none !important;
  }
  .btn-play-compact {
    padding: 0 10px;
    min-width: 34px;
  }
  .input-field.compact {
    padding: 5px 8px;
  }
  .input-field.compact input {
    font-size: 11.5px;
  }
}

/* Screen-level fallback queries */
@media (min-width: 993px) and (max-width: 1350px) {
  .btn-action-icon span {
    display: none !important;
  }
  .btn-action-icon {
    padding: 0 9px;
    min-width: 34px;
  }
}

@media (min-width: 993px) and (max-width: 1180px) {
  .switch-label-sm {
    display: none !important;
  }
}

@media (min-width: 993px) and (max-width: 1060px) {
  .btn-play-compact span {
    display: none !important;
  }
  .btn-play-compact {
    padding: 0 10px;
    min-width: 34px;
  }
}

/* ====================================================
   RIGHT COLUMN: SIDEBAR (SQUAP 24PX GLASS PANEL)
   ==================================================== */
.sidebar-column {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl);
  box-shadow: var(--glass-shadow);
  height: 100%;
  overflow: hidden;
}

.sidebar-nav-tabs {
  display: flex;
  align-items: center;
  background: rgba(10, 10, 12, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  height: 48px;
  flex-shrink: 0;
  padding: 0 8px;
  gap: 6px;
}

.btn-drawer-side-toggle {
  display: none !important;
}

.side-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  height: 34px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}
.side-tab-btn i { width: 15px; height: 15px; }
.side-tab-btn.active {
  color: #ffffff;
  background: var(--accent-main);
  box-shadow: 0 2px 8px rgba(54, 80, 253, 0.35);
}
.mobile-only-tab { display: none; }

.unread-badge, .voice-badge-dot {
  width: 7px;
  height: 7px;
  min-width: 7px;
  min-height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  position: static;
  margin-right: 4px;
  vertical-align: middle;
}
.unread-badge {
  background: var(--accent-red, #ef4444);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
  animation: unreadPulse 1.8s infinite ease-in-out;
}
.voice-badge-dot {
  background: var(--accent-green, #10b981);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
  animation: voicePulseDot 2s infinite ease-in-out;
}

@keyframes unreadPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.8; }
}

@keyframes voicePulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.85; }
}

.sidebar-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tab-pane {
  display: none;
  width: 100%;
  height: 100%;
  overflow-y: auto;
}
.tab-pane.active {
  display: flex;
  flex-direction: column;
}

/* CHAT STYLES */
.chat-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 88%;
  animation: bubbleIn 0.2s ease-out;
}
.chat-msg-row.mine {
  align-self: flex-start;
  flex-direction: row;
}
.chat-msg-row.other {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.chat-msg-row .chat-bubble {
  max-width: 100%;
  animation: none;
}

.chat-msg-avatar-slot {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 38px;
}
.chat-msg-avatar.has-strobi {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  position: relative;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.chat-msg-avatar.has-strobi strobi-avatar {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.45));
}
.chat-msg-row:hover .chat-msg-avatar.has-strobi {
  transform: scale(1.15);
}
.chat-msg-avatar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0.7;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}
.chat-msg-row:hover .chat-msg-avatar-dot {
  opacity: 1;
  transform: scale(1.35);
}

.chat-bubble {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 85%;
  animation: bubbleIn 0.2s ease-out;
}
@keyframes bubbleIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.chat-bubble.mine { align-self: flex-start; }
.chat-bubble.other { align-self: flex-end; }

.msg-info { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--text-dim); }
.chat-bubble.mine .msg-info { flex-direction: row; }
.chat-bubble.other .msg-info { flex-direction: row-reverse; }
.msg-username { font-weight: 600; color: var(--text-muted); }

.msg-text {
  padding: 8px 12px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}
.chat-bubble.mine .msg-text { background: var(--accent-main); color: white; border-bottom-right-radius: 2px; }
.chat-bubble.other .msg-text { background: var(--glass-bg-elevated); color: var(--text-main); border: 1px solid var(--border-subtle); border-bottom-left-radius: 2px; }

.system-msg { text-align: center; margin: 2px 0; }
.system-msg span { background: var(--theme-badge-bg); border: 1px solid var(--theme-badge-border); padding: 2px 10px; border-radius: var(--radius-pill); font-size: 10.5px; color: var(--theme-badge-color); }

/* CHAT TYPING INDICATOR (Clean Minimal Text without Box) */
.chat-typing-indicator {
  display: flex;
  align-items: center;
  padding: 3px 14px 4px 14px;
  font-size: 11px;
  color: var(--text-dim);
  pointer-events: none;
  transition: all 0.2s ease-out;
  min-height: 20px;
  opacity: 1;
  transform: translateY(0);
}
.chat-typing-indicator.hidden {
  opacity: 0 !important;
  transform: translateY(3px) !important;
  pointer-events: none;
  min-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}
.typing-dots-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  backdrop-filter: none !important;
}
.typing-text {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
  font-style: italic;
  opacity: 0.85;
}
.typing-wave {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 1px;
}
.typing-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}
.typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}
.typing-dot:nth-child(3) {
  animation-delay: 0s;
}
@keyframes typingBounce {
  0%, 80%, 100% {
    transform: scale(0.45);
    opacity: 0.3;
  }
  40% {
    transform: scale(1.1);
    opacity: 0.9;
  }
}

/* CHAT REPLY BAR */
.chat-reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--glass-bg-elevated);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  animation: replyBarIn 0.2s ease-out;
  position: relative;
  z-index: 10;
}
@keyframes replyBarIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.chat-reply-bar.hidden {
  display: none !important;
}
.reply-bar-content {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  flex: 1;
}
.reply-bar-icon {
  color: var(--accent-main);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.reply-bar-icon i {
  width: 14px;
  height: 14px;
}
.reply-bar-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.reply-bar-title {
  font-weight: 700;
  color: var(--accent-main);
  font-size: 11px;
}
.reply-bar-snippet {
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11.5px;
  max-width: 220px;
}
.btn-cancel-reply {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn-cancel-reply:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}
.btn-cancel-reply i {
  width: 14px;
  height: 14px;
}

/* CHAT BUBBLE REPLY QUOTE */
.msg-reply-quote {
  display: flex;
  align-items: stretch;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  padding: 4px 8px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.chat-bubble.mine .msg-reply-quote {
  background: rgba(0, 0, 0, 0.18);
}
.msg-reply-quote:hover {
  opacity: 0.85;
}
.reply-quote-bar {
  width: 3px;
  background: var(--accent-main);
  border-radius: 2px;
  flex-shrink: 0;
}
.chat-bubble.mine .reply-quote-bar {
  background: #a5b4fc;
}
.reply-quote-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.reply-quote-user {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-main);
}
.chat-bubble.mine .reply-quote-user {
  color: #c7d2fe;
}
.reply-quote-text {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.chat-bubble.mine .reply-quote-text {
  color: #e0e7ff;
}

/* REPLY BUTTON ON BUBBLE */
.btn-msg-reply {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.45;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.15s ease, opacity 0.15s ease;
  margin-right: auto;
}
.chat-bubble:hover .btn-msg-reply {
  opacity: 1;
}
.btn-msg-reply:hover {
  color: var(--accent-main);
  background: transparent;
  transform: scale(1.125);
}
.btn-msg-reply i {
  width: 12px;
  height: 12px;
  pointer-events: none;
}

/* SINGLE-STAGE HIGHLIGHT: 0 -> 100 -> HOLD 800ms -> 0 */
.msg-highlight-pulse .msg-text,
.msg-highlight-pulse .msg-reply-quote {
  animation: cleanSingleStageHighlight 1.5s ease-in-out forwards;
  position: relative;
  z-index: 2;
}

@keyframes cleanSingleStageHighlight {
  0% {
    box-shadow: 
      0 0 0 0 rgba(29, 78, 216, 0),
      0 0 0 0 rgba(0, 0, 0, 0);
  }
  15% {
    box-shadow: 
      0 0 0 1.5px #1d4ed8,
      0 0 8px 1px rgba(29, 78, 216, 0.45),
      0 0 14px 2px rgba(0, 0, 0, 0.35);
  }
  68% {
    box-shadow: 
      0 0 0 1.5px #1d4ed8,
      0 0 8px 1px rgba(29, 78, 216, 0.45),
      0 0 14px 2px rgba(0, 0, 0, 0.35);
  }
  100% {
    box-shadow: 
      0 0 0 0 rgba(29, 78, 216, 0),
      0 0 0 0 rgba(0, 0, 0, 0);
  }
}

/* Chat Input Area & Toggleable Emoji Drawer */
.chat-input-area-wrapper {
  position: relative;
  width: 100%;
}

.chat-emoji-tray {
  position: absolute;
  bottom: 54px;
  right: 8px;
  left: 8px;
  max-height: 190px;
  overflow-y: auto;
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
  z-index: 50;
  animation: modalScaleIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.emoji-tray-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  place-items: center;
}

.emoji-chip {
  background: var(--glass-bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 17px;
  cursor: pointer;
  padding: 5px;
  border-radius: var(--radius-md);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.emoji-chip:hover {
  transform: scale(1.2);
  border-color: var(--accent-main);
  background: rgba(54, 80, 253, 0.2);
}
.emoji-chip:active {
  transform: scale(0.95);
}

.chat-bar-form {
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--glass-bg-input);
}

.btn-emoji-trigger {
  background: var(--glass-bg-elevated);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  line-height: 1;
  transition: all 0.15s;
}
.btn-emoji-trigger .emoji-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16.5px;
  line-height: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  user-select: none;
}
.btn-emoji-trigger:hover {
  transform: scale(1.08);
  border-color: var(--accent-main);
  background: rgba(54, 80, 253, 0.15);
}
.btn-emoji-trigger i,
.btn-emoji-trigger svg {
  width: 16px;
  height: 16px;
  display: block;
  margin: auto;
  color: var(--text-secondary);
  transition: color 0.15s;
}
.btn-emoji-trigger:hover i,
.btn-emoji-trigger:hover svg {
  color: var(--text-main);
}
.btn-emoji-trigger.recording {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  color: #ef4444 !important;
  animation: pulseVoiceRecord 1s infinite alternate;
}
@keyframes pulseVoiceRecord {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
  100% { transform: scale(1.08); box-shadow: 0 0 12px rgba(239, 68, 68, 0.6); }
}

.chat-bar-form input {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
}
.chat-bar-form input:focus { border-color: var(--accent-main); }

.btn-send-chat {
  background: var(--accent-main);
  border: none;
  color: white;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(54, 80, 253, 0.35);
  transition: all 0.15s;
}
.btn-send-chat:hover { filter: brightness(1.1); transform: scale(1.05); }
.btn-send-chat i,
.btn-send-chat svg {
  width: 16px;
  height: 16px;
  display: block;
  margin: auto;
  transform: translate(-1px, 1px);
}

/* VOICE & MIXER STYLES */
.voice-tab-wrapper {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.voice-card-box {
  background: var(--glass-bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.voice-mixer-card.voice-accordion {
  background: var(--glass-bg-elevated);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.voice-mixer-card.voice-accordion:hover {
  border-color: rgba(68, 92, 254, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.voice-mixer-card.voice-accordion.open {
  border-color: rgba(68, 92, 254, 0.45);
  box-shadow: 0 6px 24px rgba(68, 92, 254, 0.12);
}

.accordion-trigger {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  padding: 2px 0;
}

.accordion-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}

.accordion-title-box i {
  width: 16px;
  height: 16px;
  color: var(--accent-main);
}

.accordion-chevron {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
  width: 16px;
  height: 16px;
  color: var(--text-dim);
}

.voice-accordion.open .accordion-chevron {
  transform: rotate(180deg);
  color: var(--accent-main);
}

.voice-accordion-body {
  display: none;
}

.voice-accordion.open .voice-accordion-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  animation: modalScaleIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mixer-control-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mixer-label-val {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mixer-label-val label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.mixer-label-val label i {
  width: 14px;
  height: 14px;
  color: var(--accent-main);
}

.setting-value-badge {
  font-size: 10.5px;
  font-family: 'Vazirmatn', monospace, sans-serif;
  font-weight: 700;
  background: rgba(68, 92, 254, 0.15);
  border: 1px solid rgba(68, 92, 254, 0.35);
  color: var(--theme-badge-color);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  min-width: 44px;
  text-align: center;
}

/* DISCORD-STYLE LIVE VU METER & GATE STYLING */
.discord-meter-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--glass-bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px;
}

.meter-labels-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.meter-label-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.meter-label-title i {
  width: 14px;
  height: 14px;
  color: var(--accent-main);
}

.gate-mode-switch-box {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.meter-badges-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meter-thresh-badge {
  font-size: 10.5px;
  font-family: 'Vazirmatn', sans-serif;
  background: rgba(68, 92, 254, 0.14);
  border: 1px solid rgba(68, 92, 254, 0.35);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  color: var(--theme-badge-color);
  font-weight: 700;
  transition: all 0.2s ease;
}

.meter-db-badge {
  font-size: 10.5px;
  font-family: monospace;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  color: var(--text-main);
  font-weight: 700;
  min-width: 44px;
  text-align: center;
}

.meter-track-container {
  position: relative;
  height: 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
  display: flex;
  align-items: center;
  direction: ltr !important;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.meter-active-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6 0%, #6366f1 60%, #10b981 100%);
  border-radius: var(--radius-pill);
  transition: transform 0.04s ease-out;
  transform-origin: left;
  z-index: 1;
}

.meter-threshold-gate {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: #ffffff;
  box-shadow: 0 0 8px #ffffff, 0 0 14px var(--accent-main);
  z-index: 2;
  pointer-events: none;
  transition: transform 0.06s ease;
  border-radius: 2px;
}

.meter-range-input {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 3;
  margin: 0;
  direction: ltr !important;
}

.meter-range-input:disabled {
  cursor: not-allowed;
}

.meter-scale-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
  font-size: 9.5px;
  font-family: 'Vazirmatn', sans-serif;
  color: var(--text-dim);
  direction: ltr !important;
  user-select: none;
  opacity: 0.8;
}

.meter-hint-text {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 2px;
}

.voice-box-header { display: flex; align-items: center; justify-content: space-between; }
.voice-status-indicator { display: flex; align-items: center; gap: 6px; }
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green-glow);
}
.live-label { font-size: 12.5px; font-weight: 700; color: var(--text-main); }
.member-count-badge { font-size: 11px; color: var(--text-dim); }

.voice-members-grid { display: flex; flex-direction: column; gap: 8px; }
.empty-voice-msg { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-dim); padding: 4px 0; }

.voice-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass-bg-input);
  border: 1px solid var(--border-subtle);
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  gap: 8px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.voice-member-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.voice-member-mic-icon {
  flex-shrink: 0;
}
.voice-member-name-wrap {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}
.voice-member-name {
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}
.voice-member-info.speaking .voice-member-name {
  color: var(--theme-badge-color);
  font-weight: 700;
}
.voice-member-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.voice-user-volume-box {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 115px;
  flex-shrink: 0;
}
.voice-user-volume-slider {
  width: 70px;
  height: 4px;
  accent-color: var(--accent-main);
  cursor: pointer;
  flex-shrink: 0;
}
.voice-user-volume-val {
  font-size: 10px;
  color: var(--text-dim);
  width: 28px;
  text-align: left;
  flex-shrink: 0;
}

.btn-voice-big {
  width: 100%;
  background: var(--theme-badge-bg);
  border: 1px solid var(--theme-badge-border);
  color: var(--theme-badge-color);
  border-radius: var(--radius-pill);
  padding: 11px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-voice-big:hover {
  background: rgba(68, 92, 254, 0.25);
  border-color: var(--accent-main);
}
.btn-voice-big.in-voice {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--accent-red);
}

/* MOBILE MEDIA PANE & EMBEDDED PLAYLIST */
.mobile-media-pane {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}
#tab-media.active {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}
.mobile-card-box {
  background: var(--glass-bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 14px;
  display: flex;
  flex-direction: column;
}
.mobile-card-box h4 {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--theme-badge-color);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.mobile-card-box h4 i { width: 14px; height: 14px; }
.mobile-media-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.mobile-media-header-row h4 {
  margin-bottom: 0 !important;
}
.btn-clear-media-compact {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}
.btn-clear-media-compact i {
  width: 13px;
  height: 13px;
  color: #ef4444;
}
.btn-clear-media-compact:active {
  transform: scale(0.96);
  background: rgba(239, 68, 68, 0.2);
}
.mobile-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

/* Integrated Playlist Card in Mobile Media Pane (Harmonious UI) */
.mobile-media-pane .playlist-card-box {
  background: var(--glass-bg-input) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-xl) !important;
  height: auto !important;
  min-height: 250px !important;
  flex: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}
.mobile-media-pane .playlist-box-header {
  padding: 10px 12px !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border-top-left-radius: var(--radius-xl) !important;
  border-top-right-radius: var(--radius-xl) !important;
}
.mobile-media-pane .playlist-status-indicator {
  font-size: 12.5px !important;
}
.mobile-media-pane .playlist-status-indicator i {
  width: 15px !important;
  height: 15px !important;
}
.mobile-media-pane .playlist-items-list {
  max-height: 240px !important;
  overflow-y: auto !important;
  padding: 8px 10px !important;
  -webkit-overflow-scrolling: touch;
}
.mobile-media-pane .playlist-drawer-footer {
  padding: 8px 10px !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border-bottom-left-radius: var(--radius-xl) !important;
  border-bottom-right-radius: var(--radius-xl) !important;
}
/* ====================================================
   CONFIRMATION MODALS (DANGER & CLEAR)
   ==================================================== */
.confirm-modal-card {
  max-width: 390px !important;
  text-align: right;
  padding: 22px 20px !important;
}
.confirm-modal-body {
  margin: 14px 0 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.confirm-message {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0;
}
.confirm-subtext {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}
.confirm-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.btn-danger-pill {
  background: var(--accent-red, #ef4444);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px var(--accent-red-glow, rgba(239, 68, 68, 0.35));
  transition: all 0.2s ease;
}
.btn-danger-pill:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--accent-red-glow, rgba(239, 68, 68, 0.5));
}
.btn-danger-pill:active {
  transform: scale(0.96);
}
.btn-danger-pill i {
  width: 14px;
  height: 14px;
}

.btn-secondary-pill {
  background: var(--glass-bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-secondary-pill:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

/* ====================================================
   ROOM USERS MODAL
   ==================================================== */
.room-users-card {
  max-width: 380px;
  text-align: right;
}
.room-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0;
}
.room-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-bg-input);
  border: 1px solid var(--border-subtle);
  padding: 8px 12px;
  border-radius: var(--radius-pill);
}
.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-main), #6366f1);
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-avatar-circle.has-strobi {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: visible;
  padding: 0;
}
.user-avatar-circle.has-strobi strobi-avatar {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
  transition: transform 0.2s ease;
}
.room-user-item:hover .user-avatar-circle.has-strobi strobi-avatar {
  transform: scale(1.08);
}
.user-item-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow: hidden;
}
.user-item-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.user-item-status {
  font-size: 10.5px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}
.user-item-status.voice {
  color: var(--accent-green);
  font-weight: 600;
}
.status-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  display: inline-block;
}
.user-item-status.voice .status-indicator-dot {
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}
.user-item-status.online .status-indicator-dot {
  background: var(--theme-badge-color);
}

/* ====================================================
   SUBTITLE CUSTOMIZATION MODAL (V3.89 REDESIGN)
   ==================================================== */
.subtitle-settings-card {
  max-width: 580px;
  width: 95%;
  max-height: min(88vh, 740px);
  display: flex;
  flex-direction: column;
  padding: 20px 22px 14px 22px;
  box-sizing: border-box;
  text-align: right;
  overflow: hidden;
}

.sub-settings-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 4px;
  padding-left: 2px;
  padding-bottom: 24px;
  margin-top: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.sub-settings-scroll-body::-webkit-scrollbar {
  width: 5px;
}
.sub-settings-scroll-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 5px;
}

/* 1. Cinematic Real-time Preview Hero */
.sub-preview-card {
  flex-shrink: 0;
  margin-bottom: 8px;
  background: linear-gradient(180deg, rgba(16, 24, 40, 0.85) 0%, rgba(8, 12, 22, 0.95) 100%);
  border: 1px solid rgba(54, 80, 253, 0.3);
  border-radius: var(--radius-xl);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.sub-preview-cinema-stage {
  position: relative;
  height: 104px;
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse at 50% 30%, #1e293b 0%, #090d16 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.7);
}
.sub-preview-screen-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.5) 100%);
  pointer-events: none;
}
.sub-preview-badge {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.sub-preview-badge i {
  width: 12px;
  height: 12px;
  color: var(--accent-main);
}
.sub-preview-text {
  font-family: var(--sub-font, 'Vazirmatn', sans-serif);
  font-size: var(--sub-font-size, 20px);
  color: var(--sub-color, #fde047);
  background-color: var(--sub-bg, rgba(0, 0, 0, 0.75));
  text-shadow: var(--sub-shadow, 0 2px 5px rgba(0,0,0,0.95));
  padding: 4px 14px;
  border-radius: 6px;
  text-align: center;
  max-width: 92%;
  word-break: break-word;
  line-height: 1.4;
  z-index: 1;
  margin-bottom: 6px;
  transition: margin-bottom 0.15s ease-out, font-size 0.15s ease, background-color 0.2s ease, color 0.2s ease;
}
.sub-preview-sample-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sample-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.sample-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}
.sample-chip.active {
  background: rgba(54, 80, 253, 0.2);
  border-color: var(--accent-main);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(54, 80, 253, 0.3);
}

/* 2. Subtitle Section Cards */
.sub-card-section {
  background: var(--glass-bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 12px 16px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease;
}
.sub-card-section:hover {
  border-color: rgba(255, 255, 255, 0.15);
}
.sub-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}
.sub-section-header i {
  width: 15px;
  height: 15px;
  color: var(--accent-main);
  flex-shrink: 0;
}
.sub-form-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.sub-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.sub-form-group label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.sub-form-group label i {
  width: 13px;
  height: 13px;
  color: var(--theme-badge-color);
  flex-shrink: 0;
}
.label-with-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-glass-select {
  width: 100%;
  height: 38px;
  background: var(--glass-bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0 12px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.custom-glass-select:focus {
  border-color: var(--accent-main);
  box-shadow: 0 0 10px var(--accent-glow);
}

.sub-slider-with-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  background: var(--glass-bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0 8px;
  box-sizing: border-box;
}
.sub-step-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  touch-action: manipulation;
}
.sub-step-btn:hover {
  background: var(--accent-main);
  color: #ffffff;
}
.sub-slider {
  flex: 1;
  accent-color: var(--accent-main);
  cursor: pointer;
}

.color-presets-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
.color-presets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.color-chip {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  touch-action: manipulation;
}
.color-chip:hover {
  transform: scale(1.18);
}
.color-chip.active {
  border-color: #ffffff;
  transform: scale(1.22);
  box-shadow: 0 0 12px currentColor, 0 2px 8px rgba(0, 0, 0, 0.5);
}

.sub-offset-action-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
}
.btn-sub-offset-step {
  flex: 1;
  height: 100%;
  background: var(--glass-bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  touch-action: manipulation;
}
.btn-sub-offset-step:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-main);
}
.btn-sub-offset-reset {
  padding: 0 12px;
  height: 100%;
  background: rgba(54, 80, 253, 0.15);
  border: 1px solid rgba(54, 80, 253, 0.3);
  border-radius: var(--radius-lg);
  color: var(--theme-badge-color);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  touch-action: manipulation;
}
.btn-sub-offset-reset:hover {
  background: rgba(54, 80, 253, 0.28);
  border-color: var(--accent-main);
  color: #ffffff;
}

.modal-footer-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex: 0 0 auto;
}
.btn-sub-reset {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 42px;
  font-size: 12.5px;
  font-weight: 600;
}
.btn-sub-reset i {
  width: 14px;
  height: 14px;
}

/* ====================================================
   FULLSCREEN SUBTITLE MODAL OPTIMIZATION
   ==================================================== */
.custom-player #subtitle-settings-modal:not(.hidden) {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 120 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 10px !important;
  background: rgba(0, 0, 0, 0.72) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  pointer-events: auto !important;
}

#subtitle-settings-modal.hidden {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.custom-player #subtitle-settings-modal:not(.hidden) .subtitle-settings-card {
  width: 90% !important;
  max-width: 500px !important;
  max-height: 94% !important;
  height: auto !important;
  border-radius: var(--radius-2xl) !important;
  margin: auto !important;
  padding: 12px 16px 12px 16px !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
  animation: modalPopCenter 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
  background: rgba(14, 18, 28, 0.94) !important;
}

@keyframes modalPopCenter {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

/* TOAST (SQUAP PILL) */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--theme-badge-border);
  color: var(--text-main);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 999999 !important;
  animation: toastIn 0.25s ease-out;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 15px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* SYNCSTREAM MODERN TOAST CONTAINER & PILLS */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 999999 !important;
}

/* ── 8. Fullscreen Particle FX Canvas ── */
.particle-fx-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99999;
}

/* ── 9. Sticky Pinned Message Banner ── */
.chat-pinned-banner {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
}
.pinned-icon {
  color: var(--accent-main, #3650fd);
  display: flex;
  align-items: center;
}
.pinned-icon i {
  width: 14px;
  height: 14px;
}



/* ── 11. Mobile Gesture HUD & Seek Ripples ── */
.gesture-hud-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}
.gesture-seek-pill {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  color: #fff;
  padding: 12px 18px;
  border-radius: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.gesture-seek-pill.left { left: 15%; }
.gesture-seek-pill.right { right: 15%; }
.gesture-seek-pill.animate-ripple {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}
.gesture-indicator-box {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 20px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}
.gesture-bar-track {
  width: 100px;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
}
.gesture-bar-fill {
  height: 100%;
  background: var(--accent-main, #3650fd);
  border-radius: 4px;
  transition: width 0.05s linear;
}

.syncstream-toast {
  background: rgba(16, 20, 32, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  user-select: none;
  font-family: 'Vazirmatn', sans-serif;
  direction: rtl;
  white-space: nowrap;
}

.syncstream-toast.toast-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.syncstream-toast.toast-hide {
  opacity: 0;
  transform: translateY(-8px) scale(0.95);
}

/* LOBBY ERROR BANNER */
.lobby-error-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  animation: shake 0.35s ease-in-out;
}
.lobby-error-banner i {
  color: #ef4444;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.lobby-error-banner.hidden {
  display: none !important;
}

/* ====================================================
   MOBILE RESPONSIVENESS (Screens <= 860px)
   ==================================================== */
@media (max-width: 860px) {
  /* 1. Login Modal: Full scrollability, safe padding, clean centering */
  #lobby-modal.modal-overlay {
    padding: max(16px, env(safe-area-inset-top)) 14px max(24px, env(safe-area-inset-bottom)) !important;
    align-items: flex-start !important;
    justify-content: center !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  #lobby-modal .modal-card {
    width: 100% !important;
    max-width: 440px !important;
    margin: auto !important;
    padding: 22px 18px !important;
    border-radius: var(--radius-2xl) !important;
    flex-shrink: 0 !important;
  }
  #lobby-modal .brand {
    margin-bottom: 12px !important;
  }
  #lobby-modal .brand-icon {
    width: 44px !important;
    height: 44px !important;
    margin-bottom: 8px !important;
  }
  #lobby-modal .brand-icon i {
    width: 22px !important;
    height: 22px !important;
  }
  #lobby-modal .brand h1 {
    font-size: 19px !important;
  }
  #lobby-modal .brand p {
    font-size: 11.5px !important;
    margin-bottom: 12px !important;
  }

  /* 2. Header: Icon-only for badges and buttons, remove all text */
  .brand-text,
  .tag-title,
  #privacy-text,
  #voice-status-text,
  .room-privacy-badge span,
  .room-host-badge span,
  .btn-voice-pill span {
    display: none !important;
  }

  .room-privacy-badge:not(.hidden),
  .room-host-badge:not(.hidden),
  .btn-voice-pill:not(.hidden) {
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: var(--radius-pill) !important;
  }

  .btn-voice-pill.hidden,
  .app-header .btn-voice-pill.hidden,
  #voice-toggle-btn.hidden,
  .app-header #voice-toggle-btn.hidden {
    display: none !important;
  }

  /* Expand tap target area for mobile fingers without altering visual size */
  .btn-head-icon,
  .room-privacy-badge,
  .room-host-badge,
  .btn-voice-pill,
  .users-counter {
    position: relative !important;
    touch-action: manipulation !important;
  }
  .btn-head-icon::before,
  .room-privacy-badge::before,
  .room-host-badge::before,
  .btn-voice-pill::before,
  .users-counter::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: inherit;
  }

  /* 3. Hide Shortcuts Guide Button on mobile */
  #shortcuts-toggle-btn {
    display: none !important;
  }

  /* 4. Safe Area Insets Header & Horizontal Touch Scrolling */
  .app-header {
    top: max(8px, env(safe-area-inset-top)) !important;
    left: max(8px, env(safe-area-inset-left)) !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    height: 48px !important;
    padding: 0 10px !important;
    gap: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
    white-space: nowrap !important;
    touch-action: pan-x !important;
    -webkit-mask-image: linear-gradient(to right, transparent 0px, transparent 5px, black 22px, black calc(100% - 22px), transparent calc(100% - 5px), transparent 100%) !important;
    mask-image: linear-gradient(to right, transparent 0px, transparent 5px, black 22px, black calc(100% - 22px), transparent calc(100% - 5px), transparent 100%) !important;
  }
  .app-header::-webkit-scrollbar {
    display: none !important;
  }

  .header-left, .header-right {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  .brand-logo {
    font-size: 14px !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
  }
  .brand-logo i {
    width: 17px !important;
    height: 17px !important;
  }

  /* Compact Room Tag on Mobile */
  .app-header .room-tag {
    max-width: none !important;
    padding: 2px 4px !important;
    height: 32px !important;
    gap: 2px !important;
    flex-shrink: 0 !important;
  }
  .app-header .room-tag-action-btn {
    width: 26px !important;
    height: 26px !important;
  }

  /* Compact Voice Toggle Pill on Mobile: hide "ویس" text */
  .app-header .btn-voice-pill:not(.hidden) {
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: var(--radius-pill) !important;
    justify-content: center !important;
    gap: 0 !important;
    flex-shrink: 0 !important;
  }
  .app-header .voice-header-text {
    display: none !important;
  }
  .app-header .btn-voice-pill i {
    margin: 0 !important;
  }



  /* Compact Reclaim Host Button on Mobile: icon only */
  .app-header .btn-reclaim-host {
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: var(--radius-pill) !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }
  .app-header .btn-reclaim-host span {
    display: none !important;
  }
  .app-header .btn-reclaim-host i {
    width: 14px !important;
    height: 14px !important;
    margin: 0 !important;
  }

  /* Compact Users Counter on Mobile */
  .app-header .users-counter {
    padding: 0 8px !important;
    height: 32px !important;
    font-size: 11px !important;
    gap: 3px !important;
    flex-shrink: 0 !important;
  }

  /* Universal 32x32 Head Icons on Mobile */
  .app-header .btn-head-icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    flex-shrink: 0 !important;
  }
  .app-header .btn-head-icon i {
    width: 14px !important;
    height: 14px !important;
  }

  /* Room Status Icons on Mobile: Clean Vector Icons, No Circular Badge */
  .app-header .room-status-icons {
    gap: 5px !important;
  }
  .app-header .room-status-icon,
  .app-header .room-privacy-badge,
  .app-header .room-host-badge {
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 2px !important;
    flex-shrink: 0 !important;
  }
  .app-header .room-status-icon i,
  .app-header .room-privacy-badge i,
  .app-header .room-host-badge i {
    width: 14px !important;
    height: 14px !important;
  }

  /* Mobile Hamburger Menu & Expandable Actions Pill */
  .mobile-menu-trigger {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: var(--radius-pill) !important;
    background: var(--glass-bg-elevated) !important;
    border: 1px solid var(--border-subtle) !important;
    color: var(--text-main) !important;
    cursor: pointer !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    user-select: none !important;
  }
  .mobile-menu-trigger:active {
    transform: scale(0.92) !important;
  }
  .mobile-menu-trigger i {
    width: 15px !important;
    height: 15px !important;
    color: var(--text-main) !important;
  }

  .nav-actions-group.open .mobile-menu-trigger {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
  }

  .nav-pill-drawer {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    max-width: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    background: var(--glass-bg-elevated) !important;
    border: 1px solid transparent !important;
    border-radius: var(--radius-pill) !important;
    height: 32px !important;
    box-sizing: border-box !important;
    transition: max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, padding 0.3s ease, margin 0.3s ease, border-color 0.3s ease !important;
    pointer-events: none !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .nav-actions-group.open .nav-pill-drawer {
    max-width: 90px !important;
    opacity: 1 !important;
    padding: 2px 4px !important;
    margin-left: 3px !important;
    border-color: var(--border-subtle) !important;
    pointer-events: auto !important;
  }

  .nav-pill-drawer .btn-head-icon {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--text-muted) !important;
  }
  .nav-pill-drawer .btn-head-icon::before {
    display: none !important;
  }
  .nav-pill-drawer .btn-head-icon:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
  }
  .nav-pill-drawer .btn-head-icon.danger {
    color: #ef4444 !important;
  }
  .nav-pill-drawer .btn-head-icon.danger:hover {
    background: rgba(239, 68, 68, 0.15) !important;
  }
  .nav-pill-drawer .btn-head-icon i {
    width: 14px !important;
    height: 14px !important;
  }

  .app-header .stage-layout-menu-wrapper {
    flex-shrink: 0 !important;
    position: relative !important;
  }

  /* 5. Mobile Main Layout: Sticky Player & Independent Chat Scrolling */
  .app-main-grid {
    position: fixed !important;
    top: calc(max(8px, env(safe-area-inset-top)) + 52px) !important;
    left: max(8px, env(safe-area-inset-left)) !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    height: calc(100dvh - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom)) - 60px) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    gap: 8px !important;
  }

  /* Cinema Mode Theatre Column & Player (100% v3.97 Standard) */
  body:not(.room-voice) .theatre-column,
  body.room-cinema .theatre-column {
    padding: 0 !important;
    gap: 0 !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    z-index: 10 !important;
    overflow: visible !important;
  }

  .custom-player {
    border-radius: var(--radius-xl) !important;
    aspect-ratio: 16 / 9 !important;
    width: 100% !important;
    height: auto !important;
    max-height: 32vh !important;
    flex: none !important;
  }

  .desktop-media-bar {
    display: none !important;
  }

  /* Hide Playlist Button on Player Controls Bar and Standalone Tab on Mobile */
  #ctrl-playlist-btn,
  #side-tab-playlist-btn {
    display: none !important;
  }

  .mobile-only-tab {
    display: flex !important;
  }
  .mobile-only-tab.hidden,
  body.room-voice .mobile-only-tab,
  body.room-voice #tab-media {
    display: none !important;
  }

  .btn-drawer-side-toggle {
    display: none !important;
  }

  .sidebar-column {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .tab-pane.active {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .chat-tab-wrapper,
  .chat-wrapper {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  #chat-messages {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 6px !important;
  }

  .chat-input-area-wrapper {
    flex-shrink: 0 !important;
  }

  .chat-emoji-tray {
    max-height: 145px !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
  }
  .emoji-tray-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 4px !important;
  }

  /* ============================================================
     Mobile Voice Room: Butter-Smooth GPU-Accelerated Bottom Sheet (v4.14)
     ============================================================ */

  /* Dedicated Right-Side Chevron Toggle Button on Mobile Voice Room */
  body.room-voice .btn-drawer-side-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 36px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  body.room-voice .btn-drawer-side-toggle:hover,
  body.room-voice .btn-drawer-side-toggle:active {
    background: var(--accent-main);
    border-color: var(--accent-main);
    color: #ffffff;
    transform: scale(1.06);
  }
  body.room-voice .btn-drawer-side-toggle i {
    width: 18px;
    height: 18px;
    transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  }
  body.room-voice.voice-drawer-open #voice-tab-chevron {
    transform: rotate(180deg);
  }

  /* 1. STATE COMPACT: Stage takes full viewport down to exactly 6px above the 50px bottom bar */
  body.room-voice:not(.voice-drawer-open) .theatre-column {
    padding: 0 !important;
    gap: 0 !important;
    flex: 1 1 0 !important;
    width: 100% !important;
    height: calc(100dvh - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom)) - 108px) !important;
    max-height: calc(100dvh - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom)) - 108px) !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    z-index: 10 !important;
    transition: height 0.45s cubic-bezier(0.16, 1, 0.3, 1), max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* 2. STATE EXPANDED: Stage clears space for the (70dvh - 15px) drawer with exact 6px gap */
  body.room-voice.voice-drawer-open .theatre-column {
    padding: 0 !important;
    gap: 0 !important;
    flex: 0 0 calc(30dvh + 15px - max(8px, env(safe-area-inset-top)) - 58px) !important;
    width: 100% !important;
    height: calc(30dvh + 15px - max(8px, env(safe-area-inset-top)) - 58px) !important;
    max-height: calc(30dvh + 15px - max(8px, env(safe-area-inset-top)) - 58px) !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    z-index: 10 !important;
    transition: height 0.45s cubic-bezier(0.16, 1, 0.3, 1), max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* Stage & Card Layout in Voice Room */
  body.room-voice #voice-stage {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    gap: 6px !important;
    overflow: hidden !important;
    justify-content: space-between !important;
  }

  body.room-voice .voice-stage-card {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
  }

  body.room-voice .voice-stage-viewport {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
  }

  body.room-voice .voice-stage-viewport .voice-meet-grid {
    height: 100% !important;
    min-height: 0 !important;
    align-content: stretch !important;
    justify-content: stretch !important;
  }

  body.room-voice .meet-user-tile {
    height: 100% !important;
    min-height: 0 !important;
  }

  /* Dedicated Voice Stage Controls Bar: anchored to bottom of stage with exact 6px gap to drawer */
  body.room-voice .voice-stage-controls-bar {
    flex: 0 0 48px !important;
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 8px !important;
    gap: 8px !important;
    z-index: 20 !important;
    background: rgba(18, 20, 30, 0.95) !important;
    backdrop-filter: blur(28px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-pill) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45) !important;
    margin: auto 0 0 0 !important;
  }

  /* GPU-Accelerated Stage Avatars & Grid Transitions */
  body.room-voice .voice-meet-grid {
    transform-origin: center top !important;
    will-change: transform;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), gap 0.45s ease, padding 0.45s ease !important;
    height: 100% !important;
    min-height: 0 !important;
    gap: 6px !important;
  }

  body.room-voice .meet-user-tile {
    will-change: transform;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), border-radius 0.45s ease, box-shadow 0.45s ease, padding 0.45s ease !important;
  }

  body.room-voice .meet-avatar {
    will-change: transform;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  /* FORCED AUTO GRID IN EXPANDED STATE (حالت باز: شبکه خودکار) */
  body.room-voice.voice-drawer-open .voice-stage-viewport .voice-meet-grid {
    display: grid !important;
    gap: 6px !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
  }

  body.room-voice.voice-drawer-open .voice-stage-viewport .voice-meet-grid[data-count="1"] {
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;
  }

  body.room-voice.voice-drawer-open .voice-stage-viewport .voice-meet-grid[data-count="2"] {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr !important;
  }

  body.room-voice.voice-drawer-open .voice-stage-viewport .voice-meet-grid[data-count="3"],
  body.room-voice.voice-drawer-open .voice-stage-viewport .voice-meet-grid[data-count="4"] {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)) !important;
    grid-template-rows: 1fr !important;
  }

  body.room-voice.voice-drawer-open .voice-stage-viewport .voice-meet-grid[data-count="5"],
  body.room-voice.voice-drawer-open .voice-stage-viewport .voice-meet-grid[data-count="6"],
  body.room-voice.voice-drawer-open .voice-stage-viewport .voice-meet-grid[data-count="7"],
  body.room-voice.voice-drawer-open .voice-stage-viewport .voice-meet-grid[data-count="8"],
  body.room-voice.voice-drawer-open .voice-stage-viewport .voice-meet-grid[data-count="9"],
  body.room-voice.voice-drawer-open .voice-stage-viewport .voice-meet-grid[data-count="10"],
  body.room-voice.voice-drawer-open .voice-stage-viewport .voice-meet-grid[data-count="11"],
  body.room-voice.voice-drawer-open .voice-stage-viewport .voice-meet-grid[data-count="12"] {
    grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)) !important;
    grid-template-rows: 1fr !important;
  }

  body.room-voice.voice-drawer-open .meet-user-tile {
    padding: 3px 6px !important;
    border-radius: var(--radius-lg) !important;
  }

  body.room-voice.voice-drawer-open .meet-avatar {
    transform: scale(0.82) !important;
  }

  /* Sidebar Column (GPU-Accelerated Slide-Up Bottom Sheet Drawer) */
  body.room-voice .sidebar-column {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: calc(70dvh - 15px) !important;
    max-height: calc(70dvh - 15px) !important;
    min-height: 0 !important;
    z-index: 50 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background: rgba(14, 16, 24, 0.97) !important;
    backdrop-filter: blur(32px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(32px) saturate(200%) !important;
    border-top: 1px solid var(--border-subtle) !important;
    border-left: 1px solid var(--border-subtle) !important;
    border-right: 1px solid var(--border-subtle) !important;
    border-bottom: none !important;
    border-radius: 22px 22px 0 0 !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5) !important;
    transform: translateY(calc(100% - 50px - env(safe-area-inset-bottom, 0px))) !important;
    will-change: transform;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease !important;
  }

  body.room-voice.voice-drawer-open .sidebar-column {
    transform: translateY(0) !important;
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.75), 0 0 1px rgba(255, 255, 255, 0.2) !important;
  }

  body.room-voice .sidebar-nav-tabs {
    background: rgba(12, 14, 20, 0.98) !important;
    border-bottom: 1px solid transparent !important;
    height: 50px !important;
    padding: 0 10px !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    border-radius: 22px 22px 0 0 !important;
    display: flex !important;
    align-items: center !important;
  }

  body.room-voice.voice-drawer-open .sidebar-nav-tabs {
    border-bottom: 1px solid var(--border-subtle) !important;
  }

  body.room-voice:not(.voice-drawer-open) .sidebar-content-wrapper {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  body.room-voice.voice-drawer-open .sidebar-content-wrapper {
    display: flex !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: calc(100% - 50px) !important;
    overflow: hidden !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }

  /* 7. Mobile Bottom Sheets for Modals */
  .modal-overlay:not(#lobby-modal):not(.hidden) {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    padding: 0 !important;
  }
  .modal-overlay:not(#lobby-modal):not(.hidden) .modal-card,
  .settings-modal-card:not(.hidden),
  .shortcuts-modal-card:not(.hidden),
  .subtitle-settings-card:not(.hidden),
  .room-users-card:not(.hidden) {
    width: 100% !important;
    max-width: 100% !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: var(--radius-2xl) !important;
    border-top-right-radius: var(--radius-2xl) !important;
    max-height: 90dvh !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 16px 16px max(18px, env(safe-area-inset-bottom)) 16px !important;
    animation: bottomSheetSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  @keyframes bottomSheetSlideUp {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
  }

  .modal-overlay:not(#lobby-modal) .modal-title-row {
    flex-shrink: 0 !important;
    margin-bottom: 12px !important;
  }

  .settings-accordion-list,
  .sub-settings-scroll-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    padding-right: 4px !important;
    padding-left: 2px !important;
    padding-bottom: 36px !important;
    margin-top: 4px !important;
  }

  .room-users-list,
  .shortcuts-modal-card .shortcuts-grid {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    padding-bottom: 24px !important;
  }

  .sub-form-row {
    flex-wrap: wrap !important;
  }
  .sub-form-row .sub-form-group {
    flex: 1 1 100% !important;
  }

  .setting-item-row {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .setting-item-info {
    flex: 1 1 180px !important;
    min-width: 140px !important;
  }
  .setting-slider-control {
    gap: 8px !important;
  }
  .setting-slider-control input[type="range"] {
    width: 95px !important;
  }
  .setting-radio-pill-group {
    flex-wrap: wrap !important;
  }
  .settings-hotkeys-mini-table {
    grid-template-columns: 1fr !important;
  }

  body.is-fullscreen {
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }

  /* 8. Fullscreen Floating Dock & Chat in Mobile Landscape */
  body:not(.is-fullscreen) #fullscreen-left-dock,
  .custom-player:not(:fullscreen) #fullscreen-left-dock {
    display: none !important;
  }

  body.is-fullscreen #fullscreen-left-dock,
  .custom-player:fullscreen #fullscreen-left-dock,
  .custom-player:-webkit-full-screen #fullscreen-left-dock {
    display: flex !important;
    top: 28% !important;
    left: max(10px, env(safe-area-inset-left)) !important;
    transform: translateY(-28%) !important;
  }

  .fullscreen-chat-modal-card {
    left: max(10px, env(safe-area-inset-left)) !important;
    bottom: var(--fs-chat-bottom, max(64px, env(safe-area-inset-bottom))) !important;
    top: var(--fs-chat-top, 14px) !important;
  }
  .player-controls-overlay {
    padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
    padding-left: max(12px, env(safe-area-inset-left)) !important;
    padding-right: max(12px, env(safe-area-inset-right)) !important;
  }
}

/* ====================================================
   LANDSCAPE & LOW-HEIGHT VIEWPORT ADAPTATIONS
   ==================================================== */
@media (max-height: 520px), (orientation: landscape) and (max-width: 960px) {
  .modal-overlay:not(#lobby-modal):not(.hidden) {
    align-items: center !important;
    justify-content: center !important;
    padding: 8px !important;
  }
  .modal-overlay:not(#lobby-modal):not(.hidden) .modal-card,
  .settings-modal-card:not(.hidden),
  .shortcuts-modal-card:not(.hidden),
  .subtitle-settings-card:not(.hidden),
  .room-users-card:not(.hidden) {
    width: 92% !important;
    max-width: 500px !important;
    border-radius: var(--radius-2xl) !important;
    max-height: 94vh !important;
    margin: auto !important;
    padding: 10px 16px max(10px, env(safe-area-inset-bottom)) 16px !important;
    animation: modalPopCenter 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  /* Subtitle Settings Landscape Layout */
  .subtitle-settings-card .modal-title-row {
    margin-bottom: 6px !important;
  }
  .subtitle-settings-card .modal-title-row h2 {
    font-size: 13px !important;
  }

  /* Compact Preview Hero in Landscape */
  .subtitle-settings-card .sub-preview-card {
    padding: 4px 8px !important;
    gap: 2px !important;
    margin-bottom: 6px !important;
  }
  .subtitle-settings-card .sub-preview-cinema-stage {
    height: 38px !important;
    padding-bottom: 2px !important;
  }
  .subtitle-settings-card .sub-preview-badge {
    display: none !important;
  }
  .subtitle-settings-card .sub-preview-sample-chips {
    display: none !important;
  }
  .subtitle-settings-card .sub-preview-text {
    font-size: 13.5px !important;
    padding: 2px 10px !important;
    margin-bottom: 2px !important;
  }

  /* Side-by-Side Form Groups in Landscape */
  .subtitle-settings-card .sub-form-row {
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    gap: 10px !important;
  }
  .subtitle-settings-card .sub-form-row .sub-form-group {
    flex: 1 1 50% !important;
  }

  /* Compact Form Sections */
  .subtitle-settings-card .sub-card-section {
    padding: 8px 10px !important;
    gap: 6px !important;
  }
  .subtitle-settings-card .sub-section-header {
    font-size: 11.5px !important;
  }

  /* Compact Inputs & Controls */
  .subtitle-settings-card .custom-glass-select,
  .subtitle-settings-card .sub-slider-with-stepper,
  .subtitle-settings-card .sub-offset-action-row {
    height: 32px !important;
  }
  .subtitle-settings-card .sub-step-btn {
    width: 20px !important;
    height: 20px !important;
    font-size: 12px !important;
  }
  .subtitle-settings-card .color-chip {
    width: 22px !important;
    height: 22px !important;
  }
  .subtitle-settings-card .color-presets-row,
  .subtitle-settings-card .color-presets {
    gap: 6px !important;
  }

  /* Scrollable Body in Landscape */
  .subtitle-settings-card .sub-settings-scroll-body {
    max-height: 56vh !important;
    gap: 6px !important;
    padding-bottom: 8px !important;
  }

  /* Compact Footer Actions */
  .subtitle-settings-card .modal-footer-actions {
    margin-top: 4px !important;
    gap: 6px !important;
  }
  .subtitle-settings-card .modal-footer-actions button {
    height: 34px !important;
    font-size: 11.5px !important;
  }
}

/* ====================================================
   COMPACT MOBILE RESPONSIVENESS (Screens <= 480px)
   ==================================================== */
@media (max-width: 480px) {
  #lobby-modal.modal-overlay {
    padding: max(12px, env(safe-area-inset-top)) 10px max(20px, env(safe-area-inset-bottom)) !important;
  }
  #lobby-modal .modal-card {
    padding: 16px 12px !important;
  }
  .input-group {
    margin-bottom: 10px !important;
    gap: 4px !important;
  }
  .input-group label {
    font-size: 11.5px !important;
  }
  .input-field {
    padding: 7px 12px !important;
  }
  .input-field input {
    font-size: 12.5px !important;
  }
  .field-hint {
    font-size: 9.5px !important;
    line-height: 1.3 !important;
  }
  .room-mode-selector {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .mode-card {
    flex-direction: row !important;
    align-items: center !important;
    text-align: right !important;
    padding: 9px 12px !important;
    gap: 10px !important;
  }
  .mode-card .mode-icon {
    width: 36px !important;
    height: 36px !important;
    flex-shrink: 0 !important;
    margin-bottom: 0 !important;
  }
  .mode-card .mode-info {
    flex: 1 !important;
    text-align: right !important;
  }
  .mode-card .mode-info strong {
    font-size: 12.5px !important;
  }
  .mode-card .mode-info span {
    font-size: 10px !important;
  }
  .mode-card .mode-radio {
    margin-top: 0 !important;
    flex-shrink: 0 !important;
  }
  .btn-primary {
    padding: 10px 14px !important;
    font-size: 13px !important;
  }
  body.room-voice .theatre-column {
    flex: 0 0 44vh !important;
    max-height: 46vh !important;
    min-height: 220px !important;
  }
}

/* ====================================================
   FULLSCREEN DOCKED LEFT CHAT & NON-INTRUSIVE GLASS
   ==================================================== */
.fullscreen-chat-modal-overlay {
  position: absolute !important;
  inset: 0 !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: none !important;
  z-index: 50 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
}

.fullscreen-chat-modal-card {
  position: absolute !important;
  top: var(--fs-chat-top, 14px) !important;
  bottom: var(--fs-chat-bottom, 72px) !important;
  left: 14px !important;
  width: 340px !important;
  max-width: 88vw !important;
  height: auto !important;
  max-height: none !important;
  pointer-events: auto !important;
  background: rgba(10, 11, 16, 0.68) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-2xl) !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  animation: fsChatSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  transition: bottom 0.12s ease-out, top 0.12s ease-out !important;
}

.fullscreen-chat-modal-card.keyboard-open {
  top: 8px !important;
  max-height: calc(100% - 16px) !important;
}
.fullscreen-chat-modal-card.keyboard-open .fs-modal-header {
  padding: 6px 12px !important;
}
.fullscreen-chat-modal-card.keyboard-open .fs-modal-chat-messages {
  padding: 6px 10px !important;
}
.fullscreen-chat-modal-card.keyboard-open .fs-modal-chat-form {
  padding: 6px 10px !important;
}

@keyframes fsChatSlideIn {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Fullscreen Horizontal Scrollable Single-Row Emoji Strip */
.chat-emojis-scroll {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 6px 10px !important;
  background: rgba(0, 0, 0, 0.25) !important;
  border-top: 1px solid var(--border-subtle) !important;
  flex-shrink: 0 !important;
}
.chat-emojis-scroll::-webkit-scrollbar { height: 3px !important; }
.chat-emojis-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15) !important; border-radius: 4px !important; }

.fs-emoji {
  flex-shrink: 0 !important;
  width: 30px !important;
  height: 30px !important;
  font-size: 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: transform 0.15s ease, background 0.15s ease !important;
}
.fs-emoji:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  transform: scale(1.15) !important;
}

/* Volume HUD Overlay */
.volume-hud {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  background: rgba(10, 12, 18, 0.85) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-2xl) !important;
  padding: 14px 22px !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  color: white !important;
  z-index: 45 !important;
  pointer-events: none !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7) !important;
  transition: opacity 0.25s ease, transform 0.25s ease !important;
}

.volume-hud-bar {
  width: 110px !important;
  height: 6px !important;
  background: rgba(255, 255, 255, 0.2) !important;
  border-radius: 9999px !important;
  overflow: hidden !important;
  direction: ltr !important;
}

.volume-hud-fill {
  height: 100% !important;
  width: 100%;
  background: var(--accent-main) !important;
  box-shadow: 0 0 8px var(--accent-glow) !important;
  border-radius: 9999px !important;
  transition: width 0.12s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.volume-hud-text {
  font-size: 14px !important;
  font-weight: 700 !important;
  min-width: 42px !important;
  text-align: right !important;
  font-variant-numeric: tabular-nums !important;
}

/* Fullscreen Left Chat Button & Modal Hide Overrides */
.fullscreen-chat-trigger-btn.hidden,
.fullscreen-chat-modal-overlay.hidden,
.volume-hud.hidden {
  display: none !important;
}

/* ============================================================
   ROOM MODE SELECTOR (LOBBY MODAL)
   ============================================================ */
.room-mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}
.mode-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}
.mode-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}
.mode-card.active {
  background: linear-gradient(135deg, rgba(54, 80, 253, 0.18), rgba(99, 102, 241, 0.1));
  border-color: var(--accent-main);
  box-shadow: 0 0 16px rgba(54, 80, 253, 0.25), inset 0 0 12px rgba(54, 80, 253, 0.1);
}
.mode-card .mode-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.mode-card.active .mode-icon {
  background: var(--accent-main);
  color: #ffffff;
  box-shadow: 0 0 12px var(--accent-glow);
}
.mode-card .mode-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mode-card .mode-info strong {
  font-size: 13px;
  color: var(--text-primary);
}
.mode-card .mode-info span {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.3;
}
.mode-card .mode-radio {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: all 0.2s;
}
.mode-card.active .mode-radio {
  border-color: var(--accent-main);
}
.mode-card.active .radio-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-main);
  box-shadow: 0 0 6px var(--accent-glow);
}

/* ============================================================
   VOICE STUDIO STAGE (GOOGLE MEET DYNAMIC GRID & OVERFLOW)
   ============================================================ */
.voice-stage {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  gap: 15px;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
  position: relative;
}
.voice-stage-card {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  border-radius: 0 !important;
  overflow: hidden;
  position: relative;
  box-shadow: none !important;
  padding: 0 !important;
  justify-content: flex-start;
  box-sizing: border-box;
}
.voice-stage-header {
  display: none !important;
}

/* STAGE VIEWPORT (Main 8-Slot Grid + Overflow Sidebar) */
.voice-stage-viewport {
  flex: 1;
  display: flex;
  gap: 12px;
  min-height: 0;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow: hidden;
  width: 100%;
}

/* DYNAMIC MEET GRID (1 TO 12 SLOTS) */
.voice-meet-grid {
  flex: 1;
  display: grid;
  gap: 10px;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  align-items: center;
  justify-content: center;
}

/* 1 Participant: Full-Stage Google Meet Tile */
.voice-meet-grid[data-count="1"] {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}
.voice-meet-grid[data-count="1"] .meet-tile {
  width: 100%;
  height: 100%;
}
.voice-meet-grid[data-count="1"] .meet-avatar {
  width: 104px;
  height: 104px;
  font-size: 42px;
}

/* 2 Participants: 2 Split Tiles */
.voice-meet-grid[data-count="2"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}
.voice-meet-grid[data-count="2"] .meet-avatar {
  width: 82px;
  height: 82px;
  font-size: 32px;
}

/* 3 or 4 Participants: 2x2 Grid */
.voice-meet-grid[data-count="3"],
.voice-meet-grid[data-count="4"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.voice-meet-grid[data-count="3"] .meet-avatar,
.voice-meet-grid[data-count="4"] .meet-avatar {
  width: 70px;
  height: 70px;
  font-size: 26px;
}

/* 5 or 6 Participants: 3x2 Grid */
.voice-meet-grid[data-count="5"],
.voice-meet-grid[data-count="6"] {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr 1fr;
}
.voice-meet-grid[data-count="5"] .meet-avatar,
.voice-meet-grid[data-count="6"] .meet-avatar {
  width: 58px;
  height: 58px;
  font-size: 22px;
}

/* 7 or 8 Participants: 4x2 Grid */
.voice-meet-grid[data-count="7"],
.voice-meet-grid[data-count="8"] {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1fr 1fr;
}
.voice-meet-grid[data-count="7"] .meet-avatar,
.voice-meet-grid[data-count="8"] .meet-avatar {
  width: 50px;
  height: 50px;
  font-size: 19px;
}

/* 9 to 12 Participants: 4x3 Grid */
.voice-meet-grid[data-count="9"],
.voice-meet-grid[data-count="10"],
.voice-meet-grid[data-count="11"],
.voice-meet-grid[data-count="12"] {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
}
.voice-meet-grid[data-count="9"] .meet-avatar,
.voice-meet-grid[data-count="10"] .meet-avatar,
.voice-meet-grid[data-count="11"] .meet-avatar,
.voice-meet-grid[data-count="12"] .meet-avatar {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

/* MEET PARTICIPANT TILE */
.meet-tile {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 90px;
  background: rgba(16, 20, 30, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.meet-tile:hover {
  background: rgba(22, 28, 42, 0.9);
  border-color: rgba(255, 255, 255, 0.18);
}
.meet-tile.is-speaking {
  border-color: #22c55e !important;
  box-shadow: 0 0 22px rgba(34, 197, 94, 0.32), inset 0 0 16px rgba(34, 197, 94, 0.06);
}

/* Pin Badge on Meet Tile & Overflow Chip */
.meet-pin-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(54, 80, 253, 0.3);
  border: 1px solid rgba(99, 102, 241, 0.6);
  color: #c7d2fe;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 700;
  z-index: 10;
  box-shadow: 0 0 12px rgba(54, 80, 253, 0.4);
  backdrop-filter: blur(8px);
}
.meet-pin-badge i {
  width: 12px;
  height: 12px;
  transform: rotate(35deg);
  color: #818cf8;
}
.overflow-pin-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--accent-main);
  color: white;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow: 0 0 6px var(--accent-glow);
}
.overflow-pin-badge i { width: 10px; height: 10px; transform: rotate(35deg); }

/* Centered Avatar in Meet Tile */
.meet-avatar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.meet-avatar {
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: white;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 2;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  user-select: none;
}
.meet-avatar img,
.meet-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* User Muted: Dimmed profile */
.meet-tile.user-muted .meet-avatar {
  opacity: 0.65;
  filter: grayscale(15%);
  border-color: rgba(255, 255, 255, 0.1);
}
.overflow-user-chip.user-muted .overflow-avatar {
  opacity: 0.65;
  filter: grayscale(15%);
}

/* Speaking Halo Glow: Bright Pulsing Waves around Avatar (Green for Open Audio) */
.meet-tile.is-speaking {
  border-color: #22c55e !important;
  box-shadow: 0 0 24px rgba(34, 197, 94, 0.35), inset 0 0 16px rgba(34, 197, 94, 0.08) !important;
}
.meet-tile.is-speaking .meet-avatar {
  opacity: 1 !important;
  filter: none !important;
  border-color: #22c55e !important;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.28), 0 0 24px rgba(34, 197, 94, 0.75) !important;
  transform: scale(1.08) !important;
}
.meet-avatar-pulse-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  pointer-events: none;
  transition: all 0.2s ease;
}
.meet-tile.is-speaking .meet-avatar-pulse-ring {
  border-color: rgba(34, 197, 94, 0.85);
  animation: meetSpeakingWave 1.3s infinite ease-out;
}
@keyframes meetSpeakingWave {
  0% { transform: scale(0.95); opacity: 0.9; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  65% { transform: scale(1.35); opacity: 0.4; box-shadow: 0 0 18px 4px rgba(34, 197, 94, 0.3); }
  100% { transform: scale(1.55); opacity: 0; }
}

/* Locally Muted Speaking: Bright ORANGE Halo Glow 🟠 */
.meet-tile.is-speaking.locally-muted-speaking {
  border-color: #f97316 !important;
  box-shadow: 0 0 24px rgba(249, 115, 22, 0.45), inset 0 0 16px rgba(249, 115, 22, 0.1) !important;
}
.meet-tile.is-speaking.locally-muted-speaking .meet-avatar {
  border-color: #f97316 !important;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.3), 0 0 24px rgba(249, 115, 22, 0.85) !important;
}
.meet-tile.is-speaking.locally-muted-speaking .meet-avatar-pulse-ring {
  border-color: rgba(249, 115, 22, 0.9) !important;
  animation: meetSpeakingWaveOrange 1.3s infinite ease-out !important;
}
@keyframes meetSpeakingWaveOrange {
  0% { transform: scale(0.95); opacity: 0.9; box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.7); }
  65% { transform: scale(1.35); opacity: 0.4; box-shadow: 0 0 18px 4px rgba(249, 115, 22, 0.35); }
  100% { transform: scale(1.55); opacity: 0; }
}

.overflow-user-chip.is-speaking.locally-muted-speaking {
  border-color: #f97316 !important;
  box-shadow: 0 0 14px rgba(249, 115, 22, 0.5) !important;
}
.fs-speaker-chip.locally-muted-speaking {
  border-color: #f97316 !important;
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.7) !important;
}

/* Meet Tile Bottom User Footer */
.meet-tile-footer {
  position: absolute;
  bottom: 8px;
  right: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
  z-index: 5;
}
.meet-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(10, 12, 18, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #f8fafc;
  max-width: calc(100% - 32px);
  min-width: 0;
}
.meet-user-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  max-width: 100px;
  vertical-align: middle;
}
.local-mute-tag {
  color: #f87171;
  font-size: 10px;
  margin-right: 2px;
}

.meet-status-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(10, 12, 18, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.2s ease;
}
.meet-status-indicator i {
  width: 13px;
  height: 13px;
}

/* Open Mic: Greenish glow */
.meet-status-indicator.unmuted {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.4);
}

/* Muted: Dimmed mic with slash */
.meet-status-indicator.muted {
  background: rgba(255, 255, 255, 0.07);
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.15);
}

/* Locally Muted by Me: Red Pill Badge with 'Muted' text */
.meet-status-indicator.locally-muted {
  width: auto !important;
  padding: 2px 7px !important;
  border-radius: var(--radius-pill) !important;
  background: rgba(239, 68, 68, 0.95) !important;
  color: #ffffff !important;
  border: 1px solid #fca5a5 !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5) !important;
  gap: 4px;
}
.status-muted-pill {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #ffffff;
  text-transform: uppercase;
}

.voice-local-muted-badge {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  margin-right: 4px;
  text-transform: uppercase;
}

/* Mini Equalizer animation */
.mini-equalizer {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  width: 14px;
}
.meet-tile.is-speaking .mini-equalizer {
  display: inline-flex;
}
.mini-bar {
  width: 2.5px;
  background: #22c55e;
  border-radius: 1px;
  animation: eqBounce 0.8s infinite ease-in-out;
}
.mini-bar:nth-child(1) { height: 45%; animation-delay: 0.1s; }
.mini-bar:nth-child(2) { height: 100%; animation-delay: 0.3s; }
.mini-bar:nth-child(3) { height: 60%; animation-delay: 0.2s; }
@keyframes eqBounce {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

/* OVERFLOW STRIP (For 9+ Participants) */
.voice-stage-overflow-strip {
  width: 110px;
  display: flex;
  flex-direction: column;
  background: rgba(10, 12, 18, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 8px 6px;
  gap: 8px;
  flex-shrink: 0;
  min-height: 0;
}
.overflow-strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 2px 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.overflow-count-badge {
  background: var(--accent-main);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 9999px;
  font-weight: 700;
}
.overflow-strip-scroll {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 2px;
}
.overflow-strip-scroll::-webkit-scrollbar {
  width: 4px;
}
.overflow-strip-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
}
.overflow-user-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 8px 4px;
  position: relative;
  transition: all 0.2s ease;
  text-align: center;
}
.overflow-user-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}
.overflow-user-chip.is-speaking {
  border-color: #22c55e !important;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.1);
}
.overflow-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: white;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  position: relative;
}
.overflow-user-chip.is-speaking .overflow-avatar {
  border-color: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}
.overflow-mute-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ef4444;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  border: 1.5px solid #0f172a;
}
.overflow-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-stage-controls-bar {
  flex: 0 0 auto;
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  box-shadow: var(--glass-shadow);
  padding: 0 18px;
  height: 54px;
  min-height: 54px;
  display: flex;
  direction: ltr;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  z-index: 10;
}

.btn-stage-action {
  height: 34px;
  min-width: 40px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s;
  box-sizing: border-box;
  outline: none;
}

.btn-stage-action:hover {
  border-color: var(--accent-main);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.btn-stage-action i {
  width: 15px;
  height: 15px;
  color: var(--theme-badge-color);
  flex-shrink: 0;
}

/* Primary / Mic State */
.btn-stage-action.primary {
  background: var(--glass-bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}
.btn-stage-action.primary:hover {
  border-color: var(--accent-main);
  background: rgba(255, 255, 255, 0.08);
}
.btn-stage-action.primary i {
  color: var(--theme-badge-color);
}

.btn-stage-action.primary.muted {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: var(--accent-red) !important;
}
.btn-stage-action.primary.muted:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: var(--accent-red) !important;
}
.btn-stage-action.primary.muted i {
  color: var(--accent-red) !important;
}

/* Active Screen Share State */
.btn-stage-action.screen-active {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: var(--accent-red) !important;
}
.btn-stage-action.screen-active:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: var(--accent-red) !important;
}
.btn-stage-action.screen-active i {
  color: var(--accent-red) !important;
}

/* Active Camera State */
.btn-stage-action.camera-active {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  color: #10b981 !important;
}
.btn-stage-action.camera-active:hover {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: #10b981 !important;
}
.btn-stage-action.camera-active i {
  color: #10b981 !important;
}

/* Hand Raised State */
.btn-stage-action.hand-raised {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  color: #fbbf24 !important;
}
.btn-stage-action.hand-raised:hover {
  background: rgba(245, 158, 11, 0.28) !important;
  border-color: #fbbf24 !important;
}
.btn-stage-action.hand-raised i {
  color: #fbbf24 !important;
}

.btn-stage-action.secondary {
  background: var(--glass-bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}
.btn-stage-action.secondary:hover {
  border-color: var(--accent-main);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.btn-stage-action.danger {
  background: var(--glass-bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}
.btn-stage-action.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--accent-red);
  color: var(--accent-red);
}
.stage-noise-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================================
   MEET TILE 3-DOTS OPTIONS & FLOATING USER CONTROLS POPOVER
   ============================================================ */
.meet-tile-options-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(10, 12, 18, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 25;
  opacity: 0.7;
  outline: none;
  touch-action: manipulation;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s ease;
}
.meet-tile:hover .meet-tile-options-btn,
.overflow-user-chip:hover .meet-tile-options-btn {
  opacity: 1;
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.95);
  border-color: var(--accent-main);
  box-shadow: 0 0 10px rgba(54, 80, 253, 0.3);
}
@media (hover: none) {
  .meet-tile-options-btn {
    opacity: 0.85;
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(255, 255, 255, 0.22);
    color: var(--text-main);
  }
}
.meet-tile-options-btn:focus,
.meet-tile-options-btn:focus-visible {
  outline: none;
  box-shadow: none;
}
.meet-tile-options-btn.active {
  opacity: 1;
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.95);
  border-color: var(--accent-main);
  box-shadow: 0 0 10px rgba(54, 80, 253, 0.3);
}
.meet-tile-options-btn i {
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.overflow-user-chip .meet-tile-options-btn {
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
}
.overflow-user-chip .meet-tile-options-btn i {
  width: 11px;
  height: 11px;
}

/* FLOATING USER CONTROL POPOVER */
.meet-user-popover {
  position: absolute;
  top: 40px;
  left: 10px;
  width: 230px;
  background: rgba(13, 17, 26, 0.95);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 40;
  text-align: right;
  animation: popoverFadeIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}
@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.popover-user-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.popover-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.popover-close-btn:hover { color: #f87171; }
.popover-close-btn i { width: 13px; height: 13px; }

/* VOLUME SLIDER SECTION */
.popover-vol-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 8px 10px;
  border-radius: var(--radius-lg);
}
.popover-vol-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
}
.popover-vol-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-main);
  background: rgba(54, 80, 253, 0.15);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}
.popover-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  outline: none;
  cursor: pointer;
  direction: ltr;
  transition: background 0.1s ease;
}
.popover-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid var(--accent-main);
  box-shadow: 0 0 10px var(--accent-glow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.popover-vol-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  box-shadow: 0 0 14px var(--accent-glow);
}

/* POPOVER ACTION BUTTONS */
.popover-actions-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.popover-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  text-align: right;
}
.popover-action-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.1);
}
.popover-action-btn.active {
  background: rgba(54, 80, 253, 0.15);
  color: #818cf8;
  border-color: rgba(54, 80, 253, 0.3);
}
.popover-action-btn.danger-action {
  color: #f87171;
}
.popover-action-btn.danger-action:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}
.popover-action-btn i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ============================================================
   SCREEN SHARE VIEWER & STAGE SPOTLIGHT
   ============================================================ */
.screen-share-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 72vh;
  background: #080a10;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.25s ease-out;
  margin-bottom: 12px;
}
.screen-share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(10, 12, 18, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 10;
}
.screen-sharer-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}
.screen-sharer-info strong {
  color: #60a5fa;
  font-weight: 700;
}
.screen-sharer-info i {
  width: 15px;
  height: 15px;
  color: var(--accent-main);
}
.screen-quality-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(68, 92, 254, 0.2);
  border: 1px solid rgba(68, 92, 254, 0.4);
  color: #93c5fd;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 6px;
}
.screen-quality-badge.fps-60 {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(239, 68, 68, 0.25));
  border-color: rgba(245, 158, 11, 0.5);
  color: #fde047;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}
.screen-share-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-screen-control {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-screen-control:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}
.btn-screen-control.close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}
.btn-screen-control i {
  width: 14px;
  height: 14px;
}
.screen-share-viewport {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  position: relative;
}
#screen-share-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* FULLSCREEN SCREEN SHARE RULES (Fixes infinite repeating header bug) */
.screen-share-wrapper:fullscreen,
.screen-share-wrapper:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  aspect-ratio: auto !important;
  border-radius: 0 !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #000000 !important;
  box-shadow: none !important;
}

.screen-share-wrapper:fullscreen .screen-share-header,
.screen-share-wrapper:-webkit-full-screen .screen-share-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(10, 12, 18, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 50;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.screen-share-wrapper:fullscreen:hover .screen-share-header,
.screen-share-wrapper:-webkit-full-screen:hover .screen-share-header {
  opacity: 1;
}

.screen-share-wrapper:fullscreen .screen-share-viewport,
.screen-share-wrapper:-webkit-full-screen .screen-share-viewport {
  width: 100vw !important;
  height: 100vh !important;
  background: #000000 !important;
}

.screen-share-wrapper:fullscreen #screen-share-video,
.screen-share-wrapper:-webkit-full-screen #screen-share-video {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  object-fit: contain !important;
}

/* Screen Share button active states */
.btn-stage-action.screen-active,
.btn-action-icon.screen-active {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: #ef4444 !important;
  color: #f87171 !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.35) !important;
}

/* STREAM 3-DOTS OPTIONS POPOVER */
.stream-options-popover {
  position: absolute;
  top: 44px;
  left: 14px;
  width: 220px;
  background: rgba(13, 17, 26, 0.96);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999999;
  text-align: right;
  animation: popoverFadeIn 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
  direction: rtl;
}

/* SCREEN SHARE PAUSE BLUR OVERLAY */
.screen-pause-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 16, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  cursor: pointer;
  animation: fadeIn 0.2s ease-out;
  user-select: none;
}
.screen-pause-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 20px 28px;
  background: rgba(18, 22, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-2xl);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 30px rgba(68, 92, 254, 0.2);
  transform: scale(1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.screen-pause-overlay:hover .screen-pause-card {
  transform: scale(1.04);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.7), 0 0 40px rgba(68, 92, 254, 0.35);
}
.screen-pause-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-main), #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0 20px rgba(68, 92, 254, 0.5);
  margin-bottom: 4px;
}
.screen-pause-icon-circle i {
  width: 24px;
  height: 24px;
}
.screen-pause-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}
.screen-pause-card p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}


/* ============================================================
   MEET SCREEN SHARE TILE (IN-GRID STREAM VIEWER)
   ============================================================ */
.meet-screen-share-tile {
  position: relative;
  background: #06080e !important;
  border: 1.5px solid rgba(68, 92, 254, 0.45) !important;
  box-shadow: 0 0 24px rgba(68, 92, 254, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ============================================================
   ELEGANT STREAM PAUSE STATE (MINIMALIST & PROFESSIONAL)
   ============================================================ */
@keyframes centerBadgeFadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.meet-screen-share-tile.is-stream-paused {
  border: 2px solid #f59e0b !important;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.45), inset 0 0 15px rgba(245, 158, 11, 0.15) !important;
  outline: none !important;
  animation: none !important;
}

.meet-screen-share-tile.is-stream-paused .meet-screen-video {
  filter: brightness(0.65) saturate(0.85);
  transition: filter 0.3s ease;
}

.stream-paused-banner-tag {
  display: none;
  align-items: center;
  gap: 5px;
  background: rgba(245, 158, 11, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fbbf24;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(245, 158, 11, 0.35);
  pointer-events: auto;
  animation: popoverFadeIn 0.2s ease-out;
}
.stream-paused-banner-tag i {
  width: 12px;
  height: 12px;
  color: #f59e0b;
}
.meet-screen-share-tile.is-stream-paused .stream-paused-banner-tag {
  display: inline-flex;
}

/* Subtle Centered Paused Glass Badge */
.stream-center-paused-badge {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) !important;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 24px rgba(245, 158, 11, 0.2);
  color: #fef3c7;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  z-index: 15;
  pointer-events: none !important;
  user-select: none !important;
  animation: centerBadgeFadeIn 0.2s ease-out;
  margin: 0 !important;
}
.stream-center-paused-badge i {
  width: 15px;
  height: 15px;
  color: #f59e0b;
}
.meet-screen-share-tile.is-stream-paused .stream-center-paused-badge {
  display: inline-flex;
}

.meet-screen-share-tile .meet-screen-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  z-index: 1;
  background: #000;
}
.meet-screen-top-bar {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  pointer-events: none;
}
.meet-screen-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 14, 22, 0.84);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #93c5fd;
  pointer-events: auto;
}
.meet-screen-title-badge i {
  width: 13px;
  height: 13px;
  color: var(--accent-main);
}
.meet-screen-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: auto;
}
.btn-screen-tile-ctrl {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(10, 14, 22, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-screen-tile-ctrl:hover {
  background: rgba(255, 255, 255, 0.16);
  color: white;
  transform: scale(1.1);
}
.btn-screen-tile-ctrl.active {
  background: var(--accent-main) !important;
  color: white !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 0 12px rgba(68, 92, 254, 0.6) !important;
}
.btn-screen-tile-ctrl i {
  width: 13px;
  height: 13px;
}

/* ============================================================
   GOOGLE MEET MULTI-LAYOUT STAGE GRID SYSTEM
   ============================================================ */
.stage-layout-menu-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}
body:not(.room-voice) .stage-layout-menu-wrapper {
  display: none !important;
}
body.room-voice .stage-layout-menu-wrapper {
  display: inline-flex !important;
}

#stage-layout-btn.active {
  border-color: var(--accent-main);
  background: rgba(68, 92, 254, 0.2) !important;
  color: #93c5fd !important;
  box-shadow: 0 0 10px var(--accent-glow);
}

.stage-layout-popover {
  position: fixed;
  width: 240px;
  max-width: calc(100vw - 20px);
  background: rgba(13, 17, 26, 0.96);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 999999;
  text-align: right;
  animation: popoverFadeIn 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  direction: rtl;
}
.layout-popover-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 2px 6px 6px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2px;
}
.layout-popover-header i {
  width: 13px;
  height: 13px;
  color: var(--accent-main);
}
.layout-options-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.layout-option-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  text-align: right;
  font-family: inherit;
}
.layout-option-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}
.layout-option-btn.active {
  background: rgba(68, 92, 254, 0.16);
  border-color: rgba(68, 92, 254, 0.35);
  color: #93c5fd;
}
.layout-opt-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.layout-option-btn.active .layout-opt-icon {
  background: var(--accent-main);
  color: white;
}
.layout-opt-icon i {
  width: 15px;
  height: 15px;
}
.layout-opt-info {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.layout-opt-info strong {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
}
.layout-check-icon {
  width: 14px;
  height: 14px;
  color: var(--accent-main);
  opacity: 0;
  flex-shrink: 0;
}
.layout-option-btn.active .layout-check-icon {
  opacity: 1;
}

/* ============================================================
   THE 5 STAGE LAYOUTS ENGINE (ROBUST & NO HALF-SCREEN CUTS)
   ============================================================ */

/* LAYOUT 1: Auto Grid */
.voice-stage-viewport.layout-auto .voice-meet-grid {
  display: grid;
  gap: 10px;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  justify-content: center;
  align-content: center;
}
.voice-stage-viewport.layout-auto .voice-meet-grid[data-count="1"] {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}
.voice-stage-viewport.layout-auto .voice-meet-grid[data-count="2"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}
.voice-stage-viewport.layout-auto .voice-meet-grid[data-count="3"],
.voice-stage-viewport.layout-auto .voice-meet-grid[data-count="4"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.voice-stage-viewport.layout-auto .voice-meet-grid[data-count="5"],
.voice-stage-viewport.layout-auto .voice-meet-grid[data-count="6"] {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr 1fr;
}
.voice-stage-viewport.layout-auto .voice-meet-grid[data-count="7"],
.voice-stage-viewport.layout-auto .voice-meet-grid[data-count="8"] {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1fr 1fr;
}
.voice-stage-viewport.layout-auto .voice-meet-grid[data-count="9"],
.voice-stage-viewport.layout-auto .voice-meet-grid[data-count="10"],
.voice-stage-viewport.layout-auto .voice-meet-grid[data-count="11"],
.voice-stage-viewport.layout-auto .voice-meet-grid[data-count="12"] {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

/* LAYOUT 2: Sidebar Spotlight */
.voice-stage-viewport.layout-sidebar .voice-meet-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  grid-template-rows: 1fr;
  gap: 10px;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  align-items: stretch;
}
.voice-stage-viewport.layout-sidebar .meet-tile.spotlight-tile {
  grid-column: 1;
  grid-row: 1;
  height: 100%;
  width: 100%;
  min-height: 0;
  min-width: 0;
}
.voice-stage-viewport.layout-sidebar .stage-side-column {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
  min-height: 0;
  width: 100%;
}
.voice-stage-viewport.layout-sidebar .stage-side-column .meet-tile {
  height: 120px;
  min-height: 100px;
  width: 100%;
  flex-shrink: 0;
}

/* LAYOUT 3: Spotlight & Bottom Strip */
.voice-stage-viewport.layout-spotlight .voice-meet-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
}
.voice-stage-viewport.layout-spotlight .meet-tile.spotlight-tile {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  height: 100%;
}
.voice-stage-viewport.layout-spotlight .stage-bottom-strip {
  flex: 0 0 94px;
  height: 94px;
  display: flex;
  flex-direction: row;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  min-height: 0;
  padding-bottom: 2px;
}
.voice-stage-viewport.layout-spotlight .stage-bottom-strip .meet-tile {
  width: 120px;
  height: 100%;
  flex-shrink: 0;
}

/* LAYOUT 4: Solo / Focus Mode */
.voice-stage-viewport.layout-focus .voice-meet-grid {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
}
.voice-stage-viewport.layout-focus .meet-tile.spotlight-tile {
  width: 100%;
  height: 100%;
  min-height: 0;
}
.voice-stage-viewport.layout-focus .meet-tile:not(.spotlight-tile) {
  display: none !important;
}

/* LAYOUT 5: Split View (2-Columns) */
.voice-stage-viewport.layout-split .voice-meet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  gap: 10px;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
}
.voice-stage-viewport.layout-split .voice-meet-grid:has(.stage-bottom-strip) {
  grid-template-rows: 1fr 84px;
}
.voice-stage-viewport.layout-split .meet-tile {
  height: 100%;
  width: 100%;
  min-height: 0;
  min-width: 0;
}
.voice-stage-viewport.layout-split .stage-bottom-strip {
  grid-column: 1 / -1;
  height: 84px;
  display: flex;
  flex-direction: row;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 0;
  width: 100%;
}
.voice-stage-viewport.layout-split .stage-bottom-strip .meet-tile {
  width: 110px;
  height: 100%;
  flex-shrink: 0;
}

/* Mobile Adjustments for Stage Layouts */
@media (max-width: 768px) {
  .voice-stage-viewport.layout-sidebar .voice-meet-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 90px;
  }
  .voice-stage-viewport.layout-sidebar .stage-side-column {
    grid-column: 1;
    grid-row: 2;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    height: 90px;
  }
  .voice-stage-viewport.layout-sidebar .stage-side-column .meet-tile {
    width: 100px;
    height: 100%;
  }
  .voice-stage-viewport.layout-split .voice-meet-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
  .stage-layout-popover {
    position: fixed !important;
    width: 240px !important;
    max-width: calc(100vw - 20px) !important;
    z-index: 999999 !important;
  }
}

/* ============================================================
   HOST PERMISSIONS & MODERATION STYLES
   ============================================================ */
.app-header .room-host-badge,
.room-status-icons .room-host-badge {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  padding: 0 2px !important;
  color: #fbbf24 !important;
  cursor: pointer !important;
}
.app-header .room-host-badge:hover,
.room-status-icons .room-host-badge:hover {
  background: transparent !important;
  transform: scale(1.18);
}
.app-header .room-host-badge i,
.room-status-icons .room-host-badge i {
  width: 16px !important;
  height: 16px !important;
  color: #fbbf24 !important;
  filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.5));
}

.btn-reclaim-host {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.22), rgba(245, 158, 11, 0.32));
  border: 1px solid rgba(234, 179, 8, 0.55);
  color: #fef08a;
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.25);
  transition: all 0.15s ease;
  animation: fadeIn 0.2s ease-out;
}
.btn-reclaim-host:hover {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.38), rgba(245, 158, 11, 0.55));
  border-color: #facc15;
  color: #ffffff;
  transform: scale(1.05);
}
.btn-reclaim-host.hidden {
  display: none !important;
}
.btn-reclaim-host i {
  width: 13px;
  height: 13px;
  color: #facc15;
}

/* Host Lock Switch */
.host-switch {
  border-color: rgba(245, 158, 11, 0.3) !important;
}
.host-slider {
  background-color: rgba(245, 158, 11, 0.2) !important;
}
input:checked + .host-slider {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5) !important;
}

/* Mute All Button */
.btn-stage-action.danger-mute-all {
  background: var(--glass-bg-elevated);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
}
.btn-stage-action.danger-mute-all:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* Crown Icon on Tiles & Lists */
.host-crown-inline {
  color: #fbbf24;
  margin-right: 4px;
  display: inline-flex;
  vertical-align: middle;
}
.host-crown-inline i {
  width: 13px;
  height: 13px;
}

/* Popover Host Actions */
.popover-action-btn.host-transfer {
  color: #fbbf24;
}
.popover-action-btn.host-transfer:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}
.popover-action-btn.host-kick {
  color: #ef4444;
}
.popover-action-btn.host-kick:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

/* User List Item 3-Dots Button */
.user-item-options-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: auto;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.user-item-options-btn:hover {
  background: rgba(54, 80, 253, 0.2);
  border-color: var(--accent-main);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(54, 80, 253, 0.3);
}
.user-item-options-btn:focus,
.user-item-options-btn:focus-visible {
  outline: none;
  box-shadow: none;
}
.user-item-options-btn.active {
  background: rgba(54, 80, 253, 0.2);
  border-color: var(--accent-main);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(54, 80, 253, 0.3);
}
.user-item-options-btn i {
  width: 14px;
  height: 14px;
}
.room-user-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================================
   SCREEN SHARE CONFIGURATION MODAL (Discord-Style)
   ============================================================ */
.screen-config-card {
  max-width: 480px;
  width: 95%;
  background: rgba(14, 18, 27, 0.95);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-2xl);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.screen-config-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 6px 0 16px;
}

.screen-config-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.config-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.config-section-label i {
  width: 16px;
  height: 16px;
  color: var(--accent-main);
}

/* FPS GRID SELECTOR */
.fps-grid-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.fps-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 12px 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  user-select: none;
}

.fps-card input[type="radio"] {
  display: none;
}

.fps-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.fps-card.active {
  background: linear-gradient(145deg, rgba(68, 92, 254, 0.18), rgba(99, 102, 241, 0.08));
  border-color: var(--accent-main);
  box-shadow: 0 0 16px rgba(68, 92, 254, 0.25);
}

.fps-card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.fps-badge {
  font-size: 13px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.5px;
}

.fps-badge.ultra {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.fps-badge.smooth {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.fps-badge.eco {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.fps-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.fps-desc {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* RESOLUTION TOGGLE GROUP */
.res-toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.res-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

.res-btn strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
}

.res-btn span {
  font-size: 11px;
}

.res-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.res-btn.active {
  background: rgba(68, 92, 254, 0.15);
  border-color: var(--accent-main);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(68, 92, 254, 0.25);
}
.res-btn.active strong {
  color: #60a5fa;
}

/* AUDIO SWITCH ROW */
.audio-switch-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl);
  padding: 12px 14px;
}

.audio-switch-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.audio-switch-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.audio-switch-title i {
  width: 14px;
  height: 14px;
  color: #10b981;
}

.audio-switch-text span {
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================================
   RAISE HAND SYSTEM (Voice Room Stage)
   ============================================================ */
.meet-tile-top-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 15;
  pointer-events: none;
}
.meet-tile-top-badges > * {
  pointer-events: auto;
  position: static !important;
}

.overflow-top-badges {
  position: absolute;
  top: -4px;
  right: -4px;
  display: flex;
  align-items: center;
  gap: 3px;
  z-index: 15;
  pointer-events: none;
}
.overflow-top-badges > * {
  pointer-events: auto;
  position: static !important;
}

/* Static White Hand Badge with Queue Number */
.meet-hand-badge {
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  user-select: none;
}
.meet-hand-badge i {
  width: 13px;
  height: 13px;
  color: #ffffff !important;
  stroke: #ffffff !important;
}
.meet-hand-badge .hand-queue-num {
  font-size: 11.5px;
  font-weight: 800;
  color: #ffffff !important;
  min-width: 8px;
  text-align: center;
}

.overflow-user-chip .meet-hand-badge {
  padding: 2px 5px;
  font-size: 10px;
}
.overflow-user-chip .meet-hand-badge i {
  width: 11px;
  height: 11px;
}
.overflow-user-chip .meet-hand-badge .hand-queue-num {
  font-size: 10px;
}

/* Stage Button Active State for Raise Hand */
.btn-stage-action.hand-btn.hand-active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(234, 179, 8, 0.25)) !important;
  border-color: #f59e0b !important;
  color: #fbbf24 !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4) !important;
}

/* Host Lower Hand in Popover */
.popover-action-btn.host-lower-hand {
  color: #fbbf24;
}
.popover-action-btn.host-lower-hand:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}

/* ============================================================
   LOCAL FILE SYNC PROMPT BANNER & DRAG-AND-DROP OVERLAY
   ============================================================ */
.local-file-sync-banner {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 23, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  padding: 24px;
  animation: fadeIn 0.25s ease-out;
}

.local-file-banner-content {
  background: rgba(18, 24, 38, 0.95);
  border: 1.5px solid rgba(68, 92, 254, 0.4);
  border-radius: var(--radius-2xl);
  padding: 24px 30px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(68, 92, 254, 0.2);
}

.local-file-banner-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(68, 92, 254, 0.25), rgba(99, 102, 241, 0.1));
  border: 1.5px solid rgba(68, 92, 254, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818cf8;
  box-shadow: 0 0 20px rgba(68, 92, 254, 0.3);
}

.local-file-banner-icon i {
  width: 28px;
  height: 28px;
}

.local-file-banner-info h4 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.local-file-banner-info p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 4px;
  word-break: break-all;
}

.local-file-banner-info strong {
  color: #60a5fa;
}

.local-file-banner-hint {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.local-file-banner-actions {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.local-file-banner-actions button {
  padding: 10px 24px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Custom Player Drag-over state */
.custom-player.file-drag-over {
  border: 2px dashed #445cfe !important;
  box-shadow: 0 0 35px rgba(68, 92, 254, 0.4) !important;
}

/* ============================================================
   VIDEO PLAYLIST / QUEUE SIDEBAR TAB STYLES
   ============================================================ */
body.room-voice .cinema-only-tab,
body.room-voice #tab-playlist,
body.room-voice #shortcuts-toggle-btn {
  display: none !important;
}

.playlist-tab-wrapper {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.playlist-card-box {
  height: 100%;
  background: transparent;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.playlist-box-header {
  padding: 10px 14px;
  background: rgba(10, 10, 12, 0.45);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.playlist-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 13px;
}
.playlist-status-indicator i {
  width: 17px;
  height: 17px;
  color: var(--theme-badge-color);
}
.drawer-sub-count {
  background: var(--theme-badge-bg);
  color: var(--theme-badge-color);
  border: 1px solid var(--theme-badge-border);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
}

.playlist-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-subtle {
  background: var(--glass-bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.btn-icon-subtle:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
  transform: scale(1.05);
}
.btn-icon-subtle i {
  width: 15px;
  height: 15px;
}

.playlist-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.playlist-items-list::-webkit-scrollbar {
  width: 5px;
}
.playlist-items-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-pill);
}

.playlist-empty-state {
  margin: auto;
  text-align: center;
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.playlist-empty-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-2xl);
  background: rgba(54, 80, 253, 0.12);
  border: 1px solid rgba(54, 80, 253, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-badge-color);
  box-shadow: 0 8px 24px rgba(54, 80, 253, 0.18);
  margin-bottom: 2px;
}
.playlist-empty-icon-wrap i {
  width: 24px;
  height: 24px;
}
.playlist-empty-state p {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.playlist-empty-state span {
  font-size: 11.5px;
  color: var(--text-muted);
  max-width: 220px;
  line-height: 1.5;
}

.playlist-item-card {
  position: relative;
  background: var(--glass-bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.04);
}
.playlist-item-card:hover {
  background: var(--glass-bg-elevated);
  border-color: rgba(54, 80, 253, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.08);
}
.playlist-item-card.active {
  background: linear-gradient(135deg, rgba(54, 80, 253, 0.22), rgba(20, 25, 45, 0.65));
  border-color: var(--accent-main);
  box-shadow: 0 4px 18px rgba(54, 80, 253, 0.25), inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

.item-index-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.playlist-item-card.active .item-index-badge {
  background: var(--accent-main);
  border-color: var(--accent-main);
  color: #ffffff;
  box-shadow: 0 0 10px var(--accent-main-glow);
}

.item-main-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.item-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.playlist-item-card.active .item-title {
  color: #93c5fd;
}

.item-meta {
  font-size: 10.5px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}
.item-meta .tag-local {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-size: 9.5px;
  font-weight: 700;
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.btn-item-delete {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn-item-delete:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-item-delete i {
  width: 14px;
  height: 14px;
}

.item-reorder-btns {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.btn-reorder {
  background: var(--glass-bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  width: 20px;
  height: 14px;
}
.btn-reorder:hover:not(:disabled) {
  color: var(--accent-main);
  border-color: var(--accent-main);
  background: rgba(54, 80, 253, 0.15);
}
.btn-reorder:disabled {
  opacity: 0.2;
  cursor: default;
}
.btn-reorder i {
  width: 11px;
  height: 11px;
}

.playlist-item-card .drag-handle {
  cursor: grab;
  color: var(--text-dim);
  opacity: 0.35;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  padding: 2px;
}
.playlist-item-card:hover .drag-handle {
  opacity: 0.8;
  color: var(--theme-badge-color);
}
.drag-handle i {
  width: 14px;
  height: 14px;
}

.item-status-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.item-status-badge.playing {
  background: var(--theme-badge-bg);
  color: var(--theme-badge-color);
  border: 1px solid var(--theme-badge-border);
}
.playing-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--theme-badge-color);
  animation: playlistLivePulse 1.2s infinite ease-in-out;
  display: inline-block;
}
@keyframes playlistLivePulse {
  0% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 6px var(--accent-main); }
  100% { transform: scale(0.8); opacity: 0.5; }
}
.item-status-badge.queued {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.item-status-badge.watched {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.playlist-item-card.dragging {
  opacity: 0.35;
  transform: scale(0.97);
  border-color: var(--accent-main);
}
.playlist-item-card.drag-over {
  border-top: 2px solid var(--accent-main);
}

.playlist-drawer-footer {
  padding: 8px 12px;
  background: var(--glass-bg-input);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.playlist-add-form {
  display: flex;
  align-items: center;
  gap: 8px;
}
.playlist-add-form input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  transition: all 0.2s ease;
}
.playlist-add-form input:focus {
  border-color: var(--accent-main);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 12px var(--accent-main-glow);
}
.btn-primary-compact {
  background: var(--accent-main);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px var(--accent-main-glow);
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.btn-primary-compact:hover {
  background: #233ef5;
  box-shadow: 0 4px 14px var(--accent-main-glow);
  transform: translateY(-1px);
}
.btn-primary-compact:active {
  transform: scale(0.96);
}
.btn-primary-compact i {
  width: 14px;
  height: 14px;
}

.badge-count-pill {
  background: var(--accent-main);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  border-radius: var(--radius-pill);
  padding: 1px 6px;
  margin-right: 4px;
}

.ctrl-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  background: #3b82f6;
  color: white;
  font-size: 9.5px;
  font-weight: 800;
  border-radius: var(--radius-pill);
  padding: 1px 5px;
  line-height: 1;
}

.playlist-trigger-btn {
  position: relative;
}

/* ============================================================
   PUSH-TO-TALK (PTT) COMPONENT STYLES
   ============================================================ */
.voice-input-mode-box {
  background: var(--glass-bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ptt-section-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.ptt-section-label i {
  width: 14px;
  height: 14px;
  color: var(--accent-main);
}

.voice-mode-toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.btn-voice-mode-pill {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  font-family: inherit;
}
.btn-voice-mode-pill:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}
.btn-voice-mode-pill.active {
  background: var(--accent-main);
  border-color: var(--accent-main);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 10px var(--accent-main-glow);
}
.btn-voice-mode-pill i {
  width: 13px;
  height: 13px;
}

.ptt-config-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed rgba(68, 92, 254, 0.35);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.2s ease;
}

.ptt-config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.btn-ptt-key {
  background: var(--glass-bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--theme-badge-color);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  box-sizing: border-box;
}
.btn-ptt-key:hover {
  border-color: var(--accent-main);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.btn-ptt-key.recording {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #f87171;
  animation: pulse 1s infinite;
}

.key-edit-hint {
  font-size: 10px;
  font-weight: normal;
  color: var(--text-dim);
}

/* Floating PTT Active Banner Overlay */
.ptt-active-banner {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(16, 185, 129, 0.95);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4), 0 0 15px rgba(16, 185, 129, 0.3);
  z-index: 50;
  pointer-events: none;
  animation: pttPop 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pttPop {
  from { opacity: 0; transform: translate(-50%, -10px) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.ptt-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  animation: pulse 1s infinite;
}

/* ============================================================
   LIVE PING & NETWORK QUALITY BADGE
   ============================================================ */
.top-ping-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  font-family: inherit;
  cursor: default;
  transition: all 0.2s ease;
}
.top-ping-badge:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.ping-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.ping-good {
  background-color: #22c55e !important;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6) !important;
}
.ping-medium {
  background-color: #eab308 !important;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.6) !important;
}
.ping-poor {
  background-color: #ef4444 !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6) !important;
}

.meet-ping-tag {
  font-size: 9.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-right: 4px;
  color: var(--text-dim);
}

.meet-ping-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
}

/* ========== STEP 2: Smart Chat Scroll & Floating New Messages Pill ========== */
.chat-wrapper {
  position: relative;
}

.chat-new-msg-pill {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: var(--accent-main);
  color: white;
  border: none;
  border-radius: 30px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Vazirmatn', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(68, 92, 254, 0.45);
  transition: all 0.25s ease;
  animation: pillBounce 0.4s ease-out;
}
.chat-new-msg-pill i {
  width: 14px;
  height: 14px;
}
.chat-new-msg-pill:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 6px 24px rgba(68, 92, 254, 0.6);
}
.chat-new-msg-pill.hidden {
  display: none;
}
@keyframes pillBounce {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}


/* ========== STEP 5: Keyboard Shortcuts Modal ========== */
.shortcuts-modal-card {
  max-width: 420px;
}
.shortcuts-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 0;
}
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.shortcut-row:last-child {
  border-bottom: none;
}
.shortcut-row kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 28px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-main);
  font-family: 'Sora', monospace;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}
.shortcut-row span {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================================
   VOICE STAGE CAMERA & VIDEO CALL
   ============================================================ */
.btn-stage-action.camera-active {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  border-color: #34d399 !important;
  color: white !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.45) !important;
}

.meet-tile {
  position: relative;
  overflow: hidden;
}
.meet-tile .meet-camera-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  z-index: 1;
  background: #000;
}
.meet-tile.has-camera .meet-avatar-wrapper {
  opacity: 0;
  pointer-events: none;
}
.meet-tile.has-camera .meet-tile-footer,
.meet-tile.has-camera .meet-tile-top-badges,
.meet-tile.has-camera .meet-tile-options-btn {
  z-index: 5;
}

.btn-tile-flip-cam {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}
.btn-tile-flip-cam:hover {
  background: rgba(16, 185, 129, 0.85);
  border-color: #10b981;
  transform: scale(1.1);
}
.btn-tile-flip-cam i {
  width: 16px;
  height: 16px;
}

/* ============================================================
   FIRST-TIME MIC & CAMERA GUIDANCE HINT TOOLTIP
   ============================================================ */
.mic-cam-hint-tooltip {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(99, 102, 241, 0.5);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7), 0 0 22px rgba(99, 102, 241, 0.3);
  border-radius: 14px;
  padding: 9px 14px 9px 12px;
  z-index: 120;
  max-width: 92%;
  width: max-content;
  direction: rtl;
  animation: hintSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

@keyframes hintSlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.hint-pointer-arrow {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: rgba(15, 23, 42, 0.96);
  border-right: 1px solid rgba(99, 102, 241, 0.5);
  border-bottom: 1px solid rgba(99, 102, 241, 0.5);
}

.hint-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6366f1;
  box-shadow: 0 0 8px #6366f1;
  flex-shrink: 0;
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px #818cf8; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.hint-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}

.hint-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.hint-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.hint-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  margin-right: 4px;
  transition: all 0.2s;
}

.hint-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* ============================================================
   VOICE STAGE FLOATING EMOJI TRAY & REACTIONS
   ============================================================ */
.stage-reaction-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.floating-emojis-bar.horizontal,
.stage-emoji-tray {
  position: absolute;
  bottom: 58px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 16, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  width: auto;
  max-width: 320px;
  height: 48px;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scroll-behavior: auto !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior: contain;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  animation: stageEmojiTrayFadeIn 0.18s cubic-bezier(0.16, 0.8, 0.3, 1);
  user-select: none;
  cursor: grab;
  will-change: scroll-position;
}
.stage-emoji-tray:active {
  cursor: grabbing;
}
.stage-emoji-tray::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

@keyframes stageEmojiTrayFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.voice-stage-reactions-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 120;
}

/* ============================================================
   HIDE TOP HEADER VOICE BUTTONS & VOICE STATUS BOX IN DEDICATED VOICE ROOM
   ============================================================ */
body.room-voice #voice-toggle-btn,
body.room-voice #voice-mute-btn,
body.room-voice #voice-main-status-box {
  display: none !important;
}

/* ============================================================
   MULTI-ENGINE NOISE CANCELLATION STUDIO & DRAWER
   ============================================================ */
.noise-engine-studio-card {
  background: var(--glass-bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.engine-studio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.engine-studio-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}
.engine-studio-title i,
.engine-studio-title svg {
  width: 15px;
  height: 15px;
  color: var(--accent-main);
}

.engine-active-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  letter-spacing: 0.2px;
}

.btn-engine-reset {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--glass-bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.btn-engine-reset:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
}
.btn-engine-reset i,
.btn-engine-reset svg {
  width: 11px;
  height: 11px;
}

.engine-tabs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.engine-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  font-family: inherit;
}
.engine-tab-btn i,
.engine-tab-btn svg {
  width: 13px;
  height: 13px;
}

.engine-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.engine-tab-btn.active {
  background: var(--accent-main);
  border-color: var(--accent-main);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 10px var(--accent-main-glow);
}

.engine-drawer-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  transition: all 0.25s ease;
}

.engine-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.engine-panel.hidden {
  display: none !important;
}

.engine-panel .mixer-control-row {
  margin-bottom: 0;
}

/* ============================================================
   SETTINGS MODAL & ACCORDION SYSTEM (V3.28)
   ============================================================ */
.settings-modal-card {
  max-width: 600px;
  width: 95%;
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  padding: 20px 22px 14px 22px;
  box-sizing: border-box;
  overflow: hidden;
}

.settings-modal-card .modal-title-row {
  flex: 0 0 auto;
  margin-bottom: 8px;
}

.settings-accordion-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 4px;
  padding-left: 2px;
  padding-bottom: 50px;
  margin-top: 10px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.settings-accordion-list::-webkit-scrollbar {
  width: 5px;
}
.settings-accordion-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 5px;
}

.settings-accordion-item {
  background: var(--glass-bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}
.settings-accordion-item:hover {
  border-color: rgba(255, 255, 255, 0.16);
}
.settings-accordion-item.active {
  background: rgba(18, 24, 38, 0.85);
  border-color: rgba(54, 80, 253, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.settings-accordion-header {
  width: 100%;
  padding: 13px 16px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  transition: background 0.2s ease;
  user-select: none;
  outline: none;
}
.settings-accordion-header:hover {
  background: rgba(255, 255, 255, 0.04);
}
.accordion-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.accordion-header-title i {
  width: 17px;
  height: 17px;
  color: var(--accent-main);
  flex-shrink: 0;
}
.accordion-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}
.settings-accordion-item.active .accordion-chevron {
  transform: rotate(180deg);
  color: var(--accent-main);
}

.settings-accordion-content {
  display: none;
  padding: 14px 16px 18px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-direction: column;
  gap: 12px;
  background: rgba(10, 13, 20, 0.35);
  max-height: 42vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) rgba(0, 0, 0, 0.2);
}
.settings-accordion-content::-webkit-scrollbar {
  width: 5px;
}
.settings-accordion-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}
.settings-accordion-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 4px;
}
.settings-accordion-content::-webkit-scrollbar-thumb:hover {
  background: var(--accent-main);
}
.settings-accordion-item.active .settings-accordion-content {
  display: flex;
  animation: settingsAccordionFade 0.25s ease forwards;
}

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

@keyframes hostControlsGlow {
  0% {
    border-color: rgba(245, 158, 11, 0.9);
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.45);
  }
  50% {
    border-color: rgba(245, 158, 11, 0.7);
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.3);
  }
  100% {
    border-color: rgba(54, 80, 253, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  }
}

.settings-accordion-item.highlight-glow {
  animation: hostControlsGlow 1.4s ease-out forwards;
}

.setting-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0;
}
.setting-item-row.sub-row {
  padding-right: 12px;
  border-right: 2px solid rgba(54, 80, 253, 0.3);
  margin-top: 2px;
}

.setting-item-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.setting-item-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
}
.setting-item-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.setting-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}
.setting-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.setting-switch .switch-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--glass-bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.setting-switch .switch-slider::before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-muted);
  border-radius: 50%;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.setting-switch input:checked + .switch-slider {
  background-color: var(--accent-main);
  border-color: var(--accent-main);
  box-shadow: 0 0 10px var(--accent-glow);
}
.setting-switch input:checked + .switch-slider::before {
  transform: translateX(18px);
  background-color: #ffffff;
}

.setting-slider-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.setting-slider-control input[type="range"] {
  width: 120px;
  height: 5px;
  accent-color: var(--accent-main);
  cursor: pointer;
}
.setting-slider-val {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-main);
  min-width: 36px;
  text-align: center;
}

.setting-radio-pill-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--glass-bg-input);
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.radio-pill-btn {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
}
.radio-pill-btn input {
  display: none;
}
.radio-pill-btn:has(input:checked) {
  background: var(--accent-main);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(54, 80, 253, 0.35);
}

.setting-input-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.btn-setting-action {
  background: var(--accent-main);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s;
  height: 36px;
}
.btn-setting-action i {
  width: 14px;
  height: 14px;
}
.btn-setting-action:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-setting-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  border-radius: var(--radius-lg);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s;
}
.btn-setting-danger i {
  width: 14px;
  height: 14px;
}
.btn-setting-danger:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: #ef4444;
  color: #ffffff;
}

.settings-hotkeys-mini-table {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 8px;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.hotkey-mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-secondary);
}
.hotkey-mini-row kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 2px 7px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  min-width: 24px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.setting-host-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 12px;
  font-weight: 600;
}
.setting-host-notice i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ============================================================
   SETTINGS MODAL: CINEMA VS VOICE ROOM DEDICATED FILTERING
   ============================================================ */
body.room-voice .settings-accordion-item[data-accordion="ducking"],
body.room-voice .settings-accordion-item[data-accordion="sync"],
body.room-voice .hotkey-cinema-only,
body.room-voice .setting-host-cinema-only,
body.room-voice .shortcut-cinema-only {
  display: none !important;
}

body:not(.room-voice) .hotkey-voice-only {
  display: none !important;
}

/* ============================================================
   TICKER / MARQUEE AUTO-SCROLL ANIMATION SYSTEM
   ============================================================ */
.ticker-wrapper {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
}
.ticker-wrapper.is-masked {
  mask-image: linear-gradient(to right, transparent 0px, black 6px, black calc(100% - 6px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0px, black 6px, black calc(100% - 6px), transparent 100%);
}
.ticker-text {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
}
.ticker-text.is-overflowing {
  animation: smoothTickerScroll 5s cubic-bezier(0.37, 0, 0.63, 1) 1.2s infinite alternate;
}
@keyframes smoothTickerScroll {
  0%, 25% {
    transform: translateX(0px);
  }
  75%, 100% {
    transform: translateX(var(--ticker-shift, 0px));
  }
}

/* ============================================================
   Feature Flags Visibility & Dynamic Modular Toggles (v1.0.28)
   ============================================================ */
.feature-disabled,
[data-feature].feature-disabled {
  display: none !important;
}

/* Feature Disabled Dimmed State (Accessible with visual lock) */
.feature-disabled-dimmed {
  opacity: 0.35 !important;
  pointer-events: none !important;
  filter: grayscale(0.85) !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  user-select: none !important;
}

.module-disabled-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.9);
  color: #fca5a5;
  border: 1px dashed rgba(239, 68, 68, 0.4);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  margin: 8px 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Official Server Broadcast Announcement Card */
.server-broadcast-card {
  margin: 12px 4px;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.75), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(139, 92, 246, 0.45);
  border-right: 4px solid var(--accent-primary, #3650fd);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(54, 80, 253, 0.15);
  animation: announcement-glow 3s infinite alternate;
}

@keyframes announcement-glow {
  0% { border-color: rgba(139, 92, 246, 0.4); }
  100% { border-color: rgba(54, 80, 253, 0.7); }
}

.server-broadcast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.server-broadcast-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(54, 80, 253, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(54, 80, 253, 0.4);
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.server-broadcast-time {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.5);
}

.server-broadcast-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 10px;
  word-break: break-word;
}

.server-broadcast-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: rgba(148, 163, 184, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}
/* ══════════════════════════════════════════════════════════════════
   SyncStream Phase 5: Authentication, Subscriptions, Profile & Tickets
   ══════════════════════════════════════════════════════════════════ */

/* Lobby Auth Bar */
.lobby-auth-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}
.lobby-auth-guest {
  display: flex;
  width: 100%;
  gap: 10px;
}
.btn-auth-trigger {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(54, 80, 253, 0.2), rgba(99, 102, 241, 0.3));
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-auth-trigger:hover {
  background: linear-gradient(135deg, rgba(54, 80, 253, 0.4), rgba(99, 102, 241, 0.5));
  transform: translateY(-1px);
}
.btn-pricing-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  padding: 10px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-pricing-trigger:hover {
  background: rgba(245, 158, 11, 0.2);
}

.lobby-auth-logged {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.logged-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}
.btn-auth-profile {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.btn-auth-logout {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

/* Header User Profile Pill */
.user-profile-pill-container {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(20, 20, 28, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 5px 12px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-profile-pill:hover {
  background: rgba(30, 30, 42, 0.85);
  border-color: rgba(99, 102, 241, 0.4);
}
.user-avatar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Plan Badges */
.badge-plan-tier {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-plan-free { background: rgba(255, 255, 255, 0.1); color: #94a3b8; }
.badge-plan-economic { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-plan-basic { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-plan-pro { background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(239, 68, 68, 0.25)); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-plan-enterprise { background: linear-gradient(135deg, #3b82f6, #8b5cf6); color: #fff; }

/* Notification Bell */
.btn-notif-bell {
  position: relative;
}
.notif-badge-count {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 10px;
  border: 1px solid #141418;
}

/* Quota Warning Banner */
.quota-warning-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(239, 68, 68, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 10px;
  padding: 8px 14px;
  margin-bottom: 10px;
  color: #fbbf24;
  font-size: 0.85rem;
  font-weight: 500;
}
.quota-banner-content {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-upgrade-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  border: none;
  padding: 5px 12px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

/* Auth Modal Styling */
.modal-auth-card {
  max-width: 480px;
}
.auth-tabs {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 8px 6px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.auth-tab.active {
  background: rgba(54, 80, 253, 0.8);
  color: #fff;
}
.auth-tab-content {
  display: none;
}
.auth-tab-content.active {
  display: block;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-submit-btn {
  width: 100%;
  margin-top: 6px;
}
.private-key-intro {
  display: flex;
  gap: 10px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 10px;
  padding: 12px;
  color: #c7d2fe;
  font-size: 0.84rem;
  line-height: 1.5;
  margin-bottom: 12px;
}
.btn-google-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: #fff;
  color: #1f2937;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-google-login:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
}

/* User Profile Modal */
.modal-profile-card {
  max-width: 500px;
}
.profile-summary-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  margin-bottom: 20px;
}
.profile-avatar-box {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3650fd, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.profile-main-meta h3 {
  margin: 0 0 4px 0;
  font-size: 1.15rem;
}
.prof-phone-tag {
  color: #94a3b8;
  font-size: 0.82rem;
  direction: ltr;
  display: inline-block;
  margin-bottom: 6px;
}
.prof-plan-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}
.prof-plan-free { background: rgba(255, 255, 255, 0.1); color: #cbd5e1; }
.prof-plan-economic { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.prof-plan-basic { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; }
.prof-plan-pro { background: rgba(245, 158, 11, 0.2); color: #fde047; }
.prof-plan-enterprise { background: linear-gradient(135deg, #3b82f6, #8b5cf6); color: #fff; }

.profile-quotas-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 20px;
}
.profile-quotas-box h4 {
  margin: 0 0 12px 0;
  font-size: 0.88rem;
  color: #94a3b8;
}
.quota-progress-item {
  margin-bottom: 10px;
}
.quota-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 4px;
}
.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #3b82f6);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.profile-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.btn-prof-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 12px 10px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-prof-upgrade {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(239, 68, 68, 0.2));
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}
.btn-prof-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 12px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

/* Private Key Modal */
.modal-pk-card {
  max-width: 520px;
}
.pk-description {
  color: #cbd5e1;
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 16px;
}
.current-pk-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}
.pk-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}
.pk-code-row code {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 8px 12px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.95rem;
  color: #a5b4fc;
  direction: ltr;
  text-align: left;
}
.btn-copy-pk {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.pk-controls-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 16px;
}
.pk-danger-zone {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.btn-danger-outline {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 10px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Support Tickets Modal */
.modal-ticket-card {
  max-width: 580px;
}
.ticket-header-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.ticket-list-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.ticket-list-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.3);
}
.ticket-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.ticket-status-pill {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 10px;
}
.status-open { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.status-answered { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.status-closed { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }
.ticket-card-sub {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: #94a3b8;
}
.thread-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.btn-back-tickets {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.thread-messages-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding: 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  margin-bottom: 10px;
}
.ticket-message-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 85%;
}
.bubble-admin {
  align-self: flex-start;
  background: linear-gradient(135deg, rgba(54, 80, 253, 0.25), rgba(99, 102, 241, 0.35));
  border: 1px solid rgba(99, 102, 241, 0.4);
}
.bubble-user {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.ticket-message-bubble .msg-sender { font-size: 0.75rem; font-weight: 700; margin-bottom: 4px; }
.ticket-message-bubble .msg-content { font-size: 0.88rem; line-height: 1.5; }
.ticket-message-bubble .msg-time { font-size: 0.7rem; color: #94a3b8; text-align: left; margin-top: 4px; }
.thread-reply-form {
  display: flex;
  gap: 8px;
}
.thread-reply-form input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: inherit;
}

/* Pricing Grid Modal */
.modal-pricing-card {
  max-width: 880px;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 10px;
}
.pricing-card {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
}
.pricing-card.featured {
  background: linear-gradient(180deg, rgba(54, 80, 253, 0.15), rgba(20, 20, 28, 0.8));
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 25px rgba(54, 80, 253, 0.2);
}
.pricing-card:hover {
  transform: translateY(-3px);
}
.plan-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 8px;
}
.plan-badge.popular { background: #f59e0b; color: #000; }
.plan-badge.vip { background: #ef4444; color: #fff; }
.pricing-card h3 { margin: 0 0 8px 0; font-size: 1.1rem; }
.plan-price { font-size: 1.25rem; font-weight: 800; color: #fff; margin-bottom: 14px; }
.plan-price span { font-size: 0.78rem; font-weight: 400; color: #94a3b8; }
.plan-features-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  font-size: 0.82rem;
  line-height: 1.8;
  color: #cbd5e1;
}
.btn-plan-select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
}
.btn-plan-current { background: rgba(255, 255, 255, 0.08); color: #94a3b8; cursor: default; }
.btn-plan-buy { background: linear-gradient(135deg, #3650fd, #6366f1); color: #fff; }
.btn-plan-buy:hover { opacity: 0.9; }
.btn-plan-contact { background: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); }

/* Notifications List Modal */
.modal-notif-card {
  max-width: 500px;
}
.notif-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
}
.notif-item-card.unread {
  border-color: rgba(54, 80, 253, 0.4);
  background: rgba(54, 80, 253, 0.06);
}
.notif-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  margin-bottom: 4px;
}
.notif-item-header span { font-size: 0.72rem; color: #94a3b8; }
.notif-item-card p { margin: 0; font-size: 0.82rem; color: #cbd5e1; line-height: 1.5; }
/* ══════════════════════════════════════════════════════════════════
   STAGE 1: LANDING HERO VIEW (صفحه نخست و معرفی پلتفرم)
   ══════════════════════════════════════════════════════════════════ */

.landing-hero-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 0%, rgba(54, 80, 253, 0.15) 0%, rgba(10, 10, 15, 0.95) 70%);
  color: #fff;
  overflow-y: auto;
  position: relative;
  z-index: 10;
}

/* Hero Navbar */
.hero-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  backdrop-filter: blur(20px);
  background: rgba(15, 15, 22, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}
.hero-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-icon-mini {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3650fd, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 15px rgba(54, 80, 253, 0.4);
}
.hero-brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.badge-hero-version {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 20px;
}

.hero-nav-links {
  display: flex;
  gap: 24px;
}
.hero-nav-link {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}
.hero-nav-link:hover {
  color: #fff;
}

.hero-nav-btn-group {
  display: flex;
  gap: 10px;
}
.btn-hero-auth {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(54, 80, 253, 0.3), rgba(99, 102, 241, 0.4));
  border: 1px solid rgba(99, 102, 241, 0.5);
  color: #fff;
  padding: 8px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}
.btn-hero-auth:hover {
  background: linear-gradient(135deg, #3650fd, #6366f1);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(54, 80, 253, 0.4);
}
.btn-hero-lobby-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

/* Hero Main Content */
.hero-main-content {
  flex: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 24px;
}
.hero-badge-pill i {
  width: 16px;
  height: 16px;
  color: #fbbf24;
}

.hero-main-headline {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.35;
  margin: 0 0 20px 0;
  letter-spacing: -0.5px;
}
.gradient-text {
  background: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtext {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #94a3b8;
  max-width: 760px;
  margin: 0 0 36px 0;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-bottom: 40px;
}
.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #3650fd, #6366f1);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 6px 25px rgba(54, 80, 253, 0.4);
}
.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(54, 80, 253, 0.6);
}
.btn-hero-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 14px 24px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}
.btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}
.btn-hero-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  padding: 14px 22px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}
.btn-hero-outline:hover {
  background: rgba(245, 158, 11, 0.2);
}

.hero-metrics-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 70px;
}
.metric-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.84rem;
  color: #cbd5e1;
}
.metric-chip i {
  width: 16px;
  height: 16px;
  color: #60a5fa;
}

/* Features Showcase */
.hero-features-section {
  width: 100%;
  margin-bottom: 80px;
}
.section-title-wrap {
  margin-bottom: 36px;
}
.section-title-wrap h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0 0 8px 0;
}
.section-title-wrap p {
  color: #94a3b8;
  font-size: 0.95rem;
  margin: 0;
}

.features-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  text-align: right;
}
.hero-feature-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 24px 20px;
  transition: all 0.25s ease;
}
.hero-feature-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
}
.feature-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.icon-cyan { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.icon-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.icon-green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.hero-feature-card h3 {
  font-size: 1.15rem;
  margin: 0 0 10px 0;
  color: #fff;
}
.hero-feature-card p {
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.6;
  margin: 0;
}

/* Pricing Section in Hero */
.hero-pricing-section {
  width: 100%;
  margin-bottom: 40px;
}

/* Hero Footer */
.hero-footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
  color: #64748b;
}
.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-links a:hover {
  color: #60a5fa;
}


/* ══════════════════════════════════════════════════════════════════
   STAGE 2: STANDALONE AUTH VIEW (صفحه اختصاصی ورود)
   ══════════════════════════════════════════════════════════════════ */

.standalone-auth-container {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(54, 80, 253, 0.18) 0%, rgba(10, 10, 15, 0.98) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999;
  backdrop-filter: blur(25px);
}
.auth-view-card {
  width: 100%;
  max-width: 480px;
  background: rgba(20, 20, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.auth-card-top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.btn-back-hero {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.84rem;
  cursor: pointer;
  transition: color 0.2s ease;
}
.btn-back-hero:hover {
  color: #fff;
}
.auth-card-brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #60a5fa;
}


/* ══════════════════════════════════════════════════════════════════
   STAGE 3: LOBBY TOP HEADER & 3-SUBITEM PROFILE DROPDOWN
   ══════════════════════════════════════════════════════════════════ */

.lobby-stage-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.btn-lobby-back-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-lobby-back-home:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.lobby-profile-dropdown-wrapper {
  position: relative;
}
.btn-lobby-profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-lobby-profile-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(99, 102, 241, 0.4);
}
.profile-dropdown-chevron {
  width: 14px;
  height: 14px;
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.notif-badge-pill {
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
}

/* 3-Subitem Profile Menu */
.lobby-profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: rgba(22, 22, 32, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 1000;
  animation: menuFadeIn 0.15s ease-out;
}
@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: none;
  color: #cbd5e1;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: right;
}
.profile-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.profile-menu-item i {
  width: 16px;
  height: 16px;
  color: #94a3b8;
}
.profile-menu-item:hover i {
  color: #60a5fa;
}

.menu-badge-count {
  margin-right: auto;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
}

.menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}

.profile-menu-item.menu-item-danger {
  color: #f87171;
}
.profile-menu-item.menu-item-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}
.profile-menu-item.menu-item-danger i {
  color: #f87171;
}


/* ══════════════════════════════════════════════════════════════════
   PAYMENT CHECKOUT & 2FA STYLES (v1.0.31)
   ══════════════════════════════════════════════════════════════════ */
.modal-checkout-card {
  max-width: 480px;
}

.checkout-summary-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
}

.checkout-plan-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.checkout-plan-name {
  color: #60a5fa;
  font-weight: 700;
}

.checkout-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 12px 0;
}

.checkout-amount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.checkout-amount {
  color: #34d399;
  font-size: 1.25rem;
  font-weight: 800;
}

.gateway-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.gateway-card {
  cursor: pointer;
  display: block;
  position: relative;
}

.gateway-card input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.gateway-inner {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px 6px;
  text-align: center;
  background: rgba(30, 41, 59, 0.5);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.gateway-inner i {
  width: 20px;
  height: 20px;
  color: #94a3b8;
}

.gateway-card input[type="radio"]:checked + .gateway-inner {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.15);
  color: #fff;
}

.gateway-card input[type="radio"]:checked + .gateway-inner i {
  color: #60a5fa;
}

.btn-checkout-submit {
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  font-weight: 700;
  font-size: 1rem;
}

/* 2FA Setup Styles */
.modal-2fa-card {
  max-width: 480px;
}

.twofa-intro {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.twofa-secret-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
}

.secret-code-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 10px;
  border-radius: 6px;
  margin-top: 6px;
}

.secret-code-wrap code {
  font-family: monospace;
  color: #60a5fa;
  font-size: 0.95rem;
  letter-spacing: 1px;
}

.twofa-backup-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
}

.backup-codes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.backup-code-item {
  font-family: monospace;
  background: rgba(0, 0, 0, 0.4);
  color: #fbbf24;
  padding: 4px 8px;
  border-radius: 4px;
  text-align: center;
  font-size: 0.85rem;
}
/* ══════════════════════════════════════════════════════════════════════
   SYNCSTREAM ADVANCED SOCIAL & CHAT STYLES (v1.0.34)
   ══════════════════════════════════════════════════════════════════════ */

/* ── 1. Pinned Message Banner ── */
.chat-pinned-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(54, 80, 253, 0.18), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(54, 80, 253, 0.35);
  border-radius: 10px;
  padding: 8px 12px;
  margin: 8px 10px 4px 10px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
  z-index: 10;
}
.chat-pinned-banner:hover {
  background: linear-gradient(135deg, rgba(54, 80, 253, 0.25), rgba(139, 92, 246, 0.22));
  border-color: var(--accent-main, #3650fd);
}
.pinned-icon {
  color: var(--accent-main, #3650fd);
  display: flex;
  align-items: center;
}
.pinned-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.pinned-sender {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-main, #3650fd);
}
.pinned-text {
  font-size: 12px;
  color: var(--text-primary, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-unpin {
  background: transparent;
  border: none;
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
}
.btn-unpin:hover {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.15);
}

.highlight-pulse {
  animation: pulseHighlight 1.5s ease;
}
@keyframes pulseHighlight {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 20px rgba(54, 80, 253, 0.8); }
}



/* ── 5. GIF Search Panel & Card ── */
.chat-gif-panel {
  background: rgba(24, 24, 32, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 8px;
  backdrop-filter: blur(16px);
  max-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gif-panel-header input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
}
.gif-categories {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
}
.gif-cat-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary, #94a3b8);
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.gif-cat-pill.active, .gif-cat-pill:hover {
  background: var(--accent-main, #3650fd);
  color: #fff;
  border-color: var(--accent-main, #3650fd);
}
.gif-results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  overflow-y: auto;
  max-height: 180px;
}
.gif-card-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
  background: #111;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.gif-card-item:hover {
  border-color: var(--accent-main, #3650fd);
  transform: scale(1.03);
}
.gif-card-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gif-card-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: #fff;
  font-size: 9px;
  padding: 4px;
  text-align: center;
}
.msg-gif-card {
  border-radius: 10px;
  overflow: hidden;
  max-width: 240px;
  margin-top: 4px;
}
.msg-gif-card img {
  width: 100%;
  border-radius: 10px;
  display: block;
}

/* ── 6. Live Room Poll Card ── */
.room-poll-card {
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid rgba(54, 80, 253, 0.3);
  border-radius: 14px;
  padding: 12px;
  margin: 6px 0;
  backdrop-filter: blur(10px);
}
.poll-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.poll-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-main, #3650fd);
}
.poll-title-wrap h4 {
  margin: 0;
  font-size: 13px;
  color: #fff;
}
.badge-poll-status {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}
.badge-poll-status.active {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-poll-status.closed {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.poll-options-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.poll-option-row {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  padding: 8px 12px;
  transition: all 0.2s ease;
}
.poll-option-row:hover {
  border-color: var(--accent-main, #3650fd);
  background: rgba(54, 80, 253, 0.1);
}
.poll-option-row.voted {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}
.poll-option-fill {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(54, 80, 253, 0.25), rgba(139, 92, 246, 0.25));
  transition: width 0.4s ease;
  z-index: 0;
}
.poll-option-row.voted .poll-option-fill {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.25), rgba(52, 211, 153, 0.25));
}
.poll-option-content {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.poll-opt-label {
  font-weight: 600;
  color: #fff;
}
.poll-opt-stats {
  color: var(--text-secondary, #94a3b8);
  font-family: monospace;
}
.poll-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 10px;
  color: var(--text-secondary, #94a3b8);
}
.poll-options-inputs-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.poll-option-input-wrap {
  display: flex;
  gap: 6px;
}
.poll-option-input-wrap input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  padding: 8px 12px;
  font-size: 12px;
  outline: none;
}
.btn-remove-poll-opt {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  border-radius: 8px;
  padding: 0 8px;
  cursor: pointer;
}

/* ── 7. Message Hover Actions (Pin / Reply) ── */
.msg-actions-hover {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.chat-bubble:hover .msg-actions-hover {
  opacity: 1;
}
.btn-msg-pin {
  background: transparent;
  border: none;
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.btn-msg-pin:hover {
  color: var(--accent-main, #3650fd);
  background: rgba(54, 80, 253, 0.15);
}

/* ── 8. Fullscreen Particle FX Canvas ── */
.particle-fx-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99999;
}
