/* MCQIndia JEE - theme
 *
 * Matches the CBSE, Olympiad and main-site pages: same palette, fonts, logo,
 * header, cards and dark mode. The JEE pages are Bootstrap 5.3 markup, so this
 * file works by (1) setting the site tokens, (2) pointing Bootstrap's own
 * variables at them and (3) restyling the components the pages use.
 * Dark mode follows the visitor's system setting (templates/header.php sets
 * data-bs-theme on <html>).
 */

/* ------------------------------------------------------------------ tokens */
:root,
[data-bs-theme="light"] {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-2: #eef3f9;
    --ink: #14233a;
    --muted: #55657c;
    --line: #d8e0eb;
    --accent: #1b4f9c;
    --accent-hover: #153f7e;
    --accent-soft: #e4edf9;
    --on-accent: #ffffff;
    --filament: #c9740b;
    --filament-soft: #fff1dc;
    --hero-a: #e8f0fc;
    --hero-b: #fff4e3;
    --ok: #1b7a4b;
    --ok-soft: #e1f3e8;
    --bad: #b3261e;
    --bad-soft: #fbe5e3;
    --shadow: 0 1px 2px rgba(20, 35, 58, .06), 0 8px 24px rgba(20, 35, 58, .06);
    --shadow-lg: 0 2px 4px rgba(20, 35, 58, .06), 0 18px 44px rgba(20, 35, 58, .10);

    --font-display: "Familjen Grotesk", "Trebuchet MS", system-ui, sans-serif;
    --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

    --radius: 14px;
    --radius-sm: 10px;

    /* gradients used by the dashboard / admin stat icons */
    --primary-gradient: linear-gradient(135deg, #2f6bd6, #1b4f9c);
    --success-gradient: linear-gradient(135deg, #2e9e6b, #1b7a4b);
    --warning-gradient: linear-gradient(135deg, #e8a13a, #c9740b);
    --danger-gradient: linear-gradient(135deg, #e0584f, #b3261e);

    /* Bootstrap -> site tokens */
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--ink);
    --bs-body-font-family: var(--font-body);
    --bs-body-font-size: 1.0625rem;
    --bs-body-line-height: 1.55;
    --bs-secondary-color: var(--muted);
    --bs-border-color: var(--line);
    --bs-heading-color: var(--ink);
    --bs-primary: #1b4f9c;
    --bs-primary-rgb: 27, 79, 156;
    --bs-link-color: #1b4f9c;
    --bs-link-color-rgb: 27, 79, 156;
    --bs-link-hover-color: #153f7e;
    --bs-link-hover-color-rgb: 21, 63, 126;
    --bs-primary-bg-subtle: #e4edf9;
    --bs-primary-border-subtle: #bcd0ee;
    --bs-primary-text-emphasis: #153f7e;
    --bs-success: #1b7a4b;
    --bs-success-rgb: 27, 122, 75;
    --bs-danger: #b3261e;
    --bs-danger-rgb: 179, 38, 30;
    --bs-warning: #c9740b;
    --bs-warning-rgb: 201, 116, 11;
    --bs-border-radius: 10px;
    --bs-border-radius-lg: 14px;
}

[data-bs-theme="dark"] {
    --bg: #0d1626;
    --surface: #152238;
    --surface-2: #1b2c48;
    --ink: #e6edf7;
    --muted: #9fb0c8;
    --line: #29395a;
    --accent: #7fb0ff;
    --accent-hover: #a3c5ff;
    --accent-soft: #1d3157;
    --on-accent: #0d1626;
    --filament: #f0a850;
    --filament-soft: #3a2a12;
    --hero-a: #142443;
    --hero-b: #2a2012;
    --ok: #5fd39a;
    --ok-soft: #12382a;
    --bad: #ff8a80;
    --bad-soft: #3d1b1b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 18px 44px rgba(0, 0, 0, .35);

    --primary-gradient: linear-gradient(135deg, #3b78e0, #1f5bb5);
    --success-gradient: linear-gradient(135deg, #2e9e6b, #1b7a4b);
    --warning-gradient: linear-gradient(135deg, #e8a13a, #c9740b);
    --danger-gradient: linear-gradient(135deg, #e0584f, #b3261e);

    --bs-primary: #7fb0ff;
    --bs-primary-rgb: 127, 176, 255;
    --bs-link-color: #7fb0ff;
    --bs-link-color-rgb: 127, 176, 255;
    --bs-link-hover-color: #a3c5ff;
    --bs-link-hover-color-rgb: 163, 197, 255;
    --bs-primary-bg-subtle: #1d3157;
    --bs-primary-border-subtle: #2c4a80;
    --bs-primary-text-emphasis: #a3c5ff;
    --bs-success: #5fd39a;
    --bs-success-rgb: 95, 211, 154;
    --bs-danger: #ff8a80;
    --bs-danger-rgb: 255, 138, 128;
    --bs-warning: #f0a850;
    --bs-warning-rgb: 240, 168, 80;
}

/* -------------------------------------------------------------------- base */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body > main {
    flex: 1 0 auto;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--ink);
}

a {
    text-underline-offset: 2px;
}

hr {
    border-color: var(--line);
    opacity: 1;
}

.container {
    max-width: 1080px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* the admin screens have wide tables */
body.is-admin .container {
    max-width: 1240px;
}

body.is-admin {
    --bs-body-font-size: .975rem;
}

.kicker {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--filament);
}

.text-orange { color: var(--filament) !important; }
.bg-orange { background-color: var(--filament) !important; }
.border-orange { border-color: var(--filament) !important; }

/* ------------------------------------------------------------------ header */
/* Top bar matches the main mcqindia.com header (brand, section links, JEE current);
   the thin bar below holds the JEE practice pages and the account. */
.site-top {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.site-bar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0 12px;
    min-height: 64px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -.01em;
    color: var(--ink);
    white-space: nowrap;
}

.brand:hover { color: var(--ink); }
.brand svg { width: 38px; height: 38px; flex: none; }
.brand .dom { color: var(--muted); font-weight: 500; }

.exam-tag {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    margin-left: 4px;
}

.site-mainnav {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    font-weight: 600;
}

.site-mainnav a,
.site-mainnav .off {
    padding: 10px 16px;
    border-radius: 12px;
    white-space: nowrap;
}

.site-mainnav a {
    text-decoration: none;
    color: var(--muted);
}

.site-mainnav a:hover,
.site-mainnav a:focus-visible {
    background: var(--accent-soft);
    color: var(--ink);
    outline: none;
}

.site-mainnav a[aria-current="page"] {
    background: var(--accent-soft);
    color: var(--ink);
}

.site-mainnav .off {
    color: var(--muted);
    opacity: .55;
    cursor: not-allowed;
    user-select: none;
}

.site-menu-toggle {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font-size: 1.5rem;
    line-height: 1;
    padding: .3rem .55rem;
}

/* JEE section bar */
.site-subbar {
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.site-subbar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 12px;
    min-height: 46px;
    padding-top: 4px;
    padding-bottom: 4px;
}

.site-subnav,
.site-account {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    font-size: 15px;
    font-weight: 600;
}

.site-subnav a,
.site-account a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 9px;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
}

.site-subnav a:hover,
.site-subnav a:focus-visible,
.site-account a:hover,
.site-account a:focus-visible {
    background: var(--accent-soft);
    color: var(--ink);
    outline: none;
}

.site-subnav a.active,
.site-account a.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.site-subnav .dropdown-toggle::after { vertical-align: .15em; }

.site-subnav-note {
    color: var(--muted);
    font-weight: 400;
    font-size: 14.5px;
    padding: 6px 0;
}

.site-user {
    color: var(--muted);
    font-weight: 400;
    padding: 6px 8px;
}

.site-account a.site-account-cta {
    background: var(--accent);
    color: var(--on-accent);
}

.site-account a.site-account-cta:hover,
.site-account a.site-account-cta:focus-visible {
    background: var(--accent-hover);
    color: var(--on-accent);
}

@media (max-width: 1100px) {
    .site-mainnav a,
    .site-mainnav .off { padding: 10px 12px; }
}

/* phones and tablets: section links fold into the menu button */
@media (max-width: 991.98px) {
    .site-menu {
        flex-basis: 100%;
    }

    .site-mainnav {
        flex-wrap: wrap;
        padding: 6px 0 12px;
        border-top: 1px solid var(--line);
    }

    .site-mainnav a,
    .site-mainnav .off { padding: 8px 12px; }

    .site-subnav a,
    .site-account a { padding: 6px 10px; }
}

@media (max-width: 700px) {
    .brand { font-size: 20px; }
    .brand svg { width: 32px; height: 32px; }
}

@media (max-width: 420px) {
    .brand .dom { display: none; }
    .site-subnav a .bi,
    .site-account a .bi,
    .site-user .bi { display: none; }
}

/* --------------------------------------------------------------- dropdowns */
.dropdown-menu {
    --bs-dropdown-bg: var(--surface);
    --bs-dropdown-color: var(--ink);
    --bs-dropdown-border-color: var(--line);
    --bs-dropdown-link-color: var(--ink);
    --bs-dropdown-link-hover-color: var(--ink);
    --bs-dropdown-link-hover-bg: var(--accent-soft);
    --bs-dropdown-link-active-color: var(--on-accent);
    --bs-dropdown-link-active-bg: var(--accent);
    --bs-dropdown-divider-bg: var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
}

.dropdown-item {
    border-radius: 8px;
    font-size: 15px;
    padding: 8px 12px;
}

/* ------------------------------------------------------------------ footer */
.site-footer {
    flex-shrink: 0;
    margin-top: 3.5rem;
    background: transparent;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}

.site-footer .footer-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    color: var(--ink);
}

.site-footer .footer-brand .dom { color: var(--muted); font-weight: 500; }

.footer-link {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    transition: color .15s ease;
}

.footer-link:hover { color: var(--accent); }

/* -------------------------------------------------------------- home page */
.site-hero {
    background: linear-gradient(135deg, var(--hero-a), var(--hero-b));
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 3rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow);
}

.site-hero-grid {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 2rem;
    align-items: center;
}

.site-hero h1 {
    font-size: clamp(34px, 5.5vw, 52px);
    line-height: 1.05;
    margin: 10px 0 14px;
    letter-spacing: -.02em;
}

.site-hero h1 em {
    font-style: normal;
    color: var(--accent);
}

.site-hero .lede {
    color: var(--muted);
    font-size: 19px;
    max-width: 52ch;
    margin: 0 0 1.5rem;
}

.stat-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-tile {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
}

.stat-tile b {
    display: block;
    font-family: var(--font-display);
    font-size: 32px;
    line-height: 1;
    color: var(--accent);
}

.stat-tile span {
    color: var(--muted);
    font-size: 14px;
}

.section-head h2 {
    font-size: clamp(24px, 4vw, 30px);
    margin: 0 0 6px;
}

.section-head p {
    color: var(--muted);
    margin: 0 0 1.25rem;
    max-width: 60ch;
}

.subject-card,
.feature-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform .15s ease, border-color .15s ease;
    height: 100%;
}

.subject-card:hover,
.feature-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.subject-card .card-body,
.feature-card .card-body {
    padding: 1.15rem;
}

.ico {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 21px;
    margin-bottom: 12px;
    background: var(--accent-soft);
    color: var(--accent);
}

.ico-ok { background: var(--ok-soft); color: var(--ok); }
.ico-warm { background: var(--filament-soft); color: var(--filament); }
.ico-bad { background: var(--bad-soft); color: var(--bad); }

.subject-card h3,
.feature-card h3 {
    font-size: 20px;
    margin: 0 0 6px;
}

.feature-card p {
    color: var(--muted);
    font-size: 15px;
    margin: 0;
}

.cta-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 24px;
    margin-top: 1.25rem;
    padding: 1.15rem 1.35rem;
    background: var(--filament-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.cta-band strong {
    display: block;
    font-family: var(--font-display);
    font-size: 19px;
}

.cta-band span {
    color: var(--muted);
    font-size: 15px;
}

/* legacy hero (kept so older markup still looks right) */
.hero-section {
    background: linear-gradient(135deg, var(--hero-a), var(--hero-b));
    border: 1px solid var(--line);
    color: var(--ink);
    border-radius: 22px;
    padding: 3rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

@media (max-width: 860px) {
    .site-hero { padding: 1.75rem 1.25rem; border-radius: var(--radius); }
    .site-hero-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------- cards */
.card {
    --bs-card-bg: var(--surface);
    --bs-card-border-color: var(--line);
    --bs-card-cap-bg: transparent;
    --bs-card-color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius) !important;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.card-header {
    border-bottom: 1px solid var(--line) !important;
    border-top-left-radius: var(--radius) !important;
    border-top-right-radius: var(--radius) !important;
    background: transparent;
}

.card-header.border-0 {
    border-bottom: 0 !important;
}

.modal-content {
    --bs-modal-bg: var(--surface);
    --bs-modal-color: var(--ink);
    --bs-modal-border-color: var(--line);
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-lg);
}

.stat-card {
    border: 1px solid var(--line);
    transition: transform .15s ease, border-color .15s ease;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

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

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    color: #fff;
}

.stat-card .stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--ink);
}

.stat-card .stat-label {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

a.card:hover { border-color: var(--accent); }

/* ------------------------------------------------------------- auth pages */
/* Login and Register: the form beside a short "what you get" panel */
.auth {
    min-height: calc(100vh - 300px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-shell {
    width: 100%;
    max-width: 900px;
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.auth-aside {
    padding: 2.5rem 2.25rem;
    background: linear-gradient(135deg, var(--hero-a), var(--hero-b));
    border-right: 1px solid var(--line);
}

.auth-aside h2 {
    font-size: 1.6rem;
    margin: .35rem 0 1.5rem;
}

.auth-points {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1.1rem;
}

.auth-points li {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
}

.auth-points .ico {
    width: 38px;
    height: 38px;
    font-size: 18px;
    margin: 0;
    flex-shrink: 0;
}

.auth-points strong {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
}

.auth-points span {
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.45;
}

.auth-main {
    padding: 2.5rem 2.5rem 2.25rem;
}

.auth-main h1 {
    font-size: 1.9rem;
    margin: 0 0 .3rem;
}

.auth-sub {
    color: var(--muted);
    margin: 0 0 1.5rem;
}

.auth-main .form-label {
    font-weight: 600;
    margin-bottom: .35rem;
}

.auth-main .form-control {
    padding: .7rem .9rem;
    border-radius: 10px;
}

.auth-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.auth-label-row a {
    font-size: .9rem;
    text-decoration: none;
}

/* password field with a show/hide button inside it */
.auth-password {
    position: relative;
}

.auth-password .form-control {
    padding-right: 3rem;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: .4rem;
    transform: translateY(-50%);
    border: 0;
    background: none;
    color: var(--muted);
    padding: .35rem .5rem;
    border-radius: 8px;
    line-height: 1;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
    color: var(--ink);
    background: var(--surface-2);
    outline: none;
}

.auth-hint {
    font-size: .875rem;
    color: var(--muted);
    margin-top: .35rem;
}

.auth-switch {
    margin: 1.5rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    text-align: center;
    color: var(--muted);
}

.auth-switch a {
    font-weight: 600;
    text-decoration: none;
}

.auth-legal {
    font-size: .85rem;
    color: var(--muted);
    margin: .85rem 0 0;
    text-align: center;
}

/* phones and small tablets: the form first, the panel below it */
@media (max-width: 767.98px) {
    .auth {
        min-height: 0;
    }

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

    .auth-main {
        padding: 1.75rem 1.35rem 1.5rem;
    }

    .auth-aside {
        order: 2;
        padding: 1.5rem 1.35rem;
        border-right: 0;
        border-top: 1px solid var(--line);
    }

    .auth-aside h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
}

/* Saved logins: stop the browser's pale blue/yellow autofill background */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
    -webkit-text-fill-color: var(--ink);
    caret-color: var(--ink);
    transition: background-color 9999s ease-out 0s;
}

/* ------------------------------------------------------------------- forms */
.form-label {
    font-weight: 600;
    font-size: .95rem;
    color: var(--ink);
}

.form-control,
.form-select {
    background-color: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .65rem .9rem;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

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

.form-control:focus,
.form-select:focus {
    background-color: var(--surface);
    color: var(--ink);
    border-color: var(--accent);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--accent) 22%, transparent);
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
    background-color: var(--surface-2);
}

.input-group-text {
    background: var(--surface-2);
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > .input-group-text:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > .form-control:not(:first-child),
.input-group > .input-group-text:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.form-check-input {
    background-color: var(--surface);
    border-color: color-mix(in srgb, var(--muted) 60%, var(--line));
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.form-check-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--accent) 22%, transparent);
}

.form-switch .form-check-input:checked {
    background-color: var(--accent);
}

.form-range::-webkit-slider-thumb { background: var(--accent); }
.form-range::-moz-range-thumb { background: var(--accent); border: 0; }
.form-range::-webkit-slider-runnable-track { background: var(--line); }
.form-range::-moz-range-track { background: var(--line); }
.form-range:focus::-webkit-slider-thumb { box-shadow: 0 0 0 1px var(--bg), 0 0 0 .2rem color-mix(in srgb, var(--accent) 25%, transparent); }

/* ----------------------------------------------------------------- buttons */
.btn {
    --bs-btn-padding-x: 1.1rem;
    --bs-btn-padding-y: .55rem;
    --bs-btn-font-weight: 600;
    --bs-btn-border-radius: 10px;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}

.btn-sm {
    --bs-btn-padding-x: .75rem;
    --bs-btn-padding-y: .3rem;
    --bs-btn-font-size: .875rem;
    --bs-btn-border-radius: 8px;
}

.btn-lg {
    --bs-btn-padding-x: 1.5rem;
    --bs-btn-padding-y: .75rem;
    --bs-btn-font-size: 1.1rem;
    --bs-btn-border-radius: 12px;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn.disabled { transform: none; }

.btn-primary {
    --bs-btn-color: var(--on-accent);
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-color: var(--on-accent);
    --bs-btn-hover-bg: var(--accent-hover);
    --bs-btn-hover-border-color: var(--accent-hover);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
    --bs-btn-active-color: var(--on-accent);
    --bs-btn-active-bg: var(--accent-hover);
    --bs-btn-active-border-color: var(--accent-hover);
    --bs-btn-disabled-color: var(--on-accent);
    --bs-btn-disabled-bg: var(--accent);
    --bs-btn-disabled-border-color: var(--accent);
}

.btn-primary:hover { box-shadow: var(--shadow); }

.btn-outline-primary {
    --bs-btn-color: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-color: var(--on-accent);
    --bs-btn-hover-bg: var(--accent);
    --bs-btn-hover-border-color: var(--accent);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
    --bs-btn-active-color: var(--on-accent);
    --bs-btn-active-bg: var(--accent);
    --bs-btn-active-border-color: var(--accent);
    --bs-btn-disabled-color: var(--accent);
    --bs-btn-disabled-border-color: var(--accent);
}

.btn-outline-secondary {
    --bs-btn-color: var(--muted);
    --bs-btn-border-color: var(--line);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-bg: var(--accent-soft);
    --bs-btn-hover-border-color: var(--accent);
    --bs-btn-active-color: var(--ink);
    --bs-btn-active-bg: var(--accent-soft);
    --bs-btn-active-border-color: var(--accent);
    --bs-btn-disabled-color: var(--muted);
    --bs-btn-disabled-border-color: var(--line);
    background-color: var(--surface);
}

.btn-light {
    --bs-btn-color: var(--ink);
    --bs-btn-bg: var(--surface);
    --bs-btn-border-color: var(--line);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-bg: var(--accent-soft);
    --bs-btn-hover-border-color: var(--accent);
    --bs-btn-active-color: var(--ink);
    --bs-btn-active-bg: var(--accent-soft);
    --bs-btn-active-border-color: var(--accent);
}

.btn-outline-dark {
    --bs-btn-color: var(--ink);
    --bs-btn-border-color: var(--ink);
    --bs-btn-hover-color: var(--bg);
    --bs-btn-hover-bg: var(--ink);
    --bs-btn-hover-border-color: var(--ink);
    --bs-btn-active-color: var(--bg);
    --bs-btn-active-bg: var(--ink);
    --bs-btn-active-border-color: var(--ink);
    --bs-btn-disabled-color: var(--muted);
    --bs-btn-disabled-border-color: var(--line);
}

.btn-dark {
    --bs-btn-color: var(--bg);
    --bs-btn-bg: var(--ink);
    --bs-btn-border-color: var(--ink);
    --bs-btn-hover-color: var(--bg);
    --bs-btn-hover-bg: color-mix(in srgb, var(--ink) 85%, var(--accent));
    --bs-btn-hover-border-color: var(--ink);
    --bs-btn-active-color: var(--bg);
    --bs-btn-active-bg: var(--ink);
    --bs-btn-active-border-color: var(--ink);
}

[data-bs-theme="dark"] .btn-success,
[data-bs-theme="dark"] .btn-danger,
[data-bs-theme="dark"] .btn-warning {
    --bs-btn-color: #0d1626;
    --bs-btn-hover-color: #0d1626;
    --bs-btn-active-color: #0d1626;
    --bs-btn-disabled-color: #0d1626;
}

[data-bs-theme="dark"] .btn-success { --bs-btn-bg: #5fd39a; --bs-btn-border-color: #5fd39a; --bs-btn-hover-bg: #7fe0b0; --bs-btn-hover-border-color: #7fe0b0; --bs-btn-active-bg: #7fe0b0; }
[data-bs-theme="dark"] .btn-danger { --bs-btn-bg: #ff8a80; --bs-btn-border-color: #ff8a80; --bs-btn-hover-bg: #ffa39b; --bs-btn-hover-border-color: #ffa39b; --bs-btn-active-bg: #ffa39b; }
[data-bs-theme="dark"] .btn-warning { --bs-btn-bg: #f0a850; --bs-btn-border-color: #f0a850; --bs-btn-hover-bg: #f5ba70; --bs-btn-hover-border-color: #f5ba70; --bs-btn-active-bg: #f5ba70; }

[data-bs-theme="dark"] .btn-outline-success { --bs-btn-color: #5fd39a; --bs-btn-border-color: #5fd39a; --bs-btn-hover-bg: #5fd39a; --bs-btn-hover-border-color: #5fd39a; --bs-btn-hover-color: #0d1626; --bs-btn-active-bg: #5fd39a; --bs-btn-active-color: #0d1626; }
[data-bs-theme="dark"] .btn-outline-danger { --bs-btn-color: #ff8a80; --bs-btn-border-color: #ff8a80; --bs-btn-hover-bg: #ff8a80; --bs-btn-hover-border-color: #ff8a80; --bs-btn-hover-color: #0d1626; --bs-btn-active-bg: #ff8a80; --bs-btn-active-color: #0d1626; }
[data-bs-theme="dark"] .btn-outline-warning { --bs-btn-color: #f0a850; --bs-btn-border-color: #f0a850; --bs-btn-hover-bg: #f0a850; --bs-btn-hover-border-color: #f0a850; --bs-btn-hover-color: #0d1626; --bs-btn-active-bg: #f0a850; --bs-btn-active-color: #0d1626; }

.btn-close { border-radius: 6px; }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* ------------------------------------------------------- badges and alerts */
.badge {
    font-weight: 600;
    padding: .42em .78em;
    border-radius: 999px;
    letter-spacing: .1px;
}

[data-bs-theme="dark"] .badge.bg-primary,
[data-bs-theme="dark"] .badge.bg-success,
[data-bs-theme="dark"] .badge.bg-danger,
[data-bs-theme="dark"] .badge.bg-warning,
[data-bs-theme="dark"] .badge.bg-info {
    color: #0d1626;
}

.badge.bg-dark { background-color: var(--ink) !important; color: var(--bg); }

[data-bs-theme="dark"] .badge.bg-dark {
    background-color: var(--accent-soft) !important;
    color: var(--accent);
}

.alert {
    border-radius: 12px;
    box-shadow: none;
}

/* --------------------------------------------------------- tables / lists */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ink);
    --bs-table-border-color: var(--line);
    --bs-table-hover-bg: color-mix(in srgb, var(--accent-soft) 55%, transparent);
    --bs-table-hover-color: var(--ink);
}

.table thead th {
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    border-bottom-width: 1px;
    white-space: nowrap;
}

.table-light {
    --bs-table-bg: var(--surface-2);
    --bs-table-color: var(--ink);
    --bs-table-border-color: var(--line);
}

.list-group {
    --bs-list-group-bg: transparent;
    --bs-list-group-color: var(--ink);
    --bs-list-group-border-color: var(--line);
}

.progress {
    --bs-progress-bg: var(--line);
    --bs-progress-bar-bg: var(--accent);
    --bs-progress-border-radius: 999px;
}

.accordion {
    --bs-accordion-bg: transparent;
    --bs-accordion-color: var(--ink);
    --bs-accordion-border-color: var(--line);
    --bs-accordion-btn-color: var(--ink);
    --bs-accordion-btn-bg: transparent;
    --bs-accordion-active-color: var(--accent);
    --bs-accordion-active-bg: transparent;
    --bs-accordion-btn-focus-box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--accent) 22%, transparent);
}

.accordion-button {
    font-family: var(--font-display);
    font-weight: 600;
}

.accordion-button:not(.collapsed) { box-shadow: none; }

[data-bs-theme="dark"] .accordion-button::after { filter: invert(1) brightness(1.6); }

/* ---------------------------------------------------- quiz: options etc. */
.quiz-option {
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: .9rem 1.1rem;
    margin-bottom: .75rem;
    cursor: pointer;
    background: var(--surface);
    transition: border-color .15s ease, background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.quiz-option:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.quiz-option.selected,
.quiz-option.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: var(--shadow);
}

.quiz-option.correct {
    border-color: var(--ok);
    background: var(--ok-soft);
}

.quiz-option.incorrect {
    border-color: var(--bad);
    background: var(--bad-soft);
}

.quiz-option .option-label {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 500;
    margin-right: .85rem;
    flex-shrink: 0;
    transition: background-color .15s ease, color .15s ease;
}

.quiz-option.selected .option-label,
.quiz-option.active .option-label {
    background: var(--accent);
    color: var(--on-accent);
}

.quiz-option.correct .option-label {
    background: var(--ok);
    color: var(--bg);
}

.quiz-option.incorrect .option-label {
    background: var(--bad);
    color: var(--bg);
}

[data-bs-theme="light"] .quiz-option.correct .option-label,
[data-bs-theme="light"] .quiz-option.incorrect .option-label {
    color: #fff;
}

.quiz-progress {
    height: 10px;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.quiz-progress .progress-bar {
    background: var(--accent);
    border-radius: 999px;
}

.question-card {
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.question-number {
    background: var(--accent);
    color: var(--on-accent);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 500;
    margin-right: .85rem;
    flex-shrink: 0;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border: 6px solid;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.score-circle .score-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.score-circle .score-label {
    font-size: .875rem;
    opacity: .85;
    margin-top: .25rem;
}

/* ----------------------------------------------------- admin and misc */
.admin-sidebar .list-group-item {
    border: none;
    border-radius: 10px;
    margin-bottom: 6px;
    color: var(--ink);
    font-weight: 500;
}

.admin-sidebar .list-group-item.active {
    background: var(--accent);
    color: var(--on-accent);
    border: none;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: .45;
}

.shadow-soft { box-shadow: var(--shadow); }
.rounded-premium { border-radius: 22px; }

/* ------------------------------------------- question / option HTML (WYSIWYG) */
.rich-content {
    overflow-wrap: anywhere;
}

.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

.rich-content p { margin-bottom: .35rem; }
.rich-content p:last-child { margin-bottom: 0; }

.rich-content ul,
.rich-content ol {
    padding-left: 1.2rem;
    margin-bottom: .4rem;
}

.rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: .65rem 0;
}

.rich-content table td,
.rich-content table th {
    border: 1px solid var(--line);
    padding: .5rem;
    vertical-align: top;
}

.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4,
.rich-content h5,
.rich-content h6 {
    margin-bottom: .45rem;
    font-family: var(--font-body);
    letter-spacing: 0;
}

.rich-content iframe { max-width: 100%; }

/* Pasted question text often carries its own black text / white background.
   In dark mode, let the page colours win so it stays readable. */
[data-bs-theme="dark"] .rich-content :where(*):not(img):not(svg):not(svg *) {
    color: inherit !important;
    background-color: transparent !important;
}

/* ------------------------------------- Bootstrap utilities, dark-mode fixes */
[data-bs-theme="dark"] .bg-white { background-color: var(--surface) !important; }
[data-bs-theme="dark"] .bg-light { background-color: var(--surface-2) !important; }
[data-bs-theme="dark"] .text-bg-light { background-color: var(--surface-2) !important; color: var(--ink) !important; }
[data-bs-theme="dark"] .text-dark:not(.badge) { color: var(--ink) !important; }
[data-bs-theme="dark"] .text-primary { color: var(--accent) !important; }

/* soft badge/tile colours used by the subject icons */
.bg-primary.bg-opacity-10,
.bg-success.bg-opacity-10,
.bg-warning.bg-opacity-10,
.bg-danger.bg-opacity-10 { border-radius: 50%; }

/* --------------------------------------------------------------- animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn .3s ease; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .fade-in { animation: none; }
    .btn, .quiz-option, .stat-card, .subject-card, .feature-card { transition: none; }
    .btn:hover, .quiz-option:hover, .stat-card:hover, .subject-card:hover, .feature-card:hover { transform: none; }
}

/* ------------------------------------------------------------- responsive */
@media (max-width: 992px) {
    .stat-card .stat-value { font-size: 1.6rem; }
}

@media (max-width: 768px) {
    .hero-section { padding: 2rem 1.5rem; }
    .stat-card .card-body { padding: 1.1rem; }
    .stat-card .stat-value { font-size: 1.4rem; }
    .score-circle { width: 120px; height: 120px; }
    .score-circle .score-value { font-size: 2rem; }
    .question-number { width: 36px; height: 36px; }
    .empty-state { padding: 2rem 1rem; }
}

/* ------------------------------------------- quiz: question palette */
.question-palette {
    box-shadow: var(--shadow);
}

@media (min-width: 992px) {
    .question-palette {
        position: sticky;
        top: 1rem;
    }
}

.palette-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: .75rem;
}

.palette-toggle {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    padding: .35rem 0;
    border: 0;
    background: none;
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 600;
}

.palette-toggle[aria-expanded="true"] {
    margin-bottom: .75rem;
}

.palette-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1rem;
    list-style: none;
    padding: 0;
    margin: 0 0 .75rem;
    font-size: .875rem;
    color: var(--muted);
}

.palette-legend li {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.palette-legend b {
    color: var(--ink);
    font-weight: 600;
}

.palette-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1.5px solid var(--line);
    background: var(--surface);
}

.palette-scroll {
    max-height: 55vh;
    overflow-y: auto;
    padding: 2px;
}

.palette-group-label {
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--muted);
    margin: .75rem 0 .4rem;
}

.palette-group-label:first-child {
    margin-top: 0;
}

/* fixed-size cells: stretching them to fill the row made only 6 fit, so a 180-question paper needed ~30 rows */
.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 34px);
    gap: 5px;
}

.palette-btn {
    position: relative;
    width: 34px;
    height: 32px;
    border: 1.5px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: .8rem;
    font-weight: 500;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

/* phones and tablets: a little bigger, for fingers */
@media (max-width: 991.98px) {
    .palette-grid {
        grid-template-columns: repeat(auto-fill, 40px);
        gap: 6px;
    }

    .palette-btn {
        width: 40px;
        height: 38px;
        font-size: .85rem;
    }
}

.palette-btn:hover {
    border-color: var(--accent);
}

.palette-btn.is-answered,
.palette-swatch.is-answered {
    background: var(--ok-soft);
    border-color: var(--ok);
    color: var(--ok);
}

.palette-btn.is-marked,
.palette-swatch.is-marked {
    background: var(--filament-soft);
    border-color: var(--filament);
    color: var(--ink); /* amber text on the amber tint is too faint */
}

/* answered and marked: marked colours with a small "answered" dot */
.palette-btn.is-answered.is-marked::after {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ok);
}

.palette-btn.is-current {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.palette-note {
    font-size: .8rem;
    color: var(--muted);
    margin: .75rem 0 0;
}

.review-flag {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    background: var(--filament-soft);
    color: var(--filament);
    font-size: .85rem;
    font-weight: 600;
}

/* "Mark for Review": amber outline with readable ink text (Bootstrap's warning yellow is too faint) */
.btn-review {
    --bs-btn-color: var(--ink);
    --bs-btn-border-color: var(--filament);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-bg: var(--filament-soft);
    --bs-btn-hover-border-color: var(--filament);
    --bs-btn-active-color: var(--ink);
    --bs-btn-active-bg: var(--filament-soft);
    --bs-btn-active-border-color: var(--filament);
}

.btn-review .bi {
    color: var(--filament);
}

/* quiz options are radio buttons inside labels: show a ring when one is reached by keyboard */
.quiz-option:has(.quiz-option-input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.quiz-shortcuts {
    margin: .25rem 0 0;
    font-size: .85rem;
    color: var(--muted);
}

.quiz-shortcuts kbd {
    background: var(--surface-2);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: .05em .4em;
    font-family: var(--font-mono);
    font-size: .8em;
}

/* numerical value questions (JEE Section B): a box for the number instead of options */
.quiz-numeric-label {
    display: block;
    font-weight: 600;
    margin-bottom: .4rem;
}

.quiz-numeric-input {
    max-width: 16rem;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    padding: .6rem .9rem;
    border-radius: var(--radius-sm);
}

.quiz-numeric-hint {
    margin: .5rem 0 0;
    font-size: .9rem;
    color: var(--muted);
}

/* ------------------------------------------- quiz: question text */
/* Question text in the body font at a medium weight: long physics/chemistry
   questions read as a paragraph, not as a bold heading. */
.question-text {
    flex: 1;
    min-width: 0;
    padding-top: .45rem; /* lines the first row up with the number badge */
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--ink);
}

.question-text p {
    margin-bottom: .5rem;
}

/* option text: same size as the body, comfortable line height */
.quiz-option .rich-content {
    flex: 1;
    min-width: 0;
    line-height: 1.5;
}

/* Superscripts and subscripts (10⁻³¹, H₂O, m s⁻¹) normally push their line apart,
   giving uneven spacing; this keeps every line the same height. */
.rich-content sup,
.rich-content sub {
    font-size: .72em;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

.rich-content sup { top: -.5em; }
.rich-content sub { bottom: -.25em; }

/* diagrams and graphs: on their own line, never wider than the card or taller than 360px */
.question-text img {
    display: block;
    margin: .75rem 0;
    max-height: 360px;
    width: auto;
}

/* ------------------------------------------- setup pages: PYQ paper (pyquiz.php) and quiz (quiz.php) */
.setup-page {
    max-width: 1080px;
    margin: 0 auto;
}

.setup-head {
    margin-bottom: 1.5rem;
}

.setup-head h1 {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    margin: .25rem 0 .35rem;
}

.setup-head p {
    color: var(--muted);
    margin: 0;
    max-width: 60ch;
}

.setup-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.setup-panel > .card-body {
    padding: 1.5rem;
}

/* numbered steps */
.setup-step {
    margin-bottom: 1.75rem;
}

.setup-step-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: .85rem;
}

.setup-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: .85rem;
    font-weight: 700;
}

/* step 1: year chips */
.setup-year-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.setup-chip span {
    display: inline-block;
    min-width: 76px;
    text-align: center;
    padding: .5rem .9rem;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-family: var(--font-mono);
    font-weight: 500;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.setup-chip:hover span {
    border-color: var(--accent);
}

.setup-chip input:checked + span {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

/* step 2: paper cards */
.setup-paper-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.setup-paper {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .85rem 1rem;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.setup-paper-full {
    grid-column: 1 / -1;
}

.setup-paper:hover {
    border-color: var(--accent);
}

.setup-paper:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 1px var(--accent) inset;
}

.setup-paper .ico {
    margin: 0;
    flex-shrink: 0;
}

/* on the highlighted card the default tile colour would blend in */
.setup-paper:has(input:checked) .ico {
    background-color: var(--surface);
}

.setup-paper-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.setup-paper-text strong {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
}

.setup-paper-text small {
    color: var(--muted);
    font-size: .875rem;
}

/* keyboard focus on the hidden radio buttons */
.setup-chip input:focus-visible + span,
.setup-paper:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.setup-order {
    margin-top: .85rem;
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: .925rem;
}

.setup-order-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .35rem .6rem;
}

/* step 3: marking */
.setup-marking {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1.5rem;
}

.setup-marks {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.setup-marks[hidden] {
    display: none;
}

.setup-mark {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 600;
}

.setup-mark input {
    width: 70px;
    text-align: center;
}

.setup-mark .text-muted {
    font-weight: 400;
    font-size: .9rem;
}

/* summary */
@media (min-width: 992px) {
    .setup-summary {
        position: sticky;
        top: 1rem;
    }
}

.setup-summary-label {
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}

.setup-summary-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin: .2rem 0 1rem;
}

.setup-summary-list {
    margin: 0 0 1rem;
    border-top: 1px solid var(--line);
}

.setup-summary-list > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .55rem 0;
    border-bottom: 1px solid var(--line);
}

.setup-summary-list dt {
    font-weight: 400;
    color: var(--muted);
}

.setup-summary-list dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
}

.setup-rules {
    margin: 0 0 1.25rem;
    padding-left: 1.1rem;
    font-size: .9rem;
    color: var(--muted);
}

.setup-rules li + li {
    margin-top: .3rem;
}

.setup-summary-note {
    margin: .6rem 0 0;
    text-align: center;
    font-size: .85rem;
    color: var(--muted);
}

@media (max-width: 575.98px) {
    .setup-paper-grid {
        grid-template-columns: 1fr;
    }

    .setup-panel > .card-body {
        padding: 1.15rem;
    }
}

/* ------------------------------------------- FAQ page (faq.php), as on mcqindia.com */
.faq-page {
    max-width: 760px;
    margin: 0 auto;
}

.faq-head h1 {
    font-size: clamp(1.75rem, 3.4vw, 2.3rem);
    margin: .25rem 0 .4rem;
}

.faq-head p {
    color: var(--muted);
    margin: 0 0 1.25rem;
}

.faq-search {
    width: 100%;
    font: inherit;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 16px;
    margin: 4px 0 12px;
}

.faq-search:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: var(--accent);
}

.faq-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: .5rem;
}

