:root {
    color-scheme: dark;
    --bg: #07111f;
    --bg-soft: #0f1d31;
    --panel: rgba(15, 29, 49, 0.78);
    --panel-strong: rgba(10, 19, 34, 0.92);
    --line: rgba(142, 190, 255, 0.12);
    --text: #ecf3ff;
    --muted: #a7bad8;
    --primary: #5dd6ff;
    --primary-deep: #0aaee6;
    --accent: #ff8e65;
    --success: #2ecc71;
    --danger: #ff6b6b;
    --warning: #ffcd57;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --container: 1180px;
    --body-background:
        radial-gradient(circle at 15% 20%, rgba(93, 214, 255, 0.18), transparent 28%),
        radial-gradient(circle at 80% 15%, rgba(255, 142, 101, 0.22), transparent 24%),
        linear-gradient(160deg, #050c17 0%, #07111f 45%, #091523 100%);
    --orb-one-bg: rgba(10, 174, 230, 0.5);
    --orb-two-bg: rgba(255, 142, 101, 0.25);
    --soft-text: #d2e0f7;
    --feature-text: #dce8fb;
    --label-text: #d6e6ff;
    --placeholder: #88a3c8;
    --brand-logo-text: #04111f;
    --btn-text: #03111f;
    --metric-bg: rgba(7, 17, 31, 0.44);
    --surface-bg: rgba(255, 255, 255, 0.04);
    --surface-bg-soft: rgba(255, 255, 255, 0.035);
    --surface-border: rgba(255, 255, 255, 0.1);
    --surface-border-soft: rgba(255, 255, 255, 0.06);
    --ghost-border: rgba(255, 255, 255, 0.14);
    --field-bg: rgba(255, 255, 255, 0.04);
    --field-border: rgba(255, 255, 255, 0.12);
    --option-bg: rgba(255, 255, 255, 0.08);
    --option-border: rgba(142, 190, 255, 0.2);
    --option-hover-bg: rgba(93, 214, 255, 0.12);
    --option-hover-border: rgba(93, 214, 255, 0.34);
    --option-selected-bg: linear-gradient(135deg, rgba(93, 214, 255, 0.22), rgba(255, 142, 101, 0.14));
    --option-selected-border: rgba(93, 214, 255, 0.58);
    --option-selected-shadow: 0 14px 32px rgba(10, 174, 230, 0.18);
    --option-correct-bg: rgba(46, 204, 113, 0.12);
    --option-key-bg: rgba(255, 255, 255, 0.08);
    --option-key-text: var(--primary);
    --ad-bg: rgba(255, 255, 255, 0.03);
    --ad-border: rgba(255, 255, 255, 0.14);
    --ad-text: rgba(236, 243, 255, 0.72);
    --icon-bg: linear-gradient(140deg, rgba(93, 214, 255, 0.22), rgba(255, 142, 101, 0.22));
    --theme-toggle-bg: rgba(255, 255, 255, 0.04);
    --theme-toggle-border: rgba(255, 255, 255, 0.12);
    --theme-toggle-ring: 0 0 0 4px rgba(93, 214, 255, 0.12);
    --success-badge-bg: rgba(46, 204, 113, 0.16);
    --success-badge-text: #94f0b5;
    --danger-badge-bg: rgba(255, 107, 107, 0.16);
    --danger-badge-text: #ffb0b0;
    --warning-badge-bg: rgba(255, 205, 87, 0.14);
    --warning-badge-text: #ffe29a;
    --primary-shadow: 0 16px 34px rgba(10, 174, 230, 0.24);
    --alert-success-bg: rgba(46, 204, 113, 0.12);
    --alert-success-border: rgba(46, 204, 113, 0.28);
    --alert-danger-bg: rgba(255, 107, 107, 0.12);
    --alert-danger-border: rgba(255, 107, 107, 0.28);
    --interactive-hover-border: rgba(93, 214, 255, 0.26);
    --selected-border: rgba(93, 214, 255, 0.5);
    --selected-bg: rgba(93, 214, 255, 0.16);
    --correct-border: rgba(46, 204, 113, 0.5);
    --review-flag-text: #d6e6ff;
    --palette-active-border: rgba(93, 214, 255, 0.44);
    --palette-active-ring: rgba(93, 214, 255, 0.52);
    --palette-not-answered-bg: linear-gradient(135deg, rgba(255, 107, 107, 0.24), rgba(255, 142, 101, 0.16));
    --palette-not-answered-border: rgba(255, 107, 107, 0.42);
    --palette-not-answered-text: #ffe9e9;
    --palette-answered-bg: linear-gradient(135deg, rgba(50, 210, 125, 0.28), rgba(14, 169, 95, 0.18));
    --palette-answered-border: rgba(46, 204, 113, 0.38);
    --palette-answered-text: #eafff3;
    --palette-review-bg: linear-gradient(135deg, rgba(255, 205, 87, 0.32), rgba(255, 158, 44, 0.18));
    --palette-review-border: rgba(255, 205, 87, 0.42);
    --legend-active: rgba(93, 214, 255, 0.82);
    --legend-not-answered: rgba(255, 107, 107, 0.86);
    --legend-answered: rgba(46, 204, 113, 0.82);
    --legend-review: rgba(255, 205, 87, 0.82);
    --hero-accent-bg: linear-gradient(140deg, rgba(93, 214, 255, 0.14), rgba(255, 142, 101, 0.08)), var(--panel-strong);
    --heading-text: #ffff00;
    --explanation-text: #5dd6ff;
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #eef6ff;
    --bg-soft: #ffffff;
    --panel: rgba(255, 255, 255, 0.82);
    --panel-strong: rgba(255, 255, 255, 0.94);
    --line: rgba(17, 67, 120, 0.12);
    --text: #13233a;
    --muted: #5d7391;
    --shadow: 0 24px 70px rgba(66, 98, 139, 0.14);
    --body-background:
        radial-gradient(circle at 12% 20%, rgba(10, 174, 230, 0.14), transparent 28%),
        radial-gradient(circle at 85% 12%, rgba(255, 142, 101, 0.18), transparent 24%),
        linear-gradient(160deg, #f7fbff 0%, #eef6ff 48%, #fdf7f1 100%);
    --orb-one-bg: rgba(10, 174, 230, 0.18);
    --orb-two-bg: rgba(255, 142, 101, 0.16);
    --soft-text: #314763;
    --feature-text: #203754;
    --label-text: #203754;
    --placeholder: #6f88a7;
    --brand-logo-text: #ffffff;
    --btn-text: #03111f;
    --metric-bg: rgba(255, 255, 255, 0.72);
    --surface-bg: rgba(255, 255, 255, 0.7);
    --surface-bg-soft: rgba(255, 255, 255, 0.62);
    --surface-border: rgba(17, 67, 120, 0.12);
    --surface-border-soft: rgba(17, 67, 120, 0.1);
    --ghost-border: rgba(17, 67, 120, 0.16);
    --field-bg: rgba(255, 255, 255, 0.78);
    --field-border: rgba(17, 67, 120, 0.16);
    --option-bg: rgba(255, 255, 255, 0.96);
    --option-border: rgba(17, 67, 120, 0.18);
    --option-hover-bg: rgba(10, 174, 230, 0.08);
    --option-hover-border: rgba(10, 174, 230, 0.28);
    --option-selected-bg: linear-gradient(135deg, rgba(255, 0, 0, 0.12), rgba(10, 174, 230, 0.1));
    --option-selected-border: rgba(255, 0, 0, 0.36);
    --option-selected-shadow: 0 12px 24px rgba(255, 0, 0, 0.08);
    --option-correct-bg: rgba(46, 204, 113, 0.1);
    --option-key-bg: rgba(10, 174, 230, 0.08);
    --option-key-text: #0b5f7e;
    --ad-bg: rgba(255, 255, 255, 0.68);
    --ad-border: rgba(17, 67, 120, 0.16);
    --ad-text: rgba(19, 35, 58, 0.72);
    --icon-bg: linear-gradient(140deg, rgba(10, 174, 230, 0.12), rgba(255, 142, 101, 0.16));
    --theme-toggle-bg: rgba(255, 255, 255, 0.78);
    --theme-toggle-border: rgba(17, 67, 120, 0.14);
    --theme-toggle-ring: 0 0 0 4px rgba(10, 174, 230, 0.14);
    --success-badge-bg: rgba(46, 204, 113, 0.14);
    --success-badge-text: #167d41;
    --danger-badge-bg: rgba(255, 107, 107, 0.12);
    --danger-badge-text: #ba3d3d;
    --warning-badge-bg: rgba(255, 205, 87, 0.18);
    --warning-badge-text: #8a6200;
    --primary-shadow: 0 16px 30px rgba(10, 174, 230, 0.18);
    --alert-success-bg: rgba(46, 204, 113, 0.1);
    --alert-success-border: rgba(46, 204, 113, 0.22);
    --alert-danger-bg: rgba(255, 107, 107, 0.1);
    --alert-danger-border: rgba(255, 107, 107, 0.2);
    --interactive-hover-border: rgba(10, 174, 230, 0.28);
    --selected-border: rgba(10, 174, 230, 0.34);
    --selected-bg: rgba(10, 174, 230, 0.1);
    --correct-border: rgba(46, 204, 113, 0.34);
    --review-flag-text: #203754;
    --palette-active-border: rgba(10, 174, 230, 0.34);
    --palette-active-ring: rgba(10, 174, 230, 0.34);
    --palette-not-answered-bg: linear-gradient(135deg, rgba(255, 113, 113, 0.18), rgba(255, 153, 102, 0.14));
    --palette-not-answered-border: rgba(219, 72, 72, 0.34);
    --palette-not-answered-text: #8e1f1f;
    --palette-answered-bg: linear-gradient(135deg, rgba(50, 210, 125, 0.2), rgba(14, 169, 95, 0.14));
    --palette-answered-border: rgba(46, 204, 113, 0.34);
    --palette-answered-text: #0b5c2f;
    --palette-review-bg: linear-gradient(135deg, rgba(255, 205, 87, 0.28), rgba(255, 158, 44, 0.16));
    --palette-review-border: rgba(255, 205, 87, 0.34);
    --legend-active: rgba(10, 174, 230, 0.82);
    --legend-not-answered: rgba(255, 107, 107, 0.82);
    --legend-answered: rgba(46, 204, 113, 0.82);
    --legend-review: rgba(255, 205, 87, 0.82);
    --hero-accent-bg: linear-gradient(140deg, rgba(10, 174, 230, 0.12), rgba(255, 142, 101, 0.1)), var(--panel-strong);
    --heading-text: #ff0000;
    --explanation-text: #0b5fda;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 100%;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    background: var(--body-background);
    color: var(--text);
    min-height: 100vh;
    transition: background 0.25s ease, color 0.25s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.site-shell {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.site-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    pointer-events: none;
}

.site-orb--one {
    top: -80px;
    left: -40px;
    width: 260px;
    height: 260px;
    background: var(--orb-one-bg);
}

.site-orb--two {
    right: -80px;
    bottom: -60px;
    width: 320px;
    height: 320px;
    background: var(--orb-two-bg);
}

.topbar,
.page {
    position: relative;
    z-index: 1;
}

.topbar {
    max-width: var(--container);
    margin: 18px auto 0;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: sticky;
    top: 12px;
    background: var(--panel-strong);
    backdrop-filter: blur(18px);
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: 0 20px 48px rgba(3, 10, 20, 0.22);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand strong {
    font-family: "Space Grotesk", sans-serif;
    letter-spacing: -0.03em;
    display: block;
    margin-bottom: 4px;
    font-size: 1.08rem;
}

h1,
h2,
h3 {
    font-family: "Roboto", sans-serif;
    letter-spacing: -0.03em;
    color: var(--heading-text);
}

.brand__logo {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    padding: 4px;
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    overflow: hidden;
}

.brand__logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 12px;
}

.brand small,
.muted {
    color: var(--muted);
}

.brand small {
    display: block;
    line-height: 1.45;
}

.topbar__nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 6px;
    border-radius: 999px;
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.topbar__right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    flex: 1;
}

.topbar__support {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding: 6px;
    border-radius: 999px;
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
}

.topbar__nav form {
    display: flex;
}

.topbar__chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--surface-border);
    background: var(--surface-bg);
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.3;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.topbar__chip:hover {
    transform: translateY(-1px);
    border-color: var(--interactive-hover-border);
}

.topbar__chip--accent {
    border-color: rgba(93, 214, 255, 0.22);
    background: rgba(93, 214, 255, 0.12);
}

.topbar__action,
.topbar__nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.topbar__nav-link {
    color: var(--text);
    border: 1px solid transparent;
}

.topbar__nav-link--button {
    background: transparent;
    cursor: pointer;
}

.topbar__nav-link:hover,
.topbar__nav-link:focus-visible {
    transform: translateY(-1px);
    background: var(--selected-bg);
    border-color: var(--interactive-hover-border);
    outline: none;
}

.topbar__nav form .btn {
    min-height: 44px;
}

.topbar__action {
    position: relative;
    color: #fff;
    box-shadow: none;
}

.topbar__action:hover,
.topbar__action:focus-visible {
    transform: translateY(-1px);
    outline: none;
    box-shadow: 0 12px 26px rgba(3, 10, 20, 0.18);
}

.topbar__action--call {
    background: linear-gradient(135deg, #ff6b6b, #ff8e65);
}

.topbar__action--chat {
    background: linear-gradient(135deg, #14c671, #08a77a);
}

.topbar__action-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    flex-shrink: 0;
}

.topbar__action-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.content-stack {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.site-footer {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px 48px;
    position: relative;
    z-index: 1;
}

.footer-box {
    display: grid;
    gap: 18px;
    justify-items: center;
    text-align: center;
}

.footer-box h2 {
    margin: 8px 0 6px;
}

.footer-box p {
    margin: 0;
}

.social-icon-list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.social-icon-link {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border: 1px solid var(--surface-border);
    background: var(--surface-bg);
    color: var(--text);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
    flex: 0 0 auto;
}

.social-icon-link:hover {
    transform: translateY(-2px);
    border-color: var(--interactive-hover-border);
    background: var(--selected-bg);
}

.social-icon-link svg {
    width: 22px;
    height: 22px;
    display: block;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    color: var(--muted);
    scrollbar-width: thin;
}

.footer-links a,
.footer-link-button {
    white-space: nowrap;
    flex: 0 0 auto;
}

.footer-links a {
    transition: color 0.18s ease;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-link-button {
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.page {
    max-width: var(--container);
    margin: 0 auto;
    padding: 12px 20px 60px;
}

.hero,
.section-grid,
.auth-shell,
.runner-layout,
.section-header,
.stats-grid,
.review-stack {
    margin-top: 28px;
}

.hero {
    display: grid;
    grid-template-columns: 1.25fr 0.85fr;
    gap: 24px;
    align-items: stretch;
}

.hero__copy,
.hero__panel,
.glass-card {
    background: var(--panel);
    backdrop-filter: blur(16px);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.hero__copy {
    padding: 42px;
}

.hero__copy h1,
.section-header h1,
.subject-hero h1 {
    margin: 10px 0 18px;
}

.hero__copy h1 {
    font-size: clamp(2rem, 3vw, 2.9rem);
    line-height: 1.12;
}

.section-header h1,
.subject-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4.6rem);
    line-height: 0.96;
}

.hero__copy p,
.lead {
    color: var(--soft-text);
    font-size: 1.05rem;
    line-height: 1.7;
}

.hero__actions,
.pill-row,
.form-grid,
.runner-actions,
.subject-hero__meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.hero__stats,
.stats-grid,
.card-grid {
    display: grid;
    gap: 18px;
}

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

.metric-card {
    padding: 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--metric-bg);
}

.metric-card strong {
    display: block;
    font-size: 2rem;
    margin-bottom: 6px;
}

.metric-card--compact {
    min-width: 180px;
}

.hero__panel,
.glass-card,
.result-hero,
.subject-hero,
.runner-main,
.runner-sidebar {
    padding: 30px;
}

.feature-list,
.leaderboard-list,
.answer-summary-list,
.insight-list,
.review-stack {
    display: grid;
    gap: 14px;
}

.feature-list {
    margin: 18px 0 0;
    padding-left: 18px;
    color: var(--feature-text);
    line-height: 1.7;
}

.panel-badge,
.eyebrow,
.badge,
.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.eyebrow,
.panel-badge {
    color: var(--primary);
}

.badge,
.pill {
    border: 1px solid var(--surface-border);
    background: var(--surface-bg);
    color: var(--text);
    padding: 8px 12px;
}

.badge--success {
    background: var(--success-badge-bg);
    color: var(--success-badge-text);
}

.badge--danger {
    background: var(--danger-badge-bg);
    color: var(--danger-badge-text);
}

.badge--warning {
    background: var(--warning-badge-bg);
    color: var(--warning-badge-text);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 22px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-deep));
    color: var(--btn-text);
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--primary-shadow);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn--ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--ghost-border);
    box-shadow: none;
}

