:root {
    color-scheme: dark;
    --ice: #A8D8F0;
    --ice-bright: #CFEBFA;
    --ice-mid: #7FC7E8;
    --navy: #0A1A2F;
    --navy-raised: #12294A;
    --black: #050608;
    --white: #FFFFFF;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-width: 0;
    min-height: 100%;
    margin: 0;
}

body.test-page {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    color: var(--white);
    background:
        radial-gradient(ellipse at 8% 10%, rgba(127, 199, 232, 0.16), transparent 36%),
        radial-gradient(ellipse at 92% 84%, rgba(168, 216, 240, 0.13), transparent 34%),
        linear-gradient(145deg, var(--navy), var(--black) 78%);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body.test-page.admin-page {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

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

.test-shell {
    position: relative;
    isolation: isolate;
    display: flex;
    width: min(100%, 1440px);
    height: 100%;
    min-height: 0;
    margin: 0 auto;
    padding: clamp(16px, 3.2vh, 34px) clamp(18px, 5vw, 76px);
    flex-direction: column;
}

.test-header,
.test-footer {
    display: flex;
    min-height: 34px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.test-brand {
    font-size: 0.94rem;
    font-weight: 750;
    letter-spacing: -0.03em;
}

.test-brand span {
    color: var(--ice);
}

.quiet-link,
.quiet-button {
    border: 0;
    color: rgba(207, 235, 250, 0.78);
    background: transparent;
    font-size: 0.86rem;
    transition: color 150ms ease;
}

.quiet-link:hover,
.quiet-button:hover {
    color: var(--white);
}

.quiet-button {
    padding: 8px 0 8px 12px;
    cursor: pointer;
}

.landing-shell,
.registration-shell {
    justify-content: space-between;
}

.landing-content {
    width: min(100%, 760px);
    margin: auto;
    padding: 8vh 0;
}

.test-kicker {
    margin: 0 0 14px;
    color: var(--ice);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.landing-content h1,
.registration-card h1,
.admin-content h1 {
    margin: 0;
    font-size: clamp(2.6rem, 7.5vw, 5.7rem);
    font-weight: 650;
    letter-spacing: -0.065em;
    line-height: 0.98;
}

.landing-copy {
    max-width: 580px;
    margin: 20px 0 0;
    color: rgba(207, 235, 250, 0.76);
    font-size: clamp(0.98rem, 1.5vw, 1.12rem);
    line-height: 1.65;
}

.test-selection {
    margin-top: clamp(32px, 6vh, 64px);
}

.tactile-button {
    position: relative;
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px solid rgba(207, 235, 250, 0.72);
    border-radius: 20px;
    color: var(--navy);
    background: linear-gradient(160deg, var(--white), var(--ice));
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.9),
        inset 0 -3px 0 rgba(10, 26, 47, 0.16),
        0 20px 38px rgba(5, 6, 8, 0.68),
        0 6px 14px rgba(127, 199, 232, 0.16);
    cursor: pointer;
    transition:
        transform 160ms var(--ease-out),
        box-shadow 160ms var(--ease-out),
        border-color 160ms ease,
        background 160ms ease;
}

.tactile-button:hover:not(:disabled) {
    transform: translateY(-4px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.95),
        inset 0 -3px 0 rgba(10, 26, 47, 0.12),
        0 25px 46px rgba(5, 6, 8, 0.6),
        0 8px 24px rgba(127, 199, 232, 0.22);
}

.tactile-button:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow:
        inset 0 2px 4px rgba(10, 26, 47, 0.18),
        0 7px 14px rgba(5, 6, 8, 0.72);
}

.tactile-button:focus-visible,
.quiet-link:focus-visible,
.quiet-button:focus-visible,
.registration-form input:focus-visible,
.participant-field input:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--ice-bright);
    outline-offset: 4px;
    box-shadow: 0 0 0 7px rgba(127, 199, 232, 0.2);
}

.test-option {
    min-height: 112px;
    justify-content: flex-start;
    gap: clamp(16px, 3vw, 30px);
    padding: 22px clamp(20px, 3vw, 32px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.9),
        inset 0 -3px 0 rgba(10, 26, 47, 0.16),
        0 25px 42px rgba(5, 6, 8, 0.72),
        0 0 24px rgba(127, 199, 232, 0.12);
}

