/* ==========================================================================
   SIKKHALAY DIGITAL SCHOOL OS — NEXT-GEN STUDENT LIVE CLASSROOM CSS
   Ultra-Modern Student Virtual Classroom Experience & 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;
    
    --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;
    
    --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. STUDENT CLASSROOM 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: 16px;
}

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

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

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

.title-top-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 0.725rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    background: rgba(239, 68, 68, 0.12);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
    flex-shrink: 0;
}

.header-class-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

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

.meta-pill {
    font-size: 0.725rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.meta-pill.inst-badge {
    background: var(--brand-primary-light);
    color: var(--brand-primary-hover);
    border: 1px solid var(--brand-primary-border);
}

.meta-pill.class-badge {
    background: var(--bg-surface-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.meta-pill.teacher-badge {
    background: var(--info-light);
    color: var(--info);
    border: 1px solid rgba(2, 132, 199, 0.25);
}

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

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

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

.live-clock-icon {
    color: #EF4444;
}

.meet-invite-pill {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.meet-link-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand-primary);
}

.btn-copy-code, .btn-share-trigger {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
}
.btn-copy-code:hover, .btn-share-trigger:hover {
    background: var(--brand-primary-light);
    color: var(--brand-primary);
}

.flash-glow {
    animation: flashGlowAnim 1s 2;
}
@keyframes flashGlowAnim {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
    50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.4); }
}

/* Header Right: Actions */
.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-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.95rem;
}
.icon-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: #CBD5E1;
}

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

/* ==========================================================================
   2. MAIN CLASSROOM GRID LAYOUT
   ========================================================================== */
.classroom-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 16px;
    padding: 16px;
    max-width: 1820px;
    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;
}

/* Theatre Mode & Fullscreen Overrides */
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;
    display: flex;
    flex-direction: column;
    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%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #000;
}
body.theatre-mode .stage-canvas-wrapper {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    width: 100%;
    aspect-ratio: auto;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #000;
}
body.theatre-mode #remoteLiveVideo {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #000;
}
body.theatre-mode .secondary-workspace-card {
    display: none;
}
body.theatre-mode .classroom-sidebar {
    display: flex;
    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;
}

.classroom-container.sidebar-collapsed {
    grid-template-columns: 1fr 0px;
}
.classroom-container.sidebar-collapsed .classroom-sidebar {
    display: none;
}

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

/* 2.1 BROADCAST STAGE CARD */
.broadcast-stage-card {
    background: var(--stage-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    width: 100%;
    height: 100%;
    min-height: 0;
}

.stage-canvas-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    background: #090D16;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#remoteLiveVideo {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #000000;
    display: block;
    position: relative;
    z-index: 2;
    border-radius: inherit;
    transition: object-fit 0.2s ease;
}

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

/* STAGE OVERLAYS */
.unmute-prompt-banner {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    color: #FFFFFF;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 0.825rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    z-index: 30;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    animation: bouncePrompt 1.4s infinite alternate;
}
@keyframes bouncePrompt {
    0% { transform: translateX(-50%) translateY(0); }
    100% { transform: translateX(-50%) translateY(-5px); }
}

