:root {
    --color-bg: #F7F3EA;
    --color-surface: #FFFFFF;
    --color-primary: #16151A;
    --color-primary-dark: #101014;
    --color-primary-light: #3A3832;
    --color-brand: #C9A227;
    --color-brand-dark: #A8861C;
    --color-accent-free: #2F6B4F;
    --color-accent-paid: #B45309;
    --color-danger: #B42318;
    --color-text: #1A1914;
    --color-text-muted: #5C574C;
    --color-border: #E6DFD0;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(22, 21, 16, 0.08), 0 1px 2px rgba(22, 21, 16, 0.04);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
html { scroll-behavior: smooth; }

.skip-link {
    position: absolute;
    left: -999px;
    top: 8px;
    background: #fff;
    color: var(--color-primary);
    padding: 8px 14px;
    border-radius: 8px;
    z-index: 100;
    font-weight: 600;
}
.skip-link:focus { left: 12px; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Header / Footer (stand in for a master page) ---------- */
.site-header {
    /* Warm panel so white banner areas don't blend into the nav */
    background:
        linear-gradient(180deg, #FFF9EE 0%, #FFF6E6 55%, #F8EFD8 100%);
    color: var(--color-text);
    border-top: 3px solid var(--color-brand);
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 100;
    /* Layered shadow = subtle 3D lift over the banner */
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.85) inset,
        0 2px 0 #A8861C,
        0 3px 0 #E8C65A,
        0 10px 28px rgba(22, 21, 16, 0.16),
        0 4px 10px rgba(168, 134, 28, 0.12);
}
.site-header::after {
    content: "";
    display: block;
    height: 3px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(201, 162, 39, 0.15) 8%,
        #C9A227 35%,
        #E8C65A 50%,
        #C9A227 65%,
        rgba(201, 162, 39, 0.15) 92%,
        transparent 100%
    );
}
.header-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: relative;
    z-index: 1;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    min-width: 0;
    transition: opacity 0.2s ease;
}
.brand:hover { opacity: 0.92; }
.brand-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    line-height: 1.1;
    min-width: 0;
}
.brand-name {
    font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    font-weight: 700;
    font-size: 1.22rem;
    letter-spacing: -0.01em;
    color: var(--color-primary);
}
.brand-tagline {
    font-weight: 500;
    font-size: 0.64rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8F7318;
    white-space: nowrap;
}
.brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--color-brand);
    color: #16151A;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
}
.brand-logo-wrap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(145deg, #E8C65A, #A8861C 55%, #C9A227);
    box-shadow: 0 2px 8px rgba(168, 134, 28, 0.22);
    flex-shrink: 0;
    display: block;
}
.brand-logo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: #fff;
    border: 2px solid #fff;
}
.header-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 0.875rem;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px 4px;
}
.nav-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-left: 18px;
    border-left: 1px solid rgba(201, 162, 39, 0.28);
}
.nav-link {
    color: var(--color-text-muted);
    font-weight: 500;
    padding: 8px 10px;
    border-radius: 6px;
    position: relative;
    transition: color 0.18s ease, background 0.18s ease;
}
.nav-link:hover {
    color: var(--color-primary);
    background: rgba(201, 162, 39, 0.08);
}
.nav-link-login {
    color: var(--color-primary);
    font-weight: 600;
}
.user-greeting {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}
.logout-link {
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    border-bottom: 1px solid transparent;
}
.logout-link:hover {
    color: var(--color-primary);
    border-color: currentColor;
}
.btn-header-cta {
    background: linear-gradient(180deg, #D4B03A 0%, #C9A227 100%);
    color: #16151A;
    padding: 9px 16px;
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: 999px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 2px 8px rgba(168, 134, 28, 0.28);
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}
.btn-header-cta:hover {
    filter: brightness(1.04);
    color: #16151A;
    transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 4px 12px rgba(168, 134, 28, 0.35);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(201, 162, 39, 0.35);
    background: #fff;
    border-radius: 10px;
    padding: 10px 9px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.nav-toggle:hover {
    background: rgba(201, 162, 39, 0.08);
    border-color: var(--color-brand);
}
.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--color-primary);
    margin: 5px 0;
    border-radius: 1px;
}
.nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 90; /* under sticky header (100), above page content */
    background: rgba(16, 16, 20, 0.42);
    -webkit-tap-highlight-color: transparent;
}
.nav-backdrop[hidden] { display: none !important; }
body.nav-open .nav-backdrop { display: block; }
body.nav-open { overflow: hidden; }

@media (max-width: 720px) {
    .nav-toggle { display: block; }
    .header-inner { padding: 10px 16px; gap: 12px; }
    .brand { gap: 10px; }
    .brand-logo-wrap { width: 38px; height: 38px; }
    .brand-name { font-size: 1.08rem; }
    .brand-tagline { font-size: 0.56rem; letter-spacing: 0.045em; }
    .header-nav {
        display: none;
        position: absolute;
        top: calc(100% + 3px);
        left: 10px;
        right: 10px;
        width: auto;
        color: var(--color-text);
        flex-direction: column;
        align-items: stretch;
        padding: 14px 14px 18px;
        gap: 10px;
        border-radius: 14px;
        border: 1px solid rgba(201, 162, 39, 0.35);
        background:
            linear-gradient(180deg, #FFFBF3 0%, #F6ECD6 100%);
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.7) inset,
            0 18px 40px rgba(22, 21, 16, 0.22),
            0 6px 14px rgba(168, 134, 28, 0.14);
    }
    .header-nav.is-open {
        display: flex;
        z-index: 110;
    }
    .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 4px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.55);
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
    }
    .nav-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding-left: 0;
        padding-top: 4px;
        border-left: none;
        border-top: none;
    }
    .header-nav .nav-link {
        text-align: center;
        padding: 12px 12px;
        border-radius: 8px;
        font-weight: 600;
        color: var(--color-primary);
        background: transparent;
    }
    .header-nav .nav-link:hover,
    .header-nav .nav-link:active {
        background: rgba(201, 162, 39, 0.16);
        color: var(--color-primary);
    }
    .header-nav .user-greeting,
    .header-nav .logout-link {
        text-align: center;
        padding: 10px 12px;
    }
    .header-nav .nav-link-login {
        text-align: center;
        font-weight: 700;
        letter-spacing: 0.02em;
    }
    .header-nav .btn-header-cta {
        text-align: center;
        width: 100%;
        border-radius: 999px;
        padding: 13px 16px;
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.4) inset,
            0 4px 14px rgba(168, 134, 28, 0.35);
    }
}

.site-footer {
    margin-top: 48px;
    padding: 48px 24px 20px;
    background: var(--color-primary-dark);
    color: rgba(255,255,255,0.72);
    font-size: 0.88rem;
}
.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 32px;
}
.footer-brand p {
    margin: 12px 0 0;
    max-width: 320px;
    line-height: 1.55;
    font-size: 0.88rem;
}
.brand-footer { color: #fff; }
.footer-col h3 {
    margin: 0 0 12px;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
}
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
    max-width: 1120px;
    margin: 36px auto 0;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8rem;
    color: rgba(255,255,255,0.45);
}
@media (max-width: 720px) {
    .footer-inner { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- Layout ---------- */
.page-container { max-width: 1040px; margin: 0 auto; padding: 40px 24px 24px; }
.page-title { font-size: 1.6rem; font-weight: 700; margin: 0 0 4px; }
.page-subtitle { color: var(--color-text-muted); margin: 0 0 28px; }
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1.5px solid #D8C48A;
    background: #FFF9EB;
    color: #5C4310;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 2px 8px rgba(92, 67, 16, 0.08);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.back-link:hover {
    background: #F7E7B8;
    border-color: var(--color-brand);
    color: #3A2A08;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(92, 67, 16, 0.12);
}
.back-link:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
}

/* ---------- Auth page ---------- */
.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    background:
        radial-gradient(520px 180px at 50% 0%, rgba(201, 162, 39, 0.2), transparent 70%),
        linear-gradient(180deg, var(--color-primary-dark) 0%, var(--color-primary) 18%, #F3EBDA 18%);
    overflow-x: hidden;
}
.auth-page form {
    width: 100%;
    max-width: 520px;
}
.auth-card {
    width: 100%;
    background: var(--color-surface);
    border-radius: 18px;
    border-top: 4px solid var(--color-brand);
    box-shadow: 0 24px 60px rgba(16, 16, 20, 0.28);
    padding: 36px 40px 28px;
}
.auth-brand {
    margin: 0 0 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}
