/**
 * MCQ Pro v3.8.39 — Mobile-first responsive layer.
 *
 * This file is enqueued with media="(max-width: 1024px)" so the base rules are
 * written for 320px phones, then progressively enhanced at 480/768/1024px.
 */

/* ── Phone foundation (320px+) ───────────────────────────── */
body.mcqp-student-shell-active {
    max-width: 100%;
    overflow-x: hidden;
}
@supports (overflow: clip) {
    body.mcqp-student-shell-active { overflow-x: clip; }
}

body.mcqp-student-shell-active .mcqp-virtual-subjects-page,
body.mcqp-student-shell-active .mcqp-virtual-bag-page,
body.mcqp-student-shell-active .mcqp-virtual-student-home-page,
body.mcqp-student-shell-active .mcqp-virtual-subscribe-page,
body.mcqp-student-shell-active .mcqp-virtual-profile-page,
body.mcqp-student-shell-active .mcqp-virtual-trivia-page,
body.mcqp-student-shell-active .mcqp-virtual-challenge-page,
body.mcqp-student-shell-active .mcqp-virtual-missed-page,
body.mcqp-student-shell-active .mcqp-virtual-review-page {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: .5rem .5rem calc(5.75rem + env(safe-area-inset-bottom, 0px)) !important;
}

body.mcqp-student-shell-active .entry-content,
body.mcqp-student-shell-active .wp-block-post-content {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
    padding-inline: .5rem !important;
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px)) !important;
}

body.mcqp-student-shell-active .mcqp-browser,
body.mcqp-student-shell-active .mcqp-profile,
body.mcqp-student-shell-active .mcqp-missed,
body.mcqp-student-shell-active .mcqp-review,
body.mcqp-student-shell-active .mcqp-trivia,
body.mcqp-student-shell-active .mcqp-trivia-wrap,
body.mcqp-student-shell-active .mcqp-challenge-page,
body.mcqp-student-shell-active .mcqp-section-challenge,
body.mcqp-student-shell-active .mcqp-student-home,
body.mcqp-student-shell-active .mcqp-bag-page,
body.mcqp-student-shell-active .mcqp-premium-plans {
    width: 100% !important;
    max-width: 100% !important;
    margin: .5rem auto 0 !important;
    padding-inline: 0 !important;
    box-sizing: border-box;
}

body.mcqp-student-shell-active .mcqp-browser *,
body.mcqp-student-shell-active .mcqp-profile *,
body.mcqp-student-shell-active .mcqp-missed *,
body.mcqp-student-shell-active .mcqp-review *,
body.mcqp-student-shell-active .mcqp-player *,
body.mcqp-student-shell-active .mcqp-trivia *,
body.mcqp-student-shell-active .mcqp-section-challenge * {
    box-sizing: border-box;
}

body.mcqp-student-shell-active img,
body.mcqp-student-shell-active video,
body.mcqp-student-shell-active canvas {
    max-width: 100%;
}

body.mcqp-student-shell-active .mcqp-btn,
body.mcqp-student-shell-active button.mcqp-btn,
body.mcqp-student-shell-active a.mcqp-btn,
body.mcqp-student-shell-active input,
body.mcqp-student-shell-active select,
body.mcqp-student-shell-active textarea {
    max-width: 100%;
}

body.mcqp-student-shell-active .mcqp-btn,
body.mcqp-student-shell-active button.mcqp-btn,
body.mcqp-student-shell-active a.mcqp-btn,
body.mcqp-student-shell-active select,
body.mcqp-student-shell-active input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]) {
    min-height: 2.75rem;
}

body.mcqp-student-shell-active .mcqp-page-actions,
body.mcqp-student-shell-active .entry-content > .mcqp-page-actions,
body.mcqp-student-shell-active .wp-block-post-content > .mcqp-page-actions,
.mcqp-page-actions[data-mcqp-page-actions="1"] {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: .5rem !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto .6rem !important;
    padding: 0 !important;
    direction: inherit !important;
    text-align: start !important;
}

body.mcqp-student-shell-active .mcqp-page-actions .mcqp-btn,
.mcqp-page-actions[data-mcqp-page-actions="1"] .mcqp-btn {
    width: 2.75rem !important;
    height: 2.75rem !important;
    min-width: 2.75rem !important;
    min-height: 2.75rem !important;
    margin: 0 !important;
}

body.mcqp-student-shell-active .mcqp-language-label {
    min-width: 0;
    margin-inline-start: auto;
}
body.mcqp-student-shell-active .mcqp-language-label > span { display: none; }
body.mcqp-student-shell-active .mcqp-language-switch {
    min-width: 6.6rem;
    min-height: 2.75rem;
}