.btn--runner-prev,
.btn--runner-next {
    color: #fff;
    border: none;
    box-shadow: 0 16px 30px rgba(3, 10, 20, 0.18);
}

.btn--runner-prev {
    background: linear-gradient(135deg, #ffb347, #ff7a18);
}

.btn--runner-next {
    background: linear-gradient(135deg, #32d27d, #0ea95f);
}

.btn--runner-prev:hover,
.btn--runner-next:hover,
.btn--runner-prev:focus-visible,
.btn--runner-next:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(3, 10, 20, 0.24);
    outline: none;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--theme-toggle-border);
    background: var(--theme-toggle-bg);
    color: var(--text);
    backdrop-filter: blur(14px);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
}

.theme-toggle__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: var(--theme-toggle-ring);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.theme-toggle[data-theme="light"] .theme-toggle__dot {
    transform: scale(1.08);
}

.btn--block {
    width: 100%;
}

.btn--small {
    padding: 10px 16px;
}

.runner-actions {
    margin-top: 26px;
    padding-top: 6px;
}

.section-grid {
    display: grid;
    gap: 20px;
}

.section-grid--split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-header,
.subject-hero,
.result-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.section-header h1,
.subject-hero h1 {
    margin: 8px 0 10px;
    font-size: clamp(2.1rem, 4vw, 3.2rem);
}

