/* ==========================================================================
   TỆP: css/tin-thpt-style.css (BỘ GIAO DIỆN HỢP NHẤT TOÀN CẤP THPT 10 - 11 - 12)
   Tự động chuyển đổi Bản sắc màu (Color Identity) theo thuộc tính body[data-grade]
   Tác giả: Th.S Võ Khánh Triều - Trường THPT Lý Thường Kiệt
   ========================================================================== */

/* 1. HỆ THỐNG BIẾN TOÀN CỤC & PHỐI MÀU ĐỘNG THEO KHỐI 10 - 11 - 12 */
:root,
body[data-grade="10"] {
    /* KHỐI 10 (Mặc định): Tông Xanh Dương Hoàng Gia (Royal Blue) */
    --primary: #2563EB;
    --primary-light: #EFF6FF;
    --primary-dark: #1E40AF;
    --secondary: #0EA5E9;
    --bg-h2-tag: #DBEAFE;
    --border-hover: #BFDBFE;
    --shadow-lg: 0 10px 25px rgba(37, 99, 235, 0.14);
}

body[data-grade="11"] {
    /* KHỐI 11: Tông Xanh Ngọc Lục Bảo (Emerald / Teal) */
    --primary: #0D9488;
    --primary-light: #F0FDFA;
    --primary-dark: #0F766E;
    --secondary: #14B8A6;
    --bg-h2-tag: #CCFBF1;
    --border-hover: #99F6E4;
    --shadow-lg: 0 10px 25px rgba(13, 148, 136, 0.14);
}

body[data-grade="12"] {
    /* KHỐI 12: Tông Tím Chàm Hiện Đại (Indigo / Violet) */
    --primary: #4F46E5;
    --primary-light: #EEF2FF;
    --primary-dark: #3730A3;
    --secondary: #6366F1;
    --bg-h2-tag: #E0E7FF;
    --border-hover: #C7D2FE;
    --shadow-lg: 0 10px 25px rgba(79, 70, 229, 0.14);
}

:root {
    --accent: #F59E0B;
    --accent-orange: #EA580C;
    --accent-orange-hover: #C2410C;
    --code-color: #BE185D;

    /* Trạng thái Trắc nghiệm & Phản hồi */
    --success: #10B981;
    --success-bg: #ECFDF5;
    --success-text: #065F46;
    --danger: #EF4444;
    --danger-bg: #FEE2E2;
    --danger-text: #991B1B;

    /* Màu nền dịu mắt đồng bộ với Thanh Auth Bar & Văn bản */
    --bg-body: white;
    --bg-card: #FFFFFF;
    --text-title: #0F172A;
    --text-main: #1E293B;
    --text-muted: #64748B;

    /* Đường viền, Bo góc & Đổ bóng */
    --border-color: #E2E8F0;
    --border: #E2E8F0;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   2. RESET & GIAO DIỆN CHUNG (GENERAL STYLES)
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    padding: 20px 0 60px;
    overflow-x: hidden;
}

.container {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 35px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border-top: 8px solid var(--primary-dark);
    overflow: hidden;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

/* Khung Header Hero chuyên biệt cho Khối 11 & các trang chuyên đề */
header.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #0F172A 100%);
    color: #FFFFFF;
    padding: 28px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

header.hero h1 {
    color: #FFFFFF;
    margin-bottom: 8px;
}

header.hero p {
    color: #E2E8F0;
    font-size: 1rem;
    margin: 0;
}

h1 {
    color: var(--primary-dark);
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1.08rem;
}

hr {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 30px 0;
}

section {
    margin-bottom: 35px;
}

h2 {
    color: var(--primary-dark);
    background: var(--bg-h2-tag);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 1.3rem;
    display: inline-block;
    max-width: 100%;
    margin-bottom: 20px;
    border-left: 5px solid var(--primary);
}

h3 {
    color: var(--primary-dark);
    margin-top: 25px;
    margin-bottom: 12px;
}

/* ==========================================================================
   3. THANH ĐIỀU HƯỚNG & NỘI DUNG VĂN BẢN
   ========================================================================== */
.top-nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 8px 16px;
    background: var(--primary-light);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: var(--primary);
    color: #FFFFFF;
}

strong {
    color: var(--accent-orange);
}

code {
    color: var(--code-color);
    background: var(--primary-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: 'Consolas', 'SFMono-Regular', monospace;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

pre {
    background: #0F172A;
    color: #F8FAFC;
    padding: 18px 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-size: 0.95rem;
    font-family: 'Consolas', 'SFMono-Regular', monospace;
    line-height: 1.5;
    margin: 18px 0;
    max-width: 100%;
    border: 1px solid #334155;
}

.note-box, .highlight-box, .practice-box, .example-demo, .exercise-box, .application-box {
    background: var(--success-bg);
    border-left: 5px solid var(--success);
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: var(--radius-sm);
    max-width: 100%;
    overflow-wrap: break-word;
}

.highlight-box {
    background: #FFFBEB;
    border-left-color: var(--accent);
    color: #92400E;
}

.badge, .hero-badge {
    display: inline-block;
    background-color: var(--bg-h2-tag);
    color: var(--primary-dark);
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

/* ==========================================================================
   4. BỐ CỤC LƯỚI & THẺ NỘI DUNG (CARDS & GRIDS) - CHỐNG TRÀN KHUNG (.card)
   ========================================================================== */
.grid-2, .grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
    width: 100%;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
    width: 100%;
}

.card, .sub-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover, .sub-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.compare-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    background-color: var(--primary-light);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-top: 15px;
    max-width: 100%;
}

/* ==========================================================================
   5. BẢNG DỮ LIỆU & BẢNG ĐÚNG/SAI (TABLES) - TỰ ĐỘNG CO GIÃN THEO NỘI DUNG
   ========================================================================== */
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
}

.index-table, .custom-table, .table-responsive table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    table-layout: auto;
}

.index-table th, .index-table td,
.custom-table th, .custom-table td,
.table-responsive th, .table-responsive td,
.tf-table td {
    border: 1px solid var(--border-color);
    padding: 12px 15px;
    text-align: left;
    font-size: 0.95rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: normal;
    vertical-align: top;
}

.index-table th, .custom-table th, .table-responsive th {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
}

.custom-table code,
.index-table code,
.tf-table code {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    display: inline-block;
    max-width: 100%;
}

.tf-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.tf-table th {
    background: var(--primary-dark);
    color: #FFFFFF;
    padding: 8px;
    text-align: center;
}

.tf-table td {
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}

.tf-table td:first-child {
    text-align: left;
    font-weight: 500;
    width: 72%;
}

.tf-table th:not(:first-child),
.tf-table td:not(:first-child) {
    width: 14%;
    white-space: nowrap;
}

/* ==========================================================================
   6. SƠ ĐỒ TƯ DUY (MINDMAP)
   ========================================================================== */
.mindmap-wrapper, .mindmap-container, .mindmap-box {
    background: linear-gradient(135deg, var(--primary-light) 0%, #E0F2FE 100%);
    border: 2px dashed var(--secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 20px 0;
    box-shadow: var(--shadow-sm);
    max-width: 100%;
}

.mindmap-title, .mindmap-root, .node-main {
    text-align: center;
    background: #FFFFFF;
    color: var(--accent-orange);
    font-size: 1.1rem;
    font-weight: 800;
    padding: 10px 20px;
    border-radius: 20px;
    width: fit-content;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-md);
    text-transform: uppercase;
}

.mindmap-grid, .mindmap-branches, .node-tree {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    width: 100%;
}

.mindmap-card, .branch, .node-branch {
    background: #FFFFFF;
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border-left: 5px solid var(--secondary);
    transition: transform 0.2s ease;
    min-width: 0;
}

.mindmap-card:hover, .branch:hover, .node-branch:hover {
    transform: translateY(-3px);
}

.card-branch-1 { border-left-color: var(--primary); }
.card-branch-2 { border-left-color: var(--success); }
.card-branch-3 { border-left-color: var(--accent); }
.card-branch-4 { border-left-color: #8B5CF6; }

.card-header, .branch h4, .node-branch h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border-color);
}

