/* ==========================================================================
   DESIGN SYSTEM FOR SABHA PLATFORM (Telangana Flag Palette Theme)
   ========================================================================== */

:root {
  /* Core Flag Palette Variables */
  --color-yellow: #F4C016;       /* Dominant: highlights, outgoing bubble, panels */
  --color-green: #005020;        /* Deep Hero Green: immersive bg, dark headers, nav */
  --color-blue: #203080;         /* Royal Accent Blue: category pills, buttons, dots */
  --color-text-dark: #1A1500;    /* Dark ink on yellow/light surfaces */
  --color-bg-neutral: #FAFAF5;   /* Warm off-white page background */
  
  /* Additional Premium Semantic Variables */
  --color-white: #FFFFFF;
  --color-border: #E8E8E0;
  --color-input-bg: #EFEFE8;
  --color-card-bg: #FFFFFF;
  --color-text-light: #6E6E65;
  --color-red-live: #E53935;
  --color-green-light: #E8F5E9;
  
  /* Effects and Fonts */
  --font-family: 'Outfit', sans-serif;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.15);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET & GLOBAL STYLES
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #F0F0E8;
  color: var(--color-text-dark);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  width: 100dvw;
}

button, input, select {
  font-family: var(--font-family);
  outline: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   LOGIN SCREEN (PREMIUM SPLIT CARD)
   ========================================================================== */

#login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, var(--color-green) 0%, #003816 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow-y: auto;
  padding: 20px;
}

.login-card {
  background: var(--color-white);
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 35px 30px;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.login-header {
  text-align: center;
  margin-bottom: 25px;
}

.logo-circle {
  width: 70px;
  height: 70px;
  background-color: var(--color-yellow);
  color: var(--color-text-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 12px;
  box-shadow: 0 4px 10px rgba(244, 192, 22, 0.3);
}

.login-header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--color-green);
  margin-bottom: 4px;
}

.login-header p {
  color: var(--color-text-light);
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.quick-login-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.quick-login-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-light);
  margin-bottom: 4px;
}

.quick-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: var(--color-bg-neutral);
  transition: var(--transition);
  text-align: left;
}

.quick-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  background-color: var(--color-white);
}

.quick-btn-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  margin-right: 12px;
  flex-shrink: 0;
}

.quick-btn-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.quick-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text-dark);
}

.quick-role {
  font-size: 11px;
  color: var(--color-text-light);
}

.quick-btn i {
  color: var(--color-text-light);
  font-size: 12px;
  margin-right: 4px;
  transition: var(--transition);
}

.quick-btn:hover i {
  transform: translateX(4px);
  color: var(--color-blue);
}

.leader-theme:hover { border-color: var(--color-yellow); }
.coordinator-theme:hover { border-color: var(--color-green); }
.member-theme:hover { border-color: var(--color-blue); }

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 15px 0;
  color: var(--color-text-light);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--color-border);
}

.divider span {
  padding: 0 10px;
}

.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-light);
  text-transform: uppercase;
}

.form-group input, .form-group select {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: var(--color-bg-neutral);
  font-size: 14px;
  color: var(--color-text-dark);
  transition: var(--transition);
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--color-green);
  background-color: var(--color-white);
  box-shadow: 0 0 0 3px rgba(0, 80, 32, 0.1);
}

.submit-btn {
  width: 100%;
  padding: 14px;
  background-color: var(--color-green);
  color: var(--color-white);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  transition: var(--transition);
  margin-top: 10px;
  box-shadow: 0 4px 12px rgba(0, 80, 32, 0.2);
}

.submit-btn:hover {
  background-color: #003d18;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 80, 32, 0.3);
}

/* ==========================================================================
   APP MAIN CONTAINER & LAYOUT
   ========================================================================== */

#app-container {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background-color: var(--color-bg-neutral);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==========================================================================
   APP HEADER
   ========================================================================== */

.app-header {
  background-color: var(--color-yellow);
  color: var(--color-text-dark);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  z-index: 100;
}

.header-top-strip {
  height: 5px;
  background-color: var(--color-green);
  width: 100%;
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
}

.header-branding {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 20px;
  color: var(--color-green);
  background: rgba(0, 80, 32, 0.1);
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-branding h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--color-green);
}

.user-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background-color: var(--color-white);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 80, 32, 0.1);
}

.user-status-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

.user-status-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.user-status-name {
  font-weight: 600;
  font-size: 12px;
  color: var(--color-text-dark);
}

.user-status-role {
  font-size: 9px;
  color: var(--color-text-light);
  text-transform: uppercase;
  font-weight: 700;
}

.leader-privilege-banner {
  background-color: var(--color-green);
  color: var(--color-white);
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* ==========================================================================
   APP NAVIGATION (BOTTOM BAR)
   ========================================================================== */

.app-navigation {
  background-color: var(--color-white);
  height: 65px;
  flex-shrink: 0;
  display: flex;
  justify-content: space-around;
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.02);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  color: var(--color-text-light);
  transition: var(--transition);
  position: relative;
}

.nav-icon {
  font-size: 20px;
  margin-bottom: 4px;
  position: relative;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
}

.nav-item.active {
  color: var(--color-green);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  width: 40px;
  height: 4px;
  background-color: var(--color-green);
  border-radius: 0 0 4px 4px;
}

.live-dot-nav {
  position: absolute;
  top: -2px;
  right: -5px;
  width: 8px;
  height: 8px;
  background-color: var(--color-red-live);
  border-radius: 50%;
  animation: pulseLive 1.5s infinite;
}

/* ==========================================================================
   MAIN CONTENT VIEW SYSTEM
   ========================================================================== */

.app-content {
  flex-grow: 1;
  overflow: hidden;
  position: relative;
}

.tab-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.tab-view.active {
  display: flex;
  opacity: 1;
}

/* ==========================================================================
   SPLIT VIEW LAYOUT (CHATS/GROUPS/CONF)
   ========================================================================== */

.split-view {
  display: flex;
  width: 100%;
  height: 100%;
}

.sidebar-list {
  width: 320px;
  border-right: 1px solid var(--color-border);
  background-color: var(--color-white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .sidebar-list {
    width: 100%;
  }
  
  .detail-chat-window:not(.empty) {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 500;
  }
  
  .detail-chat-window.empty {
    display: none !important;
  }
}

.detail-chat-window:not(.empty) .empty-state {
  display: none !important;
}

.mobile-back-btn {
  display: none;
  font-size: 18px;
  color: var(--color-text-dark);
  margin-right: 12px;
  padding: 4px 8px;
  border-radius: 50%;
  transition: var(--transition);
}

.mobile-back-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
  .mobile-back-btn {
    display: block;
  }
}

.list-search {
  padding: 12px 16px;
  position: relative;
  border-bottom: 1px solid var(--color-border);
}

.list-search i {
  position: absolute;
  left: 28px;
  top: 24px;
  color: var(--color-text-light);
}

.list-search input {
  width: 100%;
  padding: 10px 16px 10px 38px;
  background-color: var(--color-bg-neutral);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  font-size: 13px;
  transition: var(--transition);
}

.list-search input:focus {
  background-color: var(--color-white);
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(32, 48, 128, 0.1);
}

.list-title {
  padding: 15px 20px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-light);
  border-bottom: 1px solid var(--color-border);
}

.members-list {
  flex-grow: 1;
  overflow-y: auto;
}

/* Member Item */
.member-item {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition);
  position: relative;
}

.member-item:hover {
  background-color: var(--color-bg-neutral);
}

.member-item.active {
  background-color: rgba(244, 192, 22, 0.08);
  border-left: 4px solid var(--color-yellow);
}

.avatar-wrapper {
  position: relative;
  margin-right: 15px;
  flex-shrink: 0;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--color-white);
}

.presence-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--color-white);
  background-color: var(--color-text-light);
}

.presence-badge.online {
  background-color: var(--color-blue); /* UI Spec: Blue for online indicators */
}

.member-info {
  flex-grow: 1;
  overflow: hidden;
}

.member-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.member-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text-dark);
}

.member-time {
  font-size: 11px;
  color: var(--color-text-light);
}

.member-subtitle {
  font-size: 12px;
  color: var(--color-text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leader-badge {
  background-color: var(--color-green);
  color: var(--color-white);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.unread-badge {
  background-color: var(--color-blue);
  color: var(--color-white);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
}

/* ==========================================================================
   DETAIL CHAT WINDOWS (RIGHT HAND SIDE)
   ========================================================================== */

.detail-chat-window {
  flex-grow: 1;
  background-color: var(--color-bg-neutral);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.detail-chat-window.empty {
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.empty-state {
  text-align: center;
  max-width: 320px;
}

.empty-state i {
  font-size: 64px;
  color: var(--color-border);
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--color-text-light);
  font-size: 13px;
}

/* Active Chat Container */
.chat-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.chat-header {
  padding: 12px 20px;
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.chat-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--color-white);
  margin-right: 12px;
}

.chat-header-info {
  flex-grow: 1;
}

.chat-header-info h3 {
  font-size: 15px;
  font-weight: 700;
}

.chat-header-info span {
  font-size: 11px;
  color: var(--color-text-light);
}

.chat-header-actions {
  display: flex;
  gap: 10px;
}

.call-btn-action {
  background-color: var(--color-blue);
  color: var(--color-white);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.call-btn-action:hover {
  background-color: #172466;
  transform: translateY(-1px);
}

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

.message-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.4;
  position: relative;
  animation: popIn 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.message-bubble.incoming {
  background-color: var(--color-white);
  color: var(--color-text-dark);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.message-bubble.outgoing {
  background-color: var(--color-yellow);
  color: var(--color-text-dark);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.message-sender {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-green);
  margin-bottom: 2px;
  display: block;
}

.message-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  color: var(--color-text-light);
  margin-top: 4px;
}

.message-bubble.outgoing .message-meta {
  color: rgba(26, 21, 0, 0.6);
}

.system-message {
  align-self: center;
  background-color: rgba(32, 48, 128, 0.08);
  color: var(--color-blue);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 12px;
  text-align: center;
  max-width: 90%;
  margin: 6px 0;
}

.chat-footer {
  padding: 12px 20px;
  background-color: var(--color-white);
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  align-items: center;
}

.chat-footer input {
  flex-grow: 1;
  padding: 12px 18px;
  background-color: var(--color-bg-neutral);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: var(--transition);
}

.chat-footer input:focus {
  background-color: var(--color-white);
  border-color: var(--color-green);
}

.send-message-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--color-green);
  color: var(--color-white);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.send-message-btn:hover {
  background-color: #003816;
  transform: scale(1.05);
}

.broadcast-banner {
  padding: 16px 20px;
  background-color: rgba(32, 48, 128, 0.05);
  color: var(--color-blue);
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
}

/* ==========================================================================
   CONFERENCE ROOMS / IMMERSIVE SABHA
   ========================================================================== */

.conference-split .sidebar-list {
  width: 360px;
}

.room-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition);
}

.room-item:hover {
  background-color: var(--color-bg-neutral);
}

.room-item.active {
  background-color: rgba(244, 192, 22, 0.05);
  border-left: 4px solid var(--color-yellow);
}

.room-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.room-item-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text-dark);
}

