/*
 * Mock Tests — shared styles for the portal, detail, result, progress
 * and grading pages, and the full-screen player.
 *
 * The theme's root font is 10px (1rem = 10px), so sizes here are in px.
 * Colours come from theme tokens; each exam's accent arrives as the
 * --mt-accent custom property set inline from its profile/category.
 */

.mt-page {
    --mt-accent: var(--color-primary);
    --mt-surface: #ffffff;
    --mt-soft: var(--color-gray-light, #f6f6f6);
    --mt-line: var(--color-border, #e6e3f1);
    --mt-ok: var(--color-success, #3eb75e);
    --mt-warn: var(--color-warning, #ff8f3c);
    --mt-bad: var(--color-danger, #ff0003);
    font-size: 16px;
}

.mt-page h1,
.mt-page h2,
.mt-page h3,
.mt-page h4,
.mt-page h5 {
    color: var(--color-heading);
}

.mt-subtle {
    color: var(--color-body);
    font-size: 15px;
}

/* The site header is absolutely positioned over the top of the page
   (.rbt-transparent-header), so a page without a banner must reserve its
   height itself. Same offsets base.html gives .rbt-page-banner-wrapper. */
.mt-hero {
    padding: 140px 0 24px;
}

@media only screen and (min-width: 768px) and (max-width: 991px) {
    .mt-hero { padding-top: 120px; }
}

@media only screen and (max-width: 767px) {
    .mt-hero { padding-top: 110px; }
}

.mt-hero h1 {
    font-size: 40px;
    margin-bottom: 8px;
}

.mt-hero p {
    font-size: 18px;
    max-width: 720px;
}

/* ── Category tiles ─────────────────────────────────────────────── */

/* Three tiles per row on desktop, two on tablet, one on phones. */
.mt-categories {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

@media only screen and (max-width: 991px) {
    .mt-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media only screen and (max-width: 575px) {
    .mt-categories { grid-template-columns: 1fr; }
}

.mt-categories > .mt-empty {
    grid-column: 1 / -1;
}

.mt-category {
    --mt-accent: var(--color-primary);
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    padding: 20px;
    border: 1px solid var(--mt-line);
    border-top: 4px solid var(--mt-accent);
    border-radius: 10px;
    background: var(--mt-surface);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    width: 100%;
    text-decoration: none;
}

.mt-category:hover,
.mt-category:focus-visible {
    box-shadow: 0 8px 24px rgba(25, 35, 53, 0.08);
    transform: translateY(-2px);
}

/* Logos come in all shapes, so the mark gets a fixed-height slot and the
   logo is scaled to fit it. */
.mt-category-mark {
    display: flex;
    align-items: center;
    height: 40px;
    margin-bottom: 4px;
}

.mt-logo {
    display: block;
    height: 100%;
    max-width: 150px;
    object-fit: contain;
    object-position: left center;
}

.mt-icon {
    font-size: 24px;
    color: var(--mt-accent);
}

/* Category page header: the logo sits in its own framed tile beside the
   title, so its lettering never competes with the heading. */
.mt-hero-head {
    display: flex;
    align-items: center;
    gap: 24px;
}

.mt-hero-mark {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 168px;
    height: 96px;
    padding: 18px 20px;
    border: 1px solid var(--mt-line);
    border-bottom: 4px solid var(--mt-accent);
    border-radius: 14px;
    background: var(--mt-surface);
    box-shadow: 0 6px 18px rgba(25, 35, 53, 0.06);
}

.mt-hero-mark .mt-logo {
    height: auto;
    max-height: 100%;
    max-width: 100%;
    object-position: center;
}

.mt-hero-mark .mt-icon {
    font-size: 36px;
}

@media only screen and (max-width: 575px) {
    .mt-hero-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .mt-hero-mark {
        width: 132px;
        height: 76px;
        padding: 14px 16px;
    }

    .mt-hero h1 {
        font-size: 30px;
    }
}

.mt-category strong {
    font-size: 20px;
    color: var(--color-heading);
}

.mt-category span {
    font-size: 14px;
    color: var(--color-body);
}

.mt-category .mt-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--mt-accent);
}

/* ── Exam comparison table (portal) ─────────────────────────────── */

/* Seven columns do not fit a phone, so the table scrolls inside its
   wrapper instead of widening the page. */
.mt-compare {
    border: 1px solid var(--mt-line);
    border-radius: 10px;
    background: var(--mt-surface);
}

.mt-compare table {
    --bs-table-color: var(--color-body);
    min-width: 980px;
    font-size: 14px;
}

.mt-compare thead th {
    background: var(--mt-soft);
    color: var(--color-heading);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    padding: 14px 16px;
    border-bottom: 1px solid var(--mt-line);
}

.mt-compare tbody th,
.mt-compare tbody td {
    padding: 16px;
    vertical-align: top;
    border-color: var(--mt-line);
}

.mt-compare tbody tr:last-child > * {
    border-bottom: 0;
}

.mt-compare tbody th {
    border-left: 4px solid var(--mt-accent);
    width: 170px;
}

.mt-compare-test {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-decoration: none;
}

.mt-compare-test .mt-logo {
    height: 26px;
    max-width: 110px;
    margin-bottom: 4px;
}

.mt-compare-test .mt-icon {
    font-size: 20px;
}

.mt-compare-test strong {
    font-size: 16px;
    color: var(--color-heading);
}

.mt-compare-test em {
    font-size: 13px;
    color: var(--color-body);
}

.mt-compare-test:hover strong,
.mt-compare-test:focus-visible strong {
    color: var(--mt-accent);
}

.mt-compare td strong {
    display: block;
    color: var(--color-heading);
    margin-bottom: 2px;
}

.mt-compare td span {
    display: block;
}

.mt-compare .mt-compare-total {
    font-weight: 600;
    color: var(--color-heading);
    white-space: nowrap;
}

.mt-compare-focus {
    min-width: 220px;
}

/* ── Filters (grading queue) and test cards ──────────────────────────────────────────── */

.mt-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    padding: 16px;
    border-radius: 10px;
    background: var(--mt-soft);
}

.mt-filters label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--color-heading);
}

.mt-filters .mt-filter {
    min-width: 180px;
    flex: 1 1 180px;
}

.mt-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.mt-card {
    --mt-accent: var(--color-primary);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--mt-line);
    background: var(--mt-surface);
}

.mt-card h3 {
    font-size: 19px;
    margin: 0;
}

.mt-card .mt-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 14px;
    color: var(--color-body);
}

