* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
        .hidden { display: none !important; }
        
        :root {
            --header-height: 56px;
            /* Accent colors */
            --pink-primary: #ec4899;
            --purple-primary: #a855f7;
            --violet-primary: #8b5cf6;
            --cyan-accent: #06b6d4;
        }

        /* Dark theme (default) */
        [data-theme="dark"] {
            --bg-primary: linear-gradient(135deg, #0f0f1a 0%, #1f1530 50%, #0d1117 100%);
            --bg-solid: #0f0f1a;
            --text-primary: #ffffff;
            --text-secondary: rgba(255,255,255,0.6);
            --text-tertiary: rgba(255,255,255,0.4);
            --text-muted: rgba(255,255,255,0.35);
            --lg-bg: rgba(255, 255, 255, 0.08);
            --lg-border: rgba(255, 255, 255, 0.18);
            --lg-blur: 24px;
            --lg-specular: inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
            --lg-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
            --glass-bg: rgba(255, 255, 255, 0.08);
            --glass-border: rgba(255, 255, 255, 0.15);
            --glass-blur: 24px;
            --glass-specular: inset 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 -1px 0 rgba(255, 255, 255, 0.03);
            --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
            --card-bg: rgba(255,255,255,0.06);
            --card-border: rgba(255,255,255,0.12);
            --card-hover-bg: rgba(255,255,255,0.1);
            --card-hover-border: rgba(255,255,255,0.18);
            --overlay-bg: rgba(0,0,0,0.8);
            --modal-bg: rgba(20,15,30,0.95);
            --input-bg: rgba(255,255,255,0.03);
            --input-border: rgba(255,255,255,0.08);
            --tag-bg: rgba(255,255,255,0.08);
            --tag-color: rgba(255,255,255,0.5);
            /* Bubbles */
            --bubble-tutor-bg: rgba(255,255,255,0.07);
            --bubble-tutor-border: rgba(255,255,255,0.14);
            --bubble-tutor-shadow: 0 8px 32px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.12);
            --bubble-user-bg: rgba(42,171,238,0.08);
            --bubble-user-border: rgba(42,171,238,0.22);
            --bubble-user-border-style: dashed;
            --bubble-user-shadow: 0 8px 32px rgba(0,0,0,0.15), inset 0 1px 0 rgba(42,171,238,0.12);
            /* Speak button */
            --btn-speak-bg: linear-gradient(135deg, rgba(236,72,153,0.3) 0%, rgba(168,85,247,0.3) 100%);
            --btn-speak-border: rgba(236,72,153,0.25);
            --btn-speak-shadow: 0 4px 20px rgba(236,72,153,0.15);
            --btn-speak-color: #ffffff;
            --btn-speak-icon: #ffffff;
        }

        /* Light theme */
        [data-theme="light"] {
            --bg-primary: linear-gradient(135deg, #e0e7ff 0%, #f0e6fa 40%, #fce7f3 70%, #e0f2fe 100%);
            --bg-solid: #f0f0ff;
            --text-primary: #1a1a2e;
            --text-secondary: rgba(26,26,46,0.6);
            --text-tertiary: rgba(26,26,46,0.45);
            --text-muted: rgba(26,26,46,0.35);
            --lg-bg: rgba(255, 255, 255, 0.7);
            --lg-border: rgba(0, 0, 0, 0.08);
            --lg-blur: 24px;
            --lg-specular: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -1px 0 rgba(0, 0, 0, 0.03);
            --lg-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
            --glass-bg: rgba(255, 255, 255, 0.35);
            --glass-border: rgba(255, 255, 255, 0.5);
            --glass-blur: 24px;
            --glass-specular: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -1px 0 rgba(0, 0, 0, 0.03);
            --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
            --card-bg: rgba(255,255,255,0.35);
            --card-border: rgba(255,255,255,0.5);
            --card-hover-bg: rgba(255,255,255,0.5);
            --card-hover-border: rgba(255,255,255,0.65);
            --overlay-bg: rgba(0,0,0,0.3);
            --modal-bg: rgba(255,255,255,0.95);
            --input-bg: rgba(0,0,0,0.03);
            --input-border: rgba(0,0,0,0.08);
            --tag-bg: rgba(0,0,0,0.05);
            --tag-color: rgba(0,0,0,0.5);
            /* Bubbles */
            --bubble-tutor-bg: rgba(255,255,255,0.4);
            --bubble-tutor-border: rgba(255,255,255,0.6);
            --bubble-tutor-shadow: 0 8px 32px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.7);
            --bubble-user-bg: rgba(42,171,238,0.06);
            --bubble-user-border: rgba(42,171,238,0.18);
            --bubble-user-border-style: dashed;
            --bubble-user-shadow: 0 8px 32px rgba(0,0,0,0.04), inset 0 1px 0 rgba(42,171,238,0.08);
            /* Speak button */
            --btn-speak-bg: linear-gradient(135deg, rgba(236,72,153,0.15) 0%, rgba(168,85,247,0.15) 100%);
            --btn-speak-border: rgba(236,72,153,0.2);
            --btn-speak-shadow: 0 2px 12px rgba(236,72,153,0.1);
            --btn-speak-color: #1a1a2e;
            --btn-speak-icon: #ec4899;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
            background: var(--bg-primary);
            height: 100dvh;
            display: flex;
            flex-direction: column;
            color: var(--text-primary);
            overflow: hidden;
        }

        /* Home page: scrollable, no fixed height constraint */
        body.home-page {
            height: auto;
            min-height: 100dvh;
            overflow: auto;
        }

        /* Wide screen centering — all sections use max-width + margin:auto individually */