.section-heading h2,
.glass-card h2,
.runner-main h1,
.result-hero h1 {
    margin: 10px 0 12px;
}

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

.exam-card {
    display: grid;
    gap: 14px;
}

.exam-card__head,
.review-card__head,
.question-card__head,
.answer-summary-row,
.leaderboard-row,
.insight-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.exam-card__icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: var(--icon-bg);
    color: var(--primary);
    font-weight: 800;
}

.exam-card p,
.empty-state p,
.muted,
.leaderboard-row small,
.insight-row span,
.answer-summary-row p {
    color: var(--muted);
}

.exam-card__meta,
.review-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: 0.92rem;
}

.auth-shell {
    display: grid;
    grid-template-columns: 0.95fr 0.8fr;
    gap: 24px;
    align-items: center;
    min-height: calc(100vh - 180px);
}

.auth-copy h1 {
    font-size: clamp(2.4rem, 4vw, 3.4rem);
    margin: 8px 0 12px;
}

.auth-stack {
    display: grid;
    gap: 24px;
}

.auth-form-card,
.auth-alt-card {
    display: grid;
    gap: 16px;
}

.auth-divider {
    position: relative;
    text-align: center;
    color: var(--muted);
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-divider::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 1px solid var(--surface-border);
}

.auth-divider span {
    position: relative;
    padding: 0 14px;
    background: var(--panel);
}

