/* ============================================================
   MARAKI ENGLISH — VIRTUAL CLASSROOM
   Production Design System v2.0
   Theme: Deep Slate, Professional Dark, Maraki orange accent (as marakienglish.com)
   Font: Inter (body) + Outfit (display)
   ============================================================ */

/* Coming Soon Badge */
.coming-soon {
  opacity: 0.6;
  cursor: not-allowed !important;
}
.coming-soon:hover {
  opacity: 0.6 !important;
}
.coming-soon .btn-label {
  font-size: 0.75rem;
  color: #9ca3af;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@600;700;800&display=swap');

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Surfaces */
  --bg-base:        #0b1120;
  --bg-surface:     #111827;
  --bg-card:        #151d2e;
  --bg-card-hover:  #1a2338;
  --bg-overlay:     rgba(11,17,32, 0.96);

  /* Borders */
  --border-subtle:  rgba(255,255,255,0.07);
  --border-mid:     rgba(255,255,255,0.13);
  --border-accent:  rgba(249,115,22,0.5);

  /* Accents — Maraki orange (marakienglish.com) */
  --accent:         #f97316;
  --accent-hover:   #ea580c;
  --accent-light:   rgba(249,115,22,0.15);
  --accent-glow:    rgba(249,115,22,0.35);

  /* Status colours */
  --success:        #10b981;
  --success-light:  rgba(16,185,129,0.15);
  --warning:        #eab308;
  --warning-light:  rgba(234,179,8,0.15);
  --danger:         #ef4444;
  --danger-light:   rgba(239,68,68,0.15);

  /* Text */
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;

  /* Typography */
  --font-body:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display:   'Outfit', sans-serif;

  /* Radii */
  --r-xs:  4px;
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  18px;
  --r-xl:  24px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.6);
  --shadow-accent: 0 0 20px var(--accent-glow);

  /* Layout */
  --header-h:  60px;
  --toolbar-h: 70px;
  --drawer-w:  340px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html { font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

/* ── Utility ───────────────────────────────────────────────── */
.hidden   { display: none !important; }
.sr-only  { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ============================================================
   ROOT LAYOUT
   ============================================================ */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

/* ============================================================
   BANNERS — Broadcast & Status
   ============================================================ */
.broadcast-banner {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 640px;
  z-index: 1000;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--r-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md), var(--shadow-accent);
  animation: bannerSlide 0.3s cubic-bezier(0.16,1,0.3,1);
}
@keyframes bannerSlide {
  from { opacity:0; transform:translateX(-50%) translateY(-12px); }
  to   { opacity:1; transform:translateX(-50%) translateY(0); }
}
.banner-content  { display:flex; align-items:center; gap:12px; }
.banner-icon     { width:36px; height:36px; border-radius:var(--r-sm); background:var(--accent-light);
                   display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.banner-icon svg { width:18px; height:18px; stroke:var(--accent); }
.banner-text strong { display:block; font-size:0.82rem; font-weight:700; color:var(--text-primary); }
.banner-text p   { font-size:0.78rem; color:var(--text-secondary); margin-top:1px; }
.banner-close    { background:none; border:none; color:var(--text-muted); font-size:1.2rem; line-height:1;
                   width:28px; height:28px; display:flex; align-items:center; justify-content:center;
                   border-radius:var(--r-sm); transition:background 0.15s; flex-shrink:0; }
.banner-close:hover { background:rgba(255,255,255,0.07); color:var(--text-primary); }

/* Class status banner */
#classStatusBanner {
  background: rgba(11,17,32,0.95);
  border-color: rgba(234,179,8,0.4);
  box-shadow: var(--shadow-md);
}
#classStatusBanner .banner-icon { background:var(--warning-light); }
#classStatusBanner .banner-icon svg { stroke:var(--warning); }
#classStatusTitle { color:var(--warning) !important; }
#classStatusDesc  { color:var(--text-secondary) !important; font-size:0.78rem !important; }

/* ============================================================
   TOP HEADER
   ============================================================ */
.classroom-header {
  height: var(--header-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(11,17,32,0.95);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(20px);
  z-index: 200;
  flex-shrink: 0;
}

/* Logo / Brand */
/* Maraki "me" logo (from marakienglish.com) on a white tile, like the website */
.logo-mark {
  height: 36px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-mark img { display: block; height: 24px; width: auto; }
.header-left { display:flex; align-items:center; gap:10px; }
.class-meta  { display:flex; flex-direction:column; }
.class-title-row { display:flex; align-items:center; gap:8px; }
.class-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.class-submeta { display:flex; align-items:center; gap:8px; margin-top:2px; }

/* Network / Online pills */
.network-indicator,
.online-indicator {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.signal-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
}
.pulse-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: dotPulse 2s infinite;
}
@keyframes dotPulse {
  0%,100% { opacity:1; }
  50%      { opacity:0.4; }
}

/* Center nav tabs (Desktop View) */
.header-center {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
}
.view-switcher-tabs {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
}
.view-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 15px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.view-tab * { pointer-events: none; }
.view-tab svg { flex-shrink: 0; transition: transform 0.2s ease; }
.view-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.06);
}
.view-tab:hover svg {
  transform: scale(1.1);
}
.view-tab.active {
  background: var(--accent);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(249,115,22, 0.45);
}

/* Mobile Tab Strip & Mobile-only elements: strictly hidden on desktop */
.mobile-tab-strip,
.mobile-only {
  display: none !important;
}

/* Timer / Status pills */
.timer-pill {
  display: flex; align-items: center; gap: 6px;
  background: rgba(249,115,22,0.12);
  border: 1px solid rgba(249,115,22,0.4);
  padding: 4px 12px; border-radius: var(--r-full);
  font-size: 0.72rem;
}
.timer-label { color:var(--text-secondary); font-weight:600; text-transform:uppercase; letter-spacing:0.04em; }
.timer-clock { font-family:var(--font-display); font-weight:800; font-size:1rem; color:var(--accent); }
.timer-icon  { font-size:0.9rem; }

.trial-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--warning-light);
  border: 1px solid rgba(234,179,8,0.4);
  padding: 4px 12px; border-radius: var(--r-full);
}
.trial-label { font-size:0.72rem; font-weight:600; color:var(--warning); }
.trial-clock { font-family:var(--font-display); font-weight:800; color:var(--warning); font-size:0.95rem; }
.trial-pulse-dot {
  width:7px; height:7px; border-radius:50%;
  background:var(--warning);
  animation:dotPulse 1.2s infinite;
  flex-shrink:0;
}

/* VIP badge */
.badge-vip {
  display: flex; align-items: center; gap: 5px;
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.35);
  color: var(--success);
  padding: 4px 10px; border-radius: var(--r-full);
  font-size: 0.71rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.vip-icon { font-size:0.8rem; }

/* Header right */
.header-right { display:flex; align-items:center; gap:6px; }

/* ============================================================
   COMMON BUTTON SYSTEM
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 0.82rem; font-weight: 600;
  padding: 7px 14px;
  white-space: nowrap;
  transition: all 0.18s ease;
  cursor: pointer;
}
.btn svg { width:15px; height:15px; flex-shrink:0; }
.btn-text { /* text label inside button */ }

/* Glass (neutral) */
.btn-glass {
  background: rgba(255,255,255,0.06);
  border-color: var(--border-mid);
  color: var(--text-primary);
}
.btn-glass:hover { background:rgba(255,255,255,0.11); border-color:rgba(255,255,255,0.2); }