/* Spotlight Doubt Overlay */
.spotlight-doubt-overlay {
    position: absolute;
    bottom: 80px;
    left: 20px;
    max-width: 480px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    border: 1.5px solid var(--brand-accent);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: #FFFFFF;
    z-index: 25;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    animation: slideInUp 0.3s ease;
}
@keyframes slideInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.spotlight-badge {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--brand-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.spotlight-q-text {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.4;
    color: #FFFFFF;
}

.spotlight-author {
    font-size: 0.725rem;
    color: #94A3B8;
    margin-top: 4px;
}

.spotlight-dismiss-btn {
    position: absolute;
    top: 6px;
    right: 8px;
    color: #94A3B8;
    font-size: 1.1rem;
    line-height: 1;
}
.spotlight-dismiss-btn:hover {
    color: #FFFFFF;
}

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

.floating-reaction-item {
    position: absolute;
    bottom: 20px;
    font-size: 2.2rem;
    animation: floatUpAnim 2.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0.95;
    user-select: none;
}
@keyframes floatUpAnim {
    0% { transform: translateY(0) scale(0.6) rotate(0deg); opacity: 1; }
    50% { transform: translateY(-160px) scale(1.25) rotate(-12deg); opacity: 0.85; }
    100% { transform: translateY(-340px) scale(0.9) rotate(15deg); opacity: 0; }
}

/* Focus Timer Overlay */
.focus-timer-overlay {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(56, 189, 248, 0.4);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    display: none;
    align-items: center;
    gap: 8px;
    color: #38BDF8;
    font-size: 0.85rem;
    font-weight: 800;
    z-index: 20;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.focus-timer-overlay.active {
    display: flex;
}

/* Captions / Subtitles Overlay */
.video-captions-overlay {
    position: absolute;
    bottom: 74px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #FFFFFF;
    padding: 8px 18px;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 600;
    text-align: center;
    max-width: 80%;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    z-index: 22;
}

/* ==========================================================================
   2.2 STUDENT FLOATING COMMAND ACTION DOCK
   ========================================================================== */
.student-floating-dock {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-glass-dock);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 40;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
    max-width: 95%;
}

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

.dock-divider {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.15);
}

.dock-btn {
    padding: 7px 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #E2E8F0;
    font-size: 0.775rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}
.dock-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.dock-btn.is-active {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: var(--brand-accent);
}

.dock-btn.is-danger {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #FCA5A5;
}
.dock-btn.is-danger:hover {
    background: var(--danger);
    color: #FFFFFF;
}

/* Hand Raise Primary Button */
.btn-hand-raise-student {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.4);
    color: #F59E0B;
}
.btn-hand-raise-student.raised {
    background: rgba(239, 68, 68, 0.3);
    border-color: #EF4444;
    color: #EF4444;
    animation: pulse 1.5s infinite;
}

/* Volume Slider */
.volume-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.volume-slider {
    width: 60px;
    -webkit-appearance: none;
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-full);
}
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #FFFFFF;
    cursor: pointer;
}

/* Emoji Quick Triggers */
.emoji-dock-pill {
    font-size: 1.15rem;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: transform 0.15s ease;
}
.emoji-dock-pill:hover {
    transform: scale(1.35);
    background: rgba(255, 255, 255, 0.15);
}

/* Visibility toggles for desktop vs mobile dock controls */
.dock-desktop-only {
    display: flex;
    align-items: center;
    gap: 6px;
}
.dock-mobile-only {
    display: none;
}
.dock-btn-mobile {
    padding: 7px 12px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition-fast);
}
.dock-btn-mobile:hover, .dock-btn-mobile:active {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}
.dock-btn-mobile.is-active {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.5);
    color: var(--brand-accent);
}

/* Floating Quick Reactions Flyout (Mobile / Tablet) */
.mobile-reactions-flyout {
    position: absolute;
    bottom: 62px;
    left: 50%;
    transform: translateX(-50%) translateY(12px) scale(0.9);
    opacity: 0;
    pointer-events: none;
    background: var(--bg-glass-dock);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    z-index: 45;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-reactions-flyout.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(1);
}
.m-emoji-btn {
    background: none;
    border: none;
    font-size: 1.45rem;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    line-height: 1;
    transition: transform 0.15s ease, background 0.15s ease;
}
.m-emoji-btn:hover, .m-emoji-btn:active {
    transform: scale(1.35);
    background: rgba(255, 255, 255, 0.16);
}
.m-emoji-close-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94A3B8;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}
.m-emoji-close-btn:hover {
    color: #FFFFFF;
    background: rgba(239, 68, 68, 0.4);
    border-color: #EF4444;
}

/* ==========================================================================
   2.2.1 MOBILE BOTTOM ACTION SHEET & DRAWER
   ========================================================================== */