.auth-brand-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: #fff;
    box-shadow:
        0 0 0 3px #fff,
        0 0 0 5px rgba(201, 162, 39, 0.7),
        0 8px 18px rgba(22, 21, 16, 0.16);
}
.auth-brand-name {
    font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--color-primary);
    line-height: 1.15;
}
.auth-brand-by {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--color-brand-dark);
    background: rgba(201, 162, 39, 0.14);
    border: 1px solid rgba(201, 162, 39, 0.35);
    border-radius: 999px;
    padding: 5px 12px;
    line-height: 1.2;
}
.auth-title { margin: 0 0 6px; font-size: 1.85rem; font-weight: 700; letter-spacing: -0.02em; }
.auth-subtitle { margin: 0 0 28px; color: var(--color-text-muted); font-size: 1rem; line-height: 1.45; }
.auth-links {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.auth-inline-link { margin: -6px 0 16px; text-align: right; font-size: 0.92rem; }
.auth-inline-link a { font-weight: 600; color: var(--color-primary); }
.auth-inline-link a:hover { color: var(--color-brand-dark); }
.auth-footer-text { margin: 0; font-size: 0.95rem; color: var(--color-text-muted); text-align: center; }
.auth-footer-text a { font-weight: 600; color: var(--color-primary); }
.auth-footer-text a:hover { color: var(--color-brand-dark); }
.auth-page .form-group { margin-bottom: 18px; }
.auth-page .form-group label { font-size: 0.92rem; margin-bottom: 8px; }
/* Laptop/desktop: pair register fields in a row */
.auth-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}
.auth-form-row .form-group { min-width: 0; }
.auth-page .form-control {
    padding: 14px 16px;
    font-size: 1.02rem;
    border-radius: 10px;
    background: #FCFAF6;
}
.auth-page .btn-block {
    margin-top: 6px;
    padding: 14px 18px;
    font-size: 1.02rem;
    border-radius: 10px;
}
.auth-google-wrap { margin-bottom: 8px; }
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 13px 16px;
    font-size: 1.02rem;
    font-weight: 600;
    color: #3c4043;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 10px;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn-google:hover {
    background: #f8f9fa;
    border-color: #c6c9ce;
    color: #202124;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.14);
}
.btn-google:focus {
    outline: 2px solid rgba(66, 133, 244, 0.45);
    outline-offset: 2px;
}
.btn-google-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0 16px;
    color: var(--color-text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--color-border);
}
@media (max-width: 560px) {
    /* Fit content — avoid tall empty cream scroll under the card (100vh mobile bug) */
    .auth-page {
        align-items: flex-start;
        justify-content: flex-start;
        min-height: 0;
        height: auto;
        padding: 10px 14px 16px;
        background:
            radial-gradient(420px 100px at 50% 0%, rgba(201, 162, 39, 0.16), transparent 70%),
            linear-gradient(180deg, var(--color-primary-dark) 0%, var(--color-primary) 72px, #F3EBDA 72px);
    }
    .auth-card {
        padding: 18px 18px 16px;
        border-radius: 14px;
        margin-bottom: 0;
    }
    .auth-brand {
        margin: 0 0 14px;
        gap: 6px;
    }
    .auth-brand-logo {
        width: 64px;
        height: 64px;
    }
    .auth-brand-name {
        font-size: 1.22rem;
        letter-spacing: 0.03em;
    }
    .auth-brand-by {
        font-size: 0.8rem;
        padding: 5px 11px;
    }
    .auth-title {
        font-size: 1.4rem;
        margin: 0 0 4px;
        text-align: center;
    }
    .auth-subtitle {
        margin: 0 0 14px;
        font-size: 0.9rem;
        text-align: center;
    }
    .auth-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .auth-page .form-group { margin-bottom: 12px; }
    .auth-page .form-control { padding: 11px 12px; font-size: 0.95rem; }
    .auth-page .btn-block { padding: 12px 14px; font-size: 0.95rem; }
    .auth-divider { margin: 12px 0 10px; }
    .btn-google { padding: 11px 14px; font-size: 0.95rem; }
    .auth-inline-link { margin: -2px 0 10px; font-size: 0.85rem; }
    .auth-links {
        margin-top: 14px;
        padding-top: 12px;
        gap: 6px;
    }
    .auth-footer-text { font-size: 0.88rem; }
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.22);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.btn:focus-visible { outline: 2px solid var(--color-primary-light); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 22px; font-size: 0.98rem; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; border-radius: 8px; line-height: 1.2; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--color-primary-light); }
.btn-success { background: var(--color-brand); color: #16151A; }
.btn-success:hover:not(:disabled) { filter: brightness(1.05); color: #16151A; }
.btn-warning { background: #FDF1DF; color: var(--color-accent-paid); border: 1px solid #F3D9A6; }
.btn-ghost-light {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.28);
}
.btn-ghost-light:hover { background: rgba(255,255,255,0.08); }

/* ---------- Alerts / status text ---------- */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 0.88rem; margin-bottom: 16px; }
.alert-error { background: #FCEDEB; color: var(--color-danger); border: 1px solid #F5C6C0; }
.alert-ok { background: #E4F6EC; color: var(--color-accent-free); border: 1px solid #B7E4C7; }
.loading-text, .empty-text { color: var(--color-text-muted); font-size: 0.92rem; }

/* ---------- Cards (exams / sections) ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.card {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(16,24,40,0.10); }
.card h3 { margin: 8px 0 4px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--color-text-muted); font-size: 0.88rem; }

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-neutral { background: #EEF1F6; color: var(--color-text-muted); }
.badge-free { background: #E4F6EC; color: var(--color-accent-free); }
.badge-paid { background: #FDF1DF; color: var(--color-accent-paid); }

.badge-unlocked { background: #E8EEF8; color: #1E40AF; }

/* ---------- Catalog pages (tests, PDFs) ---------- */
.tests-page,
.catalog-page { max-width: 880px; }
.tests-page.has-bundle-page,
.tests-page:has(.tests-layout.has-bundle) { max-width: 1240px; }
.tests-page-header,
.catalog-page-header { margin-bottom: 24px; }

.paper-hook-list-meta {
    margin: 0 0 14px;
}
.exam-hook {
    margin: 12px 0 22px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #E4C56A;
    background:
        radial-gradient(circle at 92% 18%, rgba(234, 88, 12, 0.1), transparent 40%),
        radial-gradient(circle at 6% 88%, rgba(201, 162, 39, 0.16), transparent 44%),
        linear-gradient(135deg, #FFFDF7 0%, #FFF6DF 55%, #FCECC0 100%);
    box-shadow: 0 12px 32px rgba(180, 140, 40, 0.14);
    color: #1A1914;
}
.exam-hook-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.85fr);
    gap: 20px 28px;
    padding: 22px 24px;
    align-items: center;
}
.exam-hook-eyebrow {
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #B45309;
}
.exam-hook-title {
    margin: 0 0 10px;
    font-size: clamp(1.28rem, 2.3vw, 1.7rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.35;
    color: #1A1914;
}
.exam-hook-lead {
    margin: 0 0 14px;
    max-width: 46rem;
    font-size: 0.98rem;
    line-height: 1.55;
    color: #5C574C;
}
.exam-hook-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.exam-hook-points li {
    padding: 6px 11px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #E8D5A0;
    font-size: 0.8rem;
    font-weight: 650;
    color: #7A5A12;
}
.exam-hook-cta {
    padding: 16px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #E8D5A0;
    color: #1A1914;
    text-align: left;
    box-shadow: 0 6px 18px rgba(180, 140, 40, 0.1);
}
.exam-hook-price {
    margin: 0 0 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}
.exam-hook-price-was {
    font-size: 1.05rem;
    font-weight: 600;
    color: #78716C;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: #B42318;
}
.exam-hook-price-arrow {
    color: #B45309;
    font-weight: 700;
}
.exam-hook-price-now {
    font-size: 1.7rem;
    font-weight: 800;
    color: #15803D;
    line-height: 1;
}
.exam-hook-price-save {
    padding: 3px 8px;
    border-radius: 999px;
    background: #FEF3C7;
    color: #92400E;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}
.exam-hook-meta {
    margin: 0 0 12px;
    font-size: 0.8rem;
    color: #5C574C;
    line-height: 1.4;
}
.exam-hook-btn {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 0.95rem;
    font-weight: 800;
    color: #1A1914;
    background: linear-gradient(180deg, #F0D56A 0%, #C9A227 100%);
    box-shadow: 0 6px 18px rgba(201, 162, 39, 0.4);
    cursor: pointer;
}
.exam-hook-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}
.exam-hook-note {
    margin: 8px 0 0;
    font-size: 0.72rem;
    color: #78716C;
    text-align: center;
}
.exam-hook.is-owned .exam-hook-cta {
    background: rgba(240, 250, 244, 0.96);
}
.exam-hook.is-owned .exam-hook-btn {
    background: linear-gradient(180deg, #4A9B6E 0%, #2F6B4F 100%);
    color: #fff;
    box-shadow: 0 6px 18px rgba(47, 107, 79, 0.35);
}
@media (max-width: 860px) {
    .exam-hook-inner {
        grid-template-columns: 1fr;
        padding: 18px;
        gap: 16px;
    }
}
.tests-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}
.tests-layout.has-bundle {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
}
.tests-main { min-width: 0; }
.tests-page-kicker,
.catalog-page-kicker {
    margin: 0 0 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-brand-dark);
}
.tests-page-meta,
.catalog-page-meta {
    margin: 6px 0 0;
    color: var(--color-text-muted);
    font-size: 0.92rem;
}

.paper-bundle-promo {
    position: sticky;
    top: 80px;
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(180deg, #FFFDF5 0%, #FFF6D6 55%, #FEEFB8 100%);
    border: 2px solid #C9A227;
    box-shadow: 0 8px 24px rgba(201, 162, 39, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.paper-bundle-promo-glow {
    display: none;
}
.paper-bundle-promo-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px 14px 12px;
}
.paper-bundle-promo-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    min-width: 0;
}
.paper-bundle-icon {
    display: none;
}
.paper-bundle-badge {
    display: inline-block;
    margin: 0;
    padding: 3px 9px;
    border-radius: 999px;
    background: #B45309;
    border: none;
    color: #fff;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.paper-bundle-promo .paper-bundle-title,
.paper-bundle-promo h2.paper-bundle-title {
    margin: 0;
    flex: 1 1 100%;
    font-size: 1rem;
    font-weight: 800;
    color: #1A1914;
    line-height: 1.25;
}
.paper-bundle-promo .paper-bundle-meta,
.paper-bundle-promo p.paper-bundle-meta {
    margin: 0;
    flex: 1 1 100%;
    color: #4A4538;
    font-size: 0.8rem;
    line-height: 1.35;
    max-width: none;
}
.paper-bundle-promo-right {
    text-align: left;
    width: 100%;
}
.paper-bundle-promo .paper-bundle-price,
.paper-bundle-promo p.paper-bundle-price {
    margin: 0 0 6px;
    line-height: 1.15;
}
.paper-bundle-price-row {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 0;
}
.paper-bundle-price-was {
    display: inline-flex;
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
    font-size: 1rem;
    font-weight: 600;
    color: #78716C;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: #B42318;
}
.paper-bundle-price-was-label {
    display: none;
}
.paper-bundle-price-arrow {
    font-size: 1rem;
    font-weight: 700;
    color: #B45309;
    line-height: 1;
    padding-bottom: 0;
}
.paper-bundle-price-now {
    display: inline-flex;
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
    font-size: 1.35rem;
    font-weight: 800;
    color: #15803D;
    line-height: 1;
}
.paper-bundle-price-now-label {
    display: none;
}
.paper-bundle-price-now--solo {
    display: block;
    text-align: left;
    font-size: 1.3rem;
    color: #92400E;
}
.paper-bundle-price-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #78716C;
    margin-bottom: 2px;
}
.paper-bundle-promo .paper-bundle-note,
.paper-bundle-promo p.paper-bundle-note {
    margin: 6px 0 0;
    font-size: 0.7rem;
    color: #78716C;
}
.paper-bundle-note-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}
.paper-bundle-note-link:hover {
    color: var(--color-brand-dark);
    text-decoration: underline;
}
.unlock-all-card {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 16px 0 8px;
    text-decoration: none;
    color: #fff;
    border-radius: 18px;
    overflow: hidden;
    border: 2px solid #C2410C;
    background:
        radial-gradient(circle at 12% 20%, rgba(255, 255, 255, 0.22), transparent 42%),
        linear-gradient(118deg, #9A3412 0%, #EA580C 48%, #F59E0B 100%);
    box-shadow: 0 14px 36px rgba(194, 65, 12, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.unlock-all-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 44px rgba(194, 65, 12, 0.36);
    color: #fff;
}
.unlock-all-card-media {
    flex: 0 0 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.14);
}
.unlock-all-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
}
.unlock-all-card-body {
    flex: 1;
    min-width: 0;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}
.unlock-all-card-badge {
    display: inline-flex;
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.92);
    color: #9A3412;
}
.unlock-all-card-body h3 {
    margin: 0;
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: #fff;
}
.unlock-all-card-body p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.92);
}
.unlock-all-card-cta {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    margin: 16px 18px 16px 0;
    padding: 14px 18px;
    min-width: 148px;
    font-size: 0.92rem;
    font-weight: 800;
    white-space: nowrap;
    color: #9A3412;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.exam-showcase .unlock-all-card {
    grid-column: 1 / -1;
    margin: 0;
}
.sections-page .unlock-all-card {
    margin: 14px 0 20px;
}
@media (max-width: 640px) {
    .unlock-all-card {
        flex-wrap: wrap;
    }
    .unlock-all-card-media {
        flex: 0 0 auto;
        width: 100%;
        min-height: 72px;
        padding: 14px 0 0;
        background: transparent;
    }
    .unlock-all-card-cta {
        width: calc(100% - 36px);
        margin: 0 18px 18px;
        min-width: 0;
    }
}
.exam-chapter-group {
    margin: 0 0 22px;
}
.exam-chapter-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}
.exam-chapter-heading h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--color-text);
}
.exam-chapter-heading span {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-text-muted);
    white-space: nowrap;
}
.paper-bundle-promo-code {
    width: 100%;
    max-width: none;
    margin: 0 0 8px;
    text-align: left;
}
.paper-bundle-promo-code-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #78716C;
}
.paper-bundle-promo-code-row {
    display: flex;
    gap: 6px;
}
.paper-bundle-promo-code-row .form-control {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.paper-bundle-promo-code-row .btn {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 0.82rem;
}
.paper-bundle-promo-msg {
    margin: 5px 0 0;
    font-size: 0.74rem;
    line-height: 1.35;
}
.paper-bundle-promo-msg--ok { color: #15803D; font-weight: 600; }
.paper-bundle-promo-msg--error { color: #B42318; }
.paper-bundle-promo-savings {
    display: inline;
    margin: 0 0 0 6px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #15803D;
    text-align: left;
}
.paper-bundle-promo .paper-bundle-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 0;
}
.btn-bundle {
    width: 100%;
    background: linear-gradient(180deg, #E8C547 0%, #C9A227 100%);
    color: #1a1914;
    border: none;
    padding: 10px 14px;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(201, 162, 39, 0.4);
    white-space: nowrap;
}
.btn-bundle:hover:not(:disabled) {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(201, 162, 39, 0.5);
}
.btn-buy {
    background: linear-gradient(180deg, #EA580C 0%, #C2410C 100%);
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(194, 65, 12, 0.3);
}
.btn-buy:hover:not(:disabled) {
    filter: brightness(1.06);
    color: #fff;
}

.tests-section-label,
.catalog-section-label {
    margin: 0 0 14px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.tests-page .test-list,
.tests-page .exam-test-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}
.tests-page .test-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "num info"
        "actions actions";
    column-gap: 10px;
    row-gap: 8px;
    align-items: center;
    align-content: start;
    height: auto;
    min-height: 0;
    margin: 0;
}
.tests-page .test-row-num { grid-area: num; }
.tests-page .test-row-info { grid-area: info; min-width: 0; }
.tests-page .test-row-info h3 {
    margin: 0 0 2px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tests-page .test-row-info p {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.3;
}
.tests-page .test-row-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
}
.tests-page .test-row,
.catalog-page .test-row {
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 8px rgba(22, 21, 16, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.tests-page .test-row:hover,
.catalog-page .test-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(22, 21, 16, 0.1);
}
.tests-page .test-row--free,
.catalog-page .test-row--free {
    border-left: 4px solid var(--color-accent-free);
    background: linear-gradient(90deg, #f0faf4 0%, #fff 28%);
}
.tests-page .test-row--locked,
.catalog-page .test-row--locked {
    border-left: 4px solid #EA580C;
}
.tests-page .test-row--unlocked,
.catalog-page .test-row--unlocked {
    border-left: 4px solid var(--color-brand);
    background: linear-gradient(90deg, #fdfbf3 0%, #fff 28%);
}
.test-row-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f3f4f6;
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--color-text-muted);
}
.tests-page .test-row-info h3,
.catalog-page .test-row-info h3 {
    font-size: 0.92rem;
    font-weight: 600;
}
.test-meta-dot {
    margin: 0 6px;
    color: #d1d5db;
}
.tests-page .test-row-actions .btn,
.catalog-page .test-row-actions .btn {
    min-width: 0;
    padding: 7px 12px;
    font-size: 0.8rem;
    text-align: center;
}
.tests-page .test-row-actions .badge {
    font-size: 0.72rem;
    padding: 3px 8px;
}

.catalog-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 18px 22px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(22, 21, 16, 0.05);
}
.catalog-toolbar .form-group {
    margin: 0;
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}
.catalog-toolbar .form-group label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}
.catalog-row-desc {
    margin: 6px 0 0;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    line-height: 1.45;
    max-width: 520px;
}
.catalog-page .test-row-info p {
    margin: 4px 0 0;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}
.catalog-page .test-row-info p.catalog-row-desc {
    margin-top: 6px;
}
.catalog-toolbar-hint {
    margin: 0;
    flex: 1;
    min-width: 200px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    align-self: center;
}
.catalog-toolbar-hint a {
    color: var(--color-brand-dark);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (max-width: 1180px) {
    .tests-page .test-list,
    .tests-page .exam-test-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 960px) {
    .tests-layout.has-bundle {
        grid-template-columns: minmax(0, 1fr);
    }
    .paper-bundle-promo {
        position: static;
        order: 2;
    }
    .tests-main { order: 1; }
    .tests-page .test-list,
    .tests-page .exam-test-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 720px) {
    .tests-page .test-list,
    .tests-page .exam-test-list {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 640px) {
    .tests-page .test-row,
    .catalog-page .test-row {
        flex-wrap: wrap;
        align-items: flex-start;
    }
    .tests-page .test-row-actions,
    .catalog-page .test-row-actions {
        width: 100%;
        justify-content: space-between;
        padding-top: 4px;
        border-top: 1px solid var(--color-border);
        margin-top: 4px;
        padding-top: 12px;
    }
}

/* ---------- Test list rows (legacy / other pages) ---------- */
.test-list { display: flex; flex-direction: column; gap: 12px; }
.test-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
}
.test-row-info h3 { margin: 0 0 4px; font-size: 1rem; }
.test-row-info p { margin: 0; color: var(--color-text-muted); font-size: 0.85rem; }
.test-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.paper-bundle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #FDF8EC;
    border: 1px solid #E8D9A8;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 16px;
}
.paper-bundle-meta {
    margin: 4px 0 0;
    color: var(--color-text-muted);
    font-size: 0.88rem;
}
.purchase-section-title {
    margin: 28px 0 12px;
    font-size: 1.05rem;
    font-weight: 700;
}
.purchase-section-title:first-of-type {
    margin-top: 0;
}
@media (max-width: 560px) {
    .paper-bundle { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
    .test-row { flex-direction: column; align-items: flex-start; gap: 12px; }
    .test-row-actions { width: 100%; justify-content: space-between; }
}

/* ---------- Test player ---------- */
.test-topbar {
    background: var(--color-primary);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}
.test-topbar-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.test-topbar-inner h2 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.test-topbar-tools { display: flex; align-items: center; gap: 12px; }
.test-lang {
    display: inline-flex;
    background: rgba(255,255,255,0.12);
    border-radius: 999px;
    padding: 3px;
}
.test-lang-btn {
    border: 0;
    background: transparent;
    color: #fff;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
}
.test-lang-btn.is-active { background: #fff; color: var(--color-primary); }
.result-lang {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    margin: 0 0 16px;
}
.result-lang .test-lang-btn { color: var(--color-text); }
.result-lang .test-lang-btn.is-active { background: var(--color-primary); color: #fff; }
.lang-fallback { margin: 0 0 10px; color: var(--color-text-muted); font-size: 0.88rem; }
.timer-display {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 1.1rem;
    background: rgba(255,255,255,0.12);
    padding: 4px 14px;
    border-radius: 999px;
}
.timer-display.timer-critical { background: var(--color-danger); }

.player-layout {
    max-width: 1040px;
    margin: 0 auto;
    padding: 28px 24px 60px;
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 24px;
    align-items: start;
}
.question-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}
.question-number { color: var(--color-text-muted); font-size: 0.85rem; font-weight: 600; margin: 0 0 10px; }
.question-text { font-size: 1.15rem; font-weight: 600; margin: 0 0 24px; line-height: 1.5; }
.question-stem { margin: 0 0 12px; font-size: 1.15rem; font-weight: 600; line-height: 1.5; }
.options-heading { margin: 0 0 12px; font-weight: 600; color: var(--color-text-muted); font-size: 0.95rem; }

.matching-block { margin: 0 0 20px; overflow-x: auto; }
.matching-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; font-weight: 400; }
.matching-table th,
.matching-table td { border: 1px solid var(--color-border); padding: 10px 12px; text-align: left; vertical-align: top; }
.matching-table th { background: #f8f9fb; font-weight: 700; font-size: 0.85rem; }
.matching-num { font-weight: 700; color: var(--color-primary); margin-right: 4px; }

.matching-admin-rows { display: flex; flex-direction: column; gap: 8px; }
.matching-admin-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.matching-admin-row .remove-match-row { min-width: 36px; padding: 6px 10px; }

.review-item .matching-block { margin: 12px 0; }

/* ---------- Question bank editor (admin) ---------- */
.qadmin-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.qadmin-header .page-title { margin-bottom: 4px; }
.qadmin-header .page-subtitle { margin: 0; max-width: 640px; }

.qadmin-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 18px 0 20px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.qadmin-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    padding: 2px;
}
.qadmin-tab {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    border: 1px solid transparent;
    background: transparent;
    padding: 9px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.25;
    color: var(--color-text-muted);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.qadmin-tab:hover {
    color: var(--color-text);
    background: #f3f4f6;
    border-color: #e5e7eb;
}
.qadmin-tab.is-active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 1px 2px rgba(22, 21, 16, 0.12);
}
.qadmin-tab.is-active:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary-light);
    color: #fff;
}
.qadmin-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 2px 4px 2px 12px;
    margin-left: auto;
    border-left: 1px solid var(--color-border);
}
.qadmin-bar-actions .btn {
    white-space: nowrap;
}
.qadmin-bar-actions .btn-outline {
    background: #fff;
    border: 1px solid var(--color-border);
}
.qadmin-bar-actions .btn-outline:hover:not(:disabled) {
    background: #fafbfc;
    border-color: var(--color-primary-light);
    color: var(--color-text);
}

