/* ==========================================================================
   SIKKHALAY DIGITAL SCHOOL OS — NEXT-GEN LIVE CLASSROOM STUDIO CSS
   Ultra-Modern Teacher Broadcast Engine & Interactive Workspace
   Default Theme: Premium Clean Light Studio (with Full Dark Studio Parity)
   ========================================================================== */

:root, [data-theme="light"] {
    --bg-main: #F1F5F9;
    --bg-surface: #FFFFFF;
    --bg-surface-elevated: #F8FAFC;
    --bg-surface-hover: #EEF2F6;
    --bg-surface-secondary: #F8FAFC;
    --bg-glass: rgba(255, 255, 255, 0.92);
    --bg-glass-dock: rgba(15, 23, 42, 0.92);
    
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --text-inverse: #FFFFFF;
    
    --brand-primary: #059669;
    --brand-primary-hover: #047857;
    --brand-primary-light: #ECFDF5;
    --brand-primary-border: #A7F3D0;
    --brand-accent: #10B981;
    --brand-glow: rgba(16, 185, 129, 0.28);
    
    --brand-teal: #0D9488;
    --brand-teal-light: #F0FDFA;
    
    --danger: #EF4444;
    --danger-light: #FEF2F2;
    --danger-border: #FECACA;
    --warning: #F59E0B;
    --warning-light: #FFFBEB;
    --info: #0284C7;
    --info-light: #E0F2FE;
    
    --border-color: #E2E8F0;
    --border-subtle: #F1F5F9;
    --border-focus: #10B981;
    
    --stage-bg: #090D16;
    --wb-canvas-bg: #FFFFFF;
    --wb-canvas-grid: rgba(15, 23, 42, 0.08);
    
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
    --shadow-glow: 0 0 16px rgba(16, 185, 129, 0.25);
    
    --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-main: #0B0F19;
    --bg-surface: #131B2E;
    --bg-surface-elevated: #1E293B;
    --bg-surface-hover: #293548;
    --bg-surface-secondary: #0F172A;
    --bg-glass: rgba(19, 27, 46, 0.88);
    --bg-glass-dock: rgba(15, 23, 42, 0.94);
    
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-inverse: #0F172A;
    
    --brand-primary: #059669;
    --brand-primary-hover: #047857;
    --brand-primary-light: rgba(5, 150, 105, 0.18);
    --brand-primary-border: rgba(16, 185, 129, 0.35);
    --brand-accent: #10B981;
    --brand-glow: rgba(16, 185, 129, 0.4);
    
    --brand-teal: #0D9488;
    --brand-teal-light: rgba(13, 148, 136, 0.18);
    
    --danger: #EF4444;
    --danger-light: rgba(239, 68, 68, 0.18);
    --danger-border: rgba(239, 68, 68, 0.4);
    --warning: #F59E0B;
    --warning-light: rgba(245, 158, 11, 0.18);
    --info: #38BDF8;
    --info-light: rgba(56, 189, 248, 0.15);
    
    --border-color: rgba(255, 255, 255, 0.1);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-focus: #10B981;
    
    --stage-bg: #050811;
    --wb-canvas-bg: #0F172A;
    --wb-canvas-grid: rgba(255, 255, 255, 0.12);
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #334155;
}

/* Buttons and Form elements reset */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

input, textarea, select {
    font-family: inherit;
    outline: none;
    color: var(--text-primary);
}

.font-mono {
    font-family: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace !important;
}

/* Pulse Dot Animation */
.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #EF4444;
    border-radius: 50%;
    animation: pulseGlow 1.6s infinite;
    display: inline-block;
    flex-shrink: 0;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ==========================================================================
   1. ADVANCED STUDIO STICKY HEADER
   ========================================================================== */
.classroom-header {
    height: 68px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    gap: 12px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.back-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.95rem;
    flex-shrink: 0;
}
.back-btn:hover {
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    border-color: var(--brand-primary-border);
    transform: translateX(-2px);
}

.header-title-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.title-top-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.live-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #EF4444;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.675rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}
[data-theme="dark"] .live-status-pill {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
}

.header-class-title {
    font-size: 0.975rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.title-sub-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.725rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.meta-pill.inst-badge {
    font-weight: 700;
    color: var(--brand-primary);
}
.meta-pill.class-badge {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

/* Center Telemetry HUD */
.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.studio-hud-bar {
    display: flex;
    align-items: center;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 3px 6px;
    gap: 6px;
}

.hud-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.live-clock-icon {
    color: var(--brand-accent);
    font-size: 0.8rem;
}

/* Dynamic Audio Meter */
.audio-visualizer-pill {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 3px 8px;
}

.audio-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
    padding: 1px 0;
}

.a-bar {
    width: 3px;
    height: 3px;
    background-color: var(--brand-primary);
    border-radius: 1px;
    transition: height 0.08s ease;
}

.audio-meter-active .a-bar:nth-child(1) { animation: barHop1 0.35s infinite alternate; }
.audio-meter-active .a-bar:nth-child(2) { animation: barHop2 0.28s infinite alternate 0.05s; }
.audio-meter-active .a-bar:nth-child(3) { animation: barHop3 0.4s infinite alternate 0.1s; }
.audio-meter-active .a-bar:nth-child(4) { animation: barHop2 0.32s infinite alternate 0.08s; }
.audio-meter-active .a-bar:nth-child(5) { animation: barHop1 0.25s infinite alternate 0.02s; }

@keyframes barHop1 { 0% { height: 3px; } 100% { height: 11px; } }
@keyframes barHop2 { 0% { height: 4px; } 100% { height: 14px; } }
@keyframes barHop3 { 0% { height: 2px; } 100% { height: 9px; } }

.stream-health-pill {
    gap: 5px;
}

.signal-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

/* Right Header Group */
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.95rem;
    position: relative;
}
.icon-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: #CBD5E1;
}

