/* Font */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* CSS Variables - Light Theme */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 12px;
    --nav-height: 56px;
    --bottom-nav-height: 60px;
}

/* Dark Theme */
body.dark {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-card: #252525;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: #333333;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    direction: rtl;
    min-height: 100vh;
}

/* Font Sizes — applied to the ROOT <html> so every rem-based font on the site
   scales (not only text that inherits its size from <body>). The class is also
   mirrored on <body> for backward-compat, but the root rule is what scales rem. */
html.font-xs { font-size: 12px; }
html.font-sm { font-size: 14px; }
html.font-md { font-size: 16px; }
html.font-lg { font-size: 18px; }
html.font-xl { font-size: 20px; }
/* Keep <body> at 1rem so its own text follows the root scale too. */
body.font-xs, body.font-sm, body.font-md, body.font-lg, body.font-xl { font-size: 1rem; }

a {
    color: var(--accent);
    text-decoration: none;
}
a:hover {
    color: var(--accent-hover);
}

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

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: var(--nav-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    z-index: 250;
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.nav-actions,
.nav-btn-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Top-nav horizontal menu links ── */
.top-nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    justify-content: center;
    overflow: hidden;
    padding: 0 8px;
}
.top-nav-menu a {
    padding: 5px 11px;
    color: inherit;
    text-decoration: none;
    font-size: .875rem;
    white-space: nowrap;
    border-radius: 6px;
    opacity: .88;
    transition: background .15s, opacity .15s;
}
.top-nav-menu a:hover,
.top-nav-menu a.active { background: rgba(128,128,128,.15); opacity: 1; }
@media (max-width: 768px) { .top-nav-menu { display: none; } }

/* ── Top-nav social icons ── */
.nav-social-icons { display: flex; align-items: center; gap: 2px; }
.nav-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: inherit;
    text-decoration: none;
    opacity: .85;
    transition: opacity .15s, background .15s;
    flex-shrink: 0;
}
.nav-social-link:hover { opacity: 1; background: rgba(128,128,128,.15); }
.nav-social-link svg { width: 17px; height: 17px; }
.nav-social-emoji { font-size: 1.05rem; line-height: 1; }
@media (max-width: 480px) { .nav-social-icons { display: none; } }

/* ── Logo image in top-nav ── */
.top-nav-logo img { display: block; max-width: 200px; object-fit: contain; }

/* Hamburger */
.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: 0.3s;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ── Side Menu (modern, theme-aware) ─────────────────────────────────── */
.side-menu {
    position: fixed;
    top: var(--nav-height);
    right: 0;
    width: 300px;
    height: calc(100vh - var(--nav-height));
    z-index: 249;
    pointer-events: none;
    transform: translateX(105%);
    transition: transform .32s cubic-bezier(.4,0,.2,1);
}
.side-menu.open {
    pointer-events: auto;
    transform: translateX(0);
}
.side-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    z-index: -1;
}
.side-menu.open .side-menu-overlay {
    opacity: 1;
    pointer-events: auto;
}
.side-menu-content {
    position: relative;
    z-index: 1;
    height: 100%;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    box-shadow: -16px 0 40px rgba(15, 23, 42, .08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
body.dark .side-menu-content {
    box-shadow: -16px 0 40px rgba(0, 0, 0, .55);
    background: color-mix(in srgb, var(--bg-card) 96%, transparent);
}

/* Header card: user or brand */
.sm-user, .sm-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 16px;
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
        var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}
.sm-avatar, .sm-brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    background: linear-gradient(135deg,
        var(--accent),
        color-mix(in srgb, var(--accent) 60%, #000));
    box-shadow: 0 6px 14px color-mix(in srgb, var(--accent) 30%, transparent);
    flex-shrink: 0;
}
.sm-user-info, .sm-brand { min-width: 0; }
.sm-user-name, .sm-brand-name {
    font-weight: 700;
    font-size: .95rem;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sm-user-mob {
    font-size: .76rem;
    color: var(--text-secondary);
    direction: ltr;
    text-align: right;
}

/* List */
.sm-list {
    flex: 1;
    list-style: none;
    margin: 0;
    padding: 10px 10px 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.sm-list::-webkit-scrollbar { width: 4px; }
.sm-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }

.sm-section {
    padding: 12px 14px 6px;
    font-size: .7rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: .06em;
    text-transform: uppercase;
    user-select: none;
}
.sm-divider {
    height: 1px;
    margin: 8px 14px;
    background: var(--border-color);
    list-style: none;
}

.sm-row { margin-bottom: 2px; }
.sm-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: .92rem;
    font-weight: 500;
    transition:
        background .18s ease,
        color .18s ease,
        transform .15s ease;
    position: relative;
}
.sm-link:hover {
    background: color-mix(in srgb, var(--accent) 7%, var(--bg-secondary));
    color: var(--accent);
}
.sm-link:active { transform: translateX(-2px); }

.sm-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: background .18s, color .18s;
}
.sm-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
}
.sm-link:hover .sm-icon-wrap {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
}

.sm-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sm-arrow {
    color: var(--text-secondary);
    opacity: 0;
    transform: translateX(4px);
    transition: opacity .2s, transform .2s, color .2s;
}
.sm-link:hover .sm-arrow {
    opacity: 1;
    transform: translateX(0);
    color: var(--accent);
}

/* Active row — soft pill */
.sm-row-active .sm-link {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    font-weight: 700;
}
.sm-row-active .sm-link::before {
    content: '';
    position: absolute;
    right: -10px;
    top: 18%;
    bottom: 18%;
    width: 3px;
    border-radius: 4px;
    background: var(--accent);
}
.sm-row-active .sm-icon-wrap {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 10px color-mix(in srgb, var(--accent) 35%, transparent);
}
.sm-row-active .sm-arrow { opacity: 1; transform: translateX(0); color: var(--accent); }

.sm-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border-color);
    font-size: .72rem;
    color: var(--text-secondary);
    text-align: center;
    background: var(--bg-card);
}

@media (max-width: 380px) {
    .side-menu { width: 86vw; }
}

/* Icon Button */
.icon-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.1rem;
    transition: background 0.2s;
}
.icon-btn:hover {
    background: var(--bg-secondary);
}

/* Main Content */
.main-content {
    margin-top: var(--nav-height);
    padding: 16px;
    padding-bottom: calc(var(--bottom-nav-height) + 16px);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Bottom Navigation (modern floating bar) ─────────────────────────── */
:root {
    --bottom-nav-height: 68px;
}
.bottom-nav {
    position: fixed;
    bottom: 10px;
    right: 10px;
    left: 10px;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
    pointer-events: none; /* allow inner pointer events only */
}
.bottom-nav-inner {
    position: relative;
    pointer-events: auto;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    height: var(--bottom-nav-height);
    margin: 0 auto;
    max-width: 560px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    box-shadow:
        0 10px 30px rgba(0,0,0,.10),
        0 2px 6px rgba(0,0,0,.06);
    backdrop-filter: saturate(140%) blur(8px);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
    padding: 6px;
    overflow: hidden;
}
body.dark .bottom-nav-inner {
    background: color-mix(in srgb, var(--bg-card) 92%, transparent);
    box-shadow:
        0 10px 30px rgba(0,0,0,.45),
        0 2px 8px rgba(0,0,0,.30);
}

/* The sliding pill behind the active item */
.bottom-nav-pill {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 0;
    width: 0;
    border-radius: 16px;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
    transform: translateX(0);
    transition: transform .32s cubic-bezier(.4,0,.2,1),
                width .32s cubic-bezier(.4,0,.2,1),
                opacity .2s;
    opacity: 0;
    z-index: 0;
}

.bottom-nav-item {
    position: relative;
    z-index: 1;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: .68rem;
    font-weight: 500;
    padding: 6px 4px;
    border-radius: 16px;
    transition: color .22s, transform .22s;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item:hover { color: var(--accent); }
.bottom-nav-item.active { color: var(--accent); font-weight: 700; }
.bottom-nav-item:active { transform: scale(.93); }

.bottom-nav-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.bottom-nav-item.active .bottom-nav-icon-wrap { transform: translateY(-1px) scale(1.08); }

.bottom-nav-icon {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
}

.bottom-nav-label {
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -.01em;
}

/* When 5+ items, give a slightly tighter look on phones */
@media (max-width: 380px) {
    .bottom-nav-inner { padding: 4px; }
    .bottom-nav-item  { font-size: .64rem; padding: 4px 2px; }
    .bottom-nav-icon-wrap { width: 26px; height: 26px; }
    .bottom-nav-icon  { width: 20px; height: 20px; }
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.card-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
}
.card-body {
    color: var(--text-secondary);
}

/* Grid */
.grid {
    display: grid;
    gap: 16px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, transform 0.1s;
}
.btn:active {
    transform: scale(0.97);
}
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
}
.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-block {
    display: block;
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 0.9rem;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--accent);
}
textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}
.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fcd34d;
}
body.dark .alert-success { background: #14532d; color: #86efac; border-color: #166534; }
body.dark .alert-danger  { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; }
body.dark .alert-warning { background: #78350f; color: #fcd34d; border-color: #92400e; }

/* Utility */
.text-center { text-align: center; }
.text-muted  { color: var(--text-secondary); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 40px;
    min-height: calc(100vh - var(--nav-height) - var(--bottom-nav-height));
}
.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 32px 24px;
}
.auth-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}
.text-center {
    text-align: center;
}

/* OTP Inputs */
.otp-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 24px 0;
}
.otp-input {
    width: 48px;
    height: 54px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color 0.2s;
}
.otp-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}
.shake {
    animation: shake 0.4s ease;
}

/* OTP Timer */
.otp-timer {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.resend-link {
    color: var(--accent);
    cursor: pointer;
    font-weight: 700;
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s, background 0.2s;
    font-size: 0.9rem;
}
.radio-label:hover {
    background: var(--bg-secondary);
}
.radio-label input[type="radio"] {
    accent-color: var(--accent);
}
.radio-label input[type="radio"]:checked + span {
    color: var(--accent);
    font-weight: 700;
}

/* Profile */
.profile-container {
    max-width: 600px;
    margin: 0 auto;
}

/* Dashboard */
.dashboard-container {
    max-width: 800px;
    margin: 0 auto;
}
.dashboard-course-item {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}
.dashboard-course-item:last-child {
    border-bottom: none;
}
.dashboard-course-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Admin Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.admin-table th,
.admin-table td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}
.admin-table th {
    background: var(--bg-secondary);
    font-weight: 700;
    font-size: 0.85rem;
}
.admin-table tr:hover {
    background: var(--bg-secondary);
}
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Admin Header Row */
.admin-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

/* Small Buttons */
.btn-sm {
    display: inline-block;
    padding: 4px 12px;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    text-align: center;
    color: #fff;
    transition: opacity 0.2s;
}
.btn-sm:hover {
    opacity: 0.85;
    color: #fff;
}
.btn-sm.btn-primary { background: var(--accent); }
.btn-sm.btn-danger  { background: var(--danger); }
.btn-sm.btn-success { background: var(--success); }

/* Actions Column */
.actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
}
.badge-active {
    background: #dcfce7;
    color: #166534;
}
.badge-inactive {
    background: #fef2f2;
    color: #991b1b;
}
body.dark .badge-active  { background: #14532d; color: #86efac; }
body.dark .badge-inactive { background: #7f1d1d; color: #fca5a5; }

/* Stat Number */
.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.breadcrumb a {
    color: var(--accent);
}
.breadcrumb span {
    color: var(--text-primary);
}

/* Drag Handle */
.drag-handle {
    cursor: grab;
    user-select: none;
    font-size: 1.1rem;
    color: var(--text-secondary);
}
.drag-handle:active {
    cursor: grabbing;
}
tr.dragging {
    opacity: 0.5;
    background: var(--bg-secondary);
}
tr.drag-over {
    border-top: 2px solid var(--accent);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

/* Course Cards (User) */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.course-card {
    padding: 0;
    overflow: hidden;
}
.course-card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}
.course-card-body {
    padding: 16px;
}
.course-card-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 6px;
}
.course-card-desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 8px;
    line-height: 1.6;
    text-align: justify;
    direction: rtl;
    word-break: break-word;
    overflow-wrap: break-word;
}
.course-card-meta {
    display: flex;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Course Hero */
.course-hero {
    padding: 0;
    overflow: hidden;
}
.course-hero-image {
    width: 100%;
    max-height: 220px;
    overflow: hidden;
}
.course-hero-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}
.course-hero-body {
    padding: 20px;
}
.course-hero-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
}
.course-progress-section {
    margin-top: 16px;
    padding: 14px;
    background: var(--bg-secondary);
    border-radius: 10px;
}
.course-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.course-progress-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-secondary);
}
.course-progress-percent {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}
.course-progress-detail {
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Lessons Section */
.lessons-section {
    margin-top: 8px;
}
.lessons-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.lessons-section-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}
.lessons-count-badge {
    font-size: 0.8rem;
    padding: 4px 12px;
    background: var(--accent);
    color: #fff;
    border-radius: 20px;
    font-weight: 700;
}
.lessons-empty {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-secondary);
}
.lessons-empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}
.lessons-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Lesson Card (Modern) */
.lesson-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}
.lesson-card:hover {
    transform: translateX(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border-color: var(--accent);
    color: var(--text-primary);
}
body.dark .lesson-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.lesson-card-number {
    flex-shrink: 0;
}
.lesson-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    transition: all 0.2s;
}
.lesson-completed .lesson-number {
    background: #dcfce7;
    color: #166534;
}
body.dark .lesson-completed .lesson-number {
    background: #14532d;
    color: #86efac;
}
.lesson-progress .lesson-number {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(37,99,235,0.15);
}
body.dark .lesson-progress .lesson-number {
    box-shadow: 0 0 0 4px rgba(59,130,246,0.2);
}
.lesson-card-content {
    flex: 1;
    min-width: 0;
}
.lesson-card-title {
    display: block;
    font-size: 0.95rem;
    line-height: 1.5;
}
.lesson-card-badges {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.lesson-badge {
    display: inline-block;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
}
.lesson-badge-video {
    background: #ede9fe;
    color: #6d28d9;
}
.lesson-badge-audio {
    background: #fef3c7;
    color: #92400e;
}
body.dark .lesson-badge-video {
    background: #3b1f6e;
    color: #c4b5fd;
}
body.dark .lesson-badge-audio {
    background: #78350f;
    color: #fcd34d;
}
.lesson-card-arrow {
    flex-shrink: 0;
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: transform 0.2s;
}
.lesson-card:hover .lesson-card-arrow {
    transform: translateX(-4px);
    color: var(--accent);
}

/* Lesson completed card - subtle green border */
.lesson-card.lesson-completed {
    border-right: 3px solid var(--success);
}
/* Lesson in progress - subtle blue border */
.lesson-card.lesson-progress {
    border-right: 3px solid var(--accent);
}

/* Section header inside lesson list */
.lesson-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-top: 4px;
}
.lesson-section-icon {
    font-size: 1rem;
}
body.dark .lesson-section-header {
    background: rgba(255,255,255,0.05);
}