.mt-card .mt-facts i {
    margin-right: 4px;
}

.mt-card .mt-card-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.mt-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    background: var(--mt-accent);
}

.mt-badge.is-outline {
    color: var(--mt-accent);
    background: transparent;
    border: 1px solid var(--mt-accent);
}

.mt-state {
    font-size: 13px;
    font-weight: 600;
}

.mt-state.done { color: var(--mt-ok); }
.mt-state.in_progress { color: var(--mt-warn); }
.mt-state.not_started { color: var(--color-body); }

.mt-empty {
    padding: 40px;
    text-align: center;
    border: 1px dashed var(--mt-line);
    border-radius: 10px;
    color: var(--color-body);
}

.mt-panel {
    padding: 24px;
    border-radius: 10px;
    border: 1px solid var(--mt-line);
    background: var(--mt-surface);
}

.mt-panel + .mt-panel {
    margin-top: 16px;
}

.mt-panel h2,
.mt-panel h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.mt-table {
    width: 100%;
    font-size: 15px;
}

.mt-table th,
.mt-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--mt-line);
    vertical-align: top;
}

.mt-table th {
    font-size: 13px;
    color: var(--color-body);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Mode picker: three cards in one box; only the chosen one expands. */
/* No overflow:hidden here — it would clip the skill/part dropdown menu;
   the first and last cards round their own corners instead. */
.mt-mode-list {
    border: 1px solid var(--mt-line);
    border-radius: 10px;
    margin-bottom: 20px;
}

.mt-modes .mt-mode:first-child {
    border-radius: 9px 9px 0 0;
}

.mt-modes .mt-mode:last-child {
    border-radius: 0 0 9px 9px;
}

.mt-modes .mt-mode:only-child {
    border-radius: 9px;
}

.mt-modes .mt-mode {
    margin: 0;
    padding: 14px 16px 14px 40px;
    border-bottom: 1px solid var(--mt-line);
    transition: background 0.15s ease;
}

.mt-modes .mt-mode:last-child {
    border-bottom: 0;
}

.mt-modes .mt-mode:has(input:checked) {
    background: var(--mt-soft);
    box-shadow: inset 3px 0 0 var(--mt-accent);
}

.mt-modes .form-check-input {
    margin-top: 5px;
}

.mt-mode-head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-heading);
    cursor: pointer;
}

