:root {
    --bg: #f5f7fb;
    --bg-soft: #eef2f7;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --border: rgba(15, 23, 42, 0.12);
    --primary: #6366f1;
    --secondary: #ec4899;
    --accent: #22d3ee;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --gradient-main: linear-gradient(135deg, #6366f1 0%, #a855f7 45%, #ec4899 100%);
    --gradient-card: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(236,72,153,0.12));
    --shadow-card: 0 18px 50px rgba(15, 23, 42, 0.12);
    --radius-lg: 26px;
    --radius-md: 18px;
    --radius-sm: 12px;
    color-scheme: light;
}

html[data-theme="dark"] {
    --bg: #070d1a;
    --bg-soft: #0b1220;
    --surface: #111827;
    --surface-2: #162033;
    --text: #f8fafc;
    --muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --primary: #818cf8;
    --secondary: #f472b6;
    --accent: #22d3ee;
    --success: #22c55e;
    --danger: #f87171;
    --warning: #fbbf24;
    --gradient-main: linear-gradient(135deg, #5945f5 0%, #9d4edd 45%, #ec4899 100%);
    --gradient-card: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(236,72,153,0.18));
    --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
}

* { box-sizing: border-box; }

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 12% 8%, rgba(124, 58, 237, .28), transparent 34rem),
        radial-gradient(circle at 88% 18%, rgba(236, 72, 153, .18), transparent 30rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, Poppins, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

.app-main {
    width: min(1080px, calc(100% - 28px));
    margin: 0 auto;
    padding: 18px 0 34px;
    flex: 1;
}

.app-footer {
    width: min(1080px, calc(100% - 28px));
    margin: 0 auto;
    padding: 24px 0 34px;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

.app-navbar {
    background: color-mix(in srgb, var(--bg-soft) 82%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
    z-index: 20;
}

.navbar-inner {
    width: min(1080px, calc(100% - 28px));
    min-height: 56px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 900;
    white-space: nowrap;
}

.brand-icon,
.brand-icon-img {
    width: 34px;
    height: 34px;
    border-radius: 12px;
}

.brand-icon {
    display: grid;
    place-items: center;
    background: var(--gradient-main);
    color: #fff;
    box-shadow: 0 12px 28px rgba(124, 58, 237, .35);
}

.brand-icon-img {
    display: block;
    object-fit: cover;
    box-shadow: 0 12px 28px rgba(124, 58, 237, .28);
}

.nav-menu-button {
    border: 1px solid var(--border);
    border-radius: 12px;
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 9px;
    margin-left: auto;
}

.nav-menu-button span {
    width: 20px;
    height: 2px;
    background: var(--text);
    display: block;
}

.nav-collapse {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

@media (min-width: 1001px) {
    .nav-collapse.collapse {
        display: flex !important;
    }
}

.nav-links,
.nav-actions {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}

.nav-link-modern,
.btn-ghost,
.btn-gradient,
.theme-toggle,
.btn-light-hero,
.btn-outline-hero,
.btn-card-link,
.btn-filter {
    border-radius: 14px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 38px;
    padding: .52rem .82rem;
    text-decoration: none;
    font-weight: 800;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.nav-link-modern {
    color: var(--muted);
}

.nav-link-with-badge {
    position: relative;
}

.notification-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 .35rem;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: var(--danger);
    color: #fff;
    font-size: .72rem;
    font-weight: 900;
}

.nav-link-modern:hover,
.nav-link-modern.active {
    color: var(--text);
    background: var(--gradient-card);
    border-color: var(--border);
}

.btn-gradient,
.btn-primary {
    background: var(--gradient-main) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 14px 34px rgba(124, 58, 237, .32);
}

.btn-lg {
    min-height: 40px;
    padding: .55rem .9rem;
    font-size: .95rem;
}

.btn-gradient:hover,
.btn-primary:hover,
.btn-light-hero:hover,
.btn-outline-hero:hover,
.btn-ghost:hover {
    transform: translateY(-2px);
}

.btn-ghost,
.btn-outline-primary,
.btn-outline-secondary {
    background: color-mix(in srgb, var(--surface-2) 78%, transparent) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.theme-toggle {
    width: 38px;
    padding: 0;
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}

.logout-button {
    width: 38px;
    padding: 0;
}

.login-button {
    width: 38px;
    padding: 0;
}

.hero-card {
    position: relative;
    overflow: hidden;
    min-height: 470px;
    border-radius: var(--radius-lg);
    padding: clamp(1.4rem, 4vw, 3rem);
    background: var(--gradient-main);
    box-shadow: 0 30px 90px rgba(124, 58, 237, .35);
    color: #fff;
}

.hero-card::before,
.hero-card::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    filter: blur(2px);
}

.hero-card::before { top: -80px; right: 10%; }
.hero-card::after { bottom: -120px; left: 8%; }

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 880px;
}

.eyebrow {
    color: var(--muted);
    display: inline-block;
    /*font-size: .78rem;*/
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: .5rem;
}

.eyebrow.light { color: rgba(255, 255, 255, .82); }

.hero-title {
    font-size: clamp(2.45rem, 0vw, 5rem);
    font-weight: 950;
    line-height: 1.02;
    letter-spacing: 1px;
    max-width: 940px;
}

.hero-subtitle {
    max-width: 760px;
    color: rgba(255, 255, 255, .86);
    font-size: 1.12rem;
    margin: 1rem 0 1.5rem;
}

.hero-stats,
.progression-metrics,
.model-meta,
.exam-progress-header {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.hero-stat {
    min-width: 140px;
    padding: .9rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.20);
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(8px);
}

.hero-stat strong {
    display: block;
    font-size: 1.6rem;
}

.hero-stat span {
    color: rgba(255,255,255,.76);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    margin-top: 1.5rem;
}

.btn-light-hero {
    background: #fff;
    color: #4c1d95;
}

.btn-outline-hero {
    color: #fff;
    border-color: rgba(255,255,255,.36);
    background: rgba(255,255,255,.10);
}

.page-hero,
.dashboard-hero,
.category-hero,
.exam-detail-hero,
.result-hero,
.correction-header,
.progression-card,
.app-card,
.premium-category-card,
.exam-model-card,
.stat-card,
.continue-card,
.performance-card,
.recent-attempts,
.rating-card,
.question-card,
.exam-progress-card,
.auth-card {
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--surface) 94%, transparent), color-mix(in srgb, var(--surface-2) 92%, transparent)),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.page-hero,
.dashboard-hero,
.category-hero,
.exam-detail-hero,
.result-hero,
.correction-header,
.progression-card {
    padding: clamp(1.25rem, 3vw, 2rem);
    margin-bottom: 1.5rem;
}

.page-hero.compact {
    max-width: 900px;
}

.h3, h3 {
    font-size: calc(1.3rem + 0vw);
}

.h2, h2 {
    font-size: calc(1.325rem + 0vw);
}

span.btn-card-link, a.btn-gradient, a.btn-ghost {
    font-size: 13px;
}

.page-hero h1,
.dashboard-hero h1,
.category-hero h1,
.exam-detail-hero h1,
.result-hero h1 {
    font-size: clamp(1.65rem, 0vw, 2.55rem);
    font-weight: 950;
    letter-spacing: 0;
}

.page-hero p,
.dashboard-hero p,
.category-hero p,
.exam-detail-hero p,
.exam-model-card p,
.premium-category-card p,
.muted {
    color: var(--muted);
}

.section-title {
    font-size: 1.18rem;
    font-weight: 900;
    margin: 2rem 0 1rem;
}

.premium-category-grid,
.stats-grid,
.dashboard-grid,
.result-stat-grid,
.exam-meta-grid,
.performance-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.premium-category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.premium-category-card,
.exam-model-card,
.stat-card,
.continue-card,
.performance-card,
.rating-card,
.recent-attempts,
.app-card,
.question-card,
.exam-progress-card {
    padding: 1rem;
    min-width: 0;
}

.exam-progress-card {
    overflow: hidden;
}

.premium-category-card,
.exam-model-card {
    position: relative;
    overflow: hidden;
    min-height: 245px;
    display: flex;
    flex-direction: column;
    gap: .85rem;
    color: var(--text);
    text-decoration: none;
}

.premium-category-card:hover,
.exam-model-card:hover {
    border-color: color-mix(in srgb, var(--secondary) 55%, var(--border));
    transform: translateY(-4px);
}

.category-orb {
    position: absolute;
    right: -40px;
    top: -48px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--gradient-card);
}

