/* ==========================================================================
   FIGMA SVOICALL FOCUS — DESKTOP UI PALETTE & DESIGN TOKENS
   ========================================================================== */
:root {
  --bg-primary: #13161B;
  --bg-secondary: #171A20;
  --bg-tertiary: #1B1E24;
  --bg-card: #1B1E24;
  --bg-card-elevated: #20242C;
  --bg-modifier-hover: rgba(255, 255, 255, 0.06);
  --bg-modifier-selected: rgba(10, 132, 255, 0.15);
  --accent-blue: #0A84FF;
  --accent-blue-hover: #0062CC;
  --accent-red: #FF453A;
  --accent-red-hover: #E02D24;
  --accent-blurple: #0A84FF;
  --accent-blurple-hover: #0062CC;
  --accent-gold: #F0B232;
  --text-normal: #F5F5F7;
  --text-muted: #7E8591;
  --text-muted-bright: #A8AFBB;
  --text-tertiary: #6E7582;
  --text-link: #0A84FF;
  --status-online: #30D158;
  --status-danger: #FF453A;
  --status-danger-hover: #E02D24;
  --border-primary: rgba(255, 255, 255, 0.08);
  --border-secondary: rgba(255, 255, 255, 0.14);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --header-family: 'Outfit', var(--font-family);
  --sidebar-width: 260px;
  --sidebar-right-width: 300px;
}

body.light-theme {
  --bg-primary: #F4F6FA;
  --bg-secondary: #EEF2F8;
  --bg-tertiary: #E4E7EC;
  --bg-card: #FFFFFF;
  --bg-card-elevated: #FFFFFF;
  --bg-modifier-hover: rgba(0, 0, 0, 0.04);
  --bg-modifier-selected: rgba(10, 132, 255, 0.12);
  --accent-blue: #007AFF;
  --accent-red: #FF3B30;
  --text-normal: #111318;
  --text-muted: #505968;
  --text-muted-bright: #414a59;
  --text-tertiary: #90979F;
  --text-link: #0062CC;
  --status-online: #30D158;
  --status-danger: #FF3B30;
  --border-primary: rgba(0, 0, 0, 0.08);
  --border-secondary: rgba(0, 0, 0, 0.16);
}

/* ==========================================================================
   RESET & SCROLLBARS
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body, html {
  height: 100%;
  width: 100%;
  background-color: var(--bg-tertiary);
  color: var(--text-normal);
  font-family: var(--font-family);
  overflow: hidden;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Slim modern scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.45);
}

/* ==========================================================================
   COMMON COMPONENT STYLES
   ========================================================================== */
input, select, button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input,
textarea,
[contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
  pointer-events: auto;
}

.btn {
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background-color: var(--accent-blurple);
  color: #ffffff;
}
.btn-primary:hover {
  background-color: var(--accent-blurple-hover);
}
.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-normal);
  border: 1px solid var(--border-primary);
}
.btn-secondary:hover {
  background-color: var(--bg-modifier-hover);
  border-color: var(--border-secondary);
}
.btn-block {
  width: 100%;
}
.btn-square {
  width: 44px;
  min-width: 44px;
  padding-left: 0;
  padding-right: 0;
}
.btn-danger {
  background-color: var(--accent-red);
  color: #ffffff;
}
.btn-danger:hover {
  background-color: var(--accent-red-hover);
}

/* Channel Row / V2 (248x64 r:16) — Figma spec */
.channel-item {
  min-height: 64px;
  border-radius: 16px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 6px;
}

.channel-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.channel-item.active,
.channel-item.selected {
  background: rgba(10, 132, 255, 0.15) !important;
  border-color: rgba(10, 132, 255, 0.3) !important;
}

.channel-icon-box {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 14px;
  background: #272B34;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted-bright);
  transition: all 0.2s ease;
}

.channel-icon-box svg {
  width: 20px;
  height: 20px;
}

.channel-item.active .channel-icon-box {
  background: var(--accent-blurple);
  color: #FFFFFF;
}

body.light-theme .channel-icon-box {
  background: #DDE4F0;
  color: var(--text-muted);
}

body.light-theme .channel-item.active .channel-icon-box {
  background: var(--accent-blurple);
  color: #FFFFFF;
}

.channel-item-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.channel-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-normal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-item.active .channel-item-meta {
  color: var(--accent-blurple);
}

.btn-link {
  background: transparent;
  color: var(--text-normal);
}
.btn-link:hover {
  text-decoration: underline;
  color: #ffffff;
}
.btn-block {
  width: 100%;
  padding: 12px;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: 3px;
}

.input-group {
  margin-bottom: 20px;
}
.input-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}
.input-group input[type="text"],
.input-group input[type="email"],
.input-group input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  color: var(--text-normal);
  outline: none;
  font-size: 0.92rem;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.input-group input[type="text"]:focus,
.input-group input[type="email"]:focus,
.input-group input[type="password"]:focus {
  border-color: var(--accent-blurple);
  background-color: var(--bg-tertiary);
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.15);
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-radius: 50%;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   SCREENS & LOGIN
   ========================================================================== */
@keyframes screenFadeIn {
  from {
    opacity: 0;
    transform: scale(0.99) translateZ(0);
  }
  to {
    opacity: 1;
    transform: scale(1) translateZ(0);
  }
}

@keyframes loginCardIn {
  0% {
    opacity: 0;
    transform: scale(0.94) translateY(14px) translateZ(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0) translateZ(0);
  }
}

.screen {
  width: 100%;
  position: absolute;
  top: 32px;
  bottom: 0;
  left: 0;
  display: flex;
}
.screen.active:not(.hidden) {
  animation: screenFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.screen.hidden {
  display: none !important;
}

#login-screen {
  align-items: center;
  justify-content: center;
  background-color: var(--bg-primary);
  background-image: radial-gradient(circle at 50% 50%, rgba(10, 132, 255, 0.06) 0%, transparent 60%);
}

#login-screen.active:not(.hidden) .login-card {
  animation: loginCardIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: transform, opacity;
}

.login-card {
  background-color: var(--bg-secondary);
  padding: 40px;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  width: 100%;
  max-width: 440px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}
.login-header .logo-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  color: var(--accent-blurple);
  filter: drop-shadow(0 4px 8px rgba(88, 101, 242, 0.2));
}
.login-header h2 {
  font-family: var(--header-family);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-normal);
}
.login-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.saved-accounts-panel {
  margin: -8px 0 22px;
  padding: 14px;
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  background-color: var(--bg-tertiary);
}

.saved-accounts-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.saved-accounts-header span {
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.saved-accounts-header small {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.saved-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.saved-account-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 8px;
  align-items: center;
}

.saved-account-main,
.saved-account-remove {
  border: 0;
  color: var(--text-normal);
  cursor: pointer;
}

.saved-account-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  text-align: left;
  transition: background-color 0.15s, border-color 0.15s;
}

.saved-account-main:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.saved-account-avatar {
  width: 34px;
  height: 34px;
  font-size: 0.82rem;
}

.saved-account-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.saved-account-name,
.saved-account-username {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-account-name {
  color: #fff;
  font-size: 0.83rem;
  font-weight: 600;
}

.saved-account-username {
  color: var(--accent-blurple);
  font-size: 0.7rem;
}

.saved-account-remove {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.10);
  color: var(--status-danger);
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s ease, background-color 0.15s, color 0.15s;
}

.saved-account-item:hover .saved-account-remove {
  opacity: 1;
}

.saved-account-remove:hover {
  background: var(--status-danger);
}

#login-admin-btn {
  background-color: transparent !important;
  border: 1px solid var(--border-secondary) !important;
  color: var(--text-muted) !important;
  transition: all 0.15s ease !important;
  border-radius: 8px !important;
}
#login-admin-btn:hover {
  background-color: rgba(255, 255, 255, 0.03) !important;
  border-color: var(--accent-blurple) !important;
  color: var(--accent-blurple) !important;
}

/* ==========================================================================
   3-COLUMN SYSTEM LAYOUT
   ========================================================================== */
#app-workspace {
  display: flex;
  width: 100%;
}

/* LEFT SIDEBAR */
.sidebar-left {
  width: var(--sidebar-width);
  height: 100%;
  background-color: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-primary);
  flex-shrink: 0;
}

.server-header {
  height: 48px;
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  padding: 0 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  z-index: 2;
  gap: 8px;
}
.server-header h3 {
  font-family: var(--header-family);
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.server-icon {
  color: var(--accent-blurple);
}

.channels-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 8px;
  min-height: 0;
}

/* Figma: Category header */
.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  margin-bottom: 8px;
  margin-top: 4px;
}
.category-header span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.category-header button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.15s, background-color 0.15s;
}
.category-header button:hover {
  color: #ffffff;
  background-color: var(--bg-modifier-hover);
}

.channels-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 6px;
}
.no-channels-msg {
  padding: 12px 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

/* Individual Channel Element */
.channel-item-container {
  display: flex;
  flex-direction: column;
  margin-bottom: 2px;
}

.channel-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-muted);
  position: relative;
  margin: 2px 8px;
}
.channel-link:hover {
  background-color: var(--bg-modifier-hover);
  color: var(--text-normal);
}
.channel-link.active {
  background-color: rgba(88, 101, 242, 0.12);
  color: var(--text-normal);
  box-shadow: inset 0 0 0 1px rgba(88, 101, 242, 0.25);
}
.channel-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  background-color: var(--accent-blurple);
  border-radius: 1.5px;
}

.channel-link-left {
  display: flex;
  align-items: center;
  overflow: hidden;
  gap: 6px;
}
.channel-link-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.channel-link-name {
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Room users indented list */
.channel-users-list {
  padding-left: 20px;
  margin: 2px 0 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.channel-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.82rem;
  color: #949BA4;
  cursor: default;
  transition: background-color 0.1s, color 0.1s;
}
.channel-user-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-normal);
}

.channel-user-left {
  display: flex;
  align-items: center;
  overflow: hidden;
  gap: 8px;
  min-width: 0;
}
.channel-user-avatar {
  width: 20px;
  height: 20px;
  font-size: 0.6rem;
  border-radius: 50%;
  flex-shrink: 0;
  transition: box-shadow 0.15s;
}
.channel-user-item.speaking .channel-user-avatar {
  box-shadow: inset 0 0 0 2px var(--status-online);
}
.channel-user-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.channel-user-name {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  font-weight: 500;
  color: var(--text-normal);
}
.channel-user-username {
  color: var(--accent-blurple);
  font-size: 0.68rem;
  line-height: 1.05;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.channel-user-username.guest {
  color: var(--text-muted);
}
.channel-user-mic-status {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.channel-user-mic-status svg {
  width: 12px;
  height: 12px;
  color: var(--status-danger);
}

/* User Widget (Bottom of Left Sidebar) — Figma: Current User 232x66 r:18 */
.user-widget {
  margin: 8px;
  padding: 10px 12px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  min-height: 66px;
}

.user-widget-info {
  display: flex;
  align-items: center;
  overflow: hidden;
  max-width: 160px;
  gap: 10px;
  cursor: default;
  padding: 2px 4px;
  border-radius: 8px;
  transition: none;
}
.user-widget-avatar-container {
  position: relative;
  flex-shrink: 0;
}
#user-widget-avatar {
  width: 42px;
  height: 42px;
  font-size: 0.92rem;
  background: var(--accent-blurple);
}
.status-indicator {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}
.status-indicator.online {
  background-color: var(--status-online);
}

.user-widget-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  gap: 2px;
}
.user-widget-text .username {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-normal);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  display: block;
  max-width: 100%;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.user-status-text {
  font-size: 0.72rem;
  color: var(--status-online);
  font-weight: 500;
}