/* Primary accent */
.btn-primary-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary-accent:hover { background:var(--accent-hover); border-color:var(--accent-hover); }

/* Success */
.btn-success-accent {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.btn-success-accent:hover { filter:brightness(1.1); }

/* Danger */
.btn-danger-soft {
  background: var(--danger-light);
  border-color: rgba(239,68,68,0.35);
  color: var(--danger);
}
.btn-danger-soft:hover { background:rgba(239,68,68,0.25); }

.btn-danger-accent {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger-accent:hover { filter:brightness(1.1); }

/* Warning */
.btn-warning-soft {
  background: var(--warning-light);
  border-color: rgba(234,179,8,0.35);
  color: var(--warning);
}
.btn-warning-soft:hover { background:rgba(234,179,8,0.25); }

/* Sizes */
.btn-sm    { font-size:0.76rem; padding:5px 10px; }
.btn-xs    { font-size:0.68rem; padding:3px 7px; }
.btn-large { font-size:0.88rem; padding:10px 20px; }

/* Copy button */
.btn-copy {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size:0.72rem; font-weight:600;
  padding:3px 8px; border-radius:var(--r-xs);
}
.btn-copy:hover { background:rgba(255,255,255,0.1); color:#fff; }

/* Secondary accent */
.btn-secondary-accent {
  background: rgba(255,255,255,0.06);
  border-color: var(--border-mid);
  color: var(--text-primary);
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center;
  font-size: 0.65rem; font-weight: 700;
  padding: 2px 7px; border-radius: var(--r-full);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.badge-stage {
  background: var(--accent-light);
  border: 1px solid rgba(249,115,22,0.3);
  color: var(--accent);
}
.badge-breakout {
  background: var(--success-light);
  border: 1px solid rgba(16,185,129,0.3);
  color: var(--success);
}

/* ============================================================
   BREAKOUT SUB-HEADER
   ============================================================ */
.breakout-sub-header {
  height: auto; min-height: 44px; padding: 6px 16px;
  background: rgba(16,185,129,0.07);
  border-bottom: 1px solid rgba(16,185,129,0.25);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  flex-shrink: 0; z-index: 100;
}
.breakout-bar-left  { display:flex; align-items:center; gap:10px; min-width:0; flex-wrap:wrap; row-gap:2px; }
.breakout-bar-right { display:flex; align-items:center; gap:6px; flex-shrink:0; }
.breakout-live-tag  { font-size:0.65rem; font-weight:700; letter-spacing:0.08em; color:var(--success); text-transform:uppercase; flex-shrink:0; }
.breakout-bar-title { font-family:var(--font-display); font-size:0.9rem; font-weight:700; }
/* The task wraps (up to 3 lines; tap to see all): one line with "…" hid most of it on phones */
.breakout-bar-topic {
  font-size:0.78rem; color:var(--text-secondary); white-space:normal; overflow:hidden;
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; line-clamp:3;
  cursor:pointer; min-width:0; line-height:1.35;
}
.breakout-bar-topic.expanded { -webkit-line-clamp:unset; line-clamp:none; display:block; }

/* ============================================================
   CLASSROOM STAGE (Main content area)
   ============================================================ */
.classroom-stage {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.content-view {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-height: 0;
}
.active-view { display: flex; }

/* ── VIEW-ONLY ALERT BAR ─────────────────────────────────── */
.view-only-alert-bar {
  background: var(--warning-light);
  border-bottom: 1px solid rgba(234,179,8,0.3);
  padding: 8px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-shrink: 0;
}
.view-only-content { display:flex; align-items:center; gap:8px; }
.view-only-icon    { font-size:0.9rem; }
.view-only-text    { font-size:0.78rem; color:var(--text-secondary); }
.view-only-text strong { color:var(--warning); }

/* ============================================================
   VIEW 1 — VIDEO GALLERY
   ============================================================ */
.video-layout-container {
  flex: 1; display: flex; flex-direction: column;
  padding: 14px 16px; gap: 12px;
  overflow-y: auto; min-height: 0;
}

/* Speaker stage */
.main-speaker-stage {
  width: 100%; max-width: 900px; margin: 0 auto;
  aspect-ratio: 16/9; max-height: 420px;
  flex-shrink: 0;
}
.video-wrapper {
  width: 100%; height: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.video-wrapper.is-speaking {
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}
.video-element {
  width:100%; height:100%; object-fit:cover;
  background:var(--bg-base);
}

/* Avatar fallback */
.avatar-fallback-hero {
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
}
.avatar-hero-ring {
  position: relative; width:84px; height:84px;
  display:flex; align-items:center; justify-content:center;
}
.avatar-hero-disc {
  width:72px; height:72px; border-radius:50%;
  background: linear-gradient(135deg,#1e293b,#0f172a);
  border:2px solid rgba(249,115,22,0.4);
  color:#fff; font-family:var(--font-display);
  font-weight:800; font-size:1.65rem;
  display:flex; align-items:center; justify-content:center; z-index:2;
}
.audio-wave-hero {
  position:absolute; inset:0;
  border-radius:50%;
  border:2px solid var(--accent);
  opacity:0;
}
.is-speaking .audio-wave-hero {
  animation:heroPulse 1.4s infinite cubic-bezier(0.2,0.6,0.35,1);
}
@keyframes heroPulse {
  0%   { transform:scale(0.9); opacity:0.8; }
  100% { transform:scale(1.5); opacity:0; }
}
.speaker-hero-name {
  font-family:var(--font-display); font-size:1.05rem; font-weight:700;
}

/* Video overlay badges */
.video-overlay-badges {
  position:absolute; bottom:10px; left:10px; right:10px;
  display:flex; justify-content:space-between; align-items:center;
  pointer-events:none;
}
.overlay-badge {
  background:rgba(11,17,32,0.75);
  backdrop-filter:blur(8px);
  padding:3px 8px; border-radius:var(--r-xs);
  font-size:0.72rem; font-weight:600; color:var(--text-primary);
  border:1px solid var(--border-subtle);
}

/* Thumbnails section */
.video-thumbnails-section { display:flex; flex-direction:column; gap:8px; }
.thumbnails-header { display:flex; justify-content:space-between; align-items:center; }
.thumbnails-title {
  font-size:0.72rem; font-weight:700; text-transform:uppercase;
  letter-spacing:0.06em; color:var(--text-muted);
}
.thumbnails-badge { font-size:0.72rem; color:var(--accent); }
.video-tiles-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(190px,1fr));
  gap:10px;
}

/* Participant video cards */
.participant-video-card {
  aspect-ratio:16/9; border-radius:var(--r-sm);
  background:var(--bg-card);
  border:1px solid var(--border-subtle);
  position:relative; overflow:hidden;
  display:flex; align-items:center; justify-content:center;
  transition:border-color 0.2s, box-shadow 0.2s;
}
.participant-video-card.is-speaking {
  border-color:var(--accent);
  box-shadow:0 0 12px var(--accent-glow);
}

/* "+N more" tile after the small tiles: opens the People panel */
.more-tiles-card {
  aspect-ratio:16/9; border-radius:var(--r-sm);
  background:transparent;
  border:1px dashed var(--border-mid);
  color:var(--text-secondary);
  font-family:inherit; font-size:0.9rem; font-weight:700;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.more-tiles-card:hover { border-color:var(--border-accent); color:var(--text-primary); }

/* "🎙 Abel is speaking" on the big tile: shows who is talking without moving anything */
.speaking-now-bar {
  position:absolute; top:10px; left:50%; transform:translateX(-50%);
  z-index:3; pointer-events:none;
  max-width:calc(100% - 24px);
  padding:4px 12px;
  background:rgba(11,17,32,0.85);
  border:1px solid var(--border-accent);
  border-radius:var(--r-full);
  color:var(--text-primary);
  font-size:0.8rem; font-weight:600;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.participant-video-card.is-pinned {
  border-color:var(--accent);
  box-shadow:0 0 14px var(--accent-glow);
}
.card-avatar-disc {
  width:48px; height:48px; border-radius:50%;
  background:var(--bg-surface);
  border:2px solid var(--border-mid);
  color:#fff; font-family:var(--font-display);
  font-weight:700; font-size:1.1rem;
  display:flex; align-items:center; justify-content:center;
}
.is-speaking .card-avatar-disc { border-color:var(--accent); }
.card-top-badges {
  position:absolute; top:6px; right:6px;
  display:flex; gap:3px;
}
.status-icon-pill {
  background:rgba(11,17,32,0.7);
  border-radius:var(--r-full);
  padding:2px 6px; font-size:0.68rem;
}
.card-bottom-bar {
  position:absolute; bottom:5px; left:7px; right:7px;
  display:flex; justify-content:space-between; align-items:center;
  pointer-events:none;
}
.card-name-label {
  font-size:0.72rem; font-weight:600; color:#fff;
  background:rgba(11,17,32,0.8);
  padding:2px 7px; border-radius:var(--r-xs);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:130px;
}

/* ============================================================
   VIEW 2 — SLIDES & PRESENTATION
   ============================================================ */
.presentation-stage-container {
  flex:1; display:grid;
  grid-template-columns:1fr 260px;
  gap:14px; padding:14px 16px;
  overflow:hidden; min-height:0;
}
.slide-card {
  background:var(--bg-card);
  border:1px solid var(--border-subtle);
  border-radius:var(--r-md); padding:22px;
  display:flex; flex-direction:column; gap:14px;
  box-shadow:var(--shadow-md); overflow-y:auto;
}
.slide-header { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.slide-header-left { display:flex; align-items:center; gap:8px; }
.slide-header-right { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.slide-tag {
  font-size:0.68rem; font-weight:700; text-transform:uppercase;
  letter-spacing:0.08em; color:var(--accent);
}
.slide-counter-badge {
  font-size:0.68rem; color:var(--text-muted);
  background:rgba(255,255,255,0.05);
  padding:2px 7px; border-radius:var(--r-full);
  border:1px solid var(--border-subtle);
}
.slide-nav-arrows { display:flex; gap:4px; }
.slide-arrow-btn {
  background:rgba(255,255,255,0.05);
  border:1px solid var(--border-subtle);
  color:var(--text-primary); width:30px; height:30px;
  border-radius:var(--r-sm); display:flex;
  align-items:center; justify-content:center; font-size:0.9rem;
  transition:background 0.15s;
}
.slide-arrow-btn:hover { background:rgba(255,255,255,0.1); }

.slide-body { display:flex; flex-direction:column; gap:12px; }
.slide-title {
  font-family:var(--font-display); font-size:1.5rem;
  font-weight:800; color:var(--text-primary); line-height:1.25;
}
.slide-subtitle {
  font-size:1rem; font-weight:600;
  color:var(--accent); margin-top:-4px;
}
.slide-content-text {
  font-size:0.92rem; line-height:1.75; color:var(--text-secondary);
  background:rgba(11,17,32,0.5);
  padding:16px; border-radius:var(--r-sm);
  border-left:3px solid var(--accent);
}
.task-banner {
  background:rgba(16,185,129,0.08);
  border:1px solid rgba(16,185,129,0.25);
  padding:14px 16px; border-radius:var(--r-sm);
  display:flex; flex-direction:column; gap:6px;
}
.task-badge-label {
  display:flex; align-items:center; gap:5px;
  font-size:0.68rem; font-weight:700; color:var(--success);
  text-transform:uppercase; letter-spacing:0.06em;
}
.task-icon { font-size:0.85rem; }
.task-prompt-text { font-size:0.88rem; color:var(--text-primary); }

/* Slide participants strip */
.slide-participants-strip {
  background:var(--bg-card); border:1px solid var(--border-subtle);
  border-radius:var(--r-md); padding:12px;
  display:flex; flex-direction:column; gap:8px; overflow-y:auto;
}
.strip-header {
  font-size:0.7rem; font-weight:700; text-transform:uppercase;
  letter-spacing:0.06em; color:var(--text-muted);
}
.slide-tiles-grid { display:flex; flex-direction:column; gap:8px; }

/* ============================================================
   VIEW 3 — WHITEBOARD
   ============================================================ */
.whiteboard-container {
  flex:1; display:flex; flex-direction:column;
  padding:12px 16px; gap:10px; overflow:hidden; min-height:0;
}
.whiteboard-toolbar {
  background:var(--bg-card); border:1px solid var(--border-subtle);
  border-radius:var(--r-sm); padding:8px 14px;
  display:flex; align-items:center; gap:12px;
  flex-wrap:wrap; flex-shrink:0;
}
.tool-group { display:flex; align-items:center; gap:6px; }
.wb-tool-btn {
  background:rgba(255,255,255,0.05);
  border:1px solid var(--border-subtle);
  color:var(--text-secondary); font-size:0.76rem; font-weight:600;
  padding:5px 10px; border-radius:var(--r-sm); transition:all 0.15s;
}
.wb-tool-btn:hover { background:rgba(255,255,255,0.1); color:#fff; }
.wb-tool-btn.active { background:var(--accent); border-color:var(--accent); color:#fff; }

.color-swatches { display:flex; gap:5px; }
.color-dot {
  width:20px; height:20px; border-radius:50%;
  border:2px solid transparent; cursor:pointer;
  transition:transform 0.15s, border-color 0.15s;
}
.color-dot:hover { transform:scale(1.15); }
.color-dot.active { transform:scale(1.2); border-color:#fff; }

.size-label { font-size:0.72rem; color:var(--text-muted); }
.size-slider { width:80px; accent-color:var(--accent); cursor:pointer; }

.whiteboard-canvas-wrapper {
  flex:1; background:var(--bg-surface);
  border:1px solid var(--border-subtle);
  border-radius:var(--r-md); position:relative;
  overflow:hidden; min-height:0;
}
#whiteboardCanvas {
  width:100%; height:100%;
  touch-action:none; display:block;
}

/* ============================================================
   BOTTOM TOOLBAR
   ============================================================ */
.classroom-toolbar {
  height: var(--toolbar-h);
  padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(11,17,32,0.97);
  border-top: 1px solid var(--border-subtle);
  backdrop-filter: blur(20px);
  z-index: 200; flex-shrink: 0;
  gap: 8px;
}
.toolbar-left, .toolbar-center, .toolbar-right {
  display: flex; align-items: center; gap: 6px;
}
.toolbar-center { flex: 1; justify-content: center; }

.toolbar-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 58px;
  transition: all 0.18s ease;
}
.toolbar-btn:hover {
  background: rgba(255,255,255,0.09);
  border-color: var(--border-mid);
}
.toolbar-btn.muted { color:var(--danger); border-color:rgba(239,68,68,0.25); }
.toolbar-btn.camera-off { color:var(--danger); border-color:rgba(239,68,68,0.25); }
.toolbar-btn.active {
  background:var(--accent-light);
  border-color:rgba(249,115,22,0.4);
  color:var(--accent);
}
.toolbar-btn.screen-sharing {
  background:rgba(16,185,129,0.12);
  border-color:rgba(16,185,129,0.4);
  color:var(--success);
}
.toolbar-btn.more-toolbar-btn {
  display: none;
}

/* Mic icon switching */
.btn-icon .icon-mic     { display:none; }
.btn-icon .icon-mic-off { display:block; }
.toolbar-btn:not(.muted) .btn-icon .icon-mic     { display:block; }
.toolbar-btn:not(.muted) .btn-icon .icon-mic-off { display:none; }

.btn-icon .icon-cam     { display:none; }
.btn-icon .icon-cam-off { display:block; }
.toolbar-btn:not(.camera-off) .btn-icon .icon-cam     { display:block; }
.toolbar-btn:not(.camera-off) .btn-icon .icon-cam-off { display:none; }

.btn-label {
  font-size: 0.6rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: inherit;
}
.btn-emoji { font-size:1rem; line-height:1; }

/* Count badge on toolbar buttons */
.badge-icon-wrapper { position:relative; }
.drawer-count-badge {
  position:absolute; top:-5px; right:-8px;
  background:var(--accent); color:#fff;
  font-size:0.58rem; font-weight:700;
  padding:1px 5px; border-radius:var(--r-full);
  min-width:16px; text-align:center;
}
.unread-dot {
  position:absolute; top:-3px; right:-5px;
  width:7px; height:7px; border-radius:50%;
  background:var(--danger);
}

/* Leave button */
.leave-call-btn {
  background:var(--danger) !important;
  border-color:var(--danger) !important;
  color:#fff !important; font-weight:700;
}
.leave-call-btn:hover { filter:brightness(1.1); }

/* ============================================================
   SIDE DRAWERS
   ============================================================ */
.side-drawer {
  position: absolute;
  top: var(--header-h); right: 0;
  width: min(var(--drawer-w), 100%);
  height: calc(100% - var(--header-h) - var(--toolbar-h));
  background: var(--bg-overlay);
  border-left: 1px solid var(--border-subtle);
  backdrop-filter: blur(24px);
  z-index: 300;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: drawerSlide 0.25s cubic-bezier(0.16,1,0.3,1);
}
@keyframes drawerSlide {
  from { transform:translateX(100%); }
  to   { transform:translateX(0); }
}
.drawer-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
}
.drawer-title-group { display:flex; align-items:center; gap:8px; }
.drawer-title { font-family:var(--font-display); font-size:0.92rem; font-weight:700; }
.counter-pill {
  font-size:0.65rem; font-weight:700;
  background:var(--accent-light); color:var(--accent);
  padding:2px 7px; border-radius:var(--r-full);
  border:1px solid rgba(249,115,22,0.25);
}
.drawer-close {
  background:none; border:none; color:var(--text-muted);
  font-size:1.2rem; width:28px; height:28px;
  display:flex; align-items:center; justify-content:center;
  border-radius:var(--r-sm); transition:background 0.15s;
}
.drawer-close:hover { background:rgba(255,255,255,0.07); color:#fff; }

/* Search */
.drawer-search-box {
  padding:10px 14px; display:flex; align-items:center; gap:8px;
  border-bottom:1px solid var(--border-subtle);
  background:rgba(255,255,255,0.02); flex-shrink:0;
}
.drawer-search-box svg { color:var(--text-muted); flex-shrink:0; }
.drawer-search-box input {
  flex:1; background:none; border:none; outline:none;
  color:#fff; font-size:0.8rem;
  placeholder-color: var(--text-muted);
}
.drawer-search-box input::placeholder { color:var(--text-muted); }

/* Summary pills */
.participant-summary-bar {
  display:flex; padding:8px 14px; gap:6px;
  border-bottom:1px solid var(--border-subtle); flex-shrink:0;
  flex-wrap:wrap;
}
.summary-pill {
  font-size:0.69rem; color:var(--text-secondary);
  background:rgba(255,255,255,0.04);
  padding:3px 8px; border-radius:var(--r-full);
  border:1px solid var(--border-subtle);
}

/* Participant list */
.drawer-list-items {
  flex:1; overflow-y:auto;
  padding:10px 14px;
  display:flex; flex-direction:column; gap:6px;
}
.participant-drawer-row {
  display:flex; align-items:center; justify-content:space-between;
  padding:8px 10px; border-radius:var(--r-sm);
  background:rgba(255,255,255,0.02);
  border:1px solid transparent;
  transition:all 0.15s;
}
.participant-drawer-row:hover {
  background:rgba(255,255,255,0.05);
  border-color:var(--border-subtle);
}
.row-left { display:flex; align-items:center; gap:9px; }
.row-avatar {
  width:32px; height:32px; border-radius:50%;
  background:var(--bg-surface);
  color:#fff; font-weight:700; font-size:0.78rem;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
.row-details { display:flex; flex-direction:column; }
.row-name { font-size:0.82rem; font-weight:600; color:#fff; }
.row-sub  { font-size:0.68rem; color:var(--text-muted); display:flex; align-items:center; gap:5px; }
.row-status-icons { display:flex; align-items:center; gap:5px; flex-shrink:0; }
.mini-mute-btn {
  background:var(--danger-light); border:1px solid rgba(239,68,68,0.3);
  color:var(--danger); font-size:0.64rem; padding:2px 6px;
  border-radius:var(--r-xs);
}
.mini-mute-btn:hover { background:rgba(239,68,68,0.25); }

/* Waiting room */
.waiting-room-section {
  border-bottom:1px solid var(--border-subtle);
  padding:10px 14px; flex-shrink:0;
}
.waiting-room-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.waiting-title-flex  { display:flex; align-items:center; gap:6px; }
.waiting-title       { font-size:0.78rem; font-weight:700; color:var(--warning); }
.waiting-badge {
  background:var(--warning-light); color:var(--warning);
  font-size:0.64rem; font-weight:700;
  padding:1px 6px; border-radius:var(--r-full);
  border:1px solid rgba(234,179,8,0.35);
}
.waiting-requests-list { display:flex; flex-direction:column; gap:6px; }
.waiting-request-row {
  display:flex; align-items:center; justify-content:space-between;
  padding:7px 8px; border-radius:var(--r-sm);
  background:rgba(234,179,8,0.06);
  border:1px solid rgba(234,179,8,0.2);
}
.waiting-row-left { display:flex; align-items:center; gap:7px; }
.waiting-row-right { display:flex; gap:5px; flex-shrink:0; }
.waiting-avatar {
  width:28px; height:28px; border-radius:50%;
  background:var(--bg-surface); color:#fff;
  font-size:0.72rem; font-weight:700;
  display:flex; align-items:center; justify-content:center;
}
.waiting-name { font-size:0.8rem; font-weight:600; }

/* Instructor moderation bar */
.participant-moderation-bar {
  padding:8px 14px;
  border-bottom:1px solid var(--border-subtle);
  display:flex; gap:6px; flex-shrink:0;
}

/* ── CHAT DRAWER ─────────────────────────────────────────── */
.chat-messages-container {
  flex:1; overflow-y:auto;
  padding:14px; display:flex; flex-direction:column; gap:8px;
}
.chat-welcome-notice {
  font-size:0.75rem; color:var(--text-muted);
  text-align:center; padding:10px 14px;
  background:rgba(255,255,255,0.02);
  border-radius:var(--r-sm);
  border:1px solid var(--border-subtle);
}
.chat-msg { display:flex; flex-direction:column; gap:2px; }
.chat-msg-header {
  display:flex; align-items:center; gap:5px;
  font-size:0.7rem;
}
.chat-sender { font-weight:700; color:var(--text-primary); }
.chat-sender.instructor { color:var(--accent); }
.chat-time { color:var(--text-muted); }
.chat-bubble {
  background:rgba(255,255,255,0.05);
  padding:7px 11px; border-radius:var(--r-sm);
  font-size:0.83rem; color:var(--text-secondary);
  border:1px solid var(--border-subtle);
  border-top-left-radius:2px;
}
.chat-bubble.own {
  background:var(--accent-light);
  border-color:rgba(249,115,22,0.25);
  color:var(--text-primary);
}
.chat-bubble.system {
  background:rgba(16,185,129,0.07);
  border-color:rgba(16,185,129,0.2);
  color:var(--success);
  font-size:0.75rem; text-align:center;
}

/* Chat input */
.drawer-input-form {
  padding:10px 14px;
  border-top:1px solid var(--border-subtle);
  display:flex; gap:6px; flex-shrink:0;
}
.drawer-input-form input {
  flex:1; background:rgba(255,255,255,0.05);
  border:1px solid var(--border-subtle);
  color:#fff; font-size:0.82rem;
  padding:8px 12px; border-radius:var(--r-sm); outline:none;
  transition:border-color 0.15s;
}
.drawer-input-form input:focus { border-color:var(--accent); }
.drawer-input-form input::placeholder { color:var(--text-muted); }
.send-submit-btn {
  background:var(--accent); border:none;
  color:#fff; width:36px; height:36px;
  border-radius:var(--r-sm);
  display:flex; align-items:center; justify-content:center;
  transition:background 0.15s;
}
.send-submit-btn:hover { background:var(--accent-hover); }
.send-submit-btn svg { width:15px; height:15px; }

/* ============================================================
   JOIN REQUEST TOAST (Instructor — Google Meet style)
   ============================================================ */
.join-request-toast {
  position: fixed;
  bottom: calc(var(--toolbar-h) + 16px);
  right: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px;
  min-width: 280px; max-width: 320px;
  box-shadow: var(--shadow-lg), var(--shadow-accent);
  z-index: 500;
  animation: toastSlide 0.3s cubic-bezier(0.16,1,0.3,1);
}
@keyframes toastSlide {
  from { opacity:0; transform:translateX(30px); }
  to   { opacity:1; transform:translateX(0); }
}
.toast-content { display:flex; align-items:center; gap:11px; }
.toast-avatar {
  width:40px; height:40px; border-radius:50%;
  background:var(--accent);
  color:#fff; font-family:var(--font-display); font-weight:700; font-size:1.1rem;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.toast-info { display:flex; flex-direction:column; gap:2px; }
.toast-name { font-weight:700; font-size:0.88rem; }
.toast-sub  { font-size:0.74rem; color:var(--text-secondary); }
.toast-actions { display:flex; gap:7px; }
.toast-actions .btn { flex:1; justify-content:center; }

/* ============================================================
   MODALS
   ============================================================ */
.admin-modal {
  position: fixed; inset: 0;
  background: rgba(5,8,18,0.85);
  backdrop-filter: blur(8px);
  z-index: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from{opacity:0;} to{opacity:1;} }

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-xl);
  max-width: 560px; width: 100%;
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-sm { max-width: 380px; }

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  flex-shrink: 0;
}
.modal-title-group { display:flex; flex-direction:column; gap:3px; }
.modal-title {
  font-family: var(--font-display); font-size: 1.05rem;
  font-weight: 700; color: var(--text-primary);
}
.modal-desc { font-size: 0.78rem; color: var(--text-secondary); }
.modal-close {
  background: rgba(255,255,255,0.06); border: 1px solid var(--border-subtle);
  color: var(--text-muted); font-size: 1.1rem;
  width: 30px; height: 30px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
}
.modal-close:hover { background:rgba(255,255,255,0.12); color:#fff; }

.sheet-drag-handle-bar {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 10px 0 4px 0;
  cursor: grab;
  flex-shrink: 0;
}
.sheet-drag-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  transition: background 0.2s;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  flex-shrink: 0;
}
.sticky-modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px;
}
.text-center { text-align: center; }

/* Admin sections */
.admin-section {
  display: flex; flex-direction: column; gap: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md); padding: 16px;
  background: rgba(255,255,255,0.02);
}
.section-title {
  font-family: var(--font-display); font-size: 0.88rem;
  font-weight: 700; color: var(--text-primary);
}
.section-subtitle { font-size: 0.78rem; color: var(--text-secondary); }
.section-header-flex { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.hop-indicator { font-size:0.74rem; color:var(--text-muted); }
.hop-indicator strong { color:var(--text-primary); }

/* Forms */
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
  gap: 12px;
}
.form-group { display:flex; flex-direction:column; gap:6px; }
.form-group.full-width { grid-column:1/-1; }
.form-group label { font-size:0.74rem; font-weight:600; color:var(--text-secondary); }
.form-input {
  background: rgba(11,17,32,0.6);
  border: 1px solid var(--border-mid); color: #fff;
  padding: 8px 12px; border-radius: var(--r-sm); font-size: 0.82rem;
  outline: none; transition: border-color 0.15s; width: 100%;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-muted); }
.form-textarea {
  background: rgba(11,17,32,0.6);
  border: 1px solid var(--border-mid); color: #fff;
  padding: 8px 12px; border-radius: var(--r-sm); font-size: 0.82rem;
  outline: none; resize: vertical; width: 100%;
  transition: border-color 0.15s;
}
.form-textarea:focus { border-color: var(--accent); }
.form-textarea::placeholder { color: var(--text-muted); }

/* Toggle pill selector */
.toggle-pill-selector { display:flex; background:rgba(255,255,255,0.04); border:1px solid var(--border-subtle); border-radius:var(--r-sm); padding:2px; gap:2px; }
.pill-option { background:none; border:none; color:var(--text-secondary); font-size:0.76rem; font-weight:600; padding:5px 12px; border-radius:6px; transition:all 0.15s; }
.pill-option.active { background:var(--accent); color:#fff; }

/* Number picker */
.number-picker { display:flex; align-items:center; gap:8px; }
.num-btn {
  width:28px; height:28px; background:rgba(255,255,255,0.06);
  border:1px solid var(--border-subtle); color:#fff; border-radius:var(--r-sm);
  display:flex; align-items:center; justify-content:center; font-size:1rem;
  transition:background 0.15s;
}
.num-btn:hover { background:rgba(255,255,255,0.12); }
.picker-val { font-family:var(--font-display); font-size:1rem; font-weight:700; min-width:24px; text-align:center; }

/* Duration pills */
.timer-select-pills { display:flex; gap:5px; flex-wrap:wrap; }
.pill-chip {
  background:rgba(255,255,255,0.05); border:1px solid var(--border-subtle);
  color:var(--text-secondary); font-size:0.74rem; font-weight:700;
  padding:4px 10px; border-radius:var(--r-full); transition:all 0.15s;
}
.pill-chip.active { background:var(--accent); border-color:var(--accent); color:#fff; }
.pill-chip:hover  { border-color:var(--accent); color:var(--accent); }

/* Action row */
.admin-action-row { display:flex; gap:8px; flex-wrap:wrap; }

/* Admin rooms grid */
.admin-rooms-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:8px; }
.admin-room-card {
  background:rgba(255,255,255,0.03); border:1px solid var(--border-subtle);
  border-radius:var(--r-sm); padding:12px;
  display:flex; flex-direction:column; gap:8px;
  transition:border-color 0.15s;
}
.admin-room-card:hover { border-color:var(--border-mid); }
.empty-rooms-notice { font-size:0.78rem; color:var(--text-muted); grid-column:1/-1; text-align:center; padding:16px; }

/* Broadcast input row */
.broadcast-input-row { display:flex; gap:8px; }
.broadcast-input-row .form-input { flex:1; }

/* ── PAYWALL MODAL ──────────────────────────────────────── */
.paywall-modal { z-index: 700; }
.modal-paywall { max-width: 480px; }
.paywall-hero {
  padding: 24px 24px 0;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.paywall-badge-icon {
  width:52px; height:52px; border-radius:50%;
  background:var(--danger-light); border:1px solid rgba(239,68,68,0.3);
  display:flex; align-items:center; justify-content:center; font-size:1.4rem;
}
.paywall-title { font-family:var(--font-display); font-size:1.15rem; font-weight:800; }
.paywall-subtitle { font-size:0.82rem; color:var(--text-secondary); max-width:380px; }
.paywall-cards-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:14px 20px 0; }
.pay-card {
  background:rgba(255,255,255,0.03); border:1px solid var(--border-subtle);
  border-radius:var(--r-md); padding:14px;
  display:flex; flex-direction:column; gap:8px;
}
.pay-card-header { display:flex; align-items:center; gap:7px; }
.pay-logo-icon   { font-size:1.1rem; }
.pay-bank-name   { font-size:0.75rem; font-weight:600; color:var(--text-secondary); }
.pay-acc-row     { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.pay-acc-num     { font-family:var(--font-display); font-size:0.92rem; font-weight:700; color:var(--text-primary); }
.pay-acc-name    { font-size:0.72rem; color:var(--text-muted); }
.paywall-price-banner {
  background:var(--accent-light); border:1px solid rgba(249,115,22,0.25);
  border-radius:var(--r-sm); padding:10px 14px;
  margin:0 20px;
  display:flex; align-items:center; justify-content:space-between;
  font-size:0.78rem; color:var(--text-secondary);
}
.pay-price { font-family:var(--font-display); font-size:1rem; font-weight:800; color:var(--accent); }
.paywall-actions { padding:14px 20px 20px; display:flex; flex-direction:column; gap:8px; }
.paywall-subactions { display:flex; gap:8px; }
.paywall-subactions .btn { flex:1; justify-content:center; }
.verify-status-text { font-size:0.78rem; text-align:center; color:var(--text-secondary); }
.manual-verify-box {
  border:1px solid rgba(249,115,22,0.25);
  border-radius:var(--r-sm); padding:12px;
  background:var(--accent-light);
}
.manual-verify-box p { font-size:0.78rem; color:var(--text-secondary); margin-bottom:8px; }
.manual-verify-row   { display:flex; gap:6px; }
.manual-verify-row input {
  flex:1; background:rgba(6,16,30,0.8);
  border:1px solid var(--border-mid); border-radius:var(--r-xs);
  padding:7px 10px; color:#fff; font-size:0.82rem; outline:none;
}
.manual-verify-row input:focus { border-color:var(--accent); }
#manualVerifyFeedback { font-size:0.75rem; margin-top:5px; }

/* ── CALL ENDED / DENIED SCREEN ─────────────────────────── */
.call-ended-screen {
  position: fixed; inset: 0;
  background: var(--bg-base);
  z-index: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}
.call-ended-card {
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-xl); padding: 32px 24px;
  max-width: 380px; width: 100%;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  box-shadow: var(--shadow-lg);
}
.call-ended-icon-wrapper { margin-bottom:4px; }
.call-ended-icon-ring {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--danger-light);
  border: 1px solid rgba(239,68,68,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}
.call-ended-title { font-family:var(--font-display); font-size:1.15rem; font-weight:800; }
.call-ended-message { font-size:0.82rem; color:var(--text-secondary); }
.call-ended-actions { display:flex; flex-direction:column; gap:8px; width:100%; }
.call-ended-footer { font-size:0.72rem; color:var(--text-muted); }

/* ── ASKING TO JOIN SCREEN ──────────────────────────────── */
.asking-to-join-screen {
  position: fixed; inset: 0;
  background: var(--bg-base);
  z-index: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.asking-card {
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-xl); padding: 32px 24px;
  max-width: 380px; width: 100%;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  box-shadow: var(--shadow-lg);
}
.asking-radar-wrapper { position:relative; width:72px; height:72px; display:flex; align-items:center; justify-content:center; }
.asking-pulse-ring {
  position:absolute; inset:0; border-radius:50%;
  border:2px solid var(--accent); opacity:0;
  animation:radarRing 2s infinite ease-out;
}
.asking-pulse-ring-outer {
  position:absolute; inset:-12px; border-radius:50%;
  border:2px solid rgba(249,115,22,0.3); opacity:0;
  animation:radarRing 2s 0.6s infinite ease-out;
}
@keyframes radarRing {
  0%   { transform:scale(0.6); opacity:0.8; }
  100% { transform:scale(1.3); opacity:0; }
}
.asking-icon { font-size:1.8rem; z-index:2; }
.asking-title { font-family:var(--font-display); font-size:1.1rem; font-weight:800; }
.asking-subtitle { font-size:0.82rem; color:var(--text-secondary); }
.asking-user-pill {
  display:flex; align-items:center; gap:8px;
  background:rgba(255,255,255,0.05);
  border:1px solid var(--border-subtle);
  border-radius:var(--r-full); padding:6px 14px;
}
.user-pill-avatar {
  width:26px; height:26px; border-radius:50%;
  background:var(--accent); color:#fff;
  font-size:0.78rem; font-weight:700;
  display:flex; align-items:center; justify-content:center;
}
.user-pill-name { font-size:0.82rem; font-weight:600; }
.asking-actions { width:100%; }

/* ── MOBILE OVERFLOW BOTTOM SHEET (Telegram-style ...) ──────────── */
.mobile-overflow-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 18, 0.78);
  backdrop-filter: blur(8px);
  z-index: 650;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.mobile-overflow-backdrop.hidden {
  display: none !important;
}

.mobile-overflow-sheet {
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-bottom: none;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 82vh;
  max-height: 82dvh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg), 0 -10px 40px rgba(0, 0, 0, 0.7);
  animation: slideUpSheet 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
}

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

.sheet-header {
  padding: 10px 20px 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sheet-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sheet-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sheet-subtitle {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.sheet-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  cursor: pointer;
}

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

.sheet-action-list {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sheet-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  color: var(--text-primary);
  text-align: left;
  transition: all 0.18s ease;
  cursor: pointer;
  width: 100%;
}

.sheet-action-row:hover,
.sheet-action-row:active {
  background: rgba(249,115,22, 0.12);
  border-color: rgba(249,115,22, 0.35);
}

.sheet-action-icon-disc {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-primary);
}

.sheet-action-icon-disc.accent {
  background: var(--accent-light);
  color: var(--accent);
}

.sheet-action-icon-disc.warning {
  background: var(--warning-light);
  color: var(--warning);
}

.sheet-action-icon-disc.success {
  background: var(--success-light);
  color: var(--success);
}

.sheet-action-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.sheet-action-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sheet-action-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-pill-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sheet-pill-badge.active,
.sheet-pill-badge.sharing,
.sheet-pill-badge.success {
  background: var(--success-light);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.3);
}

.sheet-pill-badge.accent {
  background: var(--accent-light);
  color: var(--accent);
  border-color: rgba(249,115,22, 0.3);
}

.sheet-pill-badge.warning {
  background: var(--warning-light);
  color: var(--warning);
  border-color: rgba(234,179,8, 0.3);
}

/* ============================================================
   RESPONSIVE — Mobile & Tablet Comprehensive System
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --header-h:  54px;
    --toolbar-h: 64px;
  }

  /* Header adjustments */
  .classroom-header { padding: 0 10px; gap: 8px; }
  .logo-mark { height: 32px; padding: 0 6px; }
  .logo-mark img { height: 20px; }
  /* The logo is wider than the old "M" tile: let the class title shrink so the buttons on the right stay on screen */
  .header-left, .class-meta, .class-title-row { min-width: 0; }
  .header-left { flex: 1 1 auto; }
  .header-right { flex-shrink: 0; }
  .class-title { font-size: 0.88rem; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .class-submeta { display: none; }
  .header-center { display: none; }
  .view-switcher-tabs { display: none; }
  .btn-text { display: none; }
  .header-right { gap: 6px; }

  /* Mobile tab strip below header */
  .mobile-tab-strip {
    display: flex !important;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: 6px 10px;
    gap: 6px;
    flex-shrink: 0;
  }
  .mobile-only {
    display: flex !important;
  }
  .mobile-tab-strip .view-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    min-height: 40px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-tab-strip .view-tab:active {
    transform: scale(0.97);
  }
  .mobile-tab-strip .view-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 12px var(--accent-glow);
  }
  .mobile-tab-strip .view-tab span {
    display: inline;
  }

  /* Main stage */
  .classroom-stage {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Video layout */
  .video-layout-container {
    padding: 10px;
    gap: 10px;
  }
  .main-speaker-stage {
    max-height: 38vh;
    min-height: 180px;
  }
  .video-tiles-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
  }

  /* Presentation view */
  .presentation-stage-container {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 10px;
    height: 100%;
  }
  .slide-card {
    padding: 16px;
    gap: 12px;
    border-radius: var(--r-sm);
    touch-action: pan-y;
  }
  .slide-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  .slide-title {
    font-size: 1.2rem;
  }
  .slide-subtitle {
    font-size: 0.9rem;
  }
  .slide-content-text {
    font-size: 0.85rem;
    padding: 12px;
    line-height: 1.6;
  }
  .slide-participants-strip {
    display: none;
  }
  .slide-arrow-btn {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }

  /* Whiteboard */
  .whiteboard-container {
    padding: 8px 10px;
    gap: 8px;
  }
  .whiteboard-toolbar {
    padding: 6px 10px;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .wb-tool-btn {
    padding: 6px 10px;
    min-height: 36px;
  }
  .color-dot {
    width: 24px;
    height: 24px;
  }

  /* Breakout Banner */
  .breakout-sub-header {
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  /* Phones: the task gets its own full-width line under "Live Breakout · Room #1" */
  .breakout-bar-left,
  .breakout-bar-topic {
    flex-basis: 100%;
  }
  .breakout-bar-title {
    font-size: 0.88rem;
  }

  /* Bottom Toolbar Mobile Layout */
  .classroom-toolbar {
    padding: 0 8px;
    gap: 4px;
    justify-content: space-around;
  }
  .toolbar-left,
  .toolbar-right {
    display: contents; /* flat layout across the toolbar */
  }
  .toolbar-center {
    display: none; /* Secondary actions moved to overflow sheet */
  }
  /* Delegate secondary buttons to overflow sheet on mobile */
  #screenShareBtn,
  #openVideoBtn {
    display: none !important;
  }
  /* Show More (...) button */
  .more-toolbar-btn {
    display: flex !important;
  }
  .toolbar-btn {
    min-width: 48px;
    max-width: 62px;
    flex: 1;
    padding: 6px 4px;
    gap: 2px;
    border-radius: var(--r-sm);
  }
  .toolbar-btn .btn-icon svg {
    width: 18px;
    height: 18px;
  }
  .btn-label {
    font-size: 0.58rem;
    letter-spacing: 0.01em;
  }

  /* Side Drawers as full mobile overlays */
  .side-drawer {
    width: 100% !important;
    max-width: 100% !important;
    top: var(--header-h);
    height: calc(100% - var(--header-h) - var(--toolbar-h));
    border-left: none;
    z-index: 450;
  }

  /* Note-Slide Editing and Admin Modals as Mobile Bottom Sheets */
  .admin-modal {
    align-items: flex-end;
    padding: 0;
    backdrop-filter: blur(10px);
  }
  .sheet-drag-handle-bar {
    display: flex;
  }
  .modal-card {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 94vh !important;
    max-height: 94dvh !important;
    border-top-left-radius: 20px !important;
    border-top-right-radius: 20px !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-left: none;
    border-right: none;
    border-bottom: none;
    animation: slideUpSheet 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .modal-header {
    padding: 12px 18px;
  }
  .modal-title {
    font-size: 1rem;
  }
  .modal-desc {
    font-size: 0.74rem;
  }
  .modal-body {
    padding: 14px 18px;
    gap: 14px;
    max-height: calc(94dvh - 150px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Prevent iOS Safari auto-zoom on inputs */
  .form-input,
  .form-textarea {
    font-size: 16px !important;
  }
  .sticky-modal-footer {
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
  }
  .sticky-modal-footer .btn {
    min-height: 44px;
  }

  /* Floating Video Player Bar on mobile */
  .video-broadcast-bar {
    bottom: calc(var(--toolbar-h) + 8px);
    width: calc(100% - 16px);
    max-width: calc(100% - 16px);
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: wrap;
    border-radius: 12px;
  }
  .video-bar-left {
    min-width: 0;
    flex: 1;
  }
  .video-bar-center {
    order: 3;
    width: 100%;
    margin-top: 4px;
  }
  .video-bar-right {
    flex-shrink: 0;
  }
  .paywall-cards-grid {
    grid-template-columns: 1fr;
  }
  .paywall-subactions {
    flex-direction: column;
  }
  .admin-form-grid {
    grid-template-columns: 1fr;
  }
  .broadcast-input-row {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .slide-title { font-size: 1.1rem; }
  .slide-header { flex-direction: column; align-items: flex-start; }
  .slide-header-right { width: 100%; justify-content: space-between; }
  .video-bar-title { max-width: 110px; }
  .toolbar-btn { min-width: 44px; padding: 5px 2px; }
  .btn-label { font-size: 0.54rem; }
}

/* ============================================================
   MISC ANIMATIONS & STATES
   ============================================================ */
.is-speaking { /* applied to video cards/wrappers when audio activity detected */ }

/* Screen share highlight */
.participant-video-card.screen-share-active {
  border-color:var(--success);
  box-shadow:0 0 12px rgba(16,185,129,0.3);
}

/* Instructor badge in participant rows */
.instructor-tag {
  font-size:0.6rem; font-weight:700; text-transform:uppercase; letter-spacing:0.05em;
  color:var(--accent); background:var(--accent-light);
  padding:1px 6px; border-radius:var(--r-full);
  border:1px solid rgba(249,115,22,0.25);
}

/* System toast (simple one-liner) — replaces emoji-heavy toasts */
.sys-toast {
  position: fixed; bottom: calc(var(--toolbar-h) + 12px); left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card); border: 1px solid var(--border-mid);
  border-radius: var(--r-full); padding: 8px 18px;
  font-size: 0.78rem; color: var(--text-secondary);
  box-shadow: var(--shadow-md);
  z-index: 900; white-space: nowrap;
  animation: toastFade 0.3s ease;
}
@keyframes toastFade { from{opacity:0;transform:translateX(-50%) translateY(6px);} to{opacity:1;transform:translateX(-50%) translateY(0);} }

/* ── VIEW-ONLY ALERT BAR & VIP SIGN-IN ──────────────────── */
.view-only-alert-bar {
  background: rgba(234,179,8, 0.12);
  border-bottom: 1px solid rgba(234,179,8, 0.35);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  gap: 12px;
  font-size: 0.82rem;
  flex-shrink: 0;
  z-index: 100;
  animation: fadeIn 0.25s ease;
}
.view-only-content {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--warning);
  font-weight: 500;
}
.view-only-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.verify-status-text {
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: center;
  border-radius: var(--r-sm);
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
}

/* ============================================================
   SCREEN SHARE & LIVE VIDEO BROADCAST STYLES
   ============================================================ */
#speakerVideoWrapper.is-screen-share .video-element {
  object-fit: contain !important;
  background: #000 !important;
}

#speakerVideoWrapper.is-screen-share {
  background: #000 !important;
}

.video-broadcast-bar {
  position: absolute;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(249,115,22, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(249,115,22, 0.2);
  border-radius: 14px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 100;
  max-width: 90vw;
  width: 680px;
}

.video-broadcast-bar.hidden {
  display: none !important;
}

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

.video-live-pill {
  font-size: 0.65rem;
  font-weight: 800;
  background: #ef4444;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  animation: pulseLive 1.5s infinite;
}

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

.video-bar-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.video-bar-center {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.video-time-label {
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--text-secondary);
  min-width: 38px;
}

.video-seek-slider {
  flex: 1;
  height: 4px;
  accent-color: var(--accent);
  cursor: pointer;
}

.video-bar-right {
  display: flex;
  align-items: center;
}

.video-option-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.video-option-card:hover {
  background: rgba(249,115,22, 0.08);
  border-color: var(--accent);
}

.option-icon {
  font-size: 2rem;
}

.option-info strong {
  display: block;
  font-size: 0.92rem;
  color: #fff;
  margin-bottom: 2px;
}

.option-info p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0;
}


/* ── Device Selector Modal ─────────────────────────────────── */

/* Card sizing */
.device-selector-card {
  max-width: 440px;
}

/* Body layout */
.device-selector-body {
  padding: 18px 20px;
  gap: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Camera preview block */
.device-preview-section {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0f1e;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.device-camera-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none; /* shown via JS when stream active */
  border-radius: var(--r-md);
}
.device-preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  pointer-events: none;
}

/* Individual field */
.device-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.device-field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* Select input */
.device-select {
  width: 100%;
  padding: 10px 36px 10px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 42px; /* easy tap target */
}
.device-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.device-select:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.device-select option {
  background: #1e293b;
  color: var(--text-primary);
}

/* VU meter */
.device-vu-wrap { display: flex; flex-direction: column; gap: 4px; }
.device-vu-label { font-size: 11px; color: var(--text-muted); }
.device-vu-track {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.device-vu-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4ade80, #22d3ee);
  border-radius: 3px;
  transition: width 0.06s linear;
}

/* Compat note */
.device-compat-note {
  font-size: 11px;
  color: var(--warning);
  background: var(--warning-light);
  border-radius: var(--r-xs);
  padding: 6px 10px;
  line-height: 1.5;
}

/* Footer */
.device-selector-footer {
  justify-content: space-between;
}

/* Toolbar indicator dot — shows when custom device is saved */
#deviceSettingsBtn {
  position: relative;
}
#deviceSettingsBtn::after {
  content: '';
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--accent);
  border: 2px solid var(--bg-base);
  border-radius: 50%;
  display: none;
}
#deviceSettingsBtn.has-custom-device::after {
  display: block;
}

/* ── Device selector responsive ─────────────────────────────── */
@media (max-width: 768px) {
  /* Hide from direct toolbar — accessible via overflow sheet instead */
  #deviceSettingsBtn {
    display: none !important;
  }

  /* Bottom-sheet style (same pattern as other modals) */
  #deviceSelectorModal {
    align-items: flex-end;
    padding: 0;
  }
  .device-selector-card {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 92vh !important;
    max-height: 92dvh !important;
    border-top-left-radius: 20px !important;
    border-top-right-radius: 20px !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-left: none;
    border-right: none;
    border-bottom: none;
    animation: slideUpSheet 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .device-selector-card .sheet-drag-handle-bar {
    display: flex; /* show drag handle on mobile */
  }
  .device-selector-body {
    padding: 12px 16px;
    gap: 16px;
    max-height: calc(92dvh - 160px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Larger touch targets on mobile */
  .device-select {
    min-height: 48px;
    font-size: 16px !important; /* prevents iOS auto-zoom */
  }

  /* Camera preview: taller on portrait mobile */
  .device-preview-section {
    aspect-ratio: 4 / 3;
  }

  /* Footer padding for home indicator */
  .device-selector-footer {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .device-selector-footer .btn {
    min-height: 46px;
  }
}

@media (max-width: 480px) {
  .device-selector-body {
    padding: 10px 14px;
    gap: 14px;
  }
}

/* Give mic: the student given the mic sees their mic button pulse until they tap it */
#micBtn.mic-invited {
  animation: micInvited 1.2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(249,115,22,0.6);
}
@keyframes micInvited {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249,115,22,0.55); }
  50% { box-shadow: 0 0 0 8px rgba(249,115,22,0); }
}
.badge-has-mic {
  background: rgba(249,115,22,0.14);
  border: 1px solid rgba(249,115,22,0.4);
  color: #fdba74;
  padding: 2px 8px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700;
}
.mini-mod-btn-mic { border-color: rgba(249,115,22,0.45) !important; }

/* Teacher's moderation buttons in the People panel: on their own line under the name, wrapping,
   so none are pushed off the panel's edge (Give mic, Mute, Lower, Move, Remove) */
.participant-drawer-row { flex-wrap: wrap; row-gap: 6px; }
.row-status-icons { flex-wrap: wrap; justify-content: flex-end; flex: 1 1 100%; min-width: 0; }
.mini-action-group { display: flex; flex-wrap: wrap; gap: 4px; flex-basis: 100%; justify-content: flex-end; }
.mini-mod-btn {
  font-size: 0.68rem; padding: 3px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); color: var(--text-primary, #fff);
}
.mini-mod-btn:hover { background: rgba(255,255,255,0.12); }
.mini-mod-btn.btn-danger { color: #f87171; border-color: rgba(239,68,68,0.35); }