.mobile-action-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.mobile-action-sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.mobile-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;
}
.mobile-action-sheet-overlay.active .mobile-action-sheet {
    transform: translateY(0);
}
.sheet-drag-handle-bar {
    display: flex;
    justify-content: center;
    padding: 10px 0 6px;
    cursor: grab;
}
.sheet-drag-handle {
    width: 44px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
}
.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px 14px;
    border-bottom: 1px solid var(--border-subtle);
}
.sheet-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sheet-header-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    border: 1px solid var(--brand-primary-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}
.sheet-header-title h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.sheet-header-title p {
    font-size: 0.725rem;
    color: var(--text-muted);
    margin: 2px 0 0;
}
.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-volume-card {
    margin: 14px 20px 10px;
    padding: 12px 14px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}
.sheet-volume-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.sheet-volume-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sheet-vol-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-fast);
}
.sheet-vol-btn:hover {
    background: var(--bg-surface-hover);
}
.sheet-volume-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
}
.sheet-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--brand-primary);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.4);
    cursor: pointer;
}
.sheet-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 8px 20px 14px;
}
.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.highlight {
    background: var(--brand-primary-light);
    border-color: var(--brand-primary-border);
}
.sheet-tile-icon {
    width: 38px;
    height: 38px;
    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.1rem;
    margin-bottom: 6px;
}
.sheet-action-tile.highlight .sheet-tile-icon {
    background: var(--brand-primary);
    color: #FFFFFF;
    border-color: var(--brand-primary);
}
.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: 6px 20px;
}
.sheet-leave-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-leave-btn:hover {
    background: var(--danger);
    color: #FFFFFF;
}

/* ==========================================================================
   2.3 INTERACTIVE LIVE POLL OVERLAY MODAL
   ========================================================================== */
.student-poll-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 50;
    width: 380px;
    max-width: calc(100% - 40px);
    animation: slideInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideInDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.student-poll-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.35), 0 0 0 1px rgba(16, 185, 129, 0.25);
    overflow: hidden;
}

.student-poll-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-surface-secondary);
    border-bottom: 1px solid var(--border-color);
}

.poll-icon-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.poll-timer-bar-wrap {
    width: 100%;
    height: 4px;
    background: var(--bg-surface-hover);
}

.poll-timer-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10B981, #F59E0B);
    transition: width 1s linear;
}

.student-poll-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.student-poll-q {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}

.student-poll-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.student-poll-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-surface-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}
.student-poll-opt:hover {
    border-color: var(--brand-primary);
    background: var(--brand-primary-light);
}
.student-poll-opt.selected {
    border-color: var(--brand-primary);
    background: var(--brand-primary-light);
    color: var(--brand-primary-hover);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}
.student-poll-opt.is-correct {
    border-color: #10B981;
    background: #ECFDF5;
    color: #065F46;
}

.student-poll-footer {
    padding: 10px 16px 14px;
    display: flex;
    justify-content: flex-end;
    background: var(--bg-surface-secondary);
    border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   3. UNIFIED SIDEBAR PANES: NOTES, FILES, QUIZ & DOUBT
   ========================================================================== */

/* 3.01 NOTES PANE */
#pane_notes {
    display: none;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    flex: 1 1 0%;
}
#pane_notes.active {
    display: flex;
}
.sidebar-pane-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface-secondary);
    flex-shrink: 0;
}
.sidebar-notes-wrap {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 10px;
}
#pane_notes .student-notes-pad {
    flex: 1 1 0%;
    min-height: 0;
    height: 100%;
    width: 100%;
    resize: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    font-family: inherit;
    font-size: 0.825rem;
    color: var(--text-primary);
    background: var(--bg-surface-secondary);
    line-height: 1.5;
    box-sizing: border-box;
}
#pane_notes .student-notes-pad:focus {
    border-color: var(--brand-accent);
    background: var(--bg-surface);
}

/* 3.02 FILES PANE */
#pane_files {
    padding: 12px;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 0%;
    min-height: 0;
}
#pane_files.active {
    display: flex;
}
#pane_files .files-deck-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 2px;
    flex-shrink: 0;
}
#pane_files .files-search-box {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 6px 10px;
}
#pane_files .files-filter-pills {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}
#pane_files .files-filter-pills::-webkit-scrollbar {
    display: none;
}
#pane_files .class-files-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}
#pane_files .class-file-card {
    padding: 12px;
    border-radius: var(--radius-md);
}