.user-widget-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}
.user-widget-actions button {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s, background-color 0.12s;
}
.user-widget-actions button:hover {
  color: var(--text-normal);
  background-color: var(--bg-modifier-hover);
}
.user-widget-actions button.active-state {
  color: var(--status-danger);
}
.user-widget-actions button.active-state:hover {
  background-color: rgba(242, 63, 67, 0.15);
}
.user-widget-actions svg.icon {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   CENTER WORKSPACE
   ========================================================================== */
.center-workspace {
  flex: 1;
  height: 100%;
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Splash welcome screen */
.splash-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding: 40px;
  background-color: var(--bg-primary);
}
.splash-content {
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 32px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}
.splash-icon {
  width: 64px;
  height: 64px;
  color: var(--accent-blurple);
  margin-bottom: 20px;
  opacity: 0.9;
}
.splash-content h2 {
  font-family: var(--header-family);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-normal);
  margin-bottom: 12px;
}
.splash-content p {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.92rem;
  margin-bottom: 24px;
}
.splash-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  width: 100%;
}
.splash-actions .btn {
  flex: 1;
  min-width: 130px;
  border-radius: 8px;
}

/* Active room layout */
.active-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.room-header {
  height: 48px;
  border-bottom: 1px solid var(--border-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 2;
  background-color: var(--bg-primary);
}

.room-title {
  display: flex;
  align-items: center;
  gap: 6px;
}
.room-title h2 {
  font-family: var(--header-family);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-normal);
}
.room-title svg {
  color: var(--text-muted);
}

.media-workspace {
  flex: 1;
  min-height: 0;
  padding: clamp(10px, 1.8vw, 16px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.8vw, 16px);
  padding-bottom: 96px; /* Spacing for floating control bar */
  container-type: inline-size;
}
.media-workspace.screen-share-active {
  flex-direction: row;
  align-items: stretch;
}

/* Screen sharing overlay */
.screen-share-presentation {
  position: relative;
  background-color: #111214;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: 16/9;
  margin: 0 auto;
  width: 100%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.screen-share-header {
  position: relative;
  z-index: 10;
  background-color: var(--bg-tertiary);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border-primary);
}
.screen-share-header span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.screen-share-header strong {
  color: #ffffff;
}
.screen-share-presentation .video-wrapper {
  flex: 1;
  min-height: 0;
  background: #000;
}
.screen-share-presentation #screen-share-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.screen-share-presentation:fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  aspect-ratio: auto;
  background: #000 !important;
}

body.screen-share-window-fullscreen #titlebar,
body.screen-share-window-fullscreen .room-header {
  display: none !important;
}

body.screen-share-window-fullscreen .media-workspace {
  padding: 0 !important;
  padding-bottom: 0 !important;
  gap: 0 !important;
  container-type: normal !important;
}

body.screen-share-window-fullscreen .sidebar-left,
body.screen-share-window-fullscreen #workspace-sidebar-right,
body.screen-share-window-fullscreen .call-controls {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

body.screen-share-window-fullscreen .sidebar-left {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 20020;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-100%);
  box-shadow: 16px 0 44px rgba(0, 0, 0, 0.42);
}

body.screen-share-window-fullscreen .sidebar-left > * {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

body.screen-share-window-fullscreen .sidebar-left::after {
  content: "☰";
  position: absolute;
  top: 12px;
  left: calc(100% + 12px);
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  background: rgba(30, 31, 34, 0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  opacity: 0.4;
  cursor: pointer;
  transition: opacity 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  pointer-events: auto;
  z-index: 20030;
}

body.screen-share-window-fullscreen .sidebar-left::after:hover,
body.screen-share-window-fullscreen .sidebar-left:hover::after {
  opacity: 1;
  background-color: rgba(49, 51, 56, 0.95);
  border-color: var(--accent-blurple);
}

body.screen-share-window-fullscreen.fullscreen-left-visible .sidebar-left {
  transform: translateX(0);
}

body.screen-share-window-fullscreen.fullscreen-left-visible .sidebar-left > * {
  opacity: 1;
  pointer-events: auto;
}

body.screen-share-window-fullscreen.fullscreen-left-visible .sidebar-left::after {
  opacity: 0;
  pointer-events: none;
}

body.screen-share-window-fullscreen #workspace-sidebar-right {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 20020;
  transform: translateX(calc(100% + 18px));
  box-shadow: -16px 0 44px rgba(0, 0, 0, 0.42);
}

body.screen-share-window-fullscreen #workspace-sidebar-right:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

body.screen-share-window-fullscreen .call-controls {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20030;
  transform: translate(-50%, 18px);
}

body.screen-share-window-fullscreen.fullscreen-ui-visible .call-controls {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.screen-share-presentation.electron-fullscreen-active {
  position: fixed;
  inset: 0;
  z-index: 20000;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  aspect-ratio: auto;
  background: #000 !important;
}

.screen-share-presentation.electron-fullscreen-active .screen-share-header {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(17, 18, 20, 0.72);
  backdrop-filter: blur(12px);
}

.screen-share-presentation.electron-fullscreen-active:not(.hide-fullscreen-peers) .video-wrapper {
  padding-right: min(312px, 31vw);
}

.screen-share-presentation.electron-fullscreen-active.hide-fullscreen-peers .video-wrapper {
  padding-right: 0;
}
.screen-share-presentation.fullscreen-active .screen-share-header {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(17, 18, 20, 0.72);
  backdrop-filter: blur(12px);
}

.screen-share-presentation.fullscreen-active .screen-share-header,
.screen-share-presentation.fullscreen-active .fullscreen-peers-toggle,
.screen-share-presentation.fullscreen-active .fullscreen-peers-panel {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

body.fullscreen-ui-visible .screen-share-presentation.fullscreen-active .screen-share-header,
body.fullscreen-ui-visible .screen-share-presentation.fullscreen-active .fullscreen-peers-toggle,
body.fullscreen-ui-visible .screen-share-presentation.fullscreen-active .fullscreen-peers-panel {
  opacity: 1;
  pointer-events: auto;
}

.screen-share-presentation.fullscreen-active:not(.hide-fullscreen-peers) .video-wrapper {
  padding-right: min(312px, 31vw);
}

.screen-share-presentation.fullscreen-active.hide-fullscreen-peers .video-wrapper {
  padding-right: 0;
}

.fullscreen-peers-toggle,
.fullscreen-peers-panel {
  display: none;
}

.screen-share-presentation.fullscreen-active .fullscreen-peers-toggle {
  display: flex;
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(17, 18, 20, 0.72);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.screen-share-presentation.fullscreen-active:not(.hide-fullscreen-peers) .fullscreen-peers-panel {
  display: flex;
}

.screen-share-presentation.fullscreen-active:not(.hide-fullscreen-peers) .fullscreen-peers-toggle {
  display: none;
}

.fullscreen-peers-panel {
  position: absolute;
  top: 66px;
  right: 16px;
  bottom: 16px;
  width: min(280px, 28vw);
  min-width: 210px;
  z-index: 9;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(17, 18, 20, 0.78);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.45);
}

.fullscreen-peers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.fullscreen-peers-header button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.fullscreen-peers-header button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.fullscreen-peers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  overflow-y: auto;
}

.fullscreen-peer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.fullscreen-peer-item.speaking {
  box-shadow: inset 0 0 0 1px var(--status-online);
}

.fullscreen-peer-avatar {
  width: 34px;
  height: 34px;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.fullscreen-peer-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.fullscreen-peer-name,
.fullscreen-peer-username {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.fullscreen-peer-name {
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.fullscreen-peer-username {
  color: var(--accent-blurple);
  font-size: 0.68rem;
}

.fullscreen-peer-username.guest {
  color: var(--text-muted);
}

.fullscreen-peer-mic {
  color: var(--status-danger);
  font-size: 0.78rem;
  flex-shrink: 0;
}

/* Peer Cards Grid */
.featured-peer-zone {
  display: none;
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.featured-peer-zone.hidden {
  display: none !important;
}

.media-workspace.featured-active {
  overflow: hidden;
}

.media-workspace.featured-active .featured-peer-zone {
  display: flex;
  flex: 1 1 min(52vh, 520px);
  min-height: min(260px, 42vh);
  max-height: min(560px, 58vh);
}

.featured-peer-zone .peer-card {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
}

.peers-grid {
  --tile-min: clamp(150px, 20cqw, 220px);
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--tile-min)), 1fr));
  grid-auto-rows: min-content;
  row-gap: clamp(10px, 1.8vw, 16px);
  column-gap: clamp(10px, 1.8vw, 16px);
  align-items: start;
  align-content: center;
  justify-content: stretch;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.peers-grid.peers-count-1 {
  --tile-min: 220px;
  grid-template-columns: minmax(min(100%, 220px), min(100%, 640px));
  justify-content: center;
  align-content: center;
}

.peers-grid.peers-count-2 {
  --tile-min: clamp(180px, 34cqw, 360px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--tile-min)), 1fr));
  justify-content: center;
}

.peers-grid.peers-count-many {
  align-content: start;
}

.peers-grid.has-featured {
  flex: 0 0 auto;
  max-height: clamp(132px, 24vh, 220px);
  grid-auto-flow: column;
  grid-auto-columns: clamp(160px, 22cqw, 230px);
  grid-template-columns: none;
  grid-auto-rows: minmax(0, 1fr);
  align-content: start;
  overflow-x: auto;
  overflow-y: hidden;
  padding-right: 0;
  padding-bottom: 4px;
}

.peers-grid.has-featured.featured-strip-empty {
  display: none;
}
.media-workspace.screen-share-active .screen-share-presentation {
  flex: 1 1 auto;
  min-width: 0;
  aspect-ratio: auto;
}

.media-workspace.screen-share-active .peers-grid {
  flex: 0 0 clamp(180px, 24cqw, 320px);
  width: auto;
  height: 100%;
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(112px, 150px);
  align-content: start;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.media-workspace.screen-share-active .peer-card {
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
}

/* Premium Peer Cards — Figma: Participant Card 350x276 r:22 */
.peer-card {
  background-color: var(--bg-card);
  border-radius: 22px;
  aspect-ratio: 4 / 3;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
  transition: box-shadow 0.15s, border-color 0.15s;
  container-type: inline-size;
}
.peer-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  border-color: var(--border-secondary);
}
.peer-card.featured {
  border-color: var(--accent-blurple);
  box-shadow: 0 12px 32px rgba(10, 132, 255, 0.15);
}
.peer-card.speaking:not(.muted) {
  border-color: var(--accent-blurple);
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.3), 0 12px 28px rgba(0, 0, 0, 0.28);
}

.peer-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #050609;
  z-index: 1;
}
.peer-card.featured .peer-video {
  object-fit: contain;
}
.peer-video.mirrored {
  transform: scaleX(-1);
}
.peer-card.camera-on .peer-avatar-container {
  opacity: 0;
  transform: translateY(-6px) scale(0.92);
  pointer-events: none;
}

@media (max-width: 620px) {
  .peers-grid:not(.has-featured),
  .peers-grid.peers-count-2:not(.has-featured) {
    grid-template-columns: minmax(0, 1fr);
  }

  .media-workspace.featured-active .featured-peer-zone {
    min-height: clamp(180px, 42vh, 360px);
    max-height: clamp(220px, 48vh, 420px);
  }

  .peers-grid.has-featured {
    max-height: 144px;
    grid-auto-columns: minmax(148px, 190px);
  }
}