/* Header - Lightweight, matches home header */
        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 20px 4px;
            height: var(--header-height);
            flex-shrink: 0;
            background: transparent;
            width: 100%;
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
            box-sizing: border-box;
        }
        
        .close-btn {
            background: none;
            border: none;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            color: var(--text-tertiary);
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .close-btn:hover {
            color: var(--text-primary);
        }
        
        .header-center {
            display: flex;
            align-items: center;
            gap: 10px;
            flex: 1;
            margin: 0 12px;
            min-width: 0;
        }
        
        .header-title {
            font-size: 15px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 6px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .header-title .brand { color: var(--text-tertiary); font-weight: 500; font-size: 14px; }
        .header-title .sep { color: var(--text-muted); font-weight: 300; }
        .header-title .lesson { color: var(--text-primary); font-weight: 600; font-size: 15px; }
        
        .timer {
            display: flex;
            align-items: center;
            gap: 5px;
            font-size: 13px;
            color: var(--text-tertiary);
            white-space: nowrap;
            margin-left: auto;
            flex-shrink: 0;
        }
        .timer .dot {
            width: 6px;
            height: 6px;
            background: #ef4444;
            border-radius: 50%;
            animation: pulse 1s infinite;
            box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
        }
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }
        
        /* Instruction banner */
        .instruction-banner {
            padding: 8px 16px 8px 72px;
            text-align: left;
            font-size: 14px;
            line-height: 1.5;
            color: var(--text-tertiary);
            font-weight: 300;
            background: transparent;
            flex-shrink: 0;
            white-space: pre-line;
            max-width: 600px;
            width: 100%;
            box-sizing: border-box;
            margin-left: auto;
            margin-right: auto;
        }
        .instruction-banner:empty { display: none; }

        /* Main chat area — messenger style, scrollable */
        .chat-area {
            flex: 1;
            min-height: 0;
            max-width: 600px;
            width: 100%;
            margin-left: auto;
            margin-right: auto;
            display: flex;
            flex-direction: column;
            padding: 8px 16px 0;
            overflow-y: auto;
            gap: 10px;
            -webkit-overflow-scrolling: touch;
            margin-bottom: 8px;
        }
        /* Spacer pushes content to bottom when chat is short */
        .chat-spacer {
            flex: 1;
        }

        /* ===== CHAT FEED — Telegram-style messages ===== */
        .chat-feed {
            display: flex;
            flex-direction: column;
            gap: 16px;
            width: 100%;
        }
        .msg {
            display: flex;
            gap: 8px;
            align-items: flex-end;
            animation: msg-appear 0.3s ease-out;
        }
        @keyframes msg-appear {
            from { opacity: 0; transform: translateY(8px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        .msg-tutor { flex-direction: row; }
        .msg-user  { flex-direction: row-reverse; }
        .msg-system { justify-content: center; }

        .msg-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--glass-bg);
            border: 0.5px solid var(--glass-border);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            flex-shrink: 0;
        }

        .msg-bubble {
            max-width: 80%;
            padding: 10px 14px;
            border-radius: 16px;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            cursor: pointer;
        }
        .msg-bubble-tutor {
            background: var(--bubble-tutor-bg);
            border: 0.5px solid var(--bubble-tutor-border);
            border-top-left-radius: 4px;
            box-shadow: var(--bubble-tutor-shadow);
        }
        .msg-bubble-user {
            background: var(--bubble-user-bg);
            border: 0.5px dashed var(--bubble-user-border);
            border-bottom-right-radius: 4px;
            box-shadow: var(--bubble-user-shadow);
        }
        .msg-bubble-system {
            background: var(--glass-bg);
            border: 0.5px solid var(--glass-border);
            font-size: 13px;
            color: var(--text-secondary);
            text-align: center;
            padding: 8px 16px;
            border-radius: 20px;
            cursor: default;
        }

        .msg-greek {
            font-size: 17px;
            font-weight: 500;
            line-height: 1.35;
            color: var(--text-primary);
        }
        .msg-russian {
            font-size: 12px;
            color: var(--text-tertiary);
            font-style: italic;
            display: none;
            margin-top: 2px;
        }
        .msg-bubble.show-russian .msg-russian { display: block; }

        /* Dim older messages slightly */
        .msg.msg-done .msg-bubble-tutor,
        .msg.msg-done .msg-bubble-user {
            opacity: 0.7;
        }

        /* Active (latest) tutor message — prominent but easy to read */
        .msg-tutor:not(.msg-done) .msg-greek {
            font-size: 21px;
            font-weight: 500;
        }
        .msg-tutor:not(.msg-done) .msg-russian {
            font-size: 14px;
            display: block;
        }

        /* Typing dots animation */
        .typing-dots {
            display: flex;
            gap: 4px;
            align-items: center;
            padding: 4px 2px;
        }
        .typing-dots span {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: var(--text-tertiary);
            animation: typing-bounce 1.4s infinite ease-in-out;
        }
        .typing-dots span:nth-child(2) { animation-delay: 0.2s; }
        .typing-dots span:nth-child(3) { animation-delay: 0.4s; }
        @keyframes typing-bounce {
            0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
            40% { transform: scale(1); opacity: 1; }
        }
        
        /* ===== BOTTOM PANEL (hint + controls) ===== */
        .bottom-panel {
            flex-shrink: 0;
            padding: 0 0 calc(env(safe-area-inset-bottom, 8px) + 8px);
            width: 100%;
            max-width: 100%;
            align-self: stretch;
            min-height: 180px;
        }
        [data-theme="dark"] .bottom-panel {
            background: rgba(10, 8, 18, 0.85);
            border-top: 0.5px solid rgba(255,255,255,0.08);
        }
        [data-theme="light"] .bottom-panel {
            background: rgba(230, 232, 240, 0.92);
            border-top: 0.5px solid rgba(0,0,0,0.06);
        }

        /* Hint strip — clean inline hint, no bubble */
        .hint-strip {
            display: flex;
            align-items: baseline;
            gap: 6px;
            padding: 10px 16px 4px;
            max-width: 600px;
            margin: 0 auto;
            justify-content: center;
            flex-direction: row;
            text-align: center;
            min-height: 48px;
            opacity: 0;
            transition: opacity 0.15s ease, background 1.5s ease-out, box-shadow 1.5s ease-out;
        }
        .hint-strip.visible { opacity: 1; }
        .hint-strip.hint-error {
            background: rgba(255, 59, 48, 0.12) !important;
            box-shadow: 0 0 16px rgba(255, 59, 48, 0.15);
            transition: none;
        }
        .hint-icon {
            font-size: 13px;
            flex-shrink: 0;
            color: var(--text-tertiary);
            font-weight: 400;
            font-style: italic;
            letter-spacing: 0;
        }
        .hint-content {
            flex-shrink: 1;
            min-width: 0;
        }
        .hint-greek {
            font-size: 21px;
            font-weight: 500;
            color: var(--text-primary);
            line-height: 1.3;
            text-align: center;
        }
        .hint-russian {
            font-size: 14px;
            color: var(--text-tertiary);
            font-style: italic;
            text-align: center;
        }

        /* Controls row */
        .controls-row {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            max-width: 600px;
            margin: 8px auto 0;
            padding: 0 12px;
        }
        .bottom-left {
            flex: 1;
            display: flex;
            justify-content: flex-start;
            min-width: 0;
        }
        .bottom-right {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 8px;
            min-width: 0;
        }

        /* ===== SCRIPT BUTTON (header right) ===== */
        .script-btn {
            background: none;
            border: 0.5px solid var(--glass-border);
            border-radius: 10px;
            color: var(--text-tertiary);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 5px 10px;
            font-size: 11px;
            font-weight: 500;
            font-family: inherit;
            white-space: nowrap;
            transition: all 0.2s;
            flex-shrink: 0;
        }
        .script-btn:hover {
            color: var(--text-primary);
            border-color: var(--text-secondary);
        }
        .script-btn svg { flex-shrink: 0; }

        /* ===== SCRIPT MODAL OVERLAY ===== */
        .script-overlay {
            position: fixed;
            inset: 0;
            z-index: 1000;
            background: var(--overlay-bg);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            animation: fadeIn 0.2s ease;
        }
        .script-overlay.hidden { display: none; }
        @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

        .script-modal {
            background: var(--modal-bg);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 0.5px solid var(--glass-border);
            border-radius: 16px;
            width: 100%;
            max-width: 440px;
            max-height: 80vh;
            display: flex;
            flex-direction: column;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
        }
        .script-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 16px;
            border-bottom: 0.5px solid var(--glass-border);
            flex-shrink: 0;
        }
        .script-title {
            font-size: 15px;
            font-weight: 600;
            color: var(--text-primary);
        }
        .script-close {
            background: none;
            border: none;
            color: var(--text-tertiary);
            font-size: 18px;
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 8px;
            transition: all 0.2s;
        }
        .script-close:hover {
            color: var(--text-primary);
            background: var(--card-bg);
        }
        .script-body {
            overflow-y: auto;
            padding: 12px 14px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            -webkit-overflow-scrolling: touch;
        }
        .script-line {
            display: flex;
            flex-direction: column;
            gap: 3px;
            padding: 10px 14px;
            border-radius: 12px;
            font-size: 15px;
            line-height: 1.5;
        }
        .script-line.tutor {
            background: var(--bubble-tutor-bg);
            border: 0.5px solid var(--bubble-tutor-border);
            align-self: flex-start;
            max-width: 88%;
        }
        .script-line.student {
            background: var(--bubble-user-bg);
            border: 0.5px solid var(--bubble-user-border);
            align-self: flex-end;
            max-width: 88%;
        }
        .script-greek {
            color: var(--text-primary);
            font-weight: 500;
        }
        .script-russian {
            color: var(--text-tertiary);
            font-size: 13px;
        }
        .script-num {
            font-size: 10px;
            color: var(--text-muted);
            margin-bottom: 2px;
        }

        /* ===== PROGRESS + SKIP MERGED BLOCK ===== */
        .progress-skip-toggle {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 0;
            font-family: inherit;
        }
        .progress-skip-inner {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 0;
            background: rgba(255, 255, 255, 0.06);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 0.5px solid rgba(255, 255, 255, 0.1);
            border-radius: 10px;
            overflow: hidden;
            padding: 2px;
            min-width: 72px;
        }
        [data-theme="light"] .progress-skip-inner {
            background: rgba(0, 0, 0, 0.04);
            border-color: rgba(0, 0, 0, 0.08);
        }
        .progress-row {
            padding: 5px 12px;
            font-size: 11px;
            font-weight: 500;
            color: var(--text-secondary);
            text-align: center;
            white-space: nowrap;
            letter-spacing: 0.3px;
        }
        .skip-row {
            padding: 5px 12px;
            font-size: 11px;
            font-weight: 500;
            border-radius: 8px;
            border: none;
            color: var(--text-tertiary);
            background: transparent;
            cursor: pointer;
            transition: all 0.25s ease;
            font-family: inherit;
            white-space: nowrap;
            text-align: center;
            letter-spacing: 0.2px;
        }
        .skip-row:hover {
            color: var(--text-primary);
            background: rgba(255, 255, 255, 0.08);
        }
        [data-theme="light"] .skip-row:hover {
            background: rgba(0, 0, 0, 0.05);
        }
        .skip-row:active {
            transform: scale(0.95);
        }
        
        .mic-mode-toggle {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 0;
            font-family: inherit;
        }
        .mic-mode-switch {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 0;
            background: rgba(255, 255, 255, 0.06);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 0.5px solid rgba(255, 255, 255, 0.1);
            border-radius: 10px;
            overflow: hidden;
            padding: 2px;
        }
        [data-theme="light"] .mic-mode-switch {
            background: rgba(0, 0, 0, 0.04);
            border-color: rgba(0, 0, 0, 0.08);
        }
        .mic-mode-btn {
            padding: 5px 12px;
            font-size: 11px;
            font-weight: 400;
            border-radius: 8px;
            border: none;
            color: var(--text-tertiary);
            background: transparent;
            cursor: pointer;
            transition: all 0.25s ease;
            font-family: inherit;
            white-space: nowrap;
            letter-spacing: 0.2px;
        }
        [data-theme="light"] .mic-mode-btn {
            color: rgba(26, 26, 46, 0.35);
        }
        .mic-mode-btn.active {
            background: rgba(255, 255, 255, 0.12);
            color: var(--text-primary);
            font-weight: 500;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
        }
        [data-theme="light"] .mic-mode-btn.active {
            background: rgba(255, 255, 255, 0.7);
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }
        .mic-mode-btn:not(.active):hover {
            color: var(--text-secondary);
            background: rgba(255, 255, 255, 0.05);
        }
        
        /* Hold to speak button — Telegram style round blue, BIG */
        .speak-btn {
            width: 108px;
            height: 108px;
            padding: 0;
            border: none;
            border-radius: 50%;
            background: #2AABEE;
            color: #ffffff;
            font-size: 0;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: border-radius 0.4s cubic-bezier(.4,0,.2,1),
                        background 0.3s ease,
                        box-shadow 0.3s ease,
                        transform 0.08s ease-out;
            box-shadow: 0 6px 20px rgba(42, 171, 238, 0.45);
            user-select: none;
            -webkit-user-select: none;
            touch-action: none;
            --audio-level: 0;
            font-family: inherit;
            flex-shrink: 0;
        }
        .speak-btn span:last-child {
            display: none;
        }
        .speak-btn:active, .speak-btn.pressed {
            background: #FF3B30;
            box-shadow: 0 6px 20px rgba(255, 59, 48, 0.45);
        }
        .speak-btn:hover:not(.auto-mic-mode):not(.pressed) {
            background: #229ED9;
            box-shadow: 0 8px 24px rgba(42, 171, 238, 0.5);
        }
        /* PTT mode listening — vibrates (scales) with audio, color stays from pressed state */
        .speak-btn.listening {
            transform: scale(calc(1 + var(--audio-level) * 0.12));
        }
        .speak-btn.pressed.listening {
            box-shadow: 
                0 0 calc(var(--audio-level) * 20px + 8px) rgba(255, 59, 48, calc(var(--audio-level) * 0.4 + 0.25)),
                0 6px 20px rgba(255, 59, 48, 0.45);
        }
        /* PTT idle — round blue Telegram style */
        .speak-btn.ptt-idle {
            background: #2AABEE;
            border: none;
            border-radius: 50%;
            box-shadow: 0 6px 20px rgba(42, 171, 238, 0.45);
            color: #ffffff;
        }

        /* Loading pulse animation during cold start */
        @keyframes loadingPulse {
            0%, 100% { opacity: 0.6; transform: scale(1); }
            50%      { opacity: 1;   transform: scale(1.06); }
        }
        .speak-btn.loading {
            animation: loadingPulse 1.5s ease-in-out infinite;
            pointer-events: none;
        }
        .speak-btn.ptt-idle .mic-icon svg {
            stroke: #ffffff;
        }
        .speak-btn .mic-icon {
            display: flex;
            align-items: center;
        }
        .speak-btn .mic-icon svg {
            width: 42px;
            height: 42px;
            stroke: #ffffff;
            fill: none;
            stroke-width: 2;
            stroke-linecap: round;
            stroke-linejoin: round;
            transition: stroke 0.2s;
        }
        .speak-btn.listening .mic-icon svg,
        .speak-btn.pressed .mic-icon svg {
            stroke: #ffffff;
        }
        
        /* Auto-mic mode — square neumorphic inset indicator, not clickable */
        .speak-btn.auto-mic-mode {
            border-radius: 26px;
            background: var(--glass-bg);
            border: 0.5px solid var(--glass-border);
            box-shadow: 
                inset 0 3px 8px rgba(0, 0, 0, 0.25),
                inset 0 1px 2px rgba(0, 0, 0, 0.15),
                0 1px 0 rgba(255, 255, 255, 0.08);
            cursor: default;
            pointer-events: none;
            position: relative;
        }
        [data-theme="light"] .speak-btn.auto-mic-mode {
            box-shadow: 
                inset 0 3px 8px rgba(0, 0, 0, 0.1),
                inset 0 1px 2px rgba(0, 0, 0, 0.06),
                0 1px 0 rgba(255, 255, 255, 0.6);
        }
        .speak-btn.auto-mic-mode .mic-icon svg {
            stroke: var(--text-tertiary);
            opacity: 0.6;
        }
        .speak-btn.auto-mic-mode.paused {
            cursor: pointer;
            pointer-events: auto;
        }
        /* Auto-mic listening: grey glow + vibrate with audio level */
        .speak-btn.auto-mic-mode.listening {
            background: rgba(160, 160, 160, 0.12);
            border-color: rgba(160, 160, 160, 0.3);
            transform: scale(calc(1 + var(--audio-level) * 0.08));
            box-shadow: 
                inset 0 2px 6px rgba(0, 0, 0, 0.15),
                0 0 calc(var(--audio-level) * 20px + 4px) rgba(160, 160, 160, calc(var(--audio-level) * 0.4 + 0.1)),
                0 0 calc(var(--audio-level) * 35px + 8px) rgba(190, 190, 190, calc(var(--audio-level) * 0.25));
        }
        [data-theme="light"] .speak-btn.auto-mic-mode.listening {
            background: rgba(140, 140, 140, 0.1);
            box-shadow: 
                inset 0 2px 6px rgba(0, 0, 0, 0.06),
                0 0 calc(var(--audio-level) * 20px + 4px) rgba(140, 140, 140, calc(var(--audio-level) * 0.3 + 0.08)),
                0 0 calc(var(--audio-level) * 35px + 8px) rgba(170, 170, 170, calc(var(--audio-level) * 0.2));
        }
        .speak-btn.auto-mic-mode.listening .mic-icon svg {
            stroke: #9ca3af;
            opacity: 1;
        }
        
        /* Home screen (own page, normal flow) */
        .home-screen {
            width: 100%;
            max-width: 600px;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            min-height: 100dvh;
        }
        @media (min-width: 600px) {
            .home-screen {
                max-width: 600px;
                padding-left: 16px;
                padding-right: 16px;
            }
        }
        
        /* Home Header */
        .home-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 20px;
            flex-shrink: 0;
        }
        .home-logo {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .logo-text {
            font-size: 20px;
            font-weight: 700;
            color: var(--text-primary);
            letter-spacing: -0.5px;
        }
        .logo-dot { color: var(--pink-primary); }
        .beta-badge {
            font-size: 9px;
            font-weight: 600;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            color: var(--pink-primary);
            border: 1px solid var(--pink-primary);
            border-radius: 6px;
            padding: 2px 5px;
            margin-left: 6px;
            line-height: 1;
            opacity: 0.7;
            vertical-align: middle;
        }
        .home-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: var(--lg-bg);
            border: 0.5px solid var(--lg-border);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            overflow: hidden;
            box-shadow: var(--lg-specular), 0 2px 8px rgba(0,0,0,0.15);
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
        }
        .home-avatar:hover {
            border-color: var(--cyan-accent);
            box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
        }

        /* Back button (freetalk page) */
        .back-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: var(--lg-bg);
            border: 0.5px solid var(--lg-border);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: var(--text-secondary);
            transition: all 0.2s;
        }
        .back-btn:hover {
            border-color: var(--cyan-accent);
            color: var(--text-primary);
        }

        /* Home Content (scrollable) */
        .home-content {
            flex: 1;
            overflow-y: auto;
            padding: 0 20px 32px;
            -webkit-overflow-scrolling: touch;
        }
        .home-title {
            font-size: 28px;
            font-weight: 700;
            line-height: 1.2;
            margin-bottom: 6px;
            color: var(--text-primary);
        }
        .home-title .accent { color: var(--cyan-accent); }
        .home-subtitle {
            font-size: 14px;
            color: var(--text-tertiary);
            margin-bottom: 16px;
            font-weight: 300;
            line-height: 1.5;
        }

        /* Difficulty Filter */
        .difficulty-filter {
            display: flex;
            gap: 8px;
            margin-bottom: 20px;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            justify-content: flex-end;
        }
        .diff-btn {
            padding: 10px 20px;
            border-radius: 24px;
            border: 0.5px solid var(--card-border);
            background: var(--card-bg);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            color: rgba(255, 255, 255, 0.3);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.3s;
            font-family: inherit;
            box-shadow: var(--glass-specular);
        }
        [data-theme="light"] .diff-btn {
            color: rgba(26, 26, 46, 0.35);
        }
        .diff-btn.active {
            background: var(--lg-bg);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border-color: var(--lg-border);
            color: var(--text-primary);
            box-shadow: var(--lg-specular), 0 4px 16px rgba(6, 182, 212, 0.15);
        }
        .diff-btn-free.active {
            border-color: rgba(168, 85, 247, 0.4);
            box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.15), 0 4px 16px rgba(168, 85, 247, 0.15);
        }
        .diff-btn-words.active {
            border-color: rgba(34, 197, 94, 0.4);
            box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.15), 0 4px 16px rgba(34, 197, 94, 0.15);
        }

        /* ===== Words section: stacked full-width layout ===== */
        .words-section .section-label-full {
            margin-bottom: 10px;
            margin-top: 32px;
        }
        .words-filter-row {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
            margin-bottom: 12px;
        }

        /* ===== Custom wordlist modal ===== */
        .modal-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.6);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            z-index: 999;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .modal-box {
            background: var(--modal-bg);
            backdrop-filter: blur(var(--lg-blur));
            -webkit-backdrop-filter: blur(var(--lg-blur));
            border: 0.5px solid var(--lg-border);
            border-radius: 20px;
            padding: 24px;
            max-width: 520px;
            width: 100%;
            max-height: 85vh;
            overflow-y: auto;
            position: relative;
            box-shadow: 0 24px 64px rgba(0,0,0,0.4);
        }
        .modal-close {
            position: absolute;
            top: 12px; right: 16px;
            background: none;
            border: none;
            color: var(--text-tertiary);
            font-size: 24px;
            cursor: pointer;
            line-height: 1;
        }
        .modal-title {
            font-size: 18px;
            font-weight: 700;
            color: var(--text-primary);
            margin: 0 0 6px;
        }
        .modal-hint {
            font-size: 13px;
            color: var(--text-tertiary);
            margin: 0 0 14px;
            line-height: 1.4;
        }
        .custom-wl-textarea {
            width: 100%;
            min-height: 120px;
            border-radius: 12px;
            border: 1px solid var(--card-border);
            background: rgba(0,0,0,0.25);
            color: var(--text-primary);
            padding: 12px;
            font-size: 14px;
            font-family: inherit;
            resize: vertical;
            box-sizing: border-box;
        }
        [data-theme="light"] .custom-wl-textarea {
            background: rgba(0,0,0,0.04);
        }
        .custom-wl-textarea:focus {
            outline: none;
            border-color: var(--cyan-accent);
        }
        .custom-wl-options {
            display: flex;
            gap: 14px;
            margin: 10px 0;
            font-size: 13px;
            color: var(--text-secondary);
            flex-wrap: wrap;
        }
        .custom-wl-options label {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .custom-wl-input {
            border-radius: 8px;
            border: 1px solid var(--card-border);
            background: rgba(0,0,0,0.25);
            color: var(--text-primary);
            padding: 6px 10px;
            font-size: 13px;
            font-family: inherit;
            width: 140px;
        }
        [data-theme="light"] .custom-wl-input {
            background: rgba(0,0,0,0.04);
        }
        .custom-wl-input:focus {
            outline: none;
            border-color: var(--cyan-accent);
        }
        .custom-wl-options select {
            border-radius: 8px;
            border: 1px solid var(--card-border);
            background: rgba(0,0,0,0.25);
            color: var(--text-primary);
            padding: 4px 8px;
            font-size: 13px;
        }
        [data-theme="light"] .custom-wl-options select {
            background: rgba(0,0,0,0.04);
        }
        .custom-wl-status {
            margin-top: 10px;
            padding: 10px 14px;
            border-radius: 10px;
            background: rgba(6, 182, 212, 0.08);
            border: 1px solid rgba(6, 182, 212, 0.2);
            font-size: 13px;
            color: var(--text-secondary);
            line-height: 1.5;
        }
        .custom-wl-preview {
            margin-top: 12px;
            padding: 12px;
            border-radius: 12px;
            background: rgba(34, 197, 94, 0.06);
            border: 1px solid rgba(34, 197, 94, 0.15);
            max-height: 200px;
            overflow-y: auto;
            font-size: 13px;
            line-height: 1.6;
            color: var(--text-secondary);
        }
        .custom-wl-preview .wl-word {
            display: inline-block;
            margin: 2px 4px;
            padding: 2px 8px;
            border-radius: 6px;
            background: rgba(34, 197, 94, 0.1);
            border: 1px solid rgba(34, 197, 94, 0.2);
            font-size: 13px;
        }
        .custom-wl-preview .wl-freq {
            color: var(--text-tertiary);
            font-size: 11px;
        }
        .custom-wl-actions {
            display: flex;
            gap: 10px;
            margin-top: 14px;
        }
        .btn-secondary {
            padding: 10px 18px;
            border-radius: 12px;
            border: 1px solid var(--card-border);
            background: var(--card-bg);
            color: var(--text-primary);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
            transition: all 0.2s;
        }
        .btn-secondary:hover {
            border-color: var(--cyan-accent);
            background: var(--card-hover-bg);
        }
        .btn-primary {
            padding: 10px 18px;
            border-radius: 12px;
            border: 1px solid rgba(34, 197, 94, 0.4);
            background: rgba(34, 197, 94, 0.15);
            color: var(--text-primary);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
            transition: all 0.2s;
        }
        .btn-primary:hover {
            background: rgba(34, 197, 94, 0.25);
            border-color: rgba(34, 197, 94, 0.6);
        }
        .btn-primary:disabled, .btn-secondary:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        /* "Add wordlist" card */
        .add-wordlist-card {
            border: 2px dashed rgba(34, 197, 94, 0.3);
            background: transparent;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            color: var(--text-tertiary);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            border-radius: 14px;
            padding: 16px 12px;
            transition: all 0.2s;
            font-family: inherit;
            min-height: 68px;
        }
        .add-wordlist-card:hover {
            border-color: rgba(34, 197, 94, 0.6);
            color: var(--text-secondary);
            background: rgba(34, 197, 94, 0.05);
        }
        .add-wordlist-card .add-icon {
            font-size: 20px;
        }
        .custom-pack-delete {
            margin-left: auto;
            font-size: 14px;
            opacity: 0.4;
            cursor: pointer;
            padding: 4px 6px;
            border-radius: 6px;
            transition: opacity 0.2s;
        }
        .custom-pack-delete:hover {
            opacity: 1;
            background: rgba(239, 68, 68, 0.1);
        }

        /* Free conversation card accent */
        .free-card {
            border-color: rgba(168, 85, 247, 0.2);
        }
        .free-card:hover {
            border-color: rgba(168, 85, 247, 0.4);
        }

        /* Section Headers */
        .back-link {
            background: none;
            border: none;
            color: var(--cyan-accent);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
        }

        /* ===== Free Talk Section (distinct bg) ===== */
        .free-talk-section {
            margin: 32px -20px 0;
            padding: 20px 20px 24px;
            border-radius: 20px;
            background: rgba(120, 120, 140, 0.15);
            border-top: 1px solid rgba(120, 120, 140, 0.2);
            border-bottom: 1px solid rgba(120, 120, 140, 0.2);
        }
        .free-talk-section .section-header {
            margin-top: 0;
        }
        [data-theme="light"] .free-talk-section {
            background: rgba(120, 120, 140, 0.12);
            border-top-color: rgba(120, 120, 140, 0.16);
            border-bottom-color: rgba(120, 120, 140, 0.16);
        }

        /* ===== Section Headers (Listen / Talk) ===== */
        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
            margin-top: 32px;
        }
        .examtalk-section,
        .tests-section {
            margin-top: 64px;
        }
        .section-header:first-child {
            margin-top: 12px;
        }
        .section-label {
            font-size: 20px;
            font-weight: 700;
            color: var(--text-primary);
            letter-spacing: -0.5px;
            margin: 0;
        }
        .section-label-colon {
            color: var(--pink-primary);
        }
        .section-desc {
            font-size: 14px;
            color: var(--text-tertiary);
            font-weight: 300;
            letter-spacing: 0;
        }
        .section-action-btn {
            padding: 10px 20px;
        }
        .section-header-right {
            display: flex;
            gap: 6px;
            flex-shrink: 0;
        }

        /* ===== Listen Carousel (Home) ===== */
        .listen-carousel {
            margin-bottom: 8px;
        }
        .carousel-track {
            display: flex;
            gap: 12px;
            overflow-x: auto;
            scroll-snap-type: x mandatory;
            -webkit-overflow-scrolling: touch;
            padding-bottom: 4px;
            scrollbar-width: none;
        }
        .carousel-track::-webkit-scrollbar { display: none; }

        .track-card {
            flex-shrink: 0;
            width: 150px;
            scroll-snap-align: start;
            cursor: pointer;
            transition: transform 0.2s;
        }
        .track-card:active { transform: scale(0.97); }
        .track-card.playing .card-art { border-color: var(--cyan-accent); }

        .card-art {
            position: relative;
            width: 150px;
            height: 150px;
            border-radius: 16px;
            overflow: hidden;
            border: 0.5px solid var(--card-border);
            background: var(--card-bg);
            margin-bottom: 8px;
        }
        .card-art img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .card-art-placeholder {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 48px;
            background: var(--card-bg);
        }

        .play-overlay {
            position: absolute;
            bottom: 0;
            right: 0;
            width: 44px;
            height: 44px;
            background: rgba(0, 0, 0, 0.55);
            backdrop-filter: blur(6px);
            -webkit-backdrop-filter: blur(6px);
            border-radius: 16px 0 16px 0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            transition: all 0.2s;
        }
        .play-overlay.active {
            background: var(--cyan-accent);
            color: #000;
        }

        .mini-progress-track {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: rgba(255, 255, 255, 0.1);
        }
        .mini-progress-bar {
            width: 0%;
            height: 100%;
            background: var(--cyan-accent);
            transition: width 0.1s linear;
        }

        .card-meta h3 {
            font-size: 12px;
            font-weight: 400;
            color: var(--text-tertiary);
            margin: 0;
            line-height: 1.3;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        .card-meta p {
            font-size: 11px;
            color: var(--text-tertiary);
            margin: 3px 0 0;
        }

        /* Track List */
        .track-list-view {
            flex: 1;
            overflow-y: auto;
            padding: 0 20px 32px;
            -webkit-overflow-scrolling: touch;
        }
        .track-list-view.hidden { display: none; }

        .track-list {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .track-list-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 12px;
            border-radius: 14px;
            border: 0.5px solid var(--card-border);
            background: var(--card-bg);
            cursor: pointer;
            transition: all 0.2s;
            font-family: inherit;
            text-align: left;
            width: 100%;
            color: var(--text-primary);
        }
        .track-list-item:hover:not(.disabled) {
            border-color: var(--card-hover-border);
            background: var(--card-hover-bg);
        }
        .track-list-item.active {
            border-color: var(--cyan-accent);
            background: rgba(6, 182, 212, 0.08);
        }
        .track-list-item.disabled {
            opacity: 0.45;
            cursor: default;
        }

        .tl-cover {
            width: 44px;
            height: 44px;
            border-radius: 10px;
            overflow: hidden;
            flex-shrink: 0;
            background: var(--glass-bg);
        }
        .tl-cover img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .tl-cover-placeholder {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
        }

        .tl-info { flex: 1; min-width: 0; }
        .tl-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .tl-meta {
            font-size: 11px;
            color: var(--text-tertiary);
            margin-top: 2px;
        }

        .tl-status { flex-shrink: 0; }
        .tl-soon {
            font-size: 10px;
            color: var(--text-tertiary);
            padding: 3px 8px;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.05);
            font-weight: 600;
            text-transform: uppercase;
        }

        /* Lyrics */
        .lyrics-viewport {
            flex: 1;
            overflow-y: auto;
            position: relative;
            mask-image: linear-gradient(transparent, black 15%, black 85%, transparent);
            -webkit-mask-image: linear-gradient(transparent, black 15%, black 85%, transparent);
            padding: 40px 0;
            min-height: 120px;
            scrollbar-width: none;
        }
        .lyrics-viewport::-webkit-scrollbar { display: none; }

        .lyrics-content {
            display: flex;
            flex-direction: column;
            gap: 4px;
            padding: 60px 0;
        }

        .lyric-line {
            text-align: center;
            padding: 10px 16px;
            font-size: 18px;
            color: rgba(255, 255, 255, 0.3);
            transition: all 0.3s ease;
            cursor: pointer;
            font-weight: 500;
            border-radius: 8px;
            line-height: 1.4;
        }
        [data-theme="light"] .lyric-line {
            color: rgba(0, 0, 0, 0.25);
        }
        .lyric-line:hover {
            color: rgba(255, 255, 255, 0.5);
        }
        [data-theme="light"] .lyric-line:hover {
            color: rgba(0, 0, 0, 0.45);
        }

        .lyric-line.active {
            color: var(--text-primary);
            transform: scale(1.08);
            font-weight: 700;
            font-size: 20px;
        }
        .lyric-line.no-lyrics {
            color: var(--text-tertiary);
            font-style: italic;
            cursor: default;
        }

        /* Player Controls */
        .player-controls {
            flex-shrink: 0;
            padding-top: 8px;
        }

        .player-seek {
            -webkit-appearance: none;
            appearance: none;
            width: 100%;
            height: 4px;
            border-radius: 2px;
            background: rgba(255, 255, 255, 0.1);
            outline: none;
            cursor: pointer;
        }
        [data-theme="light"] .player-seek {
            background: rgba(0, 0, 0, 0.1);
        }
        .player-seek::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: var(--cyan-accent);
            cursor: pointer;
        }
        .player-seek::-moz-range-thumb {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: var(--cyan-accent);
            border: none;
            cursor: pointer;
        }

        .player-buttons {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 24px;
        }

        .player-btn {
            border: none;
            background: none;
            color: var(--text-primary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.15s;
        }
        .player-btn:active { transform: scale(0.92); }

        .player-btn-main {
            width: 56px;
            height: 56px;
            border-radius: 50%;
            background: var(--cyan-accent);
            color: #000;
        }
        .player-btn-secondary {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.06);
        }

        /* Lesson/Topic/Pack Grid */
        .lesson-grid {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .topic-group-header {
            padding: 10px 4px 4px;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-tertiary);
        }
        .topic-group-header:first-child {
            padding-top: 4px;
        }
        .topic-group-cards {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }
        .lesson-card {
            background: var(--card-bg);
            backdrop-filter: blur(var(--glass-blur));
            -webkit-backdrop-filter: blur(var(--glass-blur));
            border: 0.5px solid var(--card-border);
            border-radius: 14px;
            padding: 10px 12px;
            text-align: left;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 10px;
            color: var(--text-primary);
            font-family: inherit;
            box-shadow: var(--glass-specular), var(--glass-shadow);
        }
        .lesson-card:hover {
            transform: translateY(-2px);
            border-color: var(--card-hover-border);
            background: var(--card-hover-bg);
            box-shadow: var(--glass-specular), 0 12px 40px rgba(0,0,0,0.12);
        }
        .card-icon {
            width: 28px;
            min-width: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            background: none !important;
        }
        .card-title {
            font-size: 14px;
            font-weight: 400;
            color: var(--text-primary);
            line-height: 1.3;
        }
        .card-meta {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 4px;
        }
        .tag {
            font-size: 11px;
            font-weight: 600;
            padding: 4px 10px;
            border-radius: 8px;
            background: var(--tag-bg);
            color: var(--tag-color);
        }
        .tag.a1 { background: rgba(6, 182, 212, 0.12); color: #22d3ee; }
        .tag.a2 { background: rgba(34, 197, 94, 0.12); color: #4ade80; }
        .tag.b1 { background: rgba(234, 179, 8, 0.12); color: #facc15; }
        .tag.free { background: rgba(168, 85, 247, 0.12); color: #c084fc; }
        .time {
            font-size: 11px;
            color: var(--text-tertiary);
        }

/* ============ REGISTRATION GATE OVERLAY ============ */
        .reg-gate-overlay {
            position: fixed;
            inset: 0;
            z-index: 600;
            display: none;
            align-items: center;
            justify-content: center;
            background: rgba(0,0,0,0.75);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            animation: regGateFadeIn 0.4s ease;
        }
        .reg-gate-overlay.visible { display: flex; }
        @keyframes regGateFadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        .reg-gate-card {
            text-align: center;
            padding: 40px 32px;
            max-width: 360px;
            width: 90%;
            background: var(--bg-secondary);
            border-radius: 20px;
            border: 1px solid var(--border);
            box-shadow: 0 20px 60px rgba(0,0,0,0.4);
            animation: regGateSlideUp 0.4s ease;
        }
        @keyframes regGateSlideUp {
            from { opacity: 0; transform: translateY(30px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .reg-gate-icon {
            font-size: 48px;
            margin-bottom: 16px;
        }
        .reg-gate-title {
            font-size: 1.2rem;
            font-weight: 600;
            color: var(--text-primary);
            margin: 0 0 8px;
            line-height: 1.5;
        }
        .reg-gate-sub {
            font-size: 0.85rem;
            color: var(--text-tertiary);
            margin: 0 0 24px;
        }
        .reg-gate-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 12px 28px;
            font-size: 1rem;
            font-weight: 600;
            color: #fff;
            background: linear-gradient(135deg, #4285f4, #34a853);
            border: none;
            border-radius: 12px;
            cursor: pointer;
            transition: transform 0.15s, box-shadow 0.15s;
        }
        .reg-gate-btn:hover {
            transform: scale(1.04);
            box-shadow: 0 6px 20px rgba(66,133,244,0.4);
        }
        .reg-gate-btn:active { transform: scale(0.98); }

        /* ============ PROFILE MODAL ============ */
        .profile-modal {
            position: fixed;
            inset: 0;
            z-index: 500;
            display: none;
            align-items: center;
            justify-content: center;
            background: rgba(0,0,0,0.6);
            backdrop-filter: blur(6px);
            -webkit-backdrop-filter: blur(6px);
        }
        .profile-modal.visible { display: flex; }

        .profile-modal-content {
            width: 90%;
            max-width: 420px;
            max-height: 85vh;
            overflow-y: auto;
            background: var(--modal-bg);
            backdrop-filter: blur(var(--lg-blur));
            -webkit-backdrop-filter: blur(var(--lg-blur));
            border: 0.5px solid var(--lg-border);
            border-radius: 20px;
            padding: 24px;
            box-shadow: 0 24px 64px rgba(0,0,0,0.3);
        }

        .profile-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        .profile-modal-header h2 {
            font-size: 18px;
            font-weight: 700;
            color: var(--text-primary);
            margin: 0;
        }
        .profile-modal-close {
            width: 32px;
            height: 32px;
            border: none;
            background: var(--card-bg);
            border-radius: 50%;
            color: var(--text-tertiary);
            font-size: 16px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }
        .profile-modal-close:hover {
            background: var(--card-border);
            color: var(--text-primary);
        }

        /* Registration gate hint inside profile modal */
        .reg-gate-hint {
            padding: 12px 16px;
            margin: 0 0 8px;
            background: rgba(66, 133, 244, 0.1);
            border: 1px solid rgba(66, 133, 244, 0.25);
            border-radius: 12px;
            text-align: center;
        }
        .reg-gate-hint p {
            margin: 0;
            font-size: 0.9rem;
            color: var(--text-secondary);
            line-height: 1.5;
        }

        .profile-section {
            margin-bottom: 20px;
        }
        .profile-label {
            display: block;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 10px;
        }

        .gender-toggle {
            display: flex;
            gap: 4px;
            margin-bottom: 10px;
        }
        .gender-btn {
            flex: 1;
            padding: 8px 0;
            border: 1px solid var(--card-border);
            border-radius: 8px;
            background: transparent;
            color: var(--text-secondary);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all .15s;
        }
        .gender-btn:hover { border-color: var(--accent); color: var(--text-primary); }
        .gender-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }

        .profile-name-select {
            width: 100%;
            padding: 12px 14px;
            border: 1px solid var(--card-border);
            border-radius: 10px;
            background: var(--card-bg);
            color: var(--text-primary);
            font-size: 15px;
            font-family: inherit;
            appearance: none;
            -webkit-appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='2' fill='none'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 14px center;
            cursor: pointer;
            transition: border-color .15s;
        }
        .profile-name-select:focus {
            outline: none;
            border-color: var(--accent);
        }
        .profile-name-select option {
            background: var(--card-bg);
            color: var(--text-primary);
            padding: 8px;
        }
        .profile-name-select optgroup {
            font-weight: 600;
            color: var(--text-secondary);
        }

        .profile-name-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 6px;
        }
        .profile-name-btn {
            padding: 10px 12px;
            border: 0.5px solid var(--card-border);
            border-radius: 10px;
            background: var(--card-bg);
            color: var(--text-primary);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            text-align: left;
            font-family: inherit;
        }
        .profile-name-btn .name-gender {
            font-size: 11px;
            color: var(--text-tertiary);
            margin-left: 4px;
        }

        .name-auto-badge {
            display: inline-block;
            font-size: 9px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            padding: 1px 5px;
            border-radius: 4px;
            background: rgba(34, 197, 94, 0.15);
            color: #22c55e;
            margin-left: 4px;
            vertical-align: middle;
        }

        .profile-country-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 6px;
        }
        .profile-country-btn {
            padding: 10px 12px;
            border: 0.5px solid var(--card-border);
            border-radius: 10px;
            background: var(--card-bg);
            color: var(--text-primary);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            text-align: left;
            font-family: inherit;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .profile-country-btn .country-flag {
            font-size: 18px;
        }

        .profile-voice-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 6px;
        }
        .profile-voice-btn {
            padding: 8px 10px;
            border: 0.5px solid var(--card-border);
            border-radius: 10px;
            background: var(--card-bg);
            color: var(--text-primary);
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
            font-family: inherit;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
        }
        .profile-voice-btn .voice-name {
            font-weight: 600;
            font-size: 13px;
        }
        .profile-voice-btn .voice-desc {
            font-size: 11px;
            color: var(--text-tertiary);
        }

        /* Profile buttons — shared hover & selected */
        .profile-name-btn:hover,
        .profile-country-btn:hover,
        .profile-voice-btn:hover {
            border-color: var(--cyan-accent);
            background: rgba(6, 182, 212, 0.05);
        }
        .profile-name-btn.selected,
        .profile-country-btn.selected,
        .profile-voice-btn.selected {
            border-color: var(--cyan-accent);
            background: rgba(6, 182, 212, 0.12);
            box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.15);
        }

        .profile-summary {
            padding: 14px 16px;
            background: var(--card-bg);
            border: 0.5px solid var(--card-border);
            border-radius: 12px;
            margin-bottom: 16px;
            font-size: 14px;
            color: var(--text-secondary);
            line-height: 1.5;
            min-height: 44px;
        }
        .profile-summary .summary-label {
            font-size: 12px;
            color: var(--text-tertiary);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.3px;
            margin-bottom: 4px;
        }
        .profile-summary .summary-text {
            color: var(--text-primary);
            font-weight: 500;
        }

        .profile-save-btn {
            width: 100%;
            padding: 14px;
            border: none;
            border-radius: 12px;
            background: linear-gradient(135deg, #06b6d4, #0891b2);
            color: white;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            font-family: inherit;
        }
        .profile-save-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 16px rgba(6, 182, 212, 0.3);
        }
        .profile-save-btn:active {
            transform: translateY(0);
        }
        .profile-save-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        /* ── Account section in profile modal ── */
        .profile-account-section {
            margin-bottom: 20px;
            padding-top: 16px;
            border-top: 0.5px solid var(--card-border);
        }
        .account-hint {
            font-size: 12px;
            color: var(--text-tertiary);
            margin-top: 8px;
            line-height: 1.4;
        }
        #googleSignInBtn {
            display: inline-flex;
            justify-content: center;
            min-height: 44px;
        }
        .account-not-logged {
            display: flex;
            justify-content: center;
        }
        .account-logged {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .account-info {
            display: flex;
            align-items: center;
            gap: 12px;
            flex: 1;
            min-width: 0;
        }
        .account-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
            flex-shrink: 0;
            border: 0.5px solid var(--card-border);
        }
        .account-details {
            flex: 1;
            min-width: 0;
        }
        .account-name {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .account-email {
            font-size: 12px;
            color: var(--text-tertiary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .account-logout-btn {
            padding: 6px 14px;
            border: 0.5px solid rgba(239, 68, 68, 0.3);
            border-radius: 8px;
            background: rgba(239, 68, 68, 0.08);
            color: #f87171;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
            transition: all 0.2s;
            flex-shrink: 0;
        }
        .account-logout-btn:hover {
            background: rgba(239, 68, 68, 0.18);
            border-color: rgba(239, 68, 68, 0.5);
        }

        /* Header avatar (Google profile pic) */
        .header-avatar-img {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            object-fit: cover;
        }

        /* ── Opened-lesson badge ── */
        .lesson-card.lesson-opened {
            position: relative;
            border-color: rgba(34, 197, 94, 0.25);
        }
        .opened-badge {
            position: absolute;
            top: -4px;
            right: -4px;
            width: 18px;
            height: 18px;
            background: rgba(34, 197, 94, 0.9);
            color: white;
            border-radius: 50%;
            font-size: 11px;
            font-weight: 700;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 1px 4px rgba(0,0,0,0.2);
            line-height: 1;
        }

        .profile-theme-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0;
            margin-bottom: 16px;
        }
        .profile-theme-row .profile-label {
            margin-bottom: 0;
        }
        .profile-theme-toggle {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 16px;
            border: 0.5px solid var(--card-border);
            border-radius: 10px;
            background: var(--card-bg);
            color: var(--text-secondary);
            font-size: 13px;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s;
        }
        .profile-theme-toggle:hover {
            background: var(--hover-bg, rgba(255,255,255,0.05));
            color: var(--text-primary);
        }
        .profile-theme-toggle svg {
            flex-shrink: 0;
        }

        /* ===== PLAYER MODAL ===== */
        .player-modal {
            position: fixed;
            inset: 0;
            z-index: 600;
            display: none;
            align-items: center;
            justify-content: center;
            background: rgba(0,0,0,0.6);
            backdrop-filter: blur(6px);
            -webkit-backdrop-filter: blur(6px);
        }
        .player-modal.visible { display: flex; }

        .player-modal-content {
            width: 90%;
            max-width: 420px;
            max-height: 90vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            background: var(--modal-bg);
            backdrop-filter: blur(var(--lg-blur));
            -webkit-backdrop-filter: blur(var(--lg-blur));
            border: 0.5px solid var(--lg-border);
            border-radius: 20px;
            padding: 0 0 12px;
            box-shadow: 0 24px 64px rgba(0,0,0,0.3);
            position: relative;
        }

        /* Header buttons - floating over hero */
        .pm-tracklist-header {
            position: absolute;
            top: 12px;
            left: 12px;
            z-index: 10;
            padding: 6px 14px;
            border-radius: 20px;
            border: none;
            background: rgba(0,0,0,0.45);
            color: #fff;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            white-space: nowrap;
        }
        .pm-tracklist-header:active {
            transform: scale(0.95);
        }

        .pm-close-btn {
            position: absolute;
            top: 12px;
            right: 12px;
            z-index: 10;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            border: none;
            background: rgba(0,0,0,0.45);
            color: #fff;
            font-size: 16px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }

        /* Hero cover image — taller */
        .pm-hero {
            position: relative;
            width: 100%;
            height: 200px;
            flex-shrink: 0;
            overflow: hidden;
            border-radius: 20px 20px 0 0;
        }
        .pm-hero img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .pm-hero-fade {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 60px;
            background: linear-gradient(transparent, var(--modal-bg));
        }

        /* Title row below hero */
        .pm-title-row {
            padding: 8px 20px 0;
            flex-shrink: 0;
        }
        .pm-title-row h2 {
            font-size: 18px;
            font-weight: 700;
            margin: 0 0 2px;
        }
        .pm-title-row .pm-meta {
            font-size: 12px;
            color: var(--text-tertiary);
            margin: 0;
        }

        /* Seek bar row */
        .pm-seek-row {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 20px 0;
            flex-shrink: 0;
        }
        .pm-seek-row span {
            font-size: 11px;
            color: var(--text-tertiary);
            min-width: 32px;
        }
        .pm-seek-row span:last-child {
            text-align: right;
        }
        .pm-seek-row .player-seek {
            flex: 1;
        }

        /* Lyrics area - maximize space */
        .player-modal-content .lyrics-viewport {
            flex: 1;
            min-height: 80px;
        }

        /* Controls — glassmorphism bar at bottom */
        .player-modal-content .player-controls {
            flex-shrink: 0;
            padding: 0;
        }

        .pm-glass-bar {
            margin: 0 12px 0;
            padding: 10px 24px;
            border-radius: 18px;
            background: rgba(255,255,255,0.12);
            border: 0.5px solid rgba(255,255,255,0.2);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        }
        [data-theme="light"] .pm-glass-bar {
            background: rgba(255,255,255,0.55);
            border-color: rgba(0,0,0,0.08);
            box-shadow: 0 2px 12px rgba(0,0,0,0.06);
        }

        .player-buttons-row {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 20px;
        }

        .player-buttons-row .player-btn-main {
            width: 52px;
            height: 52px;
        }
        .player-buttons-row .player-btn-secondary {
            width: 38px;
            height: 38px;
        }

        /* ============================================================
           WORD CARDS (home page)
           ============================================================ */

        .word-card {
            flex-direction: row !important;
            align-items: center !important;
        }
        .word-card .card-info {
            flex: 1;
            min-width: 0;
        }
        .card-word-meta {
            font-size: 11px;
            color: var(--text-tertiary);
            margin-top: 2px;
        }
        .card-word-bar {
            margin-top: 4px;
            height: 3px;
            background: var(--card-border);
            border-radius: 2px;
            overflow: hidden;
        }
        .card-word-bar-fill {
            height: 100%;
            background: var(--cyan-accent);
            border-radius: 2px;
            transition: width 0.3s ease;
        }

        /* ============================================================
           WORDS PAGE — Flashcard Trainer
           ============================================================ */
        .words-page {
            min-height: 100vh;
            min-height: 100dvh;
            display: flex;
            flex-direction: column;
            background: var(--bg-primary);
            color: var(--text-primary);
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }

        .words-header {
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
            width: 100%;
            box-sizing: border-box;
            padding-top: max(16px, env(safe-area-inset-top));
        }
        .words-header-right {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .words-progress-badge {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-tertiary);
            background: var(--card-bg);
            border: 0.5px solid var(--card-border);
            border-radius: 12px;
            padding: 4px 10px;
        }

        /* Flashcard area */
        .words-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            padding: 16px 16px 20px;
            gap: 24px;
            width: 100%;
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
            box-sizing: border-box;
        }

        .flashcard-container {
            width: 100%;
            max-width: 380px;
            perspective: 1000px;
            cursor: pointer;
        }
        .flashcard-container.slide-in {
            animation: slideInCard 0.25s ease-out;
        }
        @keyframes slideInCard {
            from { opacity: 0; transform: translateX(30px); }
            to   { opacity: 1; transform: translateX(0); }
        }

        .flashcard {
            position: relative;
            width: 100%;
            min-height: 240px;
            transition: transform 0.4s cubic-bezier(.4,0,.2,1);
            transform-style: preserve-3d;
        }
        .flashcard.flipped {
            transform: rotateY(180deg);
        }

        .flashcard-front, .flashcard-back {
            position: absolute;
            width: 100%;
            min-height: 240px;
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 32px 24px;
            border-radius: 20px;
            background: var(--card-bg);
            border: 0.5px solid var(--card-border);
            box-shadow: var(--glass-specular), var(--glass-shadow);
            box-sizing: border-box;
        }
        .flashcard-back {
            transform: rotateY(180deg);
        }

        .fc-greek {
            font-size: 36px;
            font-weight: 600;
            color: var(--text-primary);
            text-align: center;
            line-height: 1.3;
        }
        .fc-freq {
            font-size: 12px;
            color: var(--text-muted);
            margin-top: 8px;
        }
        .fc-tap-hint {
            font-size: 12px;
            color: var(--text-muted);
            margin-top: 16px;
            opacity: 0.6;
        }

        .fc-greek-small {
            font-size: 22px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 8px;
        }
        .fc-russian {
            font-size: 28px;
            font-weight: 500;
            color: var(--cyan-accent);
            text-align: center;
            margin-bottom: 16px;
        }
        .fc-compound {
            font-size: 15px;
            color: var(--text-secondary);
            text-align: center;
            margin-bottom: 12px;
            line-height: 1.6;
        }
        .cpd-part {
            font-weight: 600;
            color: var(--text-primary);
        }
        .cpd-meaning {
            font-size: 13px;
            color: var(--text-tertiary);
            margin: 0 2px;
        }
        .fc-example {
            text-align: center;
            padding: 12px 16px;
            background: var(--bg-secondary);
            border-radius: 12px;
            width: 100%;
            max-width: 380px;
            opacity: 1;
            transform: translateY(0);
            transition: opacity 0.3s ease, transform 0.3s ease;
        }
        .fc-example.hidden {
            opacity: 0;
            transform: translateY(12px);
            pointer-events: none;
        }
        .fc-example-gr {
            font-size: 19px;
            color: var(--text-primary);
            font-weight: 500;
            line-height: 1.4;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }
        .fc-audio-icon {
            font-size: 14px;
            opacity: 0.5;
        }
        .fc-example-ru {
            font-size: 15px;
            color: var(--text-tertiary);
            margin-top: 6px;
            line-height: 1.4;
            font-style: italic;
        }

        /* Card navigation (prev / counter / next) */
        .fc-nav {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 16px;
            width: 100%;
            max-width: 380px;
        }
        .fc-nav-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            border: 1px solid var(--card-border);
            background: var(--card-bg);
            color: var(--text-secondary);
            font-size: 16px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            -webkit-tap-highlight-color: transparent;
        }
        .fc-nav-btn:active {
            transform: scale(0.9);
            background: var(--bg-secondary);
        }
        .fc-nav-btn:disabled {
            opacity: 0.3;
            cursor: default;
        }
        .fc-nav-counter {
            font-size: 15px;
            font-weight: 600;
            color: var(--text-secondary);
            min-width: 50px;
            text-align: center;
        }

        /* Answer buttons */
        .fc-buttons {
            display: flex;
            gap: 12px;
            width: 100%;
            max-width: 380px;
            justify-content: center;
            opacity: 1;
            transform: translateY(0);
            transition: opacity 0.3s ease, transform 0.3s ease;
        }
        .fc-buttons.hidden {
            opacity: 0;
            transform: translateY(12px);
            pointer-events: none;
        }
        .fc-btn {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            padding: 14px 8px;
            border: 0.5px solid var(--card-border);
            border-radius: 14px;
            background: var(--card-bg);
            cursor: pointer;
            transition: all 0.2s;
            font-family: inherit;
            color: var(--text-primary);
        }
        .fc-btn:active {
            transform: scale(0.95);
        }
        .fc-btn-icon {
            font-size: 20px;
            font-weight: 700;
        }
        .fc-btn-label {
            font-size: 12px;
            color: var(--text-tertiary);
        }
        .fc-btn-wrong .fc-btn-icon { color: #ef4444; }
        .fc-btn-ok .fc-btn-icon { color: #f59e0b; }
        .fc-btn-right .fc-btn-icon { color: #22c55e; }

        .fc-btn-wrong:active { background: rgba(239, 68, 68, 0.1); }
        .fc-btn-ok:active { background: rgba(245, 158, 11, 0.1); }
        .fc-btn-right:active { background: rgba(34, 197, 94, 0.1); }

        /* Session complete */
        .session-complete {
            position: fixed;
            inset: 0;
            background: var(--bg-primary);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 32px 24px;
            z-index: 100;
        }
        .session-complete.hidden {
            display: none;
        }
        .sc-icon {
            font-size: 56px;
            margin-bottom: 16px;
        }
        .sc-title {
            font-size: 22px;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 24px;
        }
        .sc-stats {
            width: 100%;
            max-width: 280px;
            margin-bottom: 32px;
        }
        .sc-stat-row {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
        }
        .sc-stat-label {
            font-size: 15px;
            color: var(--text-secondary);
        }
        .sc-stat-value {
            font-size: 15px;
            font-weight: 600;
            color: var(--text-primary);
        }
        .sc-right { color: #22c55e; }
        .sc-ok { color: #f59e0b; }
        .sc-wrong { color: #ef4444; }
        .sc-stat-divider {
            height: 1px;
            background: var(--card-border);
            margin: 8px 0;
        }
        .sc-btn {
            width: 100%;
            max-width: 280px;
            padding: 14px;
            border-radius: 14px;
            font-size: 16px;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            border: none;
            margin-bottom: 10px;
            transition: all 0.2s;
        }
        .sc-btn:active {
            transform: scale(0.97);
        }
        .sc-btn-primary {
            background: var(--cyan-accent);
            color: #fff;
        }
        .sc-btn-secondary {
            background: var(--card-bg);
            border: 0.5px solid var(--card-border);
            color: var(--text-secondary);
        }

        /* ============================================================
           WORDS PAGE — Mode Tabs (uses diff-btn pattern)
           ============================================================ */
        .words-mode-tabs {
            display: flex;
            gap: 6px;
            padding: 8px 16px;
            background: transparent;
            width: 100%;
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
            box-sizing: border-box;
        }
        .words-mode-tabs.hidden { display: none; }
        .mode-tab {
            flex: 1;
            padding: 10px 6px;
            border-radius: 24px;
            border: 0.5px solid var(--card-border);
            background: var(--card-bg);
            color: var(--text-tertiary);
            font-size: 13px;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.3s;
            text-align: center;
            white-space: nowrap;
            box-shadow: var(--glass-specular);
        }
        .mode-tab.active {
            background: var(--lg-bg);
            border-color: var(--lg-border);
            color: var(--text-primary);
            box-shadow: var(--lg-specular), 0 4px 16px rgba(6, 182, 212, 0.15);
        }
        .mode-tab:active { transform: scale(0.97); }

        /* Dictionary button in header */
        .words-dict-btn {
            background: var(--card-bg);
            border: 0.5px solid var(--card-border);
            border-radius: 10px;
            padding: 5px 9px;
            font-size: 16px;
            cursor: pointer;
            line-height: 1;
            transition: all 0.2s;
            box-shadow: var(--glass-specular);
        }
        .words-dict-btn:active { transform: scale(0.95); }

        /* ============================================================
           QUIZ (Multiple Choice) — uses lesson-card pattern
           ============================================================ */
        .quiz-prompt {
            font-size: 36px;
            font-weight: 600;
            text-align: center;
            color: var(--text-primary);
            padding: 24px 16px 8px;
        }
        .quiz-prompt.slide-in {
            animation: slideInCard 0.25s ease-out;
        }
        .quiz-counter {
            font-size: 13px;
            color: var(--text-muted);
            text-align: center;
            margin-bottom: 24px;
        }
        .quiz-options {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            width: 100%;
            max-width: 380px;
            padding: 0 16px;
        }
        .quiz-opt {
            padding: 16px 12px;
            border: 0.5px solid var(--card-border);
            border-radius: 14px;
            background: var(--card-bg);
            backdrop-filter: blur(var(--glass-blur));
            -webkit-backdrop-filter: blur(var(--glass-blur));
            color: var(--text-primary);
            font-size: 16px;
            font-weight: 500;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.3s;
            text-align: center;
            line-height: 1.3;
            box-shadow: var(--glass-specular), var(--glass-shadow);
        }
        .quiz-opt:active:not(:disabled) {
            transform: scale(0.97);
        }
        .quiz-opt-correct {
            background: rgba(34, 197, 94, 0.15) !important;
            border-color: rgba(34, 197, 94, 0.5) !important;
            color: #22c55e !important;
            box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.15), 0 4px 16px rgba(34, 197, 94, 0.15) !important;
        }
        .quiz-opt-wrong {
            background: rgba(239, 68, 68, 0.15) !important;
            border-color: rgba(239, 68, 68, 0.5) !important;
            color: #ef4444 !important;
            box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.15), 0 4px 16px rgba(239, 68, 68, 0.15) !important;
        }
        /* Feedback row: plain text left, next button right */
        .feedback-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-top: 14px;
            width: 100%;
            max-width: 420px;
            padding: 0 16px;
            box-sizing: border-box;
        }
        .feedback-row.hidden { display: none; }
        .next-btn-inline {
            padding: 10px 20px;
            border-radius: 12px;
            border: 1px solid rgba(6, 182, 212, 0.4);
            background: rgba(6, 182, 212, 0.12);
            color: var(--text-primary);
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
            transition: all 0.2s;
            white-space: nowrap;
            flex-shrink: 0;
        }
        .next-btn-inline:hover {
            background: rgba(6, 182, 212, 0.22);
            border-color: rgba(6, 182, 212, 0.6);
        }
        .feedback-text {
            display: flex;
            flex-direction: column;
            gap: 2px;
            padding-top: 4px;
        }
        .fb-word {
            font-size: 15px;
            font-weight: 600;
            color: var(--text-primary);
        }
        .fb-example {
            font-size: 13px;
            color: var(--text-tertiary);
            white-space: pre-line;
            line-height: 1.4;
        }

        /* ============================================================
           PHRASE EXERCISE — translate the example sentence
           ============================================================ */
        .phrase-greek {
            font-size: 22px;
            font-weight: 600;
            text-align: center;
            color: var(--text-primary);
            padding: 20px 16px 6px;
            line-height: 1.4;
        }
        .phrase-greek.slide-in {
            animation: slideInCard 0.25s ease-out;
        }
        .phrase-word {
            font-size: 14px;
            font-weight: 500;
            text-align: center;
            color: var(--accent);
            margin-bottom: 4px;
        }
        .phrase-options {
            grid-template-columns: 1fr !important;
            max-width: 420px !important;
        }
        .phrase-opt {
            font-size: 15px !important;
            padding: 14px 16px !important;
            text-align: left !important;
            line-height: 1.35;
        }

        /* ============================================================
           MATCH PAIRS — uses lesson-card pattern
           ============================================================ */
        .match-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
            max-width: 380px;
            padding: 8px 0 16px;
        }
        .match-timer {
            font-size: 18px;
            font-weight: 600;
            font-variant-numeric: tabular-nums;
            color: var(--text-secondary);
        }
        .match-score {
            font-size: 15px;
            font-weight: 600;
            color: var(--cyan-accent);
        }
        .match-board {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 8px;
            width: 100%;
            max-width: 400px;
            padding: 0 8px;
        }
        .match-board.hidden { display: none; }
        .match-tile {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            padding: 14px 6px;
            border: 0.5px solid var(--card-border);
            border-radius: 14px;
            background: var(--card-bg);
            backdrop-filter: blur(var(--glass-blur));
            -webkit-backdrop-filter: blur(var(--glass-blur));
            color: var(--text-primary);
            font-family: inherit;
            cursor: pointer;
            transition: all 0.3s;
            min-height: 70px;
            box-shadow: var(--glass-specular), var(--glass-shadow);
        }
        .match-tile:active:not(:disabled) {
            transform: scale(0.96);
        }
        .match-tile-type {
            font-size: 11px;
        }
        .match-tile-text {
            font-size: 14px;
            font-weight: 500;
            text-align: center;
            line-height: 1.2;
            word-break: break-word;
        }
        .match-tile-selected {
            border-color: var(--lg-border) !important;
            background: var(--lg-bg) !important;
            box-shadow: var(--lg-specular), 0 4px 16px rgba(6, 182, 212, 0.15) !important;
        }
        .match-tile-correct {
            border-color: rgba(34, 197, 94, 0.5) !important;
            background: rgba(34, 197, 94, 0.12) !important;
            box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.15) !important;
            animation: matchPop 0.3s ease;
        }
        .match-tile-wrong {
            border-color: rgba(239, 68, 68, 0.5) !important;
            background: rgba(239, 68, 68, 0.1) !important;
            box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.15) !important;
            animation: matchShake 0.4s ease;
        }
        .match-tile-matched {
            opacity: 0.25;
            pointer-events: none;
            transform: scale(0.92);
        }
        @keyframes matchPop {
            0% { transform: scale(1); }
            50% { transform: scale(1.08); }
            100% { transform: scale(1); }
        }
        @keyframes matchShake {
            0%, 100% { transform: translateX(0); }
            20% { transform: translateX(-4px); }
            40% { transform: translateX(4px); }
            60% { transform: translateX(-3px); }
            80% { transform: translateX(3px); }
        }

        /* Match done */
        .match-done {
            text-align: center;
            padding: 40px 20px;
        }
        .match-done.hidden { display: none; }
        .match-done-icon {
            font-size: 48px;
            margin-bottom: 12px;
        }
        .match-done-title {
            font-size: 22px;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 8px;
        }
        .match-done-time {
            font-size: 15px;
            color: var(--text-tertiary);
            margin-bottom: 24px;
        }

        /* ============================================================
           DICTIONARY VIEW — uses existing input + diff-btn patterns
           ============================================================ */
        .dict-view {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            width: 100%;
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
            box-sizing: border-box;
        }
        .dict-view.hidden { display: none; }

        .dict-search-wrap {
            padding: 8px 16px;
        }
        .dict-search {
            width: 100%;
            padding: 10px 14px;
            border: 0.5px solid var(--card-border);
            border-radius: 14px;
            background: var(--card-bg);
            backdrop-filter: blur(var(--glass-blur));
            -webkit-backdrop-filter: blur(var(--glass-blur));
            color: var(--text-primary);
            font-size: 15px;
            font-family: inherit;
            outline: none;
            box-sizing: border-box;
            transition: border-color 0.3s;
            box-shadow: var(--glass-specular);
        }
        .dict-search:focus {
            border-color: var(--cyan-accent);
            box-shadow: var(--glass-specular), 0 0 0 1px rgba(6, 182, 212, 0.2);
        }
        .dict-search::placeholder {
            color: var(--text-muted);
        }

        .dict-filters {
            display: flex;
            gap: 6px;
            padding: 4px 16px 8px;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }
        .dict-chip {
            padding: 7px 14px;
            border-radius: 24px;
            border: 0.5px solid var(--card-border);
            background: var(--card-bg);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            color: var(--text-tertiary);
            font-size: 12px;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.3s;
            flex-shrink: 0;
            box-shadow: var(--glass-specular);
        }
        .dict-chip.active {
            background: var(--lg-bg);
            border-color: var(--lg-border);
            color: var(--text-primary);
            box-shadow: var(--lg-specular), 0 4px 16px rgba(6, 182, 212, 0.15);
        }

        .dict-summary {
            padding: 4px 16px 8px;
            font-size: 12px;
            color: var(--text-muted);
            display: flex;
            gap: 4px;
            flex-wrap: wrap;
        }

        .dict-list {
            flex: 1;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            padding: 0 16px 24px;
        }
        .dict-row {
            border-bottom: 0.5px solid var(--card-border);
            cursor: pointer;
            transition: all 0.25s ease;
            user-select: none;
            -webkit-user-select: none;
        }
        .dict-row:active {
            background: rgba(255, 255, 255, 0.05);
        }
        [data-theme="light"] .dict-row:active {
            background: rgba(0, 0, 0, 0.03);
        }
        .dict-row-expanded {
            background: var(--card-bg);
            border-radius: 12px;
            border: 0.5px solid var(--card-border);
            margin: 4px 0;
            padding: 0 10px;
            box-shadow: var(--glass-specular);
        }
        .dict-row-main {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 0;
            min-height: 40px;
        }
        .dict-dot {
            font-size: 10px;
            flex-shrink: 0;
            width: 18px;
            text-align: center;
        }
        .dict-greek {
            font-size: 16px;
            font-weight: 600;
            color: var(--text-primary);
            min-width: 0;
        }
        .dict-russian {
            flex: 1;
            font-size: 14px;
            color: var(--text-tertiary);
            text-align: right;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .dict-freq {
            font-size: 11px;
            color: var(--text-muted);
            flex-shrink: 0;
        }
        .dict-row-selected {
            background: rgba(6, 182, 212, 0.12) !important;
            border-radius: 8px;
        }
        .dict-row-selected .dict-row-main {
            padding-left: 4px;
        }
        .dict-row-excluded {
            opacity: 0.45;
        }
        .dict-row-excluded .dict-greek {
            text-decoration: line-through;
        }
        .dict-restore-btn {
            border: none;
            background: rgba(6, 182, 212, 0.15);
            color: var(--cyan-accent);
            border-radius: 6px;
            padding: 3px 10px;
            font-size: 14px;
            cursor: pointer;
            flex-shrink: 0;
            font-family: inherit;
        }
        .dict-restore-btn:hover {
            background: rgba(6, 182, 212, 0.25);
        }
        .dict-delete-bar {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 16px;
            background: rgba(239, 68, 68, 0.08);
            border-radius: 10px;
            margin: 0 16px 8px;
        }
        .dict-delete-bar.hidden { display: none; }
        .dict-delete-count {
            flex: 1;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-secondary);
        }
        .dict-delete-btn {
            border: none;
            background: rgba(239, 68, 68, 0.15);
            color: #f87171;
            border-radius: 8px;
            padding: 6px 14px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
        }
        .dict-delete-btn:hover {
            background: rgba(239, 68, 68, 0.25);
        }
        .dict-deselect-btn {
            border: none;
            background: none;
            color: var(--text-tertiary);
            font-size: 16px;
            cursor: pointer;
            padding: 4px 8px;
            font-family: inherit;
        }
        .dict-row-detail {
            padding: 4px 0 12px 26px;
        }
        .dict-row-detail.hidden { display: none; }
        .dict-detail-example {
            font-size: 14px;
            color: var(--text-secondary);
            line-height: 1.4;
        }
        .dict-detail-example-ru {
            font-size: 13px;
            color: var(--text-muted);
            margin-top: 2px;
            line-height: 1.4;
        }
        .dict-detail-meta {
            font-size: 11px;
            color: var(--text-muted);
            margin-top: 6px;
        }

/* ============================================================
   TESTS — Results card + nav buttons (used by exam.html)
   ============================================================ */

.test-nav-btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.test-nav-btn:hover {
    background: var(--hover-bg, rgba(0,0,0,0.05));
}

.test-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.test-nav-next {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.test-nav-next:hover {
    filter: brightness(1.1);
}

.test-results-card {
    text-align: center;
    padding: 40px 20px;
    margin: 20px 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
}

.test-results-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.test-results-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.test-results-score {
    font-size: 36px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 4px;
}

.test-results-pct {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.test-results-details {
    font-size: 15px;
    color: var(--text-tertiary);
    line-height: 1.5;
    margin-bottom: 24px;
}

.test-results-card .test-nav-btn {
    display: block;
    width: 100%;
    margin-bottom: 8px;
}

/* Tests section on home page */
.test-card .card-word-meta {
    color: var(--text-tertiary);
    font-size: 12px;
}

/* ========== EXAM v2 STYLES ========== */

/* Exam page: scrollable, not centered */
.exam-scrollable {
    flex: unset;
    justify-content: flex-start;
    min-height: 0;
    padding-top: 8px;
    padding-bottom: 80px;
    overflow: visible;
}
body:has(.exam-scrollable) {
    display: block;
    overflow-y: auto;
}
body:has(.exam-scrollable) .home-screen {
    min-height: auto;
    display: block;
}

/* ── Progress header row ── */
.exam2-progress-header {
    display: flex;
    align-items: center;
    padding: 0 4px;
    margin-bottom: 0;
}

.exam2-question-counter {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ── Progress bar ── */
.exam2-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--card-border);
    border-radius: 3px;
    margin-bottom: 12px;
    overflow: hidden;
}

.exam2-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #06b6d4, #22c55e);
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 0%;
}

.exam2-accuracy-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    margin-top: 4px;
}

.exam2-circle-wrap {
    width: 70px;
    height: 70px;
}

.exam2-circle {
    width: 100%;
    height: 100%;
}

.exam2-circle-bg {
    stroke: var(--card-border);
}

.exam2-circle-fg {
    stroke: #22c55e;
    transition: stroke-dashoffset 0.5s ease;
}

.exam2-circle-text {
    font-size: 8px;
    font-weight: 700;
    fill: var(--text-primary);
    text-anchor: middle;
    dominant-baseline: middle;
}

.exam2-accuracy-sublabel {
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
    text-align: center;
}

/* ── Translate button + Question row ── */
.exam2-question-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 0 8px;
    margin-bottom: 6px;
}