.room-live-badge {
  background-color: var(--color-red-live);
  color: var(--color-white);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  animation: pulseLive 1.5s infinite;
}

@keyframes pulseLive {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.room-item-topic {
  font-size: 12px;
  color: var(--color-text-light);
  margin-bottom: 8px;
}

.room-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--color-text-light);
  font-weight: 500;
}

.room-item-host {
  color: var(--color-green);
  font-weight: 600;
}

.join-room-btn {
  background-color: var(--color-green);
  color: var(--color-white);
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 11px;
  font-weight: 700;
  transition: var(--transition);
}

.join-room-btn:hover {
  background-color: #003d18;
}

/* Immersive Room Panel */
.sabha-immersive-room {
  background: #0f121a; /* Professional dark theme instead of bright green gradient */
  color: var(--color-white);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.room-top-bar {
  padding: 20px;
  background-color: #161a24;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.room-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.live-tag {
  color: var(--color-red-live);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.room-meta h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-yellow);
}

.room-meta p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.leave-room-btn {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--color-white);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.leave-room-btn:hover {
  background-color: var(--color-red-live);
  border-color: var(--color-red-live);
}

.room-center {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
  z-index: 5;
  gap: 20px;
}

.ticker-box {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  justify-content: center;
}

.stat-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.yellow-pill {
  background-color: var(--color-yellow);
  color: var(--color-text-dark);
}

.blue-pill {
  background-color: var(--color-blue);
  color: var(--color-white);
}

.speakers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 16px;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}

.speaker-card {
  display: flex;
  flex-direction: column;
  background-color: #161a24;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  aspect-ratio: 16/10;
  position: relative;
  width: 100%;
  padding: 0;
  transition: var(--transition);
}

.speaker-video-wrap {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0f121a;
  overflow: hidden;
}

.speaker-video-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror local feed */
}

.speaker-avatar-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

.speaker-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  border: 3px solid transparent;
}

/* Pulsing highlight for currently speaking speaker */
.speaker-card.speaking .speaker-avatar {
  border-color: var(--color-yellow);
  box-shadow: 0 0 16px rgba(244, 192, 22, 0.6);
  animation: speakingPulse 1.2s infinite;
}

@keyframes speakingPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.mute-indicator-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background-color: rgba(229, 57, 53, 0.9);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 4;
}

.speaker-name {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-weight: 600;
  font-size: 11px;
  color: #FFFFFF;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 3px 8px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  z-index: 3;
}

.speaker-role {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-weight: 600;
  font-size: 9px;
  color: var(--color-yellow);
  background-color: rgba(0, 0, 0, 0.6);
  padding: 3px 8px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  z-index: 3;
  text-transform: uppercase;
}

.simulated-video-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 9px;
  font-weight: 700;
  color: #81c784;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 3px 8px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 4px;
}

.simulated-video-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #81c784;
  display: inline-block;
  animation: livepulse 1s infinite alternate;
}

@keyframes livepulse {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 1; }
}

/* Speaking Waveform Animation */
.speaking-waveform {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
  margin-top: 6px;
}

.speaking-waveform .bar {
  width: 2px;
  height: 3px;
  background-color: var(--color-yellow);
  border-radius: 1px;
  animation: bounceWave 0.6s infinite ease-in-out alternate;
}

.speaking-waveform .bar:nth-child(2) {
  animation-delay: 0.15s;
  animation-duration: 0.5s;
}

.speaking-waveform .bar:nth-child(3) {
  animation-delay: 0.3s;
  animation-duration: 0.7s;
}

@keyframes bounceWave {
  from { height: 3px; }
  to { height: 10px; }
}

/* Audience Section Grid */
.audience-section {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
}

.audience-section-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-yellow);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.audience-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  justify-items: center;
}

.audience-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.audience-card:hover {
  transform: translateY(-2px);
}

.audience-avatar-wrap {
  position: relative;
}

.audience-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-white);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.08);
}

.audience-name {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  max-width: 64px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audience-status-icon {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background-color: var(--color-blue);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  border: 1.5px solid #0f121a;
}

/* Host Drawer (for approvals) */
.host-drawer {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 15px;
  margin: 15px auto;
  width: 100%;
  max-width: 500px;
  z-index: 10;
}

.host-drawer h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-yellow);
  margin-bottom: 10px;
}

.raised-hands-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hand-raise-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.promote-btn {
  background-color: var(--color-yellow);
  color: var(--color-text-dark);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  transition: var(--transition);
}

.promote-btn:hover {
  background-color: var(--color-white);
}

/* Bottom Controls */
.room-bottom-controls {
  padding: 20px;
  background-color: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 10;
}

.reactions-bar {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.react-btn {
  font-size: 26px;
  background-color: rgba(255, 255, 255, 0.1);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.react-btn:hover {
  background-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.15) rotate(5deg);
}

.audio-controls-panel {
  display: flex;
  justify-content: center;
}

.control-btn {
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.control-btn.raise-hand-action {
  background-color: var(--color-blue);
  color: var(--color-white);
}

.control-btn.raise-hand-action:hover {
  background-color: #1a276b;
  transform: translateY(-1px);
}

.control-btn.active-speaking-control {
  background-color: var(--color-yellow);
  color: var(--color-text-dark);
}

/* Floating Reactions Canvas Animation */
.floating-emojis-container {
  position: absolute;
  bottom: 120px;
  left: 0;
  width: 100%;
  height: calc(100% - 200px);
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.floating-emoji {
  position: absolute;
  bottom: 0;
  font-size: 24px;
  animation: floatUp 3s linear forwards;
  opacity: 0;
}

@keyframes floatUp {
  0% {
    bottom: 0;
    opacity: 0;
    transform: translateX(0) scale(0.6);
  }
  15% {
    opacity: 1;
    transform: translateX(var(--drift-1)) scale(1.1);
  }
  50% {
    transform: translateX(var(--drift-2)) scale(1.0);
  }
  85% {
    opacity: 0.8;
  }
  100% {
    bottom: 85%;
    opacity: 0;
    transform: translateX(var(--drift-3)) scale(0.8);
  }
}

/* ==========================================================================
   CALLS OVERLAY & SCREENS
   ========================================================================== */

.call-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 80, 32, 0.96); /* Immersive Green overlay */
  color: var(--color-white);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
}

.call-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 320px;
  gap: 15px;
}

.call-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 700;
  color: var(--color-white);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border: 4px solid var(--color-yellow);
}

.call-avatar.pulsing {
  animation: callPulse 1.8s infinite ease-in-out;
}

@keyframes callPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(244, 192, 22, 0.4); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(244, 192, 22, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(244, 192, 22, 0); }
}

.call-status {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.call-actions {
  margin-top: 30px;
  display: flex;
  gap: 20px;
}

.hangup-btn {
  width: 56px;
  height: 56px;
  background-color: var(--color-red-live);
  color: var(--color-white);
  font-size: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
  transition: var(--transition);
}

.hangup-btn:hover {
  transform: scale(1.08);
  background-color: #d32f2f;
}

/* Call Bottom Sheet (Incoming) */
.call-overlay.bottom-sheet {
  background-color: transparent;
  justify-content: flex-end;
  padding: 0;
}

.incoming-sheet-card {
  width: 100%;
  max-width: 500px;
  background-color: var(--color-white);
  color: var(--color-text-dark);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: slideUpSheet 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.incoming-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.incoming-text {
  display: flex;
  flex-direction: column;
}

.incoming-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--color-blue);
}

.incoming-text h3 {
  font-size: 18px;
  font-weight: 700;
}

.incoming-sub {
  font-size: 12px;
  color: var(--color-text-light);
}

.incoming-actions {
  display: flex;
  gap: 12px;
}

.incoming-action-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.incoming-action-btn.reject-btn {
  background-color: var(--color-input-bg);
  color: var(--color-text-dark);
}

.incoming-action-btn.reject-btn:hover {
  background-color: #e0e0d5;
}

.incoming-action-btn.accept-btn {
  background-color: var(--color-green);
  color: var(--color-white);
}

.incoming-action-btn.accept-btn:hover {
  background-color: #003d18;
}

/* Call Mid Controls (Mute/Speaker) */
.call-mid-controls {
  display: flex;
  gap: 20px;
  margin-top: 15px;
}

.mid-control-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.mid-control-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.mid-control-btn.active {
  background-color: var(--color-yellow);
  color: var(--color-text-dark);
}

.audio-wave-visualization {
  display: flex;
  gap: 4px;
  height: 32px;
  align-items: center;
  margin: 15px 0;
}

.wave-bar {
  width: 4px;
  height: 8px;
  background-color: var(--color-yellow);
  border-radius: 2px;
  animation: bounceWave 0.8s infinite ease-in-out alternate;
}

.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.25s; }
.wave-bar:nth-child(4) { animation-delay: 0.15s; }
.wave-bar:nth-child(5) { animation-delay: 0.35s; }
.wave-bar:nth-child(6) { animation-delay: 0.05s; }

@keyframes bounceWave {
  from { height: 8px; }
  to { height: 32px; }
}

/* ==========================================================================
   PROFILE SCREEN
   ========================================================================== */

.profile-container {
  max-width: 500px;
  margin: 30px auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  height: calc(100% - 60px);
}

