:root {
    --emerald: #059669;
    --emerald-light: #10b981;
    --deep-blue: #1e3a8a;
    --blue: #2563eb;
    --gradient: linear-gradient(135deg, #059669 0%, #1e3a8a 100%);
    --shadow: 0 8px 30px rgba(30, 58, 138, 0.12);
    --radius: 14px;
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-faint: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --link-color: #059669;
    --emerald-bright: #059669;
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.55);
    --glass-shine: rgba(255, 255, 255, 0.45);
    --glass-blur: 14px;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Plus Jakarta Sans', var(--font-body);
    --leading-body: 1.65;
    --leading-snug: 1.45;
    --leading-tight: 1.25;
    --tracking-body: -0.011em;
    --tracking-tight: -0.025em;
    --tracking-wide: 0.04em;
}
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}
body {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    line-height: var(--leading-body);
    letter-spacing: var(--tracking-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    background: var(--bg-body);
    color: var(--text-primary);
    background-image:
        radial-gradient(ellipse 80% 60% at 10% -10%, rgba(5, 150, 105, 0.08), transparent),
        radial-gradient(ellipse 60% 50% at 90% 0%, rgba(37, 99, 235, 0.06), transparent);
    background-attachment: fixed;
}
body.dark-mode {
    --bg-body: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-faint: #64748b;
    --border-color: #334155;
    --border-light: #334155;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    --link-color: #34d399;
    --emerald-bright: #34d399;
    --deep-blue: #93c5fd;
    --glass-bg: rgba(30, 41, 59, 0.72);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shine: rgba(255, 255, 255, 0.06);
    background: var(--bg-body);
    color: var(--text-primary);
    background-image:
        radial-gradient(ellipse 80% 60% at 10% -10%, rgba(52, 211, 153, 0.07), transparent),
        radial-gradient(ellipse 60% 50% at 90% 0%, rgba(59, 130, 246, 0.06), transparent);
}
body.dark-mode .card,
body.dark-mode .navbar,
body.dark-mode footer {
    color: var(--text-primary);
    border-color: var(--border-color) !important;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.navbar-brand,
.site-brand,
.page-header-title,
.content-card-title,
.content-list-title,
.section-title,
.landing-hero-title,
.landing-section-title,
.landing-section-label,
.footer-heading,
.filter-card-label,
.mcq-question-full,
.author-box-title,
.content-section-block h3,
.quiz-feedback-title,
.topic-hub-card h3 {
    font-family: var(--font-display);
    letter-spacing: var(--tracking-tight);
}
h1, .h1, .page-header-title { font-weight: 600; line-height: var(--leading-tight); }
h2, .h2 { font-weight: 600; line-height: var(--leading-tight); }
h3, .h3, .content-card-title { font-weight: 600; line-height: var(--leading-snug); }
h4, h5, h6, .h4, .h5, .h6 { font-weight: 600; }
p, li, label, .form-control, .form-select, .btn, .nav-link, td, th {
    font-family: inherit;
}
.form-control, .form-select, textarea {
    font-size: 0.9375rem;
    line-height: var(--leading-snug);
    letter-spacing: var(--tracking-body);
}
.btn {
    font-weight: 500;
    letter-spacing: -0.01em;
}
.btn-emerald, .btn-primary, .fw-bold, .fw-semibold {
    font-weight: 600;
}
small, .small, .text-muted { line-height: 1.5; }

/* ── Glass / glossy surfaces ── */
.navbar,
.card,
footer,
.landing-stat-item,
.landing-feature-card,
.landing-category-card,
.landing-quiz-card,
.landing-resource-card,
.landing-testimonial,
.landing-blog-card,
.landing-affair-card,
.landing-trend-card,
.landing-leader-row,
.landing-hero-float,
.landing-exam-badge,
.landing-leaderboard {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 var(--glass-shine), 0 8px 32px rgba(15, 23, 42, 0.08);
}
.landing-stat-item,
.landing-feature-card,
.landing-category-card,
.landing-quiz-card,
.landing-testimonial,
.landing-trend-card,
.card {
    position: relative;
    overflow: hidden;
}
.landing-stat-item::before,
.landing-feature-card::before,
.landing-category-card::before,
.landing-quiz-card::before,
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.28) 0%, transparent 48%);
    pointer-events: none;
    border-radius: inherit;
    z-index: 0;
}
.landing-stat-item > *,
.landing-feature-card > *,
.landing-category-card > *,
.landing-quiz-card > *,
.card > * { position: relative; z-index: 1; }
body.dark-mode .landing-stat-item::before,
body.dark-mode .landing-feature-card::before,
body.dark-mode .landing-category-card::before,
body.dark-mode .landing-quiz-card::before,
body.dark-mode .card::before {
    background: linear-gradient(135deg, rgba(255,255,255,0.07) 0%, transparent 50%);
}
.navbar {
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.navbar-scrolled {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.hero-section {
    background: var(--gradient);
    border-radius: var(--radius);
    padding: 4rem 2rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('https://images.unsplash.com/photo-1498837167922-ddd27513d352?w=1200') center/cover;
    opacity: 0.15;
}
.hero-content { position: relative; z-index: 1; }
.btn-emerald {
    background: linear-gradient(180deg, var(--emerald-light) 0%, var(--emerald) 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.65rem 1.4rem;
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 4px 14px rgba(5, 150, 105, 0.35);
}
.btn-emerald:hover {
    background: linear-gradient(180deg, #34d399 0%, var(--emerald-light) 100%);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 6px 20px rgba(5, 150, 105, 0.4);
}
.btn-outline-light-custom {
    border: 2px solid rgba(255,255,255,0.8);
    color: #fff;
    font-weight: 600;
    border-radius: 10px;
}
.category-card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(5, 150, 105, 0.2);
}
.category-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.navbar-brand span { color: var(--emerald); }
.section-title {
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: var(--tracking-tight);
}
.quiz-mode-card {
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}
.quiz-mode-card:hover, .quiz-mode-card.active {
    border-color: var(--emerald);
    background: rgba(5, 150, 105, 0.08);
}
footer,
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
}
/* Admin panel styles live in public/css/admin.css */
@media (max-width: 768px) {
    .hero-section { padding: 2.5rem 1.25rem; }
}

/* ── Landing page ── */
.landing-hero {
    background: linear-gradient(135deg, #047857 0%, #1e3a8a 55%, #1e40af 100%);
    color: #fff;
    padding: 3.5rem 0 3rem;
    position: relative;
    overflow: hidden;
    margin: -1.5rem calc(-50vw + 50%) 0;
    width: 100vw;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.landing-hero.hero-loaded {
    opacity: 1;
    transform: translateY(0);
}
.landing-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('https://images.unsplash.com/photo-1498837167922-ddd27513d352?w=1600') center/cover;
    opacity: 0.08;
}
.landing-hero > .container { position: relative; z-index: 1; }
.landing-hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 40px;
    background: #f8fafc;
    clip-path: ellipse(55% 100% at 50% 100%);
}
body.dark-mode .landing-hero-wave { background: #0f172a; }

.landing-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.35rem 0.9rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
}
.landing-hero-title {
    font-size: clamp(1.75rem, 3.8vw, 2.5rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}
.landing-hero-lead {
    font-size: 1.0625rem;
    font-weight: 400;
    opacity: 0.92;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    max-width: 520px;
}
.landing-search {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 14px;
    padding: 0.35rem 0.35rem 0.35rem 1rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 8px 32px rgba(0,0,0,0.15);
    max-width: 480px;
}
.landing-search i { color: #94a3b8; margin-right: 0.5rem; }
.landing-search input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 0.95rem;
    color: #1e293b;
    background: transparent;
}
.landing-search button {
    background: var(--emerald);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    white-space: nowrap;
}
.landing-search button:hover { background: var(--emerald-light); }
.btn-hero-outline {
    border: 2px solid rgba(255,255,255,0.75);
    color: #fff;
    font-weight: 600;
    border-radius: 10px;
    background: transparent;
}
.btn-hero-outline:hover { background: rgba(255,255,255,0.12); color: #fff; }

.landing-trust {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
    opacity: 0.9;
}
.landing-trust-avatars {
    display: flex;
}
.landing-trust-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #fff;
    margin-left: -10px;
    background: rgba(255,255,255,0.25);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.landing-trust-avatars .landing-trust-avatar:first-child { margin-left: 0; }

.landing-hero-visual { position: relative; padding: 0 0.5rem; }
.landing-hero-img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.3);
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
}
.landing-hero-float {
    position: absolute;
    background: #fff;
    color: #1e293b;
    border-radius: 14px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    font-size: 0.85rem;
    animation: float 3s ease-in-out infinite;
    max-width: calc(100% - 1rem);
}
.landing-hero-float i { font-size: 1.5rem; flex-shrink: 0; }
.landing-hero-float strong { display: block; font-size: 1.1rem; line-height: 1.2; }
.landing-hero-float small { color: #64748b; }
.landing-hero-float-1 { bottom: 8%; left: 0; animation-delay: 0s; }
.landing-hero-float-2 { top: 8%; right: 0; animation-delay: 1.5s; }
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.landing-stats {
    padding: 2rem 0 2.5rem;
    position: relative;
    z-index: 3;
}
.landing-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
@media (min-width: 768px) {
    .landing-stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 992px) {
    .landing-stats-grid { grid-template-columns: repeat(5, 1fr); }
}
.landing-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 1.25rem 0.75rem;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 120px;
    min-width: 0;
    text-align: center;
}
.landing-stat-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(5,150,105,0.18);
    color: inherit;
}
.landing-stat-item i { font-size: 1.4rem; color: var(--emerald); margin-bottom: 0.35rem; flex-shrink: 0; }
.landing-stat-num {
    font-size: clamp(1.15rem, 2.2vw, 1.45rem);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
}
.landing-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    line-height: 1.3;
}