.qadmin-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--color-text-muted);
}
.qadmin-empty p { margin: 0 0 16px; }
.qadmin-preview-cell { max-width: 420px; }
.q-select-col { width: 42px; text-align: center; }
.q-sno-col { width: 56px; text-align: center; white-space: nowrap; }
.q-order-col { width: 88px; text-align: center; white-space: nowrap; }

body.q-preview-open { overflow: hidden; }
.q-test-preview {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: stretch;
    justify-content: center;
}
.q-test-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 16, 20, 0.55);
}
.q-test-preview-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(820px, 100%);
    max-width: 100%;
    height: 100%;
    margin: 0 auto;
    background: #F4F1EA;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.06), 0 24px 60px rgba(0,0,0,0.28);
}
.q-test-preview-header {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
}
.q-test-preview-kicker {
    margin: 0 0 2px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-brand-dark);
}
.q-test-preview-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.q-test-preview-sub { margin: 4px 0 0; font-size: 0.88rem; }
.q-test-preview-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.q-test-preview-lang { display: inline-flex; gap: 6px; }
.q-test-preview-lang .q-preview-lang.is-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}
.q-test-preview-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px 16px 40px;
}
.q-test-preview-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 720px;
    margin: 0 auto;
}
.q-preview-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 20px 20px 16px;
    box-shadow: 0 8px 24px rgba(16, 16, 20, 0.06);
}
.q-preview-card.is-inactive { opacity: 0.72; }
.q-preview-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.q-preview-qno {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--color-primary);
}
.q-preview-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    font-size: 0.82rem;
}
.q-preview-fallback {
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #FFF6E5;
    color: #7A5A12;
    font-size: 0.85rem;
}
.q-preview-stem .question-stem {
    margin: 0 0 14px;
    font-size: 1.12rem;
    font-weight: 600;
    line-height: 1.5;
}
.q-preview-options .option-btn {
    cursor: default;
    pointer-events: none;
    position: relative;
}
.q-preview-options .option-btn.is-correct {
    border-color: #1B7A45;
    background: #EAF8F0;
}
.q-preview-options .option-btn.is-correct .option-key {
    background: #1B7A45;
    border-color: #1B7A45;
    color: #fff;
}
.q-preview-correct-tag {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 700;
    color: #1B7A45;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.q-preview-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 14px 0 0;
    font-size: 0.88rem;
    color: var(--color-text-muted);
}
.q-preview-explanation {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #FCFAF6;
    border: 1px dashed var(--color-border);
}
.q-preview-explanation strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}
.q-preview-explanation p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
}
.q-preview-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}
@media (max-width: 640px) {
    .q-test-preview-header {
        flex-direction: column;
        align-items: stretch;
    }
    .q-test-preview-header-actions {
        justify-content: space-between;
    }
    .q-preview-card-top {
        flex-direction: column;
    }
    .q-preview-badges {
        justify-content: flex-start;
    }
}
.export-columns-panel {
    margin: 0 0 14px;
    padding: 10px 14px;
    background: #f7f9fb;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.export-columns-panel > summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
}
.export-columns-actions {
    margin: 10px 0 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.export-columns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 6px 12px;
    margin-top: 4px;
}
.export-col-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin: 0;
    cursor: pointer;
}
.qadmin-options-mini {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.35;
    max-width: 520px;
}
.q-questions-grid .qadmin-preview-cell {
    white-space: normal;
    max-width: 560px;
}
.q-questions-grid .admin-actions {
    white-space: nowrap;
}
.q-delete-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0 0 12px;
}
.btn-danger-quiet { color: #9b2335; border-color: #e7c4cb; }
.btn-danger-quiet:hover:not(:disabled) { background: #fdf2f4; border-color: #9b2335; color: #9b2335; }

.qeditor-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}
.qeditor-main { min-width: 0; }
.qeditor-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 22px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.qeditor-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.qeditor-card-head h2 { margin: 0; font-size: 1.2rem; }
.qeditor-card-title { margin: 0 0 8px; font-size: 1rem; }
.qeditor-type-select { min-width: 260px; margin: 0; }
.qeditor-type-select label { font-size: 0.8rem; }
.qeditor-textarea { font-size: 1rem; line-height: 1.5; min-height: 88px; }

.match-editor-table-wrap {
    overflow-x: auto;
    margin: 12px 0 14px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
}

/* Matching pair cards (admin editor) */
.match-steps-badge {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.match-help-box {
    margin: 0 0 18px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--color-text-muted);
}
.match-help-box strong { color: var(--color-text); }
.match-headings-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.match-pairs-list { display: flex; flex-direction: column; gap: 12px; }
.match-pair-card {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    background: #fafbfc;
    border: 1px solid var(--color-border);
    border-radius: 10px;
}
.match-pair-num {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.match-pair-fields {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: end;
    min-width: 0;
}
.match-pair-field { min-width: 0; }
.match-pair-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 5px;
}
.match-pair-field input {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.95rem;
}
.match-pair-join {
    padding-bottom: 10px;
    font-size: 1.2rem;
    color: var(--color-brand);
    font-weight: 700;
}
.match-pair-card .remove-match-row {
    align-self: center;
    white-space: nowrap;
}
.match-pairs-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}
.match-paste-panel {
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px dashed var(--color-border);
    border-radius: 10px;
    background: #fff;
}
.match-paste-panel summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-primary);
}
.match-paste-panel p { margin: 10px 0 8px; }
.match-paste-panel textarea { margin-bottom: 10px; font-size: 0.88rem; }
#optionsHint code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