.exam2-translate-btn {
    flex: 0 0 auto;
}

.exam2-translate-btn.active {
    background: var(--lg-bg);
    border-color: var(--lg-border);
    color: var(--text-primary);
    box-shadow: var(--lg-specular), 0 4px 16px rgba(6, 182, 212, 0.15);
}

/* ── Question ── */
.exam2-question {
    flex: 1;
    text-align: left;
    padding: 0;
}

.exam2-question-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}

.exam2-question-ru {
    display: none;
    margin-top: 8px;
    font-size: 15px;
    color: var(--text-tertiary);
    font-style: italic;
    line-height: 1.4;
}

.exam2-question-ru.exam2-ru-visible {
    display: block;
}

/* ── Option cards (2-column grid, home-card hover) ── */
.exam2-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    padding: 0 8px;
}

.exam2-opt-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 0.5px solid var(--card-border);
    border-radius: 14px;
    padding: 14px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-primary);
    font-family: inherit;
    box-shadow: var(--glass-specular), var(--glass-shadow);
    opacity: 1;
}

/* Hover — same as home page cards */
.exam2-opt-card:hover:not(:disabled):not(.exam2-opt-faded):not(.exam2-opt-correct) {
    transform: translateY(-2px);
    border-color: var(--card-hover-border);
    background: var(--card-hover-bg);
    box-shadow: var(--glass-specular), 0 12px 40px rgba(0,0,0,0.12);
}