.mt-mode-head i {
    font-size: 17px;
    color: var(--mt-accent);
}

.mt-mode-meta {
    margin-left: auto;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-body);
}

.mt-mode-desc {
    display: none;
    margin-top: 4px;
    font-size: 14px;
    color: var(--color-body);
}

.mt-mode:has(input:checked) .mt-mode-desc {
    display: block;
}

.mt-mode-pick {
    margin-top: 10px;
}

/* Settings: switches the student may always change, in every mode. */
.mt-settings {
    margin-bottom: 20px;
}

.mt-settings-title {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-body);
}

.mt-settings .form-switch {
    padding-left: 48px;
    margin-bottom: 10px;
}

.mt-settings .form-check-label {
    font-size: 15px;
    color: var(--color-heading);
}

.mt-settings .form-check-label small {
    display: block;
    font-size: 13px;
    color: var(--color-body);
}


.mt-device {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 15px;
}

/* ── Result page ────────────────────────────────────────────────── */

.mt-score-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
}

.mt-score-big {
    font-size: 56px;
    line-height: 1;
    font-weight: 700;
    color: var(--mt-accent);
}

.mt-score-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-body);
}

.mt-skills {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.mt-skill {
    padding: 16px;
    border-radius: 8px;
    background: var(--mt-soft);
}

.mt-skill strong {
    display: block;
    font-size: 28px;
    color: var(--color-heading);
}

.mt-skill.is-weakest {
    box-shadow: inset 0 0 0 2px var(--mt-warn);
}

.mt-review-row {
    padding: 14px 0;
    border-bottom: 1px solid var(--mt-line);
    font-size: 15px;
}

.mt-review-row .mt-mark {
    font-weight: 700;
}

.mt-review-row .mt-mark.ok { color: var(--mt-ok); }
.mt-review-row .mt-mark.bad { color: var(--mt-bad); }

.mt-review-row[data-anchor] {
    cursor: pointer;
}

.mt-transcript {
    white-space: pre-wrap;
    font-size: 15px;
    line-height: 1.7;
    max-height: 360px;
    overflow: auto;
    padding: 14px;
    border-radius: 8px;
    background: var(--mt-soft);
}

mark.mt-hit {
    background: #fff1a8;
    padding: 0 2px;
}

.mt-disclaimer {
    font-size: 14px;
    color: var(--color-body);
    font-style: italic;
}

.mt-overdue td {
    background: #fff4ec;
}

/* ── Player ─────────────────────────────────────────────────────── */

/* The player covers the viewport; the page behind must not scroll too. */
body:has(.mt-player) {
    overflow: hidden;
}

/* Keep toasts clear of the top bar's timer and "Save & exit". */
body:has(.mt-player) #toast-container {
    top: 64px !important;
}

/* Bootstrap pads modals in rem, which the theme's 10px root shrinks. */
.mt-player-modal .modal-content {
    border: 0;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(25, 35, 53, 0.2);
}