.badge-glow,
.rating-pill {
    width: fit-content;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--gradient-card);
    color: var(--text);
    padding: .42rem .72rem;
    font-size: .78rem;
    font-weight: 900;
}

.category-card-footer,
.model-card-top,
.model-actions,
.result-actions,
.question-actions,
.category-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.btn-card-link {
    min-height: 36px;
    background: var(--gradient-main);
    color: #fff;
}

.model-meta span {
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-2) 86%, transparent);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: .35rem .65rem;
    font-size: .83rem;
    font-weight: 750;
}

.stat-card span,
.category-stats span,
.exam-progress-header span {
    color: var(--muted);
    display: block;
    font-size: .78rem;
}

.stat-card strong,
.category-stats strong,
.exam-progress-header strong {
    display: block;
    font-size: 1.25rem;
}

.progress-track {
    height: .55rem;
    width: 100%;
    background: color-mix(in srgb, var(--surface-2) 80%, #000);
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    margin: .75rem 0;
}

.progress-track.compact {
    height: .42rem;
    margin: .35rem 0 .45rem;
}

.progress-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--gradient-main);
    transition: width .42s ease;
}

.card-progress,
.detail-progress {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface-2) 78%, transparent);
    padding: .7rem .75rem;
}

.card-progress-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    color: var(--muted);
    font-size: .82rem;
}