.match-editor-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
}
.match-editor-table th,
.match-editor-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}
.match-editor-table thead th {
    background: #f8f9fb;
    font-size: 0.8rem;
    font-weight: 700;
}
.match-editor-table .col-num { width: 44px; text-align: center; color: var(--color-text-muted); font-weight: 700; }
.match-editor-table .col-action { width: 52px; }
.match-col-heading { font-weight: 700; font-size: 0.9rem; }
.match-editor-table textarea { min-height: 64px; resize: vertical; font-size: 0.95rem; }
.match-row-actions { text-align: center; }
.match-row-num { font-weight: 700; color: var(--color-primary); }

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 12px;
}
.option-editor-card { min-width: 0; }
.option-editor-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 6px;
}
.option-editor-card textarea { min-height: 72px; resize: vertical; }

.qeditor-scoring-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}
.field-hint { display: block; font-size: 0.75rem; color: var(--color-text-muted); margin-top: 4px; }

.qeditor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 0 24px;
    position: sticky;
    bottom: 0;
    background: linear-gradient(to top, #F4F0E6 70%, transparent);
    z-index: 2;
}
.qeditor-actions .btn-lg { padding: 12px 28px; font-size: 1rem; }

.qeditor-preview-panel {
    position: sticky;
    top: 16px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: var(--shadow);
}
.qeditor-preview-panel h3 { margin: 0 0 4px; font-size: 0.95rem; }
.qeditor-preview-body { margin-top: 14px; }
.qeditor-preview-body .question-stem { font-size: 0.95rem; }
.qeditor-preview-body .matching-table { font-size: 0.82rem; }
.preview-card { font-size: 0.9rem; }
.preview-options { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.preview-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #fafbfc;
}
.preview-option .option-key {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #e8ecf1;
    font-weight: 700;
    font-size: 0.8rem;
}