/* Legacy support */
.lesson-info {
    flex: 1;
}
.lesson-meta {
    font-size: 0.82rem;
    margin-top: 2px;
}

/* Lesson Navigation */
.lesson-nav {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 16px;
}

/* Quiz Styles */
.quiz-question {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}
.quiz-question:last-child {
    border-bottom: none;
}
.quiz-question-text {
    margin-bottom: 10px;
}
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.quiz-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    font-size: 0.92rem;
}
.quiz-option:hover:not(.quiz-disabled) {
    background: var(--bg-secondary);
}
.quiz-option input[type="radio"] {
    accent-color: var(--accent);
}
.quiz-disabled {
    cursor: default;
    opacity: 0.85;
}
.quiz-correct {
    border-color: var(--success);
    background: #dcfce7;
}
.quiz-wrong {
    border-color: var(--danger);
    background: #fef2f2;
}
body.dark .quiz-correct { background: #14532d; border-color: #166534; }
body.dark .quiz-wrong   { background: #7f1d1d; border-color: #991b1b; }
.quiz-result {
    margin-top: 8px;
    font-size: 0.88rem;
    font-weight: 700;
}
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }

/* Continue Card (Dashboard) */
.continue-card {
    display: block;
    color: var(--text-primary);
    border-right: 4px solid var(--accent);
    transition: background 0.2s;
}
.continue-card:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.continue-label {
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 4px;
}

/* Quiz Stats Row (Dashboard) */
.quiz-stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

/* Quiz Report */
.quiz-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.quiz-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.quiz-bar-label {
    min-width: 50px;
    font-size: 0.85rem;
    font-weight: 700;
}
.quiz-bar-track {
    flex: 1;
    height: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
}
.quiz-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}
.quiz-bar-correct { background: var(--success); }
.quiz-bar-wrong   { background: var(--danger); }
.quiz-bar-value {
    min-width: 40px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 700;
}
.quiz-report-course-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.quiz-report-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Lazy Load Images */
img[loading="lazy"] {
     transition: opacity 0.3s ease;
}
img[loading="lazy"].loaded,
img.loaded {
    opacity: 1;
}

/* PWA Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 8px);
    right: 16px;
    left: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    z-index: 200;
    max-width: 500px;
    margin: 0 auto;
}
.pwa-install-banner .btn {
    white-space: nowrap;
    padding: 8px 20px;
}
.pwa-install-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
}

/* Payment Card */
.payment-card {
    max-width: 500px;
    margin: 0 auto;
}
.payment-header {
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}
.payment-header h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}
.payment-details {
    margin-bottom: 16px;
}
.payment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.92rem;
}
.payment-row + .payment-row {
    border-top: 1px solid var(--border-color);
}
.payment-total {
    font-weight: 700;
    font-size: 1rem;
    border-top: 2px solid var(--border-color);
    padding-top: 12px;
    margin-top: 4px;
}
.payment-price {
    font-weight: 700;
    color: var(--accent);
    font-size: 1.15rem;
}
.payment-desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
    text-align: center;
    margin-bottom: 16px;
}

/* Plan Cards */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.plan-card {
    text-align: center;
    padding: 24px 16px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}
.plan-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.plan-active {
    border-color: var(--accent);
    border-width: 2px;
}
.plan-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: var(--accent);
    color: #fff;
    padding: 2px 12px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
}
.plan-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.plan-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
}
.plan-duration {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.plan-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}
.plan-features {
    list-style: none;
    text-align: right;
    margin-bottom: 16px;
    font-size: 0.88rem;
}
.plan-features li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}
.plan-features li:last-child {
    border-bottom: none;
}
.plan-features li::before {
    content: '✓ ';
    color: var(--success);
    font-weight: 700;
}

/* Payment History */
.payment-history-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}
.payment-history-item:last-child {
    border-bottom: none;
}
.payment-history-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.payment-amount {
    font-weight: 700;
    font-size: 1rem;
}

/* Badge Warning */
.badge-warning {
    background: #fffbeb;
    color: #92400e;
}
body.dark .badge-warning { background: #78350f; color: #fcd34d; }

/* Badge Info */
.badge-info {
    background: #dbeafe;
    color: #1e40af;
}
body.dark .badge-info { background: #1e3a5f; color: #93c5fd; }

/* Text utilities */
.text-left { text-align: left; }

/* Course Price Tag */
.course-price {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.92rem;
}
.course-price-free {
    color: var(--success);
}

/* Theme Transition */
body.theme-transition,
body.theme-transition *,
body.theme-transition *::before,
body.theme-transition *::after {
    transition: background-color 0.3s ease, color 0.2s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* Theme Selector */
.theme-selector {
    display: flex;
    gap: 12px;
}
.theme-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s, background 0.2s;
}
.theme-option:hover {
    background: var(--bg-secondary);
}
.theme-option.selected {
    border-color: var(--accent);
    background: var(--bg-secondary);
}

/* Font Size Selector */
.font-size-selector {
    display: flex;
    gap: 12px;
}
.font-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: border-color 0.2s, background 0.2s;
}
.font-option:hover {
    background: var(--bg-secondary);
}
.font-option.selected {
    border-color: var(--accent);
    background: var(--bg-secondary);
}
.font-preview {
    font-weight: 700;
    color: var(--accent);
}
.font-preview-sm { font-size: 1rem; }
.font-preview-md { font-size: 1.4rem; }
.font-preview-lg { font-size: 1.9rem; }

/* Settings Info */
.settings-info-list {
    display: flex;
    flex-direction: column;
}
.settings-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}
.settings-info-row:last-child {
    border-bottom: none;
}

/* Admin Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.stat-card {
    text-align: center;
    padding: 16px 8px;
}
.stat-card .stat-number {
    font-size: 1.6rem;
}

/* Admin Filter Row */
.filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.filter-row .form-control {
    width: auto;
    min-width: 140px;
}
.filter-row .btn {
    padding: 10px 16px;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px);
    right: 50%;
    transform: translateX(50%) translateY(20px);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    font-size: 0.9rem;
    z-index: 300;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    white-space: nowrap;
    max-width: 90vw;
}
.toast-show {
    opacity: 1;
    transform: translateX(50%) translateY(0);
}
.toast-success {
    border-right: 4px solid var(--success);
}
.toast-danger {
    border-right: 4px solid var(--danger);
}