/* Tables scroll inside their own region, never at page level. */
body.mcqp-student-shell-active .mcqp-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
body.mcqp-student-shell-active .mcqp-history-table {
    min-width: 42rem;
}

/* ── Profile and activity ────────────────────────────────── */
.mcqp-profile-header {
    display: grid !important;
    grid-template-columns: 4rem minmax(0, 1fr);
    align-items: center !important;
    gap: .8rem !important;
    padding: 1rem !important;
    margin-bottom: .75rem !important;
    border-radius: 1.25rem !important;
}

.mcqp-profile-avatar {
    width: 4rem !important;
    height: 4rem !important;
    min-width: 4rem;
    min-height: 4rem;
    max-width: 4rem;
    max-height: 4rem;
    aspect-ratio: 1;
    flex: 0 0 4rem !important;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,.55);
    border-radius: 50% !important;
}
.mcqp-profile-avatar .mcqp-user-avatar-img,
.mcqp-profile-avatar img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 1;
    border-radius: 50% !important;
    object-fit: cover !important;
}
.mcqp-profile-info {
    min-width: 0;
    overflow: hidden;
}
.mcqp-profile .mcqp-profile-header .mcqp-profile-info h2 {
    margin: 0 0 .2rem !important;
    font-size: clamp(1.05rem, 6vw, 1.35rem) !important;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.mcqp-profile-info p {
    max-width: 100%;
    font-size: .78rem !important;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.mcqp-profile-tabs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem !important;
    margin-bottom: .75rem !important;
}
.mcqp-profile-tab {
    min-width: 0;
    min-height: 2.75rem;
    padding: .55rem .45rem !important;
    border-radius: .8rem !important;
    font-size: .78rem;
    line-height: 1.25;
    white-space: normal;
}

.mcqp-profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .55rem !important;
    margin-bottom: .85rem !important;
}
.mcqp-pstat {
    display: grid;
    place-content: center;
    min-height: 5.15rem;
    padding: .65rem .4rem !important;
    border-radius: 1rem !important;
}
.mcqp-pstat-num {
    margin-bottom: .15rem !important;
    font-size: 1.45rem !important;
    line-height: 1.1;
}
.mcqp-pstat span:last-child {
    font-size: .72rem !important;
    line-height: 1.25;
}

.mcqp-profile .mcqp-card {
    min-width: 0;
    padding: .85rem !important;
    border-radius: 1rem !important;
}
.mcqp-profile .mcqp-card-title {
    margin-bottom: .75rem;
    padding-bottom: .6rem;
    font-size: .92rem;
}
.mcqp-profile-grid,
.mcqp-level-progress-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: .7rem !important;
    margin-bottom: .85rem !important;
}

.mcqp-level-card {
    display: grid;
    grid-template-columns: 5rem minmax(0, 1fr);
    align-items: center;
    gap: .75rem;
    text-align: start !important;
}
.mcqp-level-card-head {
    grid-column: 1 / -1;
    margin-bottom: 0 !important;
}
.mcqp-level-card-head h3 {
    min-width: 0;
    font-size: .95rem !important;
    overflow-wrap: anywhere;
}
.mcqp-level-card-head span { white-space: nowrap; }
.mcqp-donut {
    width: 5rem !important;
    height: 5rem !important;
    margin: 0 !important;
}
.mcqp-donut::before { inset: .48rem !important; }
.mcqp-donut span { font-size: 1rem !important; }
.mcqp-level-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .4rem !important;
}
.mcqp-level-metrics div { padding: .55rem .25rem !important; text-align: center; }

.mcqp-progress-chart-wrap,
.mcqp-progress-chart-wrap canvas {
    height: 11rem !important;
    max-height: 11rem !important;
}

.mcqp-section-progress-card { padding: .75rem !important; }
.mcqp-gap-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: .7rem !important;
}
.mcqp-gap-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: .5rem !important;
    width: 100%;
}
.mcqp-gap-toggle,
.mcqp-gap-scope button,
.mcqp-community-gap-tabs button,
.mcqp-community-gap-scope button {
    min-height: 2.75rem;
}
.mcqp-gap-toggle { width: 100%; }
.mcqp-gap-scope,
.mcqp-community-gap-tabs,
.mcqp-community-gap-scope {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
}
.mcqp-gap-legend {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem !important;
    padding: .6rem !important;
}