.header-mobile-menu-btn {
    display: none;
}

/* Mobile Dropdown Menu */
.header-mobile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 16px;
    width: 270px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 200;
    animation: fadeInDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.header-mobile-dropdown.open {
    display: flex;
}

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

.hmd-section {
    padding: 8px 10px;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-md);
}
.hmd-telemetry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.775rem;
    font-weight: 700;
}
.hmd-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}
.hmd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    width: 100%;
}
.hmd-item:hover {
    background: var(--bg-surface-hover);
    color: var(--brand-primary);
}

/* ==========================================================================
   2. MAIN STUDIO GRID LAYOUT
   ========================================================================== */
.classroom-container {
    display: grid;
    grid-template-columns: 1fr 390px;
    gap: 16px;
    padding: 16px;
    max-width: 1840px;
    margin: 0 auto;
    width: 100%;
    height: calc(100vh - 68px);
    max-height: calc(100vh - 68px);
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
    transition: grid-template-columns 0.3s ease;
}

/* Theater Mode Viewport Override */
body.theatre-mode {
    overflow-y: hidden;
    height: 100vh;
}
body.theatre-mode .classroom-container {
    grid-template-columns: 1fr 380px;
    grid-template-rows: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
    gap: 0;
    height: calc(100vh - 68px);
    max-height: calc(100vh - 68px);
    min-height: 0;
    overflow: hidden;
}
body.theatre-mode .classroom-viewport {
    padding: 0;
    margin: 0;
    gap: 0;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}
body.theatre-mode .broadcast-stage-card {
    border-radius: 0;
    border: none;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    flex: 1 1 0%;
}
body.theatre-mode .stage-canvas-wrapper {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    aspect-ratio: auto;
    border-radius: 0;
}
body.theatre-mode .classroom-sidebar {
    display: flex !important;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    border-right: none;
    border-left: 1px solid var(--border-color);
    position: static;
    overflow: hidden;
}

/* Sidebar Collapsed State */
.classroom-container.sidebar-collapsed {
    grid-template-columns: 1fr;
}
.classroom-container.sidebar-collapsed .classroom-sidebar {
    display: none !important;
}

.classroom-viewport {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* ==========================================================================
   3. MULTIMODAL BROADCAST STAGE
   ========================================================================== */
.broadcast-stage-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1 1 0%;
}

/* Mode Switcher Nav Tabs */
.stage-mode-bar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 20;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.stage-mode-pills {
    display: flex;
    align-items: center;
    background: var(--bg-surface-elevated);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    gap: 3px;
    overflow-x: auto;
    max-width: 100%;
}

.mode-pill-btn {
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.775rem;
    font-weight: 700;
    color: var(--text-secondary);
    gap: 6px;
    white-space: nowrap;
    transition: var(--transition-fast);
}
.mode-pill-btn:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}
.mode-pill-btn.active {
    background: var(--brand-primary);
    color: #FFFFFF;
    box-shadow: var(--shadow-sm);
}

.kbd-hint {
    background: rgba(0, 0, 0, 0.15);
    color: inherit;
    font-size: 0.65rem;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 800;
}
.mode-pill-btn.active .kbd-hint {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
}

.stage-telemetry-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.telemetry-badge {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.725rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.btn-pip-toggle {
    cursor: pointer;
    background: var(--bg-surface);
    transition: var(--transition-fast);
}
.btn-pip-toggle:hover {
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    border-color: var(--brand-primary-border);
}
.btn-pip-toggle.is-active {
    background: var(--brand-primary);
    color: #FFFFFF;
    border-color: var(--brand-accent);
}

/* Full-Height Canvas Stage Wrapper */
.stage-canvas-wrapper {
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1 1 0%;
    background: var(--stage-bg);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mode 1: Live Video Canvas */
#liveVideoCanvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    transition: opacity 0.25s ease;
    display: block;
}

/* Mode 2: Interactive Digital Whiteboard */
#whiteboardCanvasContainer {
    position: absolute;
    inset: 0;
    background: var(--wb-canvas-bg);
    display: none;
    flex-direction: column;
    z-index: 10;
}
#whiteboardCanvasContainer.active {
    display: flex;
}

.wb-toolbar {
    height: 52px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    gap: 8px;
    z-index: 15;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.wb-tool-group {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-surface-elevated);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.wb-tool-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.wb-tool-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}
.wb-tool-btn.active {
    background: var(--brand-primary);
    color: #FFFFFF;
    box-shadow: var(--shadow-sm);
}

.wb-color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #FFFFFF;
    box-shadow: 0 0 0 1px #CBD5E1;
    transition: transform 0.15s ease;
}
.wb-color-dot:hover {
    transform: scale(1.2);
}
.wb-color-dot.active {
    box-shadow: 0 0 0 2px var(--brand-primary);
    transform: scale(1.15);
}