.landing-section { padding: 3.5rem 0; }
.landing-section-tag {
    display: inline-block;
    color: var(--emerald);
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}
.landing-section-title {
    font-weight: 600;
    font-size: clamp(1.4rem, 2.8vw, 1.85rem);
    line-height: var(--leading-tight);
    margin-bottom: 0.75rem;
}

.landing-feature-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    height: 100%;
    transition: transform 0.25s;
}
.landing-feature-card:hover { transform: translateY(-6px); }
.landing-feature-img-wrap {
    position: relative;
    height: 160px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.landing-feature-img-wrap.feat-1 { background: linear-gradient(135deg, #059669, #10b981); }
.landing-feature-img-wrap.feat-2 { background: linear-gradient(135deg, #2563eb, #1e3a8a); }
.landing-feature-img-wrap.feat-3 { background: linear-gradient(135deg, #d97706, #f59e0b); }
.landing-feature-img-wrap.feat-4 { background: linear-gradient(135deg, #7c3aed, #5b21b6); }
.landing-feature-img-wrap.feat-5 { background: linear-gradient(135deg, #0891b2, #0e7490); }
.landing-feature-img-wrap.feat-6 { background: linear-gradient(135deg, #db2777, #be185d); }
.landing-feature-bg-icon {
    font-size: 4rem;
    color: rgba(255,255,255,0.2);
    position: absolute;
}
.landing-feature-icon {
    position: absolute;
    bottom: -18px;
    left: 1.25rem;
    width: 44px;
    height: 44px;
    background: var(--gradient);
    color: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(5,150,105,0.35);
}
.landing-feature-body { padding: 1.75rem 1.25rem 1.25rem; }
.landing-feature-body h5 { font-weight: 600; margin-bottom: 0.5rem; }
.landing-feature-body p { font-size: 0.88rem; color: var(--text-muted); margin: 0; line-height: 1.6; }

.landing-category-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    height: 100%;
    transition: all 0.2s;
    border: 2px solid transparent;
}
.landing-category-card:hover {
    border-color: var(--emerald);
    transform: translateY(-3px);
    box-shadow: 0 12px 36px rgba(5,150,105,0.15);
}
.landing-category-card h6 {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.75rem 0 0.25rem;
    font-size: 0.9rem;
}
.landing-category-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(5,150,105,0.12), rgba(30,58,138,0.12));
    color: var(--emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}
.landing-category-count { font-size: 0.78rem; color: var(--text-faint); }

.landing-how { background: linear-gradient(180deg, rgba(5,150,105,0.04) 0%, transparent 100%); border-radius: 20px; padding: 3rem 2rem !important; }
.landing-how-visual {
    background: var(--gradient);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    color: #fff;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    box-shadow: var(--shadow);
}
.landing-how-visual i { font-size: 4rem; opacity: 0.9; }
.landing-how-visual p { font-size: 1.05rem; font-weight: 500; margin: 0; opacity: 0.95; }
.landing-steps { display: flex; flex-direction: column; gap: 1.5rem; }
.landing-step {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}
.landing-step-num {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--gradient);
    color: #fff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}
.landing-step h5 { font-weight: 600; margin-bottom: 0.25rem; }
.landing-step p { font-size: 0.9rem; color: var(--text-muted); margin: 0; }

.landing-quiz-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    height: 100%;
    border-top: 4px solid var(--accent, var(--emerald));
    transition: transform 0.2s;
}
.landing-quiz-card:hover { transform: translateY(-4px); }
.landing-quiz-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.landing-quiz-card h5 { font-weight: 600; margin-bottom: 0.5rem; }
.landing-quiz-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1rem; }

.landing-resource-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    height: 100%;
}
.landing-resource-head {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: rgba(255,255,255,0.9);
}
.landing-resource-head.res-notes { background: linear-gradient(135deg, #059669, #047857); }
.landing-resource-head.res-papers { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.landing-resource-head.res-mocks { background: linear-gradient(135deg, #d97706, #b45309); }
.landing-resource-body { padding: 1.25rem; }
.landing-resource-body h5 { font-weight: 600; margin-bottom: 0.5rem; }
.landing-resource-link {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border-light);
}
.landing-resource-link:hover { color: var(--link-color); }

.landing-testimonial {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
}
.landing-testimonial-stars { color: #f59e0b; margin-bottom: 0.75rem; font-size: 0.9rem; }
.landing-testimonial p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.7;
    flex: 1;
    font-style: italic;
}
.landing-testimonial-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}
.landing-testimonial-author img,
.landing-testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.landing-testimonial-avatar {
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}
.landing-testimonial-author strong { display: block; font-size: 0.9rem; }
.landing-testimonial-author small { color: var(--text-muted); }

.landing-author-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    height: 100%;
}
.landing-author-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.landing-author-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.landing-author-header strong { display: block; font-size: 1.05rem; }
.landing-author-header small { color: var(--text-muted); }
.landing-author-quote {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.75;
    font-style: italic;
    margin-bottom: 1.25rem;
}
.landing-author-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.author-profile-card .author-profile-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.author-profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.75rem;
    flex-shrink: 0;
}
.author-profile-name {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.author-profile-title {
    color: var(--text-muted);
    font-size: 1rem;
}
.author-contact-list li {
    margin-bottom: 0.5rem;
}
.author-contact-list a {
    color: var(--link-color);
    text-decoration: none;
}
.author-contact-list a:hover {
    text-decoration: underline;
}

.landing-blog-card {
    display: flex;
    gap: 1rem;
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 0.75rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 0.75rem;
    transition: box-shadow 0.2s;
}
.landing-blog-card:hover { box-shadow: var(--shadow); }
.landing-blog-thumb {
    width: 100px;
    height: 72px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: rgba(255,255,255,0.9);
}
.landing-blog-thumb.blog-a { background: linear-gradient(135deg, #059669, #10b981); }
.landing-blog-thumb.blog-b { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.landing-blog-thumb.blog-c { background: linear-gradient(135deg, #d97706, #f59e0b); }
.landing-blog-thumb.blog-d { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }
.landing-blog-thumb.blog-e { background: linear-gradient(135deg, #db2777, #ec4899); }
.landing-blog-card img {
    width: 100px;
    height: 72px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}
.landing-blog-title {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}
.landing-blog-title:hover { color: var(--link-color); }

.landing-affair-card {
    display: flex;
    gap: 1rem;
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 0.75rem;
    align-items: center;
}
.landing-affair-date {
    flex-shrink: 0;
    width: 52px;
    text-align: center;
    background: linear-gradient(135deg, #2563eb, #1e3a8a);
    color: #fff;
    border-radius: 10px;
    padding: 0.4rem 0;
    line-height: 1.2;
}
.landing-affair-date .day { display: block; font-size: 1.25rem; font-weight: 700; }
.landing-affair-date .month { font-size: 0.72rem; text-transform: uppercase; opacity: 0.85; }

.landing-faq .accordion-item {
    border: none;
    border-radius: 12px !important;
    margin-bottom: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.landing-faq .accordion-button {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 1.1rem 1.25rem;
    background: var(--bg-surface);
    color: var(--text-primary);
}
.landing-faq .accordion-button:not(.collapsed) {
    background: rgba(5,150,105,0.08);
    color: var(--link-color);
    box-shadow: none;
}
.landing-faq .accordion-body { font-size: 0.9rem; line-height: 1.7; color: var(--text-muted); }

.landing-cta {
    margin: 2rem calc(-50vw + 50%) 0;
    width: 100vw;
    padding: 0 0 2rem;
}
.landing-cta-inner {
    background: var(--gradient);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.landing-cta-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('https://images.unsplash.com/photo-1556910103-1c02745aae4d?w=1200') center/cover;
    opacity: 0.1;
}
.landing-cta-inner > .row { position: relative; z-index: 1; }
.landing-cta-inner h2 { font-weight: 700; font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 0.75rem; }
.landing-cta-inner p { opacity: 0.9; margin-bottom: 1.5rem; max-width: 520px; }
.landing-cta-visual {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: rgba(255,255,255,0.85);
    animation: float 3s ease-in-out infinite;
}
.landing-faq-visual {
    background: linear-gradient(135deg, rgba(5,150,105,0.12), rgba(30,58,138,0.12));
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    margin-top: 1rem;
    display: none;
}
@media (min-width: 992px) {
    .landing-faq-visual { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; min-height: 280px; }
}
.landing-faq-visual i { font-size: 3.5rem; color: var(--emerald); }
.landing-faq-visual p { color: var(--text-muted); margin: 0; font-weight: 500; }

@media (max-width: 991px) {
    .landing-hero-float { display: none; }
    .landing-hero { padding: 2.5rem 0 4rem; text-align: center; }
    .landing-hero-lead { margin-left: auto; margin-right: auto; }
    .landing-search { margin-left: auto; margin-right: auto; }
    .landing-trust { justify-content: center; }
    .landing-how { padding: 2rem 1rem !important; }
}
@media (max-width: 576px) {
    .landing-stat-num { font-size: 1.2rem; }
    .landing-cta-inner { padding: 2rem 1.25rem; border-radius: 16px; }
}

/* ── Animations & scroll reveal ── */
.reveal, .reveal-stagger {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.revealed, .reveal-stagger.revealed {
    opacity: 1;
    transform: translateY(0);
}

.navbar-scrolled {
    box-shadow: 0 4px 24px rgba(30, 58, 138, 0.1) !important;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95) !important;
}
body.dark-mode .navbar-scrolled {
    background: rgba(30, 41, 59, 0.95) !important;
}

.scroll-top-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: var(--gradient);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(5,150,105,0.35);
}
.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.scroll-top-btn:hover { transform: translateY(-3px); }

/* ── Exam boards strip ── */
.landing-exams {
    padding: 1.5rem 0 2.5rem;
    overflow: hidden;
}
.landing-exams-label {
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}
.landing-exams-track {
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.landing-exams-scroll {
    display: flex;
    gap: 0.75rem;
    width: max-content;
    animation: marquee 35s linear infinite;
}
.landing-exam-badge {
    flex-shrink: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── Trending MCQs ── */
.landing-trend-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    height: 100%;
    border-left: 4px solid var(--emerald);
    transition: transform 0.2s, box-shadow 0.2s;
}
.landing-trend-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(5,150,105,0.15);
}
.landing-trend-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.landing-trend-q {
    font-size: 0.92rem;
    color: var(--text-primary);
    line-height: 1.55;
    margin-bottom: 1rem;
    min-height: 2.8em;
}
.landing-trend-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-light);
    padding-top: 0.75rem;
}

/* ── Leaderboard ── */
.landing-leaderboard {
    background: linear-gradient(135deg, rgba(5,150,105,0.06), rgba(30,58,138,0.06));
    border-radius: 20px;
    padding: 2.5rem;
    border: 1px solid rgba(5,150,105,0.12);
}
.landing-leader-list { display: flex; flex-direction: column; gap: 0.65rem; }
.landing-leader-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--bg-surface);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.landing-leader-rank {
    font-weight: 700;
    font-size: 0.9rem;
    width: 32px;
    color: #94a3b8;
}
.landing-leader-rank.rank-1 { color: #f59e0b; }
.landing-leader-rank.rank-2 { color: #94a3b8; }
.landing-leader-rank.rank-3 { color: #d97706; }
.landing-leader-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.landing-leader-info { flex: 1; min-width: 0; }
.landing-leader-info strong { display: block; font-size: 0.92rem; }
.landing-leader-info small { color: var(--text-muted); }
.landing-leader-bar {
    width: 80px;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}
.landing-leader-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: 3px;
    transition: width 1.2s ease;
}

/* ── Daily challenge ── */
.landing-daily { padding: 0 0 3.5rem; }
.landing-daily-inner {
    background: linear-gradient(135deg, #059669, #047857);
    border-radius: 20px;
    padding: 2rem 2.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.landing-daily-inner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    animation: pulse-ring 4s ease-in-out infinite;
}
.landing-daily-inner > .row { position: relative; z-index: 1; }
.landing-daily-tag {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.landing-daily-inner h3 { font-weight: 700; margin-bottom: 0.5rem; }
@keyframes pulse-ring {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 0.25; }
}

/* ── Dark mode: global & Bootstrap overrides ── */
body.dark-mode .text-muted { color: var(--text-muted) !important; }
body.dark-mode .text-dark { color: var(--text-primary) !important; }
body.dark-mode a:not(.btn):not(.nav-link):not(.landing-stat-item):not(.landing-blog-title):not(.landing-resource-link) { color: var(--link-color); }
body.dark-mode footer a { color: var(--link-color); }
body.dark-mode footer .text-muted { color: var(--text-muted) !important; }
body.dark-mode hr { border-color: var(--border-color); opacity: 1; }

body.dark-mode .navbar-light .navbar-brand { color: var(--text-primary); }
body.dark-mode .navbar-light .nav-link { color: var(--text-secondary); }
body.dark-mode .navbar-light .nav-link:hover,
body.dark-mode .navbar-light .nav-link:focus { color: var(--text-primary); }
body.dark-mode .navbar-toggler { border-color: var(--border-color); }
body.dark-mode .navbar-toggler-icon { filter: invert(1) brightness(0.9); }

body.dark-mode .btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-color);
}
body.dark-mode .btn-outline-secondary:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-color);
}
body.dark-mode .btn-outline-primary {
    color: #60a5fa;
    border-color: #60a5fa;
}
body.dark-mode .btn-outline-primary:hover {
    background: #2563eb;
    color: #fff;
}
body.dark-mode .btn-outline-success {
    color: var(--emerald-bright);
    border-color: var(--emerald-bright);
}
body.dark-mode .btn-outline-success:hover {
    background: var(--emerald);
    color: #fff;
}
body.dark-mode .btn-link { color: var(--link-color); }

body.dark-mode .form-control,
body.dark-mode .form-select {
    background: var(--bg-surface-hover);
    border-color: var(--border-color);
    color: var(--text-primary);
}
body.dark-mode .form-control::placeholder { color: var(--text-faint); }
body.dark-mode .form-control:focus {
    background: var(--bg-surface-hover);
    border-color: var(--emerald-bright);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(52, 211, 153, 0.2);
}

body.dark-mode .alert-success { background: rgba(5, 150, 105, 0.15); color: #6ee7b7; border-color: rgba(5, 150, 105, 0.3); }
body.dark-mode .alert-danger { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border-color: rgba(239, 68, 68, 0.3); }

body.dark-mode .bg-success-subtle { background: rgba(5, 150, 105, 0.2) !important; }
body.dark-mode .text-success { color: #6ee7b7 !important; }
body.dark-mode .bg-danger-subtle { background: rgba(239, 68, 68, 0.2) !important; }
body.dark-mode .text-danger { color: #fca5a5 !important; }
body.dark-mode .bg-warning-subtle { background: rgba(245, 158, 11, 0.2) !important; }
body.dark-mode .text-warning { color: #fcd34d !important; }
body.dark-mode .bg-primary-subtle { background: rgba(37, 99, 235, 0.2) !important; }
body.dark-mode .text-primary { color: #93c5fd !important; }

/* ── Dark mode: landing page ── */
body.dark-mode .landing-section-title,
body.dark-mode .landing-feature-body h5,
body.dark-mode .landing-step h5,
body.dark-mode .landing-quiz-card h5,
body.dark-mode .landing-resource-body h5,
body.dark-mode .landing-testimonial-author strong,
body.dark-mode .landing-leader-info strong { color: var(--text-primary); }

body.dark-mode .landing-section-tag { color: var(--emerald-bright); }
body.dark-mode .landing-stat-item {
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 var(--glass-shine), var(--shadow);
}
body.dark-mode .landing-stat-item i { color: var(--emerald-bright); }
body.dark-mode .landing-stat-num { color: var(--text-primary); }
body.dark-mode .landing-stat-label { color: var(--text-muted); }

body.dark-mode .landing-exams-label { color: var(--text-muted); }

body.dark-mode .landing-feature-card,
body.dark-mode .landing-category-card,
body.dark-mode .landing-quiz-card,
body.dark-mode .landing-resource-card,
body.dark-mode .landing-testimonial,
body.dark-mode .landing-blog-card,
body.dark-mode .landing-affair-card,
body.dark-mode .landing-trend-card,
body.dark-mode .flashcard-preview-wrap,
body.dark-mode .landing-leader-row {
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 var(--glass-shine), var(--shadow);
}

body.dark-mode .landing-feature-body p,
body.dark-mode .landing-step p,
body.dark-mode .landing-quiz-card p { color: var(--text-muted); }

body.dark-mode .landing-category-card h6 { color: var(--text-primary); }
body.dark-mode .landing-category-icon {
    background: rgba(52, 211, 153, 0.12);
    color: var(--emerald-bright);
}
body.dark-mode .landing-category-count { color: var(--text-faint); }

body.dark-mode .landing-how {
    background: linear-gradient(180deg, rgba(52, 211, 153, 0.06) 0%, transparent 100%);
}

body.dark-mode .landing-resource-link {
    color: var(--text-secondary);
    border-bottom-color: var(--border-color);
}
body.dark-mode .landing-resource-link:hover { color: var(--emerald-bright); }

body.dark-mode .landing-testimonial p { color: var(--text-secondary); }
body.dark-mode .landing-testimonial-author { border-top-color: var(--border-color); }
body.dark-mode .landing-testimonial-author small { color: var(--text-muted); }
body.dark-mode .landing-author-card { background: var(--bg-surface); }
body.dark-mode .landing-author-header small { color: var(--text-muted); }
body.dark-mode .landing-author-quote { color: var(--text-secondary); }
body.dark-mode .author-profile-title { color: var(--text-muted); }

body.dark-mode .landing-blog-title { color: var(--text-primary); }
body.dark-mode .landing-blog-title:hover { color: var(--emerald-bright); }

body.dark-mode .landing-trend-q { color: var(--text-primary); }
body.dark-mode .landing-trend-foot {
    color: var(--text-muted);
    border-top-color: var(--border-color);
}
body.dark-mode .landing-flashcard-grid .flashcard-face {
    background: linear-gradient(160deg, rgba(52, 211, 153, 0.08), var(--bg-body));
}

body.dark-mode .landing-leaderboard {
    background: var(--glass-bg) !important;
    border-color: var(--glass-border);
}
body.dark-mode .landing-leader-info small { color: var(--text-muted); }
body.dark-mode .landing-leader-bar { background: var(--bg-surface-hover); }

body.dark-mode .landing-faq .accordion-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color) !important;
}
body.dark-mode .landing-faq .accordion-button {
    background: var(--bg-surface);
    color: var(--text-primary);
}
body.dark-mode .landing-faq .accordion-button:not(.collapsed) {
    background: rgba(52, 211, 153, 0.12);
    color: var(--emerald-bright);
}
body.dark-mode .landing-faq .accordion-button::after { filter: invert(1); }
body.dark-mode .landing-faq .accordion-body {
    background: var(--bg-surface);
    color: var(--text-muted);
}

body.dark-mode .landing-faq-visual {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.1), rgba(59, 130, 246, 0.1));
    border: 1px solid var(--border-color);
}
body.dark-mode .landing-faq-visual i { color: var(--emerald-bright); }
body.dark-mode .landing-faq-visual p { color: var(--text-muted); }

body.dark-mode .landing-hero-float {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
body.dark-mode .landing-hero-float small { color: var(--text-muted); }

body.dark-mode .quiz-mode-card:hover,
body.dark-mode .quiz-mode-card.active {
    background: rgba(52, 211, 153, 0.1);
    border-color: var(--emerald-bright);
}

body.dark-mode #darkModeToggle i.bi-sun { color: #fcd34d; }

/* ── Dark mode: inner pages ── */
body.dark-mode .card { color: var(--text-primary); }
body.dark-mode .card .text-muted,
body.dark-mode .card-body .text-muted { color: var(--text-muted) !important; }
body.dark-mode .card-title,
body.dark-mode .card h1, body.dark-mode .card h2,
body.dark-mode .card h3, body.dark-mode .card h4,
body.dark-mode .card h5, body.dark-mode .card h6 { color: var(--text-primary); }
body.dark-mode .list-group-item {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-color);
}
body.dark-mode .breadcrumb-item,
body.dark-mode .breadcrumb-item a { color: var(--text-muted); }
body.dark-mode .breadcrumb-item.active { color: var(--text-secondary); }
body.dark-mode .page-link {
    background: var(--bg-surface);
    border-color: var(--border-color);
    color: var(--text-secondary);
}
body.dark-mode .page-link:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}
body.dark-mode .page-item.active .page-link {
    background: var(--emerald);
    border-color: var(--emerald);
    color: #fff;
}
body.dark-mode .table { color: var(--text-primary); --bs-table-bg: transparent; }
body.dark-mode .table-light { --bs-table-bg: var(--bg-surface-hover); color: var(--text-primary); }
body.dark-mode .border-bottom { border-color: var(--border-color) !important; }
body.dark-mode .shadow-sm { box-shadow: var(--shadow) !important; }

/* ── Navigation active states ── */
.navbar .nav-link {
    position: relative;
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: -0.01em;
    padding: 0.45rem 0.85rem !important;
    border-radius: 9px;
    color: var(--text-secondary);
    transition: color 0.2s, background 0.2s;
}
.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: var(--text-primary);
    background: rgba(5, 150, 105, 0.06);
}
.navbar .nav-link.active {
    color: var(--emerald) !important;
    background: rgba(5, 150, 105, 0.12);
    font-weight: 600;
}
.navbar .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 3px;
    background: var(--emerald);
    border-radius: 2px;
}
body.dark-mode .navbar .nav-link { color: var(--text-secondary); }
body.dark-mode .navbar .nav-link:hover,
body.dark-mode .navbar .nav-link:focus { color: var(--text-primary); background: rgba(52, 211, 153, 0.08); }
body.dark-mode .navbar .nav-link.active {
    color: var(--emerald-bright) !important;
    background: rgba(52, 211, 153, 0.14);
}
body.dark-mode .navbar .nav-link.active::after { background: var(--emerald-bright); }

.nav-actions .btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
}
.nav-actions .btn-icon.active {
    background: rgba(5, 150, 105, 0.12);
    border-color: var(--emerald);
    color: var(--emerald);
}
body.dark-mode .nav-actions .btn-icon.active {
    background: rgba(52, 211, 153, 0.14);
    border-color: var(--emerald-bright);
    color: var(--emerald-bright);
}

.btn-nav-login,
.btn-nav-register {
    font-weight: 600;
    padding: 0.4rem 1rem;
    border-radius: 9px;
    min-width: 5.5rem;
    text-align: center;
}
.btn-nav-register { padding: 0.4rem 1.1rem; }
.nav-btn-active.btn-outline-primary {
    background: rgba(37, 99, 235, 0.1);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.25);
}
.nav-btn-active.btn-emerald {
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35), 0 4px 14px rgba(5, 150, 105, 0.35);
}
body.dark-mode .nav-btn-active.btn-outline-primary {
    background: rgba(96, 165, 250, 0.15);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.4);
}
.btn-nav-logout {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.4rem 0.75rem;
    border: none;
    background: transparent;
}
.btn-nav-logout:hover { color: #ef4444; background: rgba(239, 68, 68, 0.08); }
body.dark-mode .btn-nav-logout:hover { color: #fca5a5; background: rgba(239, 68, 68, 0.12); }

@media (max-width: 991px) {
    .navbar-nav { padding: 0; }
}

/* ── Forms (global) ── */
.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}
.form-control,
.form-select {
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.9rem;
    font-size: 0.925rem;
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control-lg {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 12px;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--emerald);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
    background: var(--bg-surface);
    color: var(--text-primary);
}
body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    border-color: var(--emerald-bright);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}
.form-control.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.invalid-feedback { font-size: 0.82rem; margin-top: 0.35rem; }

.form-check-input {
    width: 1.1em;
    height: 1.1em;
    border-radius: 4px;
    border-color: var(--border-color);
    cursor: pointer;
}
.form-check-input:checked {
    background-color: var(--emerald);
    border-color: var(--emerald);
}
.form-check-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding-left: 0.25rem;
}
body.dark-mode .form-check-input {
    background-color: var(--bg-surface-hover);
    border-color: var(--border-color);
}
body.dark-mode .form-check-input:checked {
    background-color: var(--emerald-bright);
    border-color: var(--emerald-bright);
}

.input-icon-wrap {
    position: relative;
}
.input-icon-wrap .input-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    font-size: 1rem;
    pointer-events: none;
    z-index: 2;
}
.input-icon-wrap .form-control {
    padding-left: 2.65rem;
}
textarea.form-control { min-height: 120px; resize: vertical; }

/* ── Auth pages ── */
.auth-page {
    padding: 2rem 0 3rem;
    min-height: calc(100vh - 280px);
    display: flex;
    align-items: center;
}
.auth-card {
    overflow: hidden;
    border-radius: 18px !important;
}
.auth-card-header {
    padding: 2rem 2rem 0.5rem;
}
.auth-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 14px;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.3);
}
.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}
.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0;
}
.auth-card-body {
    padding: 1.25rem 2rem 2rem;
}
.auth-submit {
    font-weight: 600;
    letter-spacing: 0.01em;
}
.auth-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.875rem;
    color: var(--text-muted);
}
.auth-footer a {
    font-weight: 600;
    color: var(--link-color);
    text-decoration: none;
}
.auth-footer a:hover { text-decoration: underline; }

@media (max-width: 576px) {
    .auth-card-header,
    .auth-card-body { padding-left: 1.25rem; padding-right: 1.25rem; }
    .auth-page { padding: 1rem 0 2rem; }
}

/* ── Badges (high-contrast, dark-mode safe) ── */
.badge-fsm {
    display: inline-block;
    font-weight: 500;
    font-size: 0.6875rem;
    line-height: 1.35;
    padding: 0.38em 0.72em;
    border-radius: 6px;
    border: 1px solid transparent;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.badge-fsm-success {
    background: #d1fae5;
    color: #065f46;
    border-color: #6ee7b7;
}
.badge-fsm-warning {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}
.badge-fsm-danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}
.badge-fsm-info {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}
.badge-fsm-neutral {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}
.badge-fsm-primary {
    background: #dbeafe;
    color: #1e3a8a;
    border-color: #93c5fd;
}

body.dark-mode .badge-fsm-success {
    background: rgba(16, 185, 129, 0.22);
    color: #a7f3d0;
    border-color: rgba(52, 211, 153, 0.45);
}
body.dark-mode .badge-fsm-warning {
    background: rgba(245, 158, 11, 0.22);
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.45);
}
body.dark-mode .badge-fsm-danger {
    background: rgba(239, 68, 68, 0.22);
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.45);
}
body.dark-mode .badge-fsm-info,
body.dark-mode .badge-fsm-primary {
    background: rgba(59, 130, 246, 0.22);
    color: #bfdbfe;
    border-color: rgba(96, 165, 250, 0.45);
}
body.dark-mode .badge-fsm-neutral {
    background: rgba(148, 163, 184, 0.18);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.35);
}

