.test-body {
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(15, 118, 110, .08), rgba(255, 255, 255, 0) 360px),
        #f6f8f5;
}

.test-body [hidden] {
    display: none !important;
}

.test-header {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 68px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .85rem max(1rem, calc((100vw - var(--max)) / 2));
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.test-header nav {
    display: flex;
    gap: 1rem;
}

.test-header nav a {
    color: var(--ink-2);
    text-decoration: none;
    font-weight: var(--fw-semibold);
}

.test-shell {
    max-width: 1040px;
    margin: 0 auto;
    padding: var(--s-5) var(--s-4) var(--s-8);
}

.test-intro {
    display: grid;
    gap: var(--s-3);
    margin-bottom: var(--s-5);
    padding: var(--s-5) 0 var(--s-2);
}

.test-intro h1 {
    font-size: clamp(1.85rem, 5vw, 3rem);
}

.test-intro p:not(.eyebrow) {
    max-width: 760px;
    color: var(--muted);
    font-size: var(--fs-lg);
}

.item-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: var(--s-2);
}

.item-switcher a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: .48rem .82rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: #fff;
    color: var(--ink-2);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    text-decoration: none;
}

.item-switcher a:hover,
.item-switcher a.is-active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.subject-switcher {
    display: grid;
    gap: .65rem;
    max-width: 920px;
    margin-top: var(--s-2);
    padding: var(--s-3);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .78);
}

.subject-switcher strong {
    color: var(--ink);
    font-size: var(--fs-sm);
}

.subject-switcher div {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.subject-switcher a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: .42rem .68rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #eef4f1;
    color: var(--ink-2);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    text-decoration: none;
}

.subject-switcher a:hover,
.subject-switcher a.is-active {
    border-color: var(--brand);
    background: #fff;
    color: var(--brand-dark);
}

.practice-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin-top: var(--s-2);
}

.practice-hero-stats span {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 38px;
    padding: .45rem .7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
    color: var(--ink-2);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
}

.practice-hero-stats i {
    color: var(--brand);
}

.practice-ad-slot {
    display: grid;
    place-items: center;
    min-height: 96px;
    margin: 0 0 var(--s-5);
    padding: var(--s-4);
    border: 1px dashed #b8c9c2;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .72);
    color: var(--muted);
    text-align: center;
}

.practice-ad-slot span {
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: .08em;
}

.practice-ad-slot p {
    margin: .25rem 0 0;
    font-size: var(--fs-sm);
}

.test-app,
.result-report,
.test-empty {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: 0 22px 70px rgba(15, 23, 42, .10);
    overflow: hidden;
}

.test-status {
    display: grid;
    gap: var(--s-3);
    padding: var(--s-5);
    border-bottom: 1px solid var(--line);
    background: #fbfdfc;
}

.test-status > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: var(--s-4);
    color: var(--muted);
    font-size: var(--fs-sm);
}

.test-status strong {
    color: var(--ink);
}

.test-progress {
    height: 10px;
    border-radius: 999px;
    background: #e5eee9;
    overflow: hidden;
}

.test-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand);
    transition: width var(--ease);
}

.question-panel {
    display: none;
    padding: var(--s-6);
}

.question-panel.is-active {
    display: block;
}

.question-panel.is-reviewed {
    display: block;
    border-top: 1px solid var(--line);
}

.question-kicker {
    display: flex;
    justify-content: space-between;
    gap: var(--s-3);
    margin-bottom: var(--s-4);
    color: var(--muted);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
}

.question-panel h2 {
    max-width: 820px;
    font-size: clamp(1.18rem, 2.2vw, 1.65rem);
    line-height: 1.35;
}

.question-image {
    display: block;
    max-height: 320px;
    width: auto;
    margin: var(--s-4) 0;
    border-radius: var(--radius);
}

.choice-list {
    display: grid;
    gap: var(--s-3);
    margin: var(--s-5) 0 0;
    padding: 0;
    border: 0;
}

.choice {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: var(--s-3);
    align-items: center;
    min-height: 58px;
    padding: var(--s-3);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--ink);
    line-height: 1.45;
    transition: border-color var(--ease), background var(--ease), transform var(--ease);
}

.choice:hover,
.choice:has(input:checked) {
    border-color: var(--brand);
    background: var(--bg-soft);
}

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

.choice input {
    position: absolute;
    opacity: 0;
}

.choice-letter {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #edf6f2;
    color: var(--brand-dark);
    font-weight: var(--fw-bold);
}

.choice:has(input:checked) .choice-letter {
    background: var(--brand);
    color: #fff;
}

.test-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-5);
    border-top: 1px solid var(--line);
    background: #fbfdfc;
}

#prev-question {
    justify-self: start;
}

#next-question {
    justify-self: end;
}

.test-controls button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.submit-button {
    grid-column: 1 / -1;
    justify-self: center;
    min-width: 180px;
}

.question-review {
    margin-top: var(--s-5);
    padding: var(--s-4);
    border-radius: var(--radius);
    background: #fbfdfc;
    border: 1px solid var(--line);
}

.review-result {
    display: inline-flex;
    margin-bottom: var(--s-2);
    font-weight: var(--fw-bold);
}

.is-correct { color: var(--success); }
.is-incorrect { color: var(--error); }
.is-unanswered { color: var(--warning); }

.review-explanation {
    color: var(--muted);
}

.result-report {
    margin-top: var(--s-6);
    margin-bottom: var(--s-5);
    padding: var(--s-6);
}

.result-hero {
    display: flex;
    justify-content: space-between;
    gap: var(--s-5);
    align-items: center;
    margin-bottom: var(--s-5);
}

.result-ring {
    flex: 0 0 auto;
}

.result-next {
    margin-top: var(--s-5);
    padding-top: var(--s-5);
    border-top: 1px solid var(--line);
}

.test-empty {
    padding: var(--s-6);
}

@media (max-width: 680px) {
    .test-header {
        align-items: flex-start;
        padding: .85rem 1rem;
    }

    .test-header nav {
        display: grid;
        gap: .35rem;
        text-align: right;
        font-size: var(--fs-sm);
    }

    .test-shell {
        padding: var(--s-5) var(--s-3) var(--s-7);
    }

    .question-panel,
    .test-status,
    .test-controls,
    .result-report {
        padding: var(--s-4);
    }

    .question-kicker,
    .test-status > div:first-child,
    .result-hero {
        display: grid;
    }

    .choice {
        grid-template-columns: 36px minmax(0, 1fr);
        min-height: 56px;
        align-items: start;
        font-size: var(--fs-sm);
        text-align: left;
    }

    .choice-letter {
        width: 34px;
        height: 34px;
    }

    .question-panel h2 {
        font-size: 1.08rem;
        line-height: 1.4;
        text-align: left;
    }

    .test-controls .button {
        width: auto;
        min-width: 0;
        padding-inline: .8rem;
        white-space: nowrap;
    }

    .result-next .button {
        width: 100%;
    }

    .submit-button {
        min-width: 150px;
    }
}

@media (max-width: 380px) {
    .test-controls .button {
        font-size: var(--fs-sm);
        padding-inline: .62rem;
    }
}
