:root {
    --color-primary: #38bdf8;
    --color-primary-dark: #0ea5e9;
    --color-primary-hover: #0284c7;
    --color-primary-subtle: rgba(14, 165, 233, 0.12);
    --color-primary-glow: rgba(14, 165, 233, 0.35);
    --color-accent-warm: #f59e0b;
    --color-success: #10b981;
    --color-bg: #eef2f7;
    --color-bg-subtle: #e4eaf2;
    --color-surface: #ffffff;
    --color-surface-elevated: #ffffff;
    --color-border: #d5dee9;
    --color-border-strong: #b8c5d4;
    --color-text: #152033;
    --color-muted: #5c6b7f;
    --text-muted: var(--color-muted);
    --border-subtle: rgba(148, 163, 184, 0.25);
    --sidebar-width: 272px;
    --shadow-sm: 0 1px 2px rgba(21, 32, 51, 0.05), 0 2px 8px rgba(21, 32, 51, 0.04);
    --shadow-md: 0 4px 20px rgba(21, 32, 51, 0.08), 0 2px 6px rgba(21, 32, 51, 0.04);
    --shadow-lg: 0 20px 48px rgba(21, 32, 51, 0.1), 0 8px 16px rgba(21, 32, 51, 0.05);
    --shadow-glow: 0 0 0 1px rgba(14, 165, 233, 0.08), 0 8px 32px rgba(14, 165, 233, 0.12);
    --radius: 16px;
    --radius-sm: 11px;
    --radius-pill: 999px;
    --spacing: 1rem;
    --font-sans: "Plus Jakarta Sans", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --btn-height: 2.5rem;
    --btn-height-sm: 2rem;
    --btn-height-lg: 3rem;
    --glass-bg: rgba(255, 255, 255, 0.82);
    --glass-border: rgba(255, 255, 255, 0.65);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-bg);
    background-image:
        radial-gradient(ellipse 90% 70% at 100% -15%, rgba(56, 189, 248, 0.11), transparent 55%),
        radial-gradient(ellipse 70% 50% at -5% 105%, rgba(245, 158, 11, 0.07), transparent 50%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(255, 255, 255, 0.5), transparent 70%);
    background-attachment: fixed;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.25;
}

a {
    transition: color var(--transition);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(185deg, var(--glass-bg) 0%, rgba(255, 255, 255, 0.72) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-right: 1px solid var(--color-border);
    box-shadow: 4px 0 24px rgba(21, 32, 51, 0.04);
    padding: 1.35rem 1rem;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-brand {
    padding: 0.25rem 0.5rem 1.25rem;
    background: transparent;
}

.site-logo {
    display: block;
    text-decoration: none;
    line-height: 0;
    background: transparent;
}

.site-logo-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    background: transparent !important;
    mix-blend-mode: normal;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.site-logo-image--sidebar {
    max-width: 100%;
    max-height: 72px;
    width: auto;
    margin: 0 auto;
}

.site-logo--sidebar {
    background: transparent;
    padding: 0.15rem 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.72rem 0.95rem;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: background var(--transition), color var(--transition), transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.nav-item:hover {
    background: var(--color-primary-subtle);
    color: var(--color-primary-hover);
    transform: translateX(2px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary-hover));
    color: white;
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 16px var(--color-primary-glow);
    transform: none;
}

.app-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: clamp(0.85rem, 2vw, 1.35rem) clamp(0.85rem, 2.5vw, 1.5rem) 0.85rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.top-bar-actions {
    display: flex;
    gap: 0.5rem;
}

.breadcrumb-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
    font-size: 0.875rem;
}

.breadcrumb-item {
    color: var(--color-muted);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--color-text);
    font-weight: 600;
}

.breadcrumb-item:not(.active)::after {
    content: "/";
    margin-left: 0.35rem;
    color: var(--color-border);
}

.filter-tray {
    margin: 0 1.5rem 1rem;
    padding: 1rem 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.content-area {
    padding: 0 clamp(0.75rem, 2.5vw, 1.5rem) clamp(1rem, 3vw, 2rem);
    flex: 1;
    width: 100%;
    min-width: 0;
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(14, 165, 233, 0.22);
}

.card-body {
    padding: 1.35rem 1.5rem;
}

.content-area--home {
    padding: clamp(0.5rem, 1.5vw, 0.75rem) clamp(0.5rem, 2vw, 1rem) clamp(0.75rem, 2vw, 1.25rem);
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.app-shell--home .app-main {
    min-height: 100vh;
    overflow: visible;
}

.home-page {
    display: flex;
    flex-direction: column;
    gap: clamp(0.65rem, 2vh, 1rem);
    width: 100%;
    min-width: 0;
}

.home-hero {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 2.75rem);
    text-align: center;
    background:
        radial-gradient(ellipse 90% 70% at 50% -20%, rgba(56, 189, 248, 0.28), transparent 62%),
        radial-gradient(ellipse 60% 50% at 100% 80%, rgba(245, 158, 11, 0.08), transparent 55%),
        linear-gradient(165deg, #e3f2fc 0%, #f4f9fd 42%, var(--color-surface) 100%);
    border: 1px solid rgba(14, 165, 233, 0.15);
    border-radius: calc(var(--radius) + 2px);
    box-shadow: var(--shadow-glow);
}

.home-hero-inner {
    width: 100%;
    max-width: min(1100px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(0.75rem, 2vh, 1.5rem);
}

.home-logo-link {
    display: block;
    width: 100%;
    max-width: min(720px, 100%);
    line-height: 0;
    background: transparent;
}

.home-logo-image {
    display: block;
    width: min(94%, 720px);
    max-width: 100%;
    max-height: clamp(140px, 28vh, 300px);
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    background: transparent !important;
    mix-blend-mode: normal;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

html[data-theme="dark"] .site-logo-image,
html[data-theme="dark"] .home-logo-image {
    filter: drop-shadow(0 2px 12px rgba(56, 189, 248, 0.18));
}

.hero-search-box {
    position: relative;
    width: 100%;
    max-width: min(720px, 100%);
    margin: 0 auto;
}

.hero-search-field {
    display: flex;
    align-items: stretch;
    border: 1.5px solid var(--color-border-strong);
    border-radius: var(--radius);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.hero-search-field:focus-within {
    border-color: var(--color-primary-dark);
    box-shadow: 0 0 0 3px var(--color-primary-subtle), var(--shadow-md);
}

.hero-search-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 3.1rem;
    color: var(--color-primary-dark);
    background: var(--color-primary-subtle);
    border-right: 1px solid var(--color-border);
    font-size: 1rem;
}

.hero-search-input {
    flex: 1;
    width: 100%;
    min-width: 0;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    font-weight: 500;
    padding: clamp(0.75rem, 1.5vh, 1rem) 1.15rem;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transition: none;
}

.hero-search-input:focus {
    border: none;
    box-shadow: none;
    outline: none;
}

.home-features {
    flex: 0 0 auto;
    margin: 0 !important;
    width: 100%;
}

.home-features .feature-card {
    height: 100%;
    min-width: 0;
}

.home-features .feature-card .card-body {
    padding: clamp(0.75rem, 2vw, 1rem) clamp(0.85rem, 2vw, 1rem);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.home-features h3 {
    font-size: clamp(0.95rem, 1.6vw, 1rem);
    margin-bottom: 0.25rem;
}

.home-features p {
    font-size: clamp(0.78rem, 1.4vw, 0.85rem);
    margin-bottom: 0.65rem;
    flex: 1;
    line-height: 1.45;
}


.top-bar--home {
    padding: 0.5rem 1rem 0.15rem;
    flex-shrink: 0;
    border-bottom: none;
}

.auth-layout-body {
    margin: 0;
    background: var(--color-bg);
    font-family: var(--font-sans);
}

.auth-layout-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-home-link {
    align-self: flex-start;
    margin-bottom: 1rem;
    color: var(--color-primary-dark);
    text-decoration: none;
    font-weight: 600;
}

.auth-card {
    width: 100%;
    max-width: 640px;
}

.top-bar--home .breadcrumb-nav {
    margin-top: 0;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    list-style: none;
    margin: 0.45rem 0 0;
    padding: 0.35rem;
    box-shadow: var(--shadow-md);
    z-index: 10;
    text-align: left;
    max-height: 280px;
    overflow-y: auto;
}

.search-suggestions a {
    display: block;
    padding: 0.65rem 0.85rem;
    color: var(--color-text);
    text-decoration: none;
    border-radius: 8px;
    transition: background var(--transition);
}

.search-suggestions a small {
    display: block;
    color: var(--color-muted);
    margin-top: 0.15rem;
}

.suggestion-type {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--color-primary-dark);
    font-weight: 600;
}

.search-suggestions a:hover {
    background: var(--color-primary-subtle);
}

.topic-section {
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.topic-section-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--color-bg);
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    color: var(--color-text);
}

.topic-section-header:hover {
    background: var(--color-border);
}

.topic-section-title {
    flex: 1;
    font-weight: 600;
    color: var(--color-text);
}

.topic-sublist {
    list-style: none;
    margin: 0;
    padding: 0.5rem 1rem 0.75rem 2rem;
}

.topic-sublist li {
    display: flex;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.95rem;
    color: var(--color-text);
}

.auth-card {
    max-width: 560px;
    margin: 0 auto;
}

.auth-links a {
    color: var(--color-primary-dark);
}

.auth-email-type-wrap {
    margin-top: -0.15rem;
}

.auth-email-type-options {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.2rem;
    border-radius: 999px;
    background: var(--color-bg);
}

.auth-email-type-option {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.auth-email-type-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.auth-email-type-option span {
    display: inline-block;
    padding: 0.42rem 1.05rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-muted);
    transition: color var(--transition), background var(--transition), box-shadow var(--transition);
}

.auth-email-type-option:hover span {
    color: var(--color-text);
}

.auth-email-type-option:has(input:checked) span {
    background: var(--color-surface);
    color: var(--color-primary-dark);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    font-weight: 600;
}

.auth-email-type-option:has(input:focus-visible) span {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

[data-theme="dark"] .auth-email-type-option:has(input:checked) span {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.settings-login-email-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-login-email-row .form-control {
    flex: 1;
}

.settings-email-type-badge {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: var(--color-primary-subtle);
    color: var(--color-primary-dark);
}

.user-greeting {
    align-self: center;
    font-size: 0.875rem;
    color: var(--color-muted);
    margin-right: 0.25rem;
}

.progress-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.progress-stat {
    display: flex;
    flex-direction: column;
}

.progress-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--color-primary-dark);
}

.progress-label {
    color: var(--color-muted);
    font-size: 0.9rem;
}

.feature-card .card-body {
    padding: 1.5rem;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    font-size: 1.3rem;
    color: var(--color-primary-dark);
    background: linear-gradient(145deg, var(--color-primary-subtle), rgba(255, 255, 255, 0.9));
    border: 1px solid rgba(14, 165, 233, 0.18);
    border-radius: 14px;
    margin-bottom: 0.95rem;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
}

.home-features .feature-card {
    border: 1px solid var(--color-border);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.home-features .feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(14, 165, 233, 0.38);
    box-shadow: var(--shadow-glow);
}

.home-features .btn {
    align-self: flex-start;
    font-size: clamp(0.82rem, 1.4vw, 0.875rem);
    padding: 0.45rem 1rem;
    min-height: var(--btn-height-sm);
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.topic-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.topic-list li {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}

.topic-code {
    font-weight: 600;
    color: var(--color-primary-dark);
    min-width: 4rem;
}

.calc-result {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.essay-use {
    font-size: 0.875rem;
    color: var(--color-muted);
}

.placeholder-panel {
    text-align: center;
    padding: 2rem;
    color: var(--color-muted);
}

.placeholder-panel i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: var(--color-primary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary-hover));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px var(--color-primary-glow);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: linear-gradient(135deg, var(--color-primary-hover), #0369a1);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px var(--color-primary-glow);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    background: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--color-primary-subtle);
    border-color: var(--color-primary-dark);
    color: var(--color-primary-hover);
    transform: translateY(-1px);
}

.btn-outline-secondary {
    border-color: var(--color-border-strong);
    color: var(--color-muted);
}

.btn-outline-secondary:hover {
    background: var(--color-bg-subtle);
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

.btn-link {
    font-weight: 600;
    text-decoration: none;
}

.btn-link:hover {
    text-decoration: underline;
}

#blazor-error-ui {
    background: #fef2f2;
    bottom: 0;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.1);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

@media (max-width: 992px) {
    .sidebar {
        position: static;
        width: 100%;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        box-shadow: 0 4px 16px rgba(21, 32, 51, 0.05);
        padding: 0.85rem 0.75rem 0.75rem;
    }

    .app-main {
        margin-left: 0;
        min-width: 0;
    }

    .app-shell {
        flex-direction: column;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.4rem;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-item {
        font-size: 0.82rem;
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .nav-item:hover {
        transform: none;
    }

    .sidebar-brand {
        padding-bottom: 0.75rem;
    }

    .filter-tray {
        margin: 0 clamp(0.75rem, 2vw, 1.5rem) 1rem;
    }

    .page-title {
        font-size: clamp(1.15rem, 3vw, 1.5rem);
    }
}

@media (max-height: 820px) {
    .home-logo-image {
        max-height: clamp(100px, 18vh, 180px);
    }

    .home-hero-inner {
        gap: 0.65rem;
    }

    .home-welcome-badge {
        font-size: 0.78rem;
        margin-bottom: 0.25rem;
    }
}

@media (max-width: 576px) {
    .top-bar-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .practice-mode-tabs .btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 0;
        font-size: 0.82rem;
        padding: 0.45rem 0.5rem;
    }

    .topic-revision-buttons {
        padding-left: 0;
    }

    .flashcard-deck-row {
        gap: 0.65rem;
    }

    .flashcard-scene--single {
        min-width: 0;
    }
}

/* Prevent horizontal overflow site-wide */
.app-main,
.card,
.card-body,
.row {
    max-width: 100%;
}

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

/* Breadcrumb — no slash prefix */
.breadcrumb-separator {
    color: var(--color-muted);
    margin: 0 0.35rem;
}

.breadcrumb-item:not(.active)::after {
    content: none;
}

/* Nav icons */
.nav-theme-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 6px;
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 700;
    font-size: 0.8rem;
    line-height: 1;
    flex-shrink: 0;
    border: 1px solid #bae6fd;
}

.nav-icon-svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* Auth buttons */
.btn-auth {
    border-radius: var(--radius-pill);
    padding: 0.5rem 1.15rem;
    font-weight: 600;
    font-size: 0.875rem;
    min-height: var(--btn-height-sm);
    transition: all var(--transition);
}

.btn-auth-primary {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary-hover));
    border: none;
    color: white;
    box-shadow: 0 2px 10px var(--color-primary-glow);
}

.btn-auth-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--color-primary-glow);
    color: white;
}

