        * { font-family: "Inter", sans-serif; }
        .brand-font { font-family: "Outfit", sans-serif; }
        html, body { height: 100%; overflow: hidden; margin: 0; padding: 0; }
        body { background: #0a0a0f; }
        #app { height: 100%; overflow: hidden; background: #0a0a0f; }
        .glass { background: rgba(20, 20, 24, 0.95); backdrop-filter: blur(20px); }
        .sidebar { width: 280px; min-width: 280px; overflow: hidden; }
        .sidebar::-webkit-scrollbar { display: none; }
        .sidebar * { scrollbar-width: none; }
        .sidebar *::-webkit-scrollbar { display: none; }
        .chat-container::-webkit-scrollbar { width: 6px; }
        .chat-container::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
        .chat-container::-webkit-scrollbar-track { background: transparent; }
        .typing-indicator span { animation: bounce 1.4s infinite ease-in-out; }
        .typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
        .typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
        @keyframes bounce {
            0%, 80%, 100% { transform: translateY(0); }
            40% { transform: translateY(-6px); }
        }
        .au-gradient { background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 50%, #3d7ab5 100%); }
        .subject-btn { transition: all 0.2s; opacity: 0.6; }
        .subject-btn:hover { opacity: 0.9; }
        .subject-btn.active { opacity: 1; box-shadow: 0 0 0 2px #fff; }
        .mode-btn { transition: all 0.2s; }
        .mode-btn.active { background: rgba(6, 182, 212, 0.2); color: #06b6d4; }
        .history-item:hover { background: rgba(255, 255, 255, 0.05); }
        .katex { font-size: 1.1em; color: #67e8f9; }
        .formula-box {
            background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(139, 92, 246, 0.1));
            border: 1px solid rgba(6, 182, 212, 0.3);
            border-radius: 8px;
            padding: 0.75rem 1rem;
            margin: 0.5rem 0;
        }
        .answer-content { word-wrap: break-word; overflow-wrap: break-word; word-break: break-word; max-width: 100%; }
        .answer-content p { margin: 0.5em 0; line-height: 1.7; }
        .answer-content pre { white-space: pre-wrap; word-wrap: break-word; overflow-x: auto; max-width: 100%; }

        /* ── PaperBanana Diagram Loading & Display ── */
        .diagram-loading {
            background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
            border: 1px solid #334155; border-radius: 16px; padding: 24px; margin: 16px 0;
            text-align: center; position: relative; overflow: hidden;
        }
        .diagram-loading::before {
            content: ''; position: absolute; top: 0; left: -100%; width: 200%; height: 100%;
            background: linear-gradient(90deg, transparent, rgba(6,182,212,0.08), transparent);
            animation: diagramShimmer 2s ease-in-out infinite;
        }
        @keyframes diagramShimmer { 0% { left: -100%; } 100% { left: 100%; } }
        .diagram-loading-icon {
            font-size: 40px; margin-bottom: 12px;
            animation: diagramPulse 1.5s ease-in-out infinite;
        }
        @keyframes diagramPulse { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.15); opacity: 1; } }
        .diagram-loading-text { color: #22d3ee; font-size: 14px; font-weight: 600; letter-spacing: 0.5px; }
        .diagram-loading-sub { color: #64748b; font-size: 12px; margin-top: 6px; }
        .diagram-loading-dots::after {
            content: ''; animation: loadDots 1.5s steps(4, end) infinite;
        }
        @keyframes loadDots {
            0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; }
        }
        .diagram-result {
            border: 1px solid #1e3a5f; border-radius: 16px; margin: 16px 0; overflow: hidden;
            background: linear-gradient(180deg, #0c1929 0%, #111827 100%);
            box-shadow: 0 4px 24px rgba(6,182,212,0.1);
            animation: diagramFadeIn 0.6s ease-out;
        }
        @keyframes diagramFadeIn { 0% { opacity: 0; transform: translateY(12px); } 100% { opacity: 1; transform: translateY(0); } }
        .diagram-result-header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 12px 16px; border-bottom: 1px solid #1e293b;
            background: rgba(6,182,212,0.05);
        }
        .diagram-result-header span { color: #22d3ee; font-size: 13px; font-weight: 600; }
        .diagram-result-actions { display: flex; gap: 8px; }
        .diagram-result-actions button {
            background: rgba(255,255,255,0.05); border: 1px solid #334155; border-radius: 8px;
            color: #94a3b8; font-size: 11px; padding: 4px 10px; cursor: pointer; transition: all 0.2s;
        }
        .diagram-result-actions button:hover { background: rgba(6,182,212,0.15); color: #22d3ee; border-color: #22d3ee; }
        .diagram-result img {
            width: 100%; display: block; cursor: zoom-in; transition: transform 0.3s;
        }
        .diagram-result img:hover { transform: scale(1.02); }
        .diagram-result-badge {
            display: inline-flex; align-items: center; gap: 4px; padding: 10px 16px;
            font-size: 11px; color: #64748b;
        }
        .diagram-result-badge img { width: 14px; height: 14px; border-radius: 3px; }

        /* Diagram zoom overlay */
        .diagram-zoom-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999;
            background: rgba(0,0,0,0.9); display: flex; align-items: center; justify-content: center;
            cursor: zoom-out; animation: fadeIn 0.2s;
        }
        .diagram-zoom-overlay img { max-width: 95vw; max-height: 95vh; border-radius: 12px; box-shadow: 0 8px 40px rgba(0,0,0,0.5); }
        @keyframes fadeIn { 0% { opacity: 0; } 100% { opacity: 1; } }
        @keyframes diagramProgress { 0% { width: 15%; margin-left: 0; } 50% { width: 45%; margin-left: 30%; } 100% { width: 15%; margin-left: 85%; } }
        .message-bubble { max-width: 100%; overflow: visible; }
        .follow-up-btn { display: block; width: 100%; text-align: left; margin-bottom: 0.5rem; white-space: normal; word-wrap: break-word; line-height: 1.5; }
        /* ═══ Enhanced Dashboard Styles ═══ */
        .dash-ring { transform: rotate(-90deg); }
        .dash-ring-track { fill: none; stroke: #1f2937; stroke-width: 6; }
        .dash-ring-fill { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
        .dash-card { background: rgba(17, 17, 21, 0.9); border: 1px solid rgba(255,255,255,0.06); border-radius: 1rem; transition: all 0.3s ease; }
        .dash-card:hover { border-color: rgba(6, 182, 212, 0.3); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
        .dash-stat { background: linear-gradient(135deg, rgba(20,20,28,0.95), rgba(15,15,20,0.95)); border: 1px solid rgba(255,255,255,0.06); border-radius: 1rem; position: relative; overflow: hidden; }
        .dash-stat::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
        .dash-stat-cyan::before { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
        .dash-stat-green::before { background: linear-gradient(90deg, #10b981, #34d399); }
        .dash-stat-purple::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
        .dash-stat-amber::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
        .unit-dot { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; transition: all 0.2s; }
        .unit-dot-done { background: rgba(6, 182, 212, 0.25); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.4); }
        .unit-dot-empty { background: rgba(255,255,255,0.03); color: #4b5563; border: 1px solid rgba(255,255,255,0.06); }
        .unit-dot-empty:hover { background: rgba(6, 182, 212, 0.08); color: #9ca3af; border-color: rgba(6, 182, 212, 0.2); cursor: pointer; }
        .mastery-badge { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; }
        .mastery-novice { background: rgba(107,114,128,0.2); color: #9ca3af; }
        .mastery-learner { background: rgba(59,130,246,0.15); color: #60a5fa; }
        .mastery-proficient { background: rgba(6,182,212,0.15); color: #22d3ee; }
        .mastery-expert { background: rgba(245,158,11,0.15); color: #fbbf24; }
        .gap-btn { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); color: #fca5a5; border-radius: 0.5rem; padding: 0.35rem 0.75rem; font-size: 12px; transition: all 0.2s; cursor: pointer; }
        .gap-btn:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); color: #fff; }
        .timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: #06b6d4; flex-shrink: 0; margin-top: 6px; }
        .timeline-line { width: 2px; background: rgba(6,182,212,0.15); margin-left: 3px; min-height: 20px; }
        .readiness-bar { height: 6px; border-radius: 3px; background: #1f2937; overflow: hidden; }
        .readiness-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; }
        .dash-expand { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
        .dash-expand.open { max-height: 600px; }
        .dash-section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: #6b7280; margin-bottom: 0.75rem; }
        /* Onboarding styles */
        .onboard-bg {
            background: radial-gradient(ellipse at 20% 50%, rgba(6, 182, 212, 0.08) 0%, transparent 50%),
                        radial-gradient(ellipse at 80% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
                        #0a0a0f;
        }
        .region-card {
            position: relative;
            border: 2px solid rgba(255,255,255,0.08);
            border-radius: 1.25rem;
            padding: 2rem 1.5rem;
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            background: rgba(255,255,255,0.03);
            overflow: hidden;
        }
        .region-card:hover {
            border-color: rgba(6, 182, 212, 0.5);
            background: rgba(6, 182, 212, 0.06);
            transform: translateY(-4px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.3), 0 0 30px rgba(6, 182, 212, 0.1);
        }
        .region-card.selected {
            border-color: #06b6d4;
            background: rgba(6, 182, 212, 0.1);
            box-shadow: 0 0 30px rgba(6, 182, 212, 0.15);
        }
        .region-card svg, .region-card img { transition: transform 0.4s; }
        .region-card:hover svg, .region-card:hover img { transform: scale(1.05); }
        @keyframes fadeInUp {
            from { opacity: 0; transform: translateY(30px); }
            to { opacity: 1; transform: translateY(0); }
        }
        @keyframes pulse-glow {
            0%, 100% { opacity: 0.4; }
            50% { opacity: 0.8; }
        }
        .animate-fade-in { animation: fadeInUp 0.6s ease-out forwards; }
        .animate-delay-1 { animation-delay: 0.15s; opacity: 0; }
        .animate-delay-2 { animation-delay: 0.3s; opacity: 0; }
        .animate-delay-3 { animation-delay: 0.45s; opacity: 0; }
        .onboard-select {
            width: 100%;
            background: #111118;
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 0.75rem;
            padding: 0.75rem 1rem;
            color: white;
            font-size: 0.875rem;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 0.75rem center;
            cursor: pointer;
            transition: border-color 0.2s;
        }
        .onboard-select:focus { outline: none; border-color: #06b6d4; }
        .onboard-select option { background: #111118; color: white; }
        .btn-primary {
            background: linear-gradient(135deg, #0891b2 0%, #06b6d4 50%, #22d3ee 100%);
            color: white;
            font-weight: 600;
            padding: 0.75rem 2rem;
            border-radius: 0.75rem;
            border: none;
            cursor: pointer;
            font-size: 0.95rem;
            transition: all 0.3s;
            letter-spacing: 0.02em;
        }
        .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 25px rgba(6, 182, 212, 0.3); }
        .btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
        .step-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.15); transition: all 0.3s; }
        .step-dot.active { background: #06b6d4; width: 24px; border-radius: 4px; }
        /* Streamlined auth styles */
        .auth-card { max-height: 92vh; overflow-y: auto; }
        .auth-card::-webkit-scrollbar { width: 4px; }
        .auth-card::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }
        .region-toggle { display: inline-flex; border: 1px solid rgba(255,255,255,0.1); border-radius: 0.75rem; overflow: hidden; }
        .region-toggle button { padding: 0.5rem 1.25rem; font-size: 0.8rem; color: #888; background: transparent; border: none; cursor: pointer; transition: all 0.2s; }
        .region-toggle button.active { background: rgba(6,182,212,0.15); color: #06b6d4; }
        .id-upload-zone { border: 2px dashed rgba(6,182,212,0.3); border-radius: 1rem; padding: 1.25rem; text-align: center; cursor: pointer; transition: all 0.3s; }
        .id-upload-zone:hover { border-color: rgba(6,182,212,0.6); background: rgba(6,182,212,0.03); }
        .id-upload-zone.processing { border-color: #06b6d4; background: rgba(6,182,212,0.06); pointer-events: none; }
        .divider-text { display: flex; align-items: center; gap: 0.75rem; color: #555; font-size: 0.75rem; margin: 1rem 0; }
        .divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: #333; }
        .biometric-btn { display: flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; padding: 0.75rem; border-radius: 0.75rem; border: 1px solid rgba(139,92,246,0.4); background: rgba(139,92,246,0.08); color: #a78bfa; font-weight: 500; cursor: pointer; transition: all 0.3s; font-size: 0.9rem; }
        .biometric-btn:hover { background: rgba(139,92,246,0.15); border-color: rgba(139,92,246,0.6); }
        .landing-btn { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 2rem; border-radius: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s; border: none; font-size: 0.95rem; min-width: 240px; }
        .landing-btn:hover { transform: translateY(-2px); }
        .cascade-dd { transition: all 0.3s; }
        @keyframes spin-fast { to { transform: rotate(360deg); } }
        .ocr-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #06b6d4; border-top-color: transparent; border-radius: 50%; animation: spin-fast 0.8s linear infinite; vertical-align: middle; }