.wb-slider-group {
    padding: 0 8px;
}
.wb-slider-group input[type="range"] {
    width: 60px;
    height: 4px;
    cursor: pointer;
    accent-color: var(--brand-primary);
}

#paintCanvas {
    flex: 1;
    width: 100%;
    cursor: crosshair;
    background-color: var(--wb-canvas-bg);
}
#paintCanvas.grid-bg {
    background-image: radial-gradient(var(--wb-canvas-grid) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Mode 3: Slide Presentation Viewer */
#slidePresentationContainer {
    position: absolute;
    inset: 0;
    background: #090D16;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
#slidePresentationContainer.active {
    display: flex;
}

.slide-render-frame {
    width: 90%;
    height: 84%;
    background: #FFFFFF;
    color: #0F172A;
    border-radius: var(--radius-md);
    padding: clamp(14px, 2.5vw, 32px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.slide-content-block {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.slide-top-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.slide-badge-counter {
    font-size: clamp(0.65rem, 1.2vw, 0.75rem);
    font-weight: 800;
    color: var(--brand-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.slide-badge-session {
    font-size: clamp(0.6rem, 1vw, 0.7rem);
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-surface-elevated);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}
.slide-title {
    font-size: clamp(0.95rem, 2.2vw, 1.5rem);
    font-weight: 800;
    color: #0F172A;
    margin: 6px 0 2px;
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.slide-subtitle {
    font-size: clamp(0.725rem, 1.4vw, 0.9rem);
    font-weight: 600;
    color: #475569;
}
.slide-body {
    margin-top: clamp(8px, 1.8vw, 18px);
    font-size: clamp(0.75rem, 1.4vw, 1rem);
    line-height: 1.6;
    color: #1E293B;
    background: #F8FAFC;
    padding: clamp(8px, 1.6vw, 18px);
    border-radius: var(--radius-md);
    border: 1px solid #E2E8F0;
    overflow-y: auto;
}
.slide-footer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: clamp(0.65rem, 1.1vw, 0.775rem);
    color: #64748B;
    border-top: 1px solid #E2E8F0;
    padding-top: 8px;
    margin-top: 8px;
}

.slide-controls-bar {
    position: absolute;
    bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(15, 23, 42, 0.9);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Picture-in-Picture (PiP) Floating Camera Box */
.pip-camera-box {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 180px;
    aspect-ratio: 16 / 9;
    background: #0F172A;
    border: 2px solid var(--brand-primary);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 25;
    overflow: hidden;
    display: none;
    flex-direction: column;
    transition: all 0.2s ease;
}
.pip-camera-box.active {
    display: flex;
}

.pip-header {
    height: 26px;
    background: rgba(15, 23, 42, 0.9);
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.7rem;
    font-weight: 700;
    color: #FFFFFF;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.pip-header:active {
    cursor: grabbing;
}

.pip-close-btn {
    color: #94A3B8;
    font-size: 0.9rem;
    line-height: 1;
}
.pip-close-btn:hover {
    color: #FFFFFF;
}

.pip-video-wrap {
    flex: 1;
    width: 100%;
    overflow: hidden;
}
.pip-video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Spotlight Question Overlay */
.spotlight-doubt-overlay {
    position: absolute;
    top: 14px;
    left: 14px;
    max-width: 480px;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid var(--warning);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    z-index: 25;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    animation: slideInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.spotlight-badge {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--warning);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.spotlight-q-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.4;
}
.spotlight-author {
    font-size: 0.725rem;
    color: #94A3B8;
    margin-top: 4px;
}
.spotlight-dismiss-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #94A3B8;
    font-size: 1rem;
}
.spotlight-dismiss-btn:hover {
    color: #FFFFFF;
}

/* Floating Reactions */
.reactions-overlay-canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 25;
    overflow: hidden;
}

.floating-reaction-item {
    position: absolute;
    bottom: 20px;
    font-size: 2.2rem;
    animation: floatReactionUp 2.8s ease-out forwards;
    opacity: 0.95;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

@keyframes floatReactionUp {
    0% { transform: translateY(0) scale(0.5) rotate(0deg); opacity: 1; }
    50% { transform: translateY(-160px) scale(1.3) rotate(-12deg); opacity: 0.9; }
    100% { transform: translateY(-340px) scale(0.8) rotate(15deg); opacity: 0; }
}

/* Focus Timer Overlay */
.focus-timer-overlay {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--brand-primary-border);
    backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--brand-accent);
    z-index: 25;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.focus-timer-overlay.active {
    display: flex;
}

/* ==========================================================================
   4. FLOATING TEACHER COMMAND DOCK
   ========================================================================== */
.teacher-floating-dock {
    background: var(--bg-glass-dock);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 30;
}

.dock-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dock-btn {
    height: 40px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #F8FAFC;
    font-size: 0.8rem;
    font-weight: 700;
    gap: 8px;
    transition: var(--transition-fast);
    white-space: nowrap;
}
.dock-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.3);
}
.dock-btn.is-active {
    background: var(--brand-primary);
    color: #FFFFFF;
    border-color: var(--brand-accent);
    box-shadow: 0 0 12px var(--brand-glow);
}
.dock-btn.is-danger {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    color: #FECACA;
}
.dock-btn.is-danger:hover {
    background: var(--danger);
    color: #FFFFFF;
}

.dock-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 4px;
}