.btn-auth-outline {
    border: 1.5px solid var(--color-primary-dark);
    color: var(--color-primary-dark);
    background: var(--color-surface);
}

.btn-auth-outline:hover {
    background: var(--color-primary-subtle);
    color: var(--color-primary-hover);
    border-color: var(--color-primary-dark);
}

/* Topic links & revision buttons */
.topic-sublist-item {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.5rem !important;
    padding: 0.65rem 0 !important;
}

.topic-link {
    display: flex;
    gap: 0.75rem;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
}

.topic-link:hover {
    color: var(--color-primary-dark);
}

.topic-revision-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding-left: 3.5rem;
}

/* Notes / Flashcards slider */
.mode-slider {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: 0.3rem;
    max-width: 420px;
    margin: 0 auto 1rem;
}

.mode-slider-option {
    position: relative;
    z-index: 2;
    border: none;
    background: transparent;
    padding: 0.75rem 1.15rem;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: var(--radius-pill);
    color: var(--color-muted);
    cursor: pointer;
    transition: color var(--transition);
}

.mode-slider-option.active {
    color: white;
}

.mode-slider-highlight {
    position: absolute;
    top: 0.3rem;
    left: 0.3rem;
    width: calc(50% - 0.3rem);
    height: calc(100% - 0.6rem);
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary-hover));
    border-radius: var(--radius-pill);
    box-shadow: 0 2px 8px var(--color-primary-glow);
    transition: transform 0.25s ease;
    z-index: 1;
}

.mode-slider--flashcards .mode-slider-highlight {
    transform: translateX(100%);
}

.flashcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.flashcard-scene {
    perspective: 1000px;
    min-height: 160px;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 160px;
    transition: transform 0.5s;
    transform-style: preserve-3d;
}

.flashcard-inner.is-flipped {
    transform: rotateY(180deg);
}

.flashcard-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 12px;
    border: 2px solid #bae6fd;
    background: #f0f9ff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
}

.flashcard-back {
    transform: rotateY(180deg);
    background: white;
}

.flashcard-label {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    font-size: 0.7rem;
    color: var(--color-muted);
}

.calc-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.calc-formula {
    background: #f0f9ff;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--color-primary);
}

.case-study-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}

.case-study-item h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.login-gate-icon {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}

.bg-sky {
    background-color: var(--color-primary-dark) !important;
}

.password-hint {
    font-size: 0.875rem;
    color: var(--color-muted);
    margin-bottom: 1rem;
}

.quiz-rules-notice {
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--color-primary-subtle);
    border: 1px solid var(--color-border);
    font-size: 0.875rem;
    color: var(--color-text);
}

.quiz-rules-notice ul {
    margin: 0.35rem 0 0;
    padding-left: 1.15rem;
}

.quiz-rules-notice li + li {
    margin-top: 0.25rem;
}

.quiz-ghost-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 1rem;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.25);
    color: var(--color-text);
    font-size: 0.875rem;
}

.quiz-ghost-banner i {
    color: #7c3aed;
}

.progress-footnote {
    line-height: 1.45;
}

.mcq-block {
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 0.5rem;
}

.mcq-block--vertical .mcq-question-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-muted);
    margin-bottom: 0.35rem;
}

.mcq-question-text {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.85rem;
}

.mcq-options-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: none;
    border-radius: 0;
    overflow: visible;
    background: transparent;
}

.mcq-option {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.65rem;
    width: 100%;
    text-align: left;
    padding: 0.7rem 0.9rem;
    margin: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface, #fff);
    cursor: pointer;
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--color-text);
    transition: background 0.12s ease, border-color 0.12s ease;
}

.mcq-option:last-child {
    border-bottom: 1px solid var(--color-border);
}

.mcq-option:hover:not(:disabled) {
    background: var(--color-primary-subtle);
}

.mcq-option:disabled {
    cursor: default;
}

.mcq-option-letter {
    flex-shrink: 0;
    min-width: 1.5rem;
    font-weight: 700;
    color: var(--color-muted);
    font-size: 0.88rem;
    text-align: left;
}

.mcq-option-text {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.grade-predictor {
    padding: 1rem 1.15rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-primary-subtle, rgba(14, 165, 233, 0.08));
}

.grade-predictor-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--color-primary);
    letter-spacing: 0.04em;
}

.econ-diagram-controls {
    margin-top: 1rem;
    max-width: 520px;
}

.econ-diagram-host {
    width: 100%;
}

.econ-diagram-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.econ-diagram-check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin: 0.75rem 0;
}

.econ-diagram-btn-row .btn {
    touch-action: manipulation;
}

.site-copyright {
    margin-top: auto;
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.25));
}

.site-copyright--auth {
    text-align: center;
    padding-bottom: 1.5rem;
    border-top: none;
}

.site-copyright-text {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    letter-spacing: 0.01em;
}

.grade-predictor-shell,
.voranomics-standalone {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.auth-layout-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.auth-layout-shell {
    flex: 1;
}

.legal-doc {
    max-width: 820px;
    margin: 0 auto;
}

.legal-doc--policy {
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.legal-doc-header {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
}

.legal-doc-kicker {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-primary-dark);
}

.legal-doc-summary {
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.15rem;
    margin-bottom: 1.5rem;
}

.legal-doc-section {
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--color-border);
}

.legal-doc-section:last-of-type {
    border-bottom: none;
}

.legal-doc-section h2 {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.05rem;
    margin: 0 0 0.65rem;
}

.legal-doc-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 999px;
    background: var(--color-primary-subtle);
    color: var(--color-primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.legal-doc-list {
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
}

.legal-doc-list li + li {
    margin-top: 0.4rem;
}

.legal-doc-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
}

.legal-doc h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 0.35rem;
}

.legal-doc-meta {
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

.site-copyright-links a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    padding: 0.75rem 1rem;
    background: var(--color-surface, #fff);
    border-top: 1px solid var(--color-border, #e2e8f0);
    box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.08);
}

.cookie-consent-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.cookie-consent-text {
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    flex: 1 1 280px;
}

.cookie-consent-text a {
    color: var(--color-primary, #2563eb);
}

[data-theme="dark"] .cookie-consent-banner {
    background: var(--color-surface);
    border-color: var(--color-border);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .cookie-consent-text {
    color: var(--color-muted);
}

[data-theme="dark"] .cookie-consent-text a {
    color: var(--color-primary);
}

[data-theme="dark"] .site-copyright {
    border-top-color: var(--color-border);
}

[data-theme="dark"] .site-copyright-text {
    color: var(--color-muted);
}

[data-theme="dark"] .site-copyright-links a {
    color: var(--color-muted);
}

[data-theme="dark"] .site-copyright-links a:hover {
    color: var(--color-primary);
}

[data-theme="dark"] .legal-doc a {
    color: var(--color-primary);
}

[data-theme="dark"] .legal-doc a:hover {
    color: var(--color-primary-hover);
}

[data-theme="dark"] .settings-panel-icon--privacy {
    background: rgba(56, 189, 248, 0.15);
    color: var(--color-primary);
}

[data-theme="dark"] .alert-danger {
    background: #450a0a;
    border-color: #991b1b;
    color: #fecaca;
}

[data-theme="dark"] .alert-success {
    background: #052e16;
    border-color: #166534;
    color: #bbf7d0;
}

[data-theme="dark"] .form-check-label {
    color: var(--color-text);
}

[data-theme="dark"] .form-check-input {
    background-color: #0f172a;
    border-color: var(--color-border);
}

[data-theme="dark"] .form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

[data-theme="dark"] .btn-outline-danger {
    color: #fca5a5;
    border-color: #991b1b;
}

[data-theme="dark"] .btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
    border-color: #dc2626;
}

[data-theme="dark"] .auth-layout-body {
    background-color: var(--color-bg);
    background-image:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(56, 189, 248, 0.1), transparent 60%),
        radial-gradient(ellipse 60% 50% at 100% 100%, rgba(245, 158, 11, 0.04), transparent 50%);
}

[data-theme="dark"] .auth-card.card {
    background: var(--color-surface);
    border-color: var(--color-border);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .legal-doc-summary {
    background: var(--color-bg-subtle);
    border-color: var(--color-border);
}

[data-theme="dark"] .legal-doc-num {
    background: rgba(56, 189, 248, 0.15);
    color: var(--color-primary);
}

.mcq-option--correct {
    background: rgba(34, 197, 94, 0.1);
}

.mcq-option--correct .mcq-option-letter {
    color: #15803d;
}

.mcq-option--wrong {
    background: rgba(239, 68, 68, 0.08);
}

.mcq-option--wrong .mcq-option-letter {
    color: #b91c1c;
}

.mcq-option--faded {
    opacity: 0.55;
}

.quiz-score-panel {
    margin-top: 1.5rem;
    padding: 1.35rem 1.5rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--color-border);
    background: var(--color-primary-subtle);
    text-align: center;
}

.quiz-score-panel--perfect {
    border-color: #22c55e;
    background: linear-gradient(135deg, #ecfdf5, #f0f9ff);
}

.quiz-score-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-primary-dark);
    margin-bottom: 0.35rem;
}

.quiz-score-celebration {
    color: #15803d;
    font-weight: 600;
    margin: 0;
}

.definition-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.85rem;
}

.definition-card {
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    background: linear-gradient(145deg, #f0f9ff 0%, #ffffff 100%);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.08);
}

.definition-card-term {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0369a1;
    margin: 0 0 0.45rem;
}

.definition-card-body {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--color-text);
}

.topic-examples-box {
    margin-top: 1.25rem;
    padding: 1rem 1.15rem;
    border-radius: 10px;
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
}

.topic-examples-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.65rem;
    color: #b45309;
}

.topic-examples-list {
    margin: 0;
    padding-left: 1.15rem;
}

.topic-examples-list li {
    margin-bottom: 0.5rem;
    line-height: 1.45;
}

.exam-question {
    font-size: 1.1rem;
    font-weight: 500;
}

.topic-notes-list a {
    color: var(--color-primary-dark);
    font-weight: 600;
}

.topic-notes-list li {
    margin-bottom: 0.5rem;
}