.qbulk-card { max-width: 900px; }
.qbulk-format {
    background: #f8f9fb;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.85rem;
    margin: 12px 0 16px;
    line-height: 1.6;
}
.qbulk-template { margin: 0 0 14px; }
.qbulk-mode { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.qbulk-template a { font-weight: 600; }
.qbulk-file { display: block; margin-top: 6px; }
.qbulk-textarea {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 14px;
}

@media (max-width: 1100px) {
    .qeditor-layout { grid-template-columns: 1fr; }
    .qeditor-preview-panel { position: static; }
}
@media (max-width: 720px) {
    .options-grid { grid-template-columns: 1fr; }
    .qeditor-scoring-grid { grid-template-columns: 1fr 1fr; }
    .qadmin-header { flex-direction: column; }
    .qadmin-bar { flex-direction: column; align-items: stretch; }
    .qadmin-bar-actions {
        margin-left: 0;
        padding: 8px 4px 2px;
        border-left: none;
        border-top: 1px solid var(--color-border);
        justify-content: stretch;
    }
    .qadmin-bar-actions .btn { flex: 1; text-align: center; }
    .match-headings-row { grid-template-columns: 1fr; }
    .match-pair-card { grid-template-columns: 1fr; }
    .match-pair-num { width: 28px; height: 28px; font-size: 0.85rem; }
    .match-pair-fields { grid-template-columns: 1fr; }
    .match-pair-join { display: none; }
    .match-pair-card .remove-match-row { justify-self: start; }
}

/* ---------- Content manager (admin) ---------- */
.content-manager {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    min-height: 60vh;
    transition: grid-template-columns 0.2s ease;
}
.content-manager.is-sidebar-collapsed {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 16px;
}
.cm-sidebar {
    position: sticky;
    top: 16px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 16px 12px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.cm-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}
.cm-sidebar-title {
    margin: 0 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
}
.cm-sidebar-toggle {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #FCFAF6;
    color: var(--color-text);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
}
.cm-sidebar-toggle:hover {
    border-color: var(--color-primary-light);
    background: #fff;
}
.cm-nav { display: flex; flex-direction: column; gap: 4px; }
.cm-nav-item {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 11px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cm-nav-item:hover { background: #f3f4f6; color: var(--color-text); }
.cm-nav-item.is-active {
    background: var(--color-primary);
    color: #fff;
}
.content-manager.is-sidebar-collapsed .cm-sidebar {
    padding: 12px 8px;
}
.content-manager.is-sidebar-collapsed .cm-sidebar-head {
    justify-content: center;
    margin-bottom: 8px;
}
.content-manager.is-sidebar-collapsed .cm-sidebar-title {
    display: none;
}
.content-manager.is-sidebar-collapsed .cm-sidebar-toggle {
    transform: rotate(180deg);
}
.content-manager.is-sidebar-collapsed .cm-nav-item {
    padding: 11px 0;
    text-align: center;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
}
.content-manager.is-sidebar-collapsed .cm-nav-item[data-view="exam"]::before { content: "Ex"; }
.content-manager.is-sidebar-collapsed .cm-nav-item[data-view="paper"]::before { content: "Pa"; }
.content-manager.is-sidebar-collapsed .cm-nav-item[data-view="test"]::before { content: "Te"; }
.content-manager.is-sidebar-collapsed .cm-nav-item[data-view="questions"]::before { content: "Qu"; }
.content-manager.is-sidebar-collapsed .cm-nav-item[data-view="coverage"]::before { content: "Co"; }
.content-manager.is-sidebar-collapsed .cm-nav-item {
    font-size: 0;
}
.content-manager.is-sidebar-collapsed .cm-nav-item::before {
    font-size: 0.78rem;
    font-weight: 700;
}
.cm-main { min-width: 0; overflow-x: auto; }
.cm-main .page-title { margin-top: 0; }
.cm-split {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    margin-top: 20px;
}
.cm-form-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 22px;
    box-shadow: var(--shadow);
}
.cm-form-card h2 { margin: 0 0 18px; font-size: 1.05rem; }
.cm-form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.banner-field { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--color-border); }
.banner-field > label { display: block; font-weight: 600; margin-bottom: 8px; }
.banner-preview {
    display: block;
    width: 100%;
    height: auto;
    max-height: 160px;
    object-fit: cover;
    object-position: center;
    border-radius: 10px;
    margin-bottom: 8px;
    background: #111;
}
.banner-thumb {
    display: block;
    width: 120px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
    background: #111;
}
.coverage-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0 18px;
}
.coverage-stat {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: var(--shadow);
}
.coverage-stat-value { margin: 0; font-size: 1.45rem; font-weight: 700; color: var(--color-primary); }
.coverage-stat-label { margin: 4px 0 0; color: var(--color-text-muted); font-size: 0.84rem; }
.coverage-stat.is-warn .coverage-stat-value { color: #B45309; }
.coverage-stat.is-ok .coverage-stat-value { color: var(--color-accent-free); }
.coverage-paper-row td { background: #fff; }
.coverage-paper-row.is-open td { background: #F8FAFC; }
.coverage-tests-row td {
    padding: 0 14px 14px;
    background: #F8FAFC;
    border-bottom: 1px solid var(--color-border);
}
.coverage-tests {
    margin: 0;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
}
.coverage-test {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 88px auto;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
}
.coverage-test:last-child { border-bottom: none; padding-bottom: 0; }
.coverage-test:first-child { padding-top: 0; }
.coverage-test-name { font-weight: 600; min-width: 0; }
.coverage-test-q { color: var(--color-text-muted); font-size: 0.88rem; }
.coverage-test-q.is-empty { color: #B45309; font-weight: 600; }
.coverage-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.badge-warn { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
@media (max-width: 900px) {
    .coverage-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .coverage-test { grid-template-columns: minmax(0, 1fr) auto; }
    .coverage-test-q { grid-column: 1 / -1; }
}
.banner-file-proxy { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.banner-row { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.banner-row .btn { padding: 4px 8px; font-size: 0.75rem; white-space: nowrap; }
#paperList.admin-table-wrap, #examList.admin-table-wrap { overflow-x: auto; }
.cm-series {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}
.cm-series h3 { margin: 0 0 6px; font-size: 0.98rem; }
.cm-series .muted { margin: 0 0 12px; }
.cm-series-range { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#testList.admin-table-wrap {
    overflow: auto;
    min-width: 0;
    -webkit-overflow-scrolling: touch;
}
.test-list-panel {
    display: flex;
    flex-direction: column;
    min-width: 720px;
    max-height: calc(100vh - 220px);
}
.test-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
}
.test-list-toolbar .form-control { max-width: 220px; }
.test-list-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: visible;
    min-height: 0;
}
.test-list-panel .test-row {
    display: grid;
    grid-template-columns: minmax(220px, 2.2fr) 72px 72px 64px 72px 72px;
    gap: 10px;
    align-items: start;
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border);
    min-width: 720px;
}
.test-row-head {
    padding-top: 10px;
    padding-bottom: 10px;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    background: #F8FAFC;
}
.test-row-name {
    min-width: 0;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
    font-weight: 600;
}
.test-row-num {
    display: inline-block;
    margin-right: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #F1E8D0;
    color: var(--color-brand-dark);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    vertical-align: middle;
}
.test-row-meta { color: var(--color-text-muted); font-size: 0.85rem; white-space: nowrap; }
.test-list-panel .test-row .btn { padding: 6px 10px; font-size: 0.8rem; }
.cm-cascade-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 16px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.cm-cascade-bar-2 { grid-template-columns: 1fr 1fr; }
.cm-cascade-bar-3 { grid-template-columns: 1fr 1fr 1fr; }
.cm-cascade-field { margin: 0; }
.cm-cascade-field label { font-weight: 600; font-size: 0.85rem; }
.cm-pick-prompt {
    margin-top: 24px;
    padding: 40px 24px;
    text-align: center;
    background: #fff;
    border: 2px dashed var(--color-border);
    border-radius: 12px;
    color: var(--color-text-muted);
}
@media (max-width: 720px) {
    .test-list-panel .test-row { grid-template-columns: minmax(0, 1fr) auto; }
    .test-list-panel .test-row-head,
    .test-list-panel .test-row-meta { display: none; }
}
@media (max-width: 960px) {
    .content-manager { grid-template-columns: 1fr; }
    .cm-sidebar { position: static; }
    .cm-nav { flex-direction: row; flex-wrap: wrap; }
    .cm-nav-item { width: auto; flex: 1; text-align: center; min-width: 140px; }
    .cm-split { grid-template-columns: 1fr; }
    .cm-cascade-bar-2, .cm-cascade-bar-3 { grid-template-columns: 1fr; }
}

.options-container { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
}
.option-btn:hover { border-color: var(--color-primary-light); }
.option-btn.selected { border-color: var(--color-brand); background: #F7F3EA; }
.option-key {
    flex-shrink: 0;
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.82rem;
}
.option-btn.selected .option-key { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.nav-buttons { display: flex; justify-content: space-between; gap: 12px; }
.btn-outline { background: #fff; border: 1px solid var(--color-border); color: var(--color-text); }
.btn-outline:hover:not(:disabled) { border-color: var(--color-primary-light); }

.palette-sidebar {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    position: sticky;
    top: 84px;
}
.answered-count-text { font-size: 0.82rem; color: var(--color-text-muted); margin: 0 0 12px; }
.palette-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}
.palette-btn {
    aspect-ratio: 1;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}
.palette-btn.answered { background: #E4F6EC; border-color: var(--color-accent-free); color: var(--color-accent-free); }
.palette-btn.current { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.submit-btn { margin-top: 4px; }

@media (max-width: 720px) {
    .player-layout { grid-template-columns: 1fr; }
    .palette-sidebar { position: static; }
}

/* ---------- Result page ---------- */
.result-summary-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    text-align: center;
    margin-bottom: 8px;
}
.result-score { font-size: 2.4rem; font-weight: 700; margin-bottom: 16px; }
.result-score.score-positive { color: var(--color-accent-free); }
.result-score.score-negative { color: var(--color-danger); }
.result-stats { display: flex; justify-content: center; gap: 36px; }
.result-stat { display: flex; flex-direction: column; align-items: center; }
.stat-value { font-size: 1.3rem; font-weight: 700; }
.stat-correct { color: var(--color-accent-free); }
.stat-wrong { color: var(--color-danger); }
.stat-unattempted { color: var(--color-text-muted); }
.stat-label { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 2px; }

.review-list { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.review-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left-width: 4px;
    border-radius: var(--radius);
    padding: 18px 20px;
}
.review-correct { border-left-color: var(--color-accent-free); }
.review-wrong { border-left-color: var(--color-danger); }
.review-unattempted { border-left-color: var(--color-text-muted); }
.review-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}
.review-option { padding: 6px 0; font-size: 0.9rem; color: var(--color-text-muted); }
.review-option .option-key {
    display: inline-flex; width: 20px; height: 20px; font-size: 0.72rem;
    border-radius: 50%; border: 1px solid var(--color-border);
    align-items: center; justify-content: center; margin-right: 8px;
}
.review-option.correct-answer { color: var(--color-accent-free); font-weight: 600; }
.review-option.correct-answer .option-key { border-color: var(--color-accent-free); background: #E4F6EC; }
.review-option.wrong-answer { color: var(--color-danger); font-weight: 600; }
.review-option.wrong-answer .option-key { border-color: var(--color-danger); background: #FCEDEB; }
.review-explanation {
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px dashed var(--color-border);
    font-size: 0.86rem;
    color: var(--color-text-muted);
}

.btn.btn-header-cta { padding: 8px 14px; font-size: 0.85rem; }

/* ---------- Public landing page ---------- */
body.landing { background: #FFFDF8; }
body.landing .site-footer { margin-top: 0; }

.landing-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

.hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(ellipse 70% 55% at 85% 10%, rgba(31, 157, 99, 0.22), transparent 55%),
        radial-gradient(ellipse 45% 40% at 8% 90%, rgba(44, 78, 133, 0.55), transparent 50%),
        linear-gradient(165deg, #0B1A33 0%, #16305B 58%, #1A3A6E 100%);
    padding: 56px 0 72px;
    min-height: 520px;
    display: flex;
    align-items: center;
}
.hero.hero-graphic {
    display: block;
    padding: 0;
    min-height: 0;
    color: var(--color-text);
    background: #fff;
    position: relative;
    z-index: 1;
    /* Soft top recess so banner sits under the elevated nav */
    box-shadow: 0 -1px 0 rgba(22, 21, 16, 0.04) inset;
}
.hero.hero-graphic::before { display: none; }
.hero-graphic .hero-banner-img {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    object-fit: unset;
    object-position: center;
}

/* ---------- Hero featured-video dock (rotating orb + slide panel) ---------- */
.hero-video-dock {
    /* Center bridge between banner and Combo Deals */
    position: relative;
    z-index: 12;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: -28px 0 8px;
    min-height: 96px;
    pointer-events: none;
}
.hero-video-dock[hidden] { display: none !important; }
.hero-video-orb {
    pointer-events: auto;
    position: relative;
    width: 88px;
    height: 88px;
    margin: 0;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    z-index: 2;
    filter: drop-shadow(0 10px 22px rgba(16, 24, 40, 0.32));
}
.hero-video-orb-spin {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        conic-gradient(from 0deg, #E8C65A, transparent 28%, #C9A227 48%, transparent 72%, #A8861C 100%);
    animation: hero-orb-spin 6s linear infinite;
}
.hero-video-orb-spin::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: #0B1A33;
}
.hero-video-orb-face {
    position: absolute;
    inset: 11px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    display: grid;
    place-items: center;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9);
}
.hero-video-orb-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.hero-video-orb-play {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(225, 29, 46, 0.95);
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.35);
}
.hero-video-orb-play::after {
    content: "";
    position: absolute;
    left: 12px;
    top: 9px;
    border-style: solid;
    border-width: 7px 0 7px 11px;
    border-color: transparent transparent transparent #fff;
}
.hero-video-orb-text {
    position: absolute;
    left: 50%;
    bottom: -20px;
    transform: translateX(-50%);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    background: #0B1A33;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(201, 162, 39, 0.55);
    white-space: nowrap;
    animation: hero-orb-pulse 2.4s ease-in-out infinite;
}
@keyframes hero-orb-spin {
    to { transform: rotate(360deg); }
}
@keyframes hero-orb-pulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
    50% { transform: translateX(-50%) scale(1.05); opacity: 0.88; }
}
.hero-video-panel {
    pointer-events: none;
    position: absolute;
    left: 50%;
    top: calc(100% + 14px);
    width: min(380px, calc(100vw - 32px));
    transform: translate(-50%, 12px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease, visibility 0.28s;
    background: linear-gradient(180deg, #FFFBF3 0%, #F7EFD9 100%);
    border: 1px solid rgba(201, 162, 39, 0.4);
    border-radius: 16px;
    padding: 12px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.75) inset,
        0 18px 40px rgba(16, 24, 40, 0.28);
    z-index: 20;
}
.hero-video-dock.is-open .hero-video-panel {
    pointer-events: auto;
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
}
.hero-video-dock.is-open .hero-video-orb-spin {
    animation-duration: 2.5s;
}
.hero-video-dock.is-open {
    z-index: 80;
    margin-bottom: 20px;
}
/* Tighten packages top padding when the watch orb sits between banner & section */
body.landing:has(#heroVideoDock:not([hidden])) #packages {
    padding-top: 36px;
}
body.landing:has(#heroVideoDock.is-open) #packages {
    padding-top: 28px;
}
.hero-video-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.hero-video-kicker {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8F7318;
}
.hero-video-close {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(201, 162, 39, 0.35);
    border-radius: 8px;
    background: #fff;
    color: var(--color-primary);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
.hero-video-close:hover { background: rgba(201, 162, 39, 0.12); }
.hero-video-stage {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #0B1A33;
    aspect-ratio: 16 / 9;
    z-index: 1;
}
.hero-video-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    cursor: pointer;
    background: #0B1A33;
    z-index: 1;
}
.hero-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.hero-video-thumb-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 52px;
    height: 52px;
    margin: -26px 0 0 -26px;
    border-radius: 50%;
    background: rgba(225, 29, 46, 0.95);
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.35);
}
.hero-video-thumb-play::after {
    content: "";
    position: absolute;
    left: 21px;
    top: 16px;
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent #fff;
}
.hero-video-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #0B1A33;
    z-index: 2;
}
.hero-video-frame[hidden] { display: none !important; }
.hero-video-thumb[hidden] { display: none !important; }
.hero-video-title {
    margin: 10px 4px 4px;
    font-size: 0.95rem;
    line-height: 1.35;
    color: var(--color-primary);
}
.hero-video-more {
    display: inline-block;
    margin: 0 4px 2px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #8F7318;
}
.hero-video-more:hover { color: var(--color-primary); text-decoration: underline; }

@media (max-width: 720px) {
    .hero-video-dock {
        margin: -18px 0 4px;
        min-height: 84px;
    }
    .hero-video-orb {
        width: 74px;
        height: 74px;
    }
    .hero-video-orb-text { bottom: -18px; font-size: 0.62rem; }
    .hero-video-panel {
        width: min(360px, calc(100vw - 24px));
        z-index: 120;
    }
}
.hero-cta-bar {
    background: #F7F3EA;
    color: var(--color-text);
    padding: 18px 0;
    border-bottom: 1px solid var(--color-border);
}
.hero-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.hero-cta-inner p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.45;
    max-width: 36em;
}
.hero-banner-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 72% center;
    display: none;
}
.hero-grid {
    position: relative;
    z-index: 1;
    width: 100%;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: center;
}
.hero-eyebrow {
    display: inline-block;
    margin: 0 0 14px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(31, 157, 99, 0.18);
    border: 1px solid rgba(31, 157, 99, 0.35);
    color: #8EE0B5;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.hero-copy h1 {
    font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    font-size: clamp(2rem, 4.2vw, 3.15rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
}
.hero-lead {
    margin: 0 0 28px;
    font-size: 1.05rem;
    line-height: 1.65;
    color: rgba(255,255,255,0.78);
    max-width: 34em;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}
.hero-trust li {
    display: flex;
    align-items: center;
    gap: 8px;
}
.hero-trust li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent-free);
}

.hero-preview { display: flex; justify-content: flex-end; }
.preview-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    color: var(--color-text);
    border-radius: 14px;
    box-shadow: 0 24px 50px rgba(0,0,0,0.28);
    overflow: hidden;
    pointer-events: none;
}
.preview-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-primary);
    color: #fff;
    padding: 12px 16px;
    font-size: 0.82rem;
    font-weight: 600;
}
.preview-timer {
    font-variant-numeric: tabular-nums;
    background: rgba(255,255,255,0.14);
    padding: 3px 10px;
    border-radius: 999px;
}
.preview-qnum {
    margin: 16px 18px 6px;
    color: var(--color-text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}
.preview-qtext {
    margin: 0 18px 14px;
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.45;
}
.preview-options { padding: 0 18px; display: flex; flex-direction: column; gap: 8px; }
.preview-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.9rem;
}
.preview-option.selected {
    border-color: var(--color-brand);
    background: #F7F3EA;
}
.preview-option .option-key {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.75rem;
}
.preview-option.selected .option-key {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}
.preview-footer {
    display: flex;
    gap: 8px;
    padding: 16px 18px 18px;
    flex-wrap: wrap;
}
.preview-chip {
    font-size: 0.72rem;
    font-weight: 600;
    background: #E4F6EC;
    color: var(--color-accent-free);
    padding: 4px 10px;
    border-radius: 999px;
}
.preview-chip-muted { background: #EEF1F6; color: var(--color-text-muted); }

.trust-bar {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 22px 0;
}
.trust-bar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.trust-item { display: flex; gap: 12px; align-items: flex-start; }
.trust-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #F4E9C8;
    color: var(--color-brand-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}
.trust-item strong { display: block; font-size: 0.92rem; }
.trust-item > div span { font-size: 0.82rem; color: var(--color-text-muted); line-height: 1.4; }

.landing-section { padding: 72px 0; }
.landing-section-alt { background: var(--color-bg); }
.landing-section-exams {
    background:
        radial-gradient(ellipse 50% 40% at 0% 0%, rgba(201, 162, 39, 0.12), transparent 60%),
        radial-gradient(ellipse 40% 50% at 100% 100%, rgba(22, 21, 16, 0.05), transparent 55%),
        #FFFDF8;
}

.section-header { max-width: 640px; margin-bottom: 36px; }
.section-header-row {
    max-width: none;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}
.section-header-row > div { max-width: 640px; }
.section-header-action { flex-shrink: 0; }
.section-kicker {
    margin: 0 0 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-brand);
}
.section-header h2 {
    margin: 0 0 10px;
    font-size: clamp(1.45rem, 2.4vw, 1.9rem);
    letter-spacing: -0.02em;
    line-height: 1.25;
}
.section-lead { margin: 0; color: var(--color-text-muted); line-height: 1.6; }