.dock-mobile-only {
    display: none;
}

/* ==========================================================================
   5. INTERACTIVE RIGHT SIDEBAR (8 TABS)
   ========================================================================== */
.classroom-sidebar {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.sidebar-tab-nav {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface-secondary);
    padding: 6px 8px;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0;
}
.sidebar-tab-nav::-webkit-scrollbar {
    display: none;
}

.s-nav-btn {
    flex: 0 0 auto;
    padding: 7px 12px;
    font-size: 0.775rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: var(--transition-fast);
}
.s-nav-btn:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}
.s-nav-btn.active {
    background: var(--bg-surface);
    color: var(--brand-primary);
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.tab-badge {
    background: var(--brand-primary);
    color: #FFFFFF;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: var(--radius-full);
}

.sidebar-pane-body {
    flex: 1 1 0%;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    display: none;
    flex-direction: column;
    position: relative;
}
.sidebar-pane-body.active {
    display: flex;
}

/* TAB 1: LIVE CHAT */
.pinned-announcement-bar {
    flex-shrink: 0;
    background: var(--brand-primary-light);
    border-bottom: 1px solid var(--brand-primary-border);
    padding: 8px 12px;
    font-size: 0.775rem;
    color: #065F46;
    display: flex;
    align-items: center;
    gap: 8px;
}
[data-theme="dark"] .pinned-announcement-bar {
    color: #A7F3D0;
}

.chat-stream-list {
    flex: 1 1 0%;
    min-height: 0;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-msg-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}
.chat-avatar.is-teacher {
    background: var(--brand-primary);
    color: #FFFFFF;
    border-color: var(--brand-accent);
}

.chat-msg-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-author {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chat-role-pill {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--radius-full);
}
.chat-role-pill.teacher {
    background: var(--brand-primary);
    color: #FFFFFF;
}
.chat-role-pill.student {
    background: #E2E8F0;
    color: var(--text-secondary);
}
[data-theme="dark"] .chat-role-pill.student {
    background: #334155;
    color: #CBD5E1;
}

.chat-time {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.chat-bubble {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 0.825rem;
    line-height: 1.4;
    color: var(--text-primary);
    word-break: break-word;
}
.chat-bubble.teacher-styled {
    background: var(--brand-primary-light);
    border-color: var(--brand-primary-border);
    color: #064E3B;
}
[data-theme="dark"] .chat-bubble.teacher-styled {
    color: #ECFDF5;
}

.chat-composer-box {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin-top: auto;
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface-secondary);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px 8px;
}
.chat-input-wrapper:focus-within {
    border-color: var(--brand-accent);
}

.chat-text-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 6px;
    font-size: 0.825rem;
    color: var(--text-primary);
}

.chat-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-emoji-btn {
    padding: 4px 6px;
    border-radius: var(--radius-xs);
    font-size: 0.95rem;
    transition: transform 0.15s ease;
}
.chat-emoji-btn:hover {
    transform: scale(1.3);
}

.btn-send-chat {
    background: var(--brand-primary);
    color: #FFFFFF;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-size: 0.775rem;
    font-weight: 700;
    gap: 6px;
}
.btn-send-chat:hover {
    background: var(--brand-primary-hover);
}

/* TAB 2: CONNECTED STUDENTS ROSTER */
.roster-header-bar {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface-secondary);
}

.roster-search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 5px 10px;
    font-size: 0.775rem;
}
.roster-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.775rem;
}

.roster-filter-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.r-chip {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.725rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    white-space: nowrap;
    gap: 4px;
}
.r-chip:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}
.r-chip.active {
    background: var(--brand-primary);
    color: #FFFFFF;
    border-color: var(--brand-primary);
}

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

.roster-row-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}
.roster-row-card:hover {
    border-color: var(--brand-primary-border);
    background: var(--bg-surface);
}

.roster-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.roster-roll-chip {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
}

.roster-name {
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--text-primary);
}

.roster-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.roster-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.roster-action-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-xs);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
}
.roster-action-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}
.roster-action-btn.is-active {
    color: var(--brand-primary);
    background: var(--brand-primary-light);
    border-color: var(--brand-primary-border);
}

/* TAB 3: Q&A FORUM */
.qna-filter-bar {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface-secondary);
}

.qna-subtabs {
    display: flex;
    gap: 4px;
}

.qna-filter-btn {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.725rem;
    font-weight: 700;
    color: var(--text-secondary);
}
.qna-filter-btn.active {
    background: var(--bg-surface);
    color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
}

.qna-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.qna-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.qna-card.pinned {
    border-color: var(--brand-primary-border);
    background: var(--brand-primary-light);
}

.qna-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.badge-status-qna {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--radius-full);
}
.badge-status-qna.answered {
    background: #ECFDF5;
    color: #059669;
}
.badge-status-qna.pending {
    background: #FFFBEB;
    color: #D97706;
}

.qna-question {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}

.qna-answer-box {
    background: var(--bg-surface);
    border-left: 3px solid var(--brand-primary);
    padding: 8px 10px;
    border-radius: var(--radius-xs);
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.qna-actions-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}
.qna-action-link {
    font-size: 0.725rem;
    font-weight: 700;
    color: var(--brand-primary);
    gap: 4px;
}
.qna-action-link:hover {
    text-decoration: underline;
}