.exam2-opt-card:active:not(:disabled):not(.exam2-opt-faded) {
    transform: scale(0.97);
}

.exam2-opt-card:disabled {
    cursor: default;
}

.exam2-opt-main {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
}

.exam2-opt-tr {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 400;
    line-height: 1.3;
}

/* Correct — green glow */
.exam2-opt-card.exam2-opt-correct {
    background: rgba(34, 197, 94, 0.12) !important;
    border-color: rgba(34, 197, 94, 0.5) !important;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.15), 0 4px 16px rgba(34, 197, 94, 0.12) !important;
}

.exam2-opt-card.exam2-opt-correct .exam2-opt-main {
    color: #1a1a2e;
    font-weight: 600;
}

.exam2-opt-card.exam2-opt-correct .exam2-opt-tr {
    color: #1a1a2e;
}

/* Wrong fade — smooth transition to transparent */
.exam2-opt-card.exam2-opt-faded {
    opacity: 0.2;
    transform: scale(0.97);
    pointer-events: none;
}

/* ── Nav buttons (mode-tab style, large) ── */
.exam2-nav {
    display: flex;
    gap: 10px;
    position: sticky;
    bottom: 0;
    padding: 12px 4px;
    background: var(--bg);
    z-index: 10;
}

.exam2-nav-btn {
    flex: 1;
}