/* Fix legacy Bootstrap badges in dark mode */
body.dark-mode .badge.bg-success { background: rgba(16, 185, 129, 0.85) !important; color: #fff !important; }
body.dark-mode .badge.bg-danger { background: rgba(239, 68, 68, 0.85) !important; color: #fff !important; }
body.dark-mode .badge.bg-primary { background: rgba(37, 99, 235, 0.85) !important; color: #fff !important; }
body.dark-mode .badge.bg-light {
    background: rgba(148, 163, 184, 0.2) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(148, 163, 184, 0.35);
}
body.dark-mode .badge.bg-success-subtle { background: rgba(16, 185, 129, 0.22) !important; color: #a7f3d0 !important; border: 1px solid rgba(52, 211, 153, 0.35); }
body.dark-mode .badge.bg-danger-subtle { background: rgba(239, 68, 68, 0.22) !important; color: #fecaca !important; border: 1px solid rgba(248, 113, 113, 0.35); }
body.dark-mode .badge.bg-warning-subtle { background: rgba(245, 158, 11, 0.22) !important; color: #fde68a !important; border: 1px solid rgba(251, 191, 36, 0.35); }
body.dark-mode .badge.bg-primary-subtle { background: rgba(59, 130, 246, 0.22) !important; color: #bfdbfe !important; border: 1px solid rgba(96, 165, 250, 0.35); }

body.dark-mode .card-header.bg-white {
    background: var(--bg-surface-hover) !important;
    color: var(--text-primary);
    border-bottom-color: var(--border-color) !important;
}
body.dark-mode .list-group-item {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-color);
}
body.dark-mode .list-group-item-success {
    background: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
    border-color: rgba(52, 211, 153, 0.3);
}

/* ── Content pages (blog, MCQs, papers, etc.) ── */
.page-header {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.08) 0%, rgba(37, 99, 235, 0.06) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 1.75rem 0 2rem;
    margin: 0 0 0;
    width: 100%;
}
body.dark-mode .page-header {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.06) 0%, rgba(59, 130, 246, 0.05) 100%);
}
.page-breadcrumb { margin-bottom: 1rem; }
.page-breadcrumb .breadcrumb {
    background: transparent;
    padding: 0;
    font-size: 0.82rem;
}
.page-breadcrumb .breadcrumb-item a { color: var(--text-muted); text-decoration: none; }
.page-breadcrumb .breadcrumb-item a:hover { color: var(--link-color); }
.page-breadcrumb .breadcrumb-item.active { color: var(--text-secondary); }
.page-breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: var(--text-faint); }

.page-header-inner {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}
.page-header-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.25);
}
.page-header-title {
    font-size: clamp(1.45rem, 2.8vw, 1.9rem);
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
    line-height: var(--leading-tight);
}
.page-header-subtitle {
    font-size: 0.9375rem;
    color: var(--text-muted);
    max-width: 640px;
    line-height: var(--leading-body);
    font-weight: 400;
}