@media (max-width: 860px) {
  .media-workspace.screen-share-active {
    flex-direction: column;
  }

  .media-workspace.screen-share-active .peers-grid {
    flex: 0 0 150px;
    width: 100%;
    height: auto;
    grid-auto-flow: column;
    grid-auto-columns: minmax(160px, 220px);
    grid-auto-rows: 132px;
    grid-template-columns: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-right: 0;
    padding-bottom: 4px;
  }
}

@media (max-width: 760px) {
  .fullscreen-peers-panel {
    width: min(240px, calc(100vw - 24px));
    top: 58px;
    right: 12px;
    bottom: 12px;
  }
}

.peer-avatar-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  transition: opacity 0.18s ease, transform 0.2s;
}

.peer-card .avatar {
  width: clamp(76px, 20cqw, 140px);
  height: clamp(76px, 20cqw, 140px);
  font-size: clamp(1.8rem, 5cqw, 3.2rem);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

/* Glowing Talking Indicator */
.talking-ring {
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  border: 3px solid var(--status-online);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  box-shadow: 0 0 12px rgba(35, 165, 90, 0.4);
}
.peer-card.speaking:not(.muted) .talking-ring {
  opacity: 1;
  transform: scale(1);
}

/* Peer Info Name Tag — Figma: Name Tag 166x52 bg:#20242C r:16 */
.peer-info {
  position: absolute;
  bottom: 14px;
  left: 14px;
  background-color: var(--bg-card-elevated);
  border: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 3;
  max-width: calc(100% - 28px);
  min-width: 0;
}
.peer-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 2px;
}
.peer-name {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-normal);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 100%;
}
.peer-username {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 100%;
}
.peer-username.speaking-label {
  color: var(--accent-blurple);
}
.peer-username.guest {
  color: var(--text-muted);
}

/* Sound Reactions Popup & Items */
@keyframes reactionsPopupIn {
  from {
    opacity: 0;
    transform: translateX(-50%) scale(0.9) translateY(8px) translateZ(0);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1) translateY(0) translateZ(0);
  }
}

.reactions-popup {
  position: absolute;
  bottom: 54px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-card);
  border: 1px solid var(--border-secondary);
  border-radius: 20px;
  padding: 8px;
  display: flex;
  gap: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  z-index: 100;
}
.reactions-popup:not(.hidden) {
  animation: reactionsPopupIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: transform, opacity;
}
.reactions-popup.hidden {
  display: none !important;
}
.reaction-item {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s cubic-bezier(0.18, 0.89, 0.32, 1.28), background-color 0.15s ease;
}
.reaction-item:hover {
  transform: scale(1.25);
  background-color: var(--bg-modifier-hover);
}
.reaction-item:active {
  transform: scale(0.95);
}

/* Floating Reaction Emojis */
.floating-reaction-emoji {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  font-size: 2.8rem;
  pointer-events: none;
  z-index: 100;
  animation: float-up-fade 1.5s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
  will-change: transform, opacity;
}
@keyframes float-up-fade {
  0% {
    transform: translate3d(-50%, 0, 0) scale(0.5);
    opacity: 0;
  }
  20% {
    transform: translate3d(-50%, -20px, 0) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate3d(-50%, -120px, 0) scale(0.9);
    opacity: 0;
  }
}

/* Auto-Away Indicators & Coffee Overlay */
.status-indicator.away {
  background-color: #F0B232 !important;
}
.peer-card.away {
  opacity: 0.65;
  transition: opacity 0.3s ease;
}
.away-coffee-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(14, 16, 23, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  border-radius: 12px;
  z-index: 2;
}
.away-coffee-badge {
  background-color: #F0B232;
  color: #0E1017;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: away-bounce 2s infinite ease-in-out;
  display: flex;
  align-items: center;
  gap: 4px;
}
@keyframes away-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}
.peer-username.guest {
  color: var(--text-muted);
}
.peer-mute-indicator {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.peer-mute-indicator svg {
  width: 14px;
  height: 14px;
  color: var(--status-danger);
}

/* Connection quality badge on peer card */
.connection-quality-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(14, 16, 23, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: conn-badge-pulse 1.6s ease-in-out infinite;
}
.peer-card.poor-connection .connection-quality-badge {
  color: #F0B232;
  border-color: rgba(240, 178, 50, 0.4);
}
.peer-card.offline-connection .connection-quality-badge {
  color: var(--status-danger);
  border-color: rgba(239, 68, 68, 0.4);
}
@keyframes conn-badge-pulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}
.peer-card.poor-connection {
  border-color: rgba(240, 178, 50, 0.5);
}
.peer-card.offline-connection {
  border-color: rgba(239, 68, 68, 0.5);
  opacity: 0.75;
}

/* Floating control bar */
.call-controls {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  height: 64px;
  background: rgba(14, 16, 23, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

.control-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: #ffffff;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

.control-btn:hover {
  background-color: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.12);
  transform: scale(1.05);
}

.control-btn:active {
  transform: scale(0.95);
}

/* Figma Active / Blue State (Mic on, sound on, active feature) */
.control-btn.is-active,
.control-btn.active-blue {
  background-color: var(--accent-blurple) !important;
  border-color: var(--accent-blurple) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(10, 132, 255, 0.4);
}

.control-btn.is-active:hover,
.control-btn.active-blue:hover {
  background-color: var(--accent-blurple-hover) !important;
  border-color: var(--accent-blurple-hover) !important;
}

/* Figma Muted / Red State (Mic off, sound off, leave) */
.control-btn.is-muted,
.control-btn.active-red,
.control-btn.btn-danger,
#control-mic-btn.active-state,
#user-mute-btn.active-state,
#user-deafen-btn.active-state {
  background-color: var(--accent-red) !important;
  border-color: var(--accent-red) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(255, 69, 58, 0.4);
}

.control-btn.is-muted:hover,
.control-btn.active-red:hover,
.control-btn.btn-danger:hover,
#control-mic-btn.active-state:hover,
#user-mute-btn.active-state:hover,
#user-deafen-btn.active-state:hover {
  background-color: var(--accent-red-hover) !important;
  border-color: var(--accent-red-hover) !important;
}

/* Figma: Chat button is always blue when chat is open */
#control-chat-btn.active-blue {
  background-color: var(--accent-blurple) !important;
  border-color: var(--accent-blurple) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(10, 132, 255, 0.4);
}

/* Figma: Control buttons default — #272B34 */
.control-btn {
  background-color: #272B34;
  border-color: transparent;
}

.control-btn svg {
  width: 22px;
  height: 22px;
  display: block;
  margin: auto;
  pointer-events: none;
}
.control-btn .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: var(--status-danger);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   RIGHT SIDEBAR (CHAT)
   ========================================================================== */
.sidebar-right {
  width: var(--sidebar-right-width);
  height: 100%;
  background-color: var(--bg-secondary);
  border-left: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-width: 260px;
  max-width: min(560px, 62vw);
  position: relative;
}
.sidebar-right:not(.hidden) {
  animation: sidebarRightSlideIn 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: transform, opacity;
}
.sidebar-right.is-closing {
  animation: sidebarRightSlideOut 200ms cubic-bezier(0.25, 1, 0.5, 1) both !important;
  pointer-events: none;
}
.sidebar-right.hidden {
  display: none !important;
}

@keyframes sidebarRightSlideIn {
  from {
    transform: translate3d(100%, 0, 0);
    opacity: 0.8;
  }
  to {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}

@keyframes sidebarRightSlideOut {
  from {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  to {
    transform: translate3d(100%, 0, 0);
    opacity: 0.8;
  }
}

.chat-resize-handle {
  position: absolute;
  left: -4px;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  z-index: 5;
}

.chat-resize-handle::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background-color 0.15s;
}

.chat-resize-handle:hover::after,
body.resizing-chat .chat-resize-handle::after {
  background: var(--accent-blurple);
}

body.resizing-chat {
  cursor: ew-resize;
}

/* Figma: Panel Tabs bg:#20242C r:16 */
.sidebar-right-tabs {
  height: 48px;
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  padding: 0 16px;
  align-items: center;
  gap: 4px;
  background-color: var(--bg-secondary);
  z-index: 2;
}
.tab-btn {
  background: var(--bg-card-elevated);
  border: none;
  border-radius: 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  height: 36px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  letter-spacing: 0.01em;
}
.tab-btn:hover {
  color: var(--text-normal);
  background: var(--bg-modifier-hover);
}
.tab-btn.active {
  color: var(--accent-blurple);
  background: var(--bg-card-elevated);
}

.sidebar-right-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-pane {
  display: none;
  height: 100%;
  flex-direction: column;
}
.tab-pane.active {
  display: flex;
  animation: tabPaneFadeIn 180ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Figma: Message card bg:#1B1E24 r:18 */
.chat-message-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background-color: var(--bg-card);
  border: none;
  padding: 12px 16px;
  border-radius: 18px;
  transition: background-color 0.15s ease;
}
.chat-message-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
}
.chat-message-item.message-appear {
  animation: messageBubbleSlideIn 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: transform, opacity;
  transform-origin: bottom left;
}
.chat-message-item.is-own.message-appear {
  transform-origin: bottom right;
}
@keyframes messageBubbleSlideIn {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}
.chat-message-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.chat-message-sender {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-normal);
}
.chat-message-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.chat-message-body {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-normal);
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  user-select: text;
}
.chat-link {
  color: var(--text-link) !important;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  word-break: break-all;
  transition: opacity 0.15s ease;
  pointer-events: auto !important;
  user-select: text;
  -webkit-user-select: text;
}
.chat-link:hover {
  text-decoration: underline !important;
  opacity: 0.85;
}
.chat-system-message {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 12px 16px;
  border-radius: 10px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  margin: 12px 0;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.chat-system-message::before {
  content: "💬";
  font-size: 1.2rem;
  margin-bottom: 2px;
}

/* Figma: Chat Input bg:#20242C r:18 */
.chat-input-area {
  padding: 12px 16px;
  background-color: var(--bg-secondary);
  position: relative;
}
.chat-input-wrapper {
  display: flex;
  align-items: center;
  background-color: var(--bg-card-elevated);
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 0 16px;
  min-height: 54px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chat-input-wrapper:focus-within {
  border-color: var(--accent-blurple);
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.15);
}
.btn-emoji {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px;
  opacity: 0.5;
  transition: opacity 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.btn-emoji:hover {
  opacity: 1;
}
.btn-emoji:active {
  transform: scale(0.95);
}
.chat-input-wrapper input,
.chat-input-wrapper textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 11px 8px;
  color: var(--text-normal);
  font-size: 0.88rem;
  min-width: 0;
  resize: none;
  font-family: inherit;
  line-height: 1.4;
  min-height: 20px;
  max-height: 140px;
  overflow-y: auto;
}
.btn-send {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.btn-send:hover {
  color: #ffffff;
}
.btn-send:active {
  transform: scale(0.95);
}
.btn-send:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  color: var(--text-tertiary) !important;
}
.btn-send svg {
  width: 18px;
  height: 18px;
}

/* Emoji Picker Panel */
.emoji-picker {
  position: absolute;
  bottom: 64px;
  left: 16px;
  right: 16px;
  background-color: rgba(30, 34, 48, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  height: 310px;
  z-index: 10;
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 1;
  transform: scale(1) translateY(0);
}
.emoji-picker.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: scale(0.95) translateY(10px) !important;
}

.emoji-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  border-bottom: 1px solid var(--border-primary);
  padding: 6px 6px;
  overflow-x: hidden;
  overflow-y: hidden;
}
.emoji-tab-btn {
  flex: 1 1 0;
  min-width: 0;
  max-width: 32px;
  height: 30px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.emoji-tab-btn:hover {
  background-color: var(--bg-modifier-hover);
}
.emoji-tab-btn.active {
  background-color: var(--bg-modifier-selected);
}
.emoji-tab-icon {
  max-width: 22px;
  max-height: 22px;
  width: auto;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  image-rendering: pixelated;
}
.btn-emoji-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  pointer-events: none;
  image-rendering: pixelated;
  vertical-align: middle;
}
.emoji-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  justify-items: center;
  align-content: start;
}
.emoji-item {
  background: transparent;
  border: none;
  font-size: 1.35rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.1s, transform 0.1s;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.emoji-item:hover {
  background-color: var(--bg-modifier-hover);
  transform: scale(1.15);
}
.emoji-item img {
  max-width: 28px;
  max-height: 28px;
  object-fit: contain;
}

/* Kolobki in chat */
.chat-kolobok {
  vertical-align: middle;
  display: inline-block;
  height: 24px;
  width: auto;
  max-width: 48px;
  object-fit: contain;
  margin: -2px 2px;
  image-rendering: auto;
}
.chat-kolobok-large {
  height: 42px;
  max-width: 80px;
  margin: 4px;
  vertical-align: middle;
}
.chat-kolobok-sticker-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

/* ==========================================================================
   MODAL WINDOWS & SCREEN SHARING PICKER
   ========================================================================== */
@keyframes modalOverlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalOverlayOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes modalCardPopIn {
  0% {
    opacity: 0;
    transform: scale(0.93) translateY(14px) translateZ(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0) translateZ(0);
  }
}

@keyframes modalCardPopOut {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0) translateZ(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.95) translateY(10px) translateZ(0);
  }
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(11, 13, 18, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-overlay:not(.hidden) {
  animation: modalOverlayIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.modal-overlay:not(.hidden) .modal-card {
  animation: modalCardPopIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: transform, opacity;
  transform-origin: center center;
}
.modal-overlay.is-closing {
  animation: modalOverlayOut 0.18s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
  pointer-events: none !important;
}
.modal-overlay.is-closing .modal-card {
  animation: modalCardPopOut 0.18s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
  pointer-events: none !important;
}
.modal-overlay.hidden {
  display: none !important;
}

.modal-card {
  background: rgba(30, 34, 48, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
}
.modal-card.wide {
  max-width: 640px;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h2 {
  font-family: var(--header-family);
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
}
.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}
.modal-close-btn:hover {
  color: #ffffff;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: 480px;
}

.modal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.modal-divider::before,
.modal-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border-primary);
}

.input-hint {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.join-existing-room-form {
  padding: 14px;
  border: 1px solid rgba(88, 101, 242, 0.22);
  border-radius: 8px;
  background: rgba(88, 101, 242, 0.08);
}

/* Modern Settings Dialog (Profile / Devices / Audio / Video / etc.) */
#settings-modal .modal-card.settings-modal-card {
  width: min(840px, calc(100vw - 32px));
  max-width: 840px;
  height: auto;
  max-height: calc(100vh - 40px);
  background: #111724;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.settings-modal-header {
  height: 52px;
  min-height: 52px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: #111724;
}

.settings-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-header-icon {
  width: 18px;
  height: 18px;
  color: #94a3b8;
  flex-shrink: 0;
}

.settings-modal-header h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #f8fafc;
  margin: 0;
  letter-spacing: -0.01em;
}