.btn-icon-only {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.btn-settings-access {
    padding-inline: 1rem;
}

/* Leaderboard podium */
.leaderboard-header {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.leaderboard-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.leaderboard-period-tabs {
    flex-shrink: 0;
}

.leaderboard-privacy-note {
    margin: 0;
    padding-top: 0.15rem;
}

.podium-gold td { background: linear-gradient(90deg, #fef9c3, transparent); }
.podium-silver td { background: linear-gradient(90deg, #f1f5f9, transparent); }
.podium-bronze td { background: linear-gradient(90deg, #ffedd5, transparent); }

.podium-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
}

.podium-medal--1 { background: #fbbf24; color: #78350f; }
.podium-medal--2 { background: #cbd5e1; color: #334155; }
.podium-medal--3 { background: #fdba74; color: #7c2d12; }

[data-theme="dark"] .podium-gold td {
    background: linear-gradient(90deg, rgba(234, 179, 8, 0.16), transparent);
    color: var(--color-text);
}

[data-theme="dark"] .podium-silver td {
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.14), transparent);
    color: var(--color-text);
}

[data-theme="dark"] .podium-bronze td {
    background: linear-gradient(90deg, rgba(234, 88, 12, 0.14), transparent);
    color: var(--color-text);
}

[data-theme="dark"] .podium-medal--1 {
    background: linear-gradient(145deg, #fde047, #eab308);
    color: #422006;
    box-shadow: 0 0 0 1px rgba(253, 224, 71, 0.35);
}

[data-theme="dark"] .podium-medal--2 {
    background: linear-gradient(145deg, #e2e8f0, #94a3b8);
    color: #0f172a;
    box-shadow: 0 0 0 1px rgba(226, 232, 240, 0.25);
}

[data-theme="dark"] .podium-medal--3 {
    background: linear-gradient(145deg, #fdba74, #ea580c);
    color: #431407;
    box-shadow: 0 0 0 1px rgba(253, 186, 116, 0.3);
}

.you-badge {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: var(--color-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
}

.leaderboard-you td {
    border-left: 3px solid var(--color-primary-dark);
}

/* Calculator list/detail */
.calc-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.calc-list-card {
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
}

.calc-list-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--color-primary-dark);
}

.calc-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--color-primary-dark);
    text-decoration: none;
    font-weight: 600;
}

.calc-formula-banner {
    background: #f0f9ff;
    border-left: 4px solid var(--color-primary-dark);
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
}

.calc-input-box {
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
}

.calc-live-result {
    background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
    border: 2px solid #bae6fd;
    border-radius: 12px;
    padding: 1.5rem;
    min-height: 160px;
}

.calc-live-result h3 {
    color: var(--color-primary-dark);
    font-size: 1.75rem;
}

/* Practice */
.practice-mode-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.calc-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1040;
}

.calc-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1050;
    width: min(480px, 92vw);
    box-shadow: var(--shadow-md);
}

.mark-scheme-list li {
    margin-bottom: 0.35rem;
}

.practice-answer-input {
    min-height: 120px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.practice-mark-result {
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    border: 1px solid var(--color-border);
    background: #f8fafc;
}

.practice-mark-result--full {
    border-color: #86efac;
    background: #f0fdf4;
}

.practice-mark-result--partial {
    border-color: #bae6fd;
    background: #f0f9ff;
}

.practice-mark-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: var(--color-primary-dark);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

.practice-mark-breakdown {
    list-style: none;
    padding: 0;
    margin: 0;
}

.practice-mark-line {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--color-border);
    line-height: 1.45;
}

.practice-mark-line:last-child {
    border-bottom: none;
}

.practice-mark-line--awarded strong {
    color: #15803d;
}

.practice-mark-line--partial strong {
    color: #b45309;
}

.practice-mark-feedback {
    display: block;
    color: var(--color-muted);
    font-size: 0.88rem;
    margin-top: 0.15rem;
}

.practice-mark-scheme-toggle {
    cursor: pointer;
    color: var(--color-primary-dark);
    font-weight: 600;
    font-size: 0.9rem;
}

.practice-xp-message {
    margin: 0.75rem 0 0;
    font-size: 0.92rem;
    color: #64748b;
}

.practice-xp-message--earned {
    color: #047857;
    font-weight: 600;
}

.practice-xp-message--muted {
    color: var(--color-muted);
    font-weight: 500;
}

.flashcard-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1rem;
}

.flashcard-xp-message {
    font-size: 0.88rem;
    color: #64748b;
}

.flashcard-xp-message--earned {
    color: #047857;
    font-weight: 600;
}

.flashcard-xp-message--penalty {
    color: #dc2626;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.settings-card {
    max-width: 40rem;
}

.settings-page {
    max-width: 920px;
    margin: 0 auto;
}

.settings-page-header {
    margin-bottom: 1.25rem;
}

.settings-page-header h2 {
    margin-bottom: 0.35rem;
}

.settings-page-alert {
    margin-bottom: 1rem;
}

.settings-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.settings-panel.card {
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.settings-panel .card-body,
.settings-panel {
    padding: 1.35rem 1.5rem;
}

.settings-panel-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.settings-panel-head h3 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.settings-panel-head p {
    font-size: 0.875rem;
}

.settings-panel-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.settings-panel-icon--profile {
    background: var(--color-primary-subtle);
    color: var(--color-primary-dark);
}

.settings-panel-icon--security {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.settings-panel-icon--privacy {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}

.settings-prefs-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-muted);
    margin: 0 0 0.75rem;
}

.settings-account {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.settings-prefs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.85rem;
}

.settings-pref-card {
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.settings-pref-card:hover {
    border-color: rgba(14, 165, 233, 0.35);
    box-shadow: var(--shadow-md);
}

.settings-pref-card-body {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.85rem;
    align-items: start;
    padding: 1rem 1.1rem;
}

.settings-pref-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.settings-pref-icon--ghost { background: #f3e8ff; color: #7c3aed; }
.settings-pref-icon--dark { background: #1e293b; color: #e2e8f0; }
.settings-pref-icon--privacy { background: #fef3c7; color: #b45309; }
.settings-pref-icon--stats { background: #dcfce7; color: #15803d; }

.settings-pref-copy h4 {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
    font-weight: 700;
}

.settings-pref-copy p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--color-muted);
}

.settings-toggle--card {
    margin-top: 0.15rem;
}

.settings-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.settings-section:first-of-type {
    margin-top: 1rem;
    padding-top: 0;
    border-top: none;
}

.settings-profile-form {
    max-width: 42rem;
}

.progress-stats-panel {
    padding: 1rem 1.1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg-subtle);
}

.progress-stats-list {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
}

.progress-stats-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
}

.progress-stats-list li:last-child {
    border-bottom: none;
}

.progress-stats-total {
    font-size: 0.9rem;
}

[data-theme="dark"] .progress-stats-panel {
    background: var(--color-surface);
}

[data-theme="dark"] .settings-pref-icon--ghost { background: rgba(124, 58, 237, 0.2); color: #c4b5fd; }
[data-theme="dark"] .settings-pref-icon--dark { background: #334155; color: #e2e8f0; }
[data-theme="dark"] .settings-pref-icon--privacy { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
[data-theme="dark"] .settings-pref-icon--stats { background: rgba(34, 197, 94, 0.15); color: #86efac; }
[data-theme="dark"] .settings-panel-icon--security { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }

.settings-description {
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.settings-toggle-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.settings-toggle {
    position: relative;
    display: inline-block;
    width: 3rem;
    height: 1.6rem;
    flex-shrink: 0;
}

.settings-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.settings-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--color-border-strong);
    border-radius: var(--radius-pill);
    transition: background var(--transition);
}

.settings-toggle-slider::before {
    content: "";
    position: absolute;
    height: 1.2rem;
    width: 1.2rem;
    left: 0.2rem;
    bottom: 0.2rem;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition);
    box-shadow: var(--shadow-sm);
}

.settings-toggle input:checked + .settings-toggle-slider {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary-hover));
}

.settings-toggle input:checked + .settings-toggle-slider::before {
    transform: translateX(1.35rem);
}

.settings-toggle-label {
    font-weight: 600;
}

.settings-status {
    margin-top: 0.75rem;
    font-size: 0.92rem;
}

.settings-status--ghost {
    color: #6366f1;
}

.settings-status--warning {
    color: #b45309;
}

.practice-ghost-prompt {
    font-size: 0.92rem;
    color: #64748b;
    margin-bottom: 0;
}

.practice-ghost-prompt a {
    font-weight: 600;
}

.practice-login-gate {
    padding: 1rem;
    border-radius: 0.5rem;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
}

.topic-sublist-item {
    padding: 0.5rem 0 !important;
}

/* Home polish */
.home-hero {
    background: linear-gradient(160deg, #bae6fd 0%, #e0f2fe 40%, #ffffff 100%);
}

.home-features .feature-card {
    border: 1px solid #bae6fd;
    background: linear-gradient(180deg, #ffffff, #f0f9ff);
}

#blazor-error-ui {
    background: #fef2f2;
    color: #0f172a;
}

#components-reconnect-modal,
#components-reconnect-overlay,
.components-reconnect-overlay,
.components-reconnect-hide {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
    background: transparent !important;
}

body.components-reconnect-show #components-reconnect-overlay,
body.components-reconnect-show .components-reconnect-overlay {
    display: none !important;
    pointer-events: none !important;
}

/* Nav icon alignment */
.nav-item-icon {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-item-icon .nav-icon-svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Topic notes structured layout */
.topic-notes-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.topic-notes-title {
    text-decoration: underline;
    margin-bottom: 0.25rem;
}

.topic-notes-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

.topic-notes-section h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--color-primary-dark);
}

.topic-notes-section--tips {
    background: #f0f9ff;
    border-color: #bae6fd;
}

.topic-definitions-list {
    list-style: disc;
    padding-left: 1.25rem;
    margin: 0;
}

.topic-definitions-list li {
    margin-bottom: 0.45rem;
}

.topic-notes-section p {
    margin-bottom: 0.65rem;
    line-height: 1.55;
}

/* Flashcard deck */
.flashcard-deck {
    text-align: center;
}

.flashcard-deck-number {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--color-primary-dark);
    color: white;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.flashcard-deck-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
}

.flashcard-nav-btn {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 2px solid var(--color-primary-dark);
    background: white;
    color: var(--color-primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s, background 0.2s;
}

.flashcard-nav-btn:hover:not(:disabled) {
    background: #f0f9ff;
}

.flashcard-nav-btn--disabled,
.flashcard-nav-btn:disabled {
    opacity: 0.2;
    cursor: default;
}

.flashcard-scene--single {
    flex: 1;
    max-width: min(920px, 100%);
    min-width: 280px;
}

.flashcard-scene--single .flashcard-inner {
    height: min(420px, 55vh);
    min-height: 280px;
}

.flashcard-scene--single .flashcard-face {
    font-size: clamp(1.05rem, 2.2vw, 1.35rem);
    padding: 2rem 2.25rem;
}

.flashcard-deck-counter {
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

/* Home page polish */
.home-welcome-badge {
    display: inline-block;
    padding: 0.4rem 0.95rem;
    border-radius: var(--radius-pill);
    background: var(--color-primary-subtle);
    color: var(--color-primary-hover);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 0.65rem;
}

.home-tagline {
    color: var(--color-muted);
    font-size: clamp(0.9rem, 1.8vw, 1.05rem);
    max-width: min(640px, 100%);
    margin: 0 auto;
    line-height: 1.55;
    padding: 0 0.25rem;
    font-weight: 500;
}

/* UK economy */
.country-select-lg {
    min-width: 160px;
    font-weight: 600;
    border-width: 2px;
    border-color: var(--color-primary-dark);
}

.case-study-detail {
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

/* Diagrams */
.diagrams-page {
    position: relative;
}

.voranomics-secret-btn {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--color-muted);
    text-decoration: none;
    background: white;
    opacity: 0.45;
    z-index: 5;
}

.voranomics-secret-btn:hover {
    opacity: 1;
    color: var(--color-primary-dark);
}

.diagram-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 720px;
}

.diagram-list-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--color-bg);
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-align: left;
    color: var(--color-text);
}

.diagram-list-body {
    padding: 0 1.25rem 1rem;
}

.econ-diagram-svg {
    width: 100%;
    max-width: 520px;
    display: block;
    margin: 0 auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.voranomics-standalone {
    min-height: 100vh;
    background: #052e16;
}

.voranomics-page {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.voranomics-matrix-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, #052e16 0%, #14532d 35%, #166534 65%, #052e16 100%);
    opacity: 1;
}

.voranomics-content {
    position: relative;
    z-index: 1;
    padding: 2.5rem 2rem;
    text-align: center;
    color: #bbf7d0;
    font-family: "Courier New", monospace;
}

.voranomics-content h1 {
    color: #4ade80;
    text-shadow: 0 0 12px rgba(74, 222, 128, 0.5);
    font-size: 1.75rem;
}

.voranomics-sub {
    color: #86efac;
    margin-bottom: 1.5rem;
}

.voranomics-fun-btn {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 20;
    font-size: 0.7rem;
    font-family: "Courier New", monospace;
    color: rgba(134, 239, 172, 0.25);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.voranomics-fun-btn:hover {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.4);
    background: rgba(0, 0, 0, 0.25);
}

/* Voranomics game */
.voranomics-game-shell .voranomics-game-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: min(88vh, 920px);
    max-width: min(96vw, 1480px);
    width: 100%;
    margin: 0 auto;
    padding: 1rem 1.25rem 2rem;
    text-align: center;
}

.voranomics-canvas-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
    position: relative;
}

.voranomics-canvas-wrap--speedrun {
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
}

.voranomics-canvas-wrap--speedrun .voranomics-game-canvas {
    flex: 1;
    max-width: calc(100% - 220px);
}

.voranomics-campaign-map-shell {
    position: relative;
    width: min(96vw, 960px);
    margin: 0 auto;
}

.voranomics-campaign-map-shell--speedrun {
    width: min(98vw, 1100px);
    padding-right: 230px;
}

.voranomics-speedrun-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 210px;
    min-height: 100%;
    display: none;
    flex-direction: column;
    background: rgba(28, 28, 30, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: #f4f4f5;
    z-index: 6;
    overflow: hidden;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.35);
}

.voranomics-speedrun-head {
    padding: 0.65rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: #a1a1aa;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.voranomics-speedrun-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.35rem 0;
}

.voranomics-speedrun-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.42rem 0.75rem;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.voranomics-speedrun-row--current {
    background: rgba(59, 130, 246, 0.35);
}

.voranomics-speedrun-row--done .voranomics-speedrun-split {
    color: #e4e4e7;
}

.voranomics-speedrun-name {
    text-align: left;
    line-height: 1.2;
    flex: 1;
    font-size: 0.78rem;
}

.voranomics-speedrun-split {
    font-variant-numeric: tabular-nums;
    color: #a1a1aa;
    flex-shrink: 0;
}

.voranomics-speedrun-footer {
    padding: 0.65rem 0.75rem 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: right;
}

.voranomics-speedrun-live-label {
    display: block;
    font-size: 0.7rem;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.15rem;
}

.voranomics-speedrun-live {
    font-size: 1.85rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #4ade80;
    line-height: 1;
}

.voranomics-speedrun-live--armed {
    color: #4ade80;
}

.voranomics-mode-card--speedrun {
    border-color: #fbbf24;
    background: rgba(120, 53, 15, 0.25);
}

.voranomics-mode-card--speedrun strong {
    color: #fde68a;
}

.voranomics-game-canvas {
    display: block;
    width: 100%;
    max-width: min(96vw, 1400px);
    border: 2px solid #22c55e;
    border-radius: 12px;
    background: #052e16;
    box-shadow: 0 0 40px rgba(34, 197, 94, 0.2), inset 0 0 60px rgba(0, 0, 0, 0.25);
    outline: none;
    cursor: crosshair;
}

.voranomics-game-canvas:focus {
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.45), 0 0 40px rgba(34, 197, 94, 0.25);
}

.game-hint {
    text-align: center;
    font-size: 0.85rem;
    margin-top: 0.65rem;
    opacity: 0.85;
}

.game-touch-controls {
    display: none;
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    gap: 0.65rem;
    z-index: 5;
    pointer-events: auto;
    touch-action: manipulation;
}

@media (max-width: 900px), (pointer: coarse) {
    .game-touch-controls {
        display: flex;
        align-items: flex-end;
    }
}

.game-touch-btn {
    width: 3.25rem;
    height: 3.25rem;
    border: 2px solid #4ade80;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.55);
    color: #4ade80;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.1s, transform 0.1s;
}

.game-touch-btn--jump {
    width: 3.75rem;
    height: 3.75rem;
    margin-bottom: 0.5rem;
    border-color: #fbbf24;
    color: #fbbf24;
}

.game-touch-btn:active {
    background: rgba(34, 197, 94, 0.35);
    transform: scale(0.94);
}

.game-touch-btn--jump:active {
    background: rgba(251, 191, 36, 0.3);
}

.fighter-select-card--opponent:hover {
    border-color: #fbbf24;
}

.character-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.85rem;
    margin: 1.25rem 0;
}

