/* ==========================================================
   LineLearn - High-Contrast Pure Dark Mode Stylesheet
   Modern, Single-Line Navigation, Zero Horizontal Overflow
   ========================================================== */

:root {
    --ll-primary: #6366f1;
    --ll-primary-hover: #4f46e5;
    --ll-primary-rgb: 99, 102, 241;
    --ll-secondary: #06b6d4;
    --ll-accent: #f59e0b;
    --ll-success: #10b981;
    --ll-danger: #ef4444;
    --ll-info: #38bdf8;
    
    /* Pure Dark Theme Variables */
    --ll-bg-main: #0b0f19;
    --ll-bg-surface: #131b2e;
    --ll-bg-subtle: #1c2640;
    --ll-bg-card: #151d32;
    --ll-bg-input: #17223b;
    --ll-border: #233253;
    --ll-border-light: #33446b;
    --ll-text-main: #f8fafc;
    --ll-text-muted: #94a3b8;
    --ll-text-subtle: #cbd5e1;
    --ll-card-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --ll-card-hover-shadow: 0 12px 28px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(99, 102, 241, 0.35);
}

/* Global Reset & Base Typography - Fix Mobile Horizontal Drag */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    position: relative;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--ll-bg-main);
    color-scheme: dark;
}

body {
    background-color: var(--ll-bg-main) !important;
    color: var(--ll-text-main) !important;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
    width: 100%;
    overflow-x: hidden !important;
}

/* Containers and Row Fix for Mobile */
.container, .container-fluid {
    width: 100% !important;
    max-width: 100% !important;
    padding-right: 1rem !important;
    padding-left: 1rem !important;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px !important;
    }
}
@media (min-width: 768px) {
    .container {
        max-width: 720px !important;
    }
}
@media (min-width: 992px) {
    .container {
        max-width: 960px !important;
    }
}
@media (min-width: 1200px) {
    .container {
        max-width: 1140px !important;
    }
}
@media (min-width: 1400px) {
    .container {
        max-width: 1320px !important;
    }
}

.row {
    margin-right: -0.5rem !important;
    margin-left: -0.5rem !important;
}

.row > * {
    padding-right: 0.5rem !important;
    padding-left: 0.5rem !important;
}