.faq-cats a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
}

.faq-cats a:hover,
.faq-cats a:focus-visible {
    border-color: var(--accent);
    color: var(--ink);
    outline: none;
}

.faq-group {
    scroll-margin-top: 130px; /* below the sticky header */
}

.faq-group h2 {
    font-size: 1.35rem;
    margin: 34px 0 6px;
}

.faq-q {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin: 10px 0;
    box-shadow: var(--shadow);
}

.faq-q summary {
    cursor: pointer;
    list-style: none;
    padding: 15px 48px 15px 18px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 18px;
    line-height: 1.3;
    position: relative;
}

.faq-q summary::-webkit-details-marker { display: none; }

.faq-q summary::after {
    content: "+";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: var(--accent);
    line-height: 1;
}

.faq-q[open] summary::after { content: "\2212"; }

.faq-q summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 12px;
}

.faq-a {
    padding: 0 18px 16px;
    color: var(--ink);
}

.faq-none,
.faq-empty {
    color: var(--muted);
    text-align: center;
    padding: 2rem 0;
}

.faq-empty .bi {
    display: block;
    font-size: 2.5rem;
    margin-bottom: .5rem;
}

.faq-band {
    margin-top: 48px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 28px;
    padding: 26px 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(135deg, var(--hero-a), var(--hero-b));
}