/* TAB 4: AI TEACHING CO-PILOT */
.ai-copilot-header {
    background: linear-gradient(135deg, #059669 0%, #0D9488 100%);
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #FFFFFF;
}

.ai-chips-shelf {
    padding: 10px 12px;
    background: var(--bg-surface-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-prompt-chip {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    width: 100%;
    justify-content: flex-start;
    transition: var(--transition-fast);
}
.ai-prompt-chip:hover {
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    border-color: var(--brand-primary-border);
}

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

.ai-bubble {
    background: var(--brand-teal-light);
    border: 1px solid #A7F3D0;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.825rem;
    line-height: 1.5;
    color: #064E3B;
}
[data-theme="dark"] .ai-bubble {
    color: #ECFDF5;
    background: rgba(13, 148, 136, 0.2);
    border-color: rgba(16, 185, 129, 0.35);
}

/* TAB 5: FILES & RESOURCES */
.files-shelf-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

/* ==========================================================================
   6. SIDEBAR PANES (PLAN, NOTES, QUIZ) & TEACHER MOBILE ACTION SHEET
   ========================================================================== */
.sidebar-pane-header-bar {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sidebar-plan-body,
.sidebar-quiz-body {
    padding: 14px;
    overflow-y: auto;
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
}

.sidebar-notes-wrap {
    padding: 14px;
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.overview-meta-card {
    background: var(--bg-surface-secondary);
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 0.825rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.teacher-notes-pad {
    width: 100%;
    height: 100%;
    flex: 1 1 0%;
    min-height: 200px;
    padding: 12px;
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-primary);
    resize: none;
    line-height: 1.6;
    font-family: var(--font-sans);
    transition: var(--transition-fast);
}
.teacher-notes-pad:focus {
    border-color: var(--brand-primary);
    background: var(--bg-surface);
    outline: none;
    box-shadow: 0 0 0 3px var(--brand-glow);
}

/* Teacher Mobile Action Sheet Drawer */
.teacher-action-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.teacher-action-sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.teacher-action-sheet {
    width: 100%;
    max-width: 580px;
    max-height: 88vh;
    background: var(--bg-surface);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    border: 1px solid var(--border-color);
    border-bottom: none;
    box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.35);
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.teacher-action-sheet-overlay.active .teacher-action-sheet {
    transform: translateY(0);
}

.sheet-drag-handle {
    width: 44px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
    margin: 10px auto 4px auto;
    cursor: grab;
}

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

.sheet-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sheet-title-text {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
}

.sheet-close-btn {
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}
.sheet-close-btn:hover {
    color: var(--danger);
    border-color: var(--danger-border);
}

.sheet-section-title {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 10px 20px 4px;
}

.sheet-mode-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 4px 20px 8px;
}

.sheet-mode-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}
.sheet-mode-pill:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}
.sheet-mode-pill.active {
    background: var(--brand-primary-light);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.sheet-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 6px 20px 12px;
}

.sheet-action-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 6px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.sheet-action-tile:hover, .sheet-action-tile:active {
    background: var(--bg-surface-hover);
    border-color: var(--brand-primary);
    transform: translateY(-2px);
}
.sheet-action-tile.is-active {
    background: var(--brand-primary-light);
    border-color: var(--brand-primary);
}

.sheet-tile-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-surface);
    color: var(--brand-primary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    margin-bottom: 6px;
}
.sheet-tile-name {
    font-size: 0.775rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 2px;
}
.sheet-tile-hint {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.sheet-footer {
    padding: 8px 20px 4px;
}

.sheet-end-btn {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--danger-light);
    border: 1px solid var(--danger-border);
    color: var(--danger);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
}
.sheet-end-btn:hover {
    background: var(--danger);
    color: #FFFFFF;
}

/* ==========================================================================
   7. MODALS & DIALOGS
   ========================================================================== */
.modal-backdrop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    padding: 16px;
}
.modal-backdrop-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-dialog-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transform: translateY(12px);
    transition: transform 0.2s ease;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-backdrop-overlay.active .modal-dialog-box {
    transform: translateY(0);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.modal-close-x {
    font-size: 1.4rem;
    color: var(--text-muted);
    line-height: 1;
}
.modal-close-x:hover {
    color: var(--text-primary);
}

/* Poll Progress Bars */
.poll-result-bar-group {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.poll-res-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}
.poll-progress-track {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.poll-progress-fill {
    height: 100%;
    background: var(--brand-primary);
    border-radius: var(--radius-full);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Shortcuts Grid */
.shortcuts-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    font-size: 0.825rem;
    color: var(--text-primary);
}
.kbd-pill {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 0 1px #CBD5E1;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 0.725rem;
    font-family: monospace;
}

/* End Session Summary Box */
.session-summary-box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
}
.s-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.s-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--brand-primary);
}
.s-lbl {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Toast Container */
.studio-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 400;
    pointer-events: none;
}

