body {
            font-family: 'Nunito', sans-serif;
            background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 50%, #fef3c7 100%);
            min-height: 100vh;
            user-select: none;
        }

        h1, h2, h3, .font-fun {
            font-family: 'Fredoka', sans-serif;
        }

        /* 3D Soft Buttons */
        .btn-3d {
            transition: all 0.15s ease;
            box-shadow: 0 5px 0 var(--tw-shadow-color, #cbd5e1);
        }
        .btn-3d:active {
            transform: translateY(3px);
            box-shadow: 0 2px 0 var(--tw-shadow-color, #cbd5e1);
        }

        /* Bouncy Animation */
        @keyframes bounce-slow {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-6px); }
        }
        .animate-bounce-slow {
            animation: bounce-slow 3s infinite ease-in-out;
        }

        /* Glassmorphism Soft Card */
        .card-kid {
            background: rgba(255, 255, 255, 0.94);
            backdrop-filter: blur(12px);
            border: 4px solid #ffffff;
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
            border-radius: 1.75rem;
        }

        /* Drag & Drop Visual Target Styles */
        .drag-target {
            min-height: 50px;
            border: 2px dashed #94a3b8;
            transition: all 0.2s ease;
        }
        .drag-target.drag-over {
            border-color: #06D6A0;
            background-color: #ecfdf5;
        }

        /* Responsive Mobile Bottom Nav Offset */
        @media (max-width: 768px) {
            .mobile-bottom-nav-padding {
                padding-bottom: 5rem;
            }
        }

        /* Custom Scrollbar */
        ::-webkit-scrollbar {
            width: 8px;
        }
        ::-webkit-scrollbar-track {
            background: #f1f5f9;
            border-radius: 10px;
        }
        ::-webkit-scrollbar-thumb {
            background: #70D6FF;
            border-radius: 10px;
        }

        /* Distraction-free full-screen Live Teaching layout */
        body.live-teaching-mode {
            padding-bottom: 0 !important;
            overflow: hidden;
            background: #f8fafc;
        }
        body.live-teaching-mode #app {
            max-width: none !important;
            width: 100vw;
            height: 100vh;
            margin: 0 !important;
            padding: 0 !important;
            overflow: hidden;
        }
        body.live-teaching-mode #main-header,
        body.live-teaching-mode #student-nav,
        body.live-teaching-mode #teacher-nav {
            display: none !important;
        }
        body.live-teaching-mode #view-teacher-live-session {
            display: block !important;
            height: 100vh;
            margin: 0 !important;
            padding: 0.75rem;
            overflow-y: auto;
            overscroll-behavior: contain;
        }
        body.live-teaching-mode #view-teacher-live-session > :first-child {
            top: 0;
        }
        @media (min-width: 1280px) {
            body.live-teaching-mode #view-teacher-live-session {
                padding: 1rem;
            }
            body.live-teaching-mode #view-teacher-live-session > .grid {
                min-height: calc(100vh - 116px);
            }
        }


        /* Compact Live Teaching action bar — aligns actions with the class name. */
        .live-session-header {
            container-type: inline-size;
            overflow: visible !important;
        }
        .mv-live-header-row {
            display: flex;
            align-items: center;
            gap: .85rem;
            min-width: 0;
        }
        .mv-live-header-copy {
            flex: 1 1 auto;
            min-width: 0;
        }
        .mv-live-title-line {
            display: flex;
            align-items: center;
            gap: .85rem;
            min-width: 0;
            margin-top: .15rem;
        }
        .mv-live-title-line #live-class-title {
            flex: 0 1 auto;
            min-width: 0;
            max-width: 38%;
        }
        .mv-live-header-actions {
            margin-left: auto;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: .5rem;
            flex-wrap: nowrap;
            min-width: 0;
        }
        .mv-live-header-actions > button {
            white-space: nowrap;
            flex: 0 0 auto;
        }
        .mv-live-actions-toggle {
            display: none;
            width: 2.75rem;
            height: 2.75rem;
            flex: 0 0 2.75rem;
            align-items: center;
            justify-content: center;
            border-radius: .9rem;
            border: 1px solid #cbd5e1;
            background: #f8fafc;
            color: #334155;
            font-size: 1.05rem;
            box-shadow: 0 7px 18px rgba(15,23,42,.08);
            transition: transform .16s ease, background .16s ease;
        }
        .mv-live-actions-toggle:hover { background: #f1f5f9; }
        .mv-live-actions-toggle:active { transform: scale(.96); }
        @container (max-width: 1110px) {
            .mv-live-title-line #live-class-title {
                flex: 1 1 auto;
                max-width: none;
            }
            .mv-live-actions-toggle { display: inline-flex; margin-left: auto; }
            .mv-live-header-actions {
                display: none;
                position: absolute;
                top: calc(100% + .55rem);
                right: .85rem;
                width: min(19rem, calc(100vw - 1.5rem));
                margin: 0;
                padding: .7rem;
                border: 1px solid #dbe4ee;
                border-radius: 1.15rem;
                background: rgba(255,255,255,.98);
                box-shadow: 0 22px 48px rgba(15,23,42,.18);
                flex-direction: column;
                align-items: stretch;
                gap: .45rem;
                z-index: 80;
                backdrop-filter: blur(12px);
            }
            .mv-live-header-actions.is-open { display: flex; }
            .mv-live-header-actions > button {
                width: 100%;
                justify-content: flex-start;
                padding: .72rem .9rem;
                border-radius: .85rem;
                font-size: .78rem;
            }
        }
        @container (max-width: 560px) {
            .mv-live-header-row { align-items: flex-start; gap: .65rem; }
            .mv-live-header-row > .w-12 { width: 2.6rem; height: 2.6rem; border-radius: .85rem; }
            .mv-live-title-line { gap: .5rem; }
            .mv-live-actions-toggle { width: 2.55rem; height: 2.55rem; flex-basis: 2.55rem; }
        }

        /* Embedded lesson workspace — MathVenture v2.4 */
        body.live-teaching-mode #view-teacher-live-session {
            display: flex !important;
            flex-direction: column;
            gap: 0.75rem;
            height: 100vh;
            overflow: hidden;
        }
        body.live-teaching-mode #view-teacher-live-session > .live-session-header {
            flex: 0 0 auto;
        }
        #embedded-live-shell {
            flex: 1 1 auto;
            min-height: 0;
        }
        .embedded-lesson-card {
            height: 100%;
            min-height: 520px;
            background: #f8fbff;
            border: 4px solid #ffffff;
            border-radius: 1.6rem;
            box-shadow: 0 14px 32px -12px rgba(29,53,87,.18);
            overflow: hidden;
            position: relative;
        }
        #live-lesson-frame {
            display: block;
            width: 100%;
            height: 100%;
            min-height: 520px;
            border: 0;
            background: #f8fbff;
        }
        #embedded-lesson-loading {
            position: absolute;
            inset: 0;
            display: grid;
            place-items: center;
            background: linear-gradient(135deg,#eff9ff,#fffaf0);
            z-index: 2;
            transition: opacity .2s ease;
        }
        #embedded-lesson-loading.is-hidden {
            opacity: 0;
            pointer-events: none;
        }
        .lesson-loading-orbit {
            width: 62px;
            height: 62px;
            border-radius: 22px;
            display: grid;
            place-items: center;
            background: linear-gradient(145deg,#70D6FF,#4EA8DE);
            color: white;
            font-size: 28px;
            box-shadow: 0 12px 25px rgba(78,168,222,.28);
            animation: bounce-slow 2s infinite ease-in-out;
        }
        @media (max-width: 768px) {
            body.live-teaching-mode #view-teacher-live-session { padding: .5rem; gap: .5rem; }
            .embedded-lesson-card { border-radius: 1.15rem; min-height: 440px; }
            #live-lesson-frame { min-height: 440px; }
        }


        /* Reusable student report cards: screen and print use the same visual structure */
        .student-report-card {
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 1.5rem;
            padding: 1.25rem;
            box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
            break-inside: avoid;
            page-break-inside: avoid;
        }
        .student-report-metrics {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
            gap: .6rem;
            margin-top: 1rem;
        }
        .student-report-metric {
            border-radius: 1rem;
            padding: .8rem .9rem;
            min-height: 72px;
        }
        .student-report-metric-label {
            font-size: .58rem;
            line-height: 1;
            text-transform: uppercase;
            letter-spacing: .045em;
            font-weight: 900;
            margin-bottom: .45rem;
        }
        .student-report-metric-value {
            color: #1e293b;
            font-family: 'Fredoka', sans-serif;
            font-size: 1.02rem;
            line-height: 1.2;
            font-weight: 700;
        }
        .student-report-skill {
            border-radius: .9rem;
            padding: .7rem .8rem;
            border: 1px solid #e2e8f0;
            background: #fff;
        }
        .student-report-narrative {
            margin-top: 1rem;
            border-radius: 1rem;
            padding: 1rem;
            background: #f8fafc;
            border: 1px solid #e2e8f0;
        }
        @media (max-width: 640px) {
            .student-report-card { padding: 1rem; border-radius: 1.2rem; }
            .student-report-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
        }


/* v3.2.5 live/dashboard layering guard. Hidden views must never remain above Dashboard. */
#view-teacher-live-session.hidden { display:none !important; }
body:not(.live-teaching-mode) #view-teacher-live-session.hidden { display:none !important; }