.mcqp-progress-accordion { gap: .55rem !important; }
.mcqp-progress-acc {
    min-width: 0;
    border-radius: .9rem !important;
}
.mcqp-progress-acc summary {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 2.75rem;
    align-items: center !important;
    gap: .55rem !important;
    min-height: 3.5rem;
    padding: .75rem !important;
}
.mcqp-progress-acc summary::after {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .75rem;
    background: rgba(255,255,255,.7);
}
.mcqp-acc-title {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    gap: .45rem !important;
    font-size: .9rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.mcqp-acc-icon { flex: 0 0 auto; }
.mcqp-progress-acc summary > .mcqp-gap-traffic {
    grid-column: 1 / -1;
    width: fit-content;
    margin-inline-start: 0;
}
.mcqp-acc-badges {
    grid-column: 1 / -1;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .35rem !important;
    width: 100%;
}
.mcqp-acc-badges span {
    min-width: 0;
    padding: .35rem .25rem !important;
    text-align: center;
    white-space: normal;
}
.mcqp-acc-body { padding: 0 .75rem .75rem !important; }
.mcqp-acc-bars { grid-template-columns: minmax(0, 1fr) !important; gap: .65rem !important; }
.mcqp-acc-mini {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .4rem !important;
}
.mcqp-acc-mini span { min-width: 0; padding: .45rem .35rem !important; text-align: center; }
.mcqp-progress-acc.depth-1,
.mcqp-progress-acc.depth-2 {
    margin-inline-start: .35rem !important;
}
.mcqp-acc-children { gap: .45rem !important; margin-top: .6rem !important; }

.mcqp-community-gap-card { padding: .75rem !important; }
.mcqp-community-gap-title,
.mcqp-community-gap-controls {
    flex-direction: column;
    align-items: stretch !important;
}
.mcqp-community-gap-summary,
.mcqp-community-gap-summary.columns-2,
.mcqp-community-gap-summary.columns-3,
.mcqp-community-gap-summary.columns-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
.mcqp-community-gap-node { min-width: 0; padding: .65rem !important; }
.mcqp-community-gap-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto 2.75rem;
    gap: .45rem !important;
}
.mcqp-community-gap-name { overflow-wrap: anywhere; }
.mcqp-community-gap-head::after {
    width: 2.75rem !important;
    height: 2.75rem !important;
}
.mcqp-community-gap-head .mcqp-gap-traffic {
    grid-column: 1 / -1;
    width: fit-content;
}
.mcqp-community-gap-children { padding-inline-start: .35rem !important; }