.faq-band strong {
    font-family: var(--font-display);
    font-size: 1.2rem;
}

.faq-band p {
    margin: 0;
    color: var(--muted);
}

/* phone menu: account and admin links under the section links */
.site-menu-account {
    padding: 4px 0 14px;
    border-top: 1px solid var(--line);
}

.site-menu-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 10px 12px 4px;
}

.site-menu-links,
.site-menu-user {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    font-weight: 600;
}

.site-menu-links a,
.site-menu-user a,
.site-menu-user span {
    padding: 7px 12px;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
}

.site-menu-user span { font-weight: 400; }

.site-menu-links a:hover,
.site-menu-user a:hover {
    background: var(--accent-soft);
    color: var(--ink);
}

.site-menu-user {
    margin-top: 6px;
    border-top: 1px solid var(--line);
    padding-top: 6px;
}

/* quiz setup extras: sub-labels inside a step, "optional" tag, small hint */
.setup-sublabel {
    font-size: .9rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: .45rem;
}

.setup-optional {
    font-family: var(--font-body);
    font-size: .8rem;
    font-weight: 400;
    color: var(--muted);
}

.setup-hint {
    font-size: .875rem;
    color: var(--muted);
    margin: .6rem 0 0;
}

label.setup-step-title {
    display: flex;
}