.settings-modal-header .modal-close-btn {
  background: transparent;
  border: none;
  color: #64748b;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.15s, color 0.15s;
}

.settings-modal-header .modal-close-btn svg {
  width: 16px;
  height: 16px;
}

.settings-modal-header .modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
}

.settings-modal-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #111724;
}

/* Sidebar navigation */
.settings-sidebar {
  width: 190px;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
}

.settings-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.12s, color 0.12s;
}

.settings-nav-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: inherit;
}

.settings-nav-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f1f5f9;
}

.settings-nav-btn.active {
  background: #1d65c1;
  color: #ffffff;
  font-weight: 600;
}

.settings-nav-btn.active:hover {
  background: #1856a7;
}

.settings-nav-spacer {
  flex: 1;
  min-height: 20px;
}

/* Right Content Area */
.settings-content {
  flex: 1;
  min-width: 0;
  padding: 16px 24px 20px 24px;
  overflow-y: auto;
}

.settings-content::-webkit-scrollbar {
  width: 6px;
}
.settings-content::-webkit-scrollbar-track {
  background: transparent;
}
.settings-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.settings-tab-panel {
  display: block;
}

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

.settings-section {
  margin-bottom: 16px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

#settings-modal .settings-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f8fafc;
  text-transform: none;
  letter-spacing: -0.01em;
  margin: 0;
}

#settings-modal .settings-section > .settings-section-title {
  margin-bottom: 12px;
}

.settings-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.settings-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-section-title-wrap .settings-section-title {
  margin: 0;
}

.settings-section-icon {
  width: 15px;
  height: 15px;
  color: #94a3b8;
  flex-shrink: 0;
}

.settings-subheading {
  margin: 12px 0 8px 0;
}

/* Profile Card */
.settings-profile-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.settings-avatar-wrapper {
  position: relative;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
}

.settings-avatar-wrapper .profile-avatar-preview {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: hidden;
  background: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 600;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.08);
}

.settings-avatar-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1a2234;
  border: 2px solid #111724;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.15s, color 0.15s;
}

.settings-avatar-badge:hover {
  background: #243048;
  color: #ffffff;
}

.settings-avatar-badge svg {
  width: 13px;
  height: 13px;
}

.settings-profile-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

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

.settings-field-group label {
  font-size: 0.76rem;
  font-weight: 500;
  color: #94a3b8;
  margin: 0;
}

.settings-input-with-btn {
  display: flex;
  gap: 10px;
  align-items: center;
}

.settings-input-with-btn .settings-input {
  flex: 1;
}

.settings-btn-change-avatar {
  background: #1d65c1;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s;
}

.settings-btn-change-avatar:hover {
  background: #1856a7;
}

.settings-input-with-action {
  position: relative;
  width: 100%;
}

.settings-input-with-action .settings-input {
  width: 100%;
  padding-right: 36px;
}

.settings-copy-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #64748b;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, background-color 0.15s;
}

.settings-copy-btn:hover {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
}

.settings-copy-btn svg {
  width: 15px;
  height: 15px;
}

.settings-field-hint {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.3;
}

/* Devices Section */
.settings-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(29, 101, 193, 0.12);
  border: 1px solid rgba(29, 101, 193, 0.35);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.76rem;
  font-weight: 500;
  color: #38bdf8;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.settings-pill-btn:hover {
  background: rgba(29, 101, 193, 0.2);
  border-color: rgba(29, 101, 193, 0.5);
}

.settings-pill-btn svg {
  width: 14px;
  height: 14px;
}

.settings-devices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.settings-device-item {
  background: #0c121e;
  border: 1px solid #1e2b40;
  border-radius: 8px;
  padding: 7px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
}

.settings-device-item:hover {
  border-color: #2a3d5b;
}

.settings-device-item:focus-within,
.settings-device-item.is-open {
  border-color: #1d65c1;
  box-shadow: 0 0 0 1px rgba(29, 101, 193, 0.4);
}

.settings-device-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-device-label svg {
  width: 14px;
  height: 14px;
  color: #94a3b8;
  flex-shrink: 0;
}

.settings-device-label label {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
  margin: 0;
  cursor: pointer;
}

.settings-select-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

/* Custom Select Trigger button */
.settings-custom-select-trigger {
  width: 100%;
  background: transparent;
  border: none;
  padding: 3px 0;
  color: #f1f5f9;
  font-size: 0.82rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  outline: none;
  text-align: left;
}

.settings-custom-select-text {
  flex: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  color: #f1f5f9;
}

.settings-select-arrow {
  width: 14px;
  height: 14px;
  color: #64748b;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s;
}

.settings-custom-select-trigger.is-open .settings-select-arrow,
.settings-device-item.is-open .settings-select-arrow {
  transform: rotate(180deg);
  color: #38bdf8;
}

/* Hidden native select: remains interactive for DOM/tests, but visually hidden */
.settings-select-hidden {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
}

/* Custom Floating Dropdown Menu (Portal) */
.settings-custom-dropdown-portal {
  background: #141c2c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
  max-height: 240px;
  overflow-y: auto;
  padding: 5px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-sizing: border-box;
  animation: settingsDropdownFadeIn 140ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.settings-custom-dropdown-portal::-webkit-scrollbar {
  width: 5px;
}
.settings-custom-dropdown-portal::-webkit-scrollbar-track {
  background: transparent;
}
.settings-custom-dropdown-portal::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
.settings-custom-dropdown-portal::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.settings-custom-dropdown-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #cbd5e1;
  cursor: pointer;
  transition: background-color 0.12s, color 0.12s;
  user-select: none;
}

.settings-custom-dropdown-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.settings-custom-dropdown-option.selected {
  background: rgba(29, 101, 193, 0.25);
  color: #60a5fa;
  font-weight: 600;
}

.settings-custom-dropdown-option-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-custom-dropdown-check {
  width: 14px;
  height: 14px;
  color: #38bdf8;
  flex-shrink: 0;
}

/* Parameters list & toggles */
.settings-params-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-param-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0;
}

.settings-param-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-param-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #94a3b8;
}

.settings-param-icon svg {
  width: 16px;
  height: 16px;
}

#settings-modal .toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 0;
}

#settings-modal .toggle-track {
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background-color: #243048;
  display: block;
  position: relative;
  transition: background-color 0.15s;
}

#settings-modal .toggle-thumb {
  width: 16px;
  height: 16px;
  background-color: #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.15s;
}

#settings-modal .toggle-btn.active .toggle-track {
  background-color: #1d65c1;
}

#settings-modal .toggle-btn.active .toggle-thumb {
  transform: translateX(16px);
}

.settings-param-text {
  display: flex;
  flex-direction: column;
}

.settings-param-text strong {
  font-size: 0.84rem;
  font-weight: 500;
  color: #f1f5f9;
}

.settings-param-text span {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 1px;
}

.modal-footer {
  padding: 14px 20px;
  background-color: var(--bg-tertiary);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-primary);
}

/* Settings Form Elements */
.settings-group {
  margin-bottom: 18px;
}
.settings-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.settings-select {
  width: 100%;
  padding: 11px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  color: var(--text-normal);
  outline: none;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.settings-select:focus {
  border-color: var(--accent-blurple);
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.15);
}

.settings-input {
  width: 100%;
  padding: 10px 12px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  color: var(--text-normal);
  outline: none;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.settings-input:focus {
  border-color: var(--accent-blurple);
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.15);
}

.settings-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

textarea.settings-input {
  resize: vertical;
  min-height: 64px;
  font-family: inherit;
  line-height: 1.4;
}

.settings-section-title {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.profile-settings-panel {
  display: grid;
  grid-template-columns: minmax(190px, 0.9fr) minmax(0, 1.4fr);
  gap: 18px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  background: var(--bg-tertiary);
}

.profile-settings-copy h3 {
  margin: 0 0 8px;
  color: var(--text-normal);
  font-size: 1rem;
  font-weight: 600;
}

.profile-settings-copy p {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.profile-settings-card {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.015);
}

.profile-avatar-editor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.profile-avatar-preview {
  width: 88px;
  height: 88px;
  font-size: 1.34rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.profile-avatar-file-btn {
  width: 100%;
  padding: 8px 10px;
  font-size: 0.78rem;
  cursor: pointer;
}

.profile-fields {
  min-width: 0;
}

#save-profile-btn {
  margin-top: 2px;
}

.user-widget-info {
  cursor: default;
  border-radius: 6px;
  padding: 4px;
  margin: -4px;
  transition: none;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

@media (max-width: 768px) {
  #settings-modal .modal-card.settings-modal-card {
    width: calc(100vw - 16px);
    height: calc(100vh - 24px);
    max-height: calc(100vh - 24px);
  }

  .settings-modal-body {
    flex-direction: column;
  }

  .settings-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 8px 12px;
  }

  .settings-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .settings-nav-btn {
    white-space: nowrap;
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .settings-nav-spacer {
    display: none;
  }

  .settings-devices-grid {
    grid-template-columns: 1fr;
  }

  .settings-profile-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .settings-profile-fields {
    width: 100%;
    text-align: left;
  }

  .settings-input-with-btn {
    flex-direction: column;
    align-items: stretch;
  }
}
.settings-toggle-row label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-normal);
}