/* 3.03 QUIZ PANE */
#pane_quiz {
    padding: 12px;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 0%;
    min-height: 0;
}
#pane_quiz.active {
    display: flex;
}
#pane_quiz .quiz-engine-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#pane_quiz .quiz-header-card {
    padding: 10px 12px;
    gap: 8px;
}
#pane_quiz .quiz-topic-title {
    font-size: 0.85rem;
}
#pane_quiz .quiz-q-text {
    font-size: 0.875rem;
}
#pane_quiz .quiz-options-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#pane_quiz .quiz-opt-card {
    padding: 10px 12px;
    font-size: 0.8rem;
}
#pane_quiz .quiz-result-card {
    padding: 18px 14px;
    gap: 12px;
}
#pane_quiz .quiz-score-gauge {
    width: 76px;
    height: 76px;
}
#pane_quiz .quiz-score-gauge .score-num {
    font-size: 1.25rem;
}

/* 3.04 DOUBT PANE */
#pane_doubt {
    padding: 12px;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 0%;
    min-height: 0;
}
#pane_doubt.active {
    display: flex;
}
#pane_doubt .deck-doubt-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#pane_doubt .deck-doubt-composer-card {
    padding: 12px;
    flex-shrink: 0;
}
#pane_doubt .deck-doubt-textarea {
    min-height: 56px;
    font-size: 0.8rem;
}
#pane_doubt .deck-doubts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#pane_doubt .deck-doubt-card {
    padding: 10px 12px;
    gap: 6px;
}
#pane_doubt .deck-doubt-body-text {
    font-size: 0.8rem;
}

/* 3.01 CLASS FILES DOWNLOAD SYSTEM */
.files-deck-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.files-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    flex: 1;
    min-width: 240px;
    max-width: 420px;
}
.files-search-box:focus-within {
    border-color: var(--brand-accent);
    background: var(--bg-surface);
}
.files-search-box input {
    border: none;
    background: transparent;
    font-size: 0.825rem;
    width: 100%;
    color: var(--text-primary);
}

.files-filter-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.file-filter-pill {
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}
.file-filter-pill:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}
.file-filter-pill.active {
    background: var(--brand-primary-light);
    border-color: var(--brand-primary-border);
    color: var(--brand-primary);
}

.class-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.class-file-card {
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition-fast);
    position: relative;
}
.class-file-card:hover {
    border-color: var(--brand-primary-border);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    background: var(--bg-surface);
}

.class-file-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.file-type-icon-box {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.file-type-icon-box.pdf {
    background: rgba(239, 68, 68, 0.12);
    color: #EF4444;
}
.file-type-icon-box.slides {
    background: rgba(245, 158, 11, 0.12);
    color: #F59E0B;
}
.file-type-icon-box.doc {
    background: rgba(2, 132, 199, 0.12);
    color: #0284C7;
}

.class-file-info {
    flex: 1;
    min-width: 0;
}
.class-file-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.class-file-desc {
    font-size: 0.725rem;
    color: var(--text-secondary);
    margin-top: 3px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.class-file-metas {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

.class-file-badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.class-file-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
}

.btn-file-download {
    flex: 1;
    padding: 7px 12px;
    border-radius: var(--radius-md);
    background: var(--brand-primary);
    color: #FFFFFF;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition-fast);
}
.btn-file-download:hover {
    background: var(--brand-primary-hover);
    box-shadow: 0 4px 12px var(--brand-glow);
}

.btn-file-preview {
    padding: 7px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition-fast);
}
.btn-file-preview:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--brand-primary);
}

/* 3.02 LIVE DOUBT & QUESTION SYSTEM IN LOWER WORKSPACE */
.deck-doubt-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.deck-doubt-composer-card {
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px;
}

.deck-doubt-textarea {
    flex: 1;
    min-height: 60px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.825rem;
    color: var(--text-primary);
    background: var(--bg-surface);
    resize: none;
    line-height: 1.4;
}
.deck-doubt-textarea:focus {
    border-color: var(--brand-accent);
}

.doubt-tag-chip {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}
.doubt-tag-chip:hover {
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    border-color: var(--brand-primary-border);
}