.card-body ul, .branch ul, .node-branch ul {
    list-style: none;
    padding-left: 0;
}

.card-body li, .branch li, .node-branch li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--text-main);
}

.card-body li::before, .branch li::before, .node-branch li::before {
    content: "•";
    position: absolute;
    left: 4px;
    color: var(--primary);
    font-size: 1.2rem;
    line-height: 1;
}

.timeline-tag {
    display: inline-block;
    background-color: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-right: 6px;
}

/* ==========================================================================
   7. BIỂU MẪU HỌC SINH & HỆ THỐNG TRẮC NGHIỆM (QUIZ)
   ========================================================================== */
.student-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    background: #F1F5F9;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 25px;
    max-width: 100%;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 200px;
    min-width: 0;
}

.input-group label {
    font-weight: 600;
    color: var(--primary-dark);
}

.input-group input,
.input-group select {
    height: 44px;
    width: 100%;
    max-width: 100%;
    padding: 0 14px;
    border: 1.5px solid #CBD5E1;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    background-color: #FFFFFF;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.input-group select:disabled,
.input-group input:disabled {
    background-color: #F1F5F9;
    color: #64748B;
    border-color: #CBD5E1;
    cursor: not-allowed;
    opacity: 1;
}

#quiz-container, #submit-btn {
    display: none;
}

.question-card, .quiz-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 22px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    max-width: 100%;
    overflow-x: hidden;
}

.question-text, .quiz-question {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-title);
    margin-bottom: 12px;
    display: block;
}

.options-list label, .option-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    background: #FFFFFF;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    color: var(--text-main);
}

.options-list label:hover, .option-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.options-list input {
    margin-right: 12px;
    transform: scale(1.2);
    flex-shrink: 0;
}

.correct-box, .option-btn.correct {
    border-color: var(--success) !important;
    background-color: var(--success-bg) !important;
    color: var(--success-text) !important;
    font-weight: 600;
}

.wrong-box, .option-btn.wrong {
    border-color: var(--danger) !important;
    background-color: var(--danger-bg) !important;
    color: var(--danger-text) !important;
}

.tf-btn-group {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.tf-btn {
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    background: #FFFFFF;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.tf-btn.selected-true {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}

.tf-btn.selected-false {
    background: var(--danger);
    color: #FFFFFF;
    border-color: var(--danger);
}

.explanation, .explanation-box {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: var(--success-bg);
    color: var(--success-text);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--success);
    font-size: 0.95rem;
    overflow-wrap: break-word;
}

.btn-start, .btn-submit, .btn-clear {
    width: auto !important;
    min-width: 220px;
    display: block;
    margin: 20px auto;
    padding: 13px 32px;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    color: #FFFFFF;
    transition: all 0.2s ease;
}

.btn-start, .btn-submit {
    background: var(--accent-orange);
    color: #FFFFFF;
}

.btn-start:hover, .btn-submit:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
    transform: translateY(-2px);
}

.btn-clear {
    background: var(--primary);
}

.btn-clear:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}

.result-panel {
    display: none;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 35px;
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--primary);
    margin-top: 30px;
}

.result-content {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 8px solid var(--primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
}

#score-num {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-dark);
}

/* ==========================================================================
   8. CHÂN TRANG, THIẾT BỊ DI ĐỘNG (RESPONSIVE) & CHẾ ĐỘ IN ẤN (@MEDIA PRINT)
   ========================================================================== */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
    color: #94A3B8;
    font-size: 0.9rem;
    border-top: 1px solid rgba(226, 232, 240, 0.2);
}