/* one-panel auth pages: forgot and reset password */
.auth-shell-single {
    max-width: 480px;
    grid-template-columns: 1fr;
}

/* "check your email" and "link expired" messages */
.auth-done .ico {
    width: 48px;
    height: 48px;
    font-size: 24px;
    margin-bottom: 1rem;
}

/* ------------------------------------------- dashboard (dashboard.php) */
.dash-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 2rem;
    margin-bottom: 1.5rem;
}

.dash-head h1 {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    margin: .25rem 0 .35rem;
}

.dash-head p {
    color: var(--muted);
    margin: 0;
}

.dash-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.dash-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.dash-panel > .card-body {
    padding: 1.4rem 1.5rem;
}

.dash-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem 1rem;
    margin-bottom: 1rem;
}

.dash-panel-head h2 {
    font-size: 1.15rem;
    margin: 0;
}

.dash-muted { color: var(--muted); }

/* resume */
.dash-resume {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--accent-soft);
}

.dash-resume .ico { margin: 0; flex-shrink: 0; background: var(--surface); }

.dash-resume-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.dash-resume-label {
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--accent);
}

.dash-resume-text strong {
    font-family: var(--font-display);
    font-size: 1.1rem;
}

.dash-resume-text span {
    color: var(--muted);
    font-size: .92rem;
}