/* ==========================================================================
   8. COMPREHENSIVE RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1280px) {
    .classroom-container {
        grid-template-columns: 1fr 340px;
        padding: 12px;
        gap: 12px;
    }
    .overview-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    body {
        overflow-y: auto !important;
        height: auto !important;
    }
    .classroom-container {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
        max-height: none;
        overflow: visible;
        padding: 12px;
        gap: 16px;
    }
    .classroom-viewport {
        height: auto;
        min-height: auto;
        overflow: visible;
        flex: none;
    }
    .broadcast-stage-card {
        height: auto;
        min-height: auto;
        flex: none;
        width: 100%;
        border-radius: var(--radius-lg);
        overflow: hidden;
        position: relative;
        background: var(--bg-surface);
        box-shadow: var(--shadow-md);
    }
    .stage-canvas-wrapper {
        width: 100%;
        aspect-ratio: 16 / 9;
        min-height: 280px;
        max-height: 64vh;
        position: relative;
        overflow: hidden;
        background: #000;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .classroom-sidebar {
        height: 540px;
        max-height: 650px;
        position: static;
        overflow: hidden;
    }
    .header-center {
        display: none;
    }
    .header-mobile-menu-btn {
        display: inline-flex;
    }
    .desktop-only-btn {
        display: none !important;
    }

    /* Theatre Mode Viewport Override on <= 1024px */
    body.theatre-mode {
        overflow: hidden !important;
        height: 100vh !important;
    }
    body.theatre-mode .classroom-container {
        grid-template-columns: 1fr;
        grid-template-rows: 60% 40%;
        height: calc(100vh - 68px);
        max-height: calc(100vh - 68px);
        overflow: hidden;
        padding: 0;
        gap: 0;
    }
    body.theatre-mode .classroom-viewport {
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }
    body.theatre-mode .broadcast-stage-card {
        height: 100%;
        min-height: 0;
        flex: 1 1 0%;
        border-radius: 0;
        border: none;
    }
    body.theatre-mode .stage-canvas-wrapper {
        height: 100%;
        max-height: 100%;
        min-height: 0;
        aspect-ratio: auto;
    }
    body.theatre-mode .classroom-sidebar {
        height: 100%;
        max-height: 100%;
        min-height: 0;
        overflow: hidden;
        border-radius: 0;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
}

@media (max-width: 860px) {
    .dock-desktop-only,
    .dock-divider-desktop {
        display: none !important;
    }
    .dock-mobile-only {
        display: flex !important;
        align-items: center;
        gap: 6px;
    }
    .teacher-action-sheet-overlay {
        display: flex;
    }
    .teacher-floating-dock {
        position: absolute;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        left: 50%;
        transform: translateX(-50%);
        width: auto;
        max-width: calc(100% - 24px);
        padding: 6px 12px;
        gap: 8px;
        justify-content: center;
        border-radius: var(--radius-full);
        flex-wrap: nowrap;
        overflow: visible;
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
        z-index: 40;
    }
    .dock-btn {
        min-height: 40px;
        min-width: 40px;
        padding: 7px 12px;
        border-radius: var(--radius-full);
        font-size: 0.8rem;
    }
    .dock-btn-mobile {
        min-height: 40px;
        min-width: 40px;
        padding: 7px 12px;
    }
}