.card-progress-label strong {
    color: var(--text);
}

.filter-bar {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr) auto;
    gap: .75rem;
}

.modern-filter {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: .9rem;
    box-shadow: var(--shadow-card);
}

.form-control,
.form-select,
.form-control-modern {
    background: color-mix(in srgb, var(--surface-2) 90%, transparent) !important;
    border: 1px solid var(--border) !important;
    border-radius: 14px !important;
    color: var(--text) !important;
    min-height: 46px;
}

.form-control::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }

.exam-detail-hero,
.category-hero,
.result-hero,
.correction-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.25rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 86%, transparent), color-mix(in srgb, var(--primary) 11%, var(--surface)));
}

.exam-section-list {
    display: grid;
    gap: .9rem;
}

.exam-shell {
    max-width: 1040px;
    margin: 0 auto;
    display: grid;
    gap: .75rem;
    min-width: 0;
}

.exam-sticky-status {
    position: sticky;
    top: .65rem;
    z-index: 12;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
}

.exam-timer {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    min-height: 38px;
    padding: .45rem .75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(14px);
}

.exam-timer span {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
}

.exam-timer strong {
    font-variant-numeric: tabular-nums;
    font-size: .95rem;
    font-weight: 950;
}

.exam-topbar {
    min-width: 0;
}

.exam-topbar h1 {
    font-size: clamp(1.05rem, 1.55vw, 1.45rem);
    font-weight: 850;
    line-height: 1.2;
    margin: .18rem 0 .15rem;
}

.exam-topbar p {
    margin: 0;
    color: var(--muted);
    font-size: .86rem;
}

.score-pill {
    min-width: 150px;
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: .72rem .85rem;
}

.exam-progress-header {
    justify-content: space-between;
    gap: .65rem;
    min-width: 0;
}

.exam-progress-header > div {
    min-width: 0;
}

.exam-progress-header strong {
    font-size: 1.05rem;
    font-weight: 850;
}

.score-pill span {
    color: var(--muted);
    display: block;
    font-size: .78rem;
}

.score-pill strong {
    font-size: 1.05rem;
}

.exam-timeline {
    display: flex;
    gap: .45rem;
    overflow-x: auto;
    max-width: 100%;
    min-width: 0;
    padding: .38rem 0 .28rem;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
    scroll-padding-inline: 46%;
    scrollbar-width: thin;
    mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}

.timeline-dot,
.timeline-step {
    width: 30px;
    min-width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .1rem;
    text-decoration: none;
    font-size: .72rem;
    font-weight: 850;
    border: 1px solid var(--border);
    color: var(--muted);
    background: var(--surface-2);
}

.timeline-dot small,
.timeline-step small { font-size: .68rem; }

.timeline-step-current,
.timeline-dot.timeline-step-current {
    background: var(--gradient-main);
    color: #fff;
    border-color: transparent;
}

.timeline-step-correct,
.timeline-dot.timeline-step-correct {
    background: color-mix(in srgb, var(--success) 18%, var(--surface));
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 55%, var(--border));
}

.timeline-step-wrong,
.timeline-dot.timeline-step-wrong {
    background: color-mix(in srgb, var(--danger) 16%, var(--surface));
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 55%, var(--border));
}

.timeline-step-open,
.timeline-dot.timeline-step-open {
    background: color-mix(in srgb, var(--warning) 18%, var(--surface));
    color: var(--warning);
    border-color: color-mix(in srgb, var(--warning) 55%, var(--border));
}

.question-card {
    padding: clamp(.9rem, 1.6vw, 1.15rem);
    min-width: 0;
}

.question-card h2 {
    font-size: clamp(1.05rem, 1.55vw, 1.32rem);
    font-weight: 850;
    line-height: 1.32;
    margin: .3rem 0 .7rem;
}

.question-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .42rem;
    min-width: 0;
}