.auth-provider-button {
    min-height: 52px;
}

.auth-grid {
    display: grid;
    gap: 14px;
}

.auth-grid--otp {
    grid-template-columns: 170px minmax(0, 1fr);
    align-items: end;
}

.auth-status {
    min-height: 24px;
    margin: 0;
}

.auth-status.is-error {
    color: var(--danger);
}

.auth-status.is-success {
    color: var(--success);
}

.firebase-recaptcha {
    min-height: 78px;
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-modal[hidden] {
    display: none;
}

.auth-modal__backdrop {
    position: absolute;
    inset: 0;
    border: none;
    background: rgba(3, 10, 20, 0.58);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.auth-modal__card {
    position: relative;
    z-index: 1;
    width: min(640px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    display: grid;
    gap: 16px;
    padding: 28px;
}

.auth-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

body.has-auth-modal {
    overflow: hidden;
}

.form-card {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    color: var(--label-text);
    font-weight: 600;
}

.field input,
.field select,
.field textarea,
.search-box input {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--field-border);
    background: var(--field-bg);
    color: var(--text);
    outline: none;
}

.field input::placeholder,
.field textarea::placeholder,
.search-box input::placeholder {
    color: var(--placeholder);
}

.field textarea {
    resize: vertical;
    min-height: 110px;
}

.center {
    text-align: center;
}

.alert {
    padding: 16px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.alert--success {
    background: var(--alert-success-bg);
    border-color: var(--alert-success-border);
}

.alert--error {
    background: var(--alert-danger-bg);
    border-color: var(--alert-danger-border);
}

.ad-shell {
    margin: 20px 0 28px;
}

.ad-shell__label {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.ad-shell__frame {
    min-height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    border: 1px dashed var(--ad-border);
    background: var(--ad-bg);
    color: var(--ad-text);
    text-align: center;
    padding: 16px;
}

.ad-shell__frame--live {
    display: block;
    padding: 0;
    border-style: solid;
    overflow: hidden;
}

.ad-shell__frame--live .adsbygoogle {
    width: 100%;
    min-height: 96px;
}

.ad-shell--bottom {
    margin-top: 36px;
    margin-bottom: 0;
}

.ad-shell--runner {
    margin: 0;
}

.ad-shell--runner .ad-shell__frame {
    min-height: 320px;
}

.ad-shell--runner .ad-shell__frame--live .adsbygoogle {
    min-height: 320px;
}

.leaderboard-row {
    padding: 16px 18px;
    border-radius: var(--radius-md);
    background: var(--surface-bg-soft);
    border: 1px solid var(--surface-border-soft);
}

.leaderboard-row--link:hover {
    border-color: var(--interactive-hover-border);
}

.leaderboard-row__score {
    color: var(--primary);
    font-weight: 800;
}

.runner-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}

.runner-main {
    min-width: 0;
}

.runner-sidebar {
    display: grid;
    gap: 16px;
}

.runner-main__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 22px;
}

.runner-timer {
    text-align: right;
}

.runner-timer strong {
    display: block;
    font-size: 2rem;
}

.runner-questions {
    display: grid;
}

.question-card {
    display: none;
    gap: 18px;
}

.question-card.is-active {
    display: grid;
}

.question-card h2 {
    color: var(--heading-text);
}

.option-list {
    display: grid;
    gap: 12px;
}

.option-pill {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--option-border);
    background: var(--option-bg);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.option-pill:hover {
    transform: translateY(-1px);
    border-color: var(--option-hover-border);
    background: var(--option-hover-bg);
}

.option-pill__content {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.option-pill strong {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--option-key-bg);
    color: var(--option-key-text);
    flex-shrink: 0;
}

.option-pill input {
    margin: 0;
    flex-shrink: 0;
}

.option-pill__text {
    flex: 1;
    min-width: 0;
    line-height: 1.5;
}

.option-pill--static {
    cursor: default;
}

.option-pill--static:hover {
    transform: none;
}

.option-pill.is-selected {
    border-color: var(--option-selected-border);
    background: var(--option-selected-bg);
    box-shadow: var(--option-selected-shadow);
}

.option-pill.is-correct {
    border-color: var(--correct-border);
    background: var(--option-correct-bg);
}

.option-pill.is-selected strong {
    background: rgba(255, 255, 255, 0.16);
}

html[data-theme="light"] .option-pill.is-selected strong {
    background: rgba(255, 255, 255, 0.82);
}

.review-flag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--review-flag-text);
}