/* guests: what a free quiz includes, and the nudge to register */
.guest-note {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--accent-soft);
}

.guest-note .ico { margin: 0; flex-shrink: 0; background: var(--surface); }

.guest-note > div:not(.guest-note-actions) {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.guest-note strong {
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.guest-note span:not(.ico) {
    color: var(--muted);
    font-size: .92rem;
}

.guest-note-actions {
    display: flex;
    gap: .5rem;
    flex-shrink: 0;
}

@media (max-width: 575.98px) {
    .guest-note {
        flex-wrap: wrap;
    }

    .guest-note > div:not(.guest-note-actions) {
        flex-basis: calc(100% - 4rem);
    }
}

/* key numbers */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dash-stat {
    padding: 1.1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.dash-stat-label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
}

.dash-stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    margin: .2rem 0;
}

.dash-stat-note {
    font-size: .85rem;
    color: var(--muted);
}

/* score chart: 0-100% scale, one bar per quiz, value on top */
.dash-legend {
    display: flex;
    gap: 1rem;
    font-size: .85rem;
    color: var(--muted);
}

.dash-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 4px;
}

.dash-dot.is-practice,
.dash-bar.is-practice { background: var(--accent); }

.dash-dot.is-pyq,
.dash-bar.is-pyq { background: var(--filament); }