@media (max-width: 768px) {
    .classroom-header {
        height: 58px;
        padding: 0 12px;
    }
    .header-class-title {
        font-size: 0.85rem;
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .title-sub-row {
        display: none;
    }
    .meta-pill.inst-badge, .meta-pill.teacher-badge {
        display: none;
    }
    
    .broadcast-stage-card {
        border-radius: var(--radius-md);
    }
    .stage-canvas-wrapper {
        min-height: 220px;
        aspect-ratio: 16 / 9;
    }

    /* Single-row streamlined mode switcher */
    .stage-mode-bar {
        padding: 6px 10px;
        gap: 8px;
        flex-wrap: nowrap;
        justify-content: space-between;
    }
    .stage-mode-pills {
        display: flex;
        align-items: center;
        min-width: 0;
        flex-shrink: 1;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 2px;
        padding: 2px;
    }
    .stage-mode-pills::-webkit-scrollbar {
        display: none;
    }
    .mode-pill-btn {
        padding: 5px 10px;
        font-size: 0.725rem;
        gap: 4px;
        flex-shrink: 0;
    }
    .kbd-hint {
        display: none !important;
    }
    .stage-telemetry-group {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
    }
    .stage-telemetry-group .btn-pip-toggle span,
    .stage-telemetry-group #videoBitrateText {
        display: none !important;
    }
    .stage-telemetry-group .btn-pip-toggle {
        padding: 4px 8px;
    }
    .telemetry-badge {
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    /* Whiteboard toolbar horizontal scrolling */
    .wb-toolbar {
        height: 44px;
        padding: 0 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 6px;
    }
    .wb-toolbar::-webkit-scrollbar {
        display: none;
    }
    .wb-tool-group {
        gap: 2px;
        padding: 2px;
        flex-shrink: 0;
    }
    .wb-tool-btn {
        width: 30px;
        height: 30px;
        font-size: 0.775rem;
    }

    /* Responsive Slide viewer */
    .slide-render-frame {
        width: 95%;
        height: 88%;
        padding: 14px 16px;
        font-size: 0.8rem;
    }
    .slide-controls-bar {
        bottom: 8px;
        padding: 4px 12px;
        gap: 8px;
    }

    /* Overlays inside stage */
    .spotlight-doubt-overlay {
        top: 8px;
        left: 8px;
        right: 8px;
        max-width: calc(100% - 16px);
        padding: 8px 12px;
    }
    .spotlight-q-text {
        font-size: 0.8rem;
    }
    .focus-timer-overlay {
        top: 8px;
        right: 8px;
        padding: 4px 10px;
        font-size: 0.75rem;
    }
    .pip-camera-box {
        width: 120px;
        bottom: 8px;
        right: 8px;
    }
}

@media (max-width: 480px) {
    .classroom-container {
        padding: 6px;
        gap: 10px;
    }
    .header-left {
        gap: 8px;
    }
    .back-btn {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    .header-class-title {
        max-width: 130px;
        font-size: 0.8rem;
    }
    .icon-btn {
        width: 34px;
        height: 34px;
    }
    .broadcast-stage-card {
        border-radius: var(--radius-sm);
    }
    .stage-canvas-wrapper {
        min-height: 200px;
        aspect-ratio: 16 / 9;
    }
    .stage-mode-bar {
        padding: 4px 6px;
    }
    .mode-pill-btn {
        padding: 4px 7px;
        font-size: 0.68rem;
    }
    .stage-telemetry-group #streamStateLabel {
        display: none !important;
    }
    .stage-telemetry-group #streamStatusBadge {
        padding: 3px 6px;
    }
    .teacher-floating-dock {
        padding: 5px 8px;
        gap: 4px;
        max-width: calc(100% - 12px);
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }
    .dock-btn {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        font-size: 0.775rem;
    }
    .dock-btn span {
        display: none !important;
    }
    .dock-btn-mobile span {
        display: inline-block !important;
        font-size: 0.72rem;
    }
    .pip-camera-box {
        width: 100px;
        bottom: 6px;
        right: 6px;
    }
    .classroom-sidebar {
        height: 480px;
    }
    .sheet-actions-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-height: 540px) and (orientation: landscape) {
    .classroom-container {
        padding: 6px;
        gap: 8px;
    }
    .stage-canvas-wrapper {
        height: calc(100vh - 110px);
        max-height: 85vh;
        min-height: 220px;
        aspect-ratio: auto;
    }
}


/* ==========================================================================
   STUDIO SETUP LOBBY & GOOGLE MEET-STYLE LINK STYLES
   Pre-flight selection modal, device testing, and broadcast invitation pill
   ========================================================================== */

/* Fullscreen Lobby Overlay Backdrop */
.studio-setup-lobby-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.studio-setup-lobby-overlay.active {
    display: flex;
    opacity: 1;
}

/* Central Card Box */
.lobby-card-box {
    position: relative;
    width: 100%;
    max-width: 880px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: auto;
    animation: lobbyCardScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes lobbyCardScaleIn {
    0% { transform: scale(0.94) translateY(16px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Lobby Header */
.lobby-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface-elevated);
}

.lobby-header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.lobby-logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
    flex-shrink: 0;
}

.lobby-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.lobby-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.lobby-close-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.lobby-close-btn:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}

/* Context Choice Pills (Institute vs Coaching vs Tuition) */
.lobby-context-pills {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-surface-secondary);
    border-bottom: 1px solid var(--border-color);
}

.context-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.context-pill i {
    font-size: 1.35rem;
    color: var(--text-muted);
    transition: color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.context-pill strong {
    display: block;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.25;
}

.context-pill small {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.context-pill:hover {
    border-color: var(--brand-primary-border);
    background: var(--brand-primary-light);
    transform: translateY(-1px);
}

.context-pill:hover i {
    color: var(--brand-primary);
    transform: scale(1.08);
}

.context-pill.active {
    border-color: var(--brand-primary);
    background: var(--brand-primary-light);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

.context-pill.active i {
    color: var(--brand-primary);
}

.context-pill.active strong {
    color: var(--brand-primary-hover);
}

/* Lobby Body Grid */
.lobby-body-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 20px;
    padding: 20px 24px;
    overflow-y: auto;
    max-height: 58vh;
}

/* Left Column: Form */
.lobby-form-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lobby-subform {
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: fadeInForm 0.2s ease-out;
}

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

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

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 7px;
}

.form-select, .form-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    outline: none;
    transition: all var(--transition-fast);
}

.form-select:hover, .form-input:hover {
    border-color: #CBD5E1;
}

.form-select:focus, .form-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-glow);
    background: var(--bg-surface);
}

/* Right Column: Pre-Flight Device Preview & Meet Link */
.lobby-preview-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lobby-preview-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
}

.preview-stage-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #090D16;
    overflow: hidden;
}

#lobbyPreviewVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.preview-overlay-bar {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 2;
}

.preview-badge {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    color: #FFFFFF;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-badge i {
    color: #10B981;
}

.preview-quick-toggles {
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview-ctrl-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    color: #FFFFFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.preview-ctrl-btn:hover {
    background: rgba(15, 23, 42, 0.95);
    transform: translateY(-1px);
}

.preview-ctrl-btn.is-muted, .preview-ctrl-btn.is-off {
    background: rgba(239, 68, 68, 0.9);
    border-color: #EF4444;
    color: #FFFFFF;
}

.preview-device-info {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg-surface);
}