/* Community analytics: a stable two-row header and shallow hierarchy on phones. */
@media (max-width: 767px) {
    .mcqp-community-gap-card {
        overflow: clip !important;
        border-radius: 1rem !important;
    }
    .mcqp-community-gap-title { margin-bottom: .7rem !important; }
    .mcqp-community-gap-title p,
    .mcqp-community-gap-note {
        font-size: .78rem !important;
        line-height: 1.65 !important;
    }
    .mcqp-community-gap-controls { gap: .55rem !important; margin-bottom: .75rem !important; }
    .mcqp-community-gap-summary { gap: .5rem !important; margin-bottom: .75rem !important; }
    .mcqp-community-gap-summary > div {
        min-height: 5.25rem;
        justify-content: center;
        padding: .65rem .75rem !important;
        border-radius: .85rem !important;
    }
    .mcqp-community-gap-summary strong { font-size: 1.35rem !important; }
    .mcqp-community-gap-tree { gap: .6rem !important; }
    .mcqp-community-gap-node {
        width: 100%;
        max-width: 100%;
        margin: 0 !important;
        padding: .625rem !important;
        border-inline-start-width: 3px !important;
        border-radius: .9rem !important;
        box-shadow: 0 .2rem .8rem rgba(15,23,42,.045) !important;
    }
    .mcqp-community-gap-head {
        grid-template-columns: minmax(0, 1fr) auto 2.75rem !important;
        grid-template-rows: auto 2.75rem;
        align-items: center !important;
        column-gap: .5rem !important;
        row-gap: .45rem !important;
        min-height: 0;
    }
    .mcqp-community-gap-name {
        grid-column: 1 / -1;
        grid-row: 1;
        min-width: 0;
        font-size: .9rem;
        line-height: 1.45;
        overflow-wrap: anywhere;
    }
    .mcqp-community-gap-head .mcqp-gap-traffic {
        grid-column: 1;
        grid-row: 2;
        align-self: center;
        width: fit-content;
        margin: 0 !important;
    }
    .mcqp-community-gap-score {
        grid-column: 2;
        grid-row: 2;
        align-self: stretch;
        display: grid;
        place-items: center;
        min-width: 4.5rem !important;
        min-height: 2.75rem;
        margin: 0 !important;
        padding: .35rem .7rem !important;
        font-size: 1rem !important;
    }
    .mcqp-community-gap-head::after {
        grid-column: 3;
        grid-row: 2;
        align-self: stretch;
        margin: 0 !important;
    }
    .mcqp-community-gap-body { padding-top: .15rem !important; }
    .mcqp-community-gap-track { margin: .55rem 0 !important; }
    .mcqp-community-gap-metrics {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .35rem !important;
    }
    .mcqp-community-gap-metrics > span {
        min-width: 0;
        padding: .4rem .45rem !important;
        text-align: center;
        overflow-wrap: anywhere;
    }
    .mcqp-community-gap-children {
        gap: .5rem !important;
        margin-top: .6rem !important;
        padding-inline-start: .4rem !important;
        border-inline-start: 2px solid rgba(109,40,217,.13);
    }
    .mcqp-community-gap-node.depth-1,
    .mcqp-community-gap-node.depth-2 {
        box-shadow: none !important;
    }
    .mcqp-community-gap-privacy {
        margin-top: .8rem !important;
        font-size: .72rem !important;
        line-height: 1.6 !important;
    }

    /* Quiz history becomes readable cards instead of a horizontally cropped table. */
    .mcqp-history-card {
        padding: .75rem !important;
        overflow: visible !important;
    }
    .mcqp-history-card > .mcqp-card-title { margin-bottom: .75rem !important; }
    .mcqp-history-card .mcqp-table-wrap {
        overflow: visible !important;
        scrollbar-width: none;
    }
    .mcqp-history-table,
    .mcqp-history-table tbody {
        display: block;
        width: 100%;
        min-width: 0 !important;
    }
    .mcqp-history-table thead { display: none; }
    .mcqp-history-table tbody {
        display: grid;
        gap: .65rem;
    }
    .mcqp-history-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .7rem .75rem;
        width: 100%;
        padding: .8rem;
        border: 1px solid #e2e8f0;
        border-radius: .95rem;
        background: linear-gradient(145deg, #fff, #f8fafc);
        box-shadow: 0 .2rem .75rem rgba(15,23,42,.045);
    }
    .mcqp-history-table td {
        display: block;
        min-width: 0;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        color: #334155;
        text-align: start !important;
        overflow-wrap: anywhere;
    }
    .mcqp-history-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: .22rem;
        color: #7c8798;
        font-size: .64rem;
        font-weight: 800;
        line-height: 1.2;
        letter-spacing: .02em;
    }
    .mcqp-history-table .mcqp-history-quiz {
        grid-column: 1 / -1;
        padding-bottom: .65rem !important;
        border-bottom: 1px solid #e8edf3 !important;
        color: #172033;
        font-size: .94rem;
        font-weight: 850;
        line-height: 1.45;
    }
    .mcqp-history-table .mcqp-history-score {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: .25rem .5rem;
    }
    .mcqp-history-table .mcqp-history-score::before { grid-column: 1 / -1; }
    .mcqp-history-table .mcqp-mini-bar {
        width: 100% !important;
        min-width: 0;
        margin: 0 !important;
    }
    .mcqp-history-table .mcqp-history-score strong { white-space: nowrap; }
    .mcqp-history-table .mcqp-history-result span {
        display: inline-flex;
        align-items: center;
        min-height: 2rem;
        font-weight: 850;
    }
    .mcqp-history-table .mcqp-history-date {
        grid-column: 1 / -1;
        padding-top: .65rem !important;
        border-top: 1px solid #e8edf3 !important;
    }
}

/* ── Subjects and section cards ──────────────────────────── */
.mcqp-browser-hero {
    min-height: 0 !important;
    padding: 1rem !important;
    border-radius: 1.15rem !important;
}
.mcqp-browser-hero-art { display: none !important; }
.mcqp-browser-hero h1 {
    gap: .55rem !important;
    margin: .65rem 0 .4rem !important;
    font-size: 1.45rem !important;
}
.mcqp-browser-title-icon {
    width: 2.75rem !important;
    height: 2.75rem !important;
    flex: 0 0 2.75rem;
    border-radius: .8rem !important;
}
.mcqp-browser-hero p {
    margin: 0;
    font-size: .86rem !important;
    line-height: 1.65 !important;
}
.mcqp-browser-nav {
    margin: .7rem 0 !important;
    padding: .55rem !important;
}
.mcqp-browser-back { min-width: 2.75rem; }
.mcqp-browser-path {
    min-width: 0;
    overflow-wrap: anywhere;
}
.mcqp-subject-grid { gap: .65rem !important; margin-top: .65rem !important; }