.profile-header-card {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.profile-header-card h2 {
  font-size: 20px;
  font-weight: 700;
}

.role-tag {
  background-color: var(--color-green-light);
  color: var(--color-green);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  text-transform: uppercase;
  margin-top: 6px;
  border: 1px solid rgba(0, 80, 32, 0.15);
}

.profile-phone {
  font-size: 13px;
  color: var(--color-text-light);
  margin-top: 8px;
}

.profile-details-list {
  background-color: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-item .label {
  font-weight: 600;
  color: var(--color-text-light);
}

.detail-item .value {
  color: var(--color-text-dark);
  font-weight: 500;
}

.logout-btn {
  background-color: var(--color-input-bg);
  color: var(--color-red-live);
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.logout-btn:hover {
  background-color: rgba(229, 57, 53, 0.08);
  color: #d32f2f;
}

/* ==========================================================================
   GROUP VIDEO CALL OVERLAY STYLING
   ========================================================================== */

.video-call-container {
  width: 100%;
  height: 100%;
  max-width: 800px;
  max-height: 620px;
  background-color: #111b21;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 10100;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.video-call-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.video-call-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.video-call-meta h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-yellow);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  flex-grow: 1;
  width: 100%;
  margin-bottom: 24px;
}

.video-card {
  background-color: #1a2329;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.video-card.local-video-card {
  border: 2px solid var(--color-yellow);
}

.video-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror local feed for realistic feel */
}

.video-avatar-fallback {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.participant-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background-color: rgba(0, 0, 0, 0.6);
  color: #FFFFFF;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.participant-status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.6);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  backdrop-filter: blur(4px);
}

.video-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   ROBUST RESPONSIVE BREAKPOINTS (ALL SCREENS & VIEWS)
   ========================================================================== */

/* Specifying override for sidebar width in conference view to match mobile collapsing rules */
@media (max-width: 768px) {
  .sidebar-list, 
  .conference-split .sidebar-list {
    width: 100% !important;
    border-right: none;
  }
}

/* Mobile responsive scaling for small screens */
@media (max-width: 600px) {
  .video-call-container {
    max-width: 100% !important;
    max-height: 100% !important;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: none;
    padding: 16px;
  }
  .video-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px;
    max-height: calc(100vh - 160px);
    max-height: calc(100dvh - 160px);
    overflow-y: auto;
  }
  .video-card {
    aspect-ratio: 16/9;
    width: 100%;
    flex-shrink: 0 !important;
  }
}

@media (max-width: 480px) {
  /* Login responsiveness */
  #login-screen {
    padding: 12px;
  }
  .login-card {
    padding: 24px 16px;
    border-radius: var(--radius-md);
  }
  .login-header h1 {
    font-size: 24px;
    margin-bottom: 2px;
  }
  .quick-btn {
    padding: 10px;
  }

  /* Navigation bar adjustments */
  .app-navigation {
    height: 60px;
  }
  .nav-item {
    padding: 4px 0;
  }
  .nav-icon {
    font-size: 18px;
    margin-bottom: 2px;
  }
  .nav-label {
    font-size: 10px;
  }

  /* App Header spacing */
  .header-main {
    padding: 8px 12px;
  }
  .header-branding h2 {
    font-size: 16px;
  }
  
  /* Sabha Conference Room scaling */
  .speakers-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px;
    padding: 16px;
  }
  .audience-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 12px;
  }
  .audience-avatar {
    width: 38px;
    height: 38px;
    font-size: 12px;
  }
  .audience-section {
    padding: 16px;
  }
  .room-top-bar {
    padding: 12px 16px;
  }
  .room-top-bar h2 {
    font-size: 16px;
  }
}

@media (max-width: 360px) {
  .nav-label {
    display: none; /* Hide labels on ultra-narrow screens to keep spacing tidy */
  }
  .nav-icon {
    font-size: 22px;
  }
  .audience-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* ==========================================================================
   CALL LOGS HISTORY VIEWS & LAYOUTS
   ========================================================================== */

.calls-container-box {
  max-width: 600px;
  margin: 30px auto;
  width: 100%;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  height: calc(100% - 60px);
  overflow-y: auto;
}

.calls-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 12px;
}

.calls-list-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-green);
}

.call-log-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-light);
  background-color: var(--color-input-bg);
  padding: 4px 10px;
  border-radius: 12px;
}

.call-logs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.call-log-item {
  display: flex;
  align-items: center;
  background-color: var(--color-white);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.call-log-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.call-log-avatar-wrap {
  margin-right: 16px;
  flex-shrink: 0;
}

.call-avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}

.call-log-details {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
  gap: 2px;
}

.call-log-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text-dark);
}

.call-log-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.call-status-icon {
  display: flex;
  align-items: center;
}

.call-log-time {
  font-size: 11px;
  color: var(--color-text-light);
  margin-top: 2px;
}

.call-log-actions {
  display: flex;
  gap: 10px;
  margin-left: 12px;
  flex-shrink: 0;
}

.call-log-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--transition);
}

.call-log-action-btn.voice {
  background-color: var(--color-green-light);
  color: var(--color-green);
}

.call-log-action-btn.voice:hover {
  background-color: var(--color-green);
  color: var(--color-white);
  transform: scale(1.08);
}

.call-log-action-btn.video {
  background-color: rgba(32, 48, 128, 0.08);
  color: var(--color-blue);
}

.call-log-action-btn.video:hover {
  background-color: var(--color-blue);
  color: var(--color-white);
  transform: scale(1.08);
}

@media (max-width: 400px) {
  .call-log-item {
    padding: 12px 10px;
  }
  .call-avatar-circle {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
  .call-log-name {
    font-size: 14px;
  }
  .call-log-actions {
    gap: 6px;
  }
  .call-log-action-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
}

/* ==========================================================================
   PRIVACY SHIELD — blanks content on blur / print / screenshot key combos
   ========================================================================== */
#privacy-shield {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  background: #0B1F14;
  color: #FFFFFF;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  text-align: center;
  padding: 24px;
  font-family: inherit;
}
#privacy-shield.visible { display: flex; }
#privacy-shield .ps-icon { font-size: 52px; color: #F4C016; }
#privacy-shield h2 { font-size: 20px; margin: 0; font-weight: 700; }
#privacy-shield p { opacity: 0.75; max-width: 440px; line-height: 1.5; margin: 0; }

/* Print / Save-as-PDF blanking — disabled for now along with privacy.js
@media print {
  body > *:not(#privacy-shield) { display: none !important; visibility: hidden !important; }
  #privacy-shield { display: flex !important; }
}
*/

/* ==========================================================================
   MODERN PROFESSIONAL REFRESH  (v2 — real-data build)
   Re-skins the whole app via design tokens + polished component overrides.
   ========================================================================== */
:root {
  --color-green: #0B5D3B;        /* deep professional emerald — headers, primary */
  --color-green-dark: #074B30;
  --color-teal: #00A884;         /* accent (WhatsApp-family) */
  --color-yellow: #E8B10A;       /* refined gold accent */
  --color-blue: #2563EB;
  --color-text-dark: #111B21;
  --color-text-light: #667781;
  --color-bg-neutral: #F7F8FA;
  --color-border: #E9EDEF;
  --color-input-bg: #F0F2F5;
  --color-card-bg: #FFFFFF;
  --color-red-live: #EA4335;
  --color-online: #25D366;
  --color-out-bubble: #D9FDD3;   /* WhatsApp outgoing green */
  --shadow-sm: 0 1px 2px rgba(11,27,33,.06);
  --shadow-md: 0 4px 16px rgba(11,27,33,.08);
  --shadow-lg: 0 16px 48px rgba(11,27,33,.18);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
}
body { background: var(--color-bg-neutral); color: var(--color-text-dark); -webkit-font-smoothing: antialiased; }

/* ---- AUTH SCREEN --------------------------------------------------------- */
.auth-screen {
  position: fixed; inset: 0; display: none; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px; padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(0,168,132,.16), transparent 60%),
    linear-gradient(180deg, #0B5D3B 0%, #0A2F22 100%);
}
.auth-screen.active { display: flex; }
.auth-panel {
  width: 100%; max-width: 400px; background: #fff; border-radius: 24px;
  box-shadow: var(--shadow-lg); padding: 32px 28px; position: relative; overflow: hidden;
}
.auth-brand { text-align: center; margin-bottom: 26px; }
.auth-logo {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center; font-size: 28px; color: #fff;
  background: linear-gradient(135deg, var(--color-teal), var(--color-green));
  box-shadow: 0 8px 20px rgba(11,93,59,.35);
}
.auth-brand h1 { font-size: 30px; font-weight: 800; letter-spacing: -.5px; color: var(--color-text-dark); }
.auth-brand p { color: var(--color-text-light); font-size: 14px; margin-top: 2px; }
.auth-step { display: none; animation: authFade .3s ease; position: relative; }
.auth-step.active { display: block; }
@keyframes authFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.auth-step h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.auth-sub { color: var(--color-text-light); font-size: 14px; line-height: 1.5; margin-bottom: 20px; }
.auth-back {
  position: absolute; top: -6px; right: 0; width: 34px; height: 34px; border: none; cursor: pointer;
  border-radius: 10px; background: var(--color-input-bg); color: var(--color-text-dark);
}
.phone-field { display: flex; gap: 10px; margin-bottom: 8px; }
.country-select {
  border: 1.5px solid var(--color-border); border-radius: 12px; padding: 0 10px; font-size: 15px;
  font-family: inherit; background: #fff; cursor: pointer; min-width: 96px;
}
.phone-field input {
  flex: 1; border: 1.5px solid var(--color-border); border-radius: 12px; padding: 14px 16px;
  font-size: 16px; font-family: inherit; letter-spacing: .5px; outline: none; transition: border-color .15s;
}
.phone-field input:focus, .auth-input-group input:focus, .auth-select:focus { border-color: var(--color-teal); }
.auth-input-group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.auth-input-group input, .auth-select {
  border: 1.5px solid var(--color-border); border-radius: 12px; padding: 14px 16px;
  font-size: 15px; font-family: inherit; outline: none; background: #fff; transition: border-color .15s;
}
.auth-btn {
  width: 100%; margin-top: 18px; border: none; cursor: pointer; border-radius: 14px; padding: 15px;
  font-size: 16px; font-weight: 700; font-family: inherit; color: #fff;
  background: linear-gradient(135deg, var(--color-teal), var(--color-green));
  display: flex; align-items: center; justify-content: center; gap: 8px; transition: transform .1s, opacity .2s;
}
.auth-btn:hover { opacity: .94; }
.auth-btn:active { transform: scale(.98); }
.auth-btn:disabled { opacity: .6; cursor: default; }
.auth-btn.loading span { opacity: .5; }
.auth-btn.loading::after {
  content: ''; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.otp-boxes { display: flex; gap: 8px; justify-content: space-between; margin-bottom: 10px; }
.otp-box {
  width: 46px; height: 54px; text-align: center; font-size: 24px; font-weight: 700;
  border: 1.5px solid var(--color-border); border-radius: 12px; outline: none; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.otp-box:focus { border-color: var(--color-teal); box-shadow: 0 0 0 3px rgba(0,168,132,.15); }
.auth-resend { margin-top: 16px; text-align: center; font-size: 13px; color: var(--color-text-light); }
.auth-link { border: none; background: none; color: var(--color-teal); font-weight: 700; cursor: pointer; font-family: inherit; font-size: 13px; }
.auth-link:disabled { color: var(--color-text-light); cursor: default; }
.auth-dev-hint {
  background: #FFF7E6; border: 1px dashed var(--color-yellow); color: #7a5c00; border-radius: 10px;
  padding: 10px 12px; font-size: 13px; margin-bottom: 12px; text-align: center;
}
.auth-error { color: var(--color-red-live); font-size: 13px; margin-top: 8px; font-weight: 600; }
.auth-leader-note {
  background: var(--color-green-light); color: var(--color-green-dark); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; margin-top: 4px; font-weight: 600;
}
.profile-avatar-preview {
  width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 32px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--color-teal), var(--color-green));
}
.auth-footer { color: rgba(255,255,255,.75); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }

/* ---- HEADER / NAV -------------------------------------------------------- */
.app-header { background: #fff !important; box-shadow: var(--shadow-sm); border-bottom: 1px solid var(--color-border); }
.header-top-strip { display: none !important; }
.header-main { background: #fff !important; padding: 12px 18px !important; }
.header-branding h2 { color: var(--color-green) !important; font-weight: 800 !important; letter-spacing: -.3px; }
.logo-icon { color: var(--color-teal) !important; }
.user-status-pill { background: var(--color-input-bg) !important; box-shadow: none !important; border: 1px solid var(--color-border); }
.leader-privilege-banner { background: linear-gradient(135deg, var(--color-green), var(--color-green-dark)) !important; font-weight: 600; }
.app-navigation { background: #fff !important; border-top: 1px solid var(--color-border); box-shadow: 0 -2px 12px rgba(11,27,33,.05); }
.nav-item { color: var(--color-text-light) !important; }
.nav-item.active { color: var(--color-green) !important; }
.nav-item.active .nav-icon { color: var(--color-green) !important; }

/* ---- LISTS / DIRECTORY --------------------------------------------------- */
.sidebar-list { background: #fff; border-right: 1px solid var(--color-border); }
.list-search { padding: 12px 14px; }
.list-search input { background: var(--color-input-bg) !important; border-radius: 12px !important; border: none !important; }
.member-item { border-radius: 12px; margin: 2px 8px; padding: 10px 12px !important; transition: background .15s; border-bottom: none !important; }
.member-item:hover { background: var(--color-input-bg); }
.member-item.active { background: var(--color-green-light) !important; }
.member-name { font-weight: 600 !important; color: var(--color-text-dark); }
.member-subtitle { color: var(--color-text-light) !important; font-size: 13px !important; }
.presence-badge.online { background: var(--color-online) !important; box-shadow: 0 0 0 2px #fff; }
.leader-badge { background: var(--color-teal) !important; color: #fff !important; font-weight: 700; border-radius: 6px; }
.list-title { color: var(--color-text-light); font-weight: 700; letter-spacing: .3px; }

/* ---- CHAT WINDOW / BUBBLES (WhatsApp-style) ------------------------------ */
.detail-chat-window, .chat-container { background:
  linear-gradient(rgba(247,248,250,.94), rgba(247,248,250,.94)); }
.chat-header { background: #fff !important; border-bottom: 1px solid var(--color-border); box-shadow: var(--shadow-sm); }
.chat-messages { background: transparent; }
.message-bubble { box-shadow: var(--shadow-sm) !important; border-radius: 12px !important; position: relative; max-width: 76%; }
.message-bubble.incoming { background: #fff !important; border-top-left-radius: 4px !important; }
.message-bubble.outgoing { background: var(--color-out-bubble) !important; color: var(--color-text-dark) !important; border-top-right-radius: 4px !important; }
.message-bubble.outgoing .message-text, .message-bubble.outgoing .message-meta { color: var(--color-text-dark) !important; }
.message-sender { color: var(--color-teal) !important; font-weight: 700 !important; font-size: 12.5px; }
.message-meta { color: var(--color-text-light) !important; font-size: 11px !important; }
.call-btn-action { background: var(--color-green) !important; border-radius: 10px !important; }
.send-message-btn { background: var(--color-green) !important; }
.chat-footer input { background: var(--color-input-bg) !important; border-radius: 22px !important; border: none !important; }
.chat-date-sep { text-align: center; margin: 14px 0; }
.chat-date-sep span {
  background: #fff; color: var(--color-text-light); font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 10px; box-shadow: var(--shadow-sm);
}

/* ---- EMPTY STATES -------------------------------------------------------- */
.empty-state i { color: var(--color-teal) !important; opacity: .5; }
.empty-state h3 { color: var(--color-text-dark) !important; }

/* ---- BUTTONS / PILLS ----------------------------------------------------- */
.join-room-btn { background: var(--color-green) !important; border-radius: 10px !important; font-weight: 700; }
.room-live-badge { background: var(--color-red-live) !important; color: #fff !important; }
.stat-pill.yellow-pill { background: var(--color-yellow) !important; color: #3a2c00 !important; }
.stat-pill.blue-pill { background: var(--color-green) !important; }
.promote-btn { background: var(--color-teal) !important; border-radius: 8px !important; }

/* ---- PROFILE ------------------------------------------------------------- */
.profile-header-card { background: linear-gradient(135deg, var(--color-green), var(--color-green-dark)) !important; }
.role-tag { background: rgba(255,255,255,.2) !important; color: #fff !important; }
.logout-btn { background: var(--color-red-live) !important; border-radius: 12px !important; }

/* ---- MODALS -------------------------------------------------------------- */
#create-group-modal .login-card, #create-room-modal .login-card { border-radius: 20px; }

/* ---- FLOATING ACTION (new chat / room) ----------------------------------- */
.fab {
  position: absolute; right: 22px; bottom: 22px; width: 56px; height: 56px; border-radius: 50%;
  border: none; cursor: pointer; color: #fff; font-size: 20px; z-index: 20;
  background: linear-gradient(135deg, var(--color-teal), var(--color-green)); box-shadow: var(--shadow-md);
  transition: transform .1s;
}
.fab:active { transform: scale(.94); }

/* ---- empty list states --------------------------------------------------- */
.list-empty { padding: 48px 26px; text-align: center; color: var(--color-text-light); }
.list-empty i { font-size: 40px; color: var(--color-teal); opacity: .45; margin-bottom: 14px; display: block; }
.list-empty p { font-weight: 700; color: var(--color-text-dark); margin-bottom: 6px; }
.list-empty span { font-size: 13px; line-height: 1.5; display: block; }

/* ---- profile refinements ------------------------------------------------- */
.logout-btn { color: #fff !important; font-weight: 700; padding: 15px !important; display: flex; align-items: center; justify-content: center; gap: 8px; }
.profile-details-list .detail-item .label { display: flex; align-items: center; gap: 8px; color: var(--color-text-light); }
.profile-details-list .detail-item .label i { color: var(--color-teal); }
.profile-phone { color: rgba(255,255,255,.85) !important; }

/* ==========================================================================
   v3 — New-chat directory, chat rows, redesigned profile
   ========================================================================== */

/* ---- New chat sheet ------------------------------------------------------ */
.sheet-screen {
  position: fixed; inset: 0; z-index: 1500; background: var(--color-bg-neutral);
  display: flex; flex-direction: column;
}
.sheet-screen.hidden { display: none; }
.sheet-header {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  background: var(--color-green); color: #fff;
}
.sheet-header h3 { font-size: 18px; font-weight: 700; line-height: 1.1; }
.sheet-sub { font-size: 12px; opacity: .85; }
.sheet-back { border: none; background: transparent; color: #fff; font-size: 18px; cursor: pointer; padding: 4px 6px; }
.sheet-search { padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--color-border); display: flex; align-items: center; gap: 10px; }
.sheet-search i { color: var(--color-text-light); }
.sheet-search input { flex: 1; border: none; outline: none; font-size: 15px; font-family: inherit; background: transparent; }
.sheet-list { flex: 1; overflow-y: auto; background: #fff; padding: 6px 0; }

/* ---- FAB (new chat) ------------------------------------------------------ */
.sidebar-list { position: relative; }
.fab {
  position: absolute; right: 16px; bottom: 16px; z-index: 30;
  width: 52px; height: 52px; border-radius: 16px; border: none; cursor: pointer;
  display: flex !important; align-items: center; justify-content: center;
  color: #fff; background: linear-gradient(135deg, var(--color-teal), var(--color-green));
  box-shadow: 0 8px 20px rgba(11,93,59,.32); transition: transform .12s ease, box-shadow .2s ease;
}
.fab svg { width: 22px; height: 22px; display: block; }
.fab:hover { box-shadow: 0 10px 26px rgba(11,93,59,.42); }
.fab:active { transform: scale(.92); }

/* ---- Chat rows (recent conversations) ------------------------------------ */
.chat-row .member-info { width: 100%; }
.chat-row .member-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-row-time { font-size: 11.5px; color: var(--color-text-light); white-space: nowrap; }
.chat-row-time.unread { color: var(--color-teal); font-weight: 700; }
.unread-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--color-teal);
  color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.empty-cta {
  margin-top: 16px; border: none; cursor: pointer; border-radius: 12px; padding: 11px 18px; font-family: inherit;
  font-weight: 700; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--color-teal), var(--color-green));
  display: inline-flex; gap: 8px; align-items: center;
}
/* The .list-empty icon rule (40px, block) must not blow up the icon INSIDE the CTA button */
.list-empty .empty-cta i,
.empty-cta i { font-size: 13px; display: inline; margin: 0; color: #fff; opacity: 1; }

/* ---- Redesigned profile -------------------------------------------------- */
.profile-v2 { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; }
.profile-id {
  display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--color-border);
  border-radius: 18px; padding: 20px; box-shadow: var(--shadow-sm); position: relative;
}
.profile-id-avatar {
  width: 76px; height: 76px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; font-size: 28px; font-weight: 700; color: #fff;
}
.profile-id-text { flex: 1; min-width: 0; }
.profile-id-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-id-name h2 { font-size: 20px; font-weight: 800; color: var(--color-text-dark); }
.role-chip {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  background: var(--color-green-light); color: var(--color-green-dark); padding: 3px 9px; border-radius: 8px;
}
.profile-id-about { color: var(--color-text-light); font-size: 14px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-id-phone { color: var(--color-text-light); font-size: 13px; margin-top: 6px; }
.profile-id-phone i { color: var(--color-teal); margin-right: 4px; }
.profile-edit-btn {
  position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border-radius: 12px; border: none;
  background: var(--color-input-bg); color: var(--color-green); cursor: pointer; font-size: 14px;
}
.profile-edit-btn:hover { background: var(--color-green-light); }
.settings-group { background: #fff; border: 1px solid var(--color-border); border-radius: 18px; margin-top: 16px; overflow: hidden; box-shadow: var(--shadow-sm); }
.settings-row { display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--color-border); }
.settings-row:last-child { border-bottom: none; }
.settings-icon { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; flex-shrink: 0; }
.settings-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.settings-label { font-size: 12px; color: var(--color-text-light); }
.settings-value { font-size: 15px; color: var(--color-text-dark); font-weight: 600; }
.settings-ok { color: var(--color-online); font-size: 18px; }
.profile-v2 .logout-btn { width: 100%; margin-top: 18px; }
.profile-foot { text-align: center; color: var(--color-text-light); font-size: 12px; margin-top: 16px; }

/* role-chip clipping fix — keep it whole and clear of the edit button */
.profile-id-name { padding-right: 40px; }
.profile-id-name h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.role-chip { flex-shrink: 0; white-space: nowrap; }

/* ==========================================================================
   DESKTOP RESPONSIVE OVERHAUL (≥900px)
   The mobile bottom-tab layout becomes a proper desktop app shell:
   left navigation rail · header · two-pane content with sane max-widths.
   Phones and small tablets keep the original layout untouched.
   ========================================================================== */
@media (min-width: 900px) {

  /* ---- App shell: rail | (header / content) ---- */
  #app-container {
    display: grid;
    grid-template-columns: 92px 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "nav header"
      "nav main";
  }
  .app-header { grid-area: header; }
  .app-content { grid-area: main; }

  /* ---- Bottom tab bar -> left navigation rail ---- */
  .app-navigation {
    grid-area: nav;
    height: auto !important;
    flex-direction: column;
    justify-content: flex-start !important;
    gap: 10px;
    padding: 18px 10px;
    background: linear-gradient(180deg, var(--color-green) 0%, var(--color-green-dark, #074B30) 100%) !important;
    border-top: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08) !important;
  }
  .nav-item {
    flex-grow: 0;
    width: 100%;
    padding: 10px 4px;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.62) !important;
    background: transparent;
    border: none;
    cursor: pointer;
  }
  .nav-item:hover { background: rgba(255, 255, 255, 0.10); color: #fff !important; }
  .nav-item.active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff !important;
  }
  .nav-item.active .nav-icon { color: #fff !important; }
  .nav-item.active::after { display: none; }   /* the old top-edge indicator */
  .nav-icon { font-size: 18px; margin-bottom: 5px; }
  .nav-label { font-size: 10px; letter-spacing: 0.3px; }

  /* ---- Header: tighter, aligned with content ---- */
  .header-main { padding: 10px 24px; }
  .header-top-strip { display: none; }

  /* ---- Two-pane views: responsive sidebar, comfortable reading width ---- */
  .sidebar-list,
  .conference-split .sidebar-list { width: clamp(300px, 26vw, 380px); }

  .detail-chat-window { background: #EFF2F0; }
  .chat-messages { padding: 24px clamp(24px, 7vw, 110px) !important; }
  .chat-footer { padding-left: clamp(16px, 6vw, 100px) !important; padding-right: clamp(16px, 6vw, 100px) !important; }

  /* ---- Empty states: calmer at desktop scale ---- */
  .empty-state i { font-size: 44px; margin-bottom: 14px; }
  .empty-state h3 { font-size: 16px; }
  .empty-state p { font-size: 12.5px; }

  /* ---- Single-column views: card on a neutral canvas ---- */
  .calls-container-box { max-width: 680px; margin: 28px auto; }
  .profile-v2 { max-width: 640px; padding-top: 28px; }

  /* ---- Thin scrollbars for desktop ---- */
  .members-list::-webkit-scrollbar,
  .rooms-list::-webkit-scrollbar,
  .chat-messages::-webkit-scrollbar,
  .call-logs-list::-webkit-scrollbar { width: 8px; }
  .members-list::-webkit-scrollbar-thumb,
  .rooms-list::-webkit-scrollbar-thumb,
  .chat-messages::-webkit-scrollbar-thumb,
  .call-logs-list::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.14); border-radius: 8px; }
}

/* Large desktop: give the rail labels a little more presence */
@media (min-width: 1400px) {
  #app-container { grid-template-columns: 104px 1fr; }
  .nav-icon { font-size: 20px; }
  .nav-label { font-size: 11px; }
}

/* ==========================================================================
   DESKTOP POLISH v2 — dialogs, empty states, profile, bubbles
   ========================================================================== */
@media (min-width: 900px) {

  /* Full-screen "New chat" sheet becomes a centered dialog with a dim backdrop */
  .sheet-screen {
    inset: auto;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: min(540px, 92vw);
    height: min(700px, 88vh);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35), 0 0 0 100vmax rgba(17, 27, 33, 0.45);
  }
  .sheet-screen.hidden { display: none; }

  /* Form modals: soft dim scrim instead of the solid green wall */
  #create-group-modal, #edit-profile-modal, #create-room-modal {
    background: rgba(17, 27, 33, 0.55);
    backdrop-filter: blur(3px);
  }
  #create-group-modal .login-card,
  #edit-profile-modal .login-card,
  #create-room-modal .login-card { border-radius: 20px; box-shadow: 0 24px 64px rgba(0,0,0,.35); }

  /* Sidebar empty states + the New chat CTA at sane proportions */
  .list-empty { padding: 56px 24px; }
  .list-empty i { font-size: 34px; }
  .list-empty p { font-size: 14px; }
  .list-empty span { font-size: 12px; max-width: 230px; margin: 0 auto; }
  .empty-cta {
    margin-top: 18px; padding: 10px 20px; font-size: 13px;
    border-radius: 10px; box-shadow: 0 6px 16px rgba(11, 93, 59, 0.25);
  }
  .empty-cta:hover { filter: brightness(1.06); }

  /* Chat bubbles: comfortable desktop reading width */
  .message-bubble { max-width: 58% !important; }

  /* Profile: card look on the neutral canvas, compact logout */
  .profile-v2 .logout-btn {
    width: auto; min-width: 240px; margin: 24px auto 0; display: flex;
    align-items: center; justify-content: center; gap: 8px;
  }

  /* Calls list card */
  .calls-container-box { background: #fff; border: 1px solid var(--color-border);
    border-radius: 16px; padding: 20px 24px; height: auto; max-height: calc(100% - 56px); }
}

/* ---- Group members panel ------------------------------------------------- */
.members-section-label {
  padding: 12px 18px 6px; font-size: 11px; font-weight: 800; letter-spacing: .6px;
  text-transform: uppercase; color: var(--color-text-light);
}
.member-action {
  border: none; cursor: pointer; width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
  margin-left: auto; flex-shrink: 0; transition: var(--transition);
}
.member-action.add { background: rgba(0, 168, 132, .12); color: var(--color-teal); }
.member-action.add:hover { background: var(--color-teal); color: #fff; }
.member-action.remove { background: rgba(234, 67, 53, .10); color: var(--color-red-live); }
.member-action.remove:hover { background: var(--color-red-live); color: #fff; }
#group-members-list .member-item { cursor: default; }

/* ---- Audience HLS broadcast stage ---------------------------------------- */
#sabha-hls-stage {
  position: relative; width: 100%; max-width: 900px; margin: 0 auto 18px;
  border-radius: 16px; overflow: hidden; background: #000;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}
#sabha-hls-stage.hidden { display: none; }
#sabha-hls-video { width: 100%; display: block; aspect-ratio: 16 / 9; background: #000; object-fit: contain; }
#sabha-hls-unmute {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  border: none; cursor: pointer; border-radius: 24px; padding: 10px 22px;
  font-family: inherit; font-weight: 700; font-size: 14px; color: #1A1500;
  background: var(--color-yellow); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  display: inline-flex; gap: 8px; align-items: center;
}
#sabha-hls-unmute.hidden { display: none; }
#sabha-hls-note {
  padding: 42px 20px; text-align: center; color: rgba(255, 255, 255, 0.85);
  font-weight: 600; font-size: 14px;
}
#sabha-hls-note.hidden { display: none; }

/* ==========================================================================
   SABHA IDENTITY — final design layer
   Kills the generic template look: flat ink-green + warm paper + burnished
   gold, editorial display type, hairline borders and pressed (not floaty)
   buttons. Applies to every page, mobile and desktop.
   ========================================================================== */
:root {
  --color-green: #123D2A;          /* deep forest ink — primary */
  --color-green-dark: #0B2A1D;
  --color-teal: #1E6F50;           /* serious green replaces minty teal */
  --color-yellow: #D9A514;         /* burnished gold accent */
  --color-blue: #274690;
  --color-text-dark: #14201A;
  --color-text-light: #5C6B62;
  --color-bg-neutral: #F4F1E8;     /* warm paper, not gray */
  --color-border: #E3DECF;
  --color-input-bg: #ECE8DB;
  --color-card-bg: #FFFDF7;
  --color-out-bubble: #EFE3BC;     /* gold-paper outgoing bubble */
  --color-online: #2E9E5B;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 0 rgba(20, 32, 26, 0.05);
  --shadow-md: 0 2px 0 rgba(20, 32, 26, 0.07);
  --shadow-lg: 0 18px 44px rgba(20, 32, 26, 0.20);
  --font-display: 'Bricolage Grotesque', 'Outfit', sans-serif;
}

body { background: var(--color-bg-neutral); }

/* ---- Type: editorial display for identity moments ---- */
h1, h2, h3, .header-branding h2, .auth-brand h1, .room-meta h2,
.sheet-header h3, .calls-list-header h3, .profile-id-name h2, .empty-state h3 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

/* ---- Header: quiet paper bar with a gold hairline signature ---- */
.app-header { background: var(--color-card-bg) !important; border-bottom: 1px solid var(--color-border); box-shadow: none; }
.header-top-strip { display: block; height: 3px; background: linear-gradient(90deg, var(--color-green) 0 60%, var(--color-yellow) 60% 80%, var(--color-green) 80%); }
.header-branding h2 { font-size: 19px; font-weight: 800; color: var(--color-green); letter-spacing: 0.02em; }
.logo-icon { background: var(--color-green); color: var(--color-yellow); font-size: 16px; width: 34px; height: 34px; padding: 0; }
.user-status-pill { border: 1px solid var(--color-border); box-shadow: none; background: var(--color-bg-neutral); }
.leader-privilege-banner { background: var(--color-green-dark); color: #E9E4D2; font-size: 11.5px; }

/* ---- Buttons: flat ink with a pressed edge — no gradients anywhere ---- */
.auth-btn, .submit-btn, .empty-cta, .send-message-btn, .call-btn-action {
  background: var(--color-green) !important;
  background-image: none !important;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 0 var(--color-green-dark);
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}
.auth-btn:active, .submit-btn:active, .empty-cta:active, .send-message-btn:active, .call-btn-action:active {
  transform: translateY(2px); box-shadow: 0 0 0 var(--color-green-dark);
}
.submit-btn:hover, .auth-btn:hover { transform: none; background: var(--color-green-dark) !important; }
.fab {
  background: var(--color-yellow) !important; color: var(--color-green-dark) !important;
  border-radius: var(--radius-lg); box-shadow: 0 3px 0 rgba(20, 32, 26, 0.35);
}
.fab:hover { box-shadow: 0 3px 0 rgba(20, 32, 26, 0.35); }
.fab:active { transform: translateY(3px); box-shadow: none; }

/* ---- Lists & cards: hairline borders on warm paper ---- */
.sidebar-list { background: var(--color-card-bg); }
.member-item { border-bottom: 1px solid var(--color-border); }
.member-item.active { background: rgba(217, 165, 20, 0.12); box-shadow: inset 3px 0 0 var(--color-yellow); }
.member-item:hover { background: rgba(18, 61, 42, 0.05); }
.settings-group, .profile-id, .calls-container-box {
  background: var(--color-card-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
}
.list-title { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; }
.members-section-label { letter-spacing: 0.08em; }

/* ---- Chat: paper canvas, crisp bubbles ---- */
.detail-chat-window, .chat-container { background: var(--color-bg-neutral) !important; }
.chat-header { background: var(--color-card-bg); border-bottom: 1px solid var(--color-border); }
.message-bubble {
  box-shadow: var(--shadow-sm) !important;
  border: 1px solid rgba(20, 32, 26, 0.08);
  border-radius: var(--radius-md) !important;
}
.message-bubble.outgoing { background: var(--color-out-bubble) !important; }
.message-bubble.incoming { background: #FFFFFF !important; }
.chat-footer { background: var(--color-card-bg); border-top: 1px solid var(--color-border); }
.chat-footer input { background: var(--color-input-bg); border-radius: var(--radius-md); }

/* ---- Auth: ink hall with gold seal ---- */
.auth-screen, #login-screen {
  background:
    radial-gradient(900px 480px at 50% -8%, rgba(217, 165, 20, 0.14), transparent 55%),
    var(--color-green-dark) !important;
}
.auth-panel, .login-card { border-radius: 18px; border: 1px solid rgba(217, 165, 20, 0.25); background: var(--color-card-bg); }
.auth-logo { background: var(--color-green); color: var(--color-yellow); }

/* ---- Sheets & dialogs ---- */
.sheet-header { background: var(--color-green) !important; }
.sheet-search { background: var(--color-card-bg); }
.sheet-list { background: var(--color-card-bg); }

/* ---- Immersive Sabha stage: near-black green, gold instrumentation ---- */
.sabha-immersive-room { background: #0A130E !important; }
.room-top-bar { border-bottom: 1px solid rgba(217, 165, 20, 0.18); }
.stat-pill { border-radius: 8px; font-weight: 700; }
.stat-pill.yellow-pill { background: var(--color-yellow); color: #14201A; }
.stat-pill.blue-pill { background: rgba(255, 255, 255, 0.08); color: #E9E4D2; border: 1px solid rgba(255, 255, 255, 0.14); }
.speaker-card { background: #121D15; border: 1px solid rgba(255, 255, 255, 0.07); border-radius: var(--radius-lg); }
.control-btn { border-radius: var(--radius-md); font-weight: 700; }
.audience-section { border: 1px solid rgba(255, 255, 255, 0.07); border-radius: var(--radius-lg); background: #0F1911; }
#sabha-hls-stage { border: 1px solid rgba(217, 165, 20, 0.25); border-radius: var(--radius-lg); }

/* ==========================================================================
   MOBILE SHELL (<900px): compact header + dock-style tab bar
   ========================================================================== */
@media (max-width: 899px) {
  .header-main { padding: 8px 14px; }
  .header-branding { gap: 8px; }
  .logo-icon { width: 30px; height: 30px; font-size: 14px; }
  .header-branding h2 { font-size: 17px; }
  .user-status-pill { padding: 4px 10px; }
  .leader-privilege-banner { font-size: 10.5px; padding: 6px 12px; }

  .app-navigation {
    height: 60px;
    background: var(--color-card-bg) !important;
    border-top: 1px solid var(--color-border) !important;
    box-shadow: 0 -1px 0 rgba(20, 32, 26, 0.04) !important;
    padding: 6px 8px;
  }
  .nav-item { color: var(--color-text-light) !important; border-radius: var(--radius-md); }
  .nav-item.active { color: var(--color-green) !important; }
  .nav-item.active::after { display: none; }
  .nav-item.active .nav-icon {
    background: rgba(18, 61, 42, 0.10);
    border-radius: 999px;
    padding: 3px 16px;
  }
  .nav-icon { font-size: 17px; margin-bottom: 3px; transition: var(--transition); }
  .nav-label { font-size: 10px; font-weight: 700; letter-spacing: 0.02em; }

  /* Room screen: tighter chrome on small screens */
  .room-top-bar { padding: 12px 14px; }
  .room-meta h2 { font-size: 17px; }
  .leave-room-btn { padding: 7px 12px; font-size: 12px; }
  .room-bottom-controls { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .control-btn { font-size: 12.5px; padding: 10px 14px; }
  .empty-state i { font-size: 40px; }
}

/* ==========================================================================
   MOBILE FIXES — call sheet cutoff + full-screen conversations
   ========================================================================== */

/* 100vh includes the area under the mobile URL bar — dvh is the real screen.
   This is why the incoming-call Accept/Decline buttons were cut off. */
#app-container, .call-overlay, .auth-screen, #login-screen, .sheet-screen {
  height: 100dvh;
}
.call-overlay { width: 100vw; width: 100dvw; }

/* Incoming call sheet: keep buttons above the home-indicator / nav bar */
.incoming-sheet-card {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

@media (max-width: 899px) {
  /* WhatsApp behaviour: inside an open conversation or a live room, the app
     chrome (header + tab bar) gets out of the way. The back arrow (or Leave
     Room) restores it — closeActiveDetail() re-adds .empty. */
  #app-container:has(#tab-chats.active #chat-detail-panel:not(.empty)) .app-header,
  #app-container:has(#tab-chats.active #chat-detail-panel:not(.empty)) .app-navigation,
  #app-container:has(#tab-groups.active #group-detail-panel:not(.empty)) .app-header,
  #app-container:has(#tab-groups.active #group-detail-panel:not(.empty)) .app-navigation,
  #app-container:has(#tab-conference.active #conference-detail-panel:not(.empty)) .app-header,
  #app-container:has(#tab-conference.active #conference-detail-panel:not(.empty)) .app-navigation {
    display: none;
  }

  /* Chat header becomes the sole top bar in a conversation */
  .chat-header { padding: 10px 12px; }
  .chat-header .mobile-back-btn { display: block; }
}

/* ==========================================================================
   SABHA STAGE — PREMIUM LAYER
   The live room becomes a cinematic assembly hall: layered ink-green depth,
   glass panels, gold instrumentation, a breathing gold ring on whoever is
   speaking, and a floating control dock.
   ========================================================================== */

/* ---- The hall ---- */
.sabha-immersive-room {
  background:
    radial-gradient(1100px 520px at 50% -12%, rgba(217, 165, 20, 0.10), transparent 60%),
    radial-gradient(900px 460px at 88% 112%, rgba(30, 111, 80, 0.16), transparent 60%),
    #070D09 !important;
}
.room-center { max-width: 1040px; margin: 0 auto; width: 100%; }

/* ---- Top bar: glass, editorial title, quiet leave ---- */
.room-top-bar {
  background: rgba(9, 16, 11, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(217, 165, 20, 0.16);
}
.room-meta h2 { font-family: var(--font-display); font-size: 21px; letter-spacing: -0.01em; color: #F3EFDF; }
.room-meta p { color: rgba(237, 232, 216, 0.55); }
.live-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(229, 57, 53, 0.14); color: #FF7A72;
  border: 1px solid rgba(229, 57, 53, 0.35);
  border-radius: 999px; padding: 3px 10px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em;
  animation: liveBreath 2.2s ease-in-out infinite;
}
@keyframes liveBreath {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(229, 57, 53, 0.00); }
}
.leave-room-btn {
  background: transparent !important; color: #FF8A80 !important;
  border: 1px solid rgba(255, 138, 128, 0.4) !important;
  border-radius: 999px; font-weight: 700;
  box-shadow: none;
}
.leave-room-btn:hover { background: rgba(229, 57, 53, 0.14) !important; }

/* ---- Ticker: gold counter with a soft sheen ---- */
.ticker-box { gap: 10px; }
.stat-pill.yellow-pill {
  background: linear-gradient(180deg, #E9BC33, #C9970E);
  color: #14140A; border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 18px rgba(217, 165, 20, 0.22);
  border-radius: 999px;
}
.stat-pill.blue-pill {
  background: rgba(255, 255, 255, 0.06); color: #D9D3C0;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 999px;
  backdrop-filter: blur(8px);
}

/* ---- Broadcast player: cinema frame with a LIVE chip ---- */
#sabha-hls-stage {
  border: 1px solid rgba(217, 165, 20, 0.30);
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 0 6px rgba(255, 255, 255, 0.02);
}
#sabha-hls-stage::before {
  content: 'LIVE';
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: #E53935; color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: 0.12em;
  padding: 4px 10px; border-radius: 6px;
  box-shadow: 0 4px 14px rgba(229, 57, 53, 0.45);
}

/* ---- Speakers: stage cards with a breathing gold speaking ring ---- */
.speakers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.speaker-card {
  background: linear-gradient(180deg, #121C14 0%, #0C130E 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  padding: 12px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
}
.speaker-card:hover { transform: translateY(-2px); }
.speaker-card.speaking {
  border-color: rgba(217, 165, 20, 0.65);
  box-shadow: 0 0 0 1px rgba(217, 165, 20, 0.45), 0 0 30px rgba(217, 165, 20, 0.16);
  animation: speakGlow 1.6s ease-in-out infinite;
}
@keyframes speakGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(217, 165, 20, 0.45), 0 0 22px rgba(217, 165, 20, 0.12); }
  50%      { box-shadow: 0 0 0 1px rgba(217, 165, 20, 0.65), 0 0 38px rgba(217, 165, 20, 0.24); }
}
.speaker-video-wrap {
  border-radius: 12px; overflow: hidden; background: #0A0F0B;
  aspect-ratio: 4 / 3; position: relative;
}
.speaker-video-feed { width: 100%; height: 100%; object-fit: cover; }
.speaker-avatar-wrap { display: flex; align-items: center; justify-content: center; height: 100%; }
.speaker-avatar {
  box-shadow: 0 0 0 3px rgba(217, 165, 20, 0.25), 0 10px 26px rgba(0, 0, 0, 0.5);
}
.speaker-name { color: #F0EBDB; font-weight: 700; font-size: 13px; }
.speaker-role {
  color: var(--color-yellow); font-size: 9.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.mute-indicator-badge {
  background: rgba(229, 57, 53, 0.9); border: 2px solid #0C130E;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

/* ---- Audience: quiet glass gallery ---- */
.audience-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  backdrop-filter: blur(8px);
}
.audience-section-header {
  color: var(--color-yellow); font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.12em;
}

/* ---- Host requests drawer: glass card ---- */
.host-drawer {
  background: rgba(14, 22, 16, 0.9);
  border: 1px solid rgba(217, 165, 20, 0.25);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.host-drawer h3 { color: #F0EBDB; }

/* ---- Floating control dock ---- */
.room-bottom-controls {
  background: transparent !important; border-top: none !important;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
}
.audio-controls-panel {
  margin: 0 auto; width: max-content; max-width: 100%;
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  background: rgba(15, 24, 17, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px; padding: 10px 14px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}
.control-btn {
  border-radius: 999px !important; padding: 11px 18px;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #EDE8D8 !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  font-weight: 700;
}
.control-btn:hover { background: rgba(255, 255, 255, 0.14) !important; }
.control-btn.raise-hand-action {
  background: linear-gradient(180deg, #E9BC33, #C9970E) !important;
  color: #14140A !important; border: none !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 22px rgba(217, 165, 20, 0.28);
}
.control-btn.active-speaking-control {
  background: var(--color-online) !important; color: #fff !important; border: none !important;
}

/* ---- Rooms list: event cards ---- */
#rooms-list .room-item {
  margin: 10px 14px; padding: 14px 16px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
#rooms-list .room-item:hover { transform: translateY(-1px); box-shadow: 0 4px 0 rgba(20, 32, 26, 0.08); }
#rooms-list .room-item.active { box-shadow: inset 3px 0 0 var(--color-yellow), var(--shadow-md); background: rgba(217, 165, 20, 0.07); }
.room-item-title { font-family: var(--font-display); font-weight: 700; }
.room-live-badge {
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em;
  color: #C62828; background: rgba(229, 57, 53, 0.10);
  border: 1px solid rgba(229, 57, 53, 0.25);
  padding: 2px 8px; border-radius: 999px;
}
.join-room-btn {
  background: var(--color-green) !important; color: #fff;
  border: none; border-radius: 10px; padding: 8px 16px;
  font-family: inherit; font-weight: 700; font-size: 12.5px; cursor: pointer;
  box-shadow: 0 2px 0 var(--color-green-dark);
}
.join-room-btn:active { transform: translateY(2px); box-shadow: none; }

/* ---- Mobile stage tuning ---- */
@media (max-width: 899px) {
  .speakers-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .speaker-card { padding: 8px; border-radius: 14px; }
  .room-center { padding: 12px; }
  .ticker-box { flex-wrap: wrap; }
  .audio-controls-panel { gap: 8px; padding: 8px 10px; }
  .control-btn { padding: 10px 14px; font-size: 12px; }
}

/* ==========================================================================
   ROOMS LIST — scroll fix + compact WhatsApp-style cards on mobile
   ========================================================================== */

/* The rooms list had no overflow rule at all — it could never scroll. */
.rooms-list, .members-list, .sheet-list, .call-logs-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 899px) {
  /* Compact event rows instead of tall cards */
  #rooms-list .room-item { margin: 8px 10px; padding: 12px 14px; }
  .room-item-header { display: flex; align-items: center; gap: 8px; }
  .room-item-title { font-size: 15px; }
  .room-item-topic { font-size: 12px; margin: 2px 0 4px; }
  .room-item-footer { font-size: 11.5px; }
  #rooms-list .room-item > div > div[style*="margin-top"] { margin-top: 6px !important; }
  .join-room-btn { padding: 7px 14px; font-size: 12px; }
  .list-title { padding: 10px 14px 4px; }
}

/* ==========================================================================
   LOGIN REDESIGN — assembly-hall arrival
   Left: a lit brand hero (wordmark, gold rule, feature manifest).
   Right: the entry card under a gold seal. Mobile stacks it into a
   hero-topped sheet. Layered light + concentric rings give the depth
   the flat card lacked.
   ========================================================================== */

#login-screen {
  background:
    repeating-radial-gradient(circle at 50% 30%, transparent 0 90px, rgba(217, 165, 20, 0.028) 90px 92px),
    radial-gradient(1000px 560px at 50% -10%, rgba(217, 165, 20, 0.16), transparent 58%),
    radial-gradient(760px 520px at 110% 108%, rgba(30, 111, 80, 0.22), transparent 62%),
    linear-gradient(180deg, #0C2A1D 0%, #071A11 100%) !important;
  padding: 28px 18px;
}

.auth-stage {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
  width: 100%;
  max-width: 420px;
  align-items: center;
}

/* ---- Hero ---- */
.auth-hero { text-align: center; color: #F3EFDF; }
.auth-hero-seal {
  width: 74px; height: 74px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: var(--color-yellow);
  background: rgba(217, 165, 20, 0.08);
  border: 1px solid rgba(217, 165, 20, 0.4);
  border-radius: 50%;
  box-shadow: 0 0 0 8px rgba(217, 165, 20, 0.05), 0 0 44px rgba(217, 165, 20, 0.18);
}
.auth-wordmark {
  font-family: var(--font-display);
  font-size: 52px; font-weight: 800; letter-spacing: -0.02em;
  color: #F6F1DE; line-height: 1;
  text-shadow: 0 2px 24px rgba(217, 165, 20, 0.25);
}
.auth-rule {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 14px auto 10px; max-width: 240px;
}
.auth-rule span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(217, 165, 20, 0.55)); }
.auth-rule span:last-child { background: linear-gradient(90deg, rgba(217, 165, 20, 0.55), transparent); }
.auth-rule i { font-size: 5px; color: var(--color-yellow); }
.auth-tagline {
  font-size: 14.5px; color: rgba(243, 239, 223, 0.72);
  letter-spacing: 0.04em; margin-bottom: 22px;
}
.auth-points { list-style: none; display: none; flex-direction: column; gap: 12px; text-align: left; }
.auth-points li {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px; padding: 12px 16px;
  backdrop-filter: blur(8px);
}
.auth-point-ic {
  width: 38px; height: 38px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; font-size: 15px;
  color: #14140A; background: linear-gradient(180deg, #E9BC33, #C9970E);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.auth-points b { display: block; font-size: 13.5px; font-weight: 700; color: #F3EFDF; }
.auth-points em { display: block; font-style: normal; font-size: 11.5px; color: rgba(243, 239, 223, 0.55); }

/* ---- Entry card ---- */
.auth-panel {
  position: relative;
  border: 1px solid rgba(217, 165, 20, 0.35);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 8px rgba(217, 165, 20, 0.04);
  overflow: visible;
}
.auth-panel::before {
  content: '';
  position: absolute; top: 0; left: 24px; right: 24px; height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-yellow), transparent);
  border-radius: 0 0 4px 4px;
}
.auth-brand-compact { margin-bottom: 20px; }
.auth-brand-compact .auth-logo { width: 46px; height: 46px; font-size: 20px; margin: 0 auto 8px; border-radius: 14px; }
.auth-brand-compact h1 { font-size: 20px; }
.auth-brand-compact p { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.12em; }

.otp-box:focus { border-color: var(--color-yellow); box-shadow: 0 0 0 3px rgba(217, 165, 20, 0.22); }

.auth-footer { margin-top: 20px; color: rgba(243, 239, 223, 0.5); }

/* ---- Desktop: split hall ---- */
@media (min-width: 900px) {
  .auth-stage {
    max-width: 950px;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 64px;
  }
  .auth-hero { text-align: left; }
  .auth-hero-seal { margin: 0 0 18px; }
  .auth-wordmark { font-size: 72px; }
  .auth-rule { margin: 18px 0 12px; justify-content: flex-start; max-width: 260px; }
  .auth-tagline { margin-bottom: 28px; font-size: 16px; }
  .auth-points { display: flex; }
  .auth-brand-compact { display: none; }   /* the hero carries the brand on desktop */
  .auth-panel { padding: 38px 34px; }
}

/* Small phones: keep the hero tight */
@media (max-width: 899px) {
  .auth-wordmark { font-size: 40px; }
  .auth-hero-seal { width: 62px; height: 62px; font-size: 25px; }
  .auth-tagline { margin-bottom: 4px; }
  .auth-brand-compact { display: none; }   /* hero already introduces the brand */
}

/* ==========================================================================
   LOGIN v3 — editorial restraint.
   No glows, no glass, no gradients, no icon chips. One flat ink surface,
   one gold detail, typography does all the work.
   ========================================================================== */

#login-screen {
  background: #0E241A !important;          /* single flat ink — no gradients */
  border-top: 3px solid var(--color-yellow); /* the one flag detail */
  padding: 0 20px;
  align-items: center;
}

.auth-stage {
  max-width: 1020px;
  gap: 44px;
  align-items: center;
}

/* Kill the previous decoration outright */
.auth-hero-seal, .auth-rule { display: none !important; }
.auth-points { display: none !important; }
.auth-panel::before { display: none; }

/* ---- Typographic hero: kicker above, wordmark, one line of copy ---- */
.auth-hero { display: flex; flex-direction: column; text-align: left; }
.auth-tagline {
  order: -1;                                /* the tagline becomes a kicker */
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-yellow);
  margin: 0 0 16px;
}
.auth-wordmark {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #F5F2E8;
  text-shadow: none;
  line-height: 0.95;
}
.auth-wordmark::after { content: '.'; color: var(--color-yellow); }

/* ---- Entry card: flat, square-shouldered, quiet ---- */
.auth-panel {
  background: #FFFFFF;
  border: none;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  padding: 30px 28px;
}
.auth-step h2 { font-size: 17px; letter-spacing: -0.01em; }
.auth-sub { font-size: 13px; }
.auth-btn { border-radius: 8px; box-shadow: none; }
.auth-btn:active { transform: none; opacity: 0.85; }
.otp-box { border-radius: 8px; }
.phone-field input, .auth-input-group input, .auth-select, .country-select { border-radius: 8px; }

.auth-footer {
  margin-top: 22px;
  color: rgba(245, 242, 232, 0.38);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}
.auth-footer i { display: none; }          /* no lock icon — words are enough */

/* ---- Desktop: asymmetric two-column, top-weighted like a printed page ---- */
@media (min-width: 900px) {
  .auth-stage { grid-template-columns: 1.15fr 0.85fr; gap: 88px; }
  .auth-wordmark { font-size: 96px; }
  .auth-tagline { font-size: 12px; }
  .auth-panel { padding: 36px 32px; }
}

/* ---- Mobile: same language, stacked, left-aligned ---- */
@media (max-width: 899px) {
  #login-screen { padding: 0 22px; }
  .auth-stage { gap: 30px; padding-top: 8vh; align-content: start; min-height: 100dvh; }
  .auth-wordmark { font-size: 56px; }
}

/* ==========================================================================
   LOGIN v3.1 — fluid responsiveness (phone / tablet / desktop)
   Type and layout scale with the viewport instead of jumping at one
   breakpoint; centering is scroll-safe on short screens.
   ========================================================================== */

#login-screen { overflow-y: auto; }

/* One fluid column by default; the stage centers itself and can scroll */
.auth-stage {
  width: 100%;
  max-width: 430px;
  margin: auto;
  padding: 36px 0;
  grid-template-columns: 1fr;
  gap: 30px;
  align-content: center;
  min-height: 0;
}

/* Type scales with the screen — no fixed jumps */
.auth-wordmark { font-size: clamp(44px, 12vw, 64px); }
.auth-tagline { font-size: clamp(10px, 2.6vw, 12px); }

/* Tablet portrait: same stack, roomier column */
@media (min-width: 600px) and (max-width: 899px) {
  .auth-stage { max-width: 500px; gap: 36px; }
  .auth-wordmark { font-size: clamp(56px, 9vw, 72px); }
  .auth-panel { padding: 34px 32px; }
}

/* Tablet landscape & desktop: two columns, fluid gutter */
@media (min-width: 900px) {
  .auth-stage {
    max-width: min(1020px, 92vw);
    grid-template-columns: 1.15fr 0.85fr;
    gap: clamp(40px, 7vw, 88px);
  }
  .auth-wordmark { font-size: clamp(64px, 8.5vw, 96px); }
}

/* Short screens (landscape phones): stop centering, just flow and scroll */
@media (max-height: 640px) {
  .auth-stage { align-content: start; padding-top: 28px; }
}

/* Login overflow fix: grid/flex children must be allowed to shrink below
   their intrinsic width, else the tel input pushes the card off-screen. */
.auth-stage > * { min-width: 0; }
.auth-panel { width: 100%; }
.phone-field { width: 100%; }
.phone-field input { min-width: 0; width: 100%; }
.auth-input-group input, .auth-select { min-width: 0; width: 100%; }
.otp-boxes { flex-wrap: nowrap; }
.otp-box { min-width: 0; }

/* The broadcast player must not be crushed by the .room-center flex column */
#sabha-hls-stage { flex-shrink: 0; }
#sabha-hls-video { min-height: 200px; }

/* ==========================================================================
   SABHA STAGE — professional pass: video-first 16:9 tiles, less chrome
   ========================================================================== */
.speakers-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 460px)); justify-content: center; }
.speaker-video-wrap { aspect-ratio: 16 / 9; }
.stat-pill.blue-pill { display: none; }         /* decorative, said nothing */
.ticker-box { justify-content: center; }
.stat-pill { font-size: 12px; padding: 7px 14px; }
.room-center { gap: 16px; }
.audience-section { padding: 12px 16px; }
.audience-grid .audience-avatar, .audience-grid .avatar { width: 34px; height: 34px; font-size: 12px; }
#sabha-hls-stage { margin-bottom: 6px; }
@media (max-width: 899px) {
  .speakers-grid { grid-template-columns: 1fr; }
  .speaker-video-wrap { aspect-ratio: 16 / 10; }
}

/* ==========================================================================
   PARTICIPANTS PANEL (Zoom-style) + FULLSCREEN
   ========================================================================== */

/* The old audience blob is replaced by the panel */
.audience-section { display: none !important; }

#sabha-active-room { position: relative; }

#room-participants-panel {
  position: absolute;
  top: 74px; right: 14px; bottom: 96px;
  width: 320px;
  display: flex; flex-direction: column;
  background: rgba(13, 21, 15, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 60;
  animation: ppSlide 0.18s ease-out;
}
@keyframes ppSlide { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
#room-participants-panel.hidden { display: none; }

.pp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.pp-header h3 {
  font-size: 14px; color: #F0EBDB; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.pp-header h3 i { color: var(--color-yellow); font-size: 12px; }
.pp-close {
  border: none; background: rgba(255, 255, 255, 0.08); color: #EDE8D8;
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pp-close:hover { background: rgba(255, 255, 255, 0.16); }

.pp-body { flex: 1; overflow-y: auto; padding: 8px 0 12px; }
.pp-body::-webkit-scrollbar { width: 6px; }
.pp-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 6px; }

.pp-section-label {
  padding: 12px 16px 6px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--color-yellow);
}
.pp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
}
.pp-row:hover { background: rgba(255, 255, 255, 0.04); }
.pp-avatar { width: 32px; height: 32px; font-size: 12px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.pp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pp-name { font-size: 13px; font-weight: 600; color: #EDE8D8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-state { display: flex; align-items: center; gap: 8px; font-size: 10px; color: rgba(237, 232, 216, 0.55); }
.pp-state .pp-muted { color: #FF7A72; }
.pp-chip.host {
  background: var(--color-yellow); color: #14140A;
  font-size: 8.5px; font-weight: 800; letter-spacing: 0.08em;
  padding: 1px 6px; border-radius: 4px;
}
.pp-actions { display: flex; gap: 6px; }
.pp-actions button {
  border: none; cursor: pointer; width: 28px; height: 28px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.08); color: #EDE8D8; font-size: 11px;
}
.pp-actions button:hover { background: rgba(255, 255, 255, 0.18); }
.pp-actions button.danger { color: #FF7A72; }
.pp-actions button.danger:hover { background: rgba(229, 57, 53, 0.25); }
.pp-empty { padding: 10px 16px; font-size: 12px; color: rgba(237, 232, 216, 0.45); }
#pp-btn-count { opacity: 0.7; font-size: 11px; }

/* ---- Fullscreen: native + iOS pseudo fallback ---- */
#sabha-active-room:fullscreen { width: 100vw; height: 100vh; }
#sabha-active-room.room-pseudo-fs {
  position: fixed !important; inset: 0 !important; z-index: 3000;
}

/* ---- Mobile: panel becomes a bottom sheet ---- */
@media (max-width: 899px) {
  #room-participants-panel {
    top: auto; right: 0; left: 0; bottom: 0;
    width: 100%; height: min(72vh, 560px);
    border-radius: 18px 18px 0 0;
    animation: ppSheet 0.2s ease-out;
  }
  @keyframes ppSheet { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* Stage vertical centering (auto margins survive overflow, unlike
   justify-content:center on a scrollable flex column) */
.room-center > :first-child { margin-top: auto; }
.room-center > .audience-section + *, .room-center > :last-child { margin-bottom: auto; }
.speaker-avatar { width: 92px; height: 92px; font-size: 28px; }
@media (max-width: 899px) { .speaker-avatar { width: 72px; height: 72px; font-size: 22px; } }

/* ==========================================================================
   ROOM REDESIGN v2 — the video IS the screen (Meet/Zoom philosophy)
   Stats live in the top bar, no floating pills, no box-in-box wrappers;
   tiles fill the stage, names overlay the video.
   ========================================================================== */

/* Top bar: title left · listeners pill · leave */
.room-top-bar { display: flex; align-items: center; gap: 14px; padding: 12px 18px; }
.room-meta { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.room-meta h2 { font-size: 18px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-meta p { display: none; }              /* topic already shown on the room card */
.topbar-listeners {
  display: inline-flex; align-items: center; gap: 7px;
  background: linear-gradient(180deg, #E9BC33, #C9970E); color: #14140A;
  font-size: 12.5px; font-weight: 800; padding: 6px 13px; border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

/* Stage: content fills, centered as a group, no decorative wrappers */
.room-center { padding: 14px 18px; gap: 14px; max-width: none; }
.room-center > :first-child { margin-top: 0; }
.room-center > :last-child { margin-bottom: 0; }
.ticker-box { display: none; }

.speakers-grid {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%; max-width: 1500px; margin: 0 auto;
  align-content: center;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  background: transparent; border: none;
}
/* Solo speaker: one large centered tile, not a small card in a void */
.speakers-grid > .speaker-card:only-child { max-width: min(1080px, 100%); margin: 0 auto; width: 100%; }

.speaker-card { position: relative; padding: 0; overflow: hidden; background: #0D1710; }
.speaker-video-wrap { aspect-ratio: 16 / 9; border-radius: 0; }
.speaker-card:only-child .speaker-video-wrap { max-height: min(72vh, 700px); width: 100%; }

/* Meet-style overlays on the video itself */
.speaker-card .speaker-name {
  position: absolute; left: 12px; bottom: 12px; z-index: 3;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px);
  padding: 5px 12px; border-radius: 8px; font-size: 12.5px;
}
.speaker-card .speaker-role {
  position: absolute; right: 12px; bottom: 12px; z-index: 3;
  background: rgba(217, 165, 20, 0.9); color: #14140A;
  padding: 3px 9px; border-radius: 6px;
  font-size: 8.5px; letter-spacing: 0.1em;
}
.speaker-card .mute-indicator-badge { z-index: 3; }
/* Admin mute/remove controls float top-left on hover */
.speaker-card > div[style*='margin-top'] {
  position: absolute; top: 10px; left: 10px; z-index: 4; margin: 0 !important;
  opacity: 0; transition: opacity 0.15s ease;
}
.speaker-card:hover > div[style*='margin-top'] { opacity: 1; }

/* Audience broadcast: the player fills the stage the same way */
#sabha-hls-stage {
  flex: 1 1 auto; min-height: 0;
  width: 100%; max-width: 1500px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: #000;
}
#sabha-hls-stage.hidden { display: none; }
#sabha-hls-video { width: 100%; height: 100%; max-height: 78vh; aspect-ratio: auto; object-fit: contain; }

@media (max-width: 899px) {
  .room-top-bar { padding: 10px 12px; gap: 8px; }
  .room-meta h2 { font-size: 15px; }
  .topbar-listeners { font-size: 11px; padding: 5px 10px; }
  .room-center { padding: 10px; }
  .speakers-grid { grid-template-columns: 1fr; align-content: start; }
  .speaker-video-wrap { aspect-ratio: 16 / 10; }
}

/* Solo speaker: size the tile from BOTH width and available height (the Meet
   formula) and center it dead-on — no more corner tile in an empty hall. */
.speakers-grid:has(> .speaker-card:only-child) {
  display: flex; align-items: center; justify-content: center;
}
.speakers-grid > .speaker-card:only-child {
  width: min(1200px, 100%, calc((100dvh - 240px) * 1.7778));
  margin: 0;
}
.speaker-card:only-child .speaker-video-wrap { max-height: none; aspect-ratio: 16 / 9; }

/* Two speakers side by side, centered as a pair */
.speakers-grid:has(> .speaker-card:nth-child(2):last-child) {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
}
.speakers-grid:has(> .speaker-card:nth-child(2):last-child) > .speaker-card {
  flex: 0 1 min(720px, calc(50% - 8px), calc((100dvh - 240px) * 1.25));
}
@media (max-width: 899px) {
  .speakers-grid > .speaker-card:only-child { width: 100%; }
  .speakers-grid:has(> .speaker-card:nth-child(2):last-child) > .speaker-card { flex-basis: 100%; }
}