.dash-chart {
    position: relative;
    padding-left: 2.6rem;
}

.dash-chart-grid {
    position: absolute;
    left: 2.6rem;
    right: 0;
    top: 1.4rem;
    height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dash-chart-grid span {
    position: relative;
    border-top: 1px dashed var(--line);
}

.dash-chart-grid span::before {
    content: attr(data-label);
    position: absolute;
    left: -2.6rem;
    top: -.6rem;
    width: 2.2rem;
    text-align: right;
    font-size: .72rem;
    color: var(--muted);
}

.dash-chart-bars {
    position: relative;
    display: flex;
    gap: 6px;
}

.dash-bar-col {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.dash-bar-track {
    position: relative;
    height: 180px;
    margin-top: 1.4rem;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.dash-bar {
    width: 100%;
    max-width: 38px;
    border-radius: 6px 6px 2px 2px;
}

.dash-bar-value {
    position: absolute;
    left: 0;
    right: 0;
    font-size: .75rem;
    font-weight: 600;
    color: var(--ink);
    /* sits just above the bar: the bar's height is set inline, so place the label from the bottom */
    bottom: calc(var(--bar, 0%) + 4px);
}

.dash-bar-label {
    margin-top: .4rem;
    font-size: .72rem;
    line-height: 1.25;
    color: var(--muted);
}

/* subjects */
.dash-subjects {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1rem;
}

.dash-subject-row {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
}

.dash-meter {
    height: 8px;
    border-radius: 99px;
    background: var(--surface-2);
    overflow: hidden;
    margin: .35rem 0 .25rem;
}

.dash-meter span {
    display: block;
    height: 100%;
    border-radius: 99px;
}

.dash-subject-note {
    font-size: .85rem;
    color: var(--muted);
}

/* topics: weakest ones carry a Practise button */
.dash-topic {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dash-topic-main {
    flex: 1;
    min-width: 0;
}

.dash-topic-subject {
    font-weight: 400;
    color: var(--muted);
    margin-left: .25rem;
}

/* same width as the note, so every bar ends at the same place */
.dash-topic .btn,
.dash-topic-only {
    flex: 0 0 6.5rem;
}

.dash-topic-only {
    font-size: .78rem;
    line-height: 1.3;
    text-align: right;
    color: var(--muted);
}

.dash-topics .dash-subject-row span {
    min-width: 0;
    overflow-wrap: break-word;
}

.dash-topics .dash-subject-row strong {
    flex-shrink: 0;
    margin-left: .75rem;
}

/* phones: the button goes under the bar, so the topic name keeps the full width */
@media (max-width: 575.98px) {
    .dash-topic {
        flex-wrap: wrap;
        gap: .5rem;
    }

    .dash-topic-main {
        flex-basis: 100%;
    }

    .dash-topic .btn,
    .dash-topic-only {
        flex: 0 0 auto;
        text-align: left;
    }
}

.tone-good { color: var(--ok); }
.tone-mid { color: var(--filament); }
.tone-low { color: var(--bad); }
.tone-bg-good { background: var(--ok); }
.tone-bg-mid { background: var(--filament); }
.tone-bg-low { background: var(--bad); }

/* recent activity */
.dash-table th {
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
    border-bottom-color: var(--line);
}

.dash-table td {
    border-bottom-color: var(--line);
}

.dash-table tbody tr:last-child td {
    border-bottom: 0;
}

.dash-kind {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 6px;
    margin-right: .4rem;
}

.dash-kind.is-practice { background: var(--accent-soft); color: var(--accent); }
.dash-kind.is-pyq { background: var(--filament-soft); color: var(--filament); }

.dash-title {
    font-weight: 600;
}

.dash-pill {
    display: inline-block;
    min-width: 58px;
    text-align: center;
    font-size: .85rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
}

.tone-pill-good { background: var(--ok-soft); color: var(--ok); }
.tone-pill-mid { background: var(--filament-soft); color: var(--filament); }
.tone-pill-low { background: var(--bad-soft); color: var(--bad); }
.tone-pill-none { background: var(--surface-2); color: var(--muted); font-weight: 600; }

/* empty dashboard */
.dash-empty {
    text-align: center;
    padding: 3rem 1.5rem !important;
}

.dash-empty .ico {
    margin: 0 auto 1rem;
}

.dash-empty h2 {
    font-size: 1.4rem;
}

.dash-empty p {
    color: var(--muted);
    max-width: 46ch;
    margin: 0 auto 1.25rem;
}

@media (max-width: 991.98px) {
    .dash-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .dash-resume {
        flex-wrap: wrap;
    }

    .dash-resume .btn {
        width: 100%;
    }

    .dash-stat-value {
        font-size: 1.6rem;
    }

    .dash-chart-bars {
        gap: 3px;
    }

    .dash-bar-value {
        font-size: .65rem;
    }
}

/* phones: each recent-activity row becomes a small card instead of a squeezed table */
@media (max-width: 575.98px) {
    .dash-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .dash-table,
    .dash-table tbody,
    .dash-table tr,
    .dash-table td {
        display: block;
        width: 100%;
    }

    .dash-table tr {
        padding: .85rem 0;
        border-bottom: 1px solid var(--line);
    }

    .dash-table tbody tr:last-child {
        border-bottom: 0;
    }

    .dash-table td {
        border: 0;
        padding: .15rem 0;
        display: flex;
        justify-content: space-between;
        gap: 1rem;
    }

    .dash-table td[data-label]::before {
        content: attr(data-label);
        color: var(--muted);
    }

    .dash-table td.dash-cell-title {
        display: block;
        padding-bottom: .4rem;
    }

    .dash-table td.text-end {
        padding-top: .5rem;
    }

    .dash-table td.text-end .btn {
        width: 100%;
    }
}

/* ------------------------------------------- quiz result (quiz-result.php) */
.result-score {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    gap: 1.5rem 2rem;
    align-items: center;
    padding: 1.6rem 1.75rem !important;
}

.result-percent {
    font-family: var(--font-display);
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1;
}

.result-marks {
    margin: .35rem 0 .6rem;
    color: var(--muted);
    font-size: 1.05rem;
}

.result-marks strong {
    color: var(--ink);
}

.result-meter {
    height: 10px;
    max-width: 320px;
}

.result-rule {
    margin-top: .5rem;
    font-size: .85rem;
    color: var(--muted);
}

.result-counts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: .75rem;
}

.result-count {
    display: flex;
    flex-direction: column;
    padding: .85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.result-count-value {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.1;
}

.result-count-label {
    font-weight: 600;
    font-size: .9rem;
}

.result-count-note {
    font-size: .8rem;
    color: var(--muted);
}

.result-note {
    margin: 0 1.75rem 1.4rem;
    padding: .7rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--filament-soft);
    font-size: .92rem;
}

/* filters */
.result-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.result-filter {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: .875rem;
    font-weight: 600;
}

.result-filter span {
    font-family: var(--font-mono);
    font-size: .8rem;
    margin-left: 2px;
}

.result-filter:hover {
    border-color: var(--accent);
    color: var(--ink);
}

.result-filter.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.result-empty {
    color: var(--muted);
    text-align: center;
    padding: 1.5rem 0;
    margin: 0;
}

/* one reviewed question */
.result-item {
    padding: 1.25rem 0;
    border-top: 1px solid var(--line);
}

.result-item:first-of-type {
    border-top: 0;
    padding-top: .25rem;
}

.result-item[hidden] {
    display: none;
}

.result-item-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    margin-bottom: .6rem;
}

.result-item-head .question-number {
    width: 34px;
    height: 34px;
    margin-right: 0;
    font-size: .9rem;
}

.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.result-tag {
    font-size: .8rem;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1px 8px;
}

.result-question {
    padding-top: 0;
    margin-bottom: .85rem;
}

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

.result-option {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0;
    cursor: default;
}

.result-option:hover {
    transform: none;
    border-color: var(--line);
    background: var(--surface);
}

.result-option.correct:hover { border-color: var(--ok); background: var(--ok-soft); }
.result-option.incorrect:hover { border-color: var(--bad); background: var(--bad-soft); }

.result-option > .rich-content {
    flex: 1;
    min-width: 0;
}

.result-option-tag {
    flex-basis: 100%;
    margin: .35rem 0 0 calc(36px + .85rem);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.result-option.correct .result-option-tag { color: var(--ok); }
.result-option.incorrect .result-option-tag { color: var(--bad); }

.result-explain {
    margin-top: .75rem;
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.result-explain strong {
    display: block;
    font-size: .9rem;
    margin-bottom: .25rem;
}

.result-explain-note {
    background: var(--filament-soft);
    font-size: .92rem;
    margin-bottom: 0;
}

@media (max-width: 767.98px) {
    .result-score {
        grid-template-columns: 1fr;
        padding: 1.25rem !important;
    }

    .result-percent {
        font-size: 2.6rem;
    }

    .result-note {
        margin: 0 1.25rem 1.25rem;
    }

    .result-options {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------- admin area layout (templates/admin-header.php) */
.admin-top {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.admin-top-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    padding: 0 max(16px, env(safe-area-inset-left, 0px));
}

.admin-brand {
    font-size: 20px;
}

.admin-brand svg {
    width: 32px;
    height: 32px;
}

.admin-top-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    font-weight: 600;
}

.admin-top-actions a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 9px;
    color: var(--muted);
    text-decoration: none;
}

.admin-top-actions a:hover {
    background: var(--accent-soft);
    color: var(--ink);
}

.admin-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: calc(100vh - 61px);
}

.admin-shell-plain {
    grid-template-columns: minmax(0, 1fr);
}

.admin-side {
    border-right: 1px solid var(--line);
    background: var(--surface);
}

.admin-side nav {
    position: sticky;
    top: 61px;
    padding: 1rem .75rem 2rem;
}

.admin-side-label {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: .9rem .75rem .35rem;
}

.admin-side-label:first-child {
    padding-top: 0;
}

.admin-side a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .75rem;
    border-radius: 9px;
    color: var(--ink);
    font-weight: 500;
    text-decoration: none;
}

.admin-side a .bi {
    color: var(--muted);
}

.admin-side a:hover {
    background: var(--surface-2);
}

.admin-side a.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.admin-side a.active .bi {
    color: var(--accent);
}

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

.admin-content {
    max-width: 1240px;
    padding: 1.5rem max(16px, 1.5rem) 3rem;
}

.admin-shell-plain .admin-content {
    margin: 0 auto;
}

@media (max-width: 991.98px) {
    .admin-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-side {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .admin-side nav {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2px 8px;
        padding: .75rem;
    }

    .admin-side-label {
        grid-column: 1 / -1;
    }
}

/* narrow phones: the admin top bar keeps the logo and the "JEE Admin" tag, drops the site name */
@media (max-width: 480px) {
    .admin-brand > span:not(.exam-tag) {
        display: none;
    }

    .admin-top-inner {
        gap: 8px;
    }

    .admin-top-actions a {
        padding: 6px 8px;
    }
}

/* ------------------------------------------- premium mock tests (premium.php, premium-buy.php, premium-test.php) */
.premium-status,
.premium-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.premium-status.is-active { border-color: var(--ok); background: var(--ok-soft); }
.premium-status .ico,
.premium-banner .ico { margin: 0; flex-shrink: 0; }
.premium-status.is-active .ico { background: var(--surface); }

.premium-status > div,
.premium-banner-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.premium-status strong,
.premium-banner strong {
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.premium-status span:not(.ico),
.premium-banner-text span {
    color: var(--muted);
    font-size: .92rem;
}

.premium-banner {
    color: inherit;
    text-decoration: none;
}

.premium-banner:hover,
.premium-banner:focus-visible {
    border-color: var(--accent);
    color: inherit;
}

.premium-banner .btn { flex-shrink: 0; }

.premium-offer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 2rem;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--hero-a), var(--hero-b));
    box-shadow: var(--shadow);
}

.premium-offer-main { flex: 1 1 340px; min-width: 0; }

.premium-price {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1;
}

.premium-price-note {
    color: var(--muted);
    margin: .3rem 0 .9rem;
}

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

.premium-points li {
    display: flex;
    gap: .5rem;
    padding: .15rem 0;
}

.premium-points .bi { color: var(--ok); flex-shrink: 0; }

.premium-offer-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    text-align: center;
    color: var(--muted);
    font-size: .9rem;
}

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

