        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html, body {
            position: fixed;
            width: 100%;
            height: 100%;
            overflow: hidden;
            overscroll-behavior: none;
            background: #E8E8E6;
        }
        body {
            font-family: 'Karla', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            background: #E8E8E6;
            color: #2D2D2D;
            line-height: 1.5;
            touch-action: none;
        }
        body.dark, html:has(body.dark) { background: #1a1a1a; }

        .app-container {
            position: relative;
            max-width: 800px;
            margin: 0 auto;
            padding: 24px;
            padding-top: max(32px, env(safe-area-inset-top));
            padding-bottom: max(16px, env(safe-area-inset-bottom));
            height: 100vh;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            overflow: hidden;
        }

        /* Neumorphic Styles */
        .neu-card {
            background: #E8E8E6;
            border-radius: 20px;
            box-shadow: 8px 8px 16px #c5c5c3, -8px -8px 16px #ffffff;
            padding: 32px 24px;
        }

        .neu-btn {
            background: #E8E8E6;
            border-radius: 50%;
            box-shadow: 6px 6px 12px #d1d1cf, -6px -6px 12px #ffffff;
            border: none;
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .neu-btn:active {
            box-shadow: inset 3px 3px 6px #d1d1cf, inset -3px -3px 6px #ffffff;
        }

        /* Button Styles */
        .btn-primary {
            background: #F04E23;
            color: white;
            border: none;
            padding: 18px;
            border-radius: 16px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.15s ease;
            width: 100%;
            letter-spacing: 1px;
            box-shadow: 0 4px 12px rgba(240,78,35,0.3);
        }

        .btn-primary:hover { opacity: 0.9; }
        .btn-primary:active { opacity: 0.8; }
        .btn-primary:disabled { background: #D5D5D3; color: #999; cursor: not-allowed; }

        .btn-secondary {
            background: #E8E8E6;
            color: #555;
            border: none;
            padding: 18px;
            border-radius: 16px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            box-shadow: 4px 4px 8px #c5c5c3, -4px -4px 8px #ffffff;
            transition: all 0.2s ease;
            width: 100%;
            letter-spacing: 1px;
        }

        /* Quiz Choice Buttons */
        .quiz-choice-btn {
            padding: 16px 20px;
            border-radius: 14px;
            border: none;
            cursor: pointer;
            font-size: 18px;
            font-family: inherit;
            font-weight: 500;
            color: #333;
            background: #E8E8E6;
            box-shadow: 4px 4px 8px #c5c5c3, -4px -4px 8px #ffffff;
            transition: all 0.15s ease;
            text-align: left;
            width: 100%;
        }
        .quiz-choice-btn:hover:not(:disabled) { box-shadow: 2px 2px 4px #c5c5c3, -2px -2px 4px #ffffff; }
        .quiz-choice-btn:active:not(:disabled) { box-shadow: inset 2px 2px 4px #c5c5c3, inset -2px -2px 4px #ffffff; }
        .quiz-choice-btn.correct { background: #4A7C59 !important; color: white !important; box-shadow: none; }
        .quiz-choice-btn.wrong { background: #C44536 !important; color: white !important; box-shadow: none; }
        .quiz-choice-btn:disabled { cursor: not-allowed; opacity: 0.7; }

        /* Progress Dots */
        .progress-dots {
            display: flex;
            gap: 6px;
            justify-content: center;
            margin-top: 12px;
            flex-wrap: wrap;
        }

        .dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #D0D0CE;
            transition: all 0.3s ease;
        }

        .dot.active { background: #F04E23; width: 20px; border-radius: 4px; }
        .dot.completed { background: #4A7C59; }
        .dot.wrong { background: #C44536; }

        /* Page Sections */
        .page {
            display: none;
            visibility: hidden;
            animation: fadeIn 0.3s ease;
            overflow: hidden;
            position: absolute;
            top: -9999px;
            left: -9999px;
            opacity: 0;
        }
        .page.active {
            display: flex;
            flex-direction: column;
            visibility: visible;
            position: relative;
            top: auto;
            left: auto;
            opacity: 1;
            flex: 1;
            min-height: 0;
            overflow: visible;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        /* Feedback overlay */
        .feedback-overlay {
            position: absolute;
            top: 8px; left: 50%;
            transform: translateX(-50%) translateY(-150%);
            width: 160px;
            text-align: center;
            padding: 8px 0;
            font-size: 14px;
            font-weight: 700;
            letter-spacing: 1px;
            color: white;
            border-radius: 12px;
            z-index: 100;
            pointer-events: none;
            opacity: 0;
            transition: transform 0.25s ease, opacity 0.25s ease;
        }

        .feedback-overlay.show { transform: translateX(-50%) translateY(0); opacity: 1; }
        .feedback-overlay.correct { background: #4A7C59; }
        .feedback-overlay.wrong { background: #C44536; }

        /* Navigation */
        /* Word Display - Compact Layout */
        .word-display { text-align: center; display: flex; flex-direction: column; align-items: center; width: 100%; will-change: transform, opacity; }
        .word-display.swiping { transition: none; }
        .word-display.swipe-out { transition: transform 0.2s ease-out, opacity 0.2s ease-out; }
        .word-display.swipe-in { transition: transform 0.25s ease-out, opacity 0.25s ease-out; }
        .tutorial-step-page { will-change: transform, opacity; }
        .tutorial-step-page.swiping { transition: none; }
        .tutorial-step-page.swipe-out { transition: transform 0.2s ease-out, opacity 0.2s ease-out; }
        .tutorial-step-page.swipe-in { transition: transform 0.25s ease-out, opacity 0.25s ease-out; }
        .word-progress { font-size: 15px; font-weight: 600; color: #aaa; letter-spacing: 0.5px; }

        .word-image {
            width: 280px;
            height: 280px;
            margin: 0 auto;
            cursor: pointer;
        }

        .word-image img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .word-text {
            font-size: 36px;
            font-weight: 700;
            margin: 4px 0;
            cursor: pointer;
        }

        .word-hint {
            font-size: 16px;
            color: #666;
            min-height: 20px;
            margin-bottom: 16px;
        }

        .word-hint.hidden { visibility: hidden; }

        .scene-verb { font-weight: 700; }
        .scene-kv { color: #F04E23; font-weight: 600; }

        /* Conjugation display */
        .conjugation-box {
            background: rgba(255,255,255,0.5);
            border: 1px solid #e0e0de;
            padding: 12px;
            border-radius: 12px;
            font-size: 16px;
            text-align: center;
        }

        .conj-label { color: #999; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
        .conj-value { font-size: 20px; font-weight: 600; color: #333; margin-top: 4px; }

        /* Practice nav arrows (tablet/desktop) */
        .practice-arrow {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            flex-shrink: 0;
            background: #E8E8E6;
            box-shadow: 2px 2px 4px #c5c5c3, -2px -2px 4px #fff;
            border: none;
            font-size: 22px;
            transition: box-shadow 0.15s ease;
        }
        .practice-arrow:active { box-shadow: inset 2px 2px 4px #c5c5c3, inset -2px -2px 4px #fff; }
        .practice-arrow.arr-prev { color: #bbb; }
        .practice-arrow.arr-next { color: #F04E23; }

        /* Swipe hint (mobile only) */
        .swipe-hint { display: none; align-items: center; justify-content: center; gap: 4px; color: #bbb; font-size: 12px; padding: 2px 0; opacity: 0.3; }
        .swipe-hint .swipe-arrow { animation: swipe-nudge 1.8s ease-in-out infinite; display: inline-block; }
        @keyframes swipe-nudge {
            0%, 100% { transform: translateX(0); opacity: 0.4; }
            50% { transform: translateX(6px); opacity: 1; }
        }

        /* Practice center area */
        .practice-center {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 16px;
        }

        /* Practice bottom bar */
        .practice-bottom {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            padding: 6px 0 4px;
        }
        .practice-bottom-row {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        /* Tutorial */
        .tutorial-content {
            display: flex;
            flex-direction: column;
            max-width: 600px;
            margin: 0 auto;
            padding: 24px;
            padding-top: 32px;
            flex: 1;
            min-height: 0;
        }

        .tutorial-step-page {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
        }

        .tutorial-main { flex: 1; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; touch-action: pan-y; }
        .tutorial-nav {
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 14px;
            padding: 12px 0 4px;
            margin-top: auto;
        }
        .tutorial-nav .tut-arrow {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            flex-shrink: 0;
            background: #E8E8E6;
            box-shadow: 2px 2px 4px #c5c5c3, -2px -2px 4px #fff;
            border: none;
            font-size: 20px;
            transition: box-shadow 0.15s ease;
        }
        .tutorial-nav .tut-arrow:active { box-shadow: inset 2px 2px 4px #c5c5c3, inset -2px -2px 4px #fff; }
        .tutorial-nav .tut-arrow.arr-prev { color: #bbb; }
        .tutorial-nav .tut-arrow.arr-next { color: #F04E23; }
        .tutorial-nav .tut-arrow:disabled { opacity: 0.25; cursor: default; }
        .tutorial-nav .tut-dots { display: flex; gap: 6px; align-items: center; }
        .tutorial-nav .tut-dots .dot {
            width: 8px; height: 8px; border-radius: 50%; background: #ccc; transition: all 0.2s ease;
        }
        .tutorial-nav .tut-dots .dot.active { background: #F04E23; width: 20px; border-radius: 4px; }
        .tutorial-nav .tut-counter { font-size: 11px; color: #999; white-space: nowrap; }
        .tutorial-step { font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: #F04E23; margin-bottom: 6px; }
        .tutorial-title { font-size: 26px; font-weight: 700; margin-bottom: 10px; }
        .tutorial-text { font-size: 18px; color: #555; line-height: 1.6; margin-bottom: 14px; }
        .tut-verb-row { display: flex; justify-content: center; gap: 20px; margin: 16px 0; }
        .tut-verb-col { text-align: center; }
        .tut-verb-label { font-size: 9px; color: #aaa; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 4px; }
        .tut-verb-word { font-size: 22px; font-weight: 700; color: #333; }
        .tut-pattern { background: #ffe0d9; padding: 2px 14px; border-radius: 20px; font-weight: 600; color: #F04E23; white-space: nowrap; }

        /* Tablet+ */
        @media (min-width: 601px) {
            .word-image { width: 320px; height: 320px; }
        }

        /* Mobile */
        @media (max-width: 600px) {
            .app-container { padding: 16px; padding-top: max(44px, env(safe-area-inset-top)); }
            .tutorial-content { padding: 16px; padding-top: 32px; }
            .tutorial-title { font-size: 24px; }
            .tutorial-text { font-size: 17px; }
            .tut-verb-word { font-size: 21px; }
            .word-image { width: 280px; height: 280px; }
            .word-text { font-size: 24px; }
            .conj-value { font-size: 18px; }
            .toggle-btn { padding: 8px 16px; font-size: 13px; min-width: 100px; }
            .practice-arrow { display: none; }
            .swipe-hint { display: flex; }
            .practice-center { gap: 0; flex-direction: column; }
            .tutorial-verb-forms { flex-direction: column; }
            .tutorial-verb-arrow { display: none; }
            #exam-char-btns { display: flex; }
            .hs-desktop-hint { display: none; }
            .hs-mobile-hint { display: block; }
            .hint-extra { display: none; }
            .feedback-overlay { top: 40px; }
        }

        .tab-content { display: none; flex: 1; min-height: 0; overflow: hidden; touch-action: pan-y; }
        .tab-content.active { display: flex; flex-direction: column; }
        /* Dictionary tab is content-heavy: keep it scrollable but hide the scrollbar */
        #tab-dictionary { overflow-y: auto; scrollbar-width: none; }
        #tab-dictionary::-webkit-scrollbar { display: none; }
        /* Videos tab: same treatment */
        #tab-videos { overflow-y: auto; scrollbar-width: none; }
        #tab-videos::-webkit-scrollbar { display: none; }

        /* Toggle buttons with dots */
        .nav-toggles {
            display: flex;
            gap: 10px;
            justify-content: center;
            padding: 8px 0 0;
        }
        .toggle-wrap {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 5px;
            cursor: pointer;
        }
        .toggle-btn {
            padding: 8px 20px;
            border-radius: 50px;
            font-size: 13px;
            font-weight: 600;
            border: none;
            font-family: inherit;
            cursor: pointer;
            background: #F04E23;
            color: #fff;
            box-shadow: 2px 2px 5px #c5c5c3;
            transition: all 0.2s ease;
            min-width: 90px;
        }
        .toggle-btn.mode-outline {
            background: transparent;
            color: #F04E23;
            border: 2px solid #F04E23;
            box-shadow: none;
        }
        .toggle-btn.mode-solid {
            background: #F04E23;
            color: #fff;
            border: 2px solid #F04E23;
            box-shadow: 2px 2px 5px #c5c5c3;
        }
        .toggle-btn.tab-solid {
            background: #F04E23;
            color: #fff;
            border: 2px solid #F04E23;
            box-shadow: 2px 2px 5px #c5c5c3;
        }
        .toggle-btn.tab-semi {
            background: rgba(240, 78, 35, 0.2);
            color: #F04E23;
            border: 2px solid #F04E23;
            box-shadow: none;
        }
        .toggle-btn.tab-outline {
            background: transparent;
            color: #F04E23;
            border: 2px solid #F04E23;
            box-shadow: none;
        }
        .toggle-btn.tab-dashed {
            background: transparent;
            color: #F04E23;
            border: 2px dashed #F04E23;
            box-shadow: none;
        }
        .toggle-dots {
            display: flex;
            gap: 4px;
            justify-content: center;
        }
        .toggle-dots .dot {
            width: 5px;
            height: 5px;
            border-radius: 50%;
            background: #ccc;
            transition: background 0.2s ease;
        }
        .toggle-dots .dot.active { background: #F04E23; }
        .mode-tooltip.visible { display: block; }

        /* SRS Info Box */
        .srs-info-box {
            margin: 0 0 12px;
            padding: 12px 14px 12px 14px;
            background: #fdf0ec;
            border-radius: 12px;
            font-size: 11px;
            color: #666;
            line-height: 1.5;
            position: relative;
            cursor: pointer;
        }
        .srs-info-box strong { color: #333; }
        .srs-info-box .srs-title { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: #F04E23; font-weight: 700; margin-bottom: 4px; }
        .srs-info-box .srs-close { position: absolute; top: 6px; right: 10px; background: none; border: none; color: #cba; font-size: 16px; cursor: pointer; line-height: 1; }

        /* Exam Mode Selectors - Desktop: pill toggles */
        /* Exam toggle buttons - same style as dashboard */
        .exam-toggles {
            display: flex;
            gap: 10px;
            justify-content: center;
        }

        /* Video Popup */
        .video-popup-overlay {
            display: none;
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.85);
            z-index: 200;
            align-items: center;
            justify-content: center;
        }
        .video-popup-overlay.show { display: flex; }
        .video-popup-content { width: 90%; max-width: 700px; position: relative; }
        .video-popup-close {
            position: absolute; top: -40px; right: 0;
            color: white; font-size: 28px; cursor: pointer;
            background: none; border: none; padding: 4px 8px;
        }

        /* Video Thumbnail Grid */
        .vid-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
        .vid-card {
            position: relative; border-radius: 8px; overflow: hidden; cursor: pointer;
            box-shadow: 2px 2px 4px #c5c5c3, -2px -2px 4px #ffffff;
            aspect-ratio: 16/9; background: #333;
        }
        .vid-card .play-icon {
            position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
            width: 32px; height: 32px; background: rgba(240,78,35,0.9); border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
        }
        .vid-card .play-icon::after {
            content: ''; border-left: 10px solid white;
            border-top: 6px solid transparent; border-bottom: 6px solid transparent; margin-left: 2px;
        }
        .vid-card .vid-label {
            position: absolute; bottom: 0; left: 0; right: 0;
            padding: 4px 6px; background: rgba(0,0,0,0.6); color: white; font-size: 10px; font-weight: 500;
        }

        /* Dictionary Grid */
        .dict-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
        .dict-card {
            background: #E8E8E6; border-radius: 10px; padding: 8px 6px;
            text-align: center; box-shadow: 2px 2px 4px #c5c5c3, -2px -2px 4px #ffffff;
            cursor: pointer; transition: all 0.15s ease;
        }
        .dict-card:active { box-shadow: inset 2px 2px 4px #c5c5c3, inset -2px -2px 4px #ffffff; }
        .dict-card img { width: 44px; height: 44px; object-fit: contain; }
        .dict-card .dict-name { font-size: 12px; font-weight: 600; margin-top: 2px; }
        .dict-card .dict-forms { font-size: 10px; color: #888; }

        /* Dictionary Popup */
        .dict-popup-overlay {
            display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.5); z-index: 200; align-items: center; justify-content: center;
        }
        .dict-popup-overlay.show { display: flex; }
        .dict-popup {
            background: #E8E8E6; border-radius: 20px; padding: 24px; width: 90%; max-width: 340px;
            text-align: center; box-shadow: 8px 8px 16px #999, -8px -8px 16px #ddd;
            position: relative;
        }
        .dict-popup-close {
            position: absolute; top: 10px; right: 14px; background: none; border: none;
            font-size: 22px; color: #999; cursor: pointer; line-height: 1;
        }
        .dict-popup img { max-width: 160px; max-height: 160px; object-fit: contain; margin-bottom: 12px; }
        .dict-popup .dp-infinitive { font-size: 24px; font-weight: 700; margin-bottom: 2px; }
        .dict-popup .dp-english { font-size: 14px; color: #888; margin-bottom: 14px; }
        .dict-popup .dp-forms {
            display: flex; flex-direction: column; gap: 6px;
        }
        .dict-popup .dp-form-row {
            display: flex; justify-content: space-between; align-items: center;
            padding: 6px 12px; border-radius: 8px;
            background: #E8E8E6; box-shadow: inset 1px 1px 3px #c5c5c3, inset -1px -1px 3px #ffffff;
        }
        .dict-popup .dp-form-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #999; }
        .dict-popup .dp-form-value { font-size: 15px; font-weight: 600; }

        /* Exam Input */
        .exam-answer-input {
            width: 100%; max-width: 400px; padding: 16px; font-size: 20px;
            text-align: center; border: 2px solid #ddd; border-radius: 14px;
            background: #f5f5f3; font-family: inherit; margin: 12px auto; display: block; outline: none;
        }
        .exam-answer-input:focus { border-color: #F04E23; }

        /* Character buttons (mobile umlaut input) */
        .char-btn {
            display: inline-flex; align-items: center; justify-content: center;
            width: 44px; height: 40px; border-radius: 8px;
            border: 1px solid #ccc; background: #f0f0ee;
            font-size: 18px; font-weight: 600; color: #333;
            cursor: pointer; font-family: inherit;
        }
        .char-btn:active { background: #e0e0de; }
        #exam-char-btns { display: none; gap: 8px; justify-content: center; margin-top: 10px; }

        /* Greyed-out mode toggle (dictionary tab) */
        .toggle-btn.mode-disabled {
            background: transparent; color: #bbb; border: 2px solid #ccc;
            box-shadow: none; cursor: default; opacity: 0.5; pointer-events: none;
        }

        /* H/S hint spans - desktop visible, mobile hidden by default */
        .hs-desktop-hint { display: block; }
        .hs-mobile-hint { display: none; }

        /* Video covers - teal minimalist */
        .vid-cover-teal {
            border-radius: 12px; overflow: hidden; aspect-ratio: 16/9;
            position: relative; cursor: pointer; background: #097C87;
            box-shadow: 2px 2px 4px #c5c5c3, -2px -2px 4px #ffffff;
        }
        .vid-cover-top-left { position: absolute; top: 6px; left: 8px; }
        .vid-cover-brand {
            font-size: 12px; font-weight: 400;
            color: rgba(255,255,255,0.5); letter-spacing: 1.5px;
        }
        .vid-cover-title {
            font-size: 22px; font-weight: 300; color: white; line-height: 1.2;
        }
        .vid-cover-num {
            position: absolute; top: 6px; right: 8px;
            font-size: 12px; font-weight: 400; color: rgba(255,255,255,0.15);
        }

        @media print {
            body { background: white !important; margin: 0 !important; padding: 0 !important; }
            .app-container { max-width: 100% !important; max-height: none !important; height: auto !important; box-shadow: none !important; border-radius: 0 !important; overflow: visible !important; }
            .page { display: none !important; height: auto !important; }
            #admin { display: block !important; height: auto !important; overflow: visible !important; }
            #admin > div { height: auto !important; }
            #admin-list { overflow: visible !important; grid-template-columns: repeat(4, 1fr) !important; height: auto !important; }
            #admin-search, .feedback-overlay, button { display: none !important; }
            .admin-card { break-inside: avoid; box-shadow: 1px 1px 3px #ccc !important; }
        }

        /* ===== DARK MODE ===== */
        body.dark { background: #1e1e1e; color: #e0e0e0; }

        /* Neumorphic surfaces */
        body.dark .neu-card { background: #2a2a2a; box-shadow: 6px 6px 12px #111, -6px -6px 12px #2a2a2a; }
        body.dark .neu-btn { background: #2a2a2a; box-shadow: 3px 3px 6px #111, -3px -3px 6px #333; }
        body.dark .neu-btn:active { box-shadow: inset 2px 2px 4px #111, inset -2px -2px 4px #333; }

        /* Quiz choice buttons */
        body.dark .quiz-choice-btn { background: #363636; color: #e0e0e0; box-shadow: 3px 3px 6px #111, -3px -3px 6px #444; }
        body.dark .quiz-choice-btn:hover:not(:disabled) { box-shadow: 2px 2px 4px #111, -2px -2px 4px #444; }
        body.dark .quiz-choice-btn:active:not(:disabled) { box-shadow: inset 2px 2px 4px #111, inset -2px -2px 4px #333; }
        body.dark .quiz-choice-btn.correct { background: #4A7C59 !important; color: white !important; }
        body.dark .quiz-choice-btn.wrong { background: #C44536 !important; color: white !important; }

        /* Progress dots */
        body.dark .dot { background: #444; }
        body.dark .toggle-dots .dot { background: #555; }

        /* Toggle buttons */
        body.dark .toggle-btn { box-shadow: 2px 2px 5px #111; }
        body.dark .toggle-btn.mode-outline, body.dark .toggle-btn.tab-outline, body.dark .toggle-btn.tab-dashed { box-shadow: none; }

        /* Practice arrows */
        body.dark .practice-arrow { background: #2a2a2a; box-shadow: 2px 2px 4px #111, -2px -2px 4px #333; }
        body.dark .practice-arrow:active { box-shadow: inset 2px 2px 4px #111, inset -2px -2px 4px #333; }

        /* Conjugation box */
        body.dark .conjugation-box { background: rgba(255,255,255,0.07); border-color: #444; }
        body.dark .conj-value { color: #e0e0e0 !important; }
        body.dark .conj-label { color: #777; }

        /* Word display */
        body.dark .word-text { color: #e0e0e0 !important; }
        body.dark .word-hint { color: #999 !important; }

        /* Tutorial */
        body.dark .tutorial-nav .tut-arrow { background: #2a2a2a; box-shadow: 2px 2px 4px #111, -2px -2px 4px #333; }
        body.dark .tutorial-nav .tut-arrow:active { box-shadow: inset 2px 2px 4px #111, inset -2px -2px 4px #333; }
        body.dark .tutorial-nav .tut-dots .dot { background: #555; }
        body.dark .tutorial-text { color: #bbb !important; }
        body.dark .tutorial-title { color: #e0e0e0 !important; }
        body.dark .tut-verb-word { color: #e0e0e0 !important; }
        /* Inline color:#555 and color:#333 on tutorial grid verb examples */
        body.dark #tutorial [style*="color: #555"] { color: #aaa !important; }
        body.dark #tutorial [style*="color: #333"] { color: #ddd !important; }
        /* Tutorial verb boxes + pattern pills + icon boxes (inset neumorphic) */
        body.dark #tutorial [style*="background: #E8E8E6"] {
            background: #2a2a2a !important;
            box-shadow: inset 2px 2px 4px #111, inset -2px -2px 4px #333 !important;
        }
        /* Tutorial pattern highlight pills (pink bg) */
        body.dark #tutorial [style*="background: #ffe0d9"] {
            background: rgba(240, 78, 35, 0.2) !important;
        }
        /* Tutorial divider lines */
        body.dark #tutorial [style*="background: #d0d0ce"] {
            background: #444 !important;
        }

        /* Dictionary */
        body.dark .dict-card { background: #2a2a2a; box-shadow: 2px 2px 4px #111, -2px -2px 4px #333; }
        body.dark .dict-card:active { box-shadow: inset 2px 2px 4px #111, inset -2px -2px 4px #333; }
        body.dark .dict-card .dict-forms { color: #777; }
        body.dark .dict-popup { background: #2a2a2a; box-shadow: 8px 8px 16px #000, -8px -8px 16px #333; }
        body.dark .dict-popup .dp-form-row { background: #333; box-shadow: inset 1px 1px 3px #222, inset -1px -1px 3px #444; }
        body.dark .dict-popup .dp-english { color: #999 !important; }
        body.dark .dict-popup .dp-form-label { color: #777; }
        body.dark .dict-popup .dp-form-value { color: #e0e0e0; }
        body.dark .dict-popup-close { color: #666 !important; }

        /* Video cards */
        body.dark .vid-card { box-shadow: 2px 2px 4px #111, -2px -2px 4px #333; }

        /* Peek-a-boo wizard mascot */
        .peek-disc { fill: #E8E8E6; }
        .peek-char {
            position: absolute;
            width: 60px;
            height: 60px;
            object-fit: contain;
            z-index: 1;
            pointer-events: auto;
            cursor: pointer;
            top: calc(50% - 30px);
            left: calc(50% - 30px);
            transform-origin: 30px 30px;
        }
        body.dark .peek-disc { fill: #1e1e1e; }

        /* SRS info box */
        body.dark .srs-info-box { background: #2a2020; color: #aaa; }
        body.dark .srs-info-box strong { color: #e0e0e0; }

        /* Exam input */
        body.dark .exam-answer-input { background: #333; border-color: #555; color: #e0e0e0; }
        body.dark .exam-answer-input:focus { border-color: #F04E23; }

        /* Char buttons */
        body.dark .char-btn { background: #363636; border-color: #555; color: #e0e0e0; }
        body.dark .char-btn:active { background: #444; }

        /* Mode-disabled toggle */
        body.dark .toggle-btn.mode-disabled { border-color: #555; color: #555; }

        /* H/S buttons */
        body.dark #hs-haben-btn, body.dark #hs-sein-btn { background: #363636 !important; }

        /* Video covers dark */
        body.dark .vid-cover-teal { box-shadow: 2px 2px 4px #111, -2px -2px 4px #333; }

        /* Btn secondary */
        body.dark .btn-secondary { background: #2a2a2a; color: #e0e0e0; box-shadow: 4px 4px 8px #111, -4px -4px 8px #333; }

        /* Broad inline overrides via parent page IDs */
        body.dark #login [style*="background: #E8E8E6"],
        body.dark #welcome [style*="background: #E8E8E6"],
        body.dark #mode-select [style*="background: #E8E8E6"],
        body.dark #results [style*="background: #E8E8E6"] {
            background: #2a2a2a !important;
            box-shadow: 6px 6px 12px #111, -6px -6px 12px #2a2a2a !important;
        }
        body.dark #dashboard [style*="background: #E8E8E6"] {
            background: #2a2a2a !important;
            box-shadow: 3px 3px 6px #111, -3px -3px 6px #333 !important;
        }

        /* Continue/Learn button - keep orange, fix white glow */
        body.dark #continue-btn { box-shadow: 4px 4px 8px #111 !important; }

        /* Exam mode button - double ID to beat #dashboard [style*] specificity */
        body.dark #dashboard #exam-mode-btn { background: #363636 !important; color: #ccc !important; box-shadow: 3px 3px 6px #111, -3px -3px 6px #444 !important; }
        body.dark #exam [style*="background: #E8E8E6"] {
            background: #2a2a2a !important;
            box-shadow: 3px 3px 6px #111, -3px -3px 6px #333 !important;
        }
        body.dark #practice [style*="background: #E8E8E6"] {
            background: #2a2a2a !important;
        }

        /* Inline text color overrides */
        body.dark [style*="color: #333"] { color: #e0e0e0 !important; }
        body.dark [style*="color: #2D2D2D"] { color: #e0e0e0 !important; }
        body.dark [style*="color: #555"] { color: #bbb !important; }
        body.dark [style*="color: #666"] { color: #999 !important; }
        body.dark [style*="color: #888"] { color: #777 !important; }
        body.dark [style*="color: #ddd"] { color: #444 !important; }

        /* Inline box-shadow overrides for neumorphic elements */
        body.dark [style*="box-shadow: 4px 4px 8px #c5c5c3"] { box-shadow: 3px 3px 6px #111 !important; }
        body.dark [style*="box-shadow: 6px 6px 12px #c5c5c3"] { box-shadow: 3px 3px 6px #111, -3px -3px 6px #333 !important; }
        body.dark [style*="box-shadow: 3px 3px 6px #c5c5c3"] { box-shadow: 3px 3px 6px #111, -3px -3px 6px #333 !important; }
        body.dark [style*="box-shadow: 8px 8px 16px #c5c5c3"] { box-shadow: 6px 6px 12px #111, -6px -6px 12px #2a2a2a !important; }

        /* Inline inset shadow overrides */
        body.dark [style*="box-shadow: inset 2px 2px 4px #c5c5c3"] { box-shadow: inset 2px 2px 4px #111, inset -2px -2px 4px #333 !important; }

        /* Progress ring */
        body.dark circle[stroke="#ddd"] { stroke: #444; }

        /* Dashboard search input */
        body.dark #dict-search { background: #2a2a2a !important; color: #e0e0e0 !important; box-shadow: inset 2px 2px 4px #111, inset -2px -2px 4px #333 !important; }

        /* Login page inputs */
        body.dark #login-username,
        body.dark #login-password {
            background: #2a2a2a !important;
            color: #e0e0e0 !important;
            box-shadow: inset 2px 2px 4px #111, inset -2px -2px 4px #333 !important;
        }
        body.dark #login-username::placeholder,
        body.dark #login-password::placeholder { color: #666 !important; }

        /* Quiz hint button */
        body.dark #quiz-hint-btn { border-color: #555 !important; color: #888 !important; }

        /* Results page stat boxes */
        body.dark #results [style*="background: rgba(74"] { background: rgba(74, 124, 89, 0.25) !important; }
        body.dark #results [style*="background: rgba(196"] { background: rgba(196, 69, 54, 0.25) !important; }

        /* SRS info box peach bg */
        body.dark .srs-info-box { background: #2d2222; }

        /* Dark toggle itself */
        .dark-toggle-wrap {
            display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
        }
        .dark-toggle-track {
            width: 30px; height: 16px; border-radius: 8px; position: relative; display: inline-block;
            background: #d5d5d3; transition: background 0.3s ease;
        }
        body.dark .dark-toggle-track { background: #F04E23; }
        .dark-toggle-thumb {
            width: 12px; height: 12px; background: #fff; border-radius: 50%;
            position: absolute; top: 2px; left: 2px;
            box-shadow: 1px 1px 2px rgba(0,0,0,0.15);
            transition: left 0.3s ease;
        }
        body.dark .dark-toggle-thumb { left: 16px; }
        .dark-toggle-icon { font-size: 12px; color: #bbb; transition: color 0.3s ease; }
        body.dark .dark-toggle-icon { color: #f0c040; }

        #install-btn { display: none; background: none; border: none; color: #F04E23; cursor: pointer; font-size: 11px; font-family: inherit; padding: 0; }
        .ios-install-toast {
            display: none; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
            background: #333; color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 13px;
            line-height: 1.5; text-align: center; z-index: 1000; max-width: 320px; width: 90%;
            box-shadow: 0 4px 12px rgba(0,0,0,0.3); animation: toastIn 0.3s ease;
        }
        @keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
        body.dark .ios-install-toast { background: #555; }

        /* ===== ORB MENU ===== */
        /* 3x3 grid, step=62px, items=52x52 circle, 10px gap around orb */
        .chest-menu-area { position: relative; z-index: 50; display: flex; flex-direction: column; align-items: center; margin: 0 0 22px; flex-shrink: 0; }
        .gather-zone { position: relative; width: 162px; height: 162px; }
        .chest-handle { position: absolute; left: 56px; top: 56px; width: 50px; height: 50px; cursor: pointer; z-index: 2; border: none; background: #d8d8d6; border-radius: 50%; box-shadow: 4px 4px 8px #b8b8b6, -4px -4px 8px #ffffff, inset 1px 1px 2px rgba(255,255,255,0.6), inset -1px -1px 2px rgba(0,0,0,0.08); display: flex; align-items: center; justify-content: center; transition: transform .35s cubic-bezier(.22,1,.36,1), background .25s ease, box-shadow .25s ease; }
        .chest-menu-area.open .chest-handle { transform: scale(1.12); background: #F04E23; box-shadow: 0 0 0 3px rgba(255,255,255,0.35), 0 0 22px rgba(240,78,35,0.75); }
        .gather-zone .chest-panel-item { position: absolute; left: 56px; top: 56px; width: 50px; height: 50px; border-radius: 50%; cursor: pointer; background: #E8E8E6; border: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #888; font-family: inherit; box-shadow: 3px 3px 6px #c5c5c3, -3px -3px 6px #ffffff; opacity: 0; transform: scale(.5); pointer-events: none; transition: opacity .35s cubic-bezier(.22,1,.36,1), transform .4s cubic-bezier(.22,1,.36,1), left .4s cubic-bezier(.22,1,.36,1), top .4s cubic-bezier(.22,1,.36,1); }
        .gather-zone .chest-panel-item:active { box-shadow: inset 2px 2px 4px #c5c5c3, inset -2px -2px 4px #ffffff; transform: scale(.94) !important; }
        .gather-zone .chest-panel-item svg { flex-shrink: 0; }
        .gather-zone .chest-panel-item span { font-size: 7px; font-weight: 600; letter-spacing: .2px; color: #888; line-height: 1; }
        .chest-menu-area.open .chest-panel-item { opacity: 1; transform: scale(1); pointer-events: auto; }
        .chest-menu-area.open .chest-panel-item:nth-child(1) { left: 0; top: 0; transition-delay: .02s; }
        .chest-menu-area.open .chest-panel-item:nth-child(2) { left: 56px; top: 0; transition-delay: .04s; }
        .chest-menu-area.open .chest-panel-item:nth-child(3) { left: 112px; top: 0; transition-delay: .06s; }
        .chest-menu-area.open .chest-panel-item:nth-child(4) { left: 0; top: 56px; transition-delay: .08s; }
        .chest-menu-area.open .chest-panel-item:nth-child(5) { left: 112px; top: 56px; transition-delay: .10s; }
        .chest-menu-area.open .chest-panel-item:nth-child(6) { left: 0; top: 112px; transition-delay: .12s; }
        .chest-menu-area.open .chest-panel-item:nth-child(7) { left: 56px; top: 112px; transition-delay: .14s; }
        .chest-menu-area.open .chest-panel-item:nth-child(8) { left: 112px; top: 112px; transition-delay: .16s; }
        @keyframes orbHint {
            0%, 55%, 100% { box-shadow: 4px 4px 8px #c5c5c3, -4px -4px 8px #ffffff; transform: scale(1); }
            60% { box-shadow: 4px 4px 8px #c5c5c3, -4px -4px 8px #ffffff, 0 0 16px rgba(240,78,35,0.45); transform: scale(1.14); }
            67% { box-shadow: 4px 4px 8px #c5c5c3, -4px -4px 8px #ffffff; transform: scale(1.0); }
            72% { box-shadow: 4px 4px 8px #c5c5c3, -4px -4px 8px #ffffff, 0 0 10px rgba(240,78,35,0.3); transform: scale(1.09); }
            80% { box-shadow: 4px 4px 8px #c5c5c3, -4px -4px 8px #ffffff; transform: scale(1); }
        }
        .chest-menu-area:not(.open) .chest-handle { animation: orbHint 4.5s ease-in-out infinite; }
        .chest-menu-area.open .chest-handle { animation: none; }
        body.dark .chest-handle { background: #2a2a2a; box-shadow: 4px 4px 8px #111, -4px -4px 8px #333; }
        body.dark .chest-menu-area.open .chest-handle { background: #F04E23; box-shadow: 0 0 0 3px rgba(255,255,255,0.15), 0 0 22px rgba(240,78,35,0.75); }
        body.dark .gather-zone .chest-panel-item { background: #252a32; box-shadow: 3px 3px 6px #111, -3px -3px 6px #333; color: #999; }
        body.dark .gather-zone .chest-panel-item:active { box-shadow: inset 2px 2px 4px #111, inset -2px -2px 4px #333 !important; }
        body.dark .gather-zone .chest-panel-item span { color: #999; }