.container footer {
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

@media screen and (max-width: 768px) {
    body {
        padding: 12px 8px 40px;
    }

    .container {
        padding: 20px 14px;
    }

    h1, .hero h1 {
        font-size: 1.4rem;
    }

    .card, .sub-card, .question-card {
        padding: 14px 12px;
        overflow-x: hidden;
    }

    .grid-2, .grid-3, .grid-cards, .compare-box, .mindmap-grid, .mindmap-branches, .node-tree {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .student-info {
        flex-direction: column;
        padding: 15px;
    }

    .input-group {
        flex: 1 1 100%;
    }

    .index-table,
    .custom-table,
    .tf-table,
    .table-responsive table {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        table-layout: auto !important;
        margin: 12px 0 !important;
    }

    .index-table th, .index-table td,
    .custom-table th, .custom-table td,
    .table-responsive th, .table-responsive td,
    .tf-table th, .tf-table td {
        padding: 8px 6px !important;
        font-size: 0.85rem !important;
        line-height: 1.45 !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
    }

    .index-table th[width], .index-table td[width],
    .custom-table th[width], .custom-table td[width] {
        width: auto !important;
    }

    .custom-table code,
    .tf-table code,
    code {
        font-size: 0.82rem !important;
        padding: 2px 4px !important;
        white-space: pre-wrap !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
    }

    .result-panel {
        padding: 24px 14px;
    }

    .btn-submit, .btn-start, .btn-clear {
        width: 100% !important;
    }
}

/* Chế độ In ấn Đề cương / Bài học chuẩn PDF (Ctrl + P) */
@media print {
    body {
        background: #FFFFFF !important;
        color: #000000 !important;
        padding: 0 !important;
    }
    .container {
        box-shadow: none !important;
        border: none !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
    #ltk-global-auth-bar,
    .btn-back,
    #login-section,
    #quiz-section,
    .btn-start,
    .btn-submit {
        display: none !important;
    }
    .card, .sub-card, .mindmap-wrapper, .mindmap-container, .mindmap-box, table, pre {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   9. CỤM NÚT LỆNH ĐIỀU HƯỚNG NỔI GÓC DƯỚI PHẢI (FLOATING NAVIGATION DOCK)
   Thay thế hoàn toàn cho nút "Quay lại Mục lục" (.btn-back) ở đầu trang
   ========================================================================== */
.btn-back {
    display: none !important;
}

.ltk-floating-nav {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9995;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 7px 11px;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.45);
}

.ltk-float-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    text-decoration: none;
    color: #F8FAFC !important;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.2;
}

.ltk-float-btn:hover {
    background: var(--primary);
    color: #FFFFFF !important;
    border-color: #93C5FD;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.ltk-float-btn.toc-btn {
    background: #059669;
    border-color: #34D399;
}

.ltk-float-btn.toc-btn:hover {
    background: #047857;
}

.ltk-float-btn.home-btn {
    background: var(--primary);
    border-color: #60A5FA;
}

.ltk-float-btn.disabled {
    opacity: 0.42;
    pointer-events: none;
}

@media screen and (max-width: 640px) {
    body {
        padding-bottom: 84px !important;
    }
    .ltk-floating-nav {
        bottom: 10px;
        right: 10px;
        left: 10px;
        justify-content: space-between;
        padding: 6px 8px;
    }
    .ltk-float-btn {
        flex: 1;
        padding: 8px 6px;
        font-size: 0.76rem;
    }
}

@media print {
    .ltk-floating-nav {
        display: none !important;
    }
}

/* ==========================================================================
   10. TỰ ĐỘNG CO GIÃN CỠ CHỮ (FLUID TYPOGRAPHY CLAMP) & TỐI ƯU MOBILE HEADER
   ========================================================================== */
header {
    padding: clamp(12px, 2.5vw, 24px) clamp(10px, 2vw, 20px);
    margin-bottom: clamp(16px, 3vw, 28px);
}

header.hero {
    padding: clamp(16px, 3.2vw, 28px) clamp(14px, 2.8vw, 24px) !important;
    margin-bottom: clamp(18px, 3vw, 28px) !important;
}

h1, header h1, header.hero h1 {
    font-size: clamp(1.18rem, 3.8vw, 1.75rem) !important;
    line-height: 1.32 !important;
    letter-spacing: -0.01em;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

.subtitle, header .subtitle, header.hero p {
    font-size: clamp(0.84rem, 2.4vw, 1.05rem) !important;
    line-height: 1.45 !important;
}

h2, section h2, h2.card-title {
    font-size: clamp(0.95rem, 2.8vw, 1.25rem) !important;
    padding: clamp(8px, 1.8vw, 12px) clamp(12px, 2.4vw, 18px) !important;
    line-height: 1.38 !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

h3, .card-title {
    font-size: clamp(0.94rem, 2.5vw, 1.12rem) !important;
    line-height: 1.4 !important;
}

/* Tối ưu hiển thị danh sách bài học trên trang Mục lục (Chống gãy chữ thành nhiều dòng hẹp) */
.lesson-item {
    display: flex !important;
    align-items: center !important;
    gap: clamp(8px, 2vw, 14px) !important;
    padding: clamp(10px, 2vw, 13px) clamp(8px, 2vw, 15px) !important;
}

.lesson-num {
    min-width: clamp(50px, 13vw, 76px) !important;
    font-size: clamp(0.84rem, 2.2vw, 0.96rem) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.lesson-name {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    font-size: clamp(0.88rem, 2.4vw, 1rem) !important;
    line-height: 1.42 !important;
    overflow-wrap: break-word !important;
}

.page-num {
    font-size: clamp(0.76rem, 1.9vw, 0.88rem) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    margin-right: 4px !important;
}

/* ==========================================================================
   11. HỆ THỐNG NÚT LỆNH CO GIÃN THÔNG MINH THEO MÀN HÌNH THIẾT BỊ (FLUID BUTTONS)
   Tự động điều chỉnh kích thước từ Điện thoại nhỏ (320px) -> Tablet -> PC lớn
   ========================================================================== */
button,
.btn-start,
.btn-submit,
.btn-clear,
.btn-action,
.btn-login,
.btn-submit-practice,
.btn-paste,
.nav-tab-btn,
.topic-tab-btn,
.lab-tab-btn,
.tf-btn,
.option-btn,
.options-list label {
    font-size: clamp(0.78rem, 2.2vw, 0.96rem) !important;
    padding: clamp(7px, 1.5vw, 11px) clamp(11px, 2.4vw, 20px) !important;
    border-radius: clamp(6px, 1.2vw, 10px) !important;
    line-height: 1.3 !important;
}

.btn-start, .btn-submit, .btn-clear {
    min-width: clamp(140px, 42vw, 220px) !important;
    margin: clamp(12px, 2.5vw, 20px) auto !important;
}

.btn-mini, .score-chip, .tf-btn {
    font-size: clamp(0.72rem, 1.9vw, 0.84rem) !important;
    padding: clamp(4px, 1vw, 6px) clamp(8px, 1.8vw, 13px) !important;
}

.input-group input,
.input-group select,
.form-group input,
.form-group select,
.filter-bar input,
.filter-bar select,
.search-box input {
    height: clamp(36px, 8.5vw, 42px) !important;
    padding: 0 clamp(9px, 2vw, 13px) !important;
    font-size: clamp(0.8rem, 2.2vw, 0.94rem) !important;
}

/* Thu gọn Cụm nút điều hướng nổi (.ltk-floating-nav) tự động theo màn hình */
.ltk-floating-nav {
    bottom: clamp(8px, 2vw, 16px) !important;
    right: clamp(8px, 2vw, 16px) !important;
    padding: clamp(4px, 1vw, 6px) clamp(6px, 1.4vw, 10px) !important;
    gap: clamp(4px, 1vw, 7px) !important;
}

.ltk-float-btn {
    padding: clamp(5px, 1.1vw, 7px) clamp(8px, 1.8vw, 12px) !important;
    font-size: clamp(0.7rem, 1.9vw, 0.82rem) !important;
    gap: 4px !important;
}

@media screen and (max-width: 640px) {
    .btn-start, .btn-submit, .btn-clear {
        width: 100% !important;
    }
    .ltk-floating-nav {
        left: 8px !important;
        right: 8px !important;
        bottom: 8px !important;
        justify-content: space-between !important;
    }
    .ltk-float-btn {
        flex: 1 1 0 !important;
        padding: 6px 4px !important;
        font-size: clamp(0.68rem, 2.6vw, 0.75rem) !important;
    }
}

/* ==========================================================================
   12. KHUNG HIỂN THỊ MÃ NGUỒN CHƯƠNG TRÌNH TRONG CÂU HỎI ÔN TẬP & KIỂM TRA
   (Bảo toàn tuyệt đối thụt lề Python, C/C++, Java, SQL, HTML/CSS trên mọi thiết bị)
   ========================================================================== */
.quiz-code-wrapper {
    margin: 10px 0 12px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1.5px solid #334155;
    background: #0F172A;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
    text-align: left;
    font-weight: 400;
}

.quiz-code-header {
    background: #1E293B;
    color: #93C5FD;
    padding: 5px 12px;
    font-size: clamp(0.7rem, 1.8vw, 0.78rem);
    font-weight: 700;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

pre.quiz-code-block {
    margin: 0 !important;
    padding: clamp(10px, 2vw, 14px) clamp(12px, 2.5vw, 16px) !important;
    background: #0F172A !important;
    color: #F8FAFC !important;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'SFMono-Regular', monospace !important;
    font-size: clamp(0.8rem, 2.2vw, 0.92rem) !important;
    line-height: 1.55 !important;
    white-space: pre !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    tab-size: 4;
    border: none !important;
    border-radius: 0 !important;
    text-align: left !important;
}

pre.quiz-code-block code {
    background: transparent !important;
    color: #38BDF8 !important;
    padding: 0 !important;
    font-family: inherit !important;
    font-size: inherit !important;
    white-space: pre !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

pre.quiz-option-code {
    margin: 4px 0 0 0 !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    border: 1px solid #334155 !important;
    display: block;
    width: 100%;
}

.options-list label span {
    flex: 1;
    min-width: 0;
}

code.quiz-inline-code {
    background: #EFF6FF !important;
    color: #BE185D !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    border: 1px solid #BFDBFE !important;
    font-family: 'Consolas', 'SFMono-Regular', monospace !important;
    font-size: 0.9em !important;
    font-weight: 600 !important;
}

/* ==========================================================================
   13. GIAO DIỆN CHUYÊN BIỆT TRANG MỤC LỤC (.page-muc-luc)
   Tự động kế thừa màu chủ đạo theo body[data-grade="10|11|12"]
   ========================================================================== */
body.page-muc-luc .container {
    max-width: 920px;
}

body.page-muc-luc .banner {
    margin-bottom: 28px;
    border-bottom: 1.5px solid var(--border-color);
    padding-bottom: 20px;
}

body.page-muc-luc .banner-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 18px;
    text-align: center;
}

body.page-muc-luc .banner-logo {
    width: 76px;
    height: auto;
    flex-shrink: 0;
}

body.page-muc-luc .school-info p {
    margin: 0;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

body.page-muc-luc .school-info h3 {
    margin: 2px 0 0;
    color: var(--primary-dark);
    font-size: clamp(1.05rem, 3vw, 1.38rem);
    font-weight: 800;
}

body.page-muc-luc .hero-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    display: block;
}

body.page-muc-luc h1 {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 6px;
}

body.page-muc-luc .subtitle {
    text-align: center;
    margin-bottom: 28px;
    font-style: italic;
}

body.page-muc-luc h2 {
    display: block;
    text-transform: uppercase;
    margin-top: 30px;
}

body.page-muc-luc .lesson-list {
    margin-top: 12px;
}

body.page-muc-luc .lesson-item {
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s ease;
    border-radius: 8px;
}

body.page-muc-luc .lesson-item:hover {
    background-color: var(--primary-light);
    transform: translateX(4px);
    color: var(--primary);
}

body.page-muc-luc .lesson-num {
    font-weight: 700;
    color: var(--primary-dark);
}

body.page-muc-luc .page-num {
    color: #94A3B8;
    font-style: italic;
}

@media screen and (max-width: 640px) {
    body.page-muc-luc .banner-header {
        flex-direction: row;
        text-align: left;
        justify-content: flex-start;
        gap: 12px;
    }
    body.page-muc-luc .banner-logo {
        width: 52px;
    }
}

/* ==========================================================================
   14. TINH CHỈNH THẨM MỸ & HÀI HÒA GIAO DIỆN TOÀN HỆ THỐNG (UI/UX POLISH V10)
   - Tối ưu tương phản chữ, độ thoáng đoạn văn, thẻ nội dung & kích thước nút
   ========================================================================== */
:root {
    --bg-body: #0F172A;
    --bg-surface: #F8FAFC;
    --text-main: #1E293B;
    --text-muted: #475569;
    --border-soft: #E2E8F0;
    --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow-card-hover: 0 8px 20px rgba(15, 23, 42, 0.09);
}

body {
    background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
    background-attachment: fixed;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 980px;
    padding: clamp(20px, 4vw, 40px);
    border-radius: 18px;
    box-shadow: 0 20px 45px rgba(2, 6, 23, 0.35);
}

/* Giảm chói mắt: chữ in đậm dùng màu xanh đậm chủ đạo thay vì cam gắt trên toàn văn bản */
p, li {
    color: var(--text-main);
    margin-bottom: 10px;
}

strong {
    color: var(--primary-dark);
    font-weight: 700;
}

.note-box strong,
.highlight-box strong {
    color: #B45309;
}

/* Thẻ nội dung mềm mại, khoảng thở đều đặn */
.card, .sub-card, .question-card, .quiz-item {
    background: #FFFFFF;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: clamp(16px, 2.5vw, 24px);
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover, .sub-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--border-hover);
}

.note-box, .practice-box, .example-demo, .exercise-box, .application-box {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-left: 5px solid var(--success);
    border-radius: 10px;
    padding: 16px 20px;
}

.highlight-box {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-left: 5px solid var(--accent);
    border-radius: 10px;
    padding: 16px 20px;
}

/* Khung ảnh sơ đồ bài học gọn đẹp */
.mindmap-image-box {
    text-align: center;
    margin-top: 22px;
}

.mindmap-image-box img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

/* Nút lệnh hài hòa, đồng bộ chiều cao & hiệu ứng */
.btn-start, .btn-submit, .btn-clear {
    border-radius: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
}

.btn-start {
    background: linear-gradient(135deg, #EA580C 0%, #DC2626 100%) !important;
}

.btn-start:hover {
    background: linear-gradient(135deg, #C2410C 0%, #B91C1C 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(220, 38, 38, 0.28);
}

.btn-submit {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #047857 0%, #065F46 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(5, 150, 105, 0.28);
}

/* ==========================================================================
   V30.2: CHUẨN HÓA LƯỚI SƠ ĐỒ TƯ DUY 2×2 CÂN ĐỐI (KHẮC PHỤC LỖI 3+1 LẺ THẺ)
   ========================================================================== */
.mindmap-grid, .mindmap-branches, .node-tree {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
    width: 100% !important;
    align-items: stretch !important;
}
/* Nếu sơ đồ có đúng 3 nhánh thì tự động chia đều 3 cột trên màn hình rộng */
@media (min-width: 960px) {
    .mindmap-grid:has(> :nth-child(3):last-child),
    .mindmap-branches:has(> :nth-child(3):last-child),
    .node-tree:has(> :nth-child(3):last-child) {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 768px) {
    .mindmap-grid, .mindmap-branches, .node-tree {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
}
.mindmap-card h4 code, .branch h4 code, .node-branch h4 code {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 0.9em;
    background: #EFF6FF;
    color: #1E3A8A;
    padding: 1px 6px;
    border-radius: 5px;
    border: 1px solid #BFDBFE;
    text-transform: none;
}

/* ==========================================================================
   V54: HỆ THỐNG GIAO DIỆN ĐỒNG NHẤT & MOBILE-FIRST TOÀN DIỆN
   1. Tông nền kem ấm chuẩn mực (#EFECE6 / #FAF7F2), chữ đen than (#111827),
      tiêu đề Xanh Navy (#1E3A8A), điểm nhấn Đỏ cam (#B91C1C) tiết chế trên `code`.
   2. Sửa triệt để xung đột màu chữ trắng trên nền sáng ở h2 / .card-title.
   3. Bảng 2–5 cột tự chuyển sang dạng Thẻ xếp dọc (Stacked Cards) trên <= 640px.
   4. Phẳng hóa bố cục lồng khối (Flat Mobile Layout) trên <= 640px, mở rộng 25–30% bề ngang chữ.
   5. Mindmap Accordion + Lightbox phóng to ảnh sơ đồ trên di động.
   ========================================================================== */

:root,
body[data-grade="10"],
body[data-grade="11"],
body[data-grade="12"] {
    --primary: #1E3A8A;
    --primary-light: #FAF7F2;
    --primary-dark: #1E3A8A;
    --secondary: #1D4ED8;
    --accent: #B91C1C;
    --bg-h2-tag: #F3EEE4;
    --border-hover: #1E3A8A;
    --text-main: #111827;
    --text-muted: #374151;
    --bg-body: #EFECE6;
    --bg-surface: #FAF7F2;
    --border-color: #D8D0C5;
    --code-color: #B91C1C;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    background: #EFECE6 !important;
    color: #111827 !important;
    padding-bottom: 68px !important;
    overflow-x: hidden !important;
}

.container {
    max-width: 960px !important;
    width: 100% !important;
    background: #FAF7F2 !important;
    color: #111827 !important;
    border: 1.5px solid #D8D0C5 !important;
    border-top: 5px solid #1E3A8A !important;
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.12) !important;
    overflow-x: hidden !important;
}

/* Header & Tiêu đề: tương phản cao, chống lỗi chữ trắng trên nền sáng */
header:not(.toolbar),
header.hero {
    background: linear-gradient(180deg, #FAF7F2 0%, #F3EEE4 100%) !important;
    color: #1E3A8A !important;
    border: none !important;
    border-bottom: 2.5px solid #1E3A8A !important;
    box-shadow: none !important;
}

header h1, header.hero h1, h1 {
    color: #1E3A8A !important;
    font-weight: 800 !important;
}

header p, header .subtitle, header.hero p {
    color: #374151 !important;
    font-weight: 600 !important;
}

h2, section h2, .card h2, h2.card-title {
    background: #F3EEE4 !important;
    color: #1E3A8A !important;
    border: 1px solid #D8D0C5 !important;
    border-left: 5px solid #1E3A8A !important;
    font-weight: 800 !important;
    box-shadow: none !important;
}

h3 {
    color: #111827 !important;
    border-bottom: 2px dashed #CBD5E1 !important;
    padding-bottom: 6px !important;
    font-weight: 700 !important;
}

h4, .card-title:not(h2) {
    color: #111827 !important;
    font-weight: 700 !important;
}

/* Khối nội dung & Chống tràn nhiều cột trên Desktop */
.card, .sub-card, .box {
    background: #FAF7F2 !important;
    color: #111827 !important;
    border: 1.5px solid #D8D0C5 !important;
    border-top: 4px solid #1E3A8A !important;
    box-shadow: 0 6px 16px rgba(17, 24, 39, 0.06) !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: break-word !important;
}

.card:hover, .sub-card:hover {
    border-color: #1E3A8A !important;
}

.note-box, .info-box, .callout, .practice-box, .highlight-box {
    background: #FAF7F2 !important;
    color: #111827 !important;
    border: 1.5px solid #D8D0C5 !important;
    border-left: 4px solid #1E3A8A !important;
}

.container p strong,
.container li strong,
.card strong,
.sub-card strong,
.note-box strong,
.container p b,
.container li b {
    color: #111827 !important;
    font-weight: 700 !important;
}

.grid-2 > *,
.grid-3 > *,
.mindmap-grid > * {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: break-word !important;
}

/* Điểm nhấn Đỏ cam tiết chế trên mã lệnh inline `code` — luôn tự xuống dòng khi hẹp */
code:not(pre code) {
    background: #FDECE2 !important;
    color: #B91C1C !important;
    border: none !important;
    padding: 1px 5px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    display: inline !important;
}

pre {
    background: #F3EEE4 !important;
    color: #111827 !important;
    border: 1.5px solid #D8D0C5 !important;
    border-left: 4px solid #1E3A8A !important;
    overflow-x: auto !important;
    max-width: 100% !important;
}

pre code {
    background: transparent !important;
    color: #111827 !important;
    border: none !important;
    padding: 0 !important;
    font-weight: 500 !important;
    white-space: pre !important;
}

/* Bảng dữ liệu trên Desktop / Tablet: chia cột cân đối, không tràn & không đè cột 1 */
.table-responsive {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin: 16px 0 !important;
}

.index-table,
.custom-table,
.table-responsive table,
.tf-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    background: #FAF7F2 !important;
    color: #111827 !important;
    border-color: #D8D0C5 !important;
}

.index-table th,
.custom-table th,
.table-responsive th,
.tf-table th {
    background: #1E3A8A !important;
    color: #FFFFFF !important;
    border: 1px solid #1E3A8A !important;
    font-weight: 700 !important;
    text-align: center !important;
    vertical-align: middle !important;
    padding: 10px 12px !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
}

.index-table td,
.custom-table td,
.table-responsive td,
.tf-table td {
    background: #FAF7F2 !important;
    color: #111827 !important;
    border: 1px solid #E5DFD5 !important;
    vertical-align: top !important;
    line-height: 1.55 !important;
    padding: 10px 12px !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
}

.index-table td:first-child,
.custom-table td:first-child {
    font-weight: 700;
}

.index-table tr:nth-child(even) td,
.custom-table tr:nth-child(even) td,
.table-responsive tr:nth-child(even) td,
.tf-table tr:nth-child(even) td {
    background: #F3EEE4 !important;
}

/* Tỉ lệ cột cân đối cho bảng 3 cột trên Desktop */
.index-table th:nth-child(1):nth-last-child(3),
.index-table td:nth-child(1):nth-last-child(3),
.custom-table th:nth-child(1):nth-last-child(3),
.custom-table td:nth-child(1):nth-last-child(3) { width: 25% !important; }

.index-table th:nth-child(2):nth-last-child(3),
.index-table td:nth-child(2):nth-last-child(3),
.custom-table th:nth-child(2):nth-last-child(3),
.custom-table td:nth-child(2):nth-last-child(3) { width: 39% !important; }

.index-table th:nth-child(3):nth-last-child(3),
.index-table td:nth-child(3):nth-last-child(3),
.custom-table th:nth-child(3):nth-last-child(3),
.custom-table td:nth-child(3):nth-last-child(3) { width: 36% !important; }

/* Mindmap, Quiz & Nút Accordion/Lightbox */
.mindmap-wrapper, .mindmap-container, .mindmap-box {
    background: #FAF7F2 !important;
    border: 1.5px solid #D8D0C5 !important;
}

.mindmap-card, .branch, .node-branch {
    background: #FAF7F2 !important;
    color: #111827 !important;
    border: 1.5px solid #D8D0C5 !important;
    border-top: 4px solid #1E3A8A !important;
    min-width: 0 !important;
    overflow-wrap: break-word !important;
}

.ltk-mm-toggle-btn {
    display: none;
    width: 100%;
    padding: 10px 14px !important;
    margin: 8px 0 6px 0 !important;
    background: #F3EEE4 !important;
    color: #1E3A8A !important;
    border: 1.5px solid #1E3A8A !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    cursor: pointer;
    text-align: center;
}

.ltk-zoom-hint {
    text-align: center;
    font-size: 0.8rem;
    color: #475569;
    margin-top: 6px;
    font-weight: 600;
}

.ltk-img-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(15, 23, 42, 0.92);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 14px;
}

.ltk-img-lightbox.open {
    display: flex;
}

.ltk-img-lightbox img {
    max-width: 96vw;
    max-height: 84vh;
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}

.ltk-lb-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: #B91C1C !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 8px 14px !important;
    font-weight: 700 !important;
    cursor: pointer;
}

.question-card, .quiz-item {
    background: #FAF7F2 !important;
    color: #111827 !important;
    border: 1.5px solid #D8D0C5 !important;
}

.options-list label {
    background: #FAF7F2 !important;
    color: #111827 !important;
    border: 1px solid #D8D0C5 !important;
}

.options-list label:hover {
    background: #F3EEE4 !important;
    border-color: #1E3A8A !important;
}

.explanation {
    background: #F3EEE4 !important;
    color: #111827 !important;
    border: 1px solid #D8D0C5 !important;
    border-left: 4px solid #1E3A8A !important;
}

hr {
    border-color: #D8D0C5 !important;
}

.ltk-floating-nav .home-btn,
.ltk-floating-nav a[href="index.html"] {
    display: none !important;
}

/* ==========================================================================
   MOBILE-FIRST BREAKPOINT (<= 640px):
   - Phẳng hóa bố cục (Flat Mobile Layout): tiết kiệm 25-30% bề ngang hiển thị
   - Bảng 2-5 cột -> Thẻ xếp dọc (Stacked Cards): 0% cắt chữ, 0% cuộn ngang
   - Mindmap chữ tự thu gọn vào Accordion, ưu tiên ảnh sơ đồ chạm phóng to
   ========================================================================== */
@media (max-width: 640px) {
    html, body {
        background: #FAF7F2 !important;
        padding-bottom: 72px !important;
    }

    .container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 12px 10px !important;
        border: none !important;
        border-top: 4px solid #1E3A8A !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    /* Gỡ bỏ lớp vỏ bọc thừa của section.card để mở rộng tối đa vùng đọc chữ */
    section.card,
    main > section,
    .container > section.card {
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 4px 0 !important;
        margin: 8px 0 !important;
    }

    header:not(.toolbar),
    header.hero {
        padding: 14px 10px !important;
        margin-bottom: 12px !important;
        border-radius: 8px !important;
    }

    h2, section h2, .card h2, h2.card-title {
        padding: 9px 11px !important;
        margin: 14px 0 10px 0 !important;
        font-size: 1rem !important;
        border-radius: 6px !important;
    }

    .sub-card, .box, .note-box, .info-box, .callout, .practice-box, .highlight-box {
        padding: 10px 12px !important;
        margin: 10px 0 !important;
        border-radius: 8px !important;
        box-shadow: none !important;
    }

    .grid-2, .grid-3, .mindmap-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    /* Mindmap Accordion trên điện thoại */
    .mindmap-wrapper {
        padding: 10px !important;
        border-radius: 8px !important;
    }

    .ltk-mm-toggle-btn {
        display: block !important;
    }

    .mindmap-wrapper.ltk-mobile-collapsed .mindmap-grid {
        display: none !important;
    }

    /* BẢNG 2..5 CỘT -> THẺ XẾP DỌC (STACKED CARDS) */
    .table-responsive {
        overflow-x: visible !important;
        margin: 12px 0 !important;
    }

    table.ltk-mobile-cards {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        background: transparent !important;
        border: none !important;
    }

    table.ltk-mobile-cards thead {
        display: none !important;
    }

    table.ltk-mobile-cards tbody {
        display: block !important;
        width: 100% !important;
    }

    table.ltk-mobile-cards tbody tr {
        display: block !important;
        width: 100% !important;
        background: #FAF7F2 !important;
        border: 1.5px solid #D8D0C5 !important;
        border-radius: 10px !important;
        margin-bottom: 12px !important;
        overflow: hidden !important;
        box-shadow: 0 2px 8px rgba(17, 24, 39, 0.06) !important;
    }

    table.ltk-mobile-cards tbody tr td {
        display: block !important;
        width: 100% !important;
        border: none !important;
        border-bottom: 1px solid #E5DFD5 !important;
        padding: 9px 12px !important;
        text-align: left !important;
        background: #FAF7F2 !important;
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
    }

    table.ltk-mobile-cards tbody tr td:last-child {
        border-bottom: none !important;
    }

    /* Ô đầu tiên trở thành thanh tiêu đề của Thẻ */
    table.ltk-mobile-cards tbody tr td:first-child {
        background: #1E3A8A !important;
        color: #FFFFFF !important;
        font-weight: 700 !important;
        font-size: 0.94rem !important;
        padding: 9px 12px !important;
        border-bottom: none !important;
    }

    table.ltk-mobile-cards tbody tr td:first-child b,
    table.ltk-mobile-cards tbody tr td:first-child strong {
        color: #FFFFFF !important;
    }

    table.ltk-mobile-cards tbody tr td:first-child code {
        background: rgba(255, 255, 255, 0.16) !important;
        color: #FDE68A !important;
    }

    /* Các ô còn lại hiển thị nhãn cột rõ ràng ở phía trên */
    table.ltk-mobile-cards tbody tr td:not(:first-child)::before {
        content: attr(data-label);
        display: block;
        font-size: 0.75rem;
        font-weight: 800;
        color: #1E3A8A;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        margin-bottom: 4px;
    }

    /* Giữ bảng Đúng/Sai (.tf-table) hoặc bảng >5 cột cuộn ngang gọn gàng */
    .tf-table {
        table-layout: auto !important;
        width: 100% !important;
    }
    .tf-table th, .tf-table td {
        padding: 7px 6px !important;
        font-size: 0.84rem !important;
    }
}

/* ==========================================================================
   V57: KHỐI MỤC TIÊU BÀI HỌC (YCCĐ – NLS – AI) & THANH CHUYỂN ĐỊNH HƯỚNG CS / ICT
   ========================================================================== */
.ltk-khbd-overview {
    background: #FAF7F2 !important;
    border: 1.5px solid #D8D0C5 !important;
    border-top: 4px solid #1E3A8A !important;
    border-radius: 10px !important;
    padding: 12px 14px !important;
    margin: 14px 0 18px 0 !important;
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.06) !important;
}

.ltk-khbd-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.86rem;
    font-weight: 800;
    color: #1E3A8A;
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 1.5px dashed #D8D0C5;
}

.ltk-track-pill {
    background: #E0E7FF;
    color: #1E3A8A;
    border: 1px solid #A5B4FC;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
}

.ltk-khbd-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.ltk-khbd-item {
    background: #FFFFFF;
    border: 1px solid #D8D0C5;
    border-radius: 8px;
    padding: 9px 11px;
    min-width: 0;
    overflow-wrap: break-word;
}

.ltk-khbd-label {
    font-size: 0.78rem;
    font-weight: 800;
    color: #1E3A8A;
    margin-bottom: 5px;
}

.ltk-khbd-text {
    font-size: 0.85rem;
    line-height: 1.48;
    color: #111827;
}

.ltk-comp-code {
    display: inline-block;
    background: #DBEAFE;
    color: #1E3A8A;
    font-weight: 700;
    font-size: 0.74rem;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 4px;
    margin-bottom: 2px;
}

.ltk-comp-code.ltk-ai-code {
    background: #FDECE2;
    color: #B91C1C;
    border: 1px solid #FDBA74;
}

.ltk-ai-activity {
    background: #FFFBEB !important;
    border: 1.5px solid #F59E0B !important;
    border-left: 5px solid #B91C1C !important;
    border-radius: 10px !important;
    padding: 12px 14px !important;
    margin: 18px 0 !important;
    box-shadow: 0 3px 10px rgba(180, 83, 9, 0.08) !important;
}

.ltk-ai-act-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: #9A3412;
    margin-bottom: 8px;
}

.ltk-ai-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ltk-ai-step {
    font-size: 0.86rem;
    line-height: 1.5;
    color: #111827;
    background: #FFFFFF;
    border: 1px solid #FDE68A;
    border-radius: 6px;
    padding: 7px 10px;
}

.ltk-track-switcher {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: #FFFFFF;
    border: 1.5px solid #D8D0C5;
    border-left: 5px solid #1E3A8A;
    border-radius: 10px;
    padding: 10px 14px;
    margin: 14px 0 18px 0;
    box-shadow: 0 3px 10px rgba(17, 24, 39, 0.06);
}

.ltk-ts-label {
    font-size: 0.88rem;
    font-weight: 800;
    color: #1E3A8A;
}

.ltk-ts-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ltk-ts-btn {
    padding: 6px 12px !important;
    border-radius: 8px !important;
    border: 1.5px solid #D8D0C5 !important;
    background: #FAF7F2 !important;
    color: #374151 !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ltk-ts-btn:hover {
    border-color: #1E3A8A !important;
    color: #1E3A8A !important;
}

.ltk-ts-btn.active {
    background: #1E3A8A !important;
    color: #FFFFFF !important;
    border-color: #1E3A8A !important;
}

.ltk-track-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 6px;
    vertical-align: middle;
}

.ltk-track-tag.cs {
    background: #DBEAFE;
    color: #1E3A8A;
}

.ltk-track-tag.ict {
    background: #FDECE2;
    color: #B91C1C;
}

/* Hiện nút Trang chủ nổi trên trang Mục lục để thuận tiện quay về */
body.page-muc-luc .ltk-floating-nav .home-btn,
body.page-muc-luc .ltk-floating-nav a[href="index.html"] {
    display: inline-flex !important;
}

@media (max-width: 768px) {
    .ltk-khbd-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .ltk-khbd-overview, .ltk-ai-activity {
        padding: 10px 11px !important;
        margin: 12px 0 !important;
    }
}


/* ==========================================================================
   V58.2: ĐỔI MÀU MÃ LỆNH INLINE `code` SANG XANH NAVY IN ĐẬM (#1E3A8A)
   - Thay thế nền đỏ/chữ đỏ gây rối mắt bằng Xanh Navy đậm trên nền xanh dịu nhẹ
   ========================================================================== */
code:not(pre code) {
    background: #EFF6FF !important;
    color: #1E3A8A !important;
    border: 1px solid #DBEAFE !important;
    padding: 1px 6px !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    display: inline !important;
}


/* ==========================================================================
   V59: ĐỒNG BỘ TÓM TẮT DẠNG CHỮ (THU GỌN/MỞ RỘNG) + SƠ ĐỒ PHÓNG TO
        VÀ TỐI ƯU BẢNG NHIỀU CỘT (CHỐNG GÃY CHỮ + PHÓNG TO TOÀN MÀN HÌNH)
   ========================================================================== */
.ltk-mm-toggle-btn {
    display: block !important;
    width: 100%;
    padding: 10px 14px !important;
    margin: 8px 0 10px 0 !important;
    background: #F3EEE4 !important;
    color: #1E3A8A !important;
    border: 1.5px solid #1E3A8A !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    font-size: 0.92rem !important;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.ltk-mm-toggle-btn:hover {
    background: #1E3A8A !important;
    color: #FFFFFF !important;
}

.mindmap-wrapper.ltk-mm-collapsed .mindmap-grid,
.mindmap-box.ltk-mm-collapsed .node-tree,
.mindmap-container.ltk-mm-collapsed .mindmap-branches {
    display: none !important;
}

.mindmap-image-box,
.infographic-container {
    text-align: center;
    margin: 14px 0 6px 0;
}

.mindmap-image-box img,
.infographic-container img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid #D8D0C5;
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.08);
    transition: transform 0.18s ease;
}

.mindmap-image-box img:hover,
.infographic-container img:hover {
    transform: scale(1.01);
}

.ltk-zoom-hint {
    text-align: center;
    font-size: 0.84rem;
    color: #334155;
    margin-top: 8px;
    font-weight: 600;
}

/* Lightbox cho cả Ảnh sơ đồ & Bảng nhiều cột */
.ltk-img-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(15, 23, 42, 0.94);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 54px 12px 16px 12px;
}