.difficulty-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.35rem;
}

.difficulty-badge--easy { background: #dcfce7; color: #166534; }
.difficulty-badge--medium { background: #fef9c3; color: #854d0e; }
.difficulty-badge--hard { background: #fee2e2; color: #991b1b; }
.difficulty-badge--impossible { background: #1e1b4b; color: #fca5a5; border: 1px solid #fca5a5; }
.fighter-select-row,
.difficulty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.fighter-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 900px;
    margin: 1rem auto;
}

.game-result-panel {
    padding: clamp(1.5rem, 4vw, 2.75rem);
    border-radius: 16px;
    border: 2px solid #22c55e;
    background: rgba(0, 0, 0, 0.55);
    width: min(96vw, 880px);
    min-height: min(72vh, 640px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.campaign-boss-grid--compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: 640px;
}

.campaign-boss-card--current {
    border-color: #38bdf8;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

.campaign-boss-card--failed {
    opacity: 0.85;
    border-color: #ef4444;
}
.fighter-select-card,
.difficulty-card {
    background: rgba(0, 0, 0, 0.35);
    border: 2px solid #22c55e;
    border-radius: 12px;
    padding: 1.25rem;
    color: #bbf7d0;
    cursor: pointer;
    text-align: center;
    transition: transform 0.15s, box-shadow 0.15s;
    font-family: "Courier New", monospace;
}

.fighter-select-card:hover,
.difficulty-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.25);
    background: rgba(20, 83, 45, 0.5);
}

.fighter-select-card strong,
.difficulty-card strong {
    display: block;
    color: #4ade80;
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
}

.fighter-select-card .small,
.difficulty-card .small {
    color: #86efac;
    display: block;
}

.fighter-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    border: 2px solid #4ade80;
    position: relative;
}

.fighter-avatar--marx {
    background: linear-gradient(180deg, #9ca3af 28%, #fcd9b6 29%);
}

.fighter-avatar--marx::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 10px;
    right: 10px;
    height: 32px;
    background: #6b7280;
    border-radius: 50% 50% 0 0;
}

.fighter-avatar--marx::after {
    content: "";
    position: absolute;
    bottom: 14px;
    left: 22px;
    right: 22px;
    height: 22px;
    background: #d1d5db;
    border-radius: 0 0 50% 50%;
}

.fighter-avatar--smith {
    background: linear-gradient(180deg, #e2e8f0 30%, #fcd9b6 31%);
}

.fighter-avatar--smith::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 10px;
    right: 10px;
    height: 24px;
    background: #e2e8f0;
    border-radius: 40%;
}

.fighter-avatar--stresemann { background: linear-gradient(180deg, #57534e 35%, #fcd9b6 36%); }
.fighter-avatar--sanders { background: linear-gradient(180deg, #f8fafc 35%, #fcd9b6 36%); }
.fighter-avatar--keynes { background: linear-gradient(180deg, #475569 35%, #fcd9b6 36%); }
.fighter-avatar--trump { background: linear-gradient(180deg, #fde047 35%, #fdba74 36%); }
.fighter-avatar--castro { background: linear-gradient(180deg, #14532d 35%, #fcd9b6 36%); }
.fighter-avatar--che { background: linear-gradient(180deg, #1e293b 35%, #fcd9b6 36%); }
.fighter-avatar--reagan { background: linear-gradient(180deg, #1e3a8a 35%, #fcd9b6 36%); }
.fighter-avatar--thatcher { background: linear-gradient(180deg, #fde68a 35%, #fcd9b6 36%); }

.game-result-panel--win h1 {
    color: #4ade80;
}

.game-result-panel--lose h1 {
    color: #f87171;
}

.game-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.25rem;
}

.voranomics-action-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid #22c55e;
    border-radius: 8px;
    background: rgba(20, 83, 45, 0.6);
    color: #bbf7d0;
    text-decoration: none;
    font-family: "Courier New", monospace;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
}

.voranomics-action-btn:hover {
    background: rgba(34, 197, 94, 0.35);
    color: #4ade80;
}

.voranomics-link-btn {
    color: #86efac !important;
    font-family: "Courier New", monospace;
}

.voranomics-chart-panel {
    max-width: 640px;
    margin: 0 auto 1.5rem;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid #22c55e;
    border-radius: 8px;
    text-align: left;
}

.voranomics-slider-label {
    display: block;
    color: #86efac;
    font-family: "Courier New", monospace;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.voranomics-range {
    width: 100%;
    margin-bottom: 1rem;
    accent-color: #4ade80;
}

.voranomics-chart-panel .highcharts-container {
    background: transparent;
}

.voranomics-back {
    color: #4ade80;
    text-decoration: none;
    font-weight: 600;
}

.voranomics-back:hover {
    color: #bbf7d0;
}

/* Mini calculator panel */
.mini-calc-panel {
    border-top: 1px solid var(--color-border);
    padding-top: 0.75rem;
}

.mini-calc-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* Modal backdrop fix */
.calc-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1040;
    pointer-events: auto;
}

body:not(:has(.calc-modal)) .calc-modal-backdrop {
    display: none !important;
}

/* Global UI polish */
.btn {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1.1rem;
    min-height: var(--btn-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
    border-width: 1.5px;
}

.btn-sm {
    min-height: var(--btn-height-sm);
    padding: 0.35rem 0.85rem;
    font-size: 0.8125rem;
    border-radius: 8px;
}

.btn-lg {
    min-height: var(--btn-height-lg);
    padding: 0.65rem 1.45rem;
    font-size: 0.9375rem;
}

.btn-group .btn,
.btn-group-sm .btn {
    min-height: var(--btn-height-sm);
}

.btn-group .btn:first-child {
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
}

.btn-group .btn:last-child {
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}

.form-control,
.form-select {
    font-family: var(--font-sans);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-primary-dark);
    box-shadow: 0 0 0 3px var(--color-primary-subtle);
}

.table {
    --bs-table-bg: transparent;
    font-size: 0.9rem;
}

.table thead th {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-muted);
    border-bottom-width: 1.5px;
    padding-bottom: 0.75rem;
}

.table tbody td {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: var(--color-primary-subtle);
}

.progress {
    background: var(--color-bg-subtle);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-bar {
    border-radius: var(--radius-pill);
}

.progress-bar.bg-sky,
.bg-sky {
    background: linear-gradient(90deg, var(--color-primary-dark), var(--color-primary)) !important;
}

.filter-tray {
    background: var(--color-surface);
    border-color: var(--color-border);
    box-shadow: var(--shadow-sm);
}

.topic-section-header {
    font-weight: 600;
    transition: background var(--transition);
}

.topic-section-header:hover {
    background: var(--color-primary-subtle);
}

.definition-card {
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.definition-card:hover {
    border-color: rgba(14, 165, 233, 0.35);
    box-shadow: var(--shadow-sm);
}

.calc-result,
.calc-formula-banner {
    background: var(--color-primary-subtle);
    border-color: rgba(14, 165, 233, 0.25);
    border-radius: var(--radius-sm);
}

.calc-live-result {
    background: linear-gradient(135deg, var(--color-primary-subtle), var(--color-bg));
    border: 1.5px solid rgba(14, 165, 233, 0.25);
    border-radius: var(--radius);
}

.calc-input-box {
    background: var(--color-bg);
    border-radius: var(--radius-sm);
}

/* Dark mode */
[data-theme="dark"] {
    --color-primary: #56ccf8;
    --color-primary-dark: #38bdf8;
    --color-primary-hover: #7dd3fc;
    --color-primary-subtle: rgba(56, 189, 248, 0.14);
    --color-primary-glow: rgba(56, 189, 248, 0.35);
    --color-bg: #0a0f18;
    --color-bg-subtle: #111827;
    --color-surface: #151d2e;
    --color-surface-elevated: #1c2739;
    --color-border: #2a3548;
    --color-border-strong: #3d4d66;
    --color-text: #eef2f7;
    --color-muted: #8b9cb3;
    --text-muted: var(--color-muted);
    --border-subtle: rgba(148, 163, 184, 0.15);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 0 0 1px rgba(56, 189, 248, 0.12), 0 8px 32px rgba(56, 189, 248, 0.15);
    --glass-bg: rgba(21, 29, 46, 0.88);
    --glass-border: rgba(255, 255, 255, 0.06);
    color-scheme: dark;
}

[data-theme="dark"] body {
    background-image:
        radial-gradient(ellipse 90% 70% at 100% -15%, rgba(56, 189, 248, 0.08), transparent 55%),
        radial-gradient(ellipse 70% 50% at -5% 105%, rgba(245, 158, 11, 0.04), transparent 50%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(21, 29, 46, 0.4), transparent 70%);
}

[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg) 100%);
    border-right-color: var(--color-border);
}

[data-theme="dark"] .nav-item:hover {
    background: var(--color-primary-subtle);
    color: var(--color-primary);
}

[data-theme="dark"] .nav-item.active {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary-hover));
    color: #0a0f18;
    box-shadow: 0 3px 14px var(--color-primary-glow);
}

[data-theme="dark"] .top-bar {
    border-bottom-color: var(--color-border);
}

[data-theme="dark"] .btn-primary {
    color: #0a0f18;
    box-shadow: 0 2px 12px var(--color-primary-glow);
}

[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-primary:focus {
    color: #0a0f18;
}

[data-theme="dark"] .card:hover {
    border-color: var(--color-border-strong);
}

[data-theme="dark"] .card,
[data-theme="dark"] .login-gate,
[data-theme="dark"] .calc-modal {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
}

[data-theme="dark"] .text-muted {
    color: var(--color-muted) !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] textarea.form-control {
    background: #0f172a;
    color: var(--color-text);
    border-color: var(--color-border);
}

[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] textarea.form-control::placeholder {
    color: var(--color-muted);
    opacity: 1;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] textarea.form-control:focus {
    background: #0f172a;
    color: var(--color-text);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.2);
}

[data-theme="dark"] .btn-outline-primary {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

[data-theme="dark"] .btn-outline-primary:hover {
    background: rgba(56, 189, 248, 0.15);
    color: var(--color-primary);
}

[data-theme="dark"] .btn-outline-secondary {
    color: var(--color-muted);
    border-color: var(--color-border);
}

[data-theme="dark"] .btn-outline-secondary:hover {
    background: #334155;
    color: var(--color-text);
}

[data-theme="dark"] .btn-auth-outline {
    color: var(--color-text);
    border-color: var(--color-border);
    background: transparent;
}

[data-theme="dark"] .home-hero {
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(56, 189, 248, 0.18), transparent 60%),
        linear-gradient(165deg, #0c4a6e 0%, #0f172a 50%, var(--color-surface) 100%);
    border-color: var(--color-border);
}

[data-theme="dark"] .home-features .feature-card {
    background: var(--color-surface);
    border-color: var(--color-border);
}

[data-theme="dark"] .home-features .feature-card:hover {
    border-color: rgba(56, 189, 248, 0.4);
}

[data-theme="dark"] .feature-icon {
    background: var(--color-primary-subtle);
    color: var(--color-primary);
}

[data-theme="dark"] .feature-card h3,
[data-theme="dark"] .topic-notes-title,
[data-theme="dark"] .page-title,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5 {
    color: var(--color-text);
}

[data-theme="dark"] .topic-notes-section,
[data-theme="dark"] .topic-definitions-list li,
[data-theme="dark"] .breadcrumb-item,
[data-theme="dark"] .breadcrumb-item a {
    color: var(--color-text);
}

[data-theme="dark"] .mode-slider {
    background: var(--color-bg-subtle);
    border-color: var(--color-border);
}

[data-theme="dark"] .mode-slider-option {
    color: var(--color-muted);
}

[data-theme="dark"] .mode-slider-option.active {
    color: #0a0f18;
}

[data-theme="dark"] .table-hover tbody tr:hover {
    background: var(--color-primary-subtle);
}

[data-theme="dark"] .flashcard-face {
    background: #1e293b;
    border-color: #475569;
    color: var(--color-text);
}

[data-theme="dark"] .flashcard-back {
    background: #0f172a;
}

[data-theme="dark"] .practice-mark-result {
    background: #0f172a;
    border-color: var(--color-border);
}

[data-theme="dark"] .practice-mark-result--full {
    border-color: #047857;
}

[data-theme="dark"] .practice-mark-result--partial {
    border-color: #b45309;
}

[data-theme="dark"] .practice-login-gate {
    background: #0f172a;
    border-color: var(--color-border);
}

[data-theme="dark"] .progress-stat {
    background: #0f172a;
    border-color: var(--color-border);
}

[data-theme="dark"] .table {
    --bs-table-bg: var(--color-surface);
    --bs-table-color: var(--color-text);
    --bs-table-border-color: var(--color-border);
}

[data-theme="dark"] .alert-warning {
    background: #422006;
    border-color: #b45309;
    color: #fde68a;
}

[data-theme="dark"] .settings-toggle-slider {
    background: var(--color-border-strong);
}

[data-theme="dark"] .settings-toggle input:checked + .settings-toggle-slider {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary-hover));
}

[data-theme="dark"] .filter-tray,
[data-theme="dark"] .content-area {
    background: var(--color-bg);
}

[data-theme="dark"] #blazor-error-ui {
    background: #450a0a;
    color: #fecaca;
}

[data-theme="dark"] .mcq-block {
    border-color: var(--color-border);
}

[data-theme="dark"] .mcq-options-stack {
    background: var(--color-surface);
    border-color: var(--color-border);
}

[data-theme="dark"] .mcq-option:hover:not(:disabled) {
    background: rgba(14, 165, 233, 0.12);
}

[data-theme="dark"] .definition-card {
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
    border-color: #334155;
}

[data-theme="dark"] .definition-card-term {
    color: #7dd3fc;
}

[data-theme="dark"] .topic-examples-box {
    background: #422006;
    border-left-color: #f59e0b;
}

[data-theme="dark"] .quiz-score-panel {
    background: #0f172a;
    border-color: var(--color-border);
}

.badge-toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-width: min(360px, calc(100vw - 2rem));
    pointer-events: none;
}

.badge-toast {
    pointer-events: auto;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.55);
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #f8fafc;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    animation: badge-toast-in 0.35s ease-out;
}

@keyframes badge-toast-in {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}

.badge-toast-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.badge-toast-label {
    margin: 0;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.badge-toast-name {
    margin: 0.1rem 0 0;
    font-weight: 700;
    font-size: 0.95rem;
    color: #fbbf24;
}

.badge-toast-desc {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    line-height: 1.35;
    color: #cbd5e1;
}

.badge-toast-close {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.85rem;
}

/* Achievements — collapsed teaser + category list layout */
.achievements-teaser {
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}

.achievements-teaser-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.achievements-teaser-icon {
    color: #d97706;
    margin-right: 0.35rem;
}

.achievements-teaser-count {
    font-size: 0.82rem;
    color: var(--color-muted);
    font-weight: 500;
}

.achievements-teaser-bar {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 999px;
}

.achievements-teaser-fill {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    border-radius: 999px;
}

.achievements-panel-row {
    animation: achievements-panel-in 0.25s ease-out;
}

@keyframes achievements-panel-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.achievements-panel {
    border: 1px solid var(--color-border);
}

.achievements-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--color-border);
}

.achievements-close {
    color: var(--color-muted);
    padding: 0.25rem 0.5rem;
}

.achievements-category {
    margin-bottom: 1.35rem;
}

.achievements-category:last-child {
    margin-bottom: 0;
}

.achievements-category-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.achievements-category-head h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-muted);
}

.achievements-category-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: #b45309;
    background: rgba(251, 191, 36, 0.15);
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
}

.achievements-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
}

.achievement-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.85rem 1rem;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface, #fff);
}

.achievement-row:last-child {
    border-bottom: none;
}

.achievement-row--locked {
    opacity: 0.78;
}

.achievement-row--unlocked {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.08), transparent 55%);
}

.achievement-medallion {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(14, 165, 233, 0.12);
    color: var(--color-primary-dark);
    font-weight: 700;
    font-size: 1rem;
    border: 2px solid rgba(14, 165, 233, 0.2);
}

.achievement-row--unlocked .achievement-medallion {
    background: rgba(251, 191, 36, 0.22);
    color: #b45309;
    border-color: rgba(251, 191, 36, 0.45);
}

.achievement-copy {
    min-width: 0;
}

.achievement-name {
    margin: 0;
    font-weight: 700;
    font-size: 0.92rem;
}

.achievement-desc {
    margin: 0.15rem 0 0;
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--color-muted);
}