.content-page { padding: 2.5rem 0 3.5rem; }
.content-page-narrow .detail-card { max-width: 820px; margin: 0 auto; }

.content-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}
.content-empty i { font-size: 3rem; opacity: 0.35; display: block; margin-bottom: 1rem; }

.content-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: inset 0 1px 0 var(--glass-shine), var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}
.content-card:hover {
    transform: translateY(-4px);
    box-shadow: inset 0 1px 0 var(--glass-shine), 0 12px 36px rgba(5, 150, 105, 0.12);
}
.content-card-thumb {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.75rem;
    color: rgba(255,255,255,0.9);
}
.content-card-thumb.blog-a { background: linear-gradient(135deg, #059669, #10b981); }
.content-card-thumb.blog-b { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.content-card-thumb.blog-c { background: linear-gradient(135deg, #d97706, #f59e0b); }
.content-card-thumb.blog-d { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }
.content-card-thumb.blog-e { background: linear-gradient(135deg, #db2777, #ec4899); }
.content-card-thumb.mock-thumb { background: linear-gradient(135deg, #d97706, #b45309); }
.content-card-thumb.notes-thumb { background: linear-gradient(135deg, #059669, #047857); }

.content-card-body { padding: 1.25rem 1.35rem 1.35rem; }
.content-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
}
.content-card-title {
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: var(--leading-snug);
    margin-bottom: 0.5rem;
}
.content-card-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}
.content-card-title a:hover { color: var(--link-color); }
.content-card-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: var(--leading-body);
    margin-bottom: 0.75rem;
}
.content-card-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--link-color);
    text-decoration: none;
}
.content-card-link:hover { text-decoration: underline; }

.mock-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}
.mock-stats i { color: var(--emerald); margin-right: 0.2rem; }
body.dark-mode .mock-stats i { color: var(--emerald-bright); }

.content-list { display: flex; flex-direction: column; gap: 0.85rem; }
.content-list-body { flex: 1; min-width: 0; }
.content-list-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.content-list-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.15rem 1.35rem;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: inset 0 1px 0 var(--glass-shine), 0 2px 12px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s, border-color 0.2s;
}
.content-list-item:hover {
    border-color: rgba(5, 150, 105, 0.35);
    box-shadow: inset 0 1px 0 var(--glass-shine), var(--shadow);
}
.content-list-date {
    flex-shrink: 0;
    width: 58px;
    text-align: center;
    background: linear-gradient(135deg, #2563eb, #1e3a8a);
    color: #fff;
    border-radius: 12px;
    padding: 0.5rem 0.35rem;
    line-height: 1.15;
}
.content-list-date .day { display: block; font-size: 1.35rem; font-weight: 700; }
.content-list-date .month { display: block; font-size: 0.72rem; text-transform: uppercase; opacity: 0.9; }
.content-list-date .year { display: block; font-size: 0.65rem; opacity: 0.75; }

.content-list-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}
.content-list-icon.paper-icon {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    position: relative;
}
.content-list-icon .paper-year {
    font-size: 0.65rem;
    font-weight: 700;
    margin-top: 0.15rem;
    opacity: 0.9;
}

.content-list-body { flex: 1; min-width: 0; }
.content-list-title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    line-height: var(--leading-snug);
}
.content-list-title a {
    color: var(--text-primary);
    text-decoration: none;
}
.content-list-title a:hover { color: var(--link-color); }
.content-list-action { flex-shrink: 0; }
.content-list-action-mcq {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Filter card (public + admin) ── */
.filter-card {
    margin-bottom: 1.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: calc(var(--radius) + 2px);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}
.filter-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.35);
}
body.dark-mode .filter-card-header {
    background: rgba(15, 23, 42, 0.35);
}
.filter-card-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}
.filter-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.12);
    color: var(--emerald);
    flex-shrink: 0;
}
.filter-card-label {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: var(--tracking-tight);
}
.filter-card-count {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0.15rem 0.55rem;
    border-radius: 50px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    white-space: nowrap;
}
.filter-card-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.filter-card-clear {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}
.filter-card-clear:hover {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
}
.filter-card-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    transition: transform 0.2s, border-color 0.2s;
}
.filter-card-toggle[aria-expanded="false"] i {
    transform: rotate(180deg);
}
.filter-card-active {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.65rem 1.15rem;
    background: rgba(16, 185, 129, 0.05);
    border-bottom: 1px solid var(--border-light);
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--emerald);
    background: var(--bg-surface);
    border: 1px solid rgba(16, 185, 129, 0.35);
    text-decoration: none;
    transition: all 0.2s;
}
.filter-chip:hover {
    background: rgba(16, 185, 129, 0.1);
    color: var(--emerald);
}
.filter-chip i { font-size: 0.72rem; opacity: 0.7; }
.filter-card-body {
    padding: 1rem 1.15rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.filter-card-body.is-collapsed {
    display: none;
}
.filter-card-search {
    display: block;
    margin-bottom: 0.75rem;
}
.filter-search-wrap {
    position: relative;
    flex: 1;
    min-width: min(100%, 220px);
}
.filter-search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}
.filter-search-input {
    width: 100%;
    padding: 0.55rem 2.25rem 0.55rem 2.35rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.88rem;
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.filter-search-input:focus {
    outline: none;
    border-color: var(--emerald);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.filter-search-clear {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.15rem;
    line-height: 1;
}
.filter-search-clear:hover { color: #dc2626; }
.filter-search-btn { align-self: stretch; padding-inline: 1.1rem; border-radius: 10px; }
.filter-pills-scroll {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.filter-pills-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-surface);
    color: var(--text-secondary);
    transition: border-color 0.2s, color 0.2s;
}
.filter-pills-nav:hover {
    border-color: var(--emerald);
    color: var(--emerald);
}
.filter-pills-track {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    flex: 1;
    min-width: 0;
}
.filter-pills-scroll .filter-pills-track {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.15rem 0;
}
.filter-pills-scroll .filter-pills-track::-webkit-scrollbar { display: none; }
.filter-pills-track-inline { flex-wrap: wrap; }
.filter-pill-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.filter-pill-group-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    cursor: pointer;
}
button.filter-pill {
    font-family: inherit;
}
.filter-pill:hover {
    border-color: var(--emerald);
    color: var(--link-color);
    transform: translateY(-1px);
}
.filter-pill.active {
    background: var(--emerald);
    border-color: var(--emerald);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28);
}
.filter-pill-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.08);
}
.filter-pill.active .filter-pill-count {
    background: rgba(255, 255, 255, 0.22);
}
body.dark-mode .filter-pill.active {
    background: var(--emerald-bright);
    border-color: var(--emerald-bright);
    color: #0f172a;
}
/* Admin filter card */
.admin-filter-card { margin-bottom: 1.25rem; }
.admin-filter-card .filter-card-header { cursor: default; }
.admin-filter-card .filter-card-toggle { display: inline-flex; }
.admin-filter-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem 1rem;
}
.admin-filter-field { min-width: 0; }
.admin-filter-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}
.admin-filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.15rem;
}
.admin-page-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.admin-page-toolbar .admin-filter-card {
    flex: 1;
    min-width: min(100%, 320px);
    margin-bottom: 0;
}