.mcqp-browser .mcqp-section-item > .mcqp-section-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 2.75rem !important;
    align-items: center !important;
    gap: .65rem !important;
    min-height: 0 !important;
    padding: .8rem !important;
    padding-inline-end: .8rem !important;
    border-radius: 1rem !important;
}
.mcqp-browser .mcqp-section-item > .mcqp-section-header .mcqp-section-info,
.mcqp-browser .mcqp-section-item.mcqp-type-main > .mcqp-section-header .mcqp-section-info {
    grid-column: 1;
    grid-row: 1;
    display: grid !important;
    grid-template-columns: 3.25rem minmax(0, 1fr) !important;
    align-items: center !important;
    gap: .65rem !important;
    min-width: 0;
}
.mcqp-browser .mcqp-section-children .mcqp-section-item > .mcqp-section-header .mcqp-section-info {
    grid-template-columns: 2.75rem minmax(0, 1fr) !important;
}
.mcqp-browser .mcqp-section-visual,
.mcqp-browser .mcqp-type-main > .mcqp-section-header .mcqp-section-visual {
    width: 3.25rem !important;
    height: 3.25rem !important;
    border-radius: .9rem !important;
}
.mcqp-browser .mcqp-section-children .mcqp-section-visual {
    width: 2.75rem !important;
    height: 2.75rem !important;
    border-radius: .75rem !important;
}
.mcqp-browser .mcqp-section-visual img { padding: .25rem !important; }
.mcqp-browser .mcqp-section-icon,
.mcqp-browser .mcqp-type-main > .mcqp-section-header .mcqp-section-icon {
    font-size: 1.7rem !important;
}
.mcqp-browser .mcqp-section-copy {
    min-width: 0;
    gap: .3rem !important;
}
.mcqp-browser .mcqp-section-name,
.mcqp-browser .mcqp-type-main > .mcqp-section-header .mcqp-section-name,
.mcqp-browser .mcqp-section-children .mcqp-section-name {
    font-size: 1rem !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere;
}
.mcqp-browser .mcqp-section-eyebrow {
    min-height: 0;
    width: fit-content;
    padding: .2rem .45rem;
    font-size: .62rem;
}
.mcqp-browser .mcqp-section-description { display: none !important; }
.mcqp-browser .mcqp-section-meta {
    gap: .3rem !important;
    margin-top: .1rem !important;
}
.mcqp-browser .mcqp-section-meta .mcqp-q-badge,
.mcqp-browser .mcqp-section-meta .mcqp-premium-tag {
    min-height: 1.4rem;
    padding: .18rem .4rem !important;
    font-size: .64rem !important;
}
.mcqp-browser .mcqp-section-action {
    grid-column: 1 / -1 !important;
    grid-row: 2;
    width: 100%;
    margin: 0 !important;
}
.mcqp-browser .mcqp-section-action .mcqp-btn {
    width: 100%;
    min-height: 2.75rem;
    justify-content: center;
    padding: .55rem .75rem !important;
    font-size: .78rem !important;
}
.mcqp-browser .mcqp-section-item > .mcqp-section-header > .mcqp-chevron,
.mcqp-browser .mcqp-type-main > .mcqp-section-header > .mcqp-chevron {
    position: static !important;
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    width: 2.75rem !important;
    height: 2.75rem !important;
    min-width: 2.75rem !important;
    transform: none !important;
}
.mcqp-browser .mcqp-section-item.open > .mcqp-section-header > .mcqp-chevron {
    transform: rotate(45deg) !important;
}
.mcqp-browser .mcqp-section-item.levels-open > .mcqp-section-header > .mcqp-level-chevron {
    transform: rotate(180deg) !important;
}
.mcqp-browser .mcqp-section-children {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: .55rem !important;
    margin: .55rem 0 0 !important;
    padding: .5rem !important;
    border-radius: 1rem !important;
}
.mcqp-browser .mcqp-levels-panel {
    margin: .55rem 0 0 !important;
    padding: .7rem !important;
    border-radius: .9rem !important;
}
.mcqp-browser .mcqp-level-buttons {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: .45rem !important;
}
.mcqp-browser .mcqp-level-buttons .mcqp-btn {
    width: 100%;
    min-height: 2.75rem;
    justify-content: center;
}