.mt-player-modal .modal-header,
.mt-player-modal .modal-body,
.mt-player-modal .modal-footer {
    padding: 18px 24px;
}

.mt-player-modal .modal-footer {
    gap: 8px;
}

.mt-player-modal .modal-footer > * {
    margin: 0;
}

.mt-player-modal .modal-title {
    font-size: 20px;
    margin: 0;
}

.mt-player {
    --mt-accent: var(--color-primary);
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #f4f5f8;
    z-index: 1000;
    font-size: 16px;
    color: var(--color-heading);
}

.mt-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    background: #ffffff;
    border-bottom: 1px solid var(--mt-line);
    min-height: 60px;
}

/* Not a link: leaving mid-test goes through "Save & exit". */
.mt-topbar-logo {
    flex: 0 0 auto;
    height: 28px;
    width: auto;
    padding-right: 16px;
    border-right: 1px solid var(--mt-line);
}

.mt-topbar .mt-title {
    font-weight: 700;
    font-size: 16px;
}

.mt-topbar .mt-section-name {
    font-size: 14px;
    color: var(--color-body);
}

.mt-topbar .mt-spacer {
    flex: 1;
}

.mt-timer {
    font-variant-numeric: tabular-nums;
    font-size: 22px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 6px;
    background: var(--mt-soft);
}

.mt-timer.is-low {
    background: #fde8e8;
    color: var(--mt-bad);
}

.mt-save {
    font-size: 13px;
    font-weight: 600;
}

.mt-save.saved { color: var(--mt-ok); }
.mt-save.saving { color: var(--color-body); }
.mt-save.unsaved { color: var(--mt-bad); }

.mt-audiobar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    background: #192335;
    color: #ffffff;
    font-size: 14px;
}

.mt-audiobar input[type="range"] {
    width: 140px;
}

.mt-audiobar audio {
    height: 34px;
    flex: 1;
    max-width: 520px;
}

/* Play / Pause control for exam-mode audio (player.js audioControl).
   Light card in the question pane; transparent on the dark audio bar. */
.mt-audio-slot {
    flex: 1;
    max-width: 640px;
}

.mt-audio-slot:empty {
    display: none;
}