.mcq-question-preview {
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: var(--leading-body);
}
.mcq-question-full {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: var(--leading-snug);
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.category-cta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.35rem;
    margin-bottom: 1.75rem;
    background: linear-gradient(135deg, rgba(5,150,105,0.08), rgba(37,99,235,0.06));
    border: 1px solid rgba(5,150,105,0.2);
    border-radius: var(--radius);
}
body.dark-mode .category-cta-bar {
    background: linear-gradient(135deg, rgba(52,211,153,0.08), rgba(59,130,246,0.06));
    border-color: rgba(52, 211, 153, 0.2);
}

.detail-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: inset 0 1px 0 var(--glass-shine), var(--shadow);
    overflow: hidden;
}
.detail-meta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-light);
}
.detail-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.detail-stat-box {
    text-align: center;
    padding: 1.25rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}
.detail-stat-box i {
    font-size: 1.5rem;
    color: var(--emerald);
    display: block;
    margin-bottom: 0.35rem;
}
body.dark-mode .detail-stat-box i { color: var(--emerald-bright); }
.detail-stat-box strong {
    display: block;
    font-size: 1.35rem;
    color: var(--text-primary);
    line-height: 1.2;
}
.detail-stat-box small {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-info-block {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1.35rem;
    margin-bottom: 1.5rem;
}
.detail-info-block h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}
.detail-checklist {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
}
.detail-explanation {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.2);
}
body.dark-mode .detail-explanation {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(251, 191, 36, 0.25);
}
.note-summary-block {
    background: rgba(5, 150, 105, 0.06);
    border-color: rgba(5, 150, 105, 0.2);
}
body.dark-mode .note-summary-block {
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.25);
}