.ltk-img-lightbox.open {
    display: flex;
}

.ltk-lb-content.ltk-lb-img-mode img {
    max-width: 96vw;
    max-height: 84vh;
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}

.ltk-lb-content.ltk-lb-table-mode {
    width: 96vw;
    max-width: 1040px;
    max-height: 84vh;
    background: #FAF7F2;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.ltk-lb-table-hint {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1E3A8A;
    text-align: center;
}

.ltk-lb-table-scroll {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.ltk-lb-table-scroll table {
    min-width: 680px !important;
    width: 100% !important;
    table-layout: auto !important;
}

/* Thanh tiện ích phía trên bảng rộng trên di động */
.ltk-table-toolbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 8px;
    padding: 6px 10px;
    margin: 12px 0 6px 0;
}

.ltk-tb-hint {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1E3A8A;
}

.ltk-tb-zoom-btn {
    padding: 4px 10px !important;
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    border: 1px solid #1E3A8A !important;
    background: #1E3A8A !important;
    color: #FFFFFF !important;
    cursor: pointer;
    white-space: nowrap;
}

/* TỐI ƯU BẢNG NHIỀU CỘT: Chống bóp hẹp gãy từ tiếng Việt trên di động */
.table-responsive {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

.table-responsive table:not(.tf-table) {
    table-layout: auto !important;
    width: 100% !important;
}

.table-responsive table:not(.tf-table) th,
.table-responsive table:not(.tf-table) td {
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

.table-responsive table:not(.tf-table) code {
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

@media (max-width: 768px) {
    .table-responsive table.ltk-wide-3 { min-width: 500px !important; }
    .table-responsive table.ltk-wide-4 { min-width: 620px !important; }
    .table-responsive table.ltk-wide-5 { min-width: 740px !important; }
}


/* ==========================================================================
   V59.3: ĐỒNG BỘ MÀU ĐÁNH DẤU KẾT QUẢ TRẮC NGHIỆM & KIỂM TRA TRỰC TUYẾN
   - ĐÚNG (Câu / Ý / Phương án): Xanh Sky (#0284C7 / #E0F2FE / #0C4A6E)
   - SAI  (Câu / Ý / Phương án): Đỏ cam  (#EA580C / #FFEDD5 / #9A3412)
   ========================================================================== */
.question-card.correct-box,
.quiz-item.correct-box {
    border: 2px solid #0284C7 !important;
    border-left: 6px solid #0284C7 !important;
    background: #F0F9FF !important;
}

.question-card.wrong-box,
.quiz-item.wrong-box {
    border: 2px solid #EA580C !important;
    border-left: 6px solid #EA580C !important;
    background: #FFF7ED !important;
}

.options-list label.ltk-opt-correct,
.options-list label.correct-box,
.option-btn.correct {
    background: #E0F2FE !important;
    border: 1.5px solid #0284C7 !important;
    color: #0C4A6E !important;
    font-weight: 700 !important;
}

.options-list label.ltk-opt-wrong,
.options-list label.wrong-box,
.option-btn.wrong {
    background: #FFEDD5 !important;
    border: 1.5px solid #EA580C !important;
    color: #9A3412 !important;
    font-weight: 700 !important;
}

.tf-table tr.ltk-tf-correct td {
    background: #E0F2FE !important;
    color: #0C4A6E !important;
    border-color: #7DD3FC !important;
    font-weight: 600 !important;
}

.tf-table tr.ltk-tf-wrong td {
    background: #FFEDD5 !important;
    color: #9A3412 !important;
    border-color: #FDBA74 !important;
    font-weight: 600 !important;
}


/* ==========================================================================
   V62.1: TỰ ĐỘNG ĐIỀU CHỈNH PHÔNG CHỮ, CỠ CHỮ ĐỘNG (FLUID TYPOGRAPHY)
          & CHỐNG RỚT DÒNG CHO NHÃN TRẠNG THÁI, NÚT LỆNH, TIÊU ĐỀ / Ô NGẮN
   ========================================================================== */
body {
    font-family: 'Plus Jakarta Sans', 'Be Vietnam Pro', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: clamp(0.88rem, 1.1vw + 0.65rem, 1rem);
    text-rendering: optimizeLegibility;
}

h1, .top-banner h1 {
    font-size: clamp(1.15rem, 2.6vw, 1.7rem) !important;
    line-height: 1.3 !important;
    text-wrap: balance;
}

h2, .card-title, .panel-card h2 {
    font-size: clamp(0.96rem, 2vw, 1.24rem) !important;
    line-height: 1.35 !important;
    text-wrap: balance;
}

h3 {
    font-size: clamp(0.9rem, 1.7vw, 1.08rem) !important;
    line-height: 1.38 !important;
}

/* Giữ các nhãn trạng thái, huy hiệu, thẻ định hướng, nút điều hướng luôn gọn trên 1 dòng */
.badge,
.ltk-track-pill,
.ltk-track-tag,
.ltk-status-badge,
.status-badge,
.nav-tab-btn,
.ltk-ts-btn,
.ltk-tb-zoom-btn,
.ltk-float-btn,
.score-chip {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    line-height: 1.25 !important;
    font-size: clamp(0.72rem, 1.6vw, 0.84rem) !important;
}

/* Chống rớt dòng cho tiêu đề cột ngắn & ô dữ liệu ngắn trong bảng */
table th {
    font-size: clamp(0.76rem, 1.4vw, 0.9rem) !important;
    white-space: nowrap;
}

table td.ltk-nowrap,
table th.ltk-nowrap,
.ltk-nowrap {
    white-space: nowrap !important;
    word-break: keep-all !important;
}

/* Tự động co cỡ chữ nút bấm để không bị rớt chữ trên màn hình nhỏ */
button:not(.ltk-mm-toggle-btn):not(.btn-start):not(.btn-submit):not(.btn-clear),
.btn-action,
.btn-mini {
    white-space: nowrap;
    font-size: clamp(0.74rem, 1.7vw, 0.88rem) !important;
}


/* ==========================================================================
   V64.3: CHỐNG TRÀN LỀ TOÀN HỆ THỐNG (ĐẶC BIỆT THẺ NĂNG LỰC AI, KHUNG BÀI HỌC)
   ========================================================================== */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

.container,
.main-wrapper,
.card,
.panel-card,
.note-box,
.question-card,
.ltk-khbd-box,
.ltk-khbd-item,
.ltk-ai-activity {
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.ltk-khbd-grid > *,
.ltk-ai-steps > *,
.card > * {
    min-width: 0;
}

/* Cho phép mã Năng lực số / Năng lực AI tự động xuống dòng gọn trong khung thẻ */
.ltk-comp-code,
.ltk-comp-code.ltk-ai-code {
    display: inline-block !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    box-sizing: border-box !important;
    line-height: 1.4 !important;
    vertical-align: top !important;
}

pre,
.quiz-code-block,
.code-block {
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
}

.table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

img, svg, iframe {
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    .ltk-khbd-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   V66.1: PHÂN BIỆT RÕ RÀNG GIAO DIỆN PHÒNG ÔN TẬP (XANH NGỌC) vs PHÒNG KIỂM TRA (XANH NAVY)
          & SỬA LỖI CẮT CHỮ .hero-badge TRÊN ĐIỆN THOẠI
   ========================================================================== */
.hero-badge {
    display: inline-block !important;
    max-width: 100% !important;
    white-space: normal !important;
    word-break: break-word !important;
    text-align: center !important;
    line-height: 1.38 !important;
    padding: 5px 14px !important;
    box-sizing: border-box !important;
}

/* --- CHẾ ĐỘ 1: PHÒNG ÔN TẬP TRỰC TUYẾN (XANH NGỌC LỤC BẢO - EMERALD) --- */
body.ltk-mode-practice .hero {
    background: linear-gradient(135deg, #ECFDF5 0%, #F0FDF4 65%, #E6FFFA 100%) !important;
    border: 1.5px solid #A7F3D0 !important;
    border-top: 5px solid #059669 !important;
    border-bottom: 2.5px solid #10B981 !important;
}
body.ltk-mode-practice .hero-badge {
    background: #047857 !important;
    color: #FFFFFF !important;
    box-shadow: 0 2px 8px rgba(4, 120, 87, 0.25);
}
body.ltk-mode-practice .hero h1,
body.ltk-mode-practice #exam-header-title {
    color: #065F46 !important;
}
body.ltk-mode-practice .hero p {
    color: #047857 !important;
    font-weight: 600;
}
body.ltk-mode-practice .card-title {
    background: linear-gradient(90deg, #DCFCE7 0%, #F0FDF4 100%) !important;
    border-left: 5px solid #059669 !important;
    color: #065F46 !important;
}
body.ltk-mode-practice .note-box {
    border-left-color: #059669 !important;
}
body.ltk-mode-practice .btn-start {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.32) !important;
}
body.ltk-mode-practice .btn-start:hover {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
}
body.ltk-mode-practice #exam-status-bar {
    background: #064E3B !important;
    border-bottom: 2.5px solid #10B981 !important;
}

/* --- CHẾ ĐỘ 2: PHÒNG KIỂM TRA CHÍNH THỨC (XANH NAVY - OFFICIAL EXAM) --- */
body.ltk-mode-exam .hero {
    background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 65%, #DBEAFE 100%) !important;
    border: 1.5px solid #93C5FD !important;
    border-top: 5px solid #1E3A8A !important;
    border-bottom: 2.5px solid #1E40AF !important;
}
body.ltk-mode-exam .hero-badge {
    background: #1E3A8A !important;
    color: #FFFFFF !important;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.28);
}
body.ltk-mode-exam .hero h1,
body.ltk-mode-exam #exam-header-title {
    color: #1E3A8A !important;
}
body.ltk-mode-exam .hero p {
    color: #1E40AF !important;
    font-weight: 600;
}
body.ltk-mode-exam .card-title {
    background: linear-gradient(90deg, #DBEAFE 0%, #EFF6FF 100%) !important;
    border-left: 5px solid #1E3A8A !important;
    color: #1E3A8A !important;
}
body.ltk-mode-exam .note-box {
    border-left-color: #1E3A8A !important;
}
body.ltk-mode-exam .btn-start {
    background: linear-gradient(135deg, #1E3A8A 0%, #172554 100%) !important;
    box-shadow: 0 4px 14px rgba(30, 58, 138, 0.34) !important;
}
body.ltk-mode-exam .btn-start:hover {
    background: linear-gradient(135deg, #1D4ED8 0%, #1E3A8A 100%) !important;
}
body.ltk-mode-exam #exam-status-bar {
    background: #0F172A !important;
    border-bottom: 2.5px solid #3B82F6 !important;
}


/* ==========================================================================
   V67.3: KHẮC PHỤC TRIỆT ĐỂ LỖI HIỂN THỊ TRÊN DI ĐỘNG TOÀN HỆ THỐNG
   1. Danh mục Ôn tập / Kiểm tra (.lesson-item) chuyển Thẻ 2 tầng gọn đẹp (<= 720px)
      -> Không bao giờ bị bóp tên bài thành từng chữ xếp dọc!
   2. Thanh điều hướng nổi (.ltk-floating-nav) căn giữa khi ít nút & vuốt ngang mượt khi nhiều nút
      -> Không bao giờ bị cắt nút ở 2 mép trái/phải!
   3. Lưới biểu mẫu nhiều cột (.ltk-mob-stack) tự xếp 1 cột trên điện thoại (<= 680px)
   ========================================================================== */
.ltk-floating-nav {
    max-width: calc(100vw - 16px) !important;
    box-sizing: border-box !important;
}

@media (max-width: 720px) {
    /* 1. Thẻ Ôn tập & Kiểm tra trên Mục lục 10/11/12: Bố cục 2 tầng (Tầng 1: Tiêu đề 100%, Tầng 2: Kỳ + Trạng thái + Thời lượng + Mũi tên) */
    #ltk-review-list-core .lesson-item,
    #ltk-exam-list-core .lesson-item,
    #ltk-dynamic-exams-list .lesson-item,
    .lesson-item:has(.ltk-exam-state-slot) {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        row-gap: 8px !important;
        column-gap: 8px !important;
        padding: 12px 12px !important;
    }

    #ltk-review-list-core .lesson-item .lesson-name,
    #ltk-exam-list-core .lesson-item .lesson-name,
    #ltk-dynamic-exams-list .lesson-item .lesson-name,
    .lesson-item:has(.ltk-exam-state-slot) .lesson-name {
        order: 1 !important;
        flex: 1 0 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        font-size: 0.94rem !important;
        font-weight: 700 !important;
        line-height: 1.45 !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
    }

    #ltk-review-list-core .lesson-item .lesson-num,
    #ltk-exam-list-core .lesson-item .lesson-num,
    #ltk-dynamic-exams-list .lesson-item .lesson-num,
    .lesson-item:has(.ltk-exam-state-slot) .lesson-num {
        order: 2 !important;
        min-width: auto !important;
        flex-shrink: 0 !important;
        font-size: 0.78rem !important;
        padding: 3px 8px !important;
        border-radius: 6px !important;
        background: #EFF6FF !important;
        border: 1px solid #BFDBFE !important;
        color: #1E3A8A !important;
    }

    #ltk-review-list-core .lesson-item .ltk-exam-state-slot,
    #ltk-exam-list-core .lesson-item .ltk-exam-state-slot,
    #ltk-dynamic-exams-list .lesson-item .ltk-exam-state-slot,
    .lesson-item:has(.ltk-exam-state-slot) .ltk-exam-state-slot {
        order: 3 !important;
        flex-shrink: 0 !important;
        max-width: 100% !important;
    }

    #ltk-review-list-core .lesson-item .ltk-exam-state-slot .ltk-status-badge,
    #ltk-exam-list-core .lesson-item .ltk-exam-state-slot .ltk-status-badge,
    #ltk-dynamic-exams-list .lesson-item .ltk-exam-state-slot .ltk-status-badge {
        font-size: 0.73rem !important;
        padding: 3px 8px !important;
        white-space: nowrap !important;
    }

    #ltk-review-list-core .lesson-item .page-num,
    #ltk-exam-list-core .lesson-item .page-num,
    #ltk-dynamic-exams-list .lesson-item .page-num,
    .lesson-item:has(.ltk-exam-state-slot) .page-num {
        order: 4 !important;
        margin-right: 0 !important;
        font-size: 0.78rem !important;
        color: #475569 !important;
        white-space: nowrap !important;
    }

    #ltk-review-list-core .lesson-item .icon-link,
    #ltk-exam-list-core .lesson-item .icon-link,
    #ltk-dynamic-exams-list .lesson-item .icon-link,
    .lesson-item:has(.ltk-exam-state-slot) .icon-link {
        order: 5 !important;
        margin-left: auto !important;
        flex-shrink: 0 !important;
    }

    /* Bảo vệ các dòng bài học thông thường (Bài 1–34) trên màn hình nhỏ không bao giờ bị bóp chữ */
    .lesson-item {
        flex-wrap: wrap !important;
        row-gap: 4px !important;
    }
    .lesson-item .lesson-name {
        flex: 1 1 160px !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
    }

    /* 2. Thanh điều hướng nổi (.ltk-floating-nav): căn giữa khi ít nút, vuốt ngang mượt từ nút đầu tiên khi nhiều nút */
    .ltk-floating-nav {
        left: 8px !important;
        right: 8px !important;
        bottom: 8px !important;
        width: auto !important;
        max-width: calc(100vw - 16px) !important;
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        padding: 6px 8px !important;
        gap: 6px !important;
    }
    .ltk-floating-nav::-webkit-scrollbar {
        display: none !important;
    }
    .ltk-floating-nav::before,
    .ltk-floating-nav::after {
        content: "";
        margin: auto;
        flex: 0 0 0px;
    }
    .ltk-floating-nav .ltk-float-btn {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        padding: 6px 10px !important;
        font-size: 0.75rem !important;
    }
}

/* 3. Lưới biểu mẫu nhiều cột trên các trang Quản trị & Đăng nhập tự động xếp 1 cột gọn trên điện thoại */
@media (max-width: 680px) {
    .ltk-mob-stack {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .ltk-mob-stack > * {
        min-width: 0 !important;
    }
}