.deck-doubts-list-wrap {
    display: flex;
    flex-direction: column;
}

.deck-doubts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.deck-doubt-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}
.deck-doubt-card.is-spotlighted {
    border-color: var(--brand-accent);
    background: #F0FDF4;
}
[data-theme="dark"] .deck-doubt-card.is-spotlighted {
    background: #064E3B;
}

.deck-doubt-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
}

.deck-doubt-body-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.deck-doubt-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.btn-upvote-doubt {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border-color);
    font-size: 0.725rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: var(--transition-fast);
}
.btn-upvote-doubt:hover, .btn-upvote-doubt.voted {
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    border-color: var(--brand-primary-border);
}

.student-notes-pad {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-primary);
    background: var(--bg-surface-secondary);
    resize: vertical;
    line-height: 1.5;
}
.student-notes-pad:focus {
    border-color: var(--brand-accent);
    background: var(--bg-surface);
}

/* ==========================================================================
   3.1 LIVE QUIZ SYSTEM & PRACTICE ENGINE
   ========================================================================== */
.quiz-engine-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.quiz-header-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
    gap: 10px;
}

.quiz-topic-title {
    font-size: 0.925rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-meta-pills {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-pill {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.quiz-pill.timer {
    background: #FFFBEB;
    color: #D97706;
    border-color: #FDE68A;
}

.quiz-progress-track {
    width: 100%;
    height: 6px;
    background: var(--border-subtle);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
    transition: width 0.3s ease;
}

.quiz-question-box {
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-q-num {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--brand-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.quiz-q-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.5;
}

.quiz-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 640px) {
    .quiz-options-grid {
        grid-template-columns: 1fr;
    }
}

.quiz-opt-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

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

.quiz-opt-card.selected {
    border-color: var(--brand-primary);
    background: var(--brand-primary-light);
    color: var(--brand-primary-hover);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.quiz-opt-card.is-correct {
    border-color: #10B981 !important;
    background: #ECFDF5 !important;
    color: #065F46 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3) !important;
}

.quiz-opt-card.is-incorrect {
    border-color: #EF4444 !important;
    background: #FEF2F2 !important;
    color: #991B1B !important;
}

.quiz-explanation-box {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: 0.825rem;
    color: #166534;
    line-height: 1.5;
    animation: fadeIn 0.25s ease;
}

.quiz-footer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 6px;
    flex-wrap: wrap;
    gap: 10px;
}

.quiz-result-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 20px;
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    gap: 16px;
}

.quiz-score-gauge {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
}

.quiz-score-gauge .score-num {
    font-size: 1.4rem;
    line-height: 1;
}

.quiz-score-gauge .score-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    opacity: 0.9;
    letter-spacing: 0.05em;
}

.quiz-stats-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.quiz-stat-pill {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

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

.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 6px;
    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;
}

/* CHAT TAB */
.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: var(--brand-primary-hover);
    display: flex;
    align-items: center;
    gap: 8px;
}

.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: #CBD5E1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: #334155;
}
.chat-avatar.is-teacher {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #FFFFFF;
}

.chat-msg-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 85%;
}

.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;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-weight: 700;
}
.chat-role-pill.teacher {
    background: #F59E0B;
    color: #FFFFFF;
}
.chat-role-pill.student {
    background: #E2E8F0;
    color: #475569;
}

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

.chat-bubble {
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border-subtle);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 0.825rem;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-word;
}
.chat-bubble.teacher-styled {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    color: #92400E;
    font-weight: 500;
}

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

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

.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: 3px 6px;
    font-size: 0.95rem;
    border-radius: var(--radius-xs);
}
.chat-emoji-btn:hover {
    background: var(--bg-surface-hover);
}

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

/* ROSTER TAB */
.roster-header-bar {
    padding: 10px 12px;
    background: var(--bg-surface-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.775rem;
    font-weight: 700;
}

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

.roster-row-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border-subtle);
}

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

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

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

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

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

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

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

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

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

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

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

.qna-answer-box {
    background: var(--brand-primary-light);
    border-left: 3px solid var(--brand-primary);
    padding: 8px 10px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.775rem;
    color: #064E3B;
}