.review-flag--prominent {
    width: fit-content;
    margin-top: 10px;
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 205, 87, 0.52);
    background: linear-gradient(135deg, rgba(255, 205, 87, 0.26), rgba(255, 142, 101, 0.18));
    font-weight: 800;
    font-size: 0.96rem;
    letter-spacing: 0.01em;
    box-shadow: 0 16px 34px rgba(255, 142, 101, 0.14);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.review-flag--prominent:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 205, 87, 0.7);
    box-shadow: 0 18px 38px rgba(255, 142, 101, 0.2);
}

.review-flag--prominent input {
    width: 19px;
    height: 19px;
    margin: 0;
    accent-color: #ffb300;
}

.review-flag--prominent span {
    color: var(--review-flag-text);
}

.review-flag--prominent:has(input:checked) {
    border-color: rgba(255, 205, 87, 0.82);
    background: linear-gradient(135deg, rgba(255, 205, 87, 0.34), rgba(255, 142, 101, 0.24));
    box-shadow: 0 20px 40px rgba(255, 142, 101, 0.24);
}

.review-flag--prominent:has(input:checked) span {
    color: var(--text);
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.palette-grid__item {
    padding: 12px 0;
    border-radius: 14px;
    border: 1px solid var(--palette-not-answered-border);
    background: var(--palette-not-answered-bg);
    color: var(--palette-not-answered-text);
    cursor: pointer;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(3, 10, 20, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.palette-grid__item:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(3, 10, 20, 0.12);
}

.palette-grid__item.is-active {
    border-color: var(--palette-active-border);
    box-shadow: 0 0 0 3px var(--palette-active-ring), 0 16px 32px rgba(3, 10, 20, 0.14);
}

.palette-grid__item.is-answered {
    border-color: var(--palette-answered-border);
    background: var(--palette-answered-bg);
    color: var(--palette-answered-text);
}

.palette-grid__item.is-review {
    border-color: var(--palette-review-border);
    background: var(--palette-review-bg);
    color: var(--btn-text);
}

.runner-legend {
    display: grid;
    gap: 10px;
    color: var(--muted);
}

.legend {
    width: 12px;
    height: 12px;
    display: inline-block;
    border-radius: 999px;
    margin-right: 6px;
}

.legend--active {
    background: var(--legend-active);
}

.legend--not-answered {
    background: var(--legend-not-answered);
}

.legend--answered {
    background: var(--legend-answered);
}

.legend--review {
    background: var(--legend-review);
}

.result-hero,
.subject-hero {
    background: var(--hero-accent-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
}

.result-score strong {
    display: block;
    font-size: clamp(2.8rem, 5vw, 4.4rem);
    color: var(--primary);
}

.answer-summary-row,
.review-card {
    gap: 18px;
}

.answer-summary-row p {
    margin: 6px 0 0;
}

.review-meta {
    margin-top: 6px;
}

.explanation-box {
    padding: 18px;
    border-radius: var(--radius-md);
    background: var(--surface-bg);
    border: 1px solid var(--surface-border-soft);
    color: var(--explanation-text);
}

.explanation-box strong,
.explanation-box p {
    color: var(--explanation-text);
}

.admin-actions {
    display: grid;
    gap: 14px;
    align-content: start;
}

.admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkbox-grid,
.subject-chip-grid,
.exam-list-admin {
    display: grid;
    gap: 12px;
}

.checkbox-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkbox-card,
.subject-chip,
.exam-list-admin__item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border-soft);
    background: var(--surface-bg-soft);
}

.checkbox-card input {
    margin-top: 4px;
}

.checkbox-card span,
.subject-chip strong {
    display: grid;
    gap: 4px;
}

.subject-chip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.subject-chip {
    justify-content: space-between;
    align-items: center;
}

.exam-list-admin__item {
    display: grid;
    gap: 12px;
}

.exam-editor {
    padding: 18px;
    border-radius: var(--radius-lg);
}

.exam-editor__summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    list-style: none;
}

