        :root {
            --bg: var(--tg-theme-bg-color, #ffffff);
            --bg-secondary: var(--tg-theme-secondary-bg-color, #f1f5f9);
            --text: var(--tg-theme-text-color, #1e293b);
            --text-hint: var(--tg-theme-hint-color, #94a3b8);
            --text-link: var(--tg-theme-link-color, #3b82f6);
            --button: var(--tg-theme-button-color, #3b82f6);
            --button-text: var(--tg-theme-button-text-color, #ffffff);
            --success: #16a34a;
            --danger: #dc2626;
            --warning: #eab308;
            --radius: 12px;
            --radius-sm: 8px;
            --nav-height: 64px;
            --header-height: 56px;
            --safe-bottom: 20px;
            --font-scale: 1;
        }
        * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            background: linear-gradient(180deg, #eef2ff 0%, var(--bg, #f8fafc) 100%);
            color: var(--text);
            min-height: 100vh;
            overflow-x: hidden;
            font-size: calc(16px * var(--font-scale, 1));
        }
        .page {
            display: none;
            min-height: 100vh;
            padding-bottom: calc(80px + var(--safe-bottom, 20px));
            animation: fadeIn 0.2s ease;
        }
        .page.active { display: block; }
        .page.fullscreen { padding-bottom: 0; }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(8px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        .page-header {
            position: sticky; top: 0; z-index: 100;
            background: var(--bg);
            border-bottom: 1px solid var(--bg-secondary);
            padding: 0 16px; height: var(--header-height);
            display: flex; align-items: center; justify-content: space-between;
        }
        .page-header h1 { font-size: 1.1rem; font-weight: 700; }
        .back-btn { background: none; border: none; color: var(--text-link); font-size: 1rem; cursor: pointer; padding: 8px 0; }
        .bottom-nav {
            position: fixed; bottom: 0; left: 0; right: 0;
            padding-bottom: var(--safe-bottom, 20px);
            background: var(--bg);
            border-top: 1px solid var(--bg-secondary);
            display: flex; z-index: 200;
        }
        .nav-item {
            flex: 1; display: flex; flex-direction: column;
            align-items: center; justify-content: center; gap: 4px;
            cursor: pointer; border: none; background: none;
            color: var(--text-hint); font-size: 0.7rem; font-weight: 500;
            padding: 8px 0;
        }
        .nav-item.active { color: var(--button); }
        .nav-item svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
        .content { padding: 16px; }
        .card { background: var(--bg-secondary); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
        .card-white { background: var(--bg); border: 1px solid var(--bg-secondary); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
        .btn {
            display: inline-flex; align-items: center; justify-content: center; gap: 8px;
            padding: 12px 20px; border-radius: var(--radius-sm); border: none;
            font-size: 1rem; font-weight: 600; cursor: pointer; width: 100%;
            transition: opacity 0.15s, transform 0.1s;
        }
        .btn:active { transform: scale(0.97); opacity: 0.85; }
        .btn-primary { background: var(--button); color: var(--button-text); }
        .btn-secondary { background: var(--bg-secondary); color: var(--text); }
        .btn-success { background: var(--success); color: #fff; }
        .btn-danger { background: var(--danger); color: #fff; }
        .btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
        .badge-student { background: #e2e8f0; color: #475569; }
        .badge-teacher { background: #dbeafe; color: #1e40af; }
        .badge-super_admin { background: #fee2e2; color: #991b1b; }
        .test-card { background: var(--bg-secondary); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; border: 2px solid rgba(128,128,128,0.45); box-shadow: 0 4px 16px rgba(0,0,0,0.20); }
        /* Karta foni sahifa foniga qo'shilib ketmasligi uchun ustiga
           yengil oq parda — ikkala mavzuda ham ishlaydi */
        .test-card::before { content: ""; position: absolute; inset: 0; border-radius: var(--radius); background: rgba(255,255,255,0.06); pointer-events: none; }
        .test-card { position: relative; }
        .test-card:active { transform: scale(0.98); }
        /* Yuqori satrdagi amal tugmalari — nishon emas, aniq tugma ko'rinishi */
        .top-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border: none; border-radius: 10px; background: var(--accent, #2481cc); color: #fff; font-size: 0.88rem; font-weight: 600; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.18); }
        .top-btn:active { transform: scale(0.97); }
        .top-btn.secondary { background: rgba(128,128,128,0.25); color: var(--text-primary, inherit); }
        .test-card.locked { opacity: 0.6; cursor: not-allowed; }
        /* Sinovda foydalanuvchilar kartani bosish mumkinligini payqamadi —
           shuning uchun aniq ko'rinadigan tugma qo'shildi */
        .test-card .start-btn { display: block; width: 100%; margin-top: 14px; padding: 12px; border: none; border-radius: 10px; background: var(--accent, #2481cc); color: #fff; font-size: 0.95rem; font-weight: 700; text-align: center; }
        .test-card.locked .start-btn { background: #94a3b8; }
        .test-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
        .test-card p { font-size: 0.85rem; color: var(--text-hint); margin-bottom: 10px; }
        .test-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.8rem; color: var(--text-hint); }
        .limit-bar { background: var(--bg-secondary); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; font-size: 0.85rem; }
        .limit-dots { display: flex; gap: 6px; }
        .limit-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--text-hint); }
        .limit-dot.used { background: var(--button); border-color: var(--button); }
        .test-top-bar {
            position: sticky; top: 0; z-index: 110;
            background: var(--bg); padding: 10px 16px;
            border-bottom: 1px solid var(--bg-secondary);
            display: flex; justify-content: space-between; align-items: center;
        }
        .timer { font-weight: 700; font-size: 1.2rem; }
        .timer.warning { color: var(--warning); }
        .timer.danger { color: var(--danger); }
        .progress-bar { height: 4px; background: var(--bg-secondary); border-radius: 2px; overflow: hidden; margin-top: 8px; }
        .progress-fill { height: 100%; background: var(--button); border-radius: 2px; transition: width 0.3s; }
        .q-card {
            background: var(--bg-secondary); border-radius: var(--radius);
            padding: 16px; margin-bottom: 16px;
            border-left: 4px solid var(--bg-secondary);
        }
        .q-card.answered { border-left-color: var(--button); }
        .q-card.q-correct { border-left-color: var(--success); }
        .q-card.q-wrong { border-left-color: var(--danger); }
        .q-number { font-size: 0.8rem; color: var(--text-hint); font-weight: 600; margin-bottom: 8px; }
        .q-text { font-size: 1rem; font-weight: 600; line-height: 1.5; margin-bottom: 12px; }
        .q-image { width: 100%; border-radius: var(--radius-sm); margin-bottom: 12px; max-height: 200px; object-fit: contain; background: var(--bg); }
        .option {
            display: flex; align-items: center; gap: 10px;
            padding: 12px; border-radius: var(--radius-sm);
            border: 2px solid transparent; background: var(--bg);
            margin-bottom: 8px; cursor: pointer; width: 100%;
            text-align: left; transition: all 0.15s;
        }
        .option:active { transform: scale(0.99); }
        .option.selected { border-color: var(--button); background: rgba(59,130,246,0.08); }
        .option.correct { border-color: var(--success); background: rgba(22,163,74,0.1); }
        .option.wrong { border-color: var(--danger); background: rgba(220,38,38,0.1); }
        .option-letter {
            width: 30px; height: 30px; border-radius: 50%;
            background: var(--bg-secondary); display: flex;
            align-items: center; justify-content: center;
            font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
        }
        .option.selected .option-letter { background: var(--button); color: var(--button-text); }
        .option.correct .option-letter { background: var(--success); color: #fff; }
        .option.wrong .option-letter { background: var(--danger); color: #fff; }
        .option-text { font-size: 0.9rem; line-height: 1.4; }
        .option.disabled { pointer-events: none; opacity: 0.9; }
        .explanation-box {
            margin-top: 10px; padding: 10px; border-radius: 6px;
            background: rgba(59,130,246,0.08); font-size: 0.82rem;
            border-left: 3px solid var(--button);
        }
        .result-hero { text-align: center; padding: 32px 16px 24px; }
        .result-emoji { font-size: 4rem; }
        .result-score { font-size: 2.5rem; font-weight: 800; margin: 8px 0; }
        .result-percent { font-size: 1rem; color: var(--text-hint); }
        .result-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 16px 0; }
        .stat-box { background: var(--bg-secondary); border-radius: var(--radius-sm); padding: 12px 8px; text-align: center; }
        .stat-box .val { font-size: 1.4rem; font-weight: 700; }
        .stat-box .lbl { font-size: 0.7rem; color: var(--text-hint); margin-top: 2px; }
        .val-correct { color: var(--success); }
        .val-wrong { color: var(--danger); }
        .val-score { color: var(--button); }
        .profile-header { text-align: center; padding: 24px 16px 16px; }
        .avatar {
            width: 72px; height: 72px; border-radius: 50%;
            background: var(--button); color: var(--button-text);
            display: flex; align-items: center; justify-content: center;
            font-size: 2rem; font-weight: 700; margin: 0 auto 12px;
        }
        .profile-name { font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
        .stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
        .session-item {
            display: flex; justify-content: space-between; align-items: center;
            padding: 12px 16px; background: var(--bg-secondary);
            border-radius: var(--radius-sm); margin-bottom: 10px;
            cursor: pointer; transition: transform 0.15s;
            border: 1.5px solid rgba(128,128,128,0.35);
            box-shadow: 0 2px 8px rgba(0,0,0,0.12);
        }
        .session-item:active { transform: scale(0.98); }
        .session-item.no-click { cursor: default; }
        .session-item.no-click:active { transform: none; }
        .loading { display: flex; align-items: center; justify-content: center; padding: 48px 0; color: var(--text-hint); flex-direction: column; gap: 12px; }
        .spinner { width: 32px; height: 32px; border: 3px solid var(--bg-secondary); border-top-color: var(--button); border-radius: 50%; animation: spin 0.7s linear infinite; }
        @keyframes spin { to { transform: rotate(360deg); } }
        .empty-state { text-align: center; padding: 48px 16px; color: var(--text-hint); }
        .empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
        .error-screen { display: none; position: fixed; inset: 0; background: var(--bg); z-index: 999; align-items: center; justify-content: center; flex-direction: column; gap: 16px; padding: 32px; text-align: center; }
        .error-screen.show { display: flex; }
        .obo-nav {
            position: sticky; bottom: 0; background: var(--bg);
            padding: 12px 16px; border-top: 1px solid var(--bg-secondary);
            display: flex; gap: 10px;
        }
        .obo-nav .btn { flex: 1; }
        .obo-dots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0 16px 12px; }
        .obo-dot {
            width: 28px; height: 28px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-size: 0.7rem; font-weight: 700;
            background: var(--bg-secondary); color: var(--text-hint);
            cursor: pointer; border: 2px solid transparent;
        }
        .obo-dot.current { border-color: var(--button); color: var(--button); }
        .obo-dot.done { background: var(--button); color: var(--button-text); }
        .settings-section { margin-bottom: 24px; }
        .settings-section h3 {
            font-size: 0.85rem; color: var(--text-hint);
            text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px;
        }
        .settings-options { display: flex; gap: 8px; }
        .settings-opt {
            flex: 1; padding: 12px 8px; border-radius: var(--radius-sm);
            border: 2px solid var(--bg-secondary); background: var(--bg);
            cursor: pointer; text-align: center; transition: all 0.15s;
            font-size: 0.85rem; font-weight: 500;
        }
        .settings-opt:active { transform: scale(0.97); }
        .settings-opt.active { border-color: var(--button); background: rgba(59,130,246,0.08); }
        .settings-opt .opt-icon { font-size: 1.5rem; margin-bottom: 4px; }
        .settings-preview { background: var(--bg-secondary); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
        .settings-preview h4 { margin-bottom: 8px; }
        .settings-preview .hint { color: var(--text-hint); font-size: 0.85rem; }
        /* ===== YANGI: Dashboard stillar ===== */
        .dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
        .dash-card {
            background: var(--bg-secondary); border-radius: var(--radius);
            padding: 14px; text-align: center;
        }
        .dash-card .dash-val { font-size: 1.6rem; font-weight: 800; color: var(--button); }
        .dash-card .dash-lbl { font-size: 0.75rem; color: var(--text-hint); margin-top: 2px; }
        .section-title {
            font-size: 0.85rem; color: var(--text-hint);
            text-transform: uppercase; letter-spacing: 0.05em;
            margin: 16px 0 10px;
        }
        .teacher-item {
            display: flex; justify-content: space-between; align-items: center;
            padding: 12px 16px; background: var(--bg-secondary);
            border-radius: var(--radius-sm); margin-bottom: 8px;
        }
        .teacher-item .t-name { font-weight: 600; font-size: 0.9rem; }
        .teacher-item .t-meta { font-size: 0.8rem; color: var(--text-hint); margin-top: 2px; }
        .teacher-item .t-stats { text-align: right; }
        .teacher-item .t-count { font-weight: 700; color: var(--button); font-size: 1.1rem; }
        .teacher-item .t-count-lbl { font-size: 0.7rem; color: var(--text-hint); }
        .invite-box {
            background: var(--bg-secondary); border-radius: var(--radius);
            padding: 14px; margin-bottom: 16px; text-align: center;
        }
        .invite-box .invite-label { font-size: 0.85rem; color: var(--text-hint); margin-bottom: 8px; }
        .invite-box .invite-link {
            font-size: 0.82rem; color: var(--text-link);
            word-break: break-all; margin-bottom: 10px;
        }
        .student-item {
            display: flex; justify-content: space-between; align-items: center;
            padding: 12px 16px; background: var(--bg-secondary);
            border-radius: var(--radius-sm); margin-bottom: 8px;
        }
        .student-item .s-name { font-weight: 600; font-size: 0.9rem; }
        .student-item .s-meta { font-size: 0.8rem; color: var(--text-hint); margin-top: 2px; }
    /* ====== IMAGE LIGHTBOX ====== */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}
.lightbox-overlay.open { display: flex; }
.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    transform-origin: 0 0;
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
}
.lightbox-close {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 22px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
}
.lightbox-hint {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    z-index: 10000;
    pointer-events: none;
}
.q-image { cursor: zoom-in; }

/* ====== MODAL DIALOG ====== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 5000;
    display: none;
    align-items: center; justify-content: center;
    padding: 24px;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.15s ease; }
.modal-box {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 20px;
    width: 100%; max-width: 320px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: modalPop 0.18s ease;
}
@keyframes modalPop {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
.modal-msg { font-size: 0.95rem; line-height: 1.5; margin-bottom: 16px; white-space: pre-line; }
.modal-btns { display: flex; gap: 8px; }
.modal-btns .btn { padding: 10px 16px; font-size: 0.9rem; }

/* ====== YECHIM MODALI (kattaroq, scroll qiladigan) ====== */
.modal-box.modal-lg {
    max-width: 560px;
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}
.sol-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--bg-secondary);
    flex-shrink: 0;
}
.sol-title { font-weight: 600; font-size: 1rem; }
.sol-close {
    background: none; border: none; cursor: pointer;
    font-size: 1.2rem; line-height: 1;
    color: var(--text-hint); padding: 4px 8px;
}
.sol-body {
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.sol-qnum { font-size: 0.8rem; color: var(--text-hint); margin-bottom: 8px; }
.sol-qtext { font-size: 0.95rem; line-height: 1.5; margin-bottom: 12px; }
.sol-answer { font-size: 0.9rem; margin-bottom: 12px; }
.sol-empty { font-size: 0.9rem; color: var(--text-hint); font-style: italic; }
.sol-locked {
    text-align: center; padding: 20px 12px;
    font-size: 0.95rem; line-height: 1.6;
    background: var(--bg-secondary); border-radius: var(--radius);
}
.btn-solution {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 14px;
    padding: 13px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    /* Rang mavzuga bog'liq emas — Telegram'ning yorug' va qorong'i
       rejimlarida bir xil o'qiladi */
    color: #78350f;
    background: #fbbf24;
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.btn-solution:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.3);
}

/* ====== XATO HAQIDA XABAR ====== */
.btn-report {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 9px 12px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-hint);
    background: none;
    border: 1px dashed var(--text-hint);
    border-radius: var(--radius);
    cursor: pointer;
    opacity: 0.75;
}
.btn-report:active { opacity: 1; transform: scale(0.98); }
.report-done {
    margin-top: 10px;
    padding: 9px 12px;
    font-size: 0.8rem;
    text-align: center;
    color: var(--text-hint);
}
.rep-qnum { font-size: 0.8rem; color: var(--text-hint); margin-bottom: 10px; }
.rep-hint { font-size: 0.9rem; font-weight: 600; margin-bottom: 10px; }
.rep-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    cursor: pointer;
}
.rep-item input { width: 18px; height: 18px; flex-shrink: 0; }
.rep-comment {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius);
    resize: vertical;
    box-sizing: border-box;
}
.rep-submit { width: 100%; margin-top: 14px; }

/* KaTeX blok formulalar konteynerdan chiqib ketmasin — o'rniga scroll */
.katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0;
}

/* ==================== SUV BELGISI VA NUSXA HIMOYASI ==================== */

/* Savol va yechim matnlarini tanlab bo'lmaydi.
   Mobil WebView uchun ichki elementlar ham qamraladi (* selektori) —
   MathJax kabi kutubxonalar o'z elementlarini yaratadi. */
#page-test,
#page-test *,
#page-result,
#page-result *,
#page-review,
#page-review *,
.sol-overlay,
.sol-overlay * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Rasmlarni uzoq bosib saqlash va sudrab olishni to'sish */
#page-test img,
#page-result img,
#page-review img,
.sol-overlay img,
.lightbox-img {
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    pointer-events: auto;
}/* Savol va yechim matnlarini tanlab bo'lmaydi */
.q-text,
.option-text,
.q-card,
.sol-overlay .modal-box {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* ==================== DESKTOP TARTIBI ====================
   900px dan keng ekranlar: planshet telefon tartibida qoladi,
   monitorlar markazlashtirilgan tor ustunga o'tadi. */
@media (min-width: 900px) {
    :root {
        --font-scale: 1.06;
        --safe-bottom: 0px;
    }

    body {
        background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 240px, #f8fafc 100%);
    }

    /* Kontent ustuni: matn o'qish uchun qulay kenglik */
    .page-header,
    .content {
        max-width: 760px;
        margin-left: auto;
        margin-right: auto;
    }

    .page-header {
        border-bottom: none;
        padding-top: 8px;
    }

    .page-header h1 {
        font-size: 1.35rem;
    }

    .content {
        padding: 20px 16px 40px;
    }

    /* Sichqoncha bor — hover holatlari mantiqiy */
    .option:hover {
        border-color: var(--text-link);
        background: rgba(59, 130, 246, 0.04);
    }

    .btn:hover {
        opacity: 0.9;
    }

    /* Kartalar fondan ajralib tursin: oq fon + yumshoq soya */
    .card,
    .card-white {
        background: #ffffff;
        border: 1px solid rgba(148, 163, 184, 0.18);
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04),
                    0 4px 12px rgba(15, 23, 42, 0.04);
        transition: box-shadow 0.15s, transform 0.1s;
    }

    .card:hover,
    .card-white:hover {
        box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06),
                    0 8px 20px rgba(15, 23, 42, 0.07);
    }

    /* Yuqori panel oq fonda, ostida yengil soya */
    .page-header {
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(8px);
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
        border-radius: 0 0 var(--radius) var(--radius);
    }

    /* Pastki navigatsiya ham ajralsin */
    .bottom-nav {
        box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.06);
        border-top: none;
    }

    .session-item:hover,
    .test-item:hover {
        background: rgba(59, 130, 246, 0.04);
    }

    /* Modal tugmalari teng bo'linsin */
    .modal-btns .btn {
        flex: 1;
        min-width: 0;
    }

    /* Test sahifasi deyarli butun kenglikda — elementlar ko'p */
    .test-top-bar,
    #page-test .progress-bar {
        max-width: 1500px;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Savollar maydoni: chapda raqamlar paneli, o'ngda savol(lar) */
    #testBody {
        max-width: 1500px;
        margin: 0 auto !important;
        display: grid;
        grid-template-columns: 250px 1fr;
        gap: 24px;
        align-items: start;
    }

    /* Raqamlar paneli — aylantirilganda ham ko'rinib turadi */
    .obo-dots {
        position: sticky;
        top: 80px;
        margin: 0 !important;
        justify-content: flex-start;
        background: #ffffff;
        border: 1px solid rgba(148, 163, 184, 0.18);
        border-radius: var(--radius);
        padding: 14px;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04),
                    0 4px 12px rgba(15, 23, 42, 0.04);
        /* 6 ta raqam bir qatorda: 6 × 32px + 5 × 6px oraliq + padding */
        width: 250px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }

    .obo-dot {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        font-weight: 600;
        cursor: pointer;
        transition: transform 0.1s, background 0.15s;
    }

    .obo-dot:hover {
        transform: scale(1.12);
    }

    /* Savollar ustuni — grid'ning ikkinchi katagi */
    #testBody > .q-card,
    #testBody > .obo-nav,
    #testBody > .q-list {
        grid-column: 2;
    }

    /* Tahlil sahifasi — test bilan bir xil tartib */
    #reviewContent,
    #resultContent {
        display: grid;
        grid-template-columns: 250px 1fr;
        gap: 24px;
        align-items: start;
        max-width: 1500px;
        margin: 0 auto;
    }

    #reviewContent > *,
    #resultContent > * {
        grid-column: 2;
    }

    #reviewContent > .review-dots,
    #resultContent > .review-dots {
        grid-column: 1;
        grid-row: 1 / 999;
    }

    /* ---------- Yon panel navigatsiyasi ----------
       Pastki panel chapga ko'chadi. HTML va JS o'zgarmaydi —
       Telegram'dagi ko'rinishga umuman ta'sir qilmaydi. */
    .bottom-nav {
        top: 0;
        bottom: 0;
        right: auto;
        width: 220px;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 24px 12px 24px;
        border-top: none;
        border-right: 1px solid rgba(148, 163, 184, 0.18);
        box-shadow: 2px 0 12px rgba(15, 23, 42, 0.04);
    }

    .nav-item {
        flex: 0 0 auto;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 12px 14px;
        border-radius: var(--radius-sm);
        font-size: 0.95rem;
        font-weight: 600;
        text-align: left;
        transition: background 0.15s, color 0.15s;
    }

    .nav-item:hover {
        background: rgba(59, 130, 246, 0.06);
        color: var(--text);
    }

    .nav-item.active {
        background: rgba(59, 130, 246, 0.1);
        color: var(--button);
    }

    .nav-item svg {
        flex-shrink: 0;
        width: 20px;
        height: 20px;
    }

    /* Kontent yon panel yonidan boshlanadi */
    .page {
        padding-left: 220px;
        padding-bottom: 40px;
    }

    /* Test va login sahifalarida panel yashiriladi — surish ham kerak emas */
    #page-test,
    #page-login,
    #page-loading {
        padding-left: 0;
    }
}
/* Tahlil raqamlari: xatolar ta'kidlanadi, to'g'rilar tinch turadi.
   50 ta to'ldirilgan doira ko'zni charchatadi, shuning uchun
   to'g'ri javoblar och fon + quyuq matn bilan beriladi. */
.obo-dot.rv-correct {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
    border-color: rgba(22, 163, 74, 0.3);
}

.obo-dot.rv-wrong {
    background: rgba(220, 38, 38, 0.14);
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.45);
    font-weight: 700;
}

/* Telefonda one_by_one rejimida raqamlar paneli o'rin egallaydi —
   savol bilan tugmalar bir ekranga sig'sin. Desktopda chapda qoladi. */
@media (max-width: 899px) {
    #testBody > .obo-dots {
        display: none;
    }
}