/* ── Lesson content: force Vazirmatn font ── */
.lesson-content {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 1rem;
    line-height: 1.9;
}
.lesson-content p,
.lesson-content li,
.lesson-content td,
.lesson-content h1,
.lesson-content h2,
.lesson-content h3,
.lesson-content h4,
.lesson-content h5,
.lesson-content h6 {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

/* Rich Content (HTML from editor) */
.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 8px 0;
}
.rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}
.rich-content table th,
.rich-content table td {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    text-align: right;
}
.rich-content table th {
    background: var(--bg-secondary);
    font-weight: 700;
}
.rich-content blockquote {
    border-right: 4px solid var(--accent);
    padding: 8px 16px;
    margin: 12px 0;
    background: var(--bg-secondary);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
}
.rich-content pre {
    background: var(--bg-secondary);
    padding: 12px 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
    direction: ltr;
    text-align: left;
}
.rich-content code {
    background: var(--bg-secondary);
    padding: 0px 0px;
    border-radius: 4px;
    font-size: 0.9em;
    direction: ltr;
}
.rich-content code:has(.sc-form-wrap) {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    direction: inherit;
}
.rich-content pre code {
    background: none;
    padding: 0;
}
.rich-content a {
    color: var(--accent);
    text-decoration: underline;
}
.rich-content a:hover {
    color: var(--accent-hover);
}
.rich-content ul,
.rich-content ol {
    padding-right: 24px;
    margin: 8px 0;
}
.rich-content li {
    margin-bottom: 4px;
}
.rich-content h1, .rich-content h2, .rich-content h3,
.rich-content h4, .rich-content h5, .rich-content h6 {
    margin: 16px 0 8px;
}
.rich-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 16px 0;
}
.rich-content p {
    margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════════════════
   Audio Player v2 — Warm Color Playlist Player
   Colors: warm-amber (default) | warm-rose | warm-gold
══════════════════════════════════════════════════════════════ */
.ap2-wrapper {
    --ap-c1: #F97316;
    --ap-c2: #EA580C;
    --ap-bg: linear-gradient(145deg,#FFF7ED 0%,#FFEDD5 100%);
    --ap-shadow: 0 8px 32px rgba(249,115,22,.15);
    --ap-text: #1C1917;
    --ap-sub: #78716C;
    --ap-track: rgba(249,115,22,.18);
    margin: 10px 0;
    font-family: inherit;
    position: relative;
}
.ap2-wrapper[data-color="warm-rose"] {
    --ap-c1: #E11D48;
    --ap-c2: #BE123C;
    --ap-bg: linear-gradient(145deg,#FFF1F2 0%,#FFE4E6 100%);
    --ap-shadow: 0 8px 32px rgba(225,29,72,.15);
    --ap-track: rgba(225,29,72,.18);
}
.ap2-wrapper[data-color="warm-gold"] {
    --ap-c1: #D97706;
    --ap-c2: #92400E;
    --ap-bg: linear-gradient(145deg,#FFFBEB 0%,#FEF3C7 100%);
    --ap-shadow: 0 8px 32px rgba(217,119,6,.15);
    --ap-track: rgba(217,119,6,.18);
}
.ap2-card {
    background: var(--ap-bg);
    box-shadow: var(--ap-shadow);
    padding: 18px 20px 16px;
    position: relative;
    direction: rtl;
    border-radius: 16px;       /* own radius — wrapper no longer clips */
}
/* Decoration blobs live inside their own overflow:hidden layer
   so they never clip the speed/share popup menus              */
.ap2-card-deco {
    position: absolute; inset: 0;
    border-radius: 14px;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.ap2-card-deco::before,
.ap2-card-deco::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: .12;
    filter: blur(28px);
}
.ap2-card-deco::before {
    width: 130px; height: 130px;
    top: -45px; right: -40px;
    background: var(--ap-c1);
}
.ap2-card-deco::after {
    width: 90px; height: 90px;
    bottom: -30px; left: -25px;
    background: var(--ap-c2);
}
/* Card content must sit above the deco layer */
.ap2-header, .ap2-seek-wrap, .ap2-controls {
    position: relative;
    z-index: 1;
}
.ap2-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.ap2-cover {
    width: 46px; height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg,var(--ap-c1),var(--ap-c2));
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.14);
    color: #fff;
}
.ap2-info { flex: 1; min-width: 0; }
.ap2-title {
    font-weight: 700;
    font-size: .9rem;
    color: var(--ap-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.ap2-subtitle {
    font-size: .74rem;
    color: var(--ap-sub);
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    text-align: right;
}
.ap2-header-actions {
    display: flex; align-items: center;
    gap: 2px; flex-shrink: 0;
    position: relative;
}
.ap2-seek-wrap {
    padding: 6px 0;
    cursor: pointer;
    margin-bottom: 4px;
}
.ap2-seek-track {
    position: relative;
    height: 5px;
    border-radius: 10px;
    background: var(--ap-track);
    overflow: visible;
}
.ap2-seek-buf {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 0;
    border-radius: 10px;
    background: rgba(0,0,0,.1);
    pointer-events: none;
}
.ap2-seek-prog {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 0;
    border-radius: 10px;
    background: linear-gradient(to left,var(--ap-c1),var(--ap-c2));
    pointer-events: none;
}
.ap2-seek-handle {
    position: absolute;
    top: 50%; right: 0;
    width: 15px; height: 15px;
    border-radius: 50%;
    background: var(--ap-c1);
    border: 2.5px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    transform: translate(50%,-50%);
    pointer-events: none;
    transition: transform .15s;
}
.ap2-seek-wrap:hover .ap2-seek-handle {
    transform: translate(50%,-50%) scale(1.35);
}
.ap2-controls {
    display: flex; align-items: center;
    justify-content: space-between;
}
.ap2-controls-side {
    display: flex; align-items: center;
    gap: 2px; min-width: 64px;
}
.ap2-controls-left  { justify-content: flex-start; }
.ap2-controls-right { justify-content: flex-end; }
.ap2-controls-center {
    display: flex; align-items: center; gap: 4px;
}
.ap2-btn {
    background: none; border: none;
    cursor: pointer; color: var(--ap-sub);
    padding: 6px; border-radius: 8px;
    line-height: 0;
    transition: background .15s, color .15s, transform .1s;
    font-family: inherit; position: relative;
}
.ap2-btn:hover { background: rgba(0,0,0,.07); color: var(--ap-text); }
.ap2-btn:active { transform: scale(.88); }
.ap2-dl-btn {
    display: inline-flex !important; align-items: center; gap: 4px;
    line-height: 1 !important; font-size: .8rem; font-weight: 600;
    padding: 6px 10px !important;
}
.ap2-dl-btn span { font-size: .8rem; }
.ap2-play-btn {
    width: 50px !important; height: 50px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg,var(--ap-c1),var(--ap-c2)) !important;
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.2), 0 0 0 5px rgba(249,115,22,.12) !important;
    padding: 0 !important;
    display: flex !important; align-items: center; justify-content: center;
}
.ap2-play-btn:hover {
    filter: brightness(1.08);
    transform: scale(1.07) !important;
    background: linear-gradient(135deg,var(--ap-c1),var(--ap-c2)) !important;
}
.ap2-play-btn:active { transform: scale(.92) !important; }
.ap2-speed-wrap { position: relative; }
.ap2-speed-btn {
    font-size: .72rem !important; font-weight: 700 !important;
    padding: 4px 7px !important;
    border: 1.5px solid var(--ap-track) !important;
    border-radius: 6px !important; color: var(--ap-text) !important;
    min-width: 36px; text-align: center; white-space: nowrap;
}
.ap2-speed-menu {
    position: absolute;
    bottom: calc(100% + 6px); left: 50%;
    transform: translateX(-50%);
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    overflow: hidden; display: none;
    z-index: 9990; min-width: 74px;
}
.ap2-speed-menu.ap2-open { display: block; }
.ap2-speed-menu button {
    display: block; width: 100%;
    padding: 8px 14px; background: none; border: none;
    cursor: pointer; font-size: .8rem; font-family: inherit;
    text-align: center; color: #374151;
    transition: background .12s; white-space: nowrap;
}
.ap2-speed-menu button:hover { background: #f3f4f6; }
.ap2-speed-menu button.ap2-speed-on { color: var(--ap-c1); font-weight: 700; }
.ap2-vol-wrap { display: flex; align-items: center; gap: 2px; }
.ap2-vol-slider-wrap { max-width: 0; overflow: hidden; transition: max-width .3s ease; }
.ap2-vol-wrap:hover .ap2-vol-slider-wrap,
.ap2-vol-wrap:focus-within .ap2-vol-slider-wrap { max-width: 60px; }
.ap2-vol-slider {
    width: 56px; accent-color: var(--ap-c1);
    cursor: pointer; display: block; vertical-align: middle;
}
.ap2-share-wrap { position: relative; }
.ap2-share-popup {
    position: absolute;
    bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%);
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,.14);
    padding: 12px 14px;
    display: none; z-index: 9990;
    min-width: 200px; direction: rtl;
}
.ap2-share-popup.ap2-open { display: block; }
.ap2-share-title {
    font-size: .78rem; font-weight: 700;
    color: #374151; text-align: center;
    margin-bottom: 10px;
}
.ap2-share-btns {
    display: flex; gap: 8px;
    justify-content: center; margin-bottom: 10px;
}
.ap2-share-icon {
    width: 38px; height: 38px;
    border-radius: 50%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #fff; transition: transform .15s;
    text-decoration: none;
}
.ap2-share-icon:hover { transform: scale(1.1); }
.ap2-share-tg { background: #2AABEE; }
.ap2-share-wa { background: #25D366; }
.ap2-share-link-row { display: flex; gap: 4px; }
.ap2-share-link-inp {
    flex: 1; border: 1px solid #e5e7eb;
    border-radius: 6px; padding: 5px 8px;
    font-size: .72rem; color: #374151;
    background: #f9fafb; min-width: 0;
    direction: ltr; outline: none;
}
.ap2-share-copy-btn {
    background: var(--ap-c1); color: #fff; border: none;
    border-radius: 6px; padding: 5px 10px;
    font-size: .72rem; cursor: pointer;
    white-space: nowrap; font-weight: 700;
    font-family: inherit; transition: opacity .15s;
}
.ap2-share-copy-btn:hover { opacity: .88; }
.ap2-playlist {
    background: rgba(255,255,255,.65);
    border-top: 1px solid rgba(0,0,0,.06);
    direction: rtl;
    border-radius: 0 0 16px 16px;
}
.ap2-pl-header {
    padding: 8px 16px 4px;
    font-size: .72rem; font-weight: 700;
    color: var(--ap-sub);
    letter-spacing: .05em;
}
.ap2-pl-item {
    display: flex; align-items: center;
    gap: 10px; padding: 9px 16px;
    cursor: pointer; transition: background .13s;
    border-top: 1px solid rgba(0,0,0,.04);
}
.ap2-pl-item:hover { background: rgba(0,0,0,.03); }
.ap2-pl-item.ap2-pl-on {
    background: linear-gradient(to left,rgba(249,115,22,.09),transparent);
}
.ap2-pl-num-cell {
    width: 22px; text-align: center;
    flex-shrink: 0; font-size: .75rem;
    color: var(--ap-sub); position: relative;
    height: 20px; display: flex;
    align-items: center; justify-content: center;
}
.ap2-pl-item.ap2-pl-on .ap2-pl-num-cell { color: var(--ap-c1); font-weight: 700; }
.ap2-pl-bars {
    display: none; align-items: flex-end;
    gap: 1.5px; height: 14px;
    position: absolute; inset: 0;
    justify-content: center;
}
.ap2-pl-item.ap2-pl-on.ap2-pl-playing .ap2-pl-bars { display: flex; }
.ap2-pl-item.ap2-pl-on.ap2-pl-playing .ap2-pl-num { opacity: 0; }
.ap2-pl-bars span {
    display: block; width: 2.5px;
    border-radius: 2px; background: var(--ap-c1);
    animation: ap2eq .65s ease-in-out infinite alternate;
}
.ap2-pl-bars span:nth-child(1) { height: 40%; animation-delay: 0s; }
.ap2-pl-bars span:nth-child(2) { height: 100%; animation-delay: .13s; }
.ap2-pl-bars span:nth-child(3) { height: 60%; animation-delay: .26s; }
.ap2-pl-bars span:nth-child(4) { height: 80%; animation-delay: .1s; }
@keyframes ap2eq { to { height: 15%; } }
.ap2-pl-title {
    flex: 1; font-size: .83rem; color: #374151;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ap2-pl-item.ap2-pl-on .ap2-pl-title { color: var(--ap-c1); font-weight: 600; }
.ap2-pl-dur {
    font-size: .74rem; color: var(--ap-sub);
    font-variant-numeric: tabular-nums;
    direction: ltr; flex-shrink: 0;
}
body.dark .ap2-wrapper {
    --ap-bg: linear-gradient(145deg,#2D1800 0%,#3D2408 100%);
    --ap-text: #F5F5F4; --ap-sub: #A8A29E;
    --ap-track: rgba(249,115,22,.22);
}
body.dark .ap2-wrapper[data-color="warm-rose"] {
    --ap-bg: linear-gradient(145deg,#2D0011 0%,#3D0018 100%);
    --ap-track: rgba(225,29,72,.22);
}
body.dark .ap2-wrapper[data-color="warm-gold"] {
    --ap-bg: linear-gradient(145deg,#251800 0%,#352200 100%);
    --ap-track: rgba(217,119,6,.22);
}
body.dark .ap2-card-deco::before,
body.dark .ap2-card-deco::after { opacity: .07; }
body.dark .ap2-seek-handle { border-color: #292524; }
body.dark .ap2-playlist { background: rgba(0,0,0,.2); }
body.dark .ap2-pl-item:hover { background: rgba(255,255,255,.05); }
body.dark .ap2-pl-item.ap2-pl-on { background: linear-gradient(to left,rgba(249,115,22,.13),transparent); }
body.dark .ap2-pl-title { color: #D6D3D1; }
body.dark .ap2-speed-menu,
body.dark .ap2-share-popup { background: #1C1917; border-color: #3F3F46; }
body.dark .ap2-speed-menu button { color: #D1D5DB; }
body.dark .ap2-speed-menu button:hover { background: #292524; }
body.dark .ap2-share-title { color: #D1D5DB; }
body.dark .ap2-share-link-inp { background: #292524; border-color: #4B5563; color: #D1D5DB; }
@media (max-width: 480px) {
    .ap2-card { padding: 14px 14px 12px; }
    .ap2-play-btn { width: 44px !important; height: 44px !important; }
    .ap2-cover { width: 40px; height: 40px; }
    .ap2-controls-side { min-width: 48px; }
}

/* Desktop: hide bottom nav, show side menu differently */
@media (min-width: 769px) {
    .bottom-nav {
        display: none;
    }
    .main-content {
        padding-bottom: 32px;
    }
    .toast {
        bottom: 32px;
    }
}

/* Tablet */
@media (max-width: 768px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile */
@media (max-width: 480px) {
    .grid-2,
    .grid-3 { grid-template-columns: 1fr; }
    .main-content {
        padding: 12px;
        padding-bottom: calc(var(--bottom-nav-height) + 12px);
    }
    .theme-selector,
    .font-size-selector {
        gap: 8px;
    }
    .theme-option,
    .font-option {
        padding: 12px 6px;
    }
}

/* Font Size Toggle Button */
.font-size-icon {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
}

/* Site Banner */
.site-banner {
    position: relative;
    z-index: 98;
    margin-top: var(--nav-height);
    overflow: hidden;
    background: var(--accent);
    color: #fff;
    padding: 10px 16px;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.6;
}
.site-banner::after { content: ''; display: table; clear: both; }
.site-banner img {
    max-width: 100%;
    height: auto;
    display: inline-block;
    vertical-align: middle;
}
.site-banner * { box-sizing: border-box; max-width: 100%; }
.site-banner + .main-content { margin-top: 0; }
.site-banner a { color: inherit; text-decoration: underline; }
body.dark .site-banner { background: var(--accent-hover); }
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .site-banner {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}
body.neo-dark .site-banner {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

/* Custom Homepage */
.custom-homepage {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}
.homepage-hero {
    padding: 40px 16px;
    text-align: center;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: #fff;
    margin: -16px -16px 16px -16px;
}
@media (max-width: 480px) {
    .homepage-hero {
        margin: -12px -12px 12px -12px;
    }
}
.homepage-hero h1 {
    font-size: 1.8rem;
    margin-bottom: 12px;
}
.homepage-hero p {
    font-size: 1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}
.homepage-hero a {
    color: #fff;
}
.homepage-content {
    padding: 24px 16px;
    max-width: 1200px;
    margin: 0 auto;
}
@media (max-width: 480px) {
    .homepage-hero {
        padding: 24px 12px;
    }
    .homepage-hero h1 {
        font-size: 1.4rem;
    }
    .homepage-content {
        padding: 16px 12px;
    }
}

/* ===== Admin Dashboard Stats ===== */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.admin-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.admin-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.admin-stat-icon {
    font-size: 1.4rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}
.admin-stat-users .admin-stat-icon           { background: #dbeafe; }
.admin-stat-courses .admin-stat-icon         { background: #dcfce7; }
.admin-stat-lessons .admin-stat-icon         { background: #fef3c7; }
.admin-stat-enrollments .admin-stat-icon     { background: #ede9fe; }
.admin-stat-actions .admin-stat-icon         { background: #ffedd5; }
.admin-stat-qa .admin-stat-icon              { background: #ccfbf1; }
.admin-stat-pending-comments .admin-stat-icon{ background: #fce7f3; }
.admin-stat-pending-qa .admin-stat-icon      { background: #fef9c3; }
.admin-stat-pending-post .admin-stat-icon    { background: #dbeafe; }
body.dark .admin-stat-users .admin-stat-icon            { background: #1e3a5f; }
body.dark .admin-stat-courses .admin-stat-icon          { background: #14532d; }
body.dark .admin-stat-lessons .admin-stat-icon          { background: #78350f; }
body.dark .admin-stat-enrollments .admin-stat-icon      { background: #3b0764; }
body.dark .admin-stat-actions .admin-stat-icon          { background: #7c2d12; }
body.dark .admin-stat-qa .admin-stat-icon               { background: #134e4a; }
body.dark .admin-stat-pending-comments .admin-stat-icon { background: #4a044e; }
body.dark .admin-stat-pending-qa .admin-stat-icon       { background: #713f12; }
body.dark .admin-stat-pending-post .admin-stat-icon     { background: #0c4a6e; }
.admin-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}
.admin-stat-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 3px;
    line-height: 1.3;
}

/* ===== Admin Quick Access Grid ===== */
.admin-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}
.admin-quick-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px 10px;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.admin-quick-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border-color: var(--accent);
}
.admin-quick-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
}
.admin-quick-title {
    font-weight: 600;
    font-size: 0.82rem;
    line-height: 1.3;
}
.admin-quick-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.admin-quick-section {
    grid-column: 1 / -1;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--accent);
    padding: 6px 2px 4px;
    border-bottom: 1px solid var(--border-color);
    margin-top: 6px;
}
.admin-quick-section:first-child { margin-top: 0; }

@media (max-width: 480px) {
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .admin-stat-card {
        padding: 10px 12px;
        gap: 8px;
    }
    .admin-stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        border-radius: 9px;
    }
    .admin-stat-number {
        font-size: 1.25rem;
    }
    .admin-quick-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .admin-quick-card {
        padding: 10px 6px;
        gap: 6px;
    }
    .admin-quick-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        border-radius: 10px;
    }
    .admin-quick-title {
        font-size: 0.75rem;
    }
}

/* Locked Lesson (Linear Mode) */
.lesson-card.lesson-locked {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    user-select: none;
    text-decoration: none;
}

/* Last lesson badge */
.lesson-last-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: .72rem;
    font-weight: 700;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

/* Course completion banner */
.course-complete-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--success, #22c55e) 10%, transparent);
    border: 1.5px solid color-mix(in srgb, var(--success, #22c55e) 35%, transparent);
    margin-bottom: 16px;
}
.course-complete-banner strong {
    display: block;
    font-size: 1rem;
    color: var(--success, #22c55e);
    margin-bottom: 2px;
}
.course-complete-banner p {
    font-size: .85rem;
    color: var(--text-secondary);
    margin: 0;
}
.course-complete-icon {
    font-size: 2.4rem;
    line-height: 1;
    flex-shrink: 0;
}

/* Quiz Retry Button */
.quiz-retry-btn {
    background: var(--warning);
    color: #fff;
    display: block;
    width: 100%;
    font-weight: 700;
}
.quiz-retry-btn:hover {
    background: #d97706;
}

/* ===== Homepage Sections ===== */
.hp-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}
.hp-section {
    margin-bottom: 0;
}
.hp-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 12px;
}
.hp-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* ===== Hero Modern ===== */
.hp-header {
    padding: 0;
    margin: -16px -16px 0 -16px;
    background: none;
}
.hero-modern {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 40%, #1e1b4b 100%);
    padding: 60px 24px 40px;
    text-align: center;
    color: #fff;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.hero-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.hero-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
}
.hero-shape-1 {
    width: 400px;
    height: 400px;
    background: #3b82f6;
    top: -100px;
    right: -80px;
    animation: heroFloat 8s ease-in-out infinite;
}
.hero-shape-2 {
    width: 300px;
    height: 300px;
    background: #8b5cf6;
    bottom: -80px;
    left: -60px;
    animation: heroFloat 10s ease-in-out infinite reverse;
}
.hero-shape-3 {
    width: 200px;
    height: 200px;
    background: #06b6d4;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: heroFloat 6s ease-in-out infinite;
}
@keyframes heroFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}
.hero-badge {
    display: inline-block;
    background: rgba(59,130,246,0.2);
    border: 1px solid rgba(59,130,246,0.3);
    color: #93c5fd;
    padding: 6px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 24px;
    backdrop-filter: blur(4px);
}
.hero-content h1 {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 0%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-content p {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.7);
    max-width: 500px;
    margin: 0 auto 32px;
    line-height: 1.8;
}
.hero-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: inherit;
}
.hero-btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 4px 20px rgba(59,130,246,0.4);
}
.hero-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59,130,246,0.5);
    color: #fff;
}
.hero-btn-outline {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
}
.hero-btn-outline:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
    color: #fff;
}
.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 48px;
    position: relative;
    z-index: 2;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 20px 32px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}
.hero-stat-item {
    text-align: center;
    flex: 1;
    padding: 0 16px;
}
.hero-stat-num {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.hero-stat-label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    margin-top: 4px;
}
.hero-stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    flex-shrink: 0;
}

/* ===== Features Section ===== */
.features-section {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}
.features-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.features-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 36px;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    text-align: center;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px 24px;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}
.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #8b5cf6);
    opacity: 0;
    transition: opacity 0.3s;
}
.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}
.feature-card:hover::before {
    opacity: 1;
}
.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}
.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.feature-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

/* ===== CTA Banner ===== */
.cta-banner {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #db2777 100%);
    padding: 48px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.cta-content {
    position: relative;
    z-index: 1;
}
.cta-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}
.cta-banner h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
}
.cta-banner p {
    font-size: 1rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 24px;
}
.cta-btn {
    display: inline-block;
    padding: 14px 40px;
    background: #fff;
    color: #2563eb;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    font-family: inherit;
}
.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    color: #1d4ed8;
}

/* ===== Steps Section ===== */
.steps-section {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}
.steps-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}
.step-card {
    flex: 1;
    min-width: 200px;
    max-width: 260px;
    padding: 24px 16px;
}
.step-number {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: #fff;
    font-size: 1.3rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(37,99,235,0.3);
}
.step-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.step-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}
.step-connector {
    color: var(--text-secondary);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* ===== HP Footer Grid ===== */
.hp-footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    max-width: 900px;
    margin: 0 auto 24px;
    text-align: right;
}
.hp-footer-col h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.hp-footer-col p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 6px;
}
.hp-footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.hp-footer-col ul li {
    margin-bottom: 8px;
}
.hp-footer-col ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.2s;
}
.hp-footer-col ul li a:hover {
    color: var(--accent);
}
.hp-footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    text-align: center;
}
.hp-footer-bottom p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
}

/* HP Slider */
.hp-slider {
    position: relative;
    overflow: hidden;
    margin: 0 -16px;
    background: var(--bg-secondary);
}
.hp-slider-track {
    display: flex;
    transition: transform 0.5s ease;
}
.hp-slide {
    position: relative;
    flex-shrink: 0;
}
.hp-slide img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}
.hp-slide a {
    display: block;
    text-decoration: none;
    color: inherit;
}
.hp-slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 24px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
}
.hp-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.4);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.hp-slider-arrow:hover { background: rgba(0,0,0,0.7); }
.hp-slider-prev { right: 16px; }
.hp-slider-next { left: 16px; }
.hp-slider-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}
.hp-slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s;
    padding: 0;
}
.hp-slider-dot.active { background: #fff; }

/* HP Intro */
.hp-intro {
    padding: 48px 24px;
    background: var(--bg-primary);
}
.hp-intro-content {
    max-width: 1100px;
    margin: 0 auto;
}

/* HP Banner */
.hp-banner {
    padding: 0;
}
.hp-banner img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* HP Courses */
.hp-courses {
    padding: 48px 24px;
    background: var(--bg-secondary);
}
.hp-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}
.hp-course-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}
.hp-course-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}
.hp-course-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--bg-secondary);
}
.hp-course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}
.hp-course-card:hover .hp-course-image img {
    transform: scale(1.05);
}
.hp-course-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: linear-gradient(135deg, var(--bg-secondary), var(--border-color));
}
.hp-course-info {
    padding: 20px;
    flex: 1;
}
.hp-course-info h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.5;
}
.hp-course-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* HP Custom */
.hp-custom {
    padding: 48px 24px;
    background: var(--bg-primary);
}