.avatar-crop-modal-card {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.avatar-crop-modal-body {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(130px, 170px);
  gap: clamp(12px, 2vw, 16px);
  padding: clamp(12px, 2.4vw, 16px);
  align-items: center;
  overflow: hidden;
  min-height: 0;
}

.avatar-crop-stage {
  position: relative;
  width: clamp(180px, min(36vmin, 42vw), 256px);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(88, 101, 242, 0.22), rgba(17, 19, 24, 0.9)),
    #111318;
  box-shadow:
    0 0 0 12px rgba(88, 101, 242, 0.08),
    0 18px 46px rgba(0, 0, 0, 0.45);
  cursor: grab;
  touch-action: none;
}

.avatar-crop-stage.dragging {
  cursor: grabbing;
}

.avatar-crop-stage img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  max-height: none;
  user-select: none;
  pointer-events: none;
  transform-origin: center;
}

.avatar-crop-grid {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    linear-gradient(to right, transparent 33.1%, rgba(255, 255, 255, 0.24) 33.2%, rgba(255, 255, 255, 0.24) 33.5%, transparent 33.6%),
    linear-gradient(to right, transparent 66.1%, rgba(255, 255, 255, 0.2) 66.2%, rgba(255, 255, 255, 0.2) 66.5%, transparent 66.6%),
    linear-gradient(to bottom, transparent 33.1%, rgba(255, 255, 255, 0.24) 33.2%, rgba(255, 255, 255, 0.24) 33.5%, transparent 33.6%),
    linear-gradient(to bottom, transparent 66.1%, rgba(255, 255, 255, 0.2) 66.2%, rgba(255, 255, 255, 0.2) 66.5%, transparent 66.6%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.86);
  pointer-events: none;
}

.avatar-crop-grid::before,
.avatar-crop-grid::after {
  display: none;
}

.avatar-crop-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  min-width: 0;
}

.avatar-crop-result-preview {
  width: clamp(56px, 13vmin, 78px);
  height: clamp(56px, 13vmin, 78px);
  font-size: 1.2rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.avatar-crop-side p {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.42;
}

.avatar-crop-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .avatar-crop-modal-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .avatar-crop-side {
    max-width: 320px;
    margin: 0 auto;
  }
}

@media (max-height: 620px) {
  .avatar-crop-modal-card .modal-header {
    padding: 10px 14px;
  }

  .avatar-crop-modal-card .modal-footer {
    padding: 10px 14px;
  }

  .avatar-crop-stage {
    width: clamp(150px, 32vmin, 220px);
  }

  .avatar-crop-side p {
    display: none;
  }
}

/* Custom switch toggle */
.toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 0;
}
.toggle-track {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background-color: #3f4248;
  display: block;
  position: relative;
  transition: background-color 0.15s;
}
.toggle-thumb {
  width: 14px;
  height: 14px;
  background-color: #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.15s;
}
.toggle-btn.active .toggle-track {
  background-color: var(--status-online);
}
.toggle-btn.active .toggle-thumb {
  transform: translateX(16px);
}

/* Mic test bar */
.mic-test-container {
  height: 6px;
  background-color: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border-primary);
  margin-top: 8px;
}
.mic-test-bar {
  width: 0%;
  height: 100%;
  background-color: var(--status-online);
  border-radius: 3px;
  transition: width 0.05s ease-out;
}
.mic-test-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
  margin-top: 6px;
}

/* Custom Radio Group (Channels) */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.radio-container {
  display: flex;
  cursor: pointer;
}
.radio-container input[type="radio"] {
  display: none;
}
.radio-custom {
  flex: 1;
  padding: 12px;
  background-color: var(--bg-tertiary);
  border-radius: 6px;
  border: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.radio-container input[type="radio"]:checked + .radio-custom {
  border-color: var(--accent-blurple);
  background-color: rgba(88, 101, 242, 0.05);
  box-shadow: 0 0 0 1px var(--accent-blurple);
}
.radio-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-normal);
}
.radio-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Screen sharing picker: one selection, one consent switch, one primary CTA. */
#screen-picker-modal {
  padding: 16px;
}

#screen-picker-modal .screen-picker-card {
  width: min(880px, calc(100vw - 32px));
  max-width: 880px;
  max-height: min(760px, calc(100vh - 32px));
  background: color-mix(in srgb, var(--bg-primary) 94%, transparent);
}

.screen-picker-header {
  flex: 0 0 auto;
  padding: 18px 22px;
}

.screen-picker-header > div {
  min-width: 0;
}

.screen-picker-header h2 {
  margin: 0;
}

.screen-picker-header p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.screen-picker-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  padding: 0 22px 16px;
}

.screen-picker-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  margin: 0 -4px 14px;
  padding: 10px 4px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-primary);
  scrollbar-width: none;
}

.screen-picker-tabs::-webkit-scrollbar {
  display: none;
}

.picker-tab {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.picker-tab:hover {
  color: var(--text-normal);
}

.picker-tab.active,
.picker-tab[aria-selected="true"] {
  border-bottom-color: var(--accent-blurple);
  color: var(--text-normal);
}

.picker-tab:focus-visible,
.screen-source-item:focus-visible,
.screen-audio-toggle:focus-visible,
.screen-picker-quality-details summary:focus-visible {
  outline: 2px solid var(--accent-blurple);
  outline-offset: 2px;
}

.screen-source-panel {
  min-height: 0;
}

.screen-source-panel:has(> .screen-sources-list.hidden) {
  display: none;
}

.screen-sources-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  min-height: 190px;
  max-height: min(310px, 42vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 6px 4px 2px;
}

.screen-sources-list::-webkit-scrollbar {
  width: 6px;
}

.screen-sources-list::-webkit-scrollbar-track {
  background: transparent;
}

.screen-sources-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.screen-source-item {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  padding: 8px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--bg-tertiary);
  color: var(--text-normal);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.screen-source-item:hover {
  border-color: color-mix(in srgb, var(--accent-blurple) 55%, transparent);
  background: color-mix(in srgb, var(--bg-tertiary) 82%, var(--accent-blurple));
}

.screen-source-item.selected,
.screen-source-item[aria-checked="true"] {
  border-color: var(--accent-blurple);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-blurple) 45%, transparent);
}

.screen-source-item[aria-checked="true"]::after {
  content: "✓";
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid var(--bg-primary);
  border-radius: 999px;
  background: var(--accent-blurple);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.screen-source-thumb {
  display: flex;
  width: 100%;
  aspect-ratio: 16 / 10;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: 8px;
  background: #090b10;
}

.screen-source-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.screen-source-name {
  width: 100%;
  overflow: hidden;
  color: var(--text-normal);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-picker-empty-state {
  grid-column: 1 / -1;
  display: grid;
  min-height: 180px;
  place-items: center;
  color: var(--text-muted);
  font-size: 0.84rem;
  text-align: center;
}

#screen-picker-modal .browser-share-helper {
  min-height: 190px;
  grid-template-columns: 48px minmax(0, 1fr);
  padding: 24px;
  border-radius: 14px;
}

.screen-picker-status {
  min-height: 20px;
  margin: 10px 2px 0;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.screen-picker-status.is-error {
  color: var(--status-danger);
}

.screen-picker-settings {
  display: grid;
  flex: 0 0 auto;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-primary);
}

.screen-audio-mode-picker {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  background: var(--bg-secondary);
}

.screen-audio-mode-copy {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
}

.screen-audio-mode-copy strong {
  color: var(--text-normal);
  font-size: 0.86rem;
}

.screen-audio-mode-copy span {
  max-width: 620px;
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

.screen-audio-toggle {
  display: inline-flex;
  min-width: 92px;
  min-height: 38px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 650;
  cursor: pointer;
}

.screen-audio-toggle-track {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  border: 1px solid var(--border-primary);
  border-radius: 999px;
  background: var(--bg-tertiary);
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.screen-audio-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.14s ease, background-color 0.14s ease;
}

.screen-audio-toggle[aria-checked="true"] {
  color: var(--text-normal);
}

.screen-audio-toggle[aria-checked="true"] .screen-audio-toggle-track {
  border-color: var(--accent-blurple);
  background: var(--accent-blurple);
}

.screen-audio-toggle[aria-checked="true"] .screen-audio-toggle-thumb {
  transform: translateX(18px);
  background: #fff;
}

.screen-audio-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.picker-audio-warning {
  display: flex;
  margin: -2px 4px 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

.picker-audio-warning .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.screen-picker-quality-details {
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  background: var(--bg-secondary);
}

.screen-picker-quality-details summary {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px;
  color: var(--text-normal);
  font-size: 0.8rem;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

.screen-picker-quality-details summary::-webkit-details-marker {
  display: none;
}

.screen-picker-quality-details summary::before {
  content: "›";
  color: var(--text-muted);
  font-size: 1rem;
  transform: rotate(0deg);
}

.screen-picker-quality-details[open] summary::before {
  transform: rotate(90deg);
}

.screen-picker-quality-details summary > span:first-child {
  margin-right: auto;
}

.screen-picker-quality-summary {
  overflow: hidden;
  color: var(--text-muted);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-picker-quality-content {
  display: grid;
  grid-template-columns: minmax(140px, 0.45fr) minmax(220px, 1fr);
  gap: 6px 12px;
  padding: 0 14px 14px;
  border-top: 1px solid var(--border-primary);
}

.screen-picker-quality-content label {
  align-self: center;
  color: var(--text-muted);
  font-size: 0.74rem;
}

.screen-picker-quality-content .settings-select {
  margin-top: 10px;
}

.screen-picker-quality-content p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.screen-picker-footer {
  flex: 0 0 auto;
  padding: 14px 22px;
}

.screen-picker-footer .btn {
  min-height: 40px;
}

.screen-picker-footer #screen-picker-start-btn {
  min-width: 190px;
}

.screen-picker-footer #screen-picker-start-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

@media (max-width: 680px) {
  #screen-picker-modal {
    align-items: stretch;
    padding: 0;
  }

  #screen-picker-modal .screen-picker-card {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }

  .screen-picker-header {
    padding: 14px 16px;
  }

  .screen-picker-body {
    padding: 0 14px 12px;
  }

  .screen-picker-tabs {
    margin-bottom: 10px;
  }

  .picker-tab {
    padding: 0 11px;
    font-size: 0.8rem;
  }

  .screen-sources-list {
    grid-template-columns: 1fr;
    height: 100%;
    min-height: 0;
    max-height: none;
  }

  .screen-source-panel {
    flex: 1 1 auto;
    overflow: hidden;
  }

  .screen-source-item {
    display: grid;
    grid-template-columns: minmax(112px, 42%) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
  }

  .screen-source-thumb {
    margin: 0;
  }

  .screen-audio-mode-picker {
    align-items: flex-start;
  }

  .picker-audio-warning {
    align-items: flex-start;
    flex-direction: column;
  }

  .screen-audio-toggle {
    min-width: 80px;
  }

  .screen-picker-quality-content {
    grid-template-columns: 1fr;
  }

  .screen-picker-quality-content p {
    grid-column: auto;
  }

  .screen-picker-footer {
    padding: 12px 14px;
  }
}

@media (max-width: 380px) {
  .screen-picker-header p {
    display: none;
  }

  .screen-audio-mode-picker {
    flex-direction: column;
  }

  .screen-audio-toggle {
    justify-content: flex-start;
  }

  .screen-picker-footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .screen-picker-footer .btn,
  .screen-picker-footer #screen-picker-start-btn {
    width: 100%;
  }

  .screen-picker-footer #screen-picker-start-btn {
    grid-row: 1;
  }
}

@media (forced-colors: active) {
  .screen-source-item,
  .screen-audio-toggle-track,
  .screen-picker-quality-details {
    border: 1px solid CanvasText;
  }

  .screen-source-item[aria-checked="true"] {
    outline: 3px solid Highlight;
  }

  .screen-audio-toggle[aria-checked="true"] .screen-audio-toggle-track {
    background: Highlight;
  }
}

/* ==========================================================================
   SLIDE-IN GLASSMORPHIC TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 40px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1000;
  pointer-events: none;
}
.toast {
  background: rgba(43, 45, 49, 0.85);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  animation: toast-slide-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  max-width: 340px;
  min-width: 280px;
}
.toast.removing {
  animation: toast-slide-out 0.25s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards;
}
.toast-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.toast-icon.join {
  background-color: var(--status-online);
  box-shadow: 0 0 10px var(--status-online);
}
.toast-icon.leave {
  background-color: var(--status-danger);
  box-shadow: 0 0 10px var(--status-danger);
}
.toast-message {
  font-size: 0.85rem;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.4;
}

@keyframes toast-slide-in {
  from { transform: translateX(120%) scale(0.9); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}
@keyframes toast-slide-out {
  from { transform: translateX(0) scale(1); opacity: 1; }
  to { transform: translateX(120%) scale(0.9); opacity: 0; }
}

/* ==========================================================================
   CONTEXT MENU
   ========================================================================== */
@keyframes contextMenuPopIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(-4px) translateZ(0);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0) translateZ(0);
  }
}