.achievement-rarity {
    margin: 0.35rem 0 0;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.achievement-rarity-count {
    font-weight: 500;
    opacity: 0.85;
}

.achievement-rarity--common { color: #64748b; }
.achievement-rarity--uncommon { color: #0369a1; }
.achievement-rarity--rare { color: #7c3aed; }
.achievement-rarity--very-rare { color: #b45309; }
.achievement-rarity--ultra-rare { color: #be123c; }

.achievement-hint {
    margin: 0.35rem 0 0;
    font-size: 0.76rem;
    color: #b45309;
}

.achievement-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    flex-shrink: 0;
}

.achievement-status {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.achievement-status--done {
    color: #15803d;
}

.achievement-status--locked {
    color: var(--color-muted);
}

.achievement-date {
    font-size: 0.72rem;
    color: var(--color-muted);
}

.achievement-share {
    white-space: nowrap;
}

@media (max-width: 640px) {
    .achievement-row {
        grid-template-columns: auto 1fr;
    }

    .achievement-meta {
        grid-column: 2;
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.badge-card {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1rem;
    background: var(--color-surface, #fff);
    min-height: 160px;
    display: flex;
    flex-direction: column;
}

.badge-card--unlocked {
    border-color: #fbbf24;
    background: linear-gradient(145deg, #fffbeb, #ffffff);
}

.badge-card--locked {
    opacity: 0.82;
}

.badge-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.65rem;
    background: rgba(14, 165, 233, 0.12);
    color: var(--color-primary-dark);
    font-weight: 700;
}

.badge-card--unlocked .badge-card-icon {
    background: rgba(251, 191, 36, 0.25);
    color: #b45309;
}

.badge-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.badge-card-desc {
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
    flex: 1;
    color: var(--color-muted);
}

.badge-card-hint {
    font-size: 0.78rem;
    color: #b45309;
    margin: 0.5rem 0 0;
}

.badge-share-btn {
    margin-top: 0.65rem;
    align-self: flex-start;
}

.badge-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.badge-share-message {
    font-size: 0.875rem;
    color: #15803d;
    margin-bottom: 0.75rem;
}

[data-theme="dark"] .achievement-row {
    background: #1e293b;
}

[data-theme="dark"] .achievement-row--unlocked {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.12), #1e293b 55%);
}

[data-theme="dark"] .badge-card {
    background: #1e293b;
}

[data-theme="dark"] .badge-card--unlocked {
    background: linear-gradient(145deg, #422006, #1e293b);
    border-color: #fbbf24;
}

[data-theme="dark"] .accordion-item {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
}

[data-theme="dark"] .accordion-button {
    background: var(--color-surface);
    color: var(--color-text);
}

[data-theme="dark"] .accordion-button:not(.collapsed) {
    background: #0f172a;
    color: var(--color-text);
}

[data-theme="dark"] .accordion-body {
    background: var(--color-surface);
    color: var(--color-text);
}

/* Theme 1 / Theme 2 revision */
[data-theme="dark"] .theme-page-card,
[data-theme="dark"] .theme-page-card .card-body {
    background: var(--color-surface);
    color: var(--color-text);
}

[data-theme="dark"] .topic-section {
    background: var(--color-surface);
    border-color: var(--color-border);
}

[data-theme="dark"] .topic-section.card {
    background: var(--color-surface);
}

[data-theme="dark"] .topic-section-header {
    background: #0f172a;
    color: #f8fafc;
}

[data-theme="dark"] .topic-section-header:hover {
    background: #1e293b;
}

[data-theme="dark"] .topic-section-title,
[data-theme="dark"] .topic-section-header .topic-code,
[data-theme="dark"] .topic-section-header i {
    color: #f8fafc;
}

[data-theme="dark"] .topic-sublist {
    background: var(--color-surface);
}

[data-theme="dark"] .topic-sublist li,
[data-theme="dark"] .topic-link,
[data-theme="dark"] .topic-link span {
    color: #f1f5f9;
    border-color: var(--color-border);
}

[data-theme="dark"] .topic-link:hover {
    color: var(--color-primary);
}

[data-theme="dark"] .topic-code {
    color: var(--color-primary);
}

[data-theme="dark"] .topic-notes-section {
    background: #1e293b;
    border-color: var(--color-border);
}

[data-theme="dark"] .topic-notes-section--tips {
    background: #0c4a6e;
    border-color: #0369a1;
}

[data-theme="dark"] .topic-notes-section h3 {
    color: var(--color-primary);
}

[data-theme="dark"] .topic-notes-section p,
[data-theme="dark"] .topic-notes-section li,
[data-theme="dark"] .topic-notes-section strong,
[data-theme="dark"] .topic-definitions-list li {
    color: #f1f5f9;
}

[data-theme="dark"] .diagram-list-item {
    background: var(--color-surface);
    border-color: var(--color-border);
}

[data-theme="dark"] .diagram-list-header {
    background: #0f172a;
    color: #f8fafc;
}

[data-theme="dark"] .diagram-list-body {
    color: var(--color-text);
}

[data-theme="dark"] .econ-diagram-svg {
    background: #0f172a;
    border-color: var(--color-border);
}

[data-theme="dark"] .econ-diagram-svg text {
    fill: #f1f5f9 !important;
}

[data-theme="dark"] .econ-diagram-svg line[stroke="#334155"] {
    stroke: #f1f5f9 !important;
}

[data-theme="dark"] .diagram-view-card {
    background: var(--color-surface);
    color: var(--color-text);
}

[data-theme="dark"] .progress {
    background: #334155;
}

[data-theme="dark"] .progress-bar,
[data-theme="dark"] .progress-bar.bg-sky {
    background-color: var(--color-primary) !important;
}

[data-theme="dark"] .progress-value {
    color: var(--color-primary);
}

/* Home page search */
[data-theme="dark"] .home-welcome-badge {
    background: var(--color-primary-subtle);
    color: var(--color-primary);
}

[data-theme="dark"] .home-tagline {
    color: var(--color-muted);
}

[data-theme="dark"] .hero-search-field {
    background: var(--color-bg-subtle);
    border-color: var(--color-border-strong);
}

[data-theme="dark"] .hero-search-field:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-subtle);
}

[data-theme="dark"] .hero-search-icon-wrap {
    color: var(--color-primary);
    background: rgba(56, 189, 248, 0.12);
    border-right-color: var(--color-border);
}

[data-theme="dark"] .hero-search-input {
    background: transparent;
    color: var(--color-text);
}

[data-theme="dark"] .hero-search-input::placeholder {
    color: var(--color-muted);
}

[data-theme="dark"] .hero-search-input:focus {
    background: transparent;
    color: var(--color-text);
}

[data-theme="dark"] .search-suggestions {
    background: var(--color-surface-elevated);
    border-color: var(--color-border);
}

[data-theme="dark"] .search-suggestions a {
    color: var(--color-text);
}

[data-theme="dark"] .search-suggestions a:hover {
    background: var(--color-primary-subtle);
}

[data-theme="dark"] .search-suggestions a small {
    color: var(--color-muted);
}

[data-theme="dark"] .suggestion-type {
    color: var(--color-primary);
}

/* Economics calculators */
[data-theme="dark"] .calc-list-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

[data-theme="dark"] .calc-list-card h3 {
    color: #f1f5f9;
}

[data-theme="dark"] .calc-list-card .calc-formula {
    color: #94a3b8;
    background: transparent;
    border-left-color: var(--color-primary);
}

[data-theme="dark"] .calc-list-card:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .calc-back-link {
    color: var(--color-primary);
}

[data-theme="dark"] .calc-formula-banner {
    background: #0f172a;
    border-left-color: var(--color-primary);
    color: #f1f5f9;
}

[data-theme="dark"] .calc-input-box {
    background: #0f172a;
    border-color: var(--color-border);
    color: #f1f5f9;
}

[data-theme="dark"] .calc-input-box .form-label {
    color: #e2e8f0;
}

[data-theme="dark"] .calc-live-result {
    background: linear-gradient(135deg, #0c4a6e, #0f172a);
    border-color: #0369a1;
    color: #f1f5f9;
}

[data-theme="dark"] .calc-live-result h3 {
    color: #7dd3fc;
}

[data-theme="dark"] .calc-live-result p,
[data-theme="dark"] .calc-live-result strong {
    color: #e2e8f0;
}

[data-theme="dark"] .calc-formula {
    background: #0f172a;
    border-left-color: var(--color-primary);
    color: #e2e8f0;
}

[data-theme="dark"] .calc-result-inline {
    color: #f1f5f9;
}

[data-theme="dark"] .mini-calc-panel .btn-outline-primary {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: transparent;
}

[data-theme="dark"] .mini-calc-panel .btn-outline-primary:hover {
    background: rgba(56, 189, 248, 0.15);
    color: var(--color-primary);
}

[data-theme="dark"] .mini-calc-panel .btn-primary {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: #0f172a;
}

/* UK Economy */
[data-theme="dark"] .case-study-item h4,
[data-theme="dark"] .case-study-item p,
[data-theme="dark"] .case-study-item strong {
    color: var(--color-text);
}

[data-theme="dark"] .case-study-detail {
    color: #cbd5e1;
}

[data-theme="dark"] .essay-use {
    color: #94a3b8;
}

[data-theme="dark"] .highcharts-container .highcharts-background {
    fill: transparent;
}

[data-theme="dark"] .highcharts-container text {
    fill: #e2e8f0 !important;
}

[data-theme="dark"] .highcharts-container .highcharts-grid-line {
    stroke: #334155;
}

[data-theme="dark"] .highcharts-container .highcharts-axis-line,
[data-theme="dark"] .highcharts-container .highcharts-tick {
    stroke: #64748b;
}

/* Practice exam timer & AI notice */
.practice-ai-notice {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid #fcd34d;
    background: #fffbeb;
    color: #78350f;
    font-size: 0.9rem;
    line-height: 1.45;
}

.practice-ai-notice i {
    color: #b45309;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.practice-ai-notice strong {
    color: inherit;
}

[data-theme="dark"] .practice-ai-notice {
    border-color: #ca8a04;
    background: rgba(120, 53, 15, 0.35);
    color: #fef3c7;
}

[data-theme="dark"] .practice-ai-notice i {
    color: #fbbf24;
}

.exam-timer-display {
    font-weight: 700;
    color: var(--color-primary-dark);
    margin-bottom: 0.75rem;
}

[data-theme="dark"] .exam-timer-display {
    color: #7dd3fc;
}

.exam-timer-display--urgent {
    color: #dc2626;
}

[data-theme="dark"] .exam-timer-display--urgent {
    color: #f87171;
}

.exam-rest-break-btn {
    margin-bottom: 0.75rem;
}

.exam-rest-break-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.exam-rest-break-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: #334155;
    text-align: center;
    padding: 2rem;
    max-width: 28rem;
}

.practice-exam-timer-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    cursor: pointer;
    color: var(--color-text);
}

.practice-exam-timer-toggle--field {
    margin-top: 0.35rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface, #fff);
    min-height: 2.375rem;
}

.practice-exam-timer-toggle input {
    width: 1rem;
    height: 1rem;
}

.exam-extra-time-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.exam-extra-time-pill {
    border: 1.5px solid var(--color-border);
    background: var(--color-surface, #fff);
    color: var(--color-text);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.exam-extra-time-pill:hover {
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
}

.exam-extra-time-pill--active {
    background: var(--color-primary-subtle);
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
}

.math-keyboard {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.math-keyboard-key {
    min-width: 2.25rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface, #fff);
    font-weight: 600;
    cursor: pointer;
}

.math-keyboard-key:hover {
    background: var(--color-primary-subtle);
}

/* MCQ quiz header */
.quiz-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.quiz-instant-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
}

.mcq-block--single {
    border-bottom: none;
}

/* Home greeting */
.home-greeting {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin: 0.35rem 0 0.5rem;
}

/* Achievement tiers */
.achievement-tier--bronze.achievement-medallion,
.achievement-medallion.achievement-tier--bronze {
    background: rgba(180, 83, 9, 0.15);
    border-color: rgba(180, 83, 9, 0.35);
    color: #92400e;
}

.achievement-tier--silver.achievement-medallion,
.achievement-medallion.achievement-tier--silver {
    background: rgba(100, 116, 139, 0.18);
    border-color: rgba(100, 116, 139, 0.4);
    color: #475569;
}

.achievement-tier--gold.achievement-medallion,
.achievement-medallion.achievement-tier--gold {
    background: rgba(251, 191, 36, 0.28);
    border-color: rgba(251, 191, 36, 0.55);
    color: #b45309;
}

.achievement-tier--platinum.achievement-medallion,
.achievement-medallion.achievement-tier--platinum {
    background: linear-gradient(135deg, #e0e7ff, #fae8ff);
    border-color: #a78bfa;
    color: #6d28d9;
}

.achievement-row--unlocked .achievement-medallion.achievement-tier--platinum {
    box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.35);
}

.achievement-tier-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
}

.achievement-tier-label--bronze { color: #92400e; background: #fff7ed; }
.achievement-tier-label--silver { color: #475569; background: #f8fafc; }
.achievement-tier-label--gold { color: #b45309; background: #fffbeb; }
.achievement-tier-label--platinum { color: #6d28d9; background: #f5f3ff; }

.settings-pref-icon--timer {
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
}

.settings-pref-icon--mcq {
    background: rgba(99, 102, 241, 0.12);
    color: #4f46e5;
}

.settings-pref-card-body--stacked {
    flex-direction: column;
    align-items: stretch;
}

.settings-pref-copy--wide {
    flex: 1;
    min-width: 0;
}

.settings-pref-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.15rem;
}

.settings-pref-head-row h4 {
    margin: 0;
}

.settings-toggle--compact {
    flex-shrink: 0;
}

.settings-sub-pref {
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}

.settings-sub-pref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin: 0;
}

.settings-sub-pref-row input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* Voranomics campaign */
.voranomics-mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}

.voranomics-mode-grid--hero {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

.voranomics-mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1.25rem;
    border: 2px solid rgba(134, 239, 172, 0.35);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.55);
    color: #ecfdf5;
    cursor: pointer;
    text-align: center;
}

.voranomics-mode-card--hero {
    min-height: 9.5rem;
    justify-content: center;
    padding: 2rem 1.5rem;
    font-size: 1.05rem;
}

.voranomics-mode-card--hero strong {
    font-size: 1.35rem;
}

.voranomics-mode-card i {
    font-size: 1.75rem;
    color: #86efac;
}

.voranomics-mode-card--hero i {
    font-size: 2.25rem;
}

.voranomics-mode-card--campaign {
    border-color: rgba(251, 191, 36, 0.45);
}

.voranomics-campaign-progress {
    text-align: center;
    color: #86efac;
    font-weight: 600;
}

.voranomics-campaign-leaderboard {
    margin: 1.5rem 0 1rem;
    padding: 1rem 1.1rem;
    border-radius: 12px;
    border: 1px solid rgba(134, 239, 172, 0.25);
    background: rgba(15, 23, 42, 0.45);
}

.voranomics-lb-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.voranomics-lb-row {
    display: grid;
    grid-template-columns: 2rem 1fr auto;
    gap: 0.65rem;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(134, 239, 172, 0.12);
    color: #ecfdf5;
    font-size: 0.9rem;
}

.voranomics-lb-row:last-child {
    border-bottom: none;
}

.voranomics-lb-row--you {
    color: #fbbf24;
    font-weight: 700;
}

.voranomics-lb-rank {
    opacity: 0.75;
    font-weight: 700;
}

.voranomics-lb-stars {
    color: #fbbf24;
    font-weight: 700;
}

.campaign-boss-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
    max-width: 720px;
    width: 100%;
}

.campaign-boss-grid--compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: 640px;
}

.campaign-boss-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(134, 239, 172, 0.3);
    background: rgba(15, 23, 42, 0.5);
    color: #ecfdf5;
    cursor: pointer;
}

.campaign-boss-card--locked {
    opacity: 0.45;
    cursor: not-allowed;
}

.grade-predictor-fab {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 40;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.72);
    color: rgba(51, 65, 85, 0.75);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(6px);
    transition: opacity 0.2s, border-color 0.2s;
}

[data-theme="dark"] .grade-predictor-fab {
    background: rgba(15, 23, 42, 0.65);
    color: rgba(226, 232, 240, 0.7);
    border-color: rgba(71, 85, 105, 0.5);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.grade-predictor-fab:hover {
    color: var(--color-text);
    border-color: rgba(148, 163, 184, 0.55);
    opacity: 1;
}

.grade-predictor-shell {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: #030303;
}

.grade-predictor-page {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    background:
        radial-gradient(ellipse 120% 80% at 50% 115%, rgba(69, 10, 10, 0.4), transparent 55%),
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(30, 10, 10, 0.55), transparent 60%),
        linear-gradient(180deg, #050505 0%, #030303 45%, #080404 100%);
    overflow: hidden;
}

.grade-predictor-ambient {
    pointer-events: none;
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 45% 35% at 50% 42%, rgba(251, 191, 36, 0.08), transparent 70%),
        radial-gradient(ellipse 80% 40% at 50% 100%, rgba(127, 29, 29, 0.25), transparent 65%);
    animation: gradeAmbientPulse 8s ease-in-out infinite alternate;
}

.grade-predictor-grain {
    pointer-events: none;
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

@keyframes gradeAmbientPulse {
    from { opacity: 0.75; }
    to { opacity: 1; }
}

.grade-predictor-vignette {
    pointer-events: none;
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, transparent 32%, rgba(0, 0, 0, 0.65) 72%, rgba(0, 0, 0, 0.92) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, transparent 16%, transparent 84%, rgba(0, 0, 0, 0.5) 100%);
    z-index: 1;
}

.grade-predictor-stage {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    background: transparent;
    overflow: hidden;
    z-index: 2;
    isolation: isolate;
}

.grade-predictor-stage::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 8%;
    transform: translateX(-50%);
    width: min(70vw, 520px);
    height: 18px;
    background: radial-gradient(ellipse, rgba(251, 191, 36, 0.18), transparent 70%);
    filter: blur(8px);
    opacity: 0;
    animation: gradeFloorGlow 1.2s ease 12s forwards;
    pointer-events: none;
}

@keyframes gradeFloorGlow {
    to { opacity: 1; }
}

.grade-predictor-intro {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    color: #a8b4c4;
    z-index: 30;
    max-width: none;
    width: 100%;
}

.grade-predictor-intro .grade-predictor-line {
    max-width: 42rem;
}

.grade-predictor-line {
    font-size: clamp(1.05rem, 2.6vw, 1.75rem);
    font-weight: 500;
    font-style: italic;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    margin: 0.85rem 0;
    opacity: 0;
    animation: gradeLineIn 2s ease forwards;
    text-shadow: 0 0 32px rgba(148, 163, 184, 0.2);
    line-height: 1.45;
}

.grade-predictor-line--1 { animation-delay: 0.35s; }
.grade-predictor-line--2 { animation-delay: 0s; }
.grade-predictor-line--3 { animation-delay: 0s; color: #d4c4b0; }

.grade-predictor-skip {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.55rem 1.15rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.45);
    color: rgba(214, 211, 209, 0.85);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s;
    opacity: 0;
    animation: gradeSkipIn 0.8s ease forwards;
}

.grade-predictor-skip:hover {
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.45);
    background: rgba(69, 10, 10, 0.55);
    transform: translateX(-50%) translateY(-1px);
}

@keyframes gradeLineIn {
    from { opacity: 0; transform: translateY(16px); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes gradeSkipIn {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.grade-predictor-curtains {
    position: absolute;
    inset: 0;
    z-index: 25;
    pointer-events: none;
}

.grade-curtain-valance {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 42px;
    z-index: 3;
    background: linear-gradient(180deg, #120303 0%, #450a0a 35%, #7f1d1d 70%, #991b1b 100%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
    border-bottom: 3px solid rgba(251, 191, 36, 0.25);
}

.grade-curtain-valance::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -14px;
    height: 14px;
    background: repeating-linear-gradient(90deg, #7f1d1d 0 18px, #450a0a 18px 36px);
    clip-path: polygon(0 0, 100% 0, 98% 100%, 2% 100%);
}

.grade-curtain {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 51%;
    background:
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.14) 0 5px, transparent 5px 18px),
        repeating-linear-gradient(180deg, transparent 0 36px, rgba(255, 255, 255, 0.025) 36px 38px),
        linear-gradient(180deg, #1a0505 0%, #5c1010 14%, #991b1b 36%, #7f1d1d 55%, #450a0a 78%, #0a0202 100%);
    box-shadow: inset -18px 0 40px rgba(0, 0, 0, 0.6);
    transition: transform 2.2s cubic-bezier(0.42, 0, 0.12, 1);
    z-index: 2;
    overflow: hidden;
    will-change: transform;
}

.grade-curtain--left {
    left: 0;
    transform: translateX(0);
    border-right: 2px solid rgba(0, 0, 0, 0.45);
}

.grade-curtain--right {
    right: 0;
    transform: translateX(0);
    border-left: 2px solid rgba(0, 0, 0, 0.45);
    box-shadow: inset 16px 0 36px rgba(0, 0, 0, 0.55);
}

.grade-curtain-fold {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        102deg,
        transparent 0 14px,
        rgba(255, 255, 255, 0.035) 14px 18px,
        transparent 18px 44px
    );
    opacity: 0.75;
}

.grade-curtain-fold--2 {
    transform: scaleX(-1);
    opacity: 0.4;
    background: repeating-linear-gradient(
        78deg,
        transparent 0 22px,
        rgba(0, 0, 0, 0.08) 22px 26px,
        transparent 26px 52px
    );
}

.grade-curtain-tassel {
    position: absolute;
    bottom: 0;
    width: 12px;
    height: 56px;
    background: linear-gradient(180deg, #7f1d1d, #fbbf24 70%, #fde68a);
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.grade-curtain--left .grade-curtain-tassel { right: 10px; }
.grade-curtain--right .grade-curtain-tassel { left: 10px; }

.grade-predictor-curtains--open .grade-curtain--left { transform: translateX(-102%); }
.grade-predictor-curtains--open .grade-curtain--right { transform: translateX(102%); }

/* Grade-themed curtains & spotlight */
.grade-predictor-stage--astar .grade-curtain-valance {
    background: linear-gradient(180deg, #1a1203 0%, #713f12 35%, #b45309 70%, #d97706 100%);
    border-bottom-color: rgba(253, 224, 71, 0.45);
}

.grade-predictor-stage--astar .grade-curtain {
    background:
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0 5px, transparent 5px 18px),
        linear-gradient(180deg, #1c1003 0%, #78350f 18%, #b45309 40%, #92400e 62%, #451a03 82%, #0a0502 100%);
}

.grade-predictor-stage--astar .grade-predictor-spotlight {
    background:
        radial-gradient(ellipse 48% 42% at 50% 44%, rgba(253, 224, 71, 0.28), transparent 72%),
        radial-gradient(ellipse 80% 60% at 50% 50%, rgba(251, 191, 36, 0.08), transparent 80%);
}

.grade-predictor-stage--a .grade-predictor-spotlight,
.grade-predictor-stage--b .grade-predictor-spotlight {
    background: radial-gradient(ellipse 44% 40% at 50% 46%, rgba(251, 191, 36, 0.2), transparent 72%);
}

.grade-predictor-stage--c .grade-predictor-spotlight,
.grade-predictor-stage--d .grade-predictor-spotlight {
    background: radial-gradient(ellipse 42% 38% at 50% 46%, rgba(245, 158, 11, 0.16), transparent 72%);
}

.grade-predictor-stage--e .grade-curtain-valance,
.grade-predictor-stage--u .grade-curtain-valance {
    background: linear-gradient(180deg, #0a0202 0%, #3f0a0a 40%, #5c1010 75%, #450a0a 100%);
    border-bottom-color: rgba(248, 113, 113, 0.2);
}

.grade-predictor-stage--e .grade-curtain,
.grade-predictor-stage--u .grade-curtain {
    background:
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.18) 0 5px, transparent 5px 18px),
        linear-gradient(180deg, #0a0202 0%, #3f0a0a 20%, #5c1010 45%, #3f0a0a 70%, #0a0202 100%);
}

.grade-predictor-stage--e .grade-predictor-spotlight,
.grade-predictor-stage--u .grade-predictor-spotlight {
    background: radial-gradient(ellipse 40% 36% at 50% 48%, rgba(248, 113, 113, 0.12), transparent 74%);
}

.grade-predictor-stage--celebrate::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 15;
    background:
        radial-gradient(circle at 20% 30%, rgba(253, 224, 71, 0.35) 0 2px, transparent 3px),
        radial-gradient(circle at 78% 22%, rgba(251, 191, 36, 0.3) 0 2px, transparent 3px),
        radial-gradient(circle at 62% 68%, rgba(254, 240, 138, 0.28) 0 2px, transparent 3px),
        radial-gradient(circle at 35% 72%, rgba(250, 204, 21, 0.25) 0 2px, transparent 3px);
    animation: gradeSparkle 2.4s ease-out forwards;
}

@keyframes gradeSparkle {
    0% { opacity: 0; transform: scale(0.9); }
    25% { opacity: 1; }
    100% { opacity: 0; transform: scale(1.05); }
}

.grade-predictor-spotlight {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    background: radial-gradient(ellipse 42% 38% at 50% 46%, rgba(251, 191, 36, 0.14), transparent 72%);
    opacity: 0;
    animation: gradeSpotlightIn 1.4s ease 0.2s forwards;
}

@keyframes gradeSpotlightIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.grade-predictor-reveal {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fef3c7;
    padding: 1.5rem;
    width: 100%;
    overflow-y: auto;
}

.grade-predictor-reveal > * {
    width: min(100%, 36rem);
}

.grade-predictor-oracle {
    font-size: clamp(0.88rem, 2.1vw, 1.05rem);
    font-style: italic;
    letter-spacing: 0.06em;
    color: #a8a29e;
    margin: 0 auto 1rem;
    max-width: 26rem;
    line-height: 1.5;
    opacity: 0;
    animation: gradeOracleIn 1.4s ease 0.1s forwards;
}

.grade-predictor-oracle-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed rgba(251, 191, 36, 0.35);
    transition: color 0.15s, border-color 0.15s;
}

.grade-predictor-oracle-link:hover {
    color: #fde68a;
    border-bottom-color: #fbbf24;
}

@keyframes gradeOracleIn {
    from { opacity: 0; transform: translateY(-6px); filter: blur(3px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.grade-predictor-grade {
    font-size: clamp(4.5rem, 16vw, 8.5rem);
    font-weight: 900;
    line-height: 1;
    margin: 0 auto;
    width: 100%;
    letter-spacing: -0.04em;
    color: #fde68a;
    text-shadow:
        0 0 40px rgba(251, 191, 36, 0.45),
        0 0 100px rgba(251, 191, 36, 0.2),
        0 2px 0 rgba(0, 0, 0, 0.4);
    animation: gradePop 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s forwards;
    opacity: 0;
}

.grade-predictor-grade--astar {
    color: #fef08a;
    text-shadow:
        0 0 50px rgba(250, 204, 21, 0.55),
        0 0 120px rgba(251, 191, 36, 0.25);
}

.grade-predictor-grade--a,
.grade-predictor-grade--b {
    color: #fde68a;
}

.grade-predictor-grade--c,
.grade-predictor-grade--d {
    color: #fcd34d;
    text-shadow: 0 0 40px rgba(245, 158, 11, 0.35);
}

.grade-predictor-grade--e,
.grade-predictor-grade--u {
    color: #fca5a5;
    text-shadow:
        0 0 40px rgba(248, 113, 113, 0.4),
        0 0 90px rgba(127, 29, 29, 0.25);
}

@keyframes gradePop {
    from { opacity: 0; transform: scale(0.55) translateY(12px); filter: blur(6px); }
    to { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

.grade-predictor-caption {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    margin-top: 1.25rem;
    color: #d6d3d1;
    letter-spacing: 0.04em;
    font-weight: 500;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.55;
    opacity: 0;
    animation: gradeCaptionIn 1.2s ease 0.35s forwards;
}

@keyframes gradeCaptionIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.grade-predictor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    justify-content: center;
    margin-top: 2.25rem;
    opacity: 0;
    animation: gradeCaptionIn 1s ease 0.7s forwards;
}

.grade-predictor-back-btn,
.grade-predictor-dropout {
    display: inline-block;
    padding: 0.62rem 1.25rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    border: 1px solid rgba(251, 191, 36, 0.32);
    color: #fde68a;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(6px);
    transition: background 0.22s, border-color 0.22s, transform 0.22s, color 0.22s;
}

.grade-predictor-back-btn:hover,
.grade-predictor-dropout:hover {
    color: #fff;
    border-color: #fbbf24;
    background: rgba(69, 10, 10, 0.6);
    transform: translateY(-1px);
}

.grade-predictor-dropout {
    border-color: rgba(248, 113, 113, 0.42);
    color: #fecaca;
}

.grade-predictor-dropout:hover {
    border-color: #f87171;
    background: rgba(69, 10, 10, 0.72);
}

.grade-predictor-breakdown {
    margin-top: 1.5rem;
    padding: 1.15rem 1.25rem;
    border-radius: 14px;
    border: 1px solid rgba(251, 191, 36, 0.22);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 40%),
        rgba(0, 0, 0, 0.48);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    text-align: left;
    opacity: 0;
    animation: gradeCaptionIn 1s ease 0.5s forwards;
}

.grade-predictor-breakdown-title {
    margin: 0 0 0.65rem;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #a8a29e;
    font-weight: 700;
}

.grade-predictor-breakdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.grade-predictor-breakdown-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.86rem;
    color: #d6d3d1;
}

.grade-predictor-breakdown-list li:last-child {
    border-bottom: none;
}

.grade-predictor-breakdown-row--minor {
    opacity: 0.72;
    font-size: 0.8rem !important;
}

.grade-predictor-breakdown-list em {
    font-style: normal;
    color: #fbbf24;
    font-weight: 700;
}

.grade-predictor-breakdown-total {
    margin: 0.75rem 0 0;
    font-size: 0.82rem;
    color: #a8a29e;
    text-align: center;
}

.grade-predictor-breakdown-total strong {
    color: #fde68a;
}

.grade-predictor-page .hidden {
    display: none !important;
}

.grade-predictor-breakdown-link {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    color: inherit;
    text-decoration: none;
    padding: 0.35rem 0;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.grade-predictor-breakdown-link:hover {
    background: rgba(251, 191, 36, 0.08);
    color: #fde68a;
}

.grade-predictor-breakdown-list a.grade-predictor-breakdown-link {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.practice-personalised {
    margin: 0.85rem 0 1rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.08));
    background: rgba(14, 165, 233, 0.04);
}

.practice-personalised-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.practice-personalised-title {
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0 0 0.15rem;
    letter-spacing: 0.02em;
}

.practice-weak-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    margin: 0;
}

.practice-starter-lead {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    margin: 0;
    font-style: italic;
}

.practice-rec-strip {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
    scrollbar-width: thin;
}

.practice-rec-card {
    flex: 0 0 auto;
    width: 9.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    border: 1px solid rgba(14, 165, 233, 0.18);
    background: var(--surface-elevated, #fff);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.practice-rec-card:hover {
    border-color: #0ea5e9;
    background: rgba(14, 165, 233, 0.06);
    color: inherit;
}

.practice-rec-mode {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0ea5e9;
}

.practice-rec-title {
    font-size: 0.78rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.practice-rec-meta {
    font-size: 0.65rem;
    color: var(--text-muted, #64748b);
}

.practice-rec-more {
    padding: 0;
    margin-top: 0.25rem;
    font-size: 0.78rem;
}

.mcq-sprint-card {
    border-left: 3px solid #f59e0b;
}

.mcq-sprint-header--compact {
    margin-bottom: 0.75rem;
}

.mcq-sprint-config-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.04);
    margin-bottom: 0.65rem;
}

.mcq-sprint-config-field {
    min-width: 5.5rem;
}

.mcq-sprint-config-field--grow {
    flex: 1;
    min-width: 7rem;
}

.mcq-sprint-config-field .form-label {
    font-size: 0.72rem;
    margin-bottom: 0.2rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
}

.mcq-sprint-config-hint {
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
}

.mcq-sprint-select-all {
    margin-bottom: 0.1rem;
    white-space: nowrap;
}

.mcq-sprint-topics--scroll {
    max-height: 11rem;
    overflow-y: auto;
    padding: 0.5rem 0.55rem;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    margin-top: 0;
}

.mcq-sprint-topics-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.mcq-sprint-theme-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
    margin: 0.4rem 0 0.25rem;
}

.mcq-sprint-topic-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.mcq-sprint-topic-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    font-size: 0.72rem;
    cursor: pointer;
    margin: 0;
    background: var(--surface-elevated, #fff);
}

.mcq-sprint-topic-pill--on {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
}

.mcq-sprint-topic-pill input {
    margin: 0;
    width: 0.75rem;
    height: 0.75rem;
}

.mcq-question-sublabel {
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
    margin: -0.25rem 0 0.5rem;
}

.mcq-sprint-review-hero {
    text-align: center;
    padding: 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(99, 102, 241, 0.08));
}

.mcq-sprint-score {
    font-size: 2.25rem;
    font-weight: 900;
    margin: 0.35rem 0;
    color: #f59e0b;
}

.mcq-sprint-xp-total {
    font-size: 1.05rem;
    margin: 0.5rem 0;
}

.mcq-sprint-review-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mcq-sprint-review-item {
    padding: 1rem;
    margin-bottom: 0.65rem;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.04);
}

.mcq-sprint-review-meta {
    font-size: 0.75rem;
    font-weight: 700;
    color: #dc2626;
    margin: 0 0 0.35rem;
}

.mcq-sprint-review-q {
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.mcq-sprint-perfect-msg {
    text-align: center;
    color: #16a34a;
    font-weight: 600;
}

select option:disabled {
    color: #94a3b8;
}

.practice-history-card {
    border-left: 3px solid #6366f1;
}

.practice-history-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.practice-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.practice-history-item {
    border-top: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.08));
}

.practice-history-summary {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    align-items: start;
    width: 100%;
    padding: 0.75rem 0;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.practice-history-score {
    font-weight: 800;
    font-size: 0.9rem;
    color: #6366f1;
    white-space: nowrap;
}

.practice-history-copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.practice-history-copy small {
    color: var(--text-muted, #64748b);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.practice-history-date {
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
}

.practice-history-detail {
    padding: 0 0 0.85rem 2.5rem;
    font-size: 0.88rem;
}

.timed-mcq-card {
    border-left: 3px solid #f59e0b;
}

.timed-mcq-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.timed-mcq-hud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.timed-mcq-timer,
.timed-mcq-streak,
.timed-mcq-progress {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(15, 23, 42, 0.06);
}

.timed-mcq-timer--urgent {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.timed-mcq-streak--hot {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.timed-mcq-intro {
    padding: 0.5rem 0;
}

.timed-mcq-topic-list {
    margin: 0.75rem 0 1rem;
    padding-left: 1.1rem;
    color: var(--text-muted, #64748b);
}

.timed-mcq-results {
    text-align: center;
    padding: 1rem 0;
}

.timed-mcq-score {
    font-size: 2rem;
    font-weight: 800;
    margin: 0.5rem 0;
    color: #f59e0b;
}

.voranomics-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    width: min(100%, 640px);
    margin: 1.5rem 0;
}

.voranomics-meta-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.1rem 1.25rem;
    border-radius: 12px;
    border: 2px solid rgba(74, 222, 128, 0.35);
    background: rgba(0, 0, 0, 0.4);
    color: #bbf7d0;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.voranomics-meta-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.2);
    color: #ecfdf5;
}

.voranomics-meta-card i {
    color: #fbbf24;
    font-size: 1.25rem;
}

.voranomics-meta-card strong {
    color: #4ade80;
}

.voranomics-meta-card span {
    font-size: 0.82rem;
    color: #86efac;
    opacity: 0.9;
}

.voranomics-lb-page {
    max-width: 520px;
}

.voranomics-lb-list--plain {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.voranomics-lb-list--plain .voranomics-lb-row {
    grid-template-columns: 1fr auto;
}

.voranomics-lb-list--podium .voranomics-lb-row--gold {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.18), transparent);
    border-color: rgba(251, 191, 36, 0.45);
}

.voranomics-lb-list--podium .voranomics-lb-row--silver {
    background: linear-gradient(90deg, rgba(203, 213, 225, 0.14), transparent);
}

.voranomics-lb-list--podium .voranomics-lb-row--bronze {
    background: linear-gradient(90deg, rgba(253, 186, 116, 0.14), transparent);
}

.voranomics-lb-you-tag {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    background: rgba(56, 189, 248, 0.25);
    color: #7dd3fc;
}

.voranomics-lb-time {
    color: #86efac;
    font-variant-numeric: tabular-nums;
}

.campaign-stars {
    display: flex;
    gap: 0.15rem;
    color: #475569;
}

.campaign-star--lit {
    color: #fbbf24;
}

.campaign-result-stars {
    font-size: 1.5rem;
    color: #fbbf24;
    margin: 0.25rem 0 0.5rem;
}

.voranomics-lb-fullpage-shell {
    min-height: 100vh;
    min-height: 100dvh;
}

.voranomics-lb-fullpage {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: clamp(1.25rem, 3vw, 2.5rem);
    color: #bbf7d0;
    font-family: "Courier New", monospace;
}

.voranomics-lb-fullpage-head {
    text-align: center;
    margin-bottom: 1.5rem;
}

.voranomics-lb-fullpage-head h1 {
    color: #4ade80;
    text-shadow: 0 0 12px rgba(74, 222, 128, 0.5);
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    margin-bottom: 0.35rem;
}

.voranomics-lb-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1rem, 3vw, 2rem);
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    align-items: start;
}

@media (max-width: 900px) {
    .voranomics-lb-columns {
        grid-template-columns: 1fr;
    }
}

.voranomics-lb-panel {
    background: rgba(0, 0, 0, 0.42);
    border: 2px solid rgba(74, 222, 128, 0.35);
    border-radius: 14px;
    padding: 1.25rem 1.35rem;
    text-align: left;
    min-height: min(60vh, 520px);
}

.voranomics-lb-panel-title {
    color: #4ade80;
    font-size: 1.15rem;
    margin-bottom: 0.35rem;
}

.voranomics-lb-panel-title i {
    margin-right: 0.4rem;
    color: #fbbf24;
}

.voranomics-lb-back {
    display: inline-block;
    margin: 1.5rem auto 0;
    text-align: center;
}

.voranomics-meta-grid--single {
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.mp-setup-form {
    max-width: 360px;
    margin: 0 auto 1rem;
    text-align: left;
}

.mp-setup-input {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(74, 222, 128, 0.45);
    color: #ecfdf5;
}

.mp-setup-input:focus {
    background: rgba(0, 0, 0, 0.55);
    border-color: #4ade80;
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(74, 222, 128, 0.2);
}

.game-result-panel--mp {
    width: min(96vw, 640px);
}

.mp-history {
    width: 100%;
    max-width: 420px;
    margin: 1.25rem auto;
    padding: 1rem 1.1rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(134, 239, 172, 0.25);
    color: #d1fae5;
}

.mp-history-list {
    margin: 0;
    padding-left: 1.25rem;
    text-align: left;
    font-size: 0.92rem;
}

.mp-history-list li + li {
    margin-top: 0.35rem;
}

/* ── Site-wide aesthetic polish ── */
.theme-toggle-btn {
    color: var(--color-muted);
    transition: color var(--transition), background var(--transition), transform var(--transition);
}

.theme-toggle-btn:hover {
    color: var(--color-primary-dark);
    background: var(--color-primary-subtle);
    transform: rotate(-8deg);
}

.auth-layout-body {
    background-image:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(56, 189, 248, 0.14), transparent 60%),
        radial-gradient(ellipse 60% 50% at 100% 100%, rgba(245, 158, 11, 0.06), transparent 50%);
    background-attachment: fixed;
}

.auth-card.card {
    box-shadow: var(--shadow-lg);
    border-color: rgba(14, 165, 233, 0.12);
}

.alert {
    border-radius: var(--radius-sm);
    border-width: 1px;
    font-size: 0.9rem;
}

.progress {
    height: 0.55rem;
    border-radius: var(--radius-pill);
    background: var(--color-bg-subtle);
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--color-primary-dark), var(--color-primary));
    border-radius: var(--radius-pill);
}