.option-index {
    color: rgba(10, 26, 47, 0.58);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.option-copy {
    display: grid;
    flex: 1;
    gap: 7px;
}

.option-copy strong {
    font-size: clamp(1rem, 2.3vw, 1.32rem);
}

.option-copy > span {
    color: rgba(10, 26, 47, 0.7);
    font-size: 0.88rem;
}

.option-arrow {
    font-size: 1.7rem;
    transition: transform 160ms var(--ease-out);
}

.test-option:hover .option-arrow {
    transform: translateX(5px);
}

.test-footer {
    justify-content: flex-start;
    color: rgba(207, 235, 250, 0.54);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.registration-shell {
    align-items: center;
}

.registration-shell .test-header,
.registration-shell .test-footer {
    width: 100%;
}

.registration-card {
    width: min(100%, 560px);
    margin: auto;
    padding: clamp(26px, 5vw, 52px);
    border: 1px solid rgba(168, 216, 240, 0.25);
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(18, 41, 74, 0.84), rgba(5, 6, 8, 0.78));
    box-shadow:
        0 35px 80px rgba(0, 0, 0, 0.68),
        0 0 42px rgba(127, 199, 232, 0.12),
        inset 0 1px 0 rgba(207, 235, 250, 0.12);
    backdrop-filter: blur(18px);
}

.registration-card h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
}

.registration-card .landing-copy {
    margin-top: 12px;
    font-size: 0.96rem;
}

.registration-form {
    display: grid;
    margin-top: 28px;
    gap: 12px;
}

.registration-form label {
    margin-top: 4px;
    color: var(--ice-bright);
    font-size: 0.88rem;
    font-weight: 600;
}

.registration-form input {
    width: 100%;
    min-height: 52px;
    padding: 0 15px;
    border: 1px solid rgba(168, 216, 240, 0.35);
    border-radius: 12px;
    color: var(--white);
    background: rgba(5, 6, 8, 0.66);
}

.registration-form input:focus-visible {
    border-color: var(--ice);
}

.registration-form .tactile-button {
    width: 100%;
    min-height: 58px;
    margin-top: 12px;
    font-weight: 750;
}

.form-message {
    margin: 16px 0 0;
    color: var(--ice-bright);
    font-size: 0.9rem;
}

.quiz-shell {
    gap: 6px;
    padding-top: clamp(8px, 1.5vh, 16px);
    padding-bottom: clamp(6px, 1vh, 12px);
}

.quiz-header {
    min-height: 34px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(110px, 1.4fr) minmax(0, 1fr);
}

.quiz-title {
    justify-self: end;
    color: rgba(207, 235, 250, 0.68);
    font-size: 0.8rem;
    text-align: right;
}