.custom-context-menu {
  position: fixed;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  padding: 6px;
  z-index: 500;
  min-width: 238px;
}
.custom-context-menu:not(.hidden) {
  animation: contextMenuPopIn 0.16s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: transform, opacity;
  transform-origin: top left;
}
.custom-context-menu.hidden {
  display: none !important;
}
.context-menu-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  border-radius: 4px;
  color: var(--text-normal);
  font-weight: 500;
  transition: background-color 0.1s, color 0.1s;
}
.context-menu-item:hover {
  background-color: var(--accent-blurple);
  color: #ffffff;
}

.context-menu-separator {
  height: 1px;
  margin: 6px;
  background: var(--border-primary);
}

.context-menu-volume {
  padding: 8px 10px 10px;
}

.context-menu-volume-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.context-menu-volume-header strong {
  color: var(--text-normal);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.context-menu-volume-controls {
  display: grid;
  grid-template-columns: 30px minmax(112px, 1fr) 30px;
  align-items: center;
  gap: 8px;
}

.context-menu-volume-btn,
.context-menu-volume-reset {
  border: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  color: var(--text-normal);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s;
}

.context-menu-volume-btn {
  width: 30px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.context-menu-volume-btn:hover,
.context-menu-volume-reset:hover {
  background: var(--bg-modifier-hover);
  border-color: var(--accent-blurple);
}

.context-menu-volume-slider {
  width: 100%;
  accent-color: var(--accent-blurple);
  cursor: pointer;
}

.context-menu-volume-reset {
  width: 100%;
  margin-top: 8px;
  padding: 7px 9px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Global utility to hide elements */
.hidden {
  display: none !important;
}

/* Pacman avatar speaking animation */
.avatar {
  position: relative;
  overflow: hidden;
  --avatar-mouth-travel: 10px;
}

.avatar.has-image-avatar {
  background-image: var(--avatar-image);
  background-size: cover;
  background-position: center;
  color: transparent;
}

.avatar::before,
.avatar::after {
  content: attr(data-initials);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: var(--avatar-color, #5865f2);
  background-image: var(--avatar-image, none);
  background-size: cover;
  background-position: center;
  color: #ffffff;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  text-transform: inherit;
  text-shadow: inherit;
  pointer-events: none;
  transition: opacity 0.05s ease;
  z-index: 2;
}

.avatar.has-image-avatar::before,
.avatar.has-image-avatar::after {
  color: transparent;
  background-color: transparent !important;
}

.avatar::before {
  border-radius: 50%;
  clip-path: inset(0 0 50% 0);
  transform-origin: center bottom;
}

.avatar::after {
  border-radius: 50%;
  clip-path: inset(50% 0 0 0);
  transform-origin: center top;
}

.peer-card.speaking:not(.muted) .avatar,
.focus-participant-item.speaking .avatar,
.speaker-strip-item.speaking .avatar,
.fullscreen-peer-item.speaking .avatar,
.channel-user-item.speaking .avatar {
  background: transparent !important;
  transition: none !important;
  color: transparent;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.peer-card.speaking:not(.muted) .avatar::before,
.peer-card.speaking:not(.muted) .avatar::after,
.focus-participant-item.speaking .avatar::before,
.focus-participant-item.speaking .avatar::after,
.speaker-strip-item.speaking .avatar::before,
.speaker-strip-item.speaking .avatar::after,
.fullscreen-peer-item.speaking .avatar::before,
.fullscreen-peer-item.speaking .avatar::after,
.channel-user-item.speaking .avatar::before,
.channel-user-item.speaking .avatar::after {
  opacity: 1;
}

.peer-card.speaking:not(.muted) .avatar::before,
.focus-participant-item.speaking .avatar::before,
.speaker-strip-item.speaking .avatar::before,
.fullscreen-peer-item.speaking .avatar::before,
.channel-user-item.speaking .avatar::before {
  animation: avatar-mouth-top 460ms infinite ease-in-out;
}

.peer-card.speaking:not(.muted) .avatar::after,
.focus-participant-item.speaking .avatar::after,
.speaker-strip-item.speaking .avatar::after,
.fullscreen-peer-item.speaking .avatar::after,
.channel-user-item.speaking .avatar::after {
  animation: avatar-mouth-bottom 460ms infinite ease-in-out;
}

.media-workspace[data-view-mode="list"] .peer-card .avatar,
.focus-participant-avatar,
.speaker-strip-avatar {
  --avatar-mouth-travel: 4px;
}

.fullscreen-peer-avatar {
  --avatar-mouth-travel: 3px;
}

.channel-user-avatar {
  --avatar-mouth-travel: 2px;
}

.peer-card.speaking:not(.muted) .talking-ring {
  opacity: 1;
  transform: scale(1);
  animation: speak-pulse 1.5s infinite ease-in-out;
}

@keyframes avatar-mouth-top {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(calc(var(--avatar-mouth-travel, 10px) * -1)) rotate(-9deg);
  }
}

@keyframes avatar-mouth-bottom {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(var(--avatar-mouth-travel, 10px)) rotate(9deg);
  }
}

@keyframes speak-pulse {
  0% { box-shadow: 0 0 0 0 rgba(35, 165, 90, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(35, 165, 90, 0); }
  100% { box-shadow: 0 0 0 0 rgba(35, 165, 90, 0); }
}

/* Admin Styles */
.channel-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  color: var(--text-muted);
  opacity: 0.5;
  transition: opacity 0.2s, background-color 0.2s, color 0.2s;
  cursor: pointer;
}
.channel-delete-btn:hover {
  opacity: 1;
  color: #ff4d4d;
  background-color: rgba(255, 77, 77, 0.1);
}
.channel-rename-btn:hover {
  color: var(--text-normal, #fff);
  background-color: rgba(255, 255, 255, 0.08);
}

.context-menu-item.context-menu-danger:hover {
  background-color: #ff4d4d !important;
  color: #ffffff !important;
}

/* ==========================================================================
   CUSTOM DRAGGABLE TITLEBAR (DISCORD MONOLITHIC STYLE)
   ========================================================================== */
#titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 32px;
  background-color: var(--bg-card-elevated);
  color: var(--text-muted);
  user-select: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  border-bottom: 1px solid var(--border-primary);
}

.titlebar-drag-region {
  flex: 1;
  display: flex;
  align-items: center;
  height: 100%;
  padding-left: 12px;
  -webkit-app-region: drag;
}

.titlebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--header-family);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text-normal);
  letter-spacing: 0.02em;
}

.titlebar-avatar-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.titlebar-controls {
  display: flex;
  height: 100%;
  -webkit-app-region: no-drag;
}

.titlebar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: default;
  transition: background-color 0.1s, color 0.1s;
}

.titlebar-btn:hover {
  background-color: var(--bg-modifier-hover);
  color: var(--text-normal);
}

.titlebar-btn-close:hover {
  background-color: #f04747 !important;
  color: white !important;
}

.titlebar-btn svg {
  width: 10px;
  height: 10px;
}

#titlebar svg.hidden {
  display: none !important;
}

/* Video Wrapper & Screen Share Containment */
.video-wrapper {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  background-color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#screen-share-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Fullscreen Screen Share Button */
#fullscreen-screen-share {
  position: relative;
  z-index: 11;
  pointer-events: auto !important;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}
#fullscreen-screen-share:hover {
  background: var(--accent-blurple);
  border-color: var(--accent-blurple);
  color: #ffffff;
  transform: scale(1.05);
}
#fullscreen-screen-share:active {
  transform: scale(0.95);
}

/* Updater Progress Bar Styles */
#update-progress-container {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0 2px 0;
}
#update-progress-bar {
  width: 0%;
  height: 100%;
  background: var(--accent-blurple);
  transition: width 0.1s ease;
  border-radius: 4px;
}
#update-progress-text {
  color: var(--accent-blurple);
  font-weight: 600;
  font-size: 0.85rem;
}

/* Hotkey bind button states */
.hotkey-bind-btn {
  background-color: var(--bg-secondary) !important;
  color: var(--text-muted) !important;
  border: 1px dashed var(--border-secondary) !important;
  min-width: 130px;
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 6px !important;
  transition: all 0.15s ease;
}
.hotkey-bind-btn:hover {
  background-color: var(--bg-modifier-hover) !important;
  border-color: var(--border-secondary) !important;
  color: var(--text-normal) !important;
}
.hotkey-bind-btn.btn-secondary {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-normal) !important;
  border: 1px solid var(--border-primary) !important;
}
.hotkey-bind-btn.btn-secondary:hover {
  background-color: var(--bg-modifier-hover) !important;
  border-color: var(--border-secondary) !important;
}
.hotkey-bind-btn.recording {
  background: var(--status-danger) !important;
  color: #ffffff !important;
  border-color: var(--status-danger) !important;
  border-style: solid !important;
  animation: hotkeyPulse 1s infinite alternate;
}
@keyframes hotkeyPulse {
  from { opacity: 0.8; }
  to { opacity: 1; }
}

/* Admin Mute Button */
.btn-admin-mute {
  background: rgba(242, 63, 66, 0.15);
  border: 1px solid rgba(242, 63, 66, 0.4);
  color: var(--status-danger);
  border-radius: 4px;
  padding: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-left: 8px;
  pointer-events: auto;
}
.btn-admin-mute:hover {
  background: var(--status-danger);
  color: #ffffff;
  border-color: var(--status-danger);
  transform: scale(1.05);
}