.detail-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.mcq-options { display: flex; flex-direction: column; gap: 0.65rem; margin-bottom: 1.5rem; }
.mcq-option {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: border-color 0.2s;
}
.mcq-option-correct {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.35);
}
body.dark-mode .mcq-option-correct {
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.35);
}
.mcq-option-letter {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--border-light);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mcq-option-correct .mcq-option-letter {
    background: var(--emerald);
    color: #fff;
}
body.dark-mode .mcq-option-correct .mcq-option-letter {
    background: var(--emerald-bright);
    color: #0f172a;
}
.mcq-option-text {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.5;
}
.mcq-option-icon {
    color: var(--emerald);
    font-size: 1.15rem;
    flex-shrink: 0;
}
body.dark-mode .mcq-option-icon { color: var(--emerald-bright); }

.content-prose {
    font-size: 0.975rem;
    line-height: 1.75;
    color: var(--text-secondary);
}
.content-prose h2, .content-prose h3 {
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.content-prose h2 { font-size: 1.25rem; }
.content-prose h3 { font-size: 1.1rem; }
.content-prose p { margin-bottom: 1rem; }
.content-prose ul, .content-prose ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}
.content-prose li { margin-bottom: 0.35rem; }
.content-prose blockquote {
    border-left: 3px solid var(--emerald);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    background: rgba(5, 150, 105, 0.06);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
    font-style: italic;
}
body.dark-mode .content-prose blockquote {
    background: rgba(52, 211, 153, 0.08);
    border-left-color: var(--emerald-bright);
}

.content-pagination {
    margin-top: 2rem;
}