/* ── Most-missed questions ───────────────────────────────── */
.mcqp-missed-hero {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: .75rem !important;
    padding: 1rem !important;
    border-radius: 1.15rem !important;
}
.mcqp-missed-hero h1 {
    margin-bottom: .4rem !important;
    font-size: 1.45rem !important;
}
.mcqp-missed-hero p { font-size: .88rem; line-height: 1.65 !important; }
.mcqp-missed-hero-card {
    gap: .6rem !important;
    padding: .85rem !important;
    border-radius: 1rem !important;
}
.mcqp-missed-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: .65rem !important;
    margin: .75rem 0 !important;
}
.mcqp-missed-tabs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: .3rem !important;
    padding: .3rem !important;
}
.mcqp-missed-tab {
    min-width: 0;
    min-height: 2.75rem;
    padding: .45rem .35rem !important;
    white-space: normal;
    line-height: 1.2;
}
.mcqp-missed-filters {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: .5rem !important;
    width: 100%;
}
.mcqp-tree-select,
.mcqp-tree-toggle { width: 100%; min-width: 0 !important; }
.mcqp-tree-toggle { min-height: 2.75rem; }
.mcqp-tree-panel { max-width: calc(100vw - 1rem); }
.mcqp-level-toggle {
    display: flex !important;
    width: 100%;
    max-width: 100%;
    min-height: 2.75rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}
.mcqp-level-btn {
    min-height: 2.4rem;
    flex: 1 0 auto;
    padding-inline: .8rem !important;
}

.mcqp-missed-list { gap: .7rem !important; }
.mcqp-missed-card {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: .65rem !important;
    min-width: 0;
    padding: .8rem !important;
    border-radius: 1rem !important;
}
.mcqp-missed-rank {
    width: 100% !important;
    height: 2.6rem !important;
    border-radius: .75rem !important;
}
.mcqp-missed-main { min-width: 0; }
.mcqp-missed-main h3 {
    margin-bottom: .65rem !important;
    font-size: 1.05rem !important;
    line-height: 1.55 !important;
    overflow-wrap: anywhere;
}
.mcqp-missed-meta { gap: .35rem !important; font-size: .72rem !important; }
.mcqp-missed-options { gap: .4rem !important; }
.mcqp-missed-opt,
.mcqp-missed-opt.no-dist {
    grid-template-columns: 2rem minmax(0, 1fr) !important;
    gap: .45rem !important;
    min-width: 0;
    padding: .5rem !important;
}
.mcqp-missed-opt-text {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}
.mcqp-missed-opt-bar,
.mcqp-missed-opt-pct { display: none; }
.mcqp-missed-stats {
    display: grid !important;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    align-items: center !important;
    gap: .65rem !important;
    width: 100%;
    padding: .7rem 0 0 !important;
    border-inline-start: 0 !important;
    border-top: 1px dashed #e5e7eb !important;
}
.mcqp-missed-ring {
    width: 5.5rem !important;
    height: 5.5rem !important;
}
.mcqp-missed-ring::after { inset: .55rem !important; }
.mcqp-missed-ring strong { font-size: 1.2rem !important; }
.mcqp-missed-ring span { margin-top: 1.75rem !important; font-size: .62rem !important; }