.exam-showcase {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}
.exam-unlocks {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}
.exam-unlocks .unlock-all-card {
    grid-column: auto;
    margin: 0;
}
.exam-order-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.exam-order-controls .btn {
    min-width: 34px;
    padding-left: 8px;
    padding-right: 8px;
}
.notes-showcase {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.showcase-card {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.showcase-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(16, 24, 40, 0.14);
    border-color: transparent;
}
.showcase-media {
    position: relative;
    min-height: 128px;
    padding: 18px 20px;
    display: flex;
    align-items: flex-end;
    color: #fff;
    background: linear-gradient(135deg, #1C1B16, #3A3420);
}
.showcase-card.is-jpsc .showcase-media {
    background:
        radial-gradient(circle at 85% 20%, rgba(201, 162, 39, 0.35), transparent 42%),
        linear-gradient(135deg, #101014 0%, #1C1B16 55%, #3A3420 100%);
}
.showcase-card.has-banner .showcase-media {
    min-height: 0;
    padding: 0;
    display: block;
    background: #071427;
}
.showcase-banner {
    display: block;
    width: 100%;
    height: auto;
}
.showcase-card.is-jssc .showcase-media {
    background:
        radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.18), transparent 40%),
        linear-gradient(135deg, #0d4a32 0%, #1F9D63 100%);
}
.showcase-card.is-gk .showcase-media {
    background:
        radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.16), transparent 40%),
        linear-gradient(135deg, #5c3d12 0%, #C77F1B 100%);
}
.showcase-card.is-paper .showcase-media {
    background:
        radial-gradient(circle at 85% 20%, rgba(201, 162, 39, 0.35), transparent 42%),
        linear-gradient(135deg, #101014 0%, #1C1B16 55%, #3A3420 100%);
}
.showcase-card.is-chapter .showcase-media {
    background:
        radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.16), transparent 40%),
        linear-gradient(135deg, #5c3d12 0%, #C9A227 100%);
}
.showcase-card.is-subject .showcase-media {
    background:
        radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.18), transparent 40%),
        linear-gradient(135deg, #12343a 0%, #1F7A6B 100%);
}
.section-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}
.page-kicker {
    margin: 0 0 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-brand);
}
.showcase-hot,
.showcase-badge {
    position: absolute;
    top: 14px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.showcase-hot {
    left: 14px;
    background: #fff;
    color: var(--color-primary);
}
.showcase-badge {
    right: 14px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
}
.showcase-media-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
}
.showcase-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.showcase-body h3 { margin: 0 0 6px; font-size: 1.2rem; letter-spacing: -0.02em; }
.showcase-body p {
    margin: 0 0 16px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    min-height: 2.7em;
    flex: 1;
}
.showcase-meta {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.showcase-meta li {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--color-brand-dark);
    background: #F4E9C8;
    padding: 5px 10px;
    border-radius: 999px;
}
.showcase-card.is-jssc .showcase-meta li { background: #E4F6EC; color: #157a4c; }
.showcase-card.is-gk .showcase-meta li { background: #FDF1DF; color: var(--color-accent-paid); }
.showcase-cta {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--color-primary);
}
.showcase-card:hover .showcase-cta { color: var(--color-brand-dark); }

.notes-card {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    min-height: 220px;
    overflow: hidden;
}
.notes-card.has-media {
    padding: 0;
}
.notes-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #111;
    overflow: hidden;
}
.notes-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pkg-price-tag {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    padding: 10px 16px 9px;
    border-radius: 999px;
    background: linear-gradient(145deg, #F0D56A 0%, #C9A227 48%, #A8861C 100%);
    color: #16151A;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.92),
        0 10px 22px rgba(16, 24, 40, 0.35);
    white-space: nowrap;
}
.notes-card-media .pkg-price-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    font-size: 1.35rem;
    transform: rotate(-2deg);
}
.notes-card-top .pkg-price-tag {
    font-size: 1.2rem;
}
.pkg-price-tag--list {
    font-size: 1.15rem;
    margin-bottom: 8px;
    transform: none;
}
.test-row-actions .pkg-price-tag--list {
    display: flex;
}
.pkg-price-currency {
    font-size: 0.72em;
    font-weight: 800;
    opacity: 0.9;
}
.pkg-price-amount {
    font-variant-numeric: tabular-nums;
}
.notes-card:hover .pkg-price-tag {
    transform: rotate(0deg) scale(1.04);
    transition: transform 0.18s ease;
}
.notes-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.notes-card.has-media .notes-card-body {
    padding: 18px 22px 22px;
}
.notes-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 36px rgba(16, 24, 40, 0.12);
}
.notes-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}
.banner-thumb-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 52px;
    border-radius: 6px;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}