.settings-pref-card {
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.settings-pref-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.diagram-list-item.card,
.theme-page-card {
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.diagram-list-item.card:hover,
.theme-page-card:hover {
    border-color: rgba(14, 165, 233, 0.25);
}

.mcq-option {
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.mcq-option:hover:not(.mcq-option--disabled) {
    transform: translateX(3px);
}

.breadcrumb-item:not(.active):hover {
    color: var(--color-primary-dark);
}

.page-title {
    background: linear-gradient(135deg, var(--color-text) 0%, var(--color-primary-hover) 120%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .page-title {
    background: linear-gradient(135deg, #eef2f7 0%, var(--color-primary) 120%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.home-welcome-badge {
    border: 1px solid rgba(14, 165, 233, 0.2);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.08);
}

.login-gate {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.login-gate i {
    font-size: 2.25rem;
    color: var(--color-primary-dark);
    margin-bottom: 1rem;
    opacity: 0.85;
}

.badge-toast {
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .feature-icon {
    background: linear-gradient(145deg, var(--color-primary-subtle), rgba(21, 29, 46, 0.9));
    border-color: rgba(56, 189, 248, 0.2);
}

[data-theme="dark"] .home-hero {
    background:
        radial-gradient(ellipse 90% 70% at 50% -20%, rgba(56, 189, 248, 0.18), transparent 62%),
        linear-gradient(165deg, #0f1729 0%, #151d2e 45%, var(--color-surface) 100%);
    border-color: rgba(56, 189, 248, 0.15);
}

[data-theme="dark"] .sidebar {
    background: linear-gradient(185deg, var(--glass-bg) 0%, rgba(10, 15, 24, 0.92) 100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .top-bar {
    background: var(--glass-bg);
}