.badge-status-qna {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--radius-full);
}
.badge-status-qna.answered {
    background: #ECFDF5;
    color: #065F46;
}
.badge-status-qna.pending {
    background: #FFFBEB;
    color: #92400E;
}

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

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

.ai-prompt-chip {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.725rem;
    font-weight: 700;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}
.ai-prompt-chip:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: var(--brand-primary-light);
}

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

.ai-bubble {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    color: #166534;
    line-height: 1.5;
}

/* FILES TAB */
.files-shelf-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

/* ==========================================================================
   5. PRE-FLIGHT JOIN LOBBY MODAL
   ========================================================================== */
.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.85);
    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;
}

.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: sLobbyScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes sLobbyScaleIn {
    0% { transform: scale(0.95) translateY(16px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.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-secondary);
}

.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: 800;
    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;
}

.lobby-close-btn {
    font-size: 1.75rem;
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: 8px;
}
.lobby-close-btn:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}

.lobby-body-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 20px;
    padding: 20px 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.lobby-form-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

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

.s-code-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.s-code-input {
    flex: 1;
    padding: 12px 14px;
    font-size: 0.95rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--brand-primary-hover);
    background: var(--bg-surface-secondary);
    border: 1.5px solid var(--brand-primary-border);
    border-radius: 10px;
    outline: none;
    transition: all var(--transition-fast);
}
.s-code-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
    background: #FFFFFF;
}

.btn-paste-code {
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--brand-primary);
    background: var(--brand-primary-light);
    border: 1px solid var(--brand-primary-border);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-paste-code:hover {
    background: var(--brand-primary);
    color: #FFFFFF;
}

.active-classes-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.active-classes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.active-rooms-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 190px;
    overflow-y: auto;
}

.room-card-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.room-card-item:hover, .room-card-item.selected {
    border-color: var(--brand-primary);
    background: var(--brand-primary-light);
}

.room-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.room-card-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-card-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-quick-join {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 800;
    color: #FFFFFF;
    background: var(--brand-primary);
    border-radius: 6px;
    flex-shrink: 0;
}

/* Lobby Right Column */
.lobby-preview-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lobby-preview-card {
    background: var(--bg-surface-secondary);
    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;
}

#studentLobbyPreviewVideo {
    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: 700;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.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;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}
.preview-ctrl-btn.is-muted, .preview-ctrl-btn.is-off {
    background: rgba(239, 68, 68, 0.9);
    border-color: #EF4444;
}

.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: 8px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.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-secondary);
}

.btn-start-live-studio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 24px;
    font-size: 0.9375rem;
    font-weight: 800;
    color: #FFFFFF;
    background: linear-gradient(135deg, #059669 0%, #10B981 100%);
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.btn-start-live-studio:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

/* ==========================================================================
   6. MODAL DIALOGS
   ========================================================================== */
.modal-backdrop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    padding: 20px;
}
.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: 480px;
    padding: 22px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transform: translateY(12px);
    transition: transform 0.2s ease;
}
.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.05rem;
    font-weight: 800;
}
.modal-close-x {
    font-size: 1.4rem;
    color: var(--text-muted);
}
.modal-close-x:hover {
    color: var(--text-primary);
}

/* Toast Container */
#studioToastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 99999;
    pointer-events: none;
}

/* RESPONSIVE DESIGN BREAKPOINTS */
@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;
    }
    .stage-canvas-wrapper {
        width: 100%;
        aspect-ratio: 16 / 9;
        min-height: 240px;
        max-height: 62vh;
        position: relative;
        overflow: hidden;
    }
    #remoteLiveVideo {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        display: block;
    }
    .classroom-sidebar {
        height: 520px;
        position: static;
    }
    .header-center {
        display: none;
    }
    body.theatre-mode .classroom-container {
        grid-template-columns: 1fr;
        grid-template-rows: 58% 42%;
        height: calc(100vh - 68px);
        max-height: calc(100vh - 68px);
        overflow: hidden;
    }
    body.theatre-mode .classroom-sidebar {
        height: 100%;
        max-height: 100%;
        min-height: 0;
        overflow: hidden;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
}

