/* ==========================================================================
   IDMBX Meet: Multi-Party Video Meetings, Presentation, and Whiteboard
   Theme-Harmonized Styling (Dark Obsidian Glass & Light Mode + Dynamic Accents)
   ========================================================================== */

.meet-root, .meet-launcher {
  font-family: var(--font-family, 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  color: var(--text-main, #f8fafc);
}

.meet-root .hidden, .meet-launcher.hidden, .meet-root.hidden {
  display: none !important;
}

body.meet-standalone #app {
  display: none !important;
}

/* Base Full-Screen Meeting Container */
.meet-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-main, #080a0f);
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease;
}

.meet-root.meet-min {
  inset: auto 20px 20px auto;
  background: transparent;
  pointer-events: none;
  z-index: 999999;
}

.meet-root.meet-min .meet-screen {
  display: none !important;
}

.meet-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Google Meet PiP (Picture-in-Picture) Floating Mini Window
   ========================================================================== */
.meet-pip-window {
  display: none;
  position: relative;
  width: 290px;
  background: #202124;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 10px 10px 12px 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 2px 10px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  font-family: 'Google Sans', Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif;
  user-select: none;
  animation: meet-pip-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes meet-pip-pop {
  0% { opacity: 0; transform: scale(0.9) translateY(12px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.meet-root.meet-min .meet-pip-window {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Header */
.meet-pip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 4px 4px;
  cursor: move;
}

.meet-pip-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #e8eaed;
  font-size: 12.5px;
  font-weight: 500;
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meet-pip-logo {
  color: #8ab4f8;
  flex-shrink: 0;
}

.meet-pip-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e8eaed;
}

.meet-pip-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.meet-pip-hbtn {
  background: transparent;
  border: none;
  color: #bdc1c6;
  cursor: pointer;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  padding: 0;
}

.meet-pip-hbtn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

/* Live Video Stage */
.meet-pip-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #282a2d;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.meet-pip-stage.speaking {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 2px #10b981, 0 0 16px rgba(16, 185, 129, 0.5) !important;
}

.meet-pip-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.meet-pip-stage video.self {
  transform: scaleX(-1);
}

.meet-pip-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a73e8, #8ab4f8);
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.meet-pip-stage.speaking .meet-pip-avatar {
  box-shadow: 0 0 0 3px #10b981, 0 0 18px rgba(16, 185, 129, 0.7);
  animation: meet-speaker-pulse 1.3s infinite ease-in-out;
}

/* Top-Right 3-dots in stage */
.meet-pip-stage-dots {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #8ab4f8;
  color: #202124;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, background 0.15s ease;
}

.meet-pip-stage-dots:hover {
  background: #aecbfa;
  transform: scale(1.08);
}

/* Bottom-Left Participant Badge */
.meet-pip-name-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(32, 33, 36, 0.85);
  backdrop-filter: blur(6px);
  color: #f1f3f4;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: calc(100% - 20px);
  white-space: nowrap;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.meet-pip-name-badge span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meet-pip-waves {
  display: inline-flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 10px;
}

.meet-pip-waves.hidden {
  display: none !important;
}

.meet-pip-waves span {
  width: 2px;
  background: #10b981;
  border-radius: 1px;
  animation: meet-equalizer 0.5s infinite ease-in-out alternate;
}
.meet-pip-waves span:nth-child(1) { height: 4px; animation-delay: 0s; }
.meet-pip-waves span:nth-child(2) { height: 10px; animation-delay: 0.15s; }
.meet-pip-waves span:nth-child(3) { height: 6px; animation-delay: 0.3s; }

/* Floating Controls Bar */
.meet-pip-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

.meet-pip-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #3c4043;
  color: #e8eaed;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  padding: 0;
}

.meet-pip-btn:hover {
  background: #474a4d;
  color: #ffffff;
  transform: scale(1.06);
}

.meet-pip-btn.off {
  background: #ea4335 !important;
  color: #ffffff !important;
}

.meet-pip-btn.active {
  background: #8ab4f8 !important;
  color: #202124 !important;
}

.meet-pip-btn.meet-pip-leave {
  width: 48px;
  border-radius: 20px;
  background: #ea4335;
  color: #ffffff;
}

.meet-pip-btn.meet-pip-leave:hover {
  background: #d93025;
  transform: scale(1.06);
}

/* ==========================================================================
   PiP Pop-up Options Menus (3-Dots Menus)
   ========================================================================== */
.meet-pip-menu {
  position: absolute;
  bottom: 58px;
  right: 12px;
  width: 220px;
  background: #282a2d;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75), 0 2px 8px rgba(0, 0, 0, 0.4);
  padding: 6px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 2px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: meet-pip-menu-pop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.meet-pip-menu.hidden {
  display: none !important;
}

#meet-pip-stage-menu {
  bottom: auto;
  top: 42px;
  right: 12px;
  width: 195px;
}

@keyframes meet-pip-menu-pop {
  0% { opacity: 0; transform: scale(0.92) translateY(6px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.meet-pip-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #e8eaed;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.15s ease, color 0.15s ease;
  font-family: inherit;
}

.meet-pip-menu-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.meet-pip-menu-ico {
  font-size: 14px;
  width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.meet-pip-menu-sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 4px 6px;
}

/* Primary, Ghost & Action Buttons */
.meet-primary, .meet-ghost, .meet-ghost-solid {
  border: 0;
  border-radius: var(--radius-md, 10px);
  padding: 10px 18px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  color: #ffffff;
  font-family: inherit;
  transition: all 0.2s ease;
}

.meet-primary {
  background: linear-gradient(135deg, var(--primary, #3b82f6), var(--accent, #6366f1));
  box-shadow: 0 4px 14px var(--primary-glow, rgba(59, 130, 246, 0.35));
}

.meet-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--primary-glow, rgba(59, 130, 246, 0.45));
}

.meet-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.meet-ghost {
  background: var(--bg-hover, rgba(255, 255, 255, 0.08));
  color: var(--text-main, #f8fafc);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.meet-ghost:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

body.theme-light .meet-ghost {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-main, #0f172a);
  border: 1px solid var(--border-color, #e2e8f0);
}

body.theme-light .meet-ghost:hover {
  background: rgba(0, 0, 0, 0.08);
}

.meet-ghost-solid {
  background: var(--bg-card, #181e2a);
  color: var(--text-main, #fff);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.meet-icon-text {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.meet-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  padding: 8px 0;
}

.meet-sub {
  font-size: 13px;
  color: var(--text-muted, #94a3b8);
  margin: 0;
}

.meet-msg {
  font-size: 13px;
  color: var(--warning, #f59e0b);
  min-height: 18px;
  margin: 0;
}

.meet-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted, #94a3b8);
}

.meet-field input, .meet-l-join input, .meet-chat-form input {
  background: var(--bg-input, rgba(12, 16, 24, 0.65));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
  color: var(--text-main, #fff);
  border-radius: var(--radius-md, 10px);
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  min-width: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.meet-field input:focus, .meet-l-join input:focus, .meet-chat-form input:focus {
  outline: none;
  border-color: var(--border-focus, var(--primary, #3b82f6));
  box-shadow: 0 0 0 3px var(--primary-glow, rgba(59, 130, 246, 0.25));
}

/* ==========================================================================
   Lobby & Pre-join Screen
   ========================================================================== */
.meet-lobby, .meet-ended {
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
  background: radial-gradient(circle at 50% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
}

.meet-lobby-card {
  display: flex;
  gap: 36px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 960px;
  width: 100%;
  background: var(--bg-panel, rgba(18, 23, 31, 0.78));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-xl, 20px);
  padding: 32px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-glass, 0 16px 40px rgba(0, 0, 0, 0.5));
}

.meet-preview {
  position: relative;
  width: min(560px, 100%);
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-lg, 14px);
  overflow: hidden;
  flex: 1 1 380px;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.meet-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.meet-preview-off {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card, #121824);
  color: var(--text-muted, #94a3b8);
  font-size: 15px;
}

.meet-preview-ctrls {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 12px;
  z-index: 10;
}

.meet-lobby-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 320px;
  max-width: 100%;
}

.meet-lobby-side h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
  letter-spacing: -0.3px;
}

.meet-lobby-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.meet-lobby-actions .meet-primary {
  flex: 1;
}

.meet-center {
  text-align: center;
  align-items: stretch;
}

/* Round Media Control Buttons */
.meet-round, .meet-ctrl {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.14));
  background: var(--bg-card, rgba(24, 30, 42, 0.65));
  color: var(--text-main, #ffffff);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
}

.meet-round:hover, .meet-ctrl:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
}

.meet-round.off, .meet-ctrl.off {
  background: var(--danger, #ef4444);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.meet-ctrl.active {
  background: var(--primary, #3b82f6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow, rgba(59, 130, 246, 0.4));
}

.meet-ctrl.meet-danger {
  background: var(--danger, #ef4444);
  border-color: transparent;
  color: #ffffff;
  width: 60px;
  border-radius: 24px;
}

.meet-ctrl.meet-danger:hover {
  background: #dc2626;
  transform: scale(1.05);
}

.meet-ctrl.recording {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid var(--danger, #ef4444);
  color: #ef4444;
}

.meet-ctrl.recording:hover {
  background: rgba(239, 68, 68, 0.4);
}

.meet-rec-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(220, 38, 38, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.6);
  color: #fca5a5;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

.meet-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: meet-rec-blink 1.2s infinite ease-in-out;
}

@keyframes meet-rec-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
}

.meet-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warning, #f59e0b);
  border: 2px solid var(--bg-main, #080a0f);
}

/* ==========================================================================
   Room Header, Main Video Mesh & Controls
   ========================================================================== */
.meet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  background: var(--bg-panel, rgba(18, 23, 31, 0.85));
  backdrop-filter: blur(12px);
}

.meet-top-info {
  display: flex;
  gap: 12px;
  align-items: baseline;
  min-width: 0;
}

.meet-top-info strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 16px;
  color: var(--text-main, #f8fafc);
}

.meet-top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.meet-conn {
  font-size: 12px;
  color: var(--warning, #f59e0b);
}

.meet-body {
  flex: 1;
  min-height: 0;
  display: flex;
  background: var(--bg-main, #080a0f);
}

.meet-main {
  flex: 1;
  min-width: 0;
  display: flex;
  padding: 16px;
  gap: 14px;
  position: relative;
}

.meet-main.presenting {
  flex-direction: row;
}

.meet-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
  gap: 12px;
  align-content: center;
  min-height: 0;
  overflow-y: auto;
  max-height: 100%;
}

.meet-grid.many-tiles {
  gap: 8px;
}

.meet-grid.many-tiles .meet-tile {
  border-radius: 8px;
}

.meet-grid.many-tiles .meet-tile-avatar {
  width: 44px;
  height: 44px;
  font-size: 18px;
}

.meet-grid.many-tiles .meet-tile-name {
  font-size: 11px;
  padding: 2px 6px;
}

.meet-main.presenting .meet-grid {
  flex: 0 0 220px;
  grid-template-columns: 1fr;
  align-content: start;
  overflow-y: auto;
}

.meet-tile {
  position: relative;
  background: var(--bg-card, #121824);
  border: 2px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-lg, 14px);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  min-height: 0;
  box-shadow: var(--shadow-sm, 0 4px 12px rgba(0, 0, 0, 0.3));
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.meet-tile:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

/* Active Speaker Glowing Border & Elevation */
.meet-tile.speaking {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 2px #10b981, 0 0 24px rgba(16, 185, 129, 0.55) !important;
}

.meet-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.meet-tile.self video {
  transform: scaleX(-1);
}

.meet-tile.no-video video {
  visibility: hidden;
}

.meet-tile-avatar {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary, #3b82f6), var(--accent, #6366f1));
  box-shadow: 0 4px 16px var(--primary-glow, rgba(59, 130, 246, 0.4));
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.meet-tile.no-video .meet-tile-avatar {
  display: flex;
}

.meet-tile.speaking .meet-tile-avatar {
  box-shadow: 0 0 0 4px #10b981, 0 0 24px rgba(16, 185, 129, 0.7);
  animation: meet-speaker-pulse 1.3s infinite ease-in-out;
}

@keyframes meet-speaker-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 0 4px #10b981, 0 0 20px rgba(16, 185, 129, 0.6); }
  50% { transform: translate(-50%, -50%) scale(1.06); box-shadow: 0 0 0 6px #10b981, 0 0 30px rgba(16, 185, 129, 0.85); }
}

.meet-tile-name {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-sm, 6px);
  padding: 4px 10px;
  font-size: 12px;
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: border-color 0.2s ease;
}

.meet-tile.speaking .meet-tile-name {
  border-color: rgba(16, 185, 129, 0.6);
  background: rgba(6, 78, 59, 0.85);
}

.meet-tile-name span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Soundwave Equalizer Animation */
.meet-tile-waves {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  margin-right: 2px;
}

.meet-tile-waves.hidden {
  display: none !important;
}

.meet-tile-waves .wave-bar {
  width: 2.5px;
  background: #10b981;
  border-radius: 1px;
  animation: meet-equalizer 0.6s infinite ease-in-out alternate;
}

.meet-tile-waves .wave-bar:nth-child(1) { height: 5px; animation-delay: 0s; }
.meet-tile-waves .wave-bar:nth-child(2) { height: 12px; animation-delay: 0.18s; }
.meet-tile-waves .wave-bar:nth-child(3) { height: 7px; animation-delay: 0.36s; }

@keyframes meet-equalizer {
  0% { height: 3px; opacity: 0.6; }
  100% { height: 12px; opacity: 1; }
}

.meet-tile-muted {
  color: var(--danger, #ef4444);
  display: inline-flex;
}

.meet-tile-hand {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--warning, #f59e0b);
  color: #000;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Active Speaker Pill in Top Header */
.meet-speaker-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 10px;
  animation: meet-speaker-fade 0.25s ease;
}

.meet-speaker-pill.hidden {
  display: none !important;
}

.meet-speaker-wave-icon {
  display: inline-flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 10px;
}

.meet-speaker-wave-icon span {
  width: 2px;
  background: #10b981;
  border-radius: 1px;
  animation: meet-equalizer 0.5s infinite ease-in-out alternate;
}
.meet-speaker-wave-icon span:nth-child(1) { height: 4px; animation-delay: 0s; }
.meet-speaker-wave-icon span:nth-child(2) { height: 10px; animation-delay: 0.15s; }
.meet-speaker-wave-icon span:nth-child(3) { height: 6px; animation-delay: 0.3s; }

.meet-person.speaking .meet-person-name {
  color: #10b981;
  font-weight: 600;
}

.meet-person.speaking .meet-person-flags::before {
  content: '🔊';
  font-size: 13px;
  margin-right: 4px;
}

.meet-stage {
  flex: 1;
  min-width: 0;
  position: relative;
  background: #000;
  border-radius: var(--radius-lg, 14px);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.meet-stage > video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.meet-stage-label {
  position: absolute;
  left: 14px;
  top: 14px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  padding: 6px 12px;
  border-radius: var(--radius-sm, 6px);
  font-size: 13px;
  color: #fff;
}

.meet-stage-self {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  font-size: 18px;
  color: #fff;
}

.meet-knocks {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meet-knock {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--bg-panel, #121721);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.2));
  border-radius: var(--radius-md, 10px);
  padding: 12px 18px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  font-size: 14px;
  color: var(--text-main, #fff);
  backdrop-filter: blur(12px);
}

.meet-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  background: var(--bg-panel, rgba(18, 23, 31, 0.85));
  backdrop-filter: blur(12px);
  flex-wrap: wrap;
}

.meet-leave-wrap {
  position: relative;
}

.meet-leave-menu {
  position: absolute;
  bottom: 64px;
  right: 0;
  background: var(--bg-card, #181e2a);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.18));
  border-radius: var(--radius-md, 10px);
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
}

.meet-leave-menu button {
  background: none;
  border: 0;
  color: var(--text-main, #fff);
  text-align: left;
  padding: 10px 14px;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  transition: background 0.15s ease;
}

.meet-leave-menu button:hover {
  background: var(--bg-hover, rgba(255, 255, 255, 0.1));
}

#meet-leave-all {
  color: var(--danger, #ef4444);
}

/* ==========================================================================
   Side Panel (Chat & People)
   ========================================================================== */
.meet-side {
  width: 320px;
  max-width: 100vw;
  border-left: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  display: flex;
  flex-direction: column;
  background: var(--bg-panel, #0f172a);
  backdrop-filter: blur(12px);
}

.meet-side-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.meet-tab {
  background: none;
  border: 0;
  color: var(--text-muted, #94a3b8);
  padding: 8px 14px;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.2s ease;
}

.meet-tab:hover {
  color: var(--text-main, #fff);
  background: var(--bg-hover, rgba(255, 255, 255, 0.06));
}

.meet-tab.active {
  background: var(--bg-active, rgba(59, 130, 246, 0.18));
  color: var(--primary, #3b82f6);
  font-weight: 600;
}

.meet-side-close {
  margin-left: auto;
}

.meet-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.meet-chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meet-msg-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 90%;
  align-self: flex-start;
}

.meet-msg-row.me {
  align-self: flex-end;
  align-items: flex-end;
}

.meet-msg-who {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  margin: 0 4px 3px;
}

.meet-msg-body {
  background: var(--bg-card, #181e2a);
  color: var(--text-main, #f8fafc);
  padding: 8px 13px;
  border-radius: 14px 14px 14px 4px;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.meet-msg-row.me .meet-msg-body {
  background: var(--primary, #3b82f6);
  color: #ffffff;
  border-radius: 14px 14px 4px 14px;
  border: none;
  box-shadow: 0 2px 8px var(--primary-glow, rgba(59, 130, 246, 0.3));
}

.meet-msg-time {
  font-size: 10px;
  color: var(--text-dim, #64748b);
  margin: 3px 4px 0;
}

.meet-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  background: var(--bg-panel, transparent);
}

.meet-chat-form input {
  flex: 1;
}

.meet-people {
  overflow-y: auto;
  padding: 10px;
}

.meet-person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-md, 8px);
  transition: background 0.15s ease;
}

.meet-person:hover {
  background: var(--bg-hover, rgba(255, 255, 255, 0.06));
}

.meet-person-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary, #3b82f6), var(--accent, #6366f1));
  flex-shrink: 0;
}

.meet-person-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: var(--text-main, #fff);
}

.meet-person-flags {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--danger, #ef4444);
}

/* ==========================================================================
   Interactive Whiteboard
   ========================================================================== */
.meet-wb {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #e2e8f0;
}

body.theme-light .meet-wb {
  background: #f1f5f9;
}

.meet-wb-bar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-panel, #111827);
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.meet-wb-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.meet-wb-btn {
  background: var(--bg-hover, rgba(255, 255, 255, 0.1));
  color: var(--text-main, #fff);
  border: 1px solid var(--border-color, transparent);
  border-radius: var(--radius-sm, 6px);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.meet-wb-btn.active {
  background: var(--primary, #3b82f6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px var(--primary-glow, rgba(59, 130, 246, 0.4));
}

.meet-wb-color {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.meet-wb-color:hover {
  transform: scale(1.15);
}

.meet-wb-color.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--primary, #3b82f6);
}

.meet-wb-canvas-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

#meet-wb-canvas {
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  background: #ffffff;
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  touch-action: none;
  cursor: crosshair;
}

/* ==========================================================================
   Launcher Modal Dialog (Start / Join Meeting)
   ========================================================================== */
.meet-launcher {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.meet-launcher-card {
  background: var(--bg-panel, rgba(18, 23, 31, 0.88));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.14));
  border-radius: var(--radius-xl, 20px);
  padding: 24px 28px;
  width: 420px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-glass, 0 20px 48px rgba(0, 0, 0, 0.55));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: meet-modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes meet-modal-pop {
  0% { opacity: 0; transform: scale(0.94) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.meet-launcher-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main, #fff);
}

.meet-or {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim, #64748b);
  position: relative;
  margin: 4px 0;
}

.meet-or::before, .meet-or::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--border-color, rgba(255, 255, 255, 0.1));
}

.meet-or::before { left: 0; }
.meet-or::after { right: 0; }

.meet-l-join {
  display: flex;
  gap: 10px;
}

.meet-l-join input {
  flex: 1;
}

/* ==========================================================================
   Light Mode Harmonization Specifics
   ========================================================================== */
body.theme-light .meet-root {
  background: var(--bg-main, #f4f6f9);
  color: var(--text-main, #0f172a);
}

body.theme-light .meet-lobby-card,
body.theme-light .meet-launcher-card {
  background: var(--bg-panel, rgba(255, 255, 255, 0.95));
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.12);
}

body.theme-light .meet-field input,
body.theme-light .meet-l-join input,
body.theme-light .meet-chat-form input {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

body.theme-light .meet-top {
  background: var(--bg-panel, rgba(255, 255, 255, 0.92));
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

body.theme-light .meet-body {
  background: var(--bg-main, #f8fafc);
}

body.theme-light .meet-controls {
  background: var(--bg-panel, rgba(255, 255, 255, 0.92));
  border-top: 1px solid var(--border-color, #e2e8f0);
}

body.theme-light .meet-side {
  background: var(--bg-panel, #ffffff);
  border-left: 1px solid var(--border-color, #e2e8f0);
}

body.theme-light .meet-msg-body {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #e2e8f0;
}

body.theme-light .meet-round,
body.theme-light .meet-ctrl {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

body.theme-light .meet-round:hover,
body.theme-light .meet-ctrl:hover {
  background: #e2e8f0;
}

body.theme-light .meet-wb-bar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

body.theme-light .meet-wb-btn {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

/* Responsive Breakpoints */
@media (max-width: 800px) {
  .meet-main {
    flex-direction: column;
    padding: 10px;
  }
  .meet-main.presenting .meet-grid {
    flex: 0 0 120px;
    grid-template-columns: repeat(auto-fill, 160px);
    grid-auto-flow: column;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .meet-side {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 10;
    width: min(340px, 100vw);
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.4);
  }
  .meet-body {
    position: relative;
  }
  .meet-top-info .meet-sub {
    display: none;
  }
  .meet-icon-text span {
    display: none;
  }
}

/* Connection quality: latency + 4-bar signal indicator */
.meet-net {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-sm, 6px);
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  z-index: 2;
}
.meet-net.hidden { display: none; }
.meet-net-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.meet-net-bars i { width: 3px; background: rgba(255, 255, 255, 0.25); border-radius: 1px; }
.meet-net-bars i:nth-child(1) { height: 4px; }
.meet-net-bars i:nth-child(2) { height: 6px; }
.meet-net-bars i:nth-child(3) { height: 9px; }
.meet-net-bars i:nth-child(4) { height: 12px; }
.meet-net[data-level="4"] .meet-net-bars i.on,
.meet-net[data-level="3"] .meet-net-bars i.on { background: #10b981; }
.meet-net[data-level="2"] .meet-net-bars i.on { background: #f59e0b; }
.meet-net[data-level="1"] .meet-net-bars i.on { background: #ef4444; }

.meet-net.meet-person-net {
  position: static;
  background: rgba(127, 127, 127, 0.18);
  color: var(--text-main, #fff);
  flex-shrink: 0;
}