.badge-soft,
.text-bg-primary {
    background: var(--gradient-card) !important;
    color: var(--text) !important;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .28rem .5rem;
    font-size: .72rem;
    line-height: 1.1;
}

.answer-list {
    display: grid;
    gap: .52rem;
}

.answer-option {
    display: flex;
    align-items: center;
    gap: .72rem;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface-2) 90%, transparent);
    border-radius: 12px;
    padding: 10px 12px;
    min-height: 46px;
    font-size: .92rem;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.answer-option:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--primary) 65%, var(--border));
}

.answer-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.answer-key {
    width: 28px;
    min-width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: .78rem;
    font-weight: 850;
}

.answer-option-multiple .answer-checkmark {
    width: 22px;
    min-width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border: 2px solid color-mix(in srgb, var(--muted) 45%, var(--border));
    border-radius: 6px;
    background: var(--surface);
}

.answer-option-multiple .answer-checkmark::after {
    content: "";
    width: 10px;
    height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
    opacity: 0;
}

.answer-option-multiple.selected .answer-checkmark,
.answer-option-multiple.answer-option-selected .answer-checkmark {
    border-color: transparent;
    background: var(--gradient-main);
}

.answer-option-multiple.selected .answer-checkmark::after,
.answer-option-multiple.answer-option-selected .answer-checkmark::after {
    opacity: 1;
}

.answer-option.selected,
.answer-option-selected {
    border-color: color-mix(in srgb, var(--primary) 72%, var(--border));
    background: var(--gradient-card);
}

.answer-option.correct,
.answer-option-correct {
    border-color: color-mix(in srgb, var(--success) 70%, var(--border));
    background: color-mix(in srgb, var(--success) 14%, var(--surface));
}

.answer-option.wrong,
.answer-option-wrong {
    border-color: color-mix(in srgb, var(--danger) 70%, var(--border));
    background: color-mix(in srgb, var(--danger) 12%, var(--surface));
}

.answer-option.is-disabled {
    cursor: default;
}

.answer-option.is-disabled:hover {
    transform: none;
}

.feedback-panel,
.feedback-card {
    border-radius: 14px;
    border: 1px solid var(--border);
    border-left-width: 5px;
    padding: .9rem 1rem;
    margin-top: .85rem;
}

.feedback-panel.success,
.feedback-success {
    border-left-color: var(--success);
    background: color-mix(in srgb, var(--success) 12%, var(--surface));
}

.feedback-panel.danger,
.feedback-error {
    border-left-color: var(--danger);
    background: color-mix(in srgb, var(--danger) 10%, var(--surface));
}

.feedback-panel.info,
.feedback-info {
    border-left-color: var(--warning);
    background: color-mix(in srgb, var(--warning) 10%, var(--surface));
}

.feedback-title {
    display: block;
    font-size: 1rem;
    font-weight: 950;
    margin-bottom: .4rem;
}

.feedback-explanation,
.feedback-tip {
    color: var(--muted);
}

.question-actions,
.result-actions {
    justify-content: flex-end;
    margin-top: 1rem;
}

.question-submit-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.question-actions {
    align-items: center;
    justify-content: space-between;
}

.question-action-left,
.question-action-right {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}

.question-action-right {
    justify-content: flex-end;
    margin-left: auto;
}

.is-hidden {
    display: none !important;
}

.score-ring,
.score-circle {
    width: 176px;
    height: 176px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle, var(--surface) 56%, transparent 57%),
        conic-gradient(var(--secondary), var(--primary), var(--accent), var(--secondary));
    color: var(--text);
    font-size: 2.2rem;
    font-weight: 950;
}

.correction-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-bottom: 1rem;
}

.btn-filter {
    background: var(--surface-2);
    color: var(--muted);
    border-color: var(--border);
    min-height: 38px;
}

.btn-filter.active {
    background: var(--gradient-main);
    color: #fff;
}

.accordion-item,
.accordion-button {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

.accordion-button:not(.collapsed) {
    background: var(--gradient-card) !important;
}

.correction-answer-box {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: .85rem 1rem;
    margin-bottom: .7rem;
}

.correction-answer-box strong {
    display: block;
    margin-bottom: .25rem;
}

.rating-done {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--gradient-card);
    padding: .75rem .85rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.star-rating {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: .15rem;
}

.star-rating input {
    position: absolute;
    opacity: 0;
}

.star-rating label {
    color: color-mix(in srgb, var(--muted) 55%, transparent);
    cursor: pointer;
    font-size: 1.65rem;
    line-height: 1;
    transition: color .15s ease, transform .15s ease;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: var(--warning);
}

.star-rating label:hover {
    transform: translateY(-1px);
}

.comment-list {
    display: grid;
    gap: .75rem;
}

.comment-item {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface-2) 78%, transparent);
    padding: .85rem;
}