.exam2-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.exam2-nav-next {
    background: var(--lg-bg) !important;
    border-color: var(--lg-border) !important;
    color: var(--text-primary) !important;
    box-shadow: var(--lg-specular), 0 4px 16px rgba(6, 182, 212, 0.15) !important;
}

.exam-pass-badge {
    font-size: 18px;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 12px;
    margin: 12px 0;
    display: inline-block;
}

.exam-passed {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.exam-failed {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.exam-review-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 20px 0 12px;
}

.exam-results-review {
    text-align: left;
    width: 100%;
}

.exam-review-item {
    border-radius: 10px;
    background: var(--bg);
    padding: 12px;
    margin-bottom: 8px;
}

.exam-review-q {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.exam-review-wrong {
    font-size: 13px;
    color: #ef4444;
    margin-bottom: 2px;
}

.exam-review-correct {
    font-size: 13px;
    color: #22c55e;
    font-weight: 600;
}

.exam-review-qru {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

/* ===== HOME FOOTER ===== */
.home-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 16px 24px;
    margin-top: 24px;
}
.footer-text {
    font-size: 13px;
    color: var(--text-tertiary);
}
.footer-tg-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #2AABEE;
    text-decoration: none;
    transition: opacity 0.2s;
}
.footer-tg-link:hover {
    opacity: 0.75;
}
.footer-tg-icon {
    flex-shrink: 0;
}