.pkg-row-thumb {
    flex: 0 0 112px;
    width: 112px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    background: #111;
}
.pkg-row-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.catalog-page .test-row.pkg-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
}
.pkg-card-main {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
    width: 100%;
}
.pkg-card .test-row-info {
    flex: 1;
    min-width: 0;
}
.pkg-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
}
.test-meta-sep {
    color: #c4bba8;
    font-weight: 700;
}
.pkg-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}
.pkg-card-footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.pkg-card .pkg-price-tag--list {
    margin-bottom: 0;
}
.pkg-details-btn {
    margin-top: 0;
    padding: 7px 14px;
    font-size: 0.85rem;
}
.pkg-card .buy-pkg-cta {
    flex: 0 0 auto;
    min-width: 110px;
}
/* Phone / narrow: full-bleed thumbnail above the title */
@media (max-width: 720px) {
    /* Packages / catalog: pull content up so first card is visible without scrolling */
    .catalog-page.page-container {
        padding: 12px 16px 24px;
    }
    .catalog-page .back-link {
        margin-top: 0;
        margin-bottom: 10px;
        padding: 7px 12px;
        font-size: 0.82rem;
    }
    .catalog-page .catalog-page-header {
        margin-bottom: 10px;
    }
    .catalog-page .catalog-page-kicker {
        margin: 0 0 2px;
        font-size: 0.7rem;
    }
    .catalog-page .page-title {
        font-size: 1.25rem;
        margin: 0;
    }
    .catalog-page .catalog-page-meta {
        margin: 2px 0 0;
        font-size: 0.82rem;
    }
    .catalog-page .catalog-section-label {
        display: none; /* "Available packages" — saves vertical space */
    }
    .catalog-page .loading-text {
        margin: 8px 0;
    }

    .catalog-page .test-row.pkg-card {
        padding: 12px;
        gap: 12px;
    }
    .catalog-page .pkg-card-main {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .catalog-page .pkg-card .pkg-row-thumb,
    .catalog-page .pkg-card-main > .pkg-row-thumb {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        min-height: 160px;
        aspect-ratio: 16 / 9;
        border-radius: 12px;
        align-self: stretch;
    }
    .catalog-page .pkg-card .pkg-row-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    .pkg-card .test-row-info h3 {
        font-size: 1rem;
        line-height: 1.35;
    }
    .pkg-card-meta {
        font-size: 0.82rem;
    }
    .pkg-card .catalog-row-desc {
        max-width: none;
        font-size: 0.84rem;
        margin-top: 8px;
    }
    .pkg-card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .pkg-card-footer-left {
        width: 100%;
        justify-content: space-between;
    }
    .pkg-card .buy-pkg-cta {
        width: 100%;
        min-height: 44px;
        font-size: 0.95rem;
        font-weight: 700;
    }
    .pkg-card .pkg-price-tag--list {
        font-size: 1.2rem;
        padding: 9px 14px 8px;
    }
    .pkg-details-btn {
        min-height: 40px;
        padding: 8px 16px;
    }
}
.pkg-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.pkg-detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 21, 32, 0.55);
}
.pkg-detail-dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: min(80vh, 640px);
    overflow: auto;
    background: var(--color-surface);
    border-radius: 16px;
    border: 1px solid var(--color-border);
    box-shadow: 0 24px 60px rgba(16, 24, 40, 0.28);
}
.pkg-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 8px;
}
.pkg-detail-header h2 {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.35;
}
.pkg-detail-close {
    border: 0;
    background: transparent;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0 4px;
}
.pkg-detail-meta {
    padding: 0 20px 10px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}
.pkg-detail-body {
    padding: 0 20px 8px;
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.55;
}
.pkg-detail-body p { margin: 0 0 12px; white-space: pre-wrap; }
.pkg-detail-footer {
    padding: 12px 20px 18px;
    display: flex;
    justify-content: flex-end;
}
body.pkg-detail-open { overflow: hidden; }
.notes-file-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    padding: 5px 8px;
    border-radius: 8px;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}