@media (max-width: 860px) {
    .dock-desktop-only {
        display: none !important;
    }
    .dock-divider-desktop {
        display: none !important;
    }
    .dock-mobile-only {
        display: flex !important;
        align-items: center;
        gap: 6px;
    }
    .mobile-reactions-flyout {
        display: flex;
    }
    .mobile-action-sheet-overlay {
        display: flex;
    }
    .student-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);
        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;
    }
    .btn-hand-raise-student {
        border-radius: var(--radius-full);
        padding: 7px 14px;
    }
}

@media (max-width: 768px) {
    .classroom-header {
        height: 58px;
        padding: 0 12px;
    }
    .header-left {
        gap: 8px;
    }
    .header-class-title {
        font-size: 0.875rem;
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .title-sub-row {
        display: none;
    }
    .lobby-body-grid {
        grid-template-columns: 1fr;
        padding: 14px;
    }
    .overview-grid {
        grid-template-columns: 1fr;
    }
    .stage-canvas-wrapper {
        width: 100%;
        aspect-ratio: 16 / 9;
        min-height: 200px;
        max-height: 52vh;
    }
    #remoteLiveVideo {
        width: 100%;
        height: 100%;
        max-height: 100%;
        object-fit: contain;
    }
    .workspace-deck-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .workspace-deck-tabs::-webkit-scrollbar {
        display: none;
    }
    .w-deck-tabs-left {
        flex-shrink: 0;
    }
    .dock-btn span {
        display: none;
    }
    .btn-hand-raise-student span {
        display: inline-block !important;
        font-size: 0.72rem;
    }
    .dock-btn-mobile span {
        display: inline-block !important;
        font-size: 0.72rem;
    }
    .chat-composer-box {
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 480px) {
    .classroom-header {
        height: 52px;
        padding: 0 8px;
    }
    .back-btn, .icon-btn {
        width: 34px;
        height: 34px;
        font-size: 0.8rem;
    }
    .live-status-pill {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
    .header-class-title {
        font-size: 0.8rem;
        max-width: 135px;
    }
    .classroom-container {
        padding: 6px;
        gap: 8px;
    }
    .broadcast-stage-card {
        border-radius: var(--radius-md);
    }
    .stage-canvas-wrapper {
        width: 100%;
        aspect-ratio: 16 / 9;
        min-height: 180px;
        max-height: 48vh;
        border-radius: var(--radius-md);
    }
    #remoteLiveVideo {
        width: 100%;
        height: 100%;
        max-height: 100%;
        object-fit: contain;
    }
    .student-floating-dock {
        padding: 5px 8px;
        gap: 4px;
        max-width: calc(100% - 12px);
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }
    .dock-divider-core {
        height: 16px;
        margin: 0 1px;
    }
    .dock-btn {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        font-size: 0.775rem;
    }
    .dock-btn span {
        display: none !important;
    }
    .btn-hand-raise-student span {
        display: inline-block !important;
        font-size: 0.7rem;
    }
    .dock-btn-mobile span {
        display: none !important;
    }
    .dock-btn-mobile {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
    }
    .w-deck-btn {
        padding: 6px 9px;
        font-size: 0.75rem;
    }
    .workspace-deck-body {
        padding: 10px;
    }
    .modal-dialog-box {
        padding: 14px;
    }
    .sheet-actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 4px 14px 14px;
    }
    .sheet-volume-card {
        margin: 10px 14px 8px;
        padding: 10px 12px;
    }
    .sheet-header {
        padding: 8px 14px 12px;
    }
    .sheet-footer {
        padding: 4px 14px;
    }
}

/* ==========================================================================
   MOBILE LANDSCAPE ORIENTATION ADAPTATION
   ========================================================================== */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 520px) {
    .classroom-container {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto !important;
        height: auto !important;
        padding: 4px !important;
    }
    .broadcast-stage-card {
        height: 86vh !important;
        max-height: 86vh !important;
    }
    .stage-canvas-wrapper {
        aspect-ratio: auto !important;
        height: 100% !important;
        max-height: 100% !important;
    }
    #remoteLiveVideo {
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        object-fit: contain !important;
    }
}