.comment-head {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    color: var(--muted);
    font-size: .82rem;
}

.comment-head strong {
    color: var(--text);
}

.comment-item p {
    margin: .55rem 0 .7rem;
}

.comment-like {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    min-height: 32px;
    padding: .25rem .7rem;
    font-weight: 850;
}

.comment-like.is-liked {
    color: #fff;
    border-color: transparent;
    background: var(--gradient-main);
}

.welcome-announcement .modal-content {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--surface) 96%, transparent), color-mix(in srgb, var(--surface-2) 94%, transparent)),
        var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-card);
}

.welcome-announcement .modal-header,
.welcome-announcement .modal-footer {
    border-color: var(--border);
}

.welcome-lead {
    color: var(--muted);
    margin-bottom: 1rem;
}

.welcome-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.welcome-grid div {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface-2) 78%, transparent);
    padding: .85rem;
}

.welcome-grid strong {
    display: block;
    margin-bottom: .35rem;
}

.welcome-grid span {
    color: var(--muted);
    font-size: .9rem;
}

.auth-page {
    min-height: calc(100vh - 190px);
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(100%, 480px);
    padding: clamp(1.25rem, 4vw, 2rem);
}

.auth-title {
    font-size: 2rem;
    font-weight: 950;
}

.auth-link {
    margin: 1rem 0 0;
    color: var(--muted);
    text-align: center;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border);
}

.app-alert {
    border-radius: 16px;
    border-color: var(--border);
}

.empty-state {
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    color: var(--muted);
    padding: 1.2rem;
    text-align: center;
}

.admin-actions,
.import-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: .45rem;
    flex-wrap: wrap;
}

.import-actions {
    justify-content: flex-start;
}

.preview-question-flow {
    display: grid;
    gap: 1rem;
}

.preview-question {
    border-top: 1px solid var(--border);
    margin-top: 1rem;
    padding-top: 1rem;
}

.preview-question h4 {
    font-size: 1.02rem;
    font-weight: 850;
    line-height: 1.35;
    margin: .55rem 0 .7rem;
}

.preview-input {
    color: var(--muted) !important;
    display: flex;
    align-items: center;
}

.docs-json-content {
    display: grid;
    gap: .9rem;
}

.docs-json-content h2 {
    font-size: 1.18rem;
    font-weight: 900;
    margin: 1.1rem 0 .15rem;
}

.docs-json-content h3 {
    font-size: 1rem;
    font-weight: 850;
    margin: .75rem 0 .1rem;
}

.docs-json-content p,
.docs-json-content li {
    color: var(--muted);
}

.docs-json-content code {
    color: var(--accent);
}

.docs-json-content .json-preview {
    max-height: 360px;
}

@media (max-width: 1000px) {
    .nav-menu-button { display: inline-flex; }
    .navbar-inner { flex-wrap: wrap; }
    .nav-collapse {
        flex-basis: 100%;
        align-items: stretch;
        padding-bottom: 1rem;
    }
    .nav-collapse:not(.show) { display: none; }
    .nav-collapse.show { display: grid; }
    .nav-links,
    .nav-actions {
        align-items: stretch;
        flex-direction: column;
    }
    .nav-link-modern,
    .btn-ghost,
    .btn-gradient {
        justify-content: center;
    }
    .premium-category-grid,
    .stats-grid,
    .dashboard-grid,
    .result-stat-grid,
    .exam-meta-grid,
    .performance-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .filter-bar,
    .exam-detail-hero,
    .category-hero,
    .result-hero,
    .correction-header,
    .exam-topbar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .app-main,
    .navbar-inner,
    .app-footer {
        width: min(100% - 20px, 1180px);
    }
    .premium-category-grid,
    .stats-grid,
    .dashboard-grid,
    .result-stat-grid,
    .exam-meta-grid,
    .performance-grid,
    .welcome-grid,
    .filter-bar {
        grid-template-columns: 1fr;
    }
    .hero-card {
        min-height: auto;
        padding: 1.2rem;
    }
    .hero-title {
        font-size: 2.35rem;
    }
    .hero-stats,
    .progression-metrics,
    .model-actions,
    .result-actions,
    .question-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .answer-option {
        padding: 10px 12px;
    }
    .score-ring,
    .score-circle {
        width: 140px;
        height: 140px;
        font-size: 1.7rem;
    }
}