.progress-block {
    display: grid;
    width: min(100%, 280px);
    justify-self: center;
    gap: 5px;
    color: var(--ice);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.progress-block progress {
    width: 100%;
    height: 4px;
    overflow: hidden;
    border: 0;
    border-radius: 8px;
    background: rgba(168, 216, 240, 0.18);
    accent-color: var(--ice);
}

.progress-block progress::-webkit-progress-bar {
    border-radius: 8px;
    background: rgba(168, 216, 240, 0.18);
}

.progress-block progress::-webkit-progress-value {
    border-radius: 8px;
    background: var(--ice);
}

.participant-field {
    display: flex;
    min-height: 28px;
    align-items: center;
    gap: 10px;
    color: rgba(207, 235, 250, 0.76);
    font-size: 0.78rem;
}

.participant-field input {
    width: min(100%, 280px);
    min-height: 28px;
    padding: 0 11px;
    border: 1px solid rgba(168, 216, 240, 0.35);
    border-radius: 10px;
    color: var(--white);
    background: rgba(5, 6, 8, 0.66);
}

.participant-field input:focus-visible {
    border-color: var(--ice);
}

.test-stage {
    display: grid;
    min-height: 0;
    flex: 1;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: clamp(8px, 1.2vh, 16px);
    transition: opacity 210ms ease, transform 210ms var(--ease-out);
}

.test-stage.is-panel {
    grid-template-rows: minmax(0, 1fr);
}

.test-stage.no-image {
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}

.test-stage.no-image .question-panel {
    justify-content: center;
}

.test-stage.is-leaving {
    transform: translateY(12px);
    opacity: 0;
}

.test-stage.is-entering {
    transform: translateY(-10px);
    opacity: 0;
}

.question-panel {
    position: relative;
    display: flex;
    min-height: 0;
    overflow: hidden;
    padding: clamp(14px, 2.2vh, 28px) clamp(16px, 2.4vw, 36px);
    flex-direction: column;
    justify-content: flex-start;
    gap: clamp(8px, 1.2vh, 14px);
    border: 1px solid rgba(168, 216, 240, 0.25);
    border-radius: 28px;
    background:
        radial-gradient(ellipse at 90% 4%, rgba(127, 199, 232, 0.13), transparent 42%),
        linear-gradient(145deg, rgba(18, 41, 74, 0.92), rgba(5, 6, 8, 0.91));
    box-shadow:
        0 35px 78px rgba(0, 0, 0, 0.7),
        0 14px 28px rgba(0, 0, 0, 0.52),
        0 0 38px rgba(127, 199, 232, 0.12),
        inset 0 1px 0 rgba(207, 235, 250, 0.12);
    backdrop-filter: blur(18px);
}

.sequence-panel[hidden] {
    display: none;
}

.panel-images {
    display: flex;
    min-height: 0;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.panel-images img {
    display: block;
    width: 100%;
    height: 60svh;
    min-width: 0;
    min-height: 0;
    max-height: 60svh;
    flex: 1 1 0;
    object-fit: contain;
    object-position: center;
}

.question-panel .test-kicker {
    flex: 0 0 auto;
    margin: 0;
    font-size: clamp(0.72rem, 0.8vw, 0.9rem);
}

.question-panel h1 {
    flex: 0 1 auto;
    min-height: 0;
    max-height: 100%;
    margin: 0;
    padding: 0.08em 0 0.2em;
    overflow: auto;
    font-size: clamp(1.6rem, 3vw + 1vh, 3rem);
    font-weight: 620;
    letter-spacing: -0.035em;
    line-height: 1.2;
    text-wrap: pretty;
}

.question-image {
    display: block;
    width: 100%;
    height: 60svh;
    min-height: 0;
    max-height: 60svh;
    flex: 1 1 60svh;
    margin: 0 auto;
    object-fit: contain;
    object-position: center;
}

.question-image[hidden],
.question-audio[hidden] {
    display: none;
}

.question-audio {
    width: min(25%, 160px);
    height: 24px;
    min-height: 0;
    flex: 0 0 24px;
    margin: 0 auto;
}

.question-audio-button {
    min-height: 34px;
    align-self: center;
    padding: 0 16px;
    font-size: 0.78rem;
    font-weight: 700;
}

.question-audio-button[hidden] {
    display: none;
}

.media-error {
    margin-top: 0;
}

.answer-grid {
    display: grid;
    min-height: 0;
    padding: clamp(8px, 1.1vw, 16px);
    align-content: stretch;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
    gap: clamp(8px, 1.1vw, 16px);
}

.answer-button {
    min-width: 0;
    min-height: clamp(64px, 9vh, 104px);
    padding: 8px clamp(10px, 1.2vw, 18px);
    justify-content: center;
    gap: clamp(7px, 0.8vw, 12px);
    border-radius: 12px;
    text-align: center;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.9),
        inset 0 -3px 0 rgba(10, 26, 47, 0.16),
        0 8px 18px rgba(5, 6, 8, 0.42),
        0 3px 10px rgba(127, 199, 232, 0.12);
}

.answer-button:disabled {
    cursor: default;
}

.answer-button.is-selected {
    border-color: var(--white);
    background: linear-gradient(160deg, var(--ice-bright), var(--ice-mid));
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.96),
        0 0 0 2px rgba(168, 216, 240, 0.24),
        0 10px 22px rgba(5, 6, 8, 0.48),
        0 0 16px rgba(168, 216, 240, 0.2);
}