/* Nudge Glow Yellow Pulse animation */
@keyframes nudgeYellowPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.7);
    border-color: rgba(234, 179, 8, 1);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(234, 179, 8, 0);
    border-color: rgba(234, 179, 8, 0.4);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(234, 179, 8, 0);
    border-color: var(--border-primary);
  }
}

.nudge-glow {
  animation: nudgeYellowPulse 1.2s infinite !important;
  border-color: rgba(234, 179, 8, 0.9) !important;
}

/* Selection Copy Tooltip */
.selection-copy-btn {
  position: fixed;
  background-color: var(--accent-blurple);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  transition: background-color 0.12s ease, transform 0.1s ease;
  transform: translate(-50%, -100%) scale(1);
}
.selection-copy-btn:hover {
  background-color: var(--accent-blurple-hover);
}
.selection-copy-btn:active {
  transform: translate(-50%, -100%) scale(0.95);
}
.selection-copy-btn.hidden {
  display: none !important;
}

/* ==========================================================================
   LIGHT THEME SPECIFIC OVERRIDES — Figma SvoiCall Light
   ========================================================================== */

/* Sidebar light — Figma: #EEF2F8 */
body.light-theme .sidebar-left {
  background:
    linear-gradient(180deg, rgba(10, 132, 255, 0.04), transparent 180px),
    var(--bg-secondary);
}

/* User widget light */
body.light-theme .user-widget {
  background-color: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
body.light-theme #user-widget-avatar {
  background: var(--accent-blue);
}
body.light-theme .user-status-text {
  color: var(--status-online);
}

/* Peer cards light — white bg, subtle shadow */
body.light-theme .peer-card {
  background-color: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
body.light-theme .peer-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
body.light-theme .peer-info {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
}
body.light-theme .peer-name {
  color: var(--text-normal);
}

/* Chat messages light */
body.light-theme .chat-message-item {
  background-color: #F2F4F7;
  border: none;
}
body.light-theme .chat-message-item:hover {
  background-color: #EBEDF0;
}

/* Chat input light */
body.light-theme .chat-input-wrapper {
  background-color: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.08);
}

/* Tab buttons light */
body.light-theme .tab-btn {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-muted);
}
body.light-theme .tab-btn.active {
  background: rgba(10, 132, 255, 0.12);
  color: var(--accent-blue);
}

/* Call controls light */
body.light-theme .call-controls {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
}
body.light-theme .control-btn {
  background-color: #DDE4F0;
  color: var(--text-normal);
}
body.light-theme .control-btn:hover {
  background-color: #CDD5E3;
}

/* Toggles light */
body.light-theme .toggle-track {
  background-color: #b9bbbe;
}
body.light-theme .channel-user-item:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

/* Modals light */
body.light-theme .modal-card,
body.light-theme .emoji-picker,
body.light-theme .splash-content,
body.light-theme .login-card {
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
}
body.light-theme .modal-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.08);
}
body.light-theme .emoji-picker {
  background-color: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.08);
}
body.light-theme .modal-header h2 {
  color: var(--text-normal);
}
body.light-theme .profile-settings-card {
  border-color: rgba(0, 0, 0, 0.06);
  background-color: rgba(0, 0, 0, 0.015);
}
body.light-theme .settings-select option {
  background-color: var(--bg-secondary);
  color: var(--text-normal);
}

/* Media workspace light */
body.light-theme .media-workspace {
  background:
    radial-gradient(circle at 50% 20%, rgba(10, 132, 255, 0.04), transparent 38%),
    var(--bg-primary);
}

/* Connection chips light */
body.light-theme .connection-quality-chip {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.08);
}

/* Room header light */
body.light-theme .room-header {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

/* Sidebar right light */
body.light-theme .sidebar-right {
  background:
    linear-gradient(180deg, rgba(10, 132, 255, 0.03), transparent 160px),
    var(--bg-secondary);
}
body.light-theme .sidebar-right-tabs {
  background: rgba(255, 255, 255, 0.95);
}

/* ==========================================================================
   LOW-END DEVICE PERFORMANCE OPTIMIZATIONS
   ========================================================================== */

/* Optimization Toast Icon */
.toast-icon.optimize {
  background-color: var(--accent-blurple);
  box-shadow: 0 0 10px var(--accent-blurple);
}

/* Disable heavy graphics and animations on low-end devices */
body.low-end-device .peer-card.speaking:not(.muted) .talking-ring {
  animation: none !important;
}

body.low-end-device .talking-ring {
  box-shadow: none !important;
}

body.low-end-device .peer-card {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
  transition: none !important;
}

body.low-end-device .avatar-wrapper,
body.low-end-device .avatar,
body.low-end-device .control-btn,
body.low-end-device .channel-user-item {
  transition: none !important;
}

body.low-end-device * {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  transition-duration: 0.01s !important;
  animation-duration: 0.01s !important;
}

/* Ensure solid backgrounds for glassmorphic elements when backdrop blur is disabled */
body.low-end-device .modal-content,
body.low-end-device .control-bar,
body.low-end-device .room-screen,
body.low-end-device .lobby-screen,
body.low-end-device .peer-card,
body.low-end-device .sidebar,
body.low-end-device .chat-panel,
body.low-end-device .custom-context-menu {
  background-color: rgba(20, 20, 20, 0.96) !important;
  background: rgba(20, 20, 20, 0.96) !important;
}

/* ==========================================================================
   MICRO-ANIMATIONS FOR BUTTONS
   ========================================================================== */
.control-btn, 
.btn, 
.titlebar-btn, 
.user-widget-actions button {
  transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1), background-color 0.15s, color 0.15s, border-color 0.15s;
}
.control-btn:hover, 
.btn:hover, 
.titlebar-btn:hover, 
.user-widget-actions button:hover {
  transform: scale(1.05);
}
.control-btn:active, 
.btn:active, 
.titlebar-btn:active, 
.user-widget-actions button:active {
  transform: scale(0.95);
}

/* ==========================================================================
   ADMIN LOGIN GEAR BUTTON
   ========================================================================== */
.login-admin-gear-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
}
.login-admin-gear-btn:hover {
  background-color: var(--bg-modifier-hover);
  color: var(--text-normal);
}

/* ==========================================================================
   HOTKEY ROW & VOLUMES & SIDEBAR COLLAPSE
   ========================================================================== */
.hotkey-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.15);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-primary);
}
.hotkey-label {
  font-size: 0.9rem;
  color: var(--text-normal);
}
.hotkey-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}
body.light-theme .hotkey-row {
  background: rgba(0, 0, 0, 0.04);
}

/* Sidebar collapse styles */
.sidebar-left {
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease, margin 0.22s ease;
}
#app-workspace.sidebar-left-collapsed .sidebar-left {
  width: 0 !important;
  min-width: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border-right: none !important;
}

/* Toggle button for sidebar collapse */
.toggle-sidebar-left-btn {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  margin-right: 8px;
  padding: 6px;
  border-radius: 6px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.toggle-sidebar-left-btn svg {
  width: 18px;
  height: 18px;
}
.toggle-sidebar-left-btn:hover {
  background-color: var(--bg-modifier-hover) !important;
  color: var(--text-normal);
}

/* Screen share volume control */
.screen-share-volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 16px;
  margin-left: auto;
  background: rgba(0, 0, 0, 0.12);
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid var(--border-primary);
}
body.light-theme .screen-share-volume-control {
  background: rgba(0, 0, 0, 0.04);
}
.screen-share-volume-control .vol-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}
.screen-share-volume-control input[type="range"] {
  width: 70px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-secondary);
  accent-color: var(--accent-blurple);
  cursor: pointer;
  border: none;
  outline: none;
}
.screen-share-volume-control span {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 32px;
  text-align: right;
}

body.light-theme .screen-sources-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
}
body.light-theme .screen-sources-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.22);
}

/* ==========================================================================
   UPDATE SNACKBAR (subtle, bottom-right)
   ========================================================================== */
.update-snackbar {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99999;
  min-width: 260px;
  max-width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border-secondary);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 12px 14px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  animation: snackbar-slide-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.update-snackbar.hidden {
  display: none !important;
}
.update-snackbar.dismissing {
  animation: snackbar-slide-out 0.22s ease-in forwards;
}
@keyframes snackbar-slide-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes snackbar-slide-out {
  from { opacity: 1; transform: translateY(0)    scale(1); }
  to   { opacity: 0; transform: translateY(10px) scale(0.94); }
}
.update-snackbar-icon {
  color: var(--accent-blurple);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.update-snackbar-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.update-snackbar-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-normal);
}
.update-snackbar-version {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.update-snackbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.update-snackbar-btn {
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  transition: background-color 0.15s, color 0.15s;
  line-height: 1;
}
.update-snackbar-btn.primary {
  background: var(--accent-blurple);
  color: #fff;
}
.update-snackbar-btn.primary:hover {
  background: var(--accent-blurple-hover);
}
.update-snackbar-btn:not(.primary) {
  background: transparent;
  color: var(--text-muted);
  padding: 5px 7px;
  font-size: 0.9rem;
}
.update-snackbar-btn:not(.primary):hover {
  color: var(--text-normal);
  background: var(--bg-modifier-hover);
}
.update-snackbar-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.update-snackbar-progress {
  width: 100%;
  height: 3px;
  background: var(--border-primary);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 2px;
}
.update-snackbar-progress.hidden {
  display: none;
}
.update-snackbar-progress-bar {
  height: 100%;
  background: var(--accent-blurple);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ========================================================================== 
   SVOICALL FOCUS — DESKTOP CALL SHELL
   ========================================================================== */
:root {
  --sidebar-width: 230px;
  --sidebar-right-width: 336px;
  --status-speaking: #23A55A;
  --focus-radius-sm: 6px;
  --focus-radius-md: 10px;
  --focus-radius-lg: 14px;
  --focus-space-1: 4px;
  --focus-space-2: 8px;
  --focus-space-3: 12px;
  --focus-space-4: 16px;
  --focus-space-6: 24px;
  --focus-control-size: 44px;
}

#app-workspace {
  position: relative;
  isolation: isolate;
  min-height: 0;
  height: calc(100% - 32px);
  overflow: hidden;
}

#app-workspace > .sidebar-left,
#app-workspace > .center-workspace,
#app-workspace > .sidebar-right {
  height: auto;
  min-height: 0;
}

#app-workspace .active-view {
  min-height: 0;
}

.sidebar-left {
  background:
    linear-gradient(180deg, rgba(10, 132, 255, 0.04), transparent 180px),
    var(--bg-secondary);
}

.user-widget-actions #user-mute-btn,
.user-widget-actions #user-deafen-btn {
  display: none;
}

.room-header {
  height: 64px;
  min-height: 64px;
  padding: 0 var(--focus-space-4);
  gap: var(--focus-space-3);
  background: rgba(11, 13, 18, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--border-primary), 0 8px 30px rgba(0, 0, 0, 0.08);
}

body.light-theme .room-header {
  background: rgba(255, 255, 255, 0.92);
}

.room-title {
  min-width: 0;
  flex: 1 1 auto;
  gap: var(--focus-space-2);
}

.room-title-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--focus-radius-md);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
}

.room-title-icon .icon-hash {
  width: 17px;
  height: 17px;
}

.room-title-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.room-title h2 {
  max-width: min(28vw, 260px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.96rem;
}

.room-participant-count {
  color: var(--text-tertiary);
  font-size: 0.7rem;
  line-height: 1.15;
}

.room-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--focus-space-2);
}

.connection-quality-chip {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--border-primary);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.connection-quality-chip:hover,
.connection-quality-chip:focus-visible {
  background: var(--bg-modifier-hover);
  border-color: var(--border-secondary);
  color: var(--text-normal);
  outline: none;
}