.premium-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .9rem 0;
    border-top: 1px solid var(--line);
}

.premium-item:first-child { border-top: 0; padding-top: 0; }
.premium-item-main { flex: 1; min-width: 0; }

.premium-item-title {
    font-weight: 700;
    overflow-wrap: break-word;
}

.premium-item-title .dash-kind { margin: 0 0 0 .4rem; vertical-align: .1em; }

.premium-item-meta,
.premium-item-desc {
    color: var(--muted);
    font-size: .9rem;
}

.premium-item-action {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex-shrink: 0;
}

.premium-locked {
    color: var(--muted);
    font-size: .9rem;
    font-weight: 600;
    white-space: nowrap;
}

.premium-step {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: 1.15rem;
    margin-bottom: 1rem;
    text-align: left;
}

.premium-page .setup-panel,
.premium-rules,
.premium-subjects { text-align: left; }

.premium-qr {
    width: 220px;
    max-width: 100%;
    margin: 0 auto .5rem;
    padding: 8px;
    background: #fff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
}

.premium-qr svg { display: block; width: 100%; height: auto; }

.premium-qr-note {
    text-align: center;
    color: var(--muted);
    font-size: .9rem;
}

.premium-rules {
    padding-left: 1.1rem;
    margin-bottom: 1.25rem;
}