.answer-letter {
    display: grid;
    width: clamp(22px, 2vw, 28px);
    height: clamp(22px, 2vw, 28px);
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(10, 26, 47, 0.23);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.34);
    font-size: clamp(0.68rem, 0.8vw, 0.82rem);
    font-weight: 800;
}

.answer-text {
    min-width: 0;
    font-size: clamp(1.15rem, 1.6vw + 0.6vh, 1.8rem);
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.test-controls {
    display: flex;
    min-height: 40px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 0 3px;
}

.test-controls .tactile-button {
    min-width: clamp(90px, 12vw, 140px);
    min-height: 38px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 750;
}

.secondary-button {
    border-color: rgba(168, 216, 240, 0.42);
    color: var(--ice-bright);
    background: linear-gradient(160deg, var(--navy-raised), var(--navy));
    box-shadow:
        inset 0 1px 0 rgba(207, 235, 250, 0.14),
        0 18px 32px rgba(5, 6, 8, 0.7);
}

.tactile-button:disabled {
    transform: none;
    opacity: 0.42;
    cursor: not-allowed;
}

.test-error {
    position: absolute;
    right: clamp(18px, 5vw, 76px);
    bottom: clamp(4px, 1vh, 12px);
    left: clamp(18px, 5vw, 76px);
    margin: 0;
    color: var(--ice-bright);
    font-size: 0.85rem;
    text-align: center;
}

.completion-panel {
    display: flex;
    min-height: 0;
    flex: 1;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.completion-card {
    width: min(100%, 680px);
    max-height: 100%;
    overflow: hidden;
    padding: clamp(18px, 3vh, 38px) clamp(22px, 5vw, 56px);
    border: 1px solid rgba(168, 216, 240, 0.25);
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(18, 41, 74, 0.86), rgba(5, 6, 8, 0.82));
    box-shadow: 0 35px 80px rgba(0, 0, 0, 0.68), 0 0 42px rgba(127, 199, 232, 0.12);
}

.completion-card h1 {
    margin: 0;
    font-size: clamp(2rem, 6vw, 4rem);
    letter-spacing: -0.055em;
}

.completion-card .completion-score {
    margin: 10px 0 15px;
    color: var(--white);
    font-size: clamp(1.25rem, 3.5vw, 1.8rem);
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.completion-card .missed-heading,
.completion-card .completion-note {
    margin: 8px 0;
    color: rgba(207, 235, 250, 0.76);
    font-size: 0.88rem;
    line-height: 1.4;
}

.missed-questions {
    display: flex;
    margin: 10px 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    list-style: none;
}

.missed-questions li {
    display: grid;
    min-height: 20px;
    padding: 1px 5px;
    place-items: center;
    border: 1px solid rgba(168, 216, 240, 0.24);
    border-radius: 8px;
    color: var(--ice-bright);
    background: rgba(10, 26, 47, 0.72);
    font-size: 0.66rem;
    font-variant-numeric: tabular-nums;
}

.completion-card .completion-note {
    margin: 8px 0 14px;
    font-size: 0.76rem;
    color: rgba(207, 235, 250, 0.58);
}

.completion-card .tactile-button {
    min-height: 46px;
    padding: 0 20px;
    border-radius: 14px;
    font-size: 0.88rem;
}

.admin-page {
    overflow: auto;
}

.admin-shell {
    width: min(100%, 1120px);
    min-height: 100%;
    margin: 0 auto;
    padding: 26px clamp(18px, 5vw, 64px) 48px;
}

.admin-login {
    margin-top: clamp(48px, 12vh, 120px);
}

.admin-content {
    padding-top: 48px;
}

.admin-content h1 {
    font-size: clamp(2.3rem, 6vw, 4rem);
}

.results-list {
    display: grid;
    margin-top: 34px;
    gap: 18px;
}

.result-card {
    padding: clamp(18px, 3vw, 28px);
    border: 1px solid rgba(168, 216, 240, 0.23);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(18, 41, 74, 0.78), rgba(5, 6, 8, 0.82));
    box-shadow: 0 20px 46px rgba(0, 0, 0, 0.48);
}

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

.result-heading h2 {
    margin: 0;
    font-size: 1.25rem;
}

.result-heading p,
.result-heading time,
.result-score {
    color: rgba(207, 235, 250, 0.72);
    font-size: 0.88rem;
}

.result-heading p {
    margin: 7px 0 0;
}

.result-heading time {
    text-align: right;
}

.result-score {
    margin: 20px 0;
    color: var(--ice);
    font-weight: 700;
}

.result-card details {
    border-top: 1px solid rgba(168, 216, 240, 0.18);
    padding-top: 16px;
}

.result-card summary {
    color: var(--ice-bright);
    cursor: pointer;
}

.report-questions {
    display: grid;
    padding-left: 24px;
    gap: 18px;
}

.report-questions li {
    padding-left: 5px;
}

.report-questions strong,
.report-questions span {
    display: block;
    margin-top: 7px;
    line-height: 1.5;
}

.report-questions span {
    color: rgba(207, 235, 250, 0.75);
    font-size: 0.9rem;
}

.empty-results {
    margin-top: 34px;
    color: rgba(207, 235, 250, 0.75);
}

.admin-section {
    margin-top: 44px;
}

.admin-section > h2 {
    margin: 0;
    color: var(--ice-bright);
    font-size: 1.5rem;
    letter-spacing: -0.025em;
}

.admin-section .results-list {
    margin-top: 20px;
}

.student-card h3 {
    margin: 0;
    font-size: 1.12rem;
}

.approval-status {
    color: var(--ice-bright);
    font-size: 0.82rem;
}

.approval-form {
    margin-top: 18px;
}

.admin-action {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 0.84rem;
    font-weight: 700;
}

.student-progress {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(168, 216, 240, 0.18);
}

.student-progress h4 {
    margin: 0;
    color: var(--ice-bright);
    font-size: 0.92rem;
}

.student-progress ul {
    display: grid;
    margin: 12px 0 0;
    padding-left: 20px;
    gap: 10px;
}

.student-progress li {
    padding-left: 3px;
}

.student-progress li strong,
.student-progress li span {
    display: block;
    line-height: 1.5;
}

.student-progress li span,
.student-progress > p {
    margin: 3px 0 0;
    color: rgba(207, 235, 250, 0.72);
    font-size: 0.86rem;
}

@media (max-width: 640px) {
    html,
    body {
        min-width: 0;
    }

    .test-shell {
        padding: 6px 10px max(6px, env(safe-area-inset-bottom));
    }

    .quiz-shell {
        gap: 4px;
    }

    .quiz-header {
        min-height: 30px;
        grid-template-columns: minmax(0, 0.8fr) minmax(90px, 1fr) minmax(0, 0.8fr);
        gap: 8px;
    }

    .test-brand {
        font-size: 0.8rem;
    }

    .quiz-title {
        font-size: 0.68rem;
    }

    .participant-field {
        min-height: 24px;
        gap: 5px;
        font-size: 0.58rem;
        flex-wrap: wrap;
    }

    .participant-field input {
        min-height: 24px;
        width: auto;
        min-width: 80px;
        flex: 1;
    }

    .progress-block {
        font-size: 0.65rem;
    }

    .test-stage {
        grid-template-rows: minmax(0, 1fr) auto;
        gap: 3px;
    }

    .question-panel {
        padding: 10px 12px;
        gap: 7px;
        justify-content: flex-start;
        border-radius: 14px;
    }

    .question-panel h1 {
        font-size: clamp(1.2rem, 5vw, 2rem);
        line-height: 1.18;
    }

    .question-image {
        width: 100%;
        height: 60svh;
        max-height: min(60svh, 680px);
        flex: 0 1 60svh;
    }

    .question-audio {
        width: min(25%, 100px);
        height: 22px;
        flex-basis: 22px;
    }

    .question-audio-button {
        min-height: 26px;
        padding: 0 12px;
        font-size: 0.66rem;
    }

    .answer-grid {
        padding: 8px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .answer-button {
        min-height: clamp(56px, 9vh, 84px);
        padding: 6px 8px;
        gap: 6px;
        border-radius: 10px;
    }

    .answer-letter {
        width: 19px;
        height: 19px;
        border-radius: 4px;
        font-size: 0.65rem;
    }

    .answer-text {
        font-size: clamp(1rem, 4vw, 1.35rem);
        line-height: 1.2;
    }

    .test-controls {
        min-height: 30px;
        padding-bottom: 0;
    }

    .test-controls .tactile-button {
        min-width: 0;
        min-height: 28px;
        flex: 1;
        padding: 0 12px;
        font-size: 0.68rem;
    }

    .landing-content {
        padding: 5vh 0;
    }

    .test-option {
        min-height: 94px;
        padding: 16px;
        gap: 14px;
    }

    .option-copy > span {
        font-size: 0.78rem;
    }

    .registration-card {
        padding: 25px 21px;
        border-radius: 22px;
    }

    .completion-card {
        padding: 14px 16px;
        border-radius: 20px;
    }

    .completion-card .completion-score {
        margin: 6px 0 9px;
    }

    .completion-card .missed-heading,
    .completion-card .completion-note {
        margin: 5px 0;
        font-size: 0.75rem;
    }

    .missed-questions {
        margin: 6px 0;
        gap: 2px;
    }

    .missed-questions li {
        min-height: 17px;
        padding: 0 4px;
        font-size: 0.6rem;
    }

    .completion-card .completion-note {
        margin-bottom: 8px;
        font-size: 0.68rem;
    }

    .completion-card .tactile-button {
        min-height: 40px;
    }

    .result-heading {
        flex-direction: column;
    }
}

@media (max-height: 600px) {
    .test-shell {
        padding: 6px 10px max(6px, env(safe-area-inset-bottom));
    }

    .quiz-shell {
        gap: 4px;
    }

    .quiz-header {
        min-height: 28px;
    }

    .participant-field {
        min-height: 26px;
        gap: 6px;
        font-size: 0.65rem;
    }

    .participant-field input {
        min-height: 26px;
    }

    .test-stage {
        grid-template-rows: minmax(0, 1fr) auto;
        gap: 3px;
    }

    .question-panel {
        padding: 8px 10px;
        gap: 6px;
        border-radius: 14px;
    }

    .question-panel .test-kicker {
        font-size: 0.52rem;
    }

    .question-panel h1 {
        font-size: clamp(1.05rem, 3svh, 1.55rem);
        line-height: 1.15;
    }

    .question-image {
        height: 60svh;
        max-height: 60svh;
        flex-basis: 60svh;
    }

    .question-audio {
        width: min(25%, 80px);
        height: 20px;
        flex-basis: 20px;
    }

    .answer-grid {
        gap: 6px;
    }

    .answer-button {
        min-height: clamp(48px, 10vh, 64px);
        padding: 5px 6px;
        gap: 5px;
    }

    .answer-letter {
        width: 17px;
        height: 17px;
        border-radius: 4px;
        font-size: 0.6rem;
    }

    .answer-text {
        font-size: clamp(0.95rem, 3vw, 1.15rem);
        line-height: 1.15;
    }

    .test-controls {
        min-height: 26px;
        padding-bottom: 0;
    }

    .test-controls .tactile-button {
        min-width: 0;
        min-height: 24px;
        padding: 0 12px;
        font-size: 0.62rem;
    }
}

@media (max-width: 640px) and (min-height: 481px) {
    .question-image {
        object-fit: cover;
    }
}

@media (max-height: 600px) and (max-width: 640px) {
    .completion-card {
        padding: 8px 12px;
    }

    .completion-card .test-kicker {
        margin-bottom: 6px;
    }

    .completion-card h1 {
        font-size: 1.7rem;
    }

    .missed-questions li {
        min-height: 14px;
        font-size: 0.55rem;
    }

    .result-heading time {
        text-align: left;
    }
}

@media (max-height: 600px) and (min-width: 641px) {
    .test-shell {
        padding-top: 10px;
        padding-bottom: 8px;
    }

    .quiz-shell {
        gap: 7px;
    }

    .quiz-header {
        min-height: 32px;
    }

    .test-stage {
        grid-template-rows: minmax(0, 1fr) auto;
        gap: 10px;
    }

    .question-panel {
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .answer-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-rows: minmax(0, 1fr);
        gap: 8px;
    }

    .answer-button {
        padding: 8px;
        gap: 8px;
    }

    .test-controls {
        min-height: 50px;
    }

    .completion-card {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .missed-questions li {
        min-height: 17px;
        padding: 0 4px;
        font-size: 0.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