.mt-audio {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px 10px 10px;
    border: 1px solid var(--color-border, #e6e3f1);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: var(--shadow-1, 0 6px 34px rgba(215, 216, 222, 0.41));
    font-size: 14px;
    color: var(--color-heading, #192335);
}

.mt-audio-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 132px;
    height: 44px;
    padding: 0 18px 0 4px;
    border: 0;
    border-radius: 999px;
    background-size: 200% 100%;
    background-image: linear-gradient(to right, var(--color-primary, #2f57ef), var(--color-secondary, #b966e7));
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-position 0.4s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 6px 16px rgba(47, 87, 239, 0.28);
}

.mt-audio-btn:hover:not(:disabled) {
    background-position: 100% 0;
    transform: translateY(-1px);
}

.mt-audio-btn:active:not(:disabled) {
    transform: translateY(0);
}

.mt-audio-btn:focus-visible {
    outline: 3px solid var(--primary-opacity, rgba(47, 87, 239, 0.25));
    outline-offset: 2px;
}

.mt-audio-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--color-primary, #2f57ef);
    font-size: 16px;
}

/* The play triangle sits optically left of centre; nudge it. */
.mt-audio-icon .feather-play {
    margin-left: 2px;
}

.mt-audio.is-playing .mt-audio-icon {
    animation: mt-audio-pulse 1.6s ease-out infinite;
}

@keyframes mt-audio-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    100% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
}

.mt-audio-btn:disabled {
    background: var(--color-gray-light, #e9e9ef);
    color: var(--color-body, #6b7385);
    box-shadow: none;
    cursor: not-allowed;
}

.mt-audio-btn:disabled .mt-audio-icon {
    color: var(--color-body, #6b7385);
}

.mt-audio-track {
    flex: 1;
    min-width: 60px;
    height: 6px;
    border-radius: 999px;
    background: var(--color-primary-lighter, #eeeeff);
    overflow: hidden;
}

.mt-audio-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background-image: linear-gradient(to right, var(--color-primary, #2f57ef), var(--color-secondary, #b966e7));
    transition: width 0.25s linear;
}

.mt-audio-time {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.mt-audio-left {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--color-primary-light, #f1f7ff);
    color: var(--color-primary, #2f57ef);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.mt-audio-left.is-empty {
    background: rgba(255, 0, 3, 0.08);
    color: var(--color-danger, #ff0003);
}

/* On the dark audio bar. */
.mt-audiobar .mt-audio {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #ffffff;
}

.mt-audiobar .mt-audio-btn {
    box-shadow: none;
}

.mt-audiobar .mt-audio-track {
    background: rgba(255, 255, 255, 0.18);
}

.mt-audiobar .mt-audio-btn:disabled {
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.7);
}

.mt-audiobar .mt-audio-left {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.mt-audiobar .mt-audio-left.is-empty {
    background: rgba(255, 0, 3, 0.25);
}

/* A playing clip cannot be paused, so its button is locked; it keeps
   the playing look rather than the greyed-out "no plays left" one. */
.mt-audio.is-playing .mt-audio-btn:disabled {
    background-image: linear-gradient(to right, var(--color-primary, #2f57ef), var(--color-secondary, #b966e7));
    color: #ffffff;
    cursor: default;
}

.mt-audio.is-playing .mt-audio-btn:disabled .mt-audio-icon {
    color: var(--color-primary, #2f57ef);
}

.mt-audio-left[hidden] {
    display: none;
}

@media (max-width: 575.98px) {
    .mt-audio {
        flex-wrap: wrap;
        border-radius: 16px;
    }

    .mt-audio-track {
        order: 3;
        flex-basis: 100%;
    }
}

.mt-stage {
    flex: 1;
    min-height: 0;
    display: flex;
}

.mt-split {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 0;
}

.mt-split.is-single {
    grid-template-columns: minmax(0, 860px);
    justify-content: center;
}

.mt-pane {
    overflow-y: auto;
    padding: 24px 28px;
    min-height: 0;
}

.mt-pane + .mt-pane {
    border-left: 1px solid var(--mt-line);
    background: #ffffff;
}

.mt-split.is-single .mt-pane {
    background: #ffffff;
}

.mt-passage {
    font-size: 17px;
    line-height: 1.75;
    white-space: pre-wrap;
}

.mt-passage img,
.mt-question img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.mt-question {
    padding: 16px 0;
    border-bottom: 1px solid var(--mt-line);
    scroll-margin-top: 16px;
}

.mt-question.is-current {
    background: linear-gradient(90deg, rgba(47, 87, 239, 0.06), transparent);
}

.mt-question-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.mt-qnum {
    flex: 0 0 auto;
    min-width: 30px;
    height: 30px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    background: var(--mt-soft);
}

.mt-qtext {
    flex: 1;
    font-size: 16px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.mt-instruction {
    font-size: 14px;
    font-style: italic;
    color: var(--color-body);
    margin-bottom: 6px;
}

.mt-flag {
    border: 1px solid var(--mt-line);
    background: #ffffff;
    border-radius: 6px;
    font-size: 13px;
    padding: 4px 10px;
    color: var(--color-body);
}

.mt-flag.is-on {
    border-color: var(--mt-warn);
    color: var(--mt-warn);
    font-weight: 600;
}

.mt-choice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
}

.mt-choice:hover {
    background: var(--mt-soft);
}

/* The theme hides every radio/checkbox (opacity 0, absolute) and draws
   its own on a sibling <label>; our inputs sit inside the label, so
   bring the real control back. */
.mt-page .mt-choice input[type=radio],
.mt-page .mt-choice input[type=checkbox] {
    position: static;
    opacity: 1;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 4px 0 0;
    cursor: pointer;
}

.mt-choice:has(input:checked) {
    background: #eef3ff;
    box-shadow: inset 3px 0 0 var(--mt-accent);
    font-weight: 500;
}

/* The theme styles every text input (50px tall, shadow, its own
   padding); these selectors out-rank it inside the player. */
.mt-player input.mt-inline-blank,
.mt-player input.mt-text-answer {
    box-shadow: none;
    background: #ffffff;
    line-height: normal;
}

.mt-player input.mt-inline-blank:focus,
.mt-player input.mt-text-answer:focus {
    border-color: var(--mt-accent);
    box-shadow: 0 0 0 3px rgba(47, 87, 239, 0.12);
    outline: none;
}

.mt-player input.mt-inline-blank {
    display: inline-block;
    width: 160px;
    margin: 0 4px;
    padding: 2px 8px;
    border: 1px solid var(--mt-line);
    border-radius: 4px;
    font-size: 16px;
    height: 32px;
}

/* ── Dropdown / matching answers ─────────────────────────────────────
   Native selects restyled: a chevron, a soft border, and an accent tint
   once an option is picked so a student sees at a glance what is done.
   Three layouts (see renderDropdown): a matching list of rows, selects
   inline in a sentence, or one select under the question. */
.mt-player select.mt-dd-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    height: 40px;
    min-height: 0;
    padding: 0 36px 0 12px;
    font-size: 16px;
    line-height: 1.2;
    color: #6b7385;
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7385' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1px solid var(--mt-line);
    border-radius: 8px;
    box-shadow: none;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.mt-player select.mt-dd-select:hover {
    border-color: #c5c0da;
}

.mt-player select.mt-dd-select:focus {
    border-color: var(--mt-accent);
    box-shadow: 0 0 0 3px rgba(47, 87, 239, 0.14);
    outline: none;
}

.mt-player select.mt-dd-select.is-filled {
    color: var(--color-heading, #192335);
    font-weight: 600;
    border-color: var(--mt-accent);
    background-color: rgba(47, 87, 239, 0.06);
}

.mt-player select.mt-dd-select option {
    color: var(--color-heading, #192335);
    font-weight: 400;
}

.mt-player select.mt-dd-select:disabled {
    cursor: default;
    opacity: 0.7;
}

/* One select under the question. */
.mt-player select.mt-dd-single {
    width: 100%;
    max-width: 360px;
}

/* Selects inside a sentence: sized to their text, sitting on the line.
   Only lines that hold a select grow (via its margin); plain text keeps
   the normal line height. */
.mt-dd-inline {
    line-height: 1.6;
}

.mt-player select.mt-dd-inline-select {
    display: inline-block;
    width: auto;
    min-width: 150px;
    max-width: 100%;
    height: 36px;
    margin: 4px;
    vertical-align: middle;
}

/* Options that are whole sentences: the select gets its own line. */
.mt-player select.mt-dd-inline-select.is-wide {
    display: block;
    width: 100%;
    height: 44px;
    margin: 8px 0 14px;
    font-size: 16px;
}

/* Matching list: one row per item, label left, select right. */
.mt-dd {
    margin-top: 4px;
}

.mt-dd-intro {
    margin: 0 0 10px;
    font-size: 16px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.mt-dd-list {
    max-width: 680px;
    margin-bottom: 12px;
    background: var(--mt-surface);
    border: 1px solid var(--mt-line);
    border-radius: 10px;
    overflow: hidden;
}

.mt-dd-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(170px, 260px);
    align-items: center;
    gap: 16px;
    margin: 0;
    padding: 10px 14px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.mt-dd-row + .mt-dd-row {
    border-top: 1px solid var(--mt-line);
}

.mt-dd-row:hover {
    background: var(--mt-soft);
}

.mt-dd-label {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
}

.mt-player select.mt-dd-row-select {
    width: 100%;
}

@media (max-width: 575px) {
    .mt-dd-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

.mt-player input.mt-text-answer {
    font-size: 16px;
    height: 40px;
    padding: 6px 12px;
    max-width: 360px;
    border: 1px solid var(--mt-line);
    border-radius: 6px;
}

.mt-writer {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mt-writer textarea {
    flex: 1;
    min-height: 320px;
    font-size: 17px;
    line-height: 1.7;
    padding: 16px;
    border: 1px solid var(--mt-line);
    border-radius: 8px;
    resize: none;
}

.mt-wordcount {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-body);
}

.mt-wordcount.is-enough {
    color: var(--mt-ok);
}

.mt-speak {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
}

.mt-speak-clock {
    font-size: 40px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.mt-speak-phase {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 700;
    color: var(--mt-accent);
}

.mt-speak-phase.is-recording {
    color: var(--mt-bad);
}

.mt-speak-phase.is-recording::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--mt-bad);
    animation: mt-speak-pulse 1.2s ease-in-out infinite;
}

@keyframes mt-speak-pulse {
    50% { opacity: 0.25; }
}

/* Bars that move while the examiner audio plays. */
.mt-speak-wave {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 28px;
}

.mt-speak-wave[hidden] {
    display: none;
}

.mt-speak-wave span {
    width: 5px;
    height: 100%;
    border-radius: 3px;
    background: var(--mt-accent);
    transform-origin: bottom;
    animation: mt-speak-wave 0.9s ease-in-out infinite;
}

.mt-speak-wave span:nth-child(2) { animation-delay: -0.7s; }
.mt-speak-wave span:nth-child(3) { animation-delay: -0.5s; }
.mt-speak-wave span:nth-child(4) { animation-delay: -0.3s; }
.mt-speak-wave span:nth-child(5) { animation-delay: -0.1s; }

@keyframes mt-speak-wave {
    0%, 100% { transform: scaleY(0.25); }
    50% { transform: scaleY(1); }
}

.mt-speak-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mt-speak-actions:not(:has(button:not([hidden]))) {
    display: none;
}

/* The screen that opens each skill. */
.mt-section-intro {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
    max-width: 720px;
    margin: 24px auto;
}

.mt-section-intro-title {
    font-size: 28px;
    margin: 0;
}

.mt-section-intro-text {
    font-size: 17px;
    line-height: 1.7;
}

.mt-section-intro-plain {
    white-space: pre-line;
}

.mt-section-intro-text p {
    margin-bottom: 10px;
}

.mt-section-outro-text {
    white-space: pre-line;
}

.mt-section-intro .mt-speak-phase:empty {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .mt-speak-wave span,
    .mt-speak-phase.is-recording::before {
        animation: none;
    }
}

.mt-navbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: #ffffff;
    border-top: 1px solid var(--mt-line);
}

.mt-qnav {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 84px;
    overflow-y: auto;
    /* Room for the flag dot, which sits outside each button. */
    padding: 5px 5px 2px 2px;
}

.mt-qnav button {
    min-width: 34px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid var(--mt-line);
    background: #ffffff;
    font-size: 13px;
    font-weight: 600;
    position: relative;
}

.mt-qnav button.is-answered {
    background: var(--color-heading);
    border-color: var(--color-heading);
    color: #ffffff;
}

.mt-qnav button.is-flagged::after {
    content: "";
    position: absolute;
    top: -4px;
    right: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--mt-warn);
}

.mt-qnav button.is-current {
    /* Not an outline: .mt-qnav scrolls, which would clip it into
       bracket-shaped fragments. */
    border-color: var(--mt-accent);
    box-shadow: inset 0 0 0 1px var(--mt-accent);
}

.mt-qnav button.is-current.is-answered {
    background: var(--mt-accent);
    border-color: var(--mt-accent);
}

.mt-qnav button:disabled {
    opacity: 0.45;
}

.mt-legend {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--color-body);
}

.mt-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(244, 245, 248, 0.97);
    z-index: 5;
    padding: 20px;
    overflow-y: auto;
}

.mt-overlay-card {
    width: 100%;
    max-width: 640px;
    padding: 32px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 12px 40px rgba(25, 35, 53, 0.12);
}

.mt-overlay-card h2 {
    font-size: 26px;
    margin-bottom: 10px;
}

.mt-check-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--mt-line);
    font-size: 15px;
}

.mt-check-row > div {
    flex: 1;
}

.mt-check-row .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.mt-check-row .mt-check-state {
    margin-left: auto;
    font-weight: 600;
}

.mt-check-row .mt-check-state.ok { color: var(--mt-ok); }

.mt-countdown {
    font-size: 15px;
    padding: 10px 14px;
    border-radius: 6px;
    background: #eef3ff;
    margin-bottom: 14px;
}

.mt-player .btn,
.mt-player-modal .btn {
    font-size: 15px;
}

@media (max-width: 991px) {
    .mt-split {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .mt-pane {
        overflow: visible;
    }

    .mt-pane + .mt-pane {
        border-left: 0;
        border-top: 1px solid var(--mt-line);
    }
}

/* ── Player on phones ────────────────────────────────────────────── */

.mt-topbar .mt-title,
.mt-topbar .mt-section-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mt-topbar-heading {
    min-width: 0;
}

.mt-topbar .btn,
.mt-navbar .btn {
    white-space: nowrap;
    flex: 0 0 auto;
}

/* Back / Next / Submit: the theme's .rbt-btn at 45px (btn-sm). */
.mt-navbar .mt-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 120px;
    justify-content: center;
    font-weight: 600;
    white-space: nowrap;
}

.mt-navbar .mt-nav-btn[hidden] {
    display: none;
}

.mt-navbar .mt-nav-btn i {
    font-size: 18px;
}

.mt-navbar [data-finish] {
    min-width: 150px;
}

/* Next: the theme's heading navy, the same as answered question chips, so
   the blue gradient Finish stays the one accent in the bar. */
.mt-navbar .mt-next-btn,
.mt-navbar .mt-next-btn:focus {
    background: var(--color-heading);
    color: var(--color-white);
}

.mt-navbar .mt-next-btn:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

/* Last page of a section: Next does nothing, so it reads as off rather
   than as a faded colour. */
.mt-navbar .mt-next-btn:disabled {
    background: var(--color-gray-light, #e9e9ef);
    color: var(--color-body);
    opacity: 1 !important;
}

@media (max-width: 575px) {
    .mt-topbar {
        gap: 10px;
        padding: 8px 12px;
    }

    .mt-topbar .mt-save {
        display: none;
    }

    .mt-topbar-logo {
        height: 20px;
        padding-right: 10px;
    }

    .mt-overlay-card {
        padding: 22px 18px;
    }

    .mt-check-row {
        flex-wrap: wrap;
    }

    .mt-check-row > div {
        flex: 1 1 calc(100% - 30px);
    }

    .mt-check-row .btn:first-of-type {
        margin-left: 28px;
    }

    /* Question numbers get their own row above Back / Next / Finish. */
    .mt-navbar {
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 8px;
    }

    .mt-qnav {
        flex: 1 1 100%;
        order: -1;
        max-height: 92px;
    }

    .mt-navbar [data-finish] {
        margin-left: auto;
    }

    /* Three buttons share one phone-width row. */
    .mt-navbar .mt-nav-btn,
    .mt-navbar [data-finish] {
        flex: 1 1 0;
        min-width: 0;
    }

    body:has(.mt-player) #toast-container {
        top: 58px !important;
    }
}

/* Educational disclaimer & trademark notice (portal / category foot). */
.mt-disclaimer {
    padding: 20px 24px;
    border-top: 1px solid var(--mt-line);
    color: var(--color-body);
    font-size: 13px;
    line-height: 1.6;
}

.mt-disclaimer p {
    font-size: 13px;
    margin-bottom: 8px;
}

.mt-disclaimer-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}