/* HP Footer */
.hp-footer {
    padding: 40px 24px 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0;
}
.hp-footer a {
    color: var(--accent);
    text-decoration: none;
}
.hp-footer a:hover { text-decoration: underline; }

/* Dark theme adjustments */
body.dark .hero-modern {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0c0a1d 100%);
}
body.dark .feature-card:hover {
    box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}
body.dark .step-number {
    box-shadow: 0 4px 16px rgba(59,130,246,0.2);
}
body.dark .cta-btn {
    background: rgba(255,255,255,0.95);
}

/* ===== HP Responsive ===== */
@media (max-width: 768px) {
    .hero-modern {
        padding: 40px 16px 32px;
        min-height: 360px;
    }
    .hero-content h1 {
        font-size: 1.7rem;
    }
    .hero-stats {
        padding: 16px 20px;
    }
    .hero-stat-num {
        font-size: 1.3rem;
    }
    .hp-slide img {
        height: 280px;
    }
    .hp-courses-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .hp-course-image {
        height: 140px;
    }
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .feature-card {
        padding: 24px 16px;
    }
    .steps-grid {
        flex-direction: column;
        gap: 8px;
    }
    .step-connector {
        transform: rotate(90deg);
    }
    .hp-footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }
}
@media (max-width: 480px) {
    .hp-header {
        margin: -12px -12px 0 -12px;
    }
    .hero-modern {
        padding: 32px 12px 24px;
        min-height: auto;
    }
    .hero-content h1 {
        font-size: 1.4rem;
    }
    .hero-content p {
        font-size: 0.9rem;
    }
    .hero-btn {
        padding: 12px 24px;
        font-size: 0.88rem;
    }
    .hero-stats {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
        margin-top: 32px;
    }
    .hero-stat-divider {
        width: 60px;
        height: 1px;
    }
    .hero-stat-item {
        padding: 4px 0;
    }
    .hero-shape-1 { width: 250px; height: 250px; }
    .hero-shape-2 { width: 180px; height: 180px; }
    .hero-shape-3 { width: 120px; height: 120px; }
    .hp-slider { margin: 0 -12px; }
    .hp-slide img { height: 200px; }
    .hp-slider-arrow { width: 36px; height: 36px; font-size: 1rem; }
    .hp-slider-prev { right: 8px; }
    .hp-slider-next { left: 8px; }
    .hp-courses-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .hp-intro, .hp-courses, .hp-custom {
        padding: 32px 12px;
    }
    .hp-section-title, .features-title {
        font-size: 1.2rem;
    }
    .cta-banner {
        padding: 32px 16px;
    }
    .cta-banner h3 {
        font-size: 1.2rem;
    }
    .hp-footer {
        padding: 32px 12px 20px;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   NEUMORPHIC THEME  ·  body.neo
   Palette: Warm cream-white (#eae6da) + Golden yellow accents (#c9a227)
   Soft 3D shadows — outset (raised) and inset (pressed)
   ══════════════════════════════════════════════════════════════════════════════ */

body.neo {
    /* ── Color Palette ─────────────────────────────────────────────────── */
    --bg-primary:      #eae6da;
    --bg-secondary:    #e2ddd0;
    --bg-card:         #eae6da;
    --text-primary:    #3a3020;
    --text-secondary:  #897a5a;
    --border-color:    rgba(174,152,106,0.25);
    --accent:          #c9a227;
    --accent-hover:    #a8851e;
    --success:         #4a7a50;
    --danger:          #bf3b2e;
    --warning:         #c87f12;
    --radius:          16px;

    /* ── Shadow System ─────────────────────────────────────────────────── */
    /* outset = raised element */
    --neo-out-xs:  3px 3px 7px rgba(174,152,106,0.38), -3px -3px 7px rgba(255,255,255,0.86);
    --neo-out-sm:  5px 5px 11px rgba(174,152,106,0.40), -5px -5px 11px rgba(255,255,255,0.88);
    --neo-out:     7px 7px 16px rgba(174,152,106,0.42), -7px -7px 16px rgba(255,255,255,0.88);
    --neo-out-lg: 10px 10px 24px rgba(174,152,106,0.45), -10px -10px 24px rgba(255,255,255,0.92);
    /* inset = pressed / field */
    --neo-in-xs:   inset 2px 2px 5px rgba(174,152,106,0.36), inset -2px -2px 5px rgba(255,255,255,0.84);
    --neo-in-sm:   inset 3px 3px 8px rgba(174,152,106,0.38), inset -3px -3px 8px rgba(255,255,255,0.86);
    --neo-in:      inset 5px 5px 12px rgba(174,152,106,0.40), inset -5px -5px 12px rgba(255,255,255,0.88);
    /* accent glow ring */
    --neo-accent-glow:    0 0 0 3px rgba(201,162,39,0.22);
    /* accent-colored element shadows (icon-wrap, play-btn, chip-active…) */
    --neo-accent-shdw:    4px 4px 10px rgba(150,100,0,0.38), -4px -4px 10px rgba(255,220,100,0.28);
    --neo-accent-shdw-lg: 6px 6px 14px rgba(150,100,0,0.42), -6px -6px 14px rgba(255,220,100,0.32);
    --neo-accent-shdw-in: inset 3px 3px 8px rgba(150,100,0,0.40), inset -3px -3px 8px rgba(255,220,100,0.30);
    /* primary button glow */
    --neo-btn-glow:       0 4px 18px rgba(201,162,39,0.38);
    --neo-btn-glow-hover: 0 6px 24px rgba(201,162,39,0.48);
    /* gradient second stop for progress/step */
    --neo-accent2:        #e8c040;
    /* hover / active tint for menu links */
    --neo-hover-tint:     rgba(201,162,39,0.07);
    --neo-active-tint:    rgba(201,162,39,0.09);
    /* nav & sidebar specific shadows */
    --neo-nav-shadow:     0 4px 14px rgba(174,152,106,0.32), 0 1px 0 rgba(255,255,255,0.90);
    --neo-side-shadow:    -8px 0 28px rgba(174,152,106,0.28), -1px 0 0 rgba(255,255,255,0.80);
    --neo-drawer-shadow:  -6px 0 28px rgba(174,152,106,0.28);
    /* alias */
    --shadow: var(--neo-out);

    background: var(--bg-primary);
}

/* ══════════════════════════════════════════════════════════════════════════════
   NEO-ROSE PALETTE  ·  body.neo-rose
   Warm terracotta/rose – base #f0e6e0 + accent #bf6050
   ══════════════════════════════════════════════════════════════════════════════ */
body.neo-rose {
    --bg-primary:      #f0e6e0;
    --bg-secondary:    #e8dbd3;
    --bg-card:         #f0e6e0;
    --text-primary:    #3a2520;
    --text-secondary:  #8a6458;
    --border-color:    rgba(180,130,110,0.25);
    --accent:          #bf6050;
    --accent-hover:    #9e4a3c;
    --success:         #4a7a50;
    --danger:          #bf3b2e;
    --warning:         #c87f12;
    --radius:          16px;

    --neo-out-xs:  3px 3px 7px rgba(180,130,110,0.40), -3px -3px 7px rgba(255,248,244,0.88);
    --neo-out-sm:  5px 5px 11px rgba(180,130,110,0.42), -5px -5px 11px rgba(255,248,244,0.90);
    --neo-out:     7px 7px 16px rgba(180,130,110,0.44), -7px -7px 16px rgba(255,248,244,0.90);
    --neo-out-lg: 10px 10px 24px rgba(180,130,110,0.46), -10px -10px 24px rgba(255,248,244,0.94);
    --neo-in-xs:   inset 2px 2px 5px rgba(180,130,110,0.38), inset -2px -2px 5px rgba(255,248,244,0.86);
    --neo-in-sm:   inset 3px 3px 8px rgba(180,130,110,0.40), inset -3px -3px 8px rgba(255,248,244,0.88);
    --neo-in:      inset 5px 5px 12px rgba(180,130,110,0.42), inset -5px -5px 12px rgba(255,248,244,0.90);
    --neo-accent-glow:    0 0 0 3px rgba(191,96,80,0.22);
    --neo-accent-shdw:    4px 4px 10px rgba(140,60,40,0.38), -4px -4px 10px rgba(255,180,160,0.28);
    --neo-accent-shdw-lg: 6px 6px 14px rgba(140,60,40,0.42), -6px -6px 14px rgba(255,180,160,0.32);
    --neo-accent-shdw-in: inset 3px 3px 8px rgba(140,60,40,0.40), inset -3px -3px 8px rgba(255,180,160,0.30);
    --neo-btn-glow:       0 4px 18px rgba(191,96,80,0.38);
    --neo-btn-glow-hover: 0 6px 24px rgba(191,96,80,0.48);
    --neo-accent2:        #e08070;
    --neo-hover-tint:     rgba(191,96,80,0.07);
    --neo-active-tint:    rgba(191,96,80,0.09);
    --neo-nav-shadow:     0 4px 14px rgba(180,130,110,0.32), 0 1px 0 rgba(255,248,244,0.92);
    --neo-side-shadow:    -8px 0 28px rgba(180,130,110,0.28), -1px 0 0 rgba(255,248,244,0.82);
    --neo-drawer-shadow:  -6px 0 28px rgba(180,130,110,0.28);
    --shadow: var(--neo-out);

    background: var(--bg-primary);
}

/* ══════════════════════════════════════════════════════════════════════════════
   NEO-AMBER PALETTE  ·  body.neo-amber
   Deep amber/orange – base #f0e8d8 + accent #c07a28
   ══════════════════════════════════════════════════════════════════════════════ */
body.neo-amber {
    --bg-primary:      #f0e8d8;
    --bg-secondary:    #e8deca;
    --bg-card:         #f0e8d8;
    --text-primary:    #3a2c10;
    --text-secondary:  #8a6c30;
    --border-color:    rgba(180,145,80,0.25);
    --accent:          #c07a28;
    --accent-hover:    #9e621a;
    --success:         #4a7a50;
    --danger:          #bf3b2e;
    --warning:         #c87f12;
    --radius:          16px;

    --neo-out-xs:  3px 3px 7px rgba(180,145,80,0.40), -3px -3px 7px rgba(255,252,240,0.88);
    --neo-out-sm:  5px 5px 11px rgba(180,145,80,0.42), -5px -5px 11px rgba(255,252,240,0.90);
    --neo-out:     7px 7px 16px rgba(180,145,80,0.44), -7px -7px 16px rgba(255,252,240,0.90);
    --neo-out-lg: 10px 10px 24px rgba(180,145,80,0.46), -10px -10px 24px rgba(255,252,240,0.94);
    --neo-in-xs:   inset 2px 2px 5px rgba(180,145,80,0.38), inset -2px -2px 5px rgba(255,252,240,0.86);
    --neo-in-sm:   inset 3px 3px 8px rgba(180,145,80,0.40), inset -3px -3px 8px rgba(255,252,240,0.88);
    --neo-in:      inset 5px 5px 12px rgba(180,145,80,0.42), inset -5px -5px 12px rgba(255,252,240,0.90);
    --neo-accent-glow:    0 0 0 3px rgba(192,122,40,0.22);
    --neo-accent-shdw:    4px 4px 10px rgba(140,80,0,0.38), -4px -4px 10px rgba(255,210,120,0.28);
    --neo-accent-shdw-lg: 6px 6px 14px rgba(140,80,0,0.42), -6px -6px 14px rgba(255,210,120,0.32);
    --neo-accent-shdw-in: inset 3px 3px 8px rgba(140,80,0,0.40), inset -3px -3px 8px rgba(255,210,120,0.30);
    --neo-btn-glow:       0 4px 18px rgba(192,122,40,0.38);
    --neo-btn-glow-hover: 0 6px 24px rgba(192,122,40,0.48);
    --neo-accent2:        #e0a040;
    --neo-hover-tint:     rgba(192,122,40,0.07);
    --neo-active-tint:    rgba(192,122,40,0.09);
    --neo-nav-shadow:     0 4px 14px rgba(180,145,80,0.32), 0 1px 0 rgba(255,252,240,0.92);
    --neo-side-shadow:    -8px 0 28px rgba(180,145,80,0.28), -1px 0 0 rgba(255,252,240,0.82);
    --neo-drawer-shadow:  -6px 0 28px rgba(180,145,80,0.28);
    --shadow: var(--neo-out);

    background: var(--bg-primary);
}

/* ══════════════════════════════════════════════════════════════════════════════
   NEO-WHITE PALETTE  ·  body.neo-white
   Cool neutral – base #efefef + accent #4a7fc1 (steel blue)
   ══════════════════════════════════════════════════════════════════════════════ */
body.neo-white {
    --bg-primary:      #efefef;
    --bg-secondary:    #e6e6e6;
    --bg-card:         #efefef;
    --text-primary:    #1e2835;
    --text-secondary:  #5a6878;
    --border-color:    rgba(160,170,185,0.25);
    --accent:          #4a7fc1;
    --accent-hover:    #3464a0;
    --success:         #4a7a50;
    --danger:          #bf3b2e;
    --warning:         #c87f12;
    --radius:          16px;

    --neo-out-xs:  3px 3px 7px rgba(160,170,185,0.38), -3px -3px 7px rgba(255,255,255,0.90);
    --neo-out-sm:  5px 5px 11px rgba(160,170,185,0.40), -5px -5px 11px rgba(255,255,255,0.92);
    --neo-out:     7px 7px 16px rgba(160,170,185,0.42), -7px -7px 16px rgba(255,255,255,0.92);
    --neo-out-lg: 10px 10px 24px rgba(160,170,185,0.44), -10px -10px 24px rgba(255,255,255,0.96);
    --neo-in-xs:   inset 2px 2px 5px rgba(160,170,185,0.36), inset -2px -2px 5px rgba(255,255,255,0.88);
    --neo-in-sm:   inset 3px 3px 8px rgba(160,170,185,0.38), inset -3px -3px 8px rgba(255,255,255,0.90);
    --neo-in:      inset 5px 5px 12px rgba(160,170,185,0.40), inset -5px -5px 12px rgba(255,255,255,0.92);
    --neo-accent-glow:    0 0 0 3px rgba(74,127,193,0.22);
    --neo-accent-shdw:    4px 4px 10px rgba(30,70,140,0.28), -4px -4px 10px rgba(180,210,255,0.30);
    --neo-accent-shdw-lg: 6px 6px 14px rgba(30,70,140,0.32), -6px -6px 14px rgba(180,210,255,0.34);
    --neo-accent-shdw-in: inset 3px 3px 8px rgba(30,70,140,0.30), inset -3px -3px 8px rgba(180,210,255,0.32);
    --neo-btn-glow:       0 4px 18px rgba(74,127,193,0.38);
    --neo-btn-glow-hover: 0 6px 24px rgba(74,127,193,0.48);
    --neo-accent2:        #6fa0e0;
    --neo-hover-tint:     rgba(74,127,193,0.07);
    --neo-active-tint:    rgba(74,127,193,0.09);
    --neo-nav-shadow:     0 4px 14px rgba(160,170,185,0.32), 0 1px 0 rgba(255,255,255,0.94);
    --neo-side-shadow:    -8px 0 28px rgba(160,170,185,0.28), -1px 0 0 rgba(255,255,255,0.86);
    --neo-drawer-shadow:  -6px 0 28px rgba(160,170,185,0.28);
    --shadow: var(--neo-out);

    background: var(--bg-primary);
}

/* ── Global transitions in neo mode ──────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) *,
body:is(.neo,.neo-rose,.neo-amber,.neo-white) *::before,
body:is(.neo,.neo-rose,.neo-amber,.neo-white) *::after {
    transition-timing-function: cubic-bezier(.4,0,.2,1);
}

/* ── Top navigation ───────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .top-nav {
    background: var(--bg-primary);
    border-bottom: none;
    box-shadow: var(--neo-nav-shadow);
}

/* ── Icon buttons (theme/font toggles in header) ─────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .icon-btn {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-out-sm);
    border-radius: 10px;
    transition: box-shadow .22s, transform .15s;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .icon-btn:hover {
    box-shadow: var(--neo-out);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .icon-btn:active {
    box-shadow: var(--neo-in-sm);
    transform: scale(.96);
}

/* ── Side menu ────────────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .side-menu-content {
    background: var(--bg-primary);
    border-left: none;
    box-shadow: var(--neo-side-shadow);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .sm-icon-wrap {
    background: var(--bg-secondary);
    box-shadow: var(--neo-out-xs);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .sm-link:hover .sm-icon-wrap {
    background: var(--bg-secondary);
    box-shadow: var(--neo-in-xs);
    color: var(--accent);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .sm-row-active .sm-icon-wrap {
    background: var(--accent);
    box-shadow: var(--neo-accent-shdw);
    color: #fff;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .sm-row-active .sm-link {
    background: var(--neo-active-tint);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .sm-link:hover {
    background: var(--neo-hover-tint);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .sm-divider { background: var(--border-color); }
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .sm-user,
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .sm-brand {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .sm-avatar,
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .sm-brand-logo {
    box-shadow: var(--neo-out-sm);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .sm-footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

/* ── Bottom navigation ───────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .bottom-nav-inner {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-out);
    backdrop-filter: none;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .bottom-nav-pill {
    background: var(--neo-active-tint);
    box-shadow: var(--neo-in-sm);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .bottom-nav-item.active { color: var(--accent); }
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .bottom-nav-item:hover  { color: var(--accent); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .card {
    background: var(--bg-card);
    border: none;
    box-shadow: var(--neo-out);
    border-radius: var(--radius);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .btn {
    background: var(--bg-primary);
    border: none;
    color: var(--text-primary);
    box-shadow: var(--neo-out-sm);
    transition: box-shadow .22s, transform .15s, background .2s;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .btn:hover {
    box-shadow: var(--neo-out);
    background: var(--bg-primary);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .btn:active {
    box-shadow: var(--neo-in-sm);
    transform: scale(.98);
}

body:is(.neo,.neo-rose,.neo-amber,.neo-white) .btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--neo-out-sm), var(--neo-btn-glow);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
    box-shadow: var(--neo-out), var(--neo-btn-glow-hover);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .btn-primary:active {
    box-shadow: var(--neo-in-sm), 0 2px 8px rgba(0,0,0,0.10);
}

body:is(.neo,.neo-rose,.neo-amber,.neo-white) .btn-danger {
    background: var(--danger);
    color: #fff;
    box-shadow: var(--neo-out-sm), 0 4px 16px rgba(191,59,46,0.35);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .btn-danger:hover {
    background: #a03025;
    color: #fff;
    box-shadow: var(--neo-out), 0 6px 22px rgba(191,59,46,0.45);
}

body:is(.neo,.neo-rose,.neo-amber,.neo-white) .btn-success {
    background: var(--success);
    color: #fff;
    box-shadow: var(--neo-out-sm), 0 4px 16px rgba(74,122,80,0.35);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .btn-success:hover {
    background: #3d6642;
    color: #fff;
}

body:is(.neo,.neo-rose,.neo-amber,.neo-white) .btn-sm {
    box-shadow: var(--neo-out-xs);
    border: none;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .btn-sm:hover { box-shadow: var(--neo-out-sm); }
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .btn-sm:active { box-shadow: var(--neo-in-xs); }

body:is(.neo,.neo-rose,.neo-amber,.neo-white) .btn-sm.btn-primary { background: var(--accent); }
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .btn-sm.btn-danger  { background: var(--danger); }
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .btn-sm.btn-success { background: var(--success); }

/* ── Form inputs ─────────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .form-control {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-in);
    border-radius: 12px;
    color: var(--text-primary);
    transition: box-shadow .22s;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .form-control:focus {
    outline: none;
    box-shadow: var(--neo-in), var(--neo-accent-glow);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .form-control::placeholder { color: var(--text-secondary); }

/* ── OTP inputs ──────────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .otp-input {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-in);
    border-radius: 12px;
    color: var(--text-primary);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .otp-input:focus {
    outline: none;
    box-shadow: var(--neo-in), var(--neo-accent-glow);
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .badge {
    background: var(--bg-primary);
    box-shadow: var(--neo-out-xs);
    color: var(--text-secondary);
    border-radius: 50px;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .badge-active {
    background: var(--bg-primary);
    color: var(--success);
    box-shadow: var(--neo-out-xs);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .badge-inactive {
    background: var(--bg-primary);
    color: var(--danger);
    box-shadow: var(--neo-out-xs);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .badge-warning {
    background: var(--bg-primary);
    color: var(--warning);
    box-shadow: var(--neo-out-xs);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .badge-info {
    background: var(--bg-primary);
    color: #1e6db5;
    box-shadow: var(--neo-out-xs);
}

/* ── Theme selector on settings page ─────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .theme-option,
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .font-option {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-out-sm);
    border-radius: 14px;
    color: var(--text-primary);
    transition: box-shadow .22s;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .theme-option:hover,
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .font-option:hover {
    box-shadow: var(--neo-out);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .theme-option.selected,
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .font-option.selected {
    box-shadow: var(--neo-in-sm);
    color: var(--accent);
    background: var(--bg-secondary);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .font-preview { color: var(--accent); }

/* ── Progress bars ───────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .progress-bar-container {
    background: var(--bg-secondary);
    box-shadow: var(--neo-in-sm);
    border-radius: 8px;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .progress-bar {
    background: linear-gradient(90deg, var(--accent), var(--neo-accent2));
    border-radius: 8px;
}

/* ── Alerts ──────────────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .alert {
    border: none;
    box-shadow: var(--neo-out-sm);
    border-radius: 14px;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .alert-success {
    background: color-mix(in srgb, var(--success) 9%, var(--bg-primary));
    color: var(--success);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .alert-danger {
    background: color-mix(in srgb, var(--danger) 9%, var(--bg-primary));
    color: var(--danger);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .alert-warning {
    background: color-mix(in srgb, var(--warning) 9%, var(--bg-primary));
    color: var(--warning);
}

/* ── Toast notifications ─────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .toast {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-out);
    border-radius: 14px;
    color: var(--text-primary);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .toast-success { border-right: 4px solid var(--success); }
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .toast-danger  { border-right: 4px solid var(--danger); }

/* ── Admin stat cards ────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .admin-stat-card {
    background: var(--bg-card);
    border: none;
    box-shadow: var(--neo-out);
    border-radius: var(--radius);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .admin-stat-card:hover {
    box-shadow: var(--neo-out-lg);
    transform: translateY(-2px);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .admin-quick-card {
    background: var(--bg-card);
    border: none;
    box-shadow: var(--neo-out);
    border-radius: var(--radius);
    color: var(--text-primary);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .admin-quick-card:hover {
    box-shadow: var(--neo-out-lg);
    transform: translateY(-3px);
}

/* ── Admin table ─────────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .admin-table th { background: var(--bg-secondary); }
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .admin-table tr:hover { background: var(--bg-secondary); }

/* ── Lesson cards ────────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .lesson-card {
    background: var(--bg-card);
    border: none;
    box-shadow: var(--neo-out-sm);
    border-radius: var(--radius);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .lesson-card:hover {
    box-shadow: var(--neo-out);
    border-color: transparent;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .lesson-number {
    background: var(--bg-secondary);
    box-shadow: var(--neo-in-xs);
    color: var(--text-secondary);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .lesson-completed .lesson-number {
    background: var(--bg-primary);
    color: var(--success);
    box-shadow: var(--neo-in-xs);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .lesson-progress .lesson-number {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--neo-accent-shdw);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .lesson-card.lesson-completed { border-right: 3px solid var(--success); }
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .lesson-card.lesson-progress  { border-right: 3px solid var(--accent);  }

/* ── Plan cards ──────────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .plan-card {
    background: var(--bg-card);
    border: none;
    box-shadow: var(--neo-out);
    border-radius: var(--radius);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .plan-card:hover {
    box-shadow: var(--neo-out-lg);
    transform: translateY(-2px);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .plan-active {
    box-shadow: var(--neo-in-sm), 0 0 0 2px var(--accent);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .plan-badge {
    background: var(--accent);
    box-shadow: var(--neo-out-xs);
}

/* ── Course cards ────────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .course-card,
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .hp-course-card {
    background: var(--bg-card);
    border: none;
    box-shadow: var(--neo-out);
    border-radius: var(--radius);
    color: var(--text-primary);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .course-card:hover,
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .hp-course-card:hover {
    box-shadow: var(--neo-out-lg);
    transform: translateY(-4px);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .course-progress-section {
    background: var(--bg-secondary);
    box-shadow: var(--neo-in-sm);
    border-radius: 12px;
}

/* ── Feature cards ───────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .feature-card {
    background: var(--bg-card);
    border: none;
    box-shadow: var(--neo-out);
    border-radius: var(--radius);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .feature-card:hover {
    box-shadow: var(--neo-out-lg);
    transform: translateY(-6px);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .feature-card::before { display: none; }

/* ── Quiz options ────────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .quiz-option {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-out-xs);
    border-radius: 12px;
    transition: box-shadow .2s;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .quiz-option:hover:not(.quiz-disabled) {
    box-shadow: var(--neo-out-sm);
    background: var(--bg-primary);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .quiz-correct {
    background: color-mix(in srgb, var(--success) 10%, var(--bg-primary));
    box-shadow: var(--neo-in-xs);
    border-left: 3px solid var(--success);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .quiz-wrong {
    background: color-mix(in srgb, var(--danger) 10%, var(--bg-primary));
    box-shadow: var(--neo-in-xs);
    border-left: 3px solid var(--danger);
}

/* ── Radio labels ────────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .radio-label {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-out-xs);
    border-radius: 12px;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .radio-label:hover {
    box-shadow: var(--neo-out-sm);
    background: var(--bg-primary);
}

/* ── Audio player ────────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ap-player {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-out);
    border-radius: var(--radius);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ap-play-btn {
    background: var(--accent);
    box-shadow: var(--neo-accent-shdw);
    border: none;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ap-play-btn:hover {
    background: var(--accent-hover);
    box-shadow: var(--neo-accent-shdw-lg);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ap-play-btn:active {
    box-shadow: var(--neo-accent-shdw-in);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ap-seek-track {
    background: var(--bg-secondary);
    box-shadow: var(--neo-in-xs);
    border-radius: 4px;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ap-seek-progress { background: var(--accent); }
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ap-seek-handle {
    background: var(--accent);
    border-color: var(--bg-primary);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ap-speed-btn {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-out-xs);
    border-radius: 8px;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ap-speed-btn:hover { box-shadow: var(--neo-out-sm); }
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ap-speed-menu {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-out);
    border-radius: 12px;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ap-speed-menu button:hover {
    background: var(--bg-secondary);
    box-shadow: var(--neo-in-xs);
    border-radius: 6px;
}

/* ══════════════════════════════════════════════════════════════════════════
   ACTIONS PAGE  ·  body.neo  ·  .ac-* elements
   ══════════════════════════════════════════════════════════════════════════ */

/* Search box */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-search-box {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-in);
    border-radius: 50px;
    transition: box-shadow .22s;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-search-box:focus-within {
    box-shadow: var(--neo-in), var(--neo-accent-glow);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-search-input {
    background: transparent;
    color: var(--text-primary);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-search-input::placeholder { color: var(--text-secondary); }
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-search-clear { color: var(--text-secondary); }

/* Filter chips */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-chip {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-out-xs);
    border-radius: 50px;
    color: var(--text-primary);
    transition: box-shadow .22s, color .2s;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-chip:hover {
    box-shadow: var(--neo-out-sm);
    color: var(--accent);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-chip-active {
    background: var(--accent) !important;
    color: #fff !important;
    box-shadow: var(--neo-accent-shdw-in) !important;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-chip-filter {
    background: var(--bg-primary);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-chip-filter.has-filters {
    color: var(--accent);
    box-shadow: var(--neo-in-sm);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-chip-clear {
    color: var(--danger);
    box-shadow: var(--neo-out-xs);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-chip-clear:hover {
    background: color-mix(in srgb, var(--danger) 8%, var(--bg-primary));
    box-shadow: var(--neo-out-sm);
}

/* View toggle */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-view-group {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-out-xs);
    border-radius: 12px;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-view-btn:first-child { border-left: 1px solid var(--border-color); }
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-view-btn {
    background: transparent;
    color: var(--text-secondary);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-view-btn.active {
    background: var(--bg-secondary);
    box-shadow: var(--neo-in-xs);
    color: var(--accent);
}

/* Action cards */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-card {
    background: var(--bg-card);
    box-shadow: var(--neo-out);
    border-radius: 18px;
    transition: box-shadow .25s, transform .2s;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-card:hover {
    box-shadow: var(--neo-out-lg);
    transform: translateY(-2px);
}

/* Meta box inside card */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-meta-box {
    background: var(--bg-secondary);
    box-shadow: var(--neo-in-sm);
    border-radius: 14px;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-meta-col + .ac-meta-col {
    border-right: 1px solid var(--border-color);
}

/* Badges inside cards */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-badge {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-out-xs);
    border-radius: 50px;
    color: var(--text-secondary);
    transition: box-shadow .2s, color .2s;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-badge:hover {
    box-shadow: var(--neo-out-sm);
    color: var(--accent);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-members-badge {
    background: var(--bg-primary);
    box-shadow: var(--neo-out-xs);
    border-radius: 50px;
}

/* Plan / bookmark button */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-plan-btn {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-out-xs);
    border-radius: 10px;
    color: var(--text-secondary);
    transition: box-shadow .22s, color .2s;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-plan-btn:hover {
    box-shadow: var(--neo-out-sm);
    color: var(--accent);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-plan-btn.planned {
    background: color-mix(in srgb, var(--accent) 10%, var(--bg-primary));
    box-shadow: var(--neo-in-xs);
    color: var(--accent);
}

/* Report button */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-report-btn {
    background: color-mix(in srgb, var(--success) 9%, var(--bg-primary));
    color: var(--success);
    border: none;
    box-shadow: var(--neo-out-xs);
    border-radius: 50px;
    transition: box-shadow .22s;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-report-btn:hover {
    box-shadow: var(--neo-out-sm);
    background: color-mix(in srgb, var(--success) 14%, var(--bg-primary));
}

/* Card footer */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-card-footer {
    border-top: 1px solid var(--border-color);
}

/* Like button */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-like-btn {
    background: var(--bg-primary);
    border-radius: 8px;
    box-shadow: var(--neo-out-xs);
    color: var(--text-secondary);
    transition: box-shadow .22s, color .2s;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-like-btn:hover {
    box-shadow: var(--neo-out-sm);
    color: #e74c3c;
    background: color-mix(in srgb, #e74c3c 7%, var(--bg-primary));
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-like-btn.liked {
    color: #e74c3c;
    box-shadow: var(--neo-in-xs);
}

/* Thumb */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-thumb {
    background: var(--bg-secondary);
    box-shadow: var(--neo-in-xs);
    border-radius: 14px;
}

/* Spinner */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-spinner {
    border-color: var(--border-color);
    border-top-color: var(--accent);
}

/* Filter drawer */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-drawer {
    background: var(--bg-primary);
    box-shadow: -6px 0 28px rgba(174,152,106,0.28);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-drawer-head {
    border-bottom: 1px solid var(--border-color);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-drawer-close {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-out-xs);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow .2s, color .2s;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-drawer-close:hover {
    box-shadow: var(--neo-out-sm);
    color: var(--danger);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-df-section { border-bottom: 1px solid var(--border-color); }
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-df-tag {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-out-xs);
    border-radius: 12px;
    padding: 7px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: box-shadow .2s, color .2s;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-df-tag:hover {
    box-shadow: var(--neo-out-sm);
    color: var(--accent);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-df-tag:has(.ac-df-cb:checked) {
    box-shadow: var(--neo-in-sm);
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--bg-primary));
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .ac-drawer-foot {
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

/* ── Settings info rows ──────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .settings-info-row { border-bottom: 1px solid var(--border-color); }

/* ── Dashboard course item ───────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .dashboard-course-item { border-bottom: 1px solid var(--border-color); }

/* ── Payment card ────────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .payment-card .card { box-shadow: var(--neo-out-lg); }
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .payment-row + .payment-row { border-top: 1px solid var(--border-color); }
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .payment-total { border-top: 2px solid var(--border-color); }

/* ── Section title accent line ───────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .hp-section-title::after { background: var(--accent); }

/* ── Rich content ────────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .rich-content blockquote {
    background: var(--bg-secondary);
    box-shadow: var(--neo-in-sm);
    border-right: 4px solid var(--accent);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .rich-content pre,
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .rich-content code {
    background: var(--bg-secondary);
    box-shadow: var(--neo-in-xs);
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .rich-content table th { background: var(--bg-secondary); }
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .rich-content table th,
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .rich-content table td { border-color: var(--border-color); }

/* ── CTA / Hero buttons in neo ───────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .cta-btn {
    background: var(--bg-primary);
    color: var(--accent);
    box-shadow: var(--neo-out);
    border-radius: 12px;
}
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .cta-btn:hover {
    box-shadow: var(--neo-out-lg);
    transform: translateY(-2px);
    color: var(--accent-hover);
}

/* ── Hamburger menu bars ─────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .hamburger span { background: var(--text-primary); }

/* ── PWA banner ──────────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .pwa-install-banner {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-out);
    border-radius: var(--radius);
}

/* ── Step numbers ────────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .step-number {
    background: linear-gradient(135deg, var(--accent), var(--neo-accent2));
    box-shadow: var(--neo-out-sm), var(--neo-btn-glow);
}

/* ── Stat card numbers ───────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .stat-number,
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .admin-stat-number,
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .course-progress-percent { color: var(--accent); }

/* ── Lessons count badge ─────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) .lessons-count-badge {
    background: var(--accent);
    box-shadow: var(--neo-out-xs);
}

/* ── Link colors ─────────────────────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white) a { color: var(--accent); }
body:is(.neo,.neo-rose,.neo-amber,.neo-white) a:hover { color: var(--accent-hover); }

/* ── Smooth theme switch for neo ─────────────────────────────────────────── */
body:is(.neo,.neo-rose,.neo-amber,.neo-white).theme-transition,
body:is(.neo,.neo-rose,.neo-amber,.neo-white).theme-transition *,
body:is(.neo,.neo-rose,.neo-amber,.neo-white).theme-transition *::before,
body:is(.neo,.neo-rose,.neo-amber,.neo-white).theme-transition *::after {
    transition:
        background-color .3s ease,
        color .2s ease,
        box-shadow .3s ease !important;
}

/* ══════════════════════════════════════════════════════════════════════════════
   DARK NEUMORPHIC THEME  ·  body.neo-dark
   Palette: Warm dark-brown (#25210e) + Golden yellow accents (#d4ab2a)
   Dark neumorphic: black bottom-right shadow + warm highlight top-left
   ══════════════════════════════════════════════════════════════════════════════ */

body.neo-dark {
    /* ── Color Palette ─────────────────────────────────────────────────── */
    --bg-primary:      #25210e;
    --bg-secondary:    #1e1b0a;
    --bg-card:         #25210e;
    --text-primary:    #e2d8b5;
    --text-secondary:  #9a8f68;
    --border-color:    rgba(55,50,25,0.55);
    --accent:          #d4ab2a;
    --accent-hover:    #b8921f;
    --success:         #5a9462;
    --danger:          #c94a3c;
    --warning:         #d68a18;
    --radius:          16px;

    /* ── Dark Neumorphic Shadow System ─────────────────────────────────── */
    /* outset: black toward bottom-right, warm-lighter toward top-left */
    --neo-out-xs:  3px 3px 7px rgba(0,0,0,0.55),   -3px -3px 7px rgba(55,50,25,0.58);
    --neo-out-sm:  5px 5px 11px rgba(0,0,0,0.58),  -5px -5px 11px rgba(55,50,25,0.62);
    --neo-out:     7px 7px 16px rgba(0,0,0,0.62),  -7px -7px 16px rgba(55,50,25,0.65);
    --neo-out-lg: 10px 10px 24px rgba(0,0,0,0.68), -10px -10px 24px rgba(55,50,25,0.70);
    /* inset: pressed / field */
    --neo-in-xs:   inset 2px 2px 5px rgba(0,0,0,0.55), inset -2px -2px 5px rgba(55,50,25,0.58);
    --neo-in-sm:   inset 3px 3px 8px rgba(0,0,0,0.58), inset -3px -3px 8px rgba(55,50,25,0.62);
    --neo-in:      inset 5px 5px 12px rgba(0,0,0,0.62), inset -5px -5px 12px rgba(55,50,25,0.65);
    /* accent glow */
    --neo-accent-glow: 0 0 0 3px rgba(212,171,42,0.22);
    /* alias */
    --shadow: var(--neo-out);

    background: var(--bg-primary);
}

/* ── Global transitions ──────────────────────────────────────────────────── */
body.neo-dark *,
body.neo-dark *::before,
body.neo-dark *::after {
    transition-timing-function: cubic-bezier(.4,0,.2,1);
}

/* ── Top nav ─────────────────────────────────────────────────────────────── */
body.neo-dark .top-nav {
    background: var(--bg-primary);
    border-bottom: none;
    box-shadow:
        0 4px 14px rgba(0,0,0,0.50),
        0 1px 0 rgba(55,50,25,0.55);
}

/* ── Icon buttons ────────────────────────────────────────────────────────── */
body.neo-dark .icon-btn {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-out-sm);
    border-radius: 10px;
    transition: box-shadow .22s, transform .15s;
}
body.neo-dark .icon-btn:hover  { box-shadow: var(--neo-out); }
body.neo-dark .icon-btn:active { box-shadow: var(--neo-in-sm); transform: scale(.96); }

/* ── Side menu ───────────────────────────────────────────────────────────── */
body.neo-dark .side-menu-content {
    background: var(--bg-primary);
    border-left: none;
    box-shadow: -8px 0 28px rgba(0,0,0,0.55), -1px 0 0 rgba(55,50,25,0.50);
}
body.neo-dark .sm-icon-wrap {
    background: var(--bg-secondary);
    box-shadow: var(--neo-out-xs);
}
body.neo-dark .sm-link:hover .sm-icon-wrap {
    background: var(--bg-secondary);
    box-shadow: var(--neo-in-xs);
    color: var(--accent);
}
body.neo-dark .sm-row-active .sm-icon-wrap {
    background: var(--accent);
    box-shadow:
        4px 4px 10px rgba(0,0,0,0.55),
        -4px -4px 10px rgba(80,65,20,0.45);
    color: #1e1b0a;
}
body.neo-dark .sm-row-active .sm-link { background: rgba(212,171,42,0.10); }
body.neo-dark .sm-link:hover          { background: rgba(212,171,42,0.07); }
body.neo-dark .sm-divider             { background: var(--border-color); }
body.neo-dark .sm-user,
body.neo-dark .sm-brand  { background: var(--bg-primary); border-bottom: 1px solid var(--border-color); }
body.neo-dark .sm-avatar,
body.neo-dark .sm-brand-logo { box-shadow: var(--neo-out-sm); }
body.neo-dark .sm-footer { background: var(--bg-primary); border-top: 1px solid var(--border-color); }

/* ── Bottom nav ──────────────────────────────────────────────────────────── */
body.neo-dark .bottom-nav-inner {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-out);
    backdrop-filter: none;
}
body.neo-dark .bottom-nav-pill    { background: rgba(212,171,42,0.12); box-shadow: var(--neo-in-sm); }
body.neo-dark .bottom-nav-item.active { color: var(--accent); }
body.neo-dark .bottom-nav-item:hover  { color: var(--accent); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
body.neo-dark .card {
    background: var(--bg-card);
    border: none;
    box-shadow: var(--neo-out);
    border-radius: var(--radius);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
body.neo-dark .btn {
    background: var(--bg-primary);
    border: none;
    color: var(--text-primary);
    box-shadow: var(--neo-out-sm);
    transition: box-shadow .22s, transform .15s, background .2s;
}
body.neo-dark .btn:hover  { box-shadow: var(--neo-out); background: var(--bg-primary); }
body.neo-dark .btn:active { box-shadow: var(--neo-in-sm); transform: scale(.98); }

body.neo-dark .btn-primary {
    background: var(--accent);
    color: #1a1600;
    box-shadow: var(--neo-out-sm), 0 4px 18px rgba(212,171,42,0.30);
}
body.neo-dark .btn-primary:hover {
    background: var(--accent-hover);
    color: #1a1600;
    box-shadow: var(--neo-out), 0 6px 24px rgba(212,171,42,0.40);
}
body.neo-dark .btn-primary:active {
    box-shadow: var(--neo-in-sm), 0 2px 8px rgba(212,171,42,0.20);
}
body.neo-dark .btn-danger {
    background: var(--danger); color: #fff;
    box-shadow: var(--neo-out-sm), 0 4px 16px rgba(201,74,60,0.30);
}
body.neo-dark .btn-success {
    background: var(--success); color: #fff;
    box-shadow: var(--neo-out-sm), 0 4px 16px rgba(90,148,98,0.30);
}
body.neo-dark .btn-sm { box-shadow: var(--neo-out-xs); border: none; }
body.neo-dark .btn-sm:hover  { box-shadow: var(--neo-out-sm); }
body.neo-dark .btn-sm:active { box-shadow: var(--neo-in-xs); }
body.neo-dark .btn-sm.btn-primary { background: var(--accent); color: #1a1600; }
body.neo-dark .btn-sm.btn-danger  { background: var(--danger); color: #fff; }
body.neo-dark .btn-sm.btn-success { background: var(--success); color: #fff; }

/* ── Form inputs ─────────────────────────────────────────────────────────── */
body.neo-dark .form-control {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-in);
    border-radius: 12px;
    color: var(--text-primary);
    transition: box-shadow .22s;
}
body.neo-dark .form-control:focus {
    outline: none;
    box-shadow: var(--neo-in), var(--neo-accent-glow);
}
body.neo-dark .form-control::placeholder { color: var(--text-secondary); }

/* ── OTP inputs ──────────────────────────────────────────────────────────── */
body.neo-dark .otp-input {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-in);
    border-radius: 12px;
    color: var(--text-primary);
}
body.neo-dark .otp-input:focus { box-shadow: var(--neo-in), var(--neo-accent-glow); outline: none; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
body.neo-dark .badge,
body.neo-dark .badge-active,
body.neo-dark .badge-inactive,
body.neo-dark .badge-warning,
body.neo-dark .badge-info {
    background: var(--bg-primary);
    box-shadow: var(--neo-out-xs);
    border-radius: 50px;
}
body.neo-dark .badge-active   { color: var(--success); }
body.neo-dark .badge-inactive { color: var(--danger); }
body.neo-dark .badge-warning  { color: var(--warning); }
body.neo-dark .badge-info     { color: #6ab0e0; }

/* ── Theme / font selectors ──────────────────────────────────────────────── */
body.neo-dark .theme-option,
body.neo-dark .font-option {
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--neo-out-sm);
    border-radius: 14px;
    color: var(--text-primary);
    transition: box-shadow .22s;
}
body.neo-dark .theme-option:hover,
body.neo-dark .font-option:hover { box-shadow: var(--neo-out); }
body.neo-dark .theme-option.selected,
body.neo-dark .font-option.selected {
    box-shadow: var(--neo-in-sm);
    color: var(--accent);
    background: var(--bg-secondary);
}
body.neo-dark .font-preview { color: var(--accent); }

/* ── Progress bars ───────────────────────────────────────────────────────── */
body.neo-dark .progress-bar-container { background: var(--bg-secondary); box-shadow: var(--neo-in-sm); border-radius: 8px; }
body.neo-dark .progress-bar { background: linear-gradient(90deg, var(--accent), #e8c040); border-radius: 8px; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
body.neo-dark .alert { border: none; box-shadow: var(--neo-out-sm); border-radius: 14px; }
body.neo-dark .alert-success { background: color-mix(in srgb, var(--success) 12%, var(--bg-primary)); color: var(--success); }
body.neo-dark .alert-danger  { background: color-mix(in srgb, var(--danger)  12%, var(--bg-primary)); color: var(--danger); }
body.neo-dark .alert-warning { background: color-mix(in srgb, var(--warning) 12%, var(--bg-primary)); color: var(--warning); }

/* ── Toast ───────────────────────────────────────────────────────────────── */
body.neo-dark .toast { background: var(--bg-primary); border: none; box-shadow: var(--neo-out); border-radius: 14px; color: var(--text-primary); }
body.neo-dark .toast-success { border-right: 4px solid var(--success); }
body.neo-dark .toast-danger  { border-right: 4px solid var(--danger); }

/* ── Stat cards ──────────────────────────────────────────────────────────── */
body.neo-dark .admin-stat-card,
body.neo-dark .admin-quick-card {
    background: var(--bg-card); border: none;
    box-shadow: var(--neo-out); border-radius: var(--radius); color: var(--text-primary);
}
body.neo-dark .admin-stat-card:hover  { box-shadow: var(--neo-out-lg); transform: translateY(-2px); }
body.neo-dark .admin-quick-card:hover { box-shadow: var(--neo-out-lg); transform: translateY(-3px); }
body.neo-dark .admin-table th         { background: var(--bg-secondary); }
body.neo-dark .admin-table tr:hover   { background: var(--bg-secondary); }

/* ── Lesson cards ────────────────────────────────────────────────────────── */
body.neo-dark .lesson-card { background: var(--bg-card); border: none; box-shadow: var(--neo-out-sm); border-radius: var(--radius); }
body.neo-dark .lesson-card:hover { box-shadow: var(--neo-out); border-color: transparent; }
body.neo-dark .lesson-number { background: var(--bg-secondary); box-shadow: var(--neo-in-xs); color: var(--text-secondary); }
body.neo-dark .lesson-completed .lesson-number { background: var(--bg-primary); color: var(--success); box-shadow: var(--neo-in-xs); }
body.neo-dark .lesson-progress .lesson-number {
    background: var(--accent); color: #1a1600;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.55), -4px -4px 10px rgba(80,65,20,0.45);
}
body.neo-dark .lesson-card.lesson-completed { border-right: 3px solid var(--success); }
body.neo-dark .lesson-card.lesson-progress  { border-right: 3px solid var(--accent); }

/* ── Plan/course/feature cards ───────────────────────────────────────────── */
body.neo-dark .plan-card,
body.neo-dark .course-card,
body.neo-dark .hp-course-card,
body.neo-dark .feature-card {
    background: var(--bg-card); border: none;
    box-shadow: var(--neo-out); border-radius: var(--radius); color: var(--text-primary);
}
body.neo-dark .plan-card:hover,
body.neo-dark .course-card:hover,
body.neo-dark .hp-course-card:hover,
body.neo-dark .feature-card:hover  { box-shadow: var(--neo-out-lg); transform: translateY(-4px); }
body.neo-dark .plan-active         { box-shadow: var(--neo-in-sm), 0 0 0 2px var(--accent); }
body.neo-dark .plan-badge          { background: var(--accent); color: #1a1600; box-shadow: var(--neo-out-xs); }
body.neo-dark .feature-card::before { display: none; }
body.neo-dark .course-progress-section { background: var(--bg-secondary); box-shadow: var(--neo-in-sm); border-radius: 12px; }

/* ── Quiz ────────────────────────────────────────────────────────────────── */
body.neo-dark .quiz-option { background: var(--bg-primary); border: none; box-shadow: var(--neo-out-xs); border-radius: 12px; }
body.neo-dark .quiz-option:hover:not(.quiz-disabled) { box-shadow: var(--neo-out-sm); background: var(--bg-primary); }
body.neo-dark .quiz-correct { background: color-mix(in srgb, var(--success) 12%, var(--bg-primary)); box-shadow: var(--neo-in-xs); border-left: 3px solid var(--success); }
body.neo-dark .quiz-wrong   { background: color-mix(in srgb, var(--danger) 12%, var(--bg-primary));  box-shadow: var(--neo-in-xs); border-left: 3px solid var(--danger); }

/* ── Radio labels ────────────────────────────────────────────────────────── */
body.neo-dark .radio-label { background: var(--bg-primary); border: none; box-shadow: var(--neo-out-xs); border-radius: 12px; }
body.neo-dark .radio-label:hover { box-shadow: var(--neo-out-sm); background: var(--bg-primary); }

/* ── Audio player ────────────────────────────────────────────────────────── */
body.neo-dark .ap-player { background: var(--bg-primary); border: none; box-shadow: var(--neo-out); border-radius: var(--radius); }
body.neo-dark .ap-play-btn {
    background: var(--accent); color: #1a1600;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.55), -4px -4px 10px rgba(80,65,20,0.40);
    border: none;
}
body.neo-dark .ap-play-btn:hover { background: var(--accent-hover); }
body.neo-dark .ap-play-btn:active { box-shadow: var(--neo-in-sm); }
body.neo-dark .ap-seek-track { background: var(--bg-secondary); box-shadow: var(--neo-in-xs); border-radius: 4px; }
body.neo-dark .ap-seek-progress  { background: var(--accent); }
body.neo-dark .ap-seek-handle    { background: var(--accent); border-color: var(--bg-primary); }
body.neo-dark .ap-speed-btn      { background: var(--bg-primary); border: none; box-shadow: var(--neo-out-xs); border-radius: 8px; }
body.neo-dark .ap-speed-btn:hover { box-shadow: var(--neo-out-sm); }
body.neo-dark .ap-speed-menu     { background: var(--bg-primary); border: none; box-shadow: var(--neo-out); border-radius: 12px; }
body.neo-dark .ap-speed-menu button:hover { background: var(--bg-secondary); box-shadow: var(--neo-in-xs); border-radius: 6px; }

/* ══ ACTIONS PAGE  ·  body.neo-dark  ·  .ac-* ════════════════════════════ */
body.neo-dark .ac-search-box {
    background: var(--bg-primary); border: none;
    box-shadow: var(--neo-in); border-radius: 50px; transition: box-shadow .22s;
}
body.neo-dark .ac-search-box:focus-within { box-shadow: var(--neo-in), var(--neo-accent-glow); }
body.neo-dark .ac-search-input { background: transparent; color: var(--text-primary); }
body.neo-dark .ac-search-input::placeholder { color: var(--text-secondary); }

body.neo-dark .ac-chip {
    background: var(--bg-primary); border: none;
    box-shadow: var(--neo-out-xs); border-radius: 50px;
    color: var(--text-primary); transition: box-shadow .22s, color .2s;
}
body.neo-dark .ac-chip:hover { box-shadow: var(--neo-out-sm); color: var(--accent); }
body.neo-dark .ac-chip-active {
    background: var(--accent) !important; color: #1a1600 !important;
    box-shadow: inset 3px 3px 8px rgba(0,0,0,0.45), inset -3px -3px 8px rgba(80,65,20,0.40) !important;
}
body.neo-dark .ac-chip-filter { background: var(--bg-primary); }
body.neo-dark .ac-chip-filter.has-filters { color: var(--accent); box-shadow: var(--neo-in-sm); }
body.neo-dark .ac-chip-clear  { color: var(--danger); box-shadow: var(--neo-out-xs); }
body.neo-dark .ac-chip-clear:hover {
    background: color-mix(in srgb, var(--danger) 10%, var(--bg-primary));
    box-shadow: var(--neo-out-sm);
}
body.neo-dark .ac-view-group  { background: var(--bg-primary); border: none; box-shadow: var(--neo-out-xs); border-radius: 12px; }
body.neo-dark .ac-view-btn:first-child { border-left: 1px solid var(--border-color); }
body.neo-dark .ac-view-btn    { background: transparent; color: var(--text-secondary); }
body.neo-dark .ac-view-btn.active { background: var(--bg-secondary); box-shadow: var(--neo-in-xs); color: var(--accent); }

body.neo-dark .ac-card { background: var(--bg-card); box-shadow: var(--neo-out); border-radius: 18px; transition: box-shadow .25s, transform .2s; }
body.neo-dark .ac-card:hover { box-shadow: var(--neo-out-lg); transform: translateY(-2px); }
body.neo-dark .ac-meta-box { background: var(--bg-secondary); box-shadow: var(--neo-in-sm); border-radius: 14px; }
body.neo-dark .ac-meta-col + .ac-meta-col { border-right: 1px solid var(--border-color); }

body.neo-dark .ac-badge {
    background: var(--bg-primary); border: none;
    box-shadow: var(--neo-out-xs); border-radius: 50px;
    color: var(--text-secondary); transition: box-shadow .2s, color .2s;
}
body.neo-dark .ac-badge:hover { box-shadow: var(--neo-out-sm); color: var(--accent); }

body.neo-dark .ac-plan-btn {
    background: var(--bg-primary); border: none;
    box-shadow: var(--neo-out-xs); border-radius: 10px;
    color: var(--text-secondary); transition: box-shadow .22s, color .2s;
}
body.neo-dark .ac-plan-btn:hover { box-shadow: var(--neo-out-sm); color: var(--accent); }
body.neo-dark .ac-plan-btn.planned {
    background: color-mix(in srgb, var(--accent) 12%, var(--bg-primary));
    box-shadow: var(--neo-in-xs); color: var(--accent);
}
body.neo-dark .ac-report-btn {
    background: color-mix(in srgb, var(--success) 10%, var(--bg-primary));
    color: var(--success); border: none;
    box-shadow: var(--neo-out-xs); border-radius: 50px; transition: box-shadow .22s;
}
body.neo-dark .ac-report-btn:hover { box-shadow: var(--neo-out-sm); background: color-mix(in srgb, var(--success) 16%, var(--bg-primary)); }
body.neo-dark .ac-card-footer { border-top: 1px solid var(--border-color); }

body.neo-dark .ac-like-btn {
    background: var(--bg-primary); border-radius: 8px;
    box-shadow: var(--neo-out-xs); color: var(--text-secondary); transition: box-shadow .22s, color .2s;
}
body.neo-dark .ac-like-btn:hover { box-shadow: var(--neo-out-sm); color: #e05a4a; background: color-mix(in srgb, #e74c3c 8%, var(--bg-primary)); }
body.neo-dark .ac-like-btn.liked { color: #e05a4a; box-shadow: var(--neo-in-xs); }
body.neo-dark .ac-thumb { background: var(--bg-secondary); box-shadow: var(--neo-in-xs); border-radius: 14px; }
body.neo-dark .ac-spinner { border-color: var(--border-color); border-top-color: var(--accent); }

body.neo-dark .ac-drawer { background: var(--bg-primary); box-shadow: -6px 0 28px rgba(0,0,0,0.55); }
body.neo-dark .ac-drawer-head { border-bottom: 1px solid var(--border-color); }
body.neo-dark .ac-drawer-close {
    background: var(--bg-primary); border: none;
    box-shadow: var(--neo-out-xs); border-radius: 8px;
    color: var(--text-secondary); cursor: pointer;
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    transition: box-shadow .2s, color .2s;
}
body.neo-dark .ac-drawer-close:hover { box-shadow: var(--neo-out-sm); color: var(--danger); }
body.neo-dark .ac-df-section { border-bottom: 1px solid var(--border-color); }
body.neo-dark .ac-df-tag {
    background: var(--bg-primary); border: none;
    box-shadow: var(--neo-out-xs); border-radius: 12px;
    padding: 7px 14px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: box-shadow .2s, color .2s;
}
body.neo-dark .ac-df-tag:hover { box-shadow: var(--neo-out-sm); color: var(--accent); }
body.neo-dark .ac-df-tag:has(.ac-df-cb:checked) {
    box-shadow: var(--neo-in-sm); color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--bg-primary));
}
body.neo-dark .ac-drawer-foot { border-top: 1px solid var(--border-color); background: var(--bg-primary); }

/* ── Misc ────────────────────────────────────────────────────────────────── */
body.neo-dark .settings-info-row    { border-bottom: 1px solid var(--border-color); }
body.neo-dark .dashboard-course-item { border-bottom: 1px solid var(--border-color); }
body.neo-dark .payment-row + .payment-row { border-top: 1px solid var(--border-color); }
body.neo-dark .payment-total        { border-top: 2px solid var(--border-color); }
body.neo-dark .hp-section-title::after { background: var(--accent); }
body.neo-dark .rich-content blockquote { background: var(--bg-secondary); box-shadow: var(--neo-in-sm); border-right: 4px solid var(--accent); }
body.neo-dark .rich-content pre,
body.neo-dark .rich-content code    { background: var(--bg-secondary); box-shadow: var(--neo-in-xs); }
body.neo-dark .rich-content table th { background: var(--bg-secondary); }
body.neo-dark .rich-content table th,
body.neo-dark .rich-content table td { border-color: var(--border-color); }
body.neo-dark .cta-btn { background: var(--bg-primary); color: var(--accent); box-shadow: var(--neo-out); border-radius: 12px; }
body.neo-dark .cta-btn:hover { box-shadow: var(--neo-out-lg); transform: translateY(-2px); color: var(--accent-hover); }
body.neo-dark .hamburger span { background: var(--text-primary); }
body.neo-dark .pwa-install-banner { background: var(--bg-primary); border: none; box-shadow: var(--neo-out); border-radius: var(--radius); }
body.neo-dark .step-number { background: linear-gradient(135deg, var(--accent), #c89018); box-shadow: var(--neo-out-sm), 0 4px 16px rgba(212,171,42,0.22); }
body.neo-dark .stat-number,
body.neo-dark .admin-stat-number,
body.neo-dark .course-progress-percent { color: var(--accent); }
body.neo-dark .lessons-count-badge    { background: var(--accent); color: #1a1600; box-shadow: var(--neo-out-xs); }
body.neo-dark a       { color: var(--accent); }
body.neo-dark a:hover { color: var(--accent-hover); }

/* ── Theme transition ────────────────────────────────────────────────────── */
body.neo-dark.theme-transition,
body.neo-dark.theme-transition *,
body.neo-dark.theme-transition *::before,
body.neo-dark.theme-transition *::after {
    transition: background-color .3s ease, color .2s ease, box-shadow .3s ease !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Video Player v1 (vp2)
   ═══════════════════════════════════════════════════════════════════════════ */
.vp2-wrap {
    width: 100%;
    font-family: Vazirmatn, Tahoma, sans-serif;
    direction: rtl;
    margin: 8px 0;
}

/* ── Video box ── */
.vp2-video-box {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.vp2-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

/* ── Overlay (center play/pause) ── */
.vp2-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    z-index: 3;
}
.vp2-big-play {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: transform .15s, opacity .2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
/* hide big-play when video is playing (not paused) */
.vp2-video-box:not(.vp2-not-started):not(.vp2-paused-state) .vp2-center-btn {
    opacity: 0;
    pointer-events: none;
}
.vp2-video-box.vp2-paused-state .vp2-center-btn,
.vp2-video-box.vp2-not-started .vp2-center-btn {
    opacity: 1;
}
/* flash animation on click */
.vp2-big-play:active { transform: scale(.9); }

/* ── Loading spinner ── */
.vp2-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.3);
    z-index: 4;
    pointer-events: none;
}
.vp2-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255,255,255,.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: vp2-spin .8s linear infinite;
}
@keyframes vp2-spin { to { transform: rotate(360deg); } }

/* ── Controls bar ── */
.vp2-controls-bar {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 32px 12px 10px;
    background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 100%);
    z-index: 5;
    transition: opacity .3s, visibility .3s;
    pointer-events: auto;
}

/* Auto-hide controls when playing */
.vp2-video-box.vp2-hide-ctrl .vp2-controls-bar {
    opacity: 0;
    visibility: hidden;
}
.vp2-video-box.vp2-hide-ctrl { cursor: none; }

/* ── Progress ── */
.vp2-progress-wrap {
    margin-bottom: 6px;
}
.vp2-progress-track {
    position: relative;
    height: 5px;
    background: rgba(255,255,255,.25);
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: height .15s;
}
.vp2-progress-track:hover { height: 7px; }
.vp2-progress-buf,
.vp2-progress-fill {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    border-radius: 4px;
    pointer-events: none;
}
.vp2-progress-buf  { background: rgba(255,255,255,.35); }
.vp2-progress-fill { background: var(--accent, #F97316); }
.vp2-progress-handle {
    position: absolute;
    top: 50%;
    left: 0;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    margin-left: -7px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.4);
    pointer-events: none;
    transition: transform .1s;
}
.vp2-progress-track:hover .vp2-progress-handle { transform: scale(1.3); }

/* ── Time row ── */
.vp2-time-row {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: .75rem;
    color: rgba(255,255,255,.9);
    direction: ltr;
    font-variant-numeric: tabular-nums;
}

/* ── Buttons row ── */
.vp2-btns-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    flex-wrap: nowrap;
}
.vp2-btns-left,
.vp2-btns-right {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.vp2-title-label {
    flex: 1;
    text-align: center;
    font-size: .8rem;
    color: rgba(255,255,255,.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 8px;
}

/* ── Control buttons ── */
.vp2-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background .15s, transform .1s;
    flex-shrink: 0;
    line-height: 1;
    text-decoration: none;
}
.vp2-btn:hover  { background: rgba(255,255,255,.18); }
.vp2-btn:active { transform: scale(.9); }
.vp2-dl-btn span { font-size: .78rem; font-weight: 600; }

/* ── Volume ── */
.vp2-vol-wrap {
    display: flex;
    align-items: center;
    gap: 2px;
}
.vp2-vol-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 0;
    max-width: 0;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,.4);
    outline: none;
    cursor: pointer;
    transition: width .2s, max-width .2s, opacity .2s;
    opacity: 0;
    overflow: hidden;
}
.vp2-vol-wrap:hover .vp2-vol-slider,
.vp2-vol-slider:focus {
    width: 64px;
    max-width: 64px;
    opacity: 1;
}
.vp2-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}
.vp2-vol-slider::-moz-range-thumb {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
}

/* ── Speed menu ── */
.vp2-speed-btn {
    font-size: .78rem;
    font-weight: 700;
    min-width: 32px;
    padding: 4px 6px;
    letter-spacing: -.3px;
}
/* Speed menu + share popup are teleported to <body> by JS and use position:fixed */
.vp2-speed-menu {
    background: rgba(20,20,20,.97);
    border-radius: 8px;
    padding: 4px;
    min-width: 72px;
    display: none;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 4px 20px rgba(0,0,0,.5);
    z-index: 99999;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-family: Vazirmatn, Tahoma, sans-serif;
}
.vp2-speed-menu.vp2-open { display: flex; }
.vp2-speed-menu button {
    background: transparent;
    border: none;
    color: rgba(255,255,255,.85);
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: .8rem;
    text-align: center;
    transition: background .12s;
    font-family: inherit;
}
.vp2-speed-menu button:hover { background: rgba(255,255,255,.12); }
.vp2-speed-menu button.vp2-speed-on { color: var(--accent, #F97316); font-weight: 700; }

/* ── Share popup ── */
.vp2-share-popup {
    background: rgba(20,20,20,.97);
    border-radius: 12px;
    padding: 12px;
    min-width: 200px;
    display: none;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 28px rgba(0,0,0,.6);
    z-index: 99999;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-family: Vazirmatn, Tahoma, sans-serif;
    direction: rtl;
}
.vp2-share-popup.vp2-open { display: flex; }
.vp2-share-title {
    font-size: .8rem;
    font-weight: 700;
    color: rgba(255,255,255,.7);
    text-align: center;
}
.vp2-share-icons {
    display: flex;
    justify-content: center;
    gap: 10px;
}
.vp2-share-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: transform .15s, filter .15s;
}
.vp2-share-icon:hover { transform: scale(1.1); filter: brightness(1.2); }
.vp2-share-tg { background: #229ed9; }
.vp2-share-wa { background: #25d366; }
.vp2-share-link-row {
    display: flex;
    gap: 4px;
    align-items: center;
}
.vp2-share-link-inp {
    flex: 1;
    font-size: .72rem;
    padding: 4px 6px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.08);
    color: #fff;
    outline: none;
    direction: ltr;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vp2-share-copy-btn {
    font-size: .72rem;
    padding: 4px 8px;
    border-radius: 5px;
    border: none;
    background: var(--accent, #F97316);
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .15s;
}
.vp2-share-copy-btn:hover { opacity: .85; }

/* ── Fullscreen ── */
.vp2-video-box.vp2-fullscreen {
    border-radius: 0;
}
.vp2-video-box:-webkit-full-screen { width: 100vw; height: 100vh; }
.vp2-video-box:-moz-full-screen    { width: 100vw; height: 100vh; }
.vp2-video-box:fullscreen          { width: 100vw; height: 100vh; }

/* ── Mobile: compact controls so the progress bar hugs the buttons at the
   bottom instead of floating toward the middle of a short (16/9) video ── */
@media (max-width: 600px) {
    .vp2-controls-bar      { padding: 14px 6px 6px; }
    .vp2-progress-wrap     { margin-bottom: 3px; }
    .vp2-progress-track    { margin-bottom: 3px; }
    .vp2-time-row          { font-size: .68rem; }
    .vp2-title-label       { display: none; }          /* free space, keep one row */
    .vp2-btns-row          { gap: 0; }
    .vp2-btns-left,
    .vp2-btns-right        { gap: 0; }
    .vp2-btn               { padding: 5px; }
    .vp2-btn svg           { width: 19px; height: 19px; }
    .vp2-play-btn svg      { width: 22px; height: 22px; }
    .vp2-speed-btn         { min-width: 28px; font-size: .72rem; padding: 4px; }
    .vp2-big-play          { width: 54px; height: 54px; }
    .vp2-big-play svg      { width: 24px; height: 24px; }
}

/* ── Dark mode adjustments ── */
body.dark .vp2-wrap,
body.neo-dark .vp2-wrap {
    /* video box is always dark by nature — no changes needed */
}

/* ══════════════════════════════════════════════════════════════
   TOC — Table of Contents
   ══════════════════════════════════════════════════════════════ */

/* ── Heading anchor (link icon on hover) ── */
.toc-heading-anchor {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
    opacity: 0;
    color: var(--accent);
    text-decoration: none;
    transition: opacity .15s;
    vertical-align: middle;
}
h1:hover .toc-heading-anchor,
h2:hover .toc-heading-anchor,
h3:hover .toc-heading-anchor,
h4:hover .toc-heading-anchor,
h5:hover .toc-heading-anchor,
h6:hover .toc-heading-anchor {
    opacity: 1;
}

/* ── Shared list styles ── */
.toc-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.toc-list .toc-list {
    padding-right: 16px;
    margin-top: 4px;
}
.toc-item {
    margin-bottom: 2px;
}
.toc-link {
    display: block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: .88rem;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.5;
    transition: background .15s, color .15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.toc-link:hover {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
}
.toc-link.toc-active {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
    font-weight: 600;
}

/* ── Inline TOC ── */
.toc-inline {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius, 10px);
    margin-bottom: 20px;
    overflow: hidden;
}
.toc-inline-head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: .92rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
}
.toc-inline-head:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
/* Prevent SVG/span children from absorbing clicks instead of bubbling to button */
.toc-inline-head > * { pointer-events: none; }
.toc-inline-icon { color: var(--accent); display: flex; }
.toc-inline-label { flex: 1; }
.toc-chev {
    display: flex;
    color: var(--text-secondary);
    transition: transform .25s;
}
.toc-inline-body {
    padding: 6px 12px 12px;
    border-top: 1px solid var(--border-color);
    transition: max-height .3s ease, opacity .25s;
    max-height: 1000px;
    opacity: 1;
    overflow: hidden;
}
.toc-inline-body.toc-collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    padding-top: 0;
    padding-bottom: 0;
    border-top-color: transparent;
}

/* ── Layout wrapper (sidebar mode) ── */
.toc-layout {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    /* keeps sidebar + content centred, preserving content width */
    max-width: var(--toc-layout-maxwidth, 1044px);
    margin-right: auto;
    margin-left: auto;
    width: 100%;
}

/* When sidebar is active, parent containers must not constrain width */
html.has-toc-sidebar .dashboard-container,
html.has-toc-sidebar .blog-post-article {
    max-width: none;
}
/* The card / article that moves into the layout should fill remaining width */
.toc-layout > :not(.toc-sidebar) {
    flex: 1;
    min-width: 0; /* prevent flex overflow */
}

/* ── Sidebar ── */
.toc-sidebar {
    width: var(--toc-sidebar-width, 220px);
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius, 10px);
    padding: 12px;
    /* RTL: sidebar is first child → appears on right */
}
.toc-sidebar-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .88rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}
.toc-sidebar nav { padding: 0; }

/* Mobile backdrop */
.toc-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1199; /* just below sidebar (1200) */
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer; /* required for click events to fire on iOS Safari */
}
.toc-backdrop.toc-backdrop-open {
    display: block;
}

/* Mobile hamburger button */
.toc-ham-btn {
    display: none;
    position: fixed;
    bottom: 80px;
    left: 16px;
    z-index: 1201; /* above backdrop (1199) and sidebar (1200) */
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.2);
}

/* ── Responsive sidebar ── */
@media (max-width: 900px) {
    /* Restore normal width constraints on mobile — sidebar is a fixed overlay */
    html.has-toc-sidebar .dashboard-container,
    html.has-toc-sidebar .blog-post-article {
        max-width: 800px;
    }
    .toc-layout {
        flex-direction: column;
        max-width: none; /* mobile doesn't need the 1044px layout cap */
    }
    .toc-sidebar {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 1200;
        width: var(--toc-sidebar-width, 260px);
        max-width: 85vw;
        max-height: 100%;
        border-radius: 0;
        overflow-y: auto;
        box-shadow: -4px 0 20px rgba(0,0,0,.2);
        transform: translateX(100%);
        transition: transform .3s ease;
    }
    .toc-sidebar.toc-sidebar-open {
        display: block;
        transform: translateX(0);
    }
    .toc-ham-btn {
        display: flex;
    }
}