.notes-card h3 { margin: 0 0 8px; font-size: 1.08rem; line-height: 1.35; }
.notes-card p { margin: 0 0 18px; color: var(--color-text-muted); font-size: 0.88rem; line-height: 1.5; flex: 1; }
.notes-card-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    flex: 0 0 auto;
    max-height: 4.5em;
}
.notes-card-empty {
    border-style: dashed;
    background: linear-gradient(180deg, #fff, #F7FAFC);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.feature-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 22px;
}
.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #F4E9C8;
    color: var(--color-brand-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.feature-card h3 { margin: 0 0 8px; font-size: 1rem; }
.feature-card p { margin: 0; color: var(--color-text-muted); font-size: 0.88rem; line-height: 1.55; }

.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.step h3 { margin: 4px 0 6px; font-size: 1.05rem; }
.step p { margin: 0; color: var(--color-text-muted); font-size: 0.9rem; line-height: 1.55; }

.cta-band {
    background: linear-gradient(135deg, #101014, #2A2416);
    color: #fff;
    padding: 56px 0;
}
.cta-band-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.cta-band h2 { margin: 0 0 8px; font-size: 1.6rem; letter-spacing: -0.02em; }
.cta-band p { margin: 0; color: rgba(255,255,255,0.75); max-width: 36em; line-height: 1.55; }

.yt-channel {
    background:
        radial-gradient(circle at 88% 20%, rgba(225, 29, 46, 0.28), transparent 42%),
        linear-gradient(120deg, #101014 0%, #1C1512 55%, #2A1818 100%);
    color: #fff;
    padding: 56px 0;
}
.yt-channel-inner {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 32px;
    align-items: center;
}
.yt-channel-copy h2 { margin: 0 0 10px; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.yt-channel-copy p { margin: 0 0 22px; color: rgba(255,255,255,0.78); max-width: 34em; line-height: 1.55; }
.yt-channel-visual { display: flex; justify-content: center; }
.yt-big-play {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #E11D2E;
    box-shadow: 0 12px 32px rgba(225, 29, 46, 0.4);
    position: relative;
}
.yt-big-play::after {
    content: '';
    position: absolute;
    left: 38px;
    top: 30px;
    border-style: solid;
    border-width: 18px 0 18px 30px;
    border-color: transparent transparent transparent #fff;
}
.btn-yt { background: #E11D2E; color: #fff; }
.btn-yt:hover:not(:disabled) { filter: brightness(1.08); color: #fff; }

.topic-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 22px;
}
.topic-chip {
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-text);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}
.topic-chip.is-on,
.topic-chip:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.yt-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.yt-card {
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 0;
    width: 100%;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    font: inherit;
    color: inherit;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.yt-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(16, 24, 40, 0.12); }
.yt-thumb-wrap {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: #111;
}
.yt-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
    border-radius: 50%;
    background: #E11D2E;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}
.yt-play::after {
    content: '';
    position: absolute;
    left: 19px;
    top: 15px;
    border-style: solid;
    border-width: 9px 0 9px 15px;
    border-color: transparent transparent transparent #fff;
}
.yt-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px 16px;
}
.yt-card-body strong { font-size: 0.98rem; line-height: 1.35; }
.yt-mini-channel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #101014;
    color: #fff;
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 24px;
}
.yt-mini-channel p { margin: 4px 0 0; color: rgba(255,255,255,0.7); font-size: 0.88rem; }
.yt-player-wrap {
    margin: 0 0 24px;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
}
.yt-player-wrap iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }
.yt-player-title { margin: 0; padding: 12px 16px; background: #101014; color: #fff; font-weight: 700; }

@media (max-width: 960px) {
    .hero-grid,
    .feature-grid,
    .exam-showcase,
    .notes-showcase,
    .yt-grid,
    .yt-channel-inner,
    .trust-bar-grid,
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-preview { justify-content: flex-start; }
    .section-header-row { flex-direction: column; align-items: flex-start; }
    .hero-cta-inner { flex-wrap: wrap; }
}
@media (max-width: 720px) {
    .hero:not(.hero-graphic) { padding: 36px 0 48px; min-height: 0; }
    .hero-cta-inner { flex-direction: column; align-items: flex-start; }
    .hero-grid,
    .feature-grid,
    .exam-showcase,
    .notes-showcase,
    .yt-grid,
    .yt-channel-inner,
    .trust-bar-grid,
    .steps { grid-template-columns: 1fr; }
    .yt-mini-channel { flex-direction: column; align-items: flex-start; }
    .cta-band-inner { flex-direction: column; align-items: flex-start; }
    .hero-preview { display: none; }
    .landing-section { padding: 48px 0; }

    /* Mobile banner (banner-mobile.jpg) — full image, no crop */
    .hero.hero-graphic {
        min-height: 0;
        background: #0B1A33;
    }
    .hero-graphic picture {
        display: block;
        width: 100%;
    }
    .hero-graphic .hero-banner-img {
        width: 100%;
        height: auto;
        object-fit: contain;
        object-position: center top;
        background: #0B1A33;
    }

    /* Packages: keep kicker + CTA, hide long headline/lead on mobile */
    #packages .section-header-row {
        gap: 12px;
        margin-bottom: 8px;
    }
    #packages #packages-heading,
    #packages .section-lead {
        display: none;
    }
    #packages .section-kicker {
        margin-bottom: 0;
    }
    #packages .section-header-action {
        align-self: center;
    }
}

/* ---------- Admin panel ---------- */
.admin-body { background: #F4F0E6; }
.admin-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}
.admin-sidebar {
    background: var(--color-primary-dark);
    color: #fff;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
}
.admin-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    margin-bottom: 28px;
    padding: 0 8px;
}
.admin-brand-sub {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(201, 162, 39, 0.22);
    color: var(--color-brand);
    padding: 3px 8px;
    border-radius: 999px;
}
.admin-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.admin-nav-link {
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(255,255,255,0.8);
    font-size: 0.92rem;
}
.admin-nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.admin-nav-link.is-active { background: rgba(201, 162, 39, 0.18); color: var(--color-brand); font-weight: 600; }
.admin-sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.admin-main { display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    padding: 14px 28px;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.9rem;
}
.admin-topbar .logout-link { color: var(--color-primary); }
.admin-content { padding: 28px 32px 48px; }
.admin-content .page-title { margin-top: 0; }
.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 8px 0 28px;
}
.admin-stat {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}
.admin-stat-value { margin: 0; font-size: 1.8rem; font-weight: 700; color: var(--color-primary); }
.admin-stat-label { margin: 4px 0 0; color: var(--color-text-muted); font-size: 0.88rem; }
.admin-next { margin-top: 8px; }
.admin-split {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}
.admin-split-wide { grid-template-columns: 1fr 380px; }
.admin-panel {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}
.admin-panel h2 { margin: 0 0 16px; font-size: 1.05rem; }
.admin-table-wrap {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: auto;
    box-shadow: var(--shadow);
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th {
    text-align: left;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-border);
    background: #F8FAFC;
}
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr.is-muted { opacity: 0.55; }
.admin-actions { white-space: nowrap; }
.admin-actions .btn { padding: 6px 10px; font-size: 0.8rem; }
.admin-check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.admin-inline-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.admin-divider { border: none; border-top: 1px solid var(--color-border); margin: 22px 0; }
.muted { color: var(--color-text-muted); font-size: 0.85rem; }
select.form-control { background: #fff; }
.file-hint { margin: 6px 0 0; font-size: 0.8rem; color: var(--color-text-muted); }
input[type=file].form-control { padding: 8px; }

/* Question bank (AllQuestions) */
.qb-filter-panel {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 20px;
}
.qb-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 14px;
}
.qb-search-field { grid-column: span 2; }
.qb-filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}
.qb-result-summary {
    margin-left: auto;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}
.qb-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 16px 0 24px;
}
.qb-page-info { font-size: 0.9rem; color: var(--color-text-muted); }
.qb-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.qb-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}
.qb-modal-dialog {
    position: relative;
    width: min(720px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}
.qb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--color-border);
}
.qb-modal-header h2 { margin: 0; font-size: 1.1rem; }
.qb-modal-body { padding: 18px; }
.qb-meta { margin: 0 0 12px; color: var(--color-text-muted); }
.qb-question-text {
    font-size: 1rem;
    line-height: 1.55;
    margin-bottom: 14px;
    white-space: pre-wrap;
}
.qb-option {
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 8px;
    line-height: 1.45;
}
.qb-option-correct {
    border-color: #16a34a;
    background: #f0fdf4;
}
.qb-explanation {
    margin-top: 14px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    line-height: 1.5;
    white-space: pre-wrap;
}
@media (max-width: 960px) {
    .qb-filter-grid { grid-template-columns: 1fr; }
    .qb-search-field { grid-column: span 1; }
    .qb-result-summary { margin-left: 0; width: 100%; }
    .qb-assign-grid { grid-template-columns: 1fr; }
}

.qb-assign-panel {
    background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
    border: 1px solid #f0d78c;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 20px;
}
.qb-assign-title { margin: 0 0 4px; font-size: 1.05rem; }
.qb-assign-sub { margin: 0 0 14px; color: var(--color-text-muted); font-size: 0.9rem; }
.qb-assign-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 1.2fr auto;
    gap: 12px 14px;
    align-items: end;
}
.qb-assign-action { min-width: 160px; }
.qb-selection-summary {
    margin: 12px 0 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #92400e;
}
.qb-grid-table .qb-check-col,
.qb-grid-table .qb-sno-col { width: 48px; text-align: center; white-space: nowrap; }
.qb-grid-table .qb-check-col input { width: 16px; height: 16px; cursor: pointer; }

@media (max-width: 960px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }
    .admin-brand { margin: 0; }
    .admin-nav { flex-direction: row; flex: none; }
    .admin-sidebar-foot { border: none; margin: 0; padding: 0; }
    .admin-split, .admin-split-wide, .admin-stat-grid, .admin-inline-fields { grid-template-columns: 1fr; }
    .admin-content { padding: 20px 16px 40px; }
}