.premium-rules li + li { margin-top: .45rem; }

.premium-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.premium-subjects span {
    padding: .35rem .75rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: .9rem;
}

@media (max-width: 575.98px) {
    .premium-banner { flex-wrap: wrap; }
    .premium-banner-text { flex-basis: calc(100% - 4rem); }
    .premium-item { flex-wrap: wrap; }
    .premium-item-action { width: 100%; }
    .premium-offer { padding: 1.25rem; }
    .premium-offer-cta { width: 100%; }
    .premium-offer-cta .btn { width: 100%; }
}

/* mock tests in the dashboard lists and chart */
.dash-kind.is-mock { background: var(--ok-soft); color: var(--ok); }
.dash-dot.is-mock,
.dash-bar.is-mock { background: var(--ok); }

/* rank on the result page */
.result-rank {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 2rem;
}

.result-rank-item {
    display: flex;
    flex-direction: column;
    padding: .85rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    min-width: 130px;
}

.result-rank-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--ok);
}

.result-rank-note {
    flex: 1 1 260px;
    margin: 0;
    color: var(--muted);
    font-size: .92rem;
}

/* ------------------------------------------- exam information (exam-info.php) */
.info-page {
    max-width: 1080px;
    margin: 0 auto;
}

.info-total td { font-weight: 700; }

.info-marks {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.info-marks li {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .4rem 0;
}

.info-mark {
    display: inline-grid;
    place-items: center;
    width: 3rem;
    height: 2.2rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
}

.info-list {
    margin: 0 0 1rem;
    padding-left: 1.1rem;
}

.info-list:last-child { margin-bottom: 0; }
.info-list li + li { margin-top: .45rem; }

.info-timeline {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    border-left: 2px solid var(--line);
}

.info-timeline li {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0 0 .8rem 1.1rem;
}

.info-timeline li::before {
    content: "";
    position: absolute;
    left: -6px;
    top: .45rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
}

.info-timeline span { color: var(--muted); font-size: .95rem; }

.info-syllabus {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem 2rem;
}

.info-syllabus h3 {
    font-size: 1rem;
    margin-bottom: .35rem;
}

.info-syllabus p {
    margin: 0;
    color: var(--muted);
    font-size: .95rem;
}

.info-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--accent-soft);
}

.info-cta > div:first-child {
    flex: 1 1 320px;
    display: flex;
    flex-direction: column;
}

.info-cta strong { font-family: var(--font-display); font-size: 1.1rem; }
.info-cta span { color: var(--muted); }

.info-disclaimer {
    margin: 1.25rem 0 0;
    color: var(--muted);
    font-size: .85rem;
}

@media (max-width: 991.98px) {
    .info-syllabus { grid-template-columns: 1fr; }
}

/* ------------------------------------------- email confirmation (verify-email.php and the reminder bar) */
.verify-bar {
    background: var(--filament-soft);
    border-bottom: 1px solid var(--line);
    font-size: .92rem;
}

.verify-bar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .25rem 1rem;
    padding-top: .5rem;
    padding-bottom: .5rem;
}

.verify-bar .bi { color: var(--filament); margin-right: .25rem; }
.verify-bar a { font-weight: 600; white-space: nowrap; }

.verify-change {
    border-top: 1px solid var(--line);
    padding-top: 1rem;
}

.verify-change summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 600;
}

/* WhatsApp help on the payment page (premium-buy.php) */
.premium-help {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.premium-help .ico { margin: 0; flex-shrink: 0; }

.premium-help > div {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.premium-help > div > span { color: var(--muted); font-size: .92rem; }
.premium-help a:not(.btn) { font-weight: 600; white-space: nowrap; }
.premium-help .btn { flex-shrink: 0; }

@media (max-width: 575.98px) {
    .premium-help { flex-wrap: wrap; }
    .premium-help > div { flex-basis: calc(100% - 4rem); }
    .premium-help .btn { width: 100%; }
}