/* Crisp Headings */
h1, .h1 { font-size: clamp(1.75rem, 3.8vw, 2.75rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; color: #ffffff !important; word-wrap: break-word; }
h2, .h2 { font-size: clamp(1.35rem, 2.8vw, 2.1rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; color: #ffffff !important; word-wrap: break-word; }
h3, .h3 { font-size: clamp(1.2rem, 2.2vw, 1.65rem); font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; color: #ffffff !important; word-wrap: break-word; }
h4, .h4 { font-size: clamp(1.05rem, 1.8vw, 1.35rem); font-weight: 600; line-height: 1.35; color: #ffffff !important; word-wrap: break-word; }
h5, .h5 { font-size: 1.1rem; font-weight: 600; color: #ffffff !important; word-wrap: break-word; }
h6, .h6 { font-size: 0.95rem; font-weight: 600; color: #f1f5f9 !important; word-wrap: break-word; }

p {
    font-size: 0.98rem;
    color: var(--ll-text-subtle) !important;
    word-wrap: break-word;
}

.text-muted {
    color: var(--ll-text-muted) !important;
}

.text-body {
    color: var(--ll-text-main) !important;
}

a {
    color: #818cf8;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #a5b4fc;
}

/* Custom Navigation Bar - Single Line Strictly, Zero Horizontal Overflow */
.navbar-custom {
    background-color: rgba(19, 27, 46, 0.96) !important;
    border-bottom: 1px solid var(--ll-border) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.3s ease;
    width: 100% !important;
    max-width: 100vw !important;
}

.brand-logo {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    white-space: nowrap !important;
    background: linear-gradient(135deg, #818cf8 0%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    font-size: 0.84rem;
    color: var(--ll-text-muted) !important;
    padding: 0.35rem 0.45rem !important;
    border-radius: 0.5rem;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.25rem;
    line-height: 1.2 !important;
    transition: all 0.15s ease;
}

.nav-link i {
    font-size: 0.92rem;
    line-height: 1;
}

@media (min-width: 1400px) {
    .brand-logo {
        font-size: 1.35rem;
    }
    .nav-link {
        font-size: 0.88rem;
        padding: 0.4rem 0.65rem !important;
        gap: 0.35rem;
    }
    .nav-link i {
        font-size: 1rem;
    }
}

.nav-link:hover, .nav-link.active {
    color: #ffffff !important;
    background-color: rgba(99, 102, 241, 0.15) !important;
}

/* Hero Section */
.hero-wrapper {
    position: relative;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.18), transparent 50%),
                radial-gradient(circle at bottom left, rgba(6, 182, 212, 0.12), transparent 50%),
                #0b0f19;
    padding: 3rem 0 2.5rem;
    border-bottom: 1px solid var(--ll-border);
    overflow: hidden;
}

@media (min-width: 768px) {
    .hero-wrapper {
        padding: 5rem 0 4rem;
    }
}

.hero-title {
    font-size: clamp(1.85rem, 4.5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.15;
    color: #ffffff !important;
}

.hero-subtitle {
    font-size: clamp(0.95rem, 1.8vw, 1.2rem);
    color: var(--ll-text-muted) !important;
    max-width: 700px;
    line-height: 1.65;
}

/* Hero Search Bar */
.search-bar-hero {
    background: var(--ll-bg-surface);
    border: 2px solid var(--ll-border);
    border-radius: 50rem;
    padding: 0.35rem 0.45rem 0.35rem 1.1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
    max-width: 100%;
}

@media (max-width: 575px) {
    .search-bar-hero {
        border-radius: 1rem;
        padding: 0.5rem 0.75rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    .search-bar-hero input {
        width: 100%;
        padding: 0.25rem 0;
    }
    .search-bar-hero button {
        width: 100%;
    }
}

.search-bar-hero:focus-within {
    border-color: var(--ll-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25);
}

.search-bar-hero input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 1rem;
    width: 100%;
}

.search-bar-hero input::placeholder {
    color: #64748b;
}

/* Modern Card Layouts */
.ll-card {
    background-color: var(--ll-bg-card) !important;
    border: 1px solid var(--ll-border) !important;
    border-radius: 0.85rem;
    box-shadow: var(--ll-card-shadow);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
    overflow: hidden;
    height: auto;
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

.ll-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--ll-card-hover-shadow);
    border-color: var(--ll-border-light) !important;
}

.ll-card .card-img-top {
    height: 180px;
    object-fit: cover;
    background-color: var(--ll-bg-subtle);
    transition: transform 0.3s ease;
}

.ll-card:hover .card-img-top {
    transform: scale(1.02);
}

/* Book Card Cover Aspect Ratio */
.ll-card-book .card-img-top {
    height: 220px;
    object-fit: cover;
}

@media (max-width: 575px) {
    .ll-card-book .card-img-top {
        height: 160px;
    }
}

/* Badges & Chips */
.badge-category {
    background-color: rgba(99, 102, 241, 0.18) !important;
    color: #a5b4fc !important;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.3rem 0.65rem;
    border-radius: 50rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid rgba(99, 102, 241, 0.3);
    white-space: nowrap;
}

.badge-tag {
    background-color: var(--ll-bg-subtle) !important;
    color: var(--ll-text-subtle) !important;
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: 0.4rem;
    border: 1px solid var(--ll-border);
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
    white-space: nowrap;
}

.badge-tag:hover {
    background-color: var(--ll-primary) !important;
    color: #ffffff !important;
    border-color: var(--ll-primary) !important;
}

/* Roadmap Timeline Mobile-Safe (No Horizontal Overflow) */
.roadmap-timeline {
    position: relative;
    padding-left: 2.75rem;
    width: 100%;
    max-width: 100%;
}

.roadmap-timeline::before {
    content: '';
    position: absolute;
    left: 1.15rem;
    top: 1rem;
    bottom: 1rem;
    width: 2px;
    background: var(--ll-border);
    border-radius: 2px;
}

.roadmap-step {
    position: relative;
    margin-bottom: 1.75rem;
    width: 100%;
}

.roadmap-step:last-child {
    margin-bottom: 0;
}

.roadmap-marker {
    position: absolute;
    left: -2.75rem;
    top: 0.2rem;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 50%;
    background: var(--ll-bg-surface);
    border: 2px solid var(--ll-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--ll-text-muted);
    z-index: 2;
    transition: all 0.3s ease;
}

.roadmap-step.completed .roadmap-marker {
    background: var(--ll-success);
    border-color: var(--ll-success);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.roadmap-card {
    background: var(--ll-bg-card) !important;
    border: 1px solid var(--ll-border) !important;
    border-radius: 0.75rem;
    padding: 1.15rem;
    transition: all 0.2s ease;
    width: 100%;
}

.roadmap-card:hover {
    border-color: var(--ll-primary) !important;
}

@media (max-width: 575px) {
    .roadmap-timeline {
        padding-left: 2.2rem;
    }
    .roadmap-timeline::before {
        left: 0.85rem;
    }
    .roadmap-marker {
        left: -2.2rem;
        width: 1.7rem;
        height: 1.7rem;
        font-size: 0.72rem;
    }
    .roadmap-card {
        padding: 0.85rem;
    }
}

/* Course Learning Player Layout */
.classroom-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    width: 100%;
}

@media (max-width: 991px) {
    .classroom-container {
        grid-template-columns: 1fr;
    }
}

.video-responsive {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 0.75rem;
    background: #000000;
    border: 1px solid var(--ll-border);
    width: 100%;
}

.video-responsive iframe,
.video-responsive video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.curriculum-sidebar {
    background: var(--ll-bg-surface) !important;
    border: 1px solid var(--ll-border) !important;
    border-radius: 0.75rem;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    width: 100%;
}

@media (max-width: 991px) {
    .curriculum-sidebar {
        max-height: 380px;
    }
}

.lesson-list-item {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--ll-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--ll-text-main) !important;
    transition: background-color 0.2s ease;
}

.lesson-list-item:hover {
    background-color: var(--ll-bg-subtle) !important;
    color: #818cf8 !important;
}

.lesson-list-item.active {
    background-color: rgba(99, 102, 241, 0.18) !important;
    color: #a5b4fc !important;
    font-weight: 600;
    border-left: 4px solid var(--ll-primary);
}

/* Content Reader Mode */
.reading-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #e2e8f0 !important;
    word-wrap: break-word;
}

.reading-content p {
    margin-bottom: 1.4rem;
    color: #e2e8f0 !important;
}

.reading-content h2, .reading-content h3, .reading-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff !important;
}

.reading-content pre {
    background: #070b13 !important;
    border: 1px solid var(--ll-border) !important;
    padding: 1.25rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #38bdf8 !important;
    max-width: 100%;
}

.reading-content code {
    font-family: 'JetBrains Mono', monospace;
    color: #f43f5e;
    background: rgba(244, 63, 94, 0.1);
    padding: 0.2rem 0.45rem;
    border-radius: 0.35rem;
    word-break: break-word;
}

/* Buttons */
.btn {
    white-space: nowrap !important;
}

.btn-primary {
    background-color: var(--ll-primary) !important;
    border-color: var(--ll-primary) !important;
    color: #ffffff !important;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--ll-primary-hover) !important;
    border-color: var(--ll-primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-warning {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #0f172a !important;
    font-weight: 700 !important;
}

.btn-warning:hover {
    background-color: #d97706 !important;
    border-color: #d97706 !important;
    color: #000000 !important;
}

/* High Contrast Outline Buttons on Dark Mode */
.btn-outline-warning {
    color: #fbbf24 !important;
    border-color: #fbbf24 !important;
    background-color: transparent !important;
}
.btn-outline-warning:hover, .btn-outline-warning:focus, .btn-outline-warning:active {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #0f172a !important;
}

.btn-outline-primary {
    color: #818cf8 !important;
    border-color: #6366f1 !important;
    background-color: transparent !important;
}
.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active {
    background-color: #6366f1 !important;
    border-color: #6366f1 !important;
    color: #ffffff !important;
}

.btn-outline-success {
    color: #34d399 !important;
    border-color: #10b981 !important;
    background-color: transparent !important;
}
.btn-outline-success:hover, .btn-outline-success:focus, .btn-outline-success:active {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
}

.btn-outline-danger {
    color: #f87171 !important;
    border-color: #ef4444 !important;
    background-color: transparent !important;
}
.btn-outline-danger:hover, .btn-outline-danger:focus, .btn-outline-danger:active {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
}

.btn-outline-info {
    color: #38bdf8 !important;
    border-color: #38bdf8 !important;
    background-color: transparent !important;
}
.btn-outline-info:hover, .btn-outline-info:focus, .btn-outline-info:active {
    background-color: #38bdf8 !important;
    border-color: #38bdf8 !important;
    color: #0f172a !important;
}

.btn-outline-secondary {
    color: #cbd5e1 !important;
    border-color: #475569 !important;
    background-color: transparent !important;
}
.btn-outline-secondary:hover, .btn-outline-secondary:focus, .btn-outline-secondary:active {
    background-color: #334155 !important;
    border-color: #64748b !important;
    color: #ffffff !important;
}

.btn-outline-light {
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    background-color: transparent !important;
}
.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: #ffffff !important;
    color: #ffffff !important;
}

/* High Contrast Badges in Dark Mode */
.badge {
    letter-spacing: 0.02em;
}

.badge.bg-success-subtle, .bg-success-subtle {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
    font-weight: 600;
}

.badge.bg-danger-subtle, .bg-danger-subtle {
    background-color: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
    font-weight: 600;
}

.badge.bg-warning-subtle, .bg-warning-subtle {
    background-color: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    font-weight: 600;
}

.badge.bg-primary-subtle, .bg-primary-subtle {
    background-color: rgba(99, 102, 241, 0.2) !important;
    color: #a5b4fc !important;
    border: 1px solid rgba(99, 102, 241, 0.35) !important;
    font-weight: 600;
}

.badge.bg-info-subtle, .bg-info-subtle {
    background-color: rgba(56, 189, 248, 0.2) !important;
    color: #7dd3fc !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    font-weight: 600;
}

.badge.bg-secondary-subtle, .bg-secondary-subtle {
    background-color: rgba(148, 163, 184, 0.15) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
    font-weight: 600;
}

.badge.bg-warning.text-dark {
    background-color: #f59e0b !important;
    color: #0f172a !important;
    font-weight: 800 !important;
}

/* Global Footer */
.footer-custom {
    background-color: var(--ll-bg-surface) !important;
    border-top: 1px solid var(--ll-border) !important;
    color: var(--ll-text-muted) !important;
    padding: 3rem 0 2rem;
    width: 100%;
    overflow-x: hidden;
}

.footer-link {
    color: #94a3b8 !important;
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-block;
    margin-bottom: 0.45rem;
    font-size: 0.92rem;
}

.footer-link:hover {
    color: #818cf8 !important;
}

/* Cards & Containers */
.card {
    background-color: var(--ll-bg-surface) !important;
    border-color: var(--ll-border) !important;
    color: var(--ll-text-main) !important;
    max-width: 100%;
}

.bg-body-tertiary {
    background-color: #0f1526 !important;
}

.border-top, .border-bottom, .border-start, .border-end, .border {
    border-color: var(--ll-border) !important;
}

/* Forms */
.form-control, .form-select {
    background-color: var(--ll-bg-input) !important;
    border-color: var(--ll-border) !important;
    color: #ffffff !important;
}

.form-control:focus, .form-select:focus {
    background-color: #1a2744 !important;
    border-color: var(--ll-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25) !important;
}

.form-control::placeholder {
    color: #94a3b8 !important;
}

.form-label {
    color: #e2e8f0 !important;
    font-weight: 600;
}

.form-check-label {
    color: #cbd5e1 !important;
}

/* Dropdown Menus */
.dropdown-menu {
    background-color: #131b2e !important;
    border: 1px solid #283756 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

.dropdown-item {
    color: #cbd5e1 !important;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: #1e293b !important;
    color: #ffffff !important;
}

/* Table Responsive Container & Crisp Headers */
.table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.table {
    color: #e2e8f0 !important;
    border-color: var(--ll-border) !important;
}

.table thead th, thead.table-light th, .table-light th {
    background-color: #1a233a !important;
    color: #f1f5f9 !important;
    border-bottom: 2px solid #2d3f66 !important;
    font-weight: 700;
}

.table tbody td {
    border-bottom: 1px solid #1c2742 !important;
    color: #cbd5e1;
}

.table-hover tbody tr:hover td {
    background-color: rgba(99, 102, 241, 0.08) !important;
    color: #ffffff !important;
}

/* Alerts */
.alert-success {
    background-color: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: #34d399 !important;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    color: #f87171 !important;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
    color: #fbbf24 !important;
}

.alert-info {
    background-color: rgba(56, 189, 248, 0.15) !important;
    border-color: rgba(56, 189, 248, 0.4) !important;
    color: #7dd3fc !important;
}

/* ==========================================================
   MathJax & Rich Learning Content Responsive Containment
   Prevents any formula, table, or card from overflowing viewport
   ========================================================== */
.note-content-wrapper,
.reading-content,
.rich-content,
.note-multi-sections,
.note-section-body {
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

.note-content-wrapper .card,
.note-content-wrapper .row > *,
.note-content-wrapper [class*="col-"],
.note-section-card {
    min-width: 0 !important;
    max-width: 100% !important;
}

.note-bullet-list {
    list-style-type: disc;
    margin-bottom: 1rem;
    padding-left: 1.5rem !important;
}

.note-bullet-list li {
    margin-bottom: 0.35rem;
    color: var(--ll-text-subtle);
}

/* MathJax 3 Container Overflow Control */
mjx-container {
    max-width: 100% !important;
    font-size: 100% !important;
}

mjx-container[jax="CHTML"][display="true"] {
    display: block !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    max-width: 100% !important;
    padding: 0.5rem 0.25rem !important;
    margin: 0.6rem 0 !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.4) transparent;
}

mjx-container[jax="CHTML"][display="true"]::-webkit-scrollbar {
    height: 4px;
}

mjx-container[jax="CHTML"][display="true"]::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.5);
    border-radius: 4px;
}

/* Responsive Math Box Card */
.math-box {
    overflow-x: auto !important;
    max-width: 100% !important;
    -webkit-overflow-scrolling: touch;
    padding: 0.75rem 1rem !important;
}

/* Mobile Adaptive Display (< 768px) */
@media (max-width: 767.98px) {
    .reading-content,
    .rich-content,
    .note-section-body {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
    }

    .reading-content h1, .rich-content h1 { font-size: 1.45rem !important; }
    .reading-content h2, .rich-content h2 { font-size: 1.3rem !important; }
    .reading-content h3, .rich-content h3 { font-size: 1.15rem !important; }
    .reading-content h4, .rich-content h4 { font-size: 1.05rem !important; }
    .reading-content h5, .rich-content h5 { font-size: 0.98rem !important; }
    .reading-content h6, .rich-content h6 { font-size: 0.9rem !important; }

    mjx-container[jax="CHTML"] {
        font-size: 88% !important;
    }

    .math-box {
        font-size: 0.88rem !important;
        padding: 0.5rem !important;
    }

    .card, .ll-card, .note-section-card {
        padding: 1rem !important;
        border-radius: 0.75rem !important;
    }

    .table {
        font-size: 0.85rem !important;
    }

    .badge {
        font-size: 0.75rem !important;
        padding: 0.35em 0.65em !important;
    }
}