/* Connection quality icon states */
.connection-quality-icon {
  color: var(--text-tertiary);
  transition: color 0.2s;
}

.is-good .connection-quality-icon {
  color: var(--status-online);
}

.is-poor .connection-quality-icon {
  color: var(--accent-gold);
}

.is-offline .connection-quality-icon {
  color: var(--status-danger);
}

/* Keep dots for quality summary panel */
.connection-quality-dot,
.quality-summary-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--text-tertiary);
  box-shadow: 0 0 0 3px rgba(111, 118, 144, 0.12);
}

.is-good .connection-quality-dot,
.quality-summary.is-good .quality-summary-dot {
  background: var(--status-online);
  box-shadow: 0 0 0 3px rgba(35, 209, 139, 0.12);
}

.is-poor .connection-quality-dot,
.quality-summary.is-poor .quality-summary-dot {
  background: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(240, 178, 50, 0.14);
}

.is-offline .connection-quality-dot,
.quality-summary.is-offline .quality-summary-dot {
  background: var(--status-danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}

.view-mode-switcher {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--focus-radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
}

.view-mode-btn {
  height: 30px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.view-mode-btn svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.view-mode-btn:hover,
.view-mode-btn:focus-visible {
  color: var(--text-normal);
  outline: none;
}

.view-mode-btn.active {
  color: #fff;
  background: var(--accent-blurple);
  box-shadow: 0 4px 12px rgba(10, 132, 255, 0.25);
}

#copy-room-link-btn {
  width: auto;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--focus-radius-md);
}

#copy-room-link-btn svg {
  width: 15px;
  height: 15px;
}

.media-workspace {
  padding: var(--focus-space-4);
  padding-bottom: 92px;
  background:
    radial-gradient(circle at 50% 20%, rgba(10, 132, 255, 0.04), transparent 38%),
    var(--bg-primary);
}

.peer-card {
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.018), transparent 44%),
    var(--bg-card);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

.peer-card.speaking:not(.muted) {
  border-color: var(--accent-blurple);
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.25), 0 12px 28px rgba(0, 0, 0, 0.28);
}

.focus-content-empty {
  display: none;
  flex: 1 1 auto;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  gap: var(--focus-space-2);
  border: 1px dashed var(--border-secondary);
  border-radius: var(--focus-radius-lg);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.012);
}

.focus-content-empty-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: var(--focus-space-1);
  border-radius: 18px;
  color: var(--accent-blurple);
  background: rgba(10, 132, 255, 0.12);
}

.focus-content-empty-icon svg {
  width: 24px;
  height: 24px;
}

.focus-content-empty strong {
  color: var(--text-normal);
  font-family: var(--header-family);
  font-size: 1rem;
}

.focus-content-empty span {
  max-width: 390px;
  font-size: 0.8rem;
  line-height: 1.45;
}

.media-workspace[data-view-mode="speaker"] .peers-grid:not(.has-featured) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 88px), 1fr));
  grid-auto-rows: auto;
  align-items: start;
  align-content: start;
}

.media-workspace[data-view-mode="speaker"] .peers-grid:not(.has-featured) .peer-card {
  aspect-ratio: auto;
  height: 120px;
}

.media-workspace[data-view-mode="speaker"] .peers-grid:not(.has-featured) .peer-card.focus-primary-speaker {
  order: -1;
  grid-column: 1 / -1;
  height: clamp(260px, 51vh, 500px);
}

.media-workspace[data-view-mode="list"]:not(.screen-share-active) .featured-peer-zone {
  display: none !important;
}

.media-workspace[data-view-mode="list"]:not(.screen-share-active) .peers-grid {
  flex: 1 1 auto;
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-flow: row;
  grid-auto-rows: 72px;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
}

.media-workspace[data-view-mode="list"]:not(.screen-share-active) .peer-card {
  height: 72px;
  aspect-ratio: auto;
}

.call-controls {
  bottom: 16px;
  height: 60px;
  padding: 0 8px;
  gap: 8px;
  border-radius: 18px;
  background: rgba(20, 23, 32, 0.9);
  border-color: var(--border-secondary);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.46);
}

.control-btn {
  width: var(--focus-control-size);
  height: var(--focus-control-size);
  border-radius: var(--focus-radius-md);
}

#control-deafen-btn.active-state,
#user-deafen-btn.active-state {
  background-color: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: var(--status-danger) !important;
}

#control-deafen-btn.active-state:hover,
#user-deafen-btn.active-state:hover {
  background-color: var(--status-danger) !important;
  border-color: var(--status-danger) !important;
  color: #fff !important;
}

#control-reactions-btn,
#control-chat-btn,
#control-leave-btn {
  margin-left: 4px;
}

.sidebar-right {
  background:
    linear-gradient(180deg, rgba(10, 132, 255, 0.03), transparent 160px),
    var(--bg-secondary);
}

.sidebar-right-tabs {
  height: 64px;
  min-height: 64px;
  padding: 0 10px;
  gap: 4px;
  background: rgba(11, 13, 18, 0.92);
}

body.light-theme .sidebar-right-tabs {
  background: rgba(255, 255, 255, 0.92);
}

.tab-btn {
  flex: 1 1 0;
  min-width: 0;
  height: 36px;
  justify-content: center;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.76rem;
  transition: background-color 0.15s, color 0.15s;
}

.tab-btn:hover,
.tab-btn:focus-visible {
  color: var(--text-normal);
  background: var(--bg-modifier-hover);
  outline: none;
}

.tab-btn.active {
  color: var(--accent-blurple);
  background: var(--bg-card-elevated);
}

.sidebar-right-content {
  background: rgba(11, 13, 18, 0.22);
}

.context-pane-header {
  min-height: 84px;
  padding: var(--focus-space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-primary);
}

.context-pane-header h3 {
  margin-top: 3px;
  font-family: var(--header-family);
  font-size: 1rem;
}

.context-pane-eyebrow {
  color: var(--text-tertiary);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.context-pane-count {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: var(--text-normal);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  font-size: 0.75rem;
  font-weight: 700;
}

.participants-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--focus-space-3);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.focus-participant-item {
  min-height: 58px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--focus-radius-md);
  border: 1px solid transparent;
  color: var(--text-muted);
}

.focus-participant-item:hover {
  background: var(--bg-modifier-hover);
}

.focus-participant-item.speaking {
  background: rgba(35, 165, 90, 0.07);
  border-color: rgba(35, 165, 90, 0.16);
}

.focus-participant-avatar {
  width: 36px;
  height: 36px;
  font-size: 0.75rem;
}

.focus-participant-item.speaking .focus-participant-avatar {
  box-shadow: 0 0 0 2px var(--status-speaking), 0 5px 12px rgba(0, 0, 0, 0.24);
}

.focus-participant-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.focus-participant-copy strong,
.focus-participant-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focus-participant-copy strong {
  color: var(--text-normal);
  font-size: 0.82rem;
}

.focus-participant-copy span {
  color: var(--text-tertiary);
  font-size: 0.69rem;
}

.focus-participant-state {
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.66rem;
}

.focus-participant-state.is-speaking {
  color: var(--status-online);
  font-weight: 700;
}

.focus-participant-state.is-muted {
  color: var(--status-danger);
}

.quality-summary {
  margin: var(--focus-space-4);
  padding: var(--focus-space-4);
  border-radius: var(--focus-radius-lg);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
}

.quality-summary-hero {
  display: flex;
  align-items: flex-start;
  gap: var(--focus-space-3);
  padding-bottom: var(--focus-space-4);
}

.quality-summary-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
}

.quality-summary-hero > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.quality-summary-title {
  color: var(--text-normal);
  font-family: var(--header-family);
  font-size: 0.94rem;
}

.quality-summary-copy,
.quality-note {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.quality-facts {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-primary);
  border-bottom: 1px solid var(--border-primary);
}

.quality-fact {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--focus-space-3);
  color: var(--text-muted);
  font-size: 0.76rem;
}

.quality-fact + .quality-fact {
  border-top: 1px solid var(--border-primary);
}

.quality-fact strong {
  color: var(--text-normal);
  font-size: 0.75rem;
}

.quality-note {
  margin-top: var(--focus-space-4);
}

@media (max-width: 1400px) {
  .view-mode-btn {
    width: 32px;
    padding: 0;
  }

  .view-mode-btn span,
  #copy-room-link-btn span {
    display: none;
  }

  #copy-room-link-btn {
    width: 36px;
    padding: 0;
  }
}

@media (max-width: 980px) {
  .sidebar-right {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    width: min(var(--sidebar-right-width), calc(100vw - 56px));
    max-width: calc(100vw - 56px);
    box-shadow: -24px 0 50px rgba(0, 0, 0, 0.42);
    padding-bottom: 76px;
  }

  .call-controls {
    z-index: 40;
  }

  .chat-resize-handle {
    display: none;
  }

  .connection-quality-chip {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .connection-quality-label {
    display: none;
  }

  .room-title h2 {
    max-width: 170px;
  }
}

@media (max-width: 840px) {
  :root {
    --sidebar-width: 204px;
  }

  .room-header {
    padding: 0 10px;
    gap: 6px;
  }

  .room-title-icon,
  .room-participant-count {
    display: none;
  }

  .toggle-sidebar-left-btn {
    margin-right: 2px;
  }

  .room-actions {
    gap: 5px;
  }

  .view-mode-switcher {
    height: 36px;
  }

  .media-workspace {
    padding: 12px;
    padding-bottom: 84px;
  }

  .media-workspace[data-view-mode="speaker"] .peers-grid:not(.has-featured) .peer-card.focus-primary-speaker {
    height: clamp(210px, 38vh, 320px);
  }

  .media-workspace[data-view-mode="speaker"] .peers-grid:not(.has-featured) .peer-card:not(.focus-primary-speaker) {
    height: 112px;
  }

  .call-controls {
    bottom: 12px;
    height: 56px;
    gap: 6px;
  }

  .control-btn {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .call-controls {
    width: calc(100vw - 16px);
    box-sizing: border-box;
    gap: 3px;
    padding: 6px;
    justify-content: space-between;
  }

  .call-controls .control-btn {
    flex: 1 1 36px;
    min-width: 32px;
    max-width: 40px;
  }
}

@media (max-height: 700px) {
  .room-header,
  .sidebar-right-tabs {
    height: 56px;
    min-height: 56px;
  }

  .media-workspace {
    padding-bottom: 78px;
  }

  .call-controls {
    bottom: 10px;
    height: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal-overlay:not(.hidden),
  .modal-overlay:not(.hidden) .modal-card,
  .modal-overlay.is-closing,
  .modal-overlay.is-closing .modal-card,
  .screen.active:not(.hidden),
  #login-screen.active:not(.hidden) .login-card,
  .reactions-popup:not(.hidden),
  .custom-context-menu:not(.hidden) {
    animation-duration: 0.01s !important;
    transform: none !important;
  }
}

/* Streamer mode indicator in the titlebar (click to turn the mode off). */
.streamer-mode-badge{-webkit-app-region:no-drag;display:inline-flex;align-items:center;gap:6px;height:24px;margin-right:8px;padding:0 10px;border:1px solid rgba(145,70,255,.55);border-radius:999px;background:rgba(145,70,255,.18);color:#e6d9ff;font-size:12px;font-weight:600;cursor:pointer}
.streamer-mode-badge::before{content:"";width:7px;height:7px;border-radius:50%;background:#a970ff;box-shadow:0 0 6px #a970ff}
.streamer-mode-badge:hover{background:rgba(145,70,255,.3)}
.streamer-mode-badge[hidden]{display:none}