.device-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.device-row span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lobby-audio-bar-mini {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.lobby-audio-bar-mini .l-bar {
    width: 3px;
    background: var(--brand-primary);
    border-radius: 1px;
    height: 4px;
    animation: miniMicJitter 0.9s infinite ease-in-out alternate;
}

.lobby-audio-bar-mini .l-bar:nth-child(2) {
    animation-delay: 0.2s;
    height: 9px;
}

.lobby-audio-bar-mini .l-bar:nth-child(3) {
    animation-delay: 0.4s;
    height: 6px;
}

@keyframes miniMicJitter {
    0% { height: 3px; }
    50% { height: 11px; }
    100% { height: 5px; }
}

/* Meet Link Preview Box */
.meet-link-preview-box {
    background: var(--bg-surface-elevated);
    border: 1.5px dashed var(--brand-primary-border);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mlp-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.mlp-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--brand-primary-hover);
    background: var(--brand-primary-light);
    border: 1px solid var(--brand-primary-border);
    padding: 8px 12px;
    border-radius: 8px;
    word-break: break-all;
    letter-spacing: 0.2px;
}

.mlp-note {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.35;
}

/* Lobby Footer Action Bar */
.lobby-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface-elevated);
}

.lobby-footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.l-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-glow);
    animation: statusPulse 2s infinite;
}

.lobby-footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-cancel-lobby {
    padding: 10px 18px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-cancel-lobby:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.btn-start-live-studio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 22px;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #FFFFFF;
    background: linear-gradient(135deg, #059669 0%, #10B981 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-start-live-studio:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
}

.btn-start-live-studio:active {
    transform: translateY(0);
}

/* ==========================================================================
   STICKY HEADER GOOGLE MEET-STYLE LINK PILL & CONTEXT SWITCH BUTTON
   ========================================================================== */

/* Context Switch Button in Header */
.context-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--brand-primary);
    background: var(--brand-primary-light);
    border: 1px solid var(--brand-primary-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
    vertical-align: middle;
}

.context-switch-btn:hover {
    background: var(--brand-primary);
    color: #FFFFFF;
    transform: translateY(-1px);
}

/* Google Meet Style Invite Link Pill */
.meet-invite-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px 8px;
    cursor: default;
    transition: all var(--transition-fast);
}

.meet-invite-pill:hover {
    border-color: var(--brand-primary-border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.meet-link-text {
    font-size: 0.78rem;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.1px;
    max-width: 210px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-copy-code, .btn-share-trigger {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 3px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-copy-code:hover {
    color: var(--brand-primary);
    background: var(--brand-primary-light);
}

.btn-share-trigger:hover {
    color: #0284C7;
    background: var(--info-light);
}

/* ==========================================================================
   SHARE MEETING LINK MODAL
   ========================================================================== */
.share-link-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.share-url-input {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--brand-primary-hover);
    background: var(--bg-surface-elevated);
    border: 1.5px solid var(--brand-primary-border);
}

.btn-copy-modal-url {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 0.875rem;
    font-weight: 700;
    color: #FFFFFF;
    background: var(--brand-primary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.btn-copy-modal-url:hover {
    background: var(--brand-primary-hover);
}

.share-channels-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.share-channels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.share-channel-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    transition: all var(--transition-fast);
}

.share-channel-card i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.share-channel-card.whatsapp i { color: #25D366; }
.share-channel-card.notice i { color: #F59E0B; }
.share-channel-card.sms i { color: #0284C7; }
.share-channel-card.qr i { color: #8B5CF6; }

.share-channel-card:hover {
    border-color: var(--brand-primary);
    background: var(--brand-primary-light);
    transform: translateY(-1px);
}

/* ==========================================================================
   RESPONSIVE DESIGN FOR LOBBY & SHARING
   ========================================================================== */
@media (max-width: 860px) {
    .lobby-context-pills {
        grid-template-columns: 1fr;
    }
    .lobby-body-grid {
        grid-template-columns: 1fr;
    }
    .lobby-preview-col {
        order: -1;
    }
    .preview-stage-container {
        aspect-ratio: 16 / 9;
        max-height: 220px;
    }
    .meet-link-text {
        max-width: 140px;
    }
}

@media (max-width: 580px) {
    .studio-setup-lobby-overlay {
        padding: 10px;
    }
    .lobby-card-box {
        border-radius: 16px;
    }
    .lobby-header {
        padding: 14px 16px;
    }
    .lobby-title {
        font-size: 1.05rem;
    }
    .lobby-context-pills {
        padding: 12px 14px;
        gap: 8px;
    }
    .context-pill {
        padding: 10px 12px;
    }
    .lobby-body-grid {
        padding: 14px 16px;
        gap: 14px;
    }
    .form-row-2 {
        grid-template-columns: 1fr;
    }
    .lobby-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        padding: 14px 16px;
    }
    .lobby-footer-left {
        justify-content: center;
    }
    .lobby-footer-right {
        display: flex;
        flex-direction: column-reverse;
        gap: 8px;
    }
    .btn-start-live-studio {
        justify-content: center;
        width: 100%;
    }
    .btn-cancel-lobby {
        width: 100%;
        text-align: center;
    }
    .share-channels-grid {
        grid-template-columns: 1fr;
    }
    .meet-invite-pill {
        display: none !important;
    }
}