/* ── Quiz player and question interactions ───────────────── */
.mcqp-overlay {
    align-items: stretch !important;
    padding: 0 !important;
}
.mcqp-player {
    width: 100vw !important;
    max-width: none !important;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    overscroll-behavior: contain;
}
.mcqp-player-header {
    min-height: 3.5rem;
    padding: .65rem .8rem !important;
}
.mcqp-player-title {
    min-width: 0;
    font-size: 1rem !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mcqp-player-timer {
    flex: 0 0 auto;
    margin-inline: .35rem !important;
    padding: .35rem .55rem !important;
    font-size: .82rem !important;
}
.mcqp-player-close {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    padding: 0 !important;
}
.mcqp-player-progress { padding: .55rem .85rem !important; }
.mcqp-player-loading { padding: 3rem 1rem !important; }
#player-question { padding: .8rem .85rem .3rem !important; }
.mcqp-question-head { min-height: 2.75rem; }
.mcqp-question-text {
    margin-bottom: .85rem !important;
    font-size: 1rem !important;
    line-height: 1.55 !important;
    overflow-wrap: anywhere;
}
.mcqp-options { gap: .55rem !important; }
.mcqp-option {
    min-height: 3.25rem;
    gap: .7rem !important;
    padding: .7rem .75rem !important;
    border-radius: .8rem !important;
    font-size: .92rem !important;
}
.mcqp-option-key {
    width: 2.25rem !important;
    height: 2.25rem !important;
    flex: 0 0 2.25rem !important;
}
.mcqp-option-text {
    min-width: 0;
    overflow-wrap: anywhere;
}
.mcqp-option-explanation { padding: .65rem .7rem !important; }
.mcqp-option-explanation .mcqp-explanation-text { font-size: .86rem !important; }
.mcqp-player-nav,
.mcqp-player-nav.mcqp-hide-previous {
    position: sticky;
    z-index: 4;
    bottom: 0;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    align-items: center;
    gap: .45rem !important;
    width: calc(100% + 1.7rem);
    margin: .8rem -.85rem 0;
    padding: .65rem .75rem calc(.65rem + env(safe-area-inset-bottom, 0px)) !important;
    border-top: 1px solid #e5e7eb;
    background: rgba(255,255,255,.97);
    box-shadow: 0 -8px 24px rgba(15,23,42,.08);
    backdrop-filter: blur(8px);
}
.mcqp-player-nav .mcqp-btn {
    min-width: 2.75rem;
    min-height: 2.75rem;
    justify-content: center;
    padding-inline: .7rem !important;
    white-space: nowrap;
}
.mcqp-player-nav .mcqp-dots {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    overflow-x: auto;
    overflow-y: hidden;
    padding: .5rem .2rem !important;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
}
.mcqp-player-nav .mcqp-dots::-webkit-scrollbar { display: none; }
.mcqp-dot {
    width: .58rem !important;
    height: .58rem !important;
    min-width: .58rem;
    flex: 0 0 .58rem;
}
.mcqp-player-nav.mcqp-hide-previous { grid-template-columns: minmax(0, 1fr) auto !important; }
.mcqp-player-nav.mcqp-hide-previous .mcqp-dots { grid-column: 1 !important; }
.mcqp-player-nav.mcqp-hide-previous #btn-next,
.mcqp-player-nav.mcqp-hide-previous #btn-submit {
    grid-column: 2 !important;
}
.mcqp-result { padding: 1.5rem .85rem !important; }
.mcqp-result-auth-gate { padding: 1.75rem .85rem !important; }
.mcqp-result-actions,
.mcqp-result-auth-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: .55rem !important;
}
.mcqp-result-actions .mcqp-btn,
.mcqp-result-auth-actions .mcqp-btn { width: 100%; justify-content: center; }
.mcqp-answer-item { min-width: 0; overflow-wrap: anywhere; }

/* Keep the grade switcher useful without hiding the last card or answer. */
.mcqp-grade-switcher {
    inset-inline-end: .5rem !important;
    bottom: calc(.5rem + env(safe-area-inset-bottom, 0px)) !important;
    width: min(18rem, calc(100vw - 1rem)) !important;
}
.mcqp-grade-switcher-toggle {
    min-height: 3.25rem !important;
    padding: .45rem .6rem !important;
}
.mcqp-grade-switcher-menu { max-height: calc(100dvh - 5rem); }