/* ── FSM Pagination ── */
.fsm-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: inset 0 1px 0 var(--glass-shine), 0 2px 12px rgba(0,0,0,0.04);
}
.fsm-pagination-info {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.fsm-pagination-info strong {
    color: var(--text-primary);
    font-weight: 600;
}
.fsm-pagination-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.fsm-pagination-list li { margin: 0; }
.fsm-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.65rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    color: var(--text-secondary);
    text-decoration: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
a.fsm-page-btn:hover {
    color: var(--emerald);
    border-color: rgba(5, 150, 105, 0.45);
    background: rgba(5, 150, 105, 0.08);
}
.fsm-page-btn.active {
    color: #fff;
    background: linear-gradient(135deg, #059669, #047857);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
    cursor: default;
}
.fsm-page-btn.disabled {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
}
.fsm-page-btn-nav {
    min-width: auto;
    padding: 0 0.85rem;
    font-weight: 600;
}
.fsm-page-ellipsis {
    border-color: transparent;
    background: transparent;
    min-width: 1.75rem;
    padding: 0 0.25rem;
    letter-spacing: 0.05em;
}
body.dark-mode .fsm-pagination {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 2px 12px rgba(0,0,0,0.2);
}
body.dark-mode a.fsm-page-btn:hover {
    background: rgba(52, 211, 153, 0.12);
    border-color: rgba(52, 211, 153, 0.35);
    color: var(--emerald-bright);
}
body.dark-mode .fsm-page-btn {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.1);
}

/* Content card & detail photos */
.content-card-thumb-photo {
    height: 160px;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #059669, #1e3a8a);
}
.content-card-thumb-photo .content-card-photo,
.content-card-thumb-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.detail-hero-image {
    margin: -2rem -2rem 1.25rem;
    border-radius: 0;
    overflow: hidden;
    max-height: 280px;
    background: linear-gradient(135deg, #059669, #1e3a8a);
}
.detail-hero-image img,
.detail-hero-photo {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}
.content-list-photo-wrap {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #2563eb, #1e3a8a);
}
.content-list-photo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.content-list-photo-wrap-paper {
    position: relative;
}
.content-list-photo-year {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.25rem 0.35rem 0.15rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-align: center;
    color: #fff;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
}
.landing-blog-thumb-photo {
    width: 100px;
    height: 72px;
    border-radius: 10px;
    flex-shrink: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #059669, #10b981);
}
.landing-blog-thumb-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 575px) {
    .fsm-pagination {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .fsm-pagination-list {
        justify-content: center;
    }
}

@media (max-width: 767px) {
    .content-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.85rem;
    }
    .content-list-action { width: 100%; }
    .content-list-action .btn { width: 100%; }
    .content-list-action-mcq { justify-content: flex-start; }
    .content-list-date { width: 100%; display: flex; align-items: center; gap: 0.5rem; padding: 0.65rem 1rem; }
    .content-list-date .day, .content-list-date .month, .content-list-date .year { display: inline; font-size: 0.85rem; }
    .detail-card { padding: 1.35rem; }
    .detail-hero-image { margin: -1.35rem -1.35rem 1.25rem; }
    .detail-footer .btn { flex: 1; text-align: center; }
    .page-header-inner { flex-direction: column; gap: 0.85rem; }
}

/* Topic hub */
.mcq-browse-intro h2 { font-family: var(--font-display); }
.mcq-category-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1.25rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: inset 0 1px 0 var(--glass-shine), var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    height: 100%;
    color: inherit;
}
.mcq-category-card:hover {
    transform: translateY(-4px);
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: inset 0 1px 0 var(--glass-shine), 0 12px 32px rgba(5, 150, 105, 0.12);
    color: inherit;
}
.mcq-category-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}
.mcq-category-card-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    line-height: var(--leading-snug);
    color: var(--text-primary);
}
.mcq-category-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.mcq-category-card-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--link-color);
    margin-top: auto;
}
.topic-hub-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.topic-hub-card {
    display: flex; align-items: center; gap: 1rem;
    padding: 1.1rem 1.25rem; background: var(--bg-surface);
    border-radius: var(--radius); box-shadow: var(--shadow);
    text-decoration: none; color: inherit; transition: box-shadow 0.2s, transform 0.2s;
}
.topic-hub-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.1); transform: translateY(-2px); color: inherit; }
.topic-hub-card h3 { font-size: 1rem; font-weight: 600; margin: 0 0 0.15rem; }
.topic-hub-count { font-size: 0.82rem; color: var(--text-muted); }
.topic-hub-card-icon { width: 44px; height: 44px; border-radius: 10px; background: rgba(5,150,105,0.1); color: var(--emerald); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.topic-hub-arrow { margin-left: auto; color: var(--text-muted); }

/* Interactive MCQ */
.mcq-option-btn {
    width: 100%; text-align: left; cursor: pointer; border: 1px solid var(--border-light);
    background: var(--bg-surface); transition: border-color 0.2s, background 0.2s;
}
.mcq-option-btn:hover:not(:disabled) { border-color: var(--emerald); }
.mcq-option-wrong { background: rgba(220,38,38,0.08) !important; border-color: rgba(220,38,38,0.35) !important; }
.mcq-option-wrong .mcq-option-letter { background: #dc2626; color: #fff; }
.mcq-option-selected { border-color: var(--emerald); }
.mcq-reveal-actions { margin-bottom: 1.5rem; }
.mcq-answer-section { border-top: 1px solid var(--border-light); padding-top: 1.5rem; }

/* MCQ unified card & flashcards */
.detail-card-mcq-unified { padding-bottom: 0; overflow: hidden; }
.mcq-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.mcq-bookmark-action { flex-shrink: 0; }

.flashcard {
    perspective: 1000px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    cursor: pointer;
    outline: none;
}
.flashcard-inner {
    position: relative;
    width: 100%;
    min-height: 240px;
    height: 260px;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
}
.flashcard-compact .flashcard-inner {
    height: 220px;
    min-height: 220px;
}
.flashcard.is-flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    background: linear-gradient(145deg, rgba(5,150,105,0.05), var(--bg-surface));
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
}
.flashcard-back { transform: rotateY(180deg); }
.flashcard-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--emerald);
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}
.flashcard-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex-shrink: 0;
}
.flashcard-text, .flashcard-answer {
    font-size: 1.05rem;
    line-height: 1.55;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.flashcard-compact .flashcard-text,
.flashcard-compact .flashcard-answer { font-size: 0.92rem; line-height: 1.5; }
.flashcard-excerpt {
    font-size: 0.88rem;
    color: var(--text-secondary);
    overflow-y: auto;
    min-height: 0;
    flex: 1;
}
.flashcard-hint {
    margin-top: auto;
    padding-top: 0.75rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.flashcard-preview-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
    padding: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}
.landing-flashcard-grid .flashcard-preview-wrap {
    border-left: 4px solid var(--emerald);
}
.landing-flashcard-grid .flashcard-preview-wrap:hover {
    box-shadow: 0 12px 32px rgba(5, 150, 105, 0.12);
}
.landing-flashcard-grid .flashcard-face {
    border: none;
    border-radius: 12px;
    background: linear-gradient(160deg, rgba(5,150,105,0.07), var(--bg-body));
}
.flashcard-open-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--emerald);
    text-decoration: none;
    margin-top: auto;
    padding-top: 0.15rem;
}
.flashcard-open-link:hover { color: #047857; }
.flashcard-study-card { padding: 1.5rem; }
.flashcard-study-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}
.flashcard-deck-progress {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}
.flashcard-study-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-light);
    padding-top: 1.25rem;
    margin-top: 1.5rem;
}
.flashcard-category-card { height: 100%; }