.exam-editor__summary::-webkit-details-marker {
    display: none;
}

.exam-editor__summary small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.exam-editor__form {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--surface-border-soft);
}

.search-box {
    width: min(360px, 100%);
}

[data-filter-item].is-hidden {
    display: none;
}

@media (max-width: 1080px) {
    .hero,
    .auth-shell,
    .runner-layout,
    .section-grid--split {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero__stats,
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-grid--otp {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .topbar,
    .page,
    .site-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .topbar {
        align-items: center;
        flex-direction: column;
        position: relative;
        top: 0;
        padding-top: 18px;
        padding-bottom: 18px;
    }

    .brand,
    .topbar__right,
    .topbar__support,
    .topbar__nav,
    .topbar__nav form,
    .content-stack,
    .footer-box,
    .social-icon-list {
        justify-content: center;
        justify-items: center;
        text-align: center;
        width: 100%;
    }

    .brand {
        text-align: center;
    }

    .brand > span:last-child,
    .topbar__right {
        display: grid;
        justify-items: center;
    }

    .topbar__right {
        gap: 14px;
    }

    .topbar__support,
    .topbar__nav {
        border-radius: 22px;
        padding: 10px;
    }

    .topbar__nav-link,
    .topbar__nav form,
    .topbar__nav form .btn {
        width: 100%;
    }

    .topbar__support .topbar__action,
    .topbar__support .theme-toggle {
        width: auto;
        flex: 1 1 0;
        min-width: 0;
    }

    .topbar__action,
    .topbar__nav-link,
    .theme-toggle {
        justify-content: center;
    }

    .hero__copy,
    .hero__panel,
    .glass-card,
    .result-hero,
    .subject-hero,
    .runner-main,
    .runner-sidebar {
        padding: 22px;
        border-radius: 24px;
    }

    .hero__stats,
    .stats-grid,
    .card-grid {
        grid-template-columns: 1fr;
    }

    .hero__stats,
    .stats-grid {
        justify-items: center;
    }

    .metric-card,
    .metric-card--compact {
        width: min(100%, 320px);
        text-align: center;
    }

    .palette-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .checkbox-grid,
    .subject-chip-grid,
    .admin-metrics {
        grid-template-columns: 1fr;
    }

    .section-header,
    .subject-hero,
    .result-hero,
    .runner-main__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .exam-editor__summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .runner-timer {
        text-align: left;
    }

    .footer-links,
    .social-icon-list {
        justify-content: flex-start;
    }

    .auth-modal {
        padding: 16px;
    }

    .auth-modal__card {
        padding: 22px;
    }

    .auth-modal__header {
        flex-direction: column;
        align-items: flex-start;
    }
}