/* ── Progressive enhancement: wide phones (480px+) ──────── */
@media (min-width: 480px) {
    body.mcqp-student-shell-active .mcqp-virtual-subjects-page,
    body.mcqp-student-shell-active .mcqp-virtual-bag-page,
    body.mcqp-student-shell-active .mcqp-virtual-student-home-page,
    body.mcqp-student-shell-active .mcqp-virtual-subscribe-page,
    body.mcqp-student-shell-active .mcqp-virtual-profile-page,
    body.mcqp-student-shell-active .mcqp-virtual-trivia-page,
    body.mcqp-student-shell-active .mcqp-virtual-challenge-page,
    body.mcqp-student-shell-active .mcqp-virtual-missed-page,
    body.mcqp-student-shell-active .mcqp-virtual-review-page,
    body.mcqp-student-shell-active .entry-content,
    body.mcqp-student-shell-active .wp-block-post-content {
        padding-inline: .75rem !important;
    }

    .mcqp-profile-header { grid-template-columns: 4.5rem minmax(0, 1fr); padding: 1.15rem !important; }
    .mcqp-profile-avatar {
        width: 4.5rem !important;
        height: 4.5rem !important;
        min-width: 4.5rem;
        min-height: 4.5rem;
        max-width: 4.5rem;
        max-height: 4.5rem;
        flex-basis: 4.5rem !important;
    }
    .mcqp-profile-stats { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
    .mcqp-pstat { min-height: 5.4rem; }
    .mcqp-browser-hero,
    .mcqp-missed-hero { padding: 1.25rem !important; }
    .mcqp-browser .mcqp-section-item > .mcqp-section-header { padding: 1rem !important; }
    .mcqp-missed-card { padding: 1rem !important; }
    .mcqp-missed-opt {
        grid-template-columns: 2rem minmax(0, 1fr) 4.5rem 2.25rem !important;
    }
    .mcqp-missed-opt.no-dist {
        grid-template-columns: 2rem minmax(0, 1fr) !important;
    }
    .mcqp-missed-opt-bar,
    .mcqp-missed-opt-pct { display: block; }
}

/* ── Progressive enhancement: tablets (768px+) ──────────── */
@media (min-width: 768px) {
    body.mcqp-student-shell-active .mcqp-virtual-subjects-page,
    body.mcqp-student-shell-active .mcqp-virtual-bag-page,
    body.mcqp-student-shell-active .mcqp-virtual-student-home-page,
    body.mcqp-student-shell-active .mcqp-virtual-subscribe-page,
    body.mcqp-student-shell-active .mcqp-virtual-profile-page,
    body.mcqp-student-shell-active .mcqp-virtual-trivia-page,
    body.mcqp-student-shell-active .mcqp-virtual-challenge-page,
    body.mcqp-student-shell-active .mcqp-virtual-missed-page,
    body.mcqp-student-shell-active .mcqp-virtual-review-page,
    body.mcqp-student-shell-active .entry-content,
    body.mcqp-student-shell-active .wp-block-post-content {
        padding-inline: 1rem !important;
    }

    .mcqp-profile-tabs {
        display: flex !important;
        width: fit-content;
    }
    .mcqp-profile-tab { padding-inline: 1rem !important; font-size: .88rem; }
    .mcqp-profile-grid,
    .mcqp-level-progress-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .mcqp-level-card { display: block; text-align: center !important; }
    .mcqp-level-card-head { margin-bottom: .8rem !important; }
    .mcqp-donut { width: 6.5rem !important; height: 6.5rem !important; margin: 0 auto .75rem !important; }
    .mcqp-gap-actions { display: flex !important; width: auto; }
    .mcqp-gap-toggle { width: auto; }
    .mcqp-gap-scope { display: inline-grid !important; width: auto; }
    .mcqp-gap-legend { display: flex !important; }
    .mcqp-acc-bars { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .mcqp-community-gap-head { display: flex !important; }
    .mcqp-community-gap-head .mcqp-gap-traffic { grid-column: auto; }
    .mcqp-browser .mcqp-section-children { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .mcqp-browser .mcqp-level-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mcqp-missed-toolbar { grid-template-columns: auto minmax(0, 1fr) !important; align-items: center; }
    .mcqp-missed-filters { grid-template-columns: minmax(14rem, 1fr) auto; align-items: center; }
    .mcqp-missed-card {
        grid-template-columns: 2.75rem minmax(0, 1fr) !important;
    }
    .mcqp-missed-rank { width: 2.75rem !important; }
    .mcqp-missed-stats { grid-column: 2; }
    .mcqp-overlay { align-items: center !important; padding: 1rem !important; }
    .mcqp-player {
        width: min(100%, 45rem) !important;
        height: auto;
        max-height: 94dvh !important;
        border-radius: 1.25rem !important;
    }
    .mcqp-result-actions,
    .mcqp-result-auth-actions { display: flex !important; justify-content: center; }
    .mcqp-result-actions .mcqp-btn,
    .mcqp-result-auth-actions .mcqp-btn { width: auto; }
}

/* ── Progressive enhancement: small laptops (1024px) ────── */
@media (min-width: 1024px) {
    body.mcqp-student-shell-active .mcqp-virtual-subjects-page,
    body.mcqp-student-shell-active .mcqp-virtual-profile-page,
    body.mcqp-student-shell-active .mcqp-virtual-missed-page {
        padding-inline: 1.25rem !important;
    }
    .mcqp-browser-hero { padding: 1.6rem !important; }
    .mcqp-browser-hero-art { display: block !important; }
    .mcqp-missed-card {
        grid-template-columns: 2.75rem minmax(0, 1fr) 13rem !important;
        align-items: start;
    }
    .mcqp-missed-stats {
        grid-column: auto;
        grid-template-columns: minmax(0, 1fr);
        padding: 0 0 0 .8rem !important;
        border-top: 0 !important;
        border-inline-start: 1px dashed #e5e7eb !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.mcqp-student-shell-active *,
    body.mcqp-student-shell-active *::before,
    body.mcqp-student-shell-active *::after {
        scroll-behavior: auto !important;
    }
}