.mcq-card-toolbar {
    border-top: 1px solid var(--border-light);
    padding: 1rem 0 0.5rem;
    margin-top: 1.25rem;
}
.mcq-card-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.mcq-toolbar-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}
.mcq-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    border-radius: 9px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.mcq-toolbar-btn:hover { border-color: var(--emerald); color: var(--emerald); }
.mcq-toolbar-btn-next {
    background: linear-gradient(135deg, #059669, #047857);
    border-color: transparent;
    color: #fff;
}
.mcq-toolbar-btn-next:hover {
    background: linear-gradient(135deg, #047857, #065f46);
    color: #fff;
    border-color: transparent;
}
.mcq-toolbar-btn-prev { flex-direction: row; }
.mcq-toolbar-spacer { flex: 1; min-width: 80px; }

/* Content navigation */
.content-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 0.85rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.content-nav-side { flex: 1; min-width: 0; display: flex; }
.content-nav-side-prev { justify-content: flex-start; }
.content-nav-side-next { justify-content: flex-end; }
.content-nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.content-nav-bookmark-form { margin: 0; }
.content-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border-radius: 9px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    max-width: 100%;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.content-nav-btn:hover {
    border-color: var(--emerald);
    color: var(--emerald);
    background: rgba(5, 150, 105, 0.06);
}
.content-nav-btn-next-emerald {
    background: linear-gradient(135deg, #059669, #047857);
    border-color: transparent;
    color: #fff;
}
.content-nav-btn-next-emerald:hover {
    background: linear-gradient(135deg, #047857, #065f46);
    color: #fff;
    border-color: transparent;
}
.content-nav-btn-next { flex-direction: row; }
.content-nav-btn-prev { flex-direction: row; }
.content-nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}
.content-nav-placeholder { display: block; min-width: 1px; }
.content-nav-back span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }

/* Author box */
.author-box {
    background: rgba(5,150,105,0.05); border: 1px solid rgba(5,150,105,0.15);
    border-radius: var(--radius); padding: 1.25rem; margin-top: 1.5rem;
}
.author-box-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
.author-box-avatar {
    width: 52px; height: 52px; border-radius: 50%; background: var(--gradient);
    color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.author-box-title { font-size: 0.95rem; font-weight: 700; margin: 0 0 0.15rem; }
.author-box-text { font-size: 0.92rem; color: var(--text-secondary); line-height: 1.7; }

/* Article author header */
.article-author-header {
    display: flex; gap: 1rem; padding-bottom: 1.25rem; margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-light);
}
.article-author-avatar {
    width: 56px; height: 56px; border-radius: 50%; background: var(--gradient);
    color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
}
.article-author-byline { font-size: 0.95rem; }
.article-author-role { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.article-author-dates { font-size: 0.82rem; color: var(--text-muted); }

/* Content sections */
.content-section-block { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--border-light); }
.content-section-block h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.content-ref-list { padding-left: 1.25rem; }
.content-ref-list li { margin-bottom: 0.35rem; }
.related-topics-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.related-topic-link {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.45rem 0.85rem; background: var(--bg-surface); border: 1px solid var(--border-light);
    border-radius: 999px; font-size: 0.85rem; text-decoration: none; color: var(--text-primary);
}
.related-topic-link:hover { border-color: var(--emerald); color: var(--emerald); }
.related-topic-count { font-size: 0.75rem; color: var(--text-muted); margin-left: 0.25rem; }
.related-topic-static { cursor: default; }

.blog-meta-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.blog-meta-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.25rem 0.65rem;
    background: var(--bg-body);
    border: 1px solid var(--border-light);
    border-radius: 999px;
}
.blog-meta-header { align-items: flex-start; }

/* Comments panel */
.comments-panel {
    border-top: 1px solid var(--border-light);
    margin-top: 1.25rem;
    padding-top: 0.75rem;
    padding-bottom: 0.5rem;
}
.comments-panel-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: none;
    background: var(--bg-body);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.comments-panel-toggle:hover {
    border-color: var(--emerald);
    background: rgba(5,150,105,0.04);
}
.comments-panel-toggle-left {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.comments-panel-toggle-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.comments-panel-chevron {
    color: var(--text-muted);
    transition: transform 0.2s;
}
.comments-panel-toggle:not(.collapsed) .comments-panel-chevron {
    transform: rotate(180deg);
}
.comments-panel-body {
    padding-top: 1rem;
}
.comments-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: rgba(5,150,105,0.1);
    color: var(--emerald);
    font-size: 0.78rem;
    font-weight: 700;
}
.comment-compose { margin-bottom: 1.25rem; }
.comment-compose-inner {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}
.comment-compose-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}
.comment-compose-body textarea {
    border-radius: 10px;
    resize: vertical;
    min-height: 80px;
}
.comment-compose-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    gap: 0.5rem;
}
.comment-guest-prompt {
    padding: 0.85rem 1rem;
    background: var(--bg-body);
    border: 1px dashed var(--border-light);
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.comment-list { display: flex; flex-direction: column; gap: 0.75rem; }
.comment-card {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--bg-body);
    border: 1px solid var(--border-light);
    border-radius: 12px;
}
.comment-card-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}
.comment-card-body { flex: 1; min-width: 0; }
.comment-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    margin-bottom: 0.35rem;
}
.comment-card-author { font-size: 0.9rem; }
.comment-card-time { font-size: 0.78rem; color: var(--text-muted); }
.comment-delete-form { margin: 0 0 0 auto; }
.comment-delete-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 0.15rem 0.35rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}
.comment-delete-btn:hover { color: #dc2626; background: rgba(220,38,38,0.08); }
.comment-card-text { font-size: 0.92rem; line-height: 1.55; color: var(--text-primary); }
.comment-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    border: 1px dashed var(--border-light);
    border-radius: 12px;
}
.comment-empty i { font-size: 1.75rem; display: block; margin-bottom: 0.5rem; opacity: 0.5; }

/* Legacy comments (notes etc.) */
.comments-section .comment-item {
    display: flex; gap: 0.85rem; padding: 1rem 0; border-bottom: 1px solid var(--border-light);
}
.comment-avatar {
    width: 40px; height: 40px; border-radius: 50%; background: var(--gradient);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}

/* Quiz feedback */
.quiz-feedback-panel {
    background: rgba(5,150,105,0.06); border-radius: var(--radius);
    padding: 1rem 1.15rem; margin-top: 1rem;
}
.quiz-feedback-title { font-weight: 700; margin-bottom: 0.5rem; }
.quiz-review-item {
    padding: 1rem; border-radius: var(--radius); margin-bottom: 0.75rem;
    border: 1px solid var(--border-light);
}
.quiz-review-correct { border-left: 4px solid var(--emerald); }
.quiz-review-wrong { border-left: 4px solid #dc2626; }
.quiz-review-header { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; flex-wrap: wrap; }

/* Score guide */
.score-guide-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.score-badge {
    display: inline-block; padding: 0.2rem 0.5rem; border-radius: 6px;
    font-size: 0.78rem; font-weight: 700; margin-right: 0.35rem;
}
.score-pass { background: rgba(234,179,8,0.2); color: #a16207; }
.score-good { background: rgba(59,130,246,0.15); color: #1d4ed8; }
.score-better { background: rgba(5,150,105,0.15); color: var(--emerald); }
.score-best { background: rgba(16,185,129,0.2); color: #047857; }
.score-excellent { background: rgba(139,92,246,0.15); color: #6d28d9; }
.mock-category-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

@media (max-width: 767px) {
    .content-nav { flex-wrap: wrap; }
    .content-nav-side { flex: 1 1 40%; }
    .content-nav-center { flex: 1 1 100%; order: -1; padding-bottom: 0.35rem; border-bottom: 1px solid var(--border-light); margin-bottom: 0.25rem; width: 100%; }
    .content-nav-label { max-width: 100px; }
}

/* ── Site layout & navigation UX ── */
.site-main { padding-bottom: 2rem; min-height: 50vh; }
.site-alerts { padding-top: 1rem; }
.site-navbar {
    background: var(--glass-bg) !important;
    border-bottom: 1px solid var(--border-color);
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}
.site-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: var(--tracking-tight);
}
.site-nav-main {
    margin: 0 auto;
    gap: 0.15rem;
}
.site-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}
.site-user-btn { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
    padding: 3rem 0 2rem;
}
.footer-heading {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--text-secondary);
    margin-bottom: 0.85rem;
}
.site-footer-links li { margin-bottom: 0.45rem; }
.site-footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.site-footer-links a:hover { color: var(--link-color); }
.site-newsletter-form {
    display: flex;
    gap: 0.5rem;
    max-width: 320px;
}
.site-newsletter-form .form-control { flex: 1; }

.navbar .dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 0.4rem;
    min-width: 210px;
}
.navbar .dropdown-item {
    border-radius: 8px;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}
.navbar .dropdown-item.active,
.navbar .dropdown-item:active {
    background: rgba(5, 150, 105, 0.12);
    color: var(--emerald);
}
body.dark-mode .navbar .dropdown-item.active,
body.dark-mode .navbar .dropdown-item:active {
    background: rgba(52, 211, 153, 0.14);
    color: var(--emerald-bright);
}

.article-author-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-light);
}
.article-author-dates {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.filter-card-bookmarks .filter-pill.active {
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28);
}
.mock-test-group.is-filter-hidden {
    display: none;
}
.mock-test-card.is-filter-hidden {
    display: none !important;
}

@media (max-width: 991px) {
    .site-nav-main {
        width: 100%;
        margin: 0.5rem 0 0;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-light);
    }
    .site-nav-actions {
        width: 100%;
        margin-left: 0;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-light);
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    .navbar .nav-link.active::after { display: none; }
}

@media (min-width: 992px) {
    .navbar-collapse {
        display: flex !important;
        align-items: center;
        gap: 1rem;
    }
}
