    .custom-option {
        border: 2px solid #333; /* Border color */
        padding: 10px;
        margin: 5px;
        border-radius: 5px; /* Contoured edges */
        cursor: pointer;
    }

    .custom-option:hover {
        background-color: #eee; /* Highlight on hover */
    }

    .custom-option.selected {
        background-color: rgba(0, 123, 255, 0.12); /* Highlight when selected */
        color: #000; /* Text color when selected */
    }

    .custom-option.submitted-answer {
        border-color: #0d6efd;
        background-color: rgba(13, 110, 253, 0.14);
        box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.16);
    }

    .options-div {
        display: flex; /* Ensure horizontal stacking */
        flex-direction: column; /* Stack items vertically */
        align-items: center; /* Center the options horizontally */
    }

    .question-heading-tools {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.55rem;
        margin-bottom: 0.75rem;
    }

    .question-flag-btn {
        border: 0;
        background: transparent;
        color: #6c757d;
        font-size: 1.8rem;
        line-height: 1;
        padding: 0.15rem 0.3rem;
        border-radius: 0.4rem;
    }

    .question-flag-btn.is-flagged {
        color: #f59e0b;
    }

    .question-flag-btn:focus-visible {
        outline: 3px solid rgba(245, 158, 11, 0.45);
        outline-offset: 2px;
    }

    /* Your existing CSS for light mode */

    /* Add this rule to highlight borders on dark mode */
    [data-bs-theme=dark] .custom-option:hover {
        background-color: transparent;
        border: 2px solid #eee; /* Border color for dark mode */
    }

    /* Add this rule to handle the selected state in dark mode */
    [data-bs-theme=dark] .custom-option.selected {
        background-color: rgba(0, 123, 255, 0.12);  /* Highlight when selected */
        color: #fff; /* Text color when selected */
        border: 2px solid #007bff; /* Border color for dark mode */
    }

    [data-bs-theme=dark] .custom-option.submitted-answer {
        background-color: rgba(67, 143, 240, 0.2);
        border-color: #76a6ff;
        box-shadow: 0 0 0 2px rgba(118, 166, 255, 0.2);
    }

  /* highlight the question the user is viewing */
    #progress-container .progress-item.current-question {
        border: 2px solid #007bff;   /* your requested highlight */
        box-shadow: 0 0 0 2px rgba(0,123,255,0.07);
    }

    #progress-container a {
    all: unset;
    cursor: pointer;
    }

    .score-sidebar {
        position: fixed;
        display: none;
        top: 130px;
        right: 20px;
        width: 70px;
        max-height: 80vh;
        overflow-y: auto;
        overflow-x: hidden;
        white-space: normal;
        border: 1px solid #ccc;
        padding: 10px;
        border-radius: 10px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        color: #060928;
        z-index: 9999;
        flex-direction: column;
    }

    .score-sidebar--review {
        right: 30px;
    }

    .score-sidebar.open {
        display: flex !important;
        flex-direction: column;
    }

    .score-toggle-btn {
        display: block;
        position: fixed;
        top: 80px;
        right: 20px;
        background-color: #060928;
        color: white;
        border: 1px solid #ccc;
        padding: 10px 15px;
        border-radius: 15px;
        font-size: 16px;
        cursor: pointer;
        z-index: 10000;
    }

    .score-toggle-btn--question {
        width: 70px;
    }

    .score-toggle-btn--review {
        width: 90px;
    }

    #progress-container div {
        border: 1px solid #ccc;
        border-radius: 6px;
        text-align: center;
        margin-bottom: 4px;
        font-size: 14px;
        background: #f7f7f7;
    }

    #score-percentage {
        border: 1px solid #ccc;
        border-radius: 6px;
        text-align: center;
        margin-bottom: 4px;
        font-size: 14px;
        background: #f7f7f7;
        display: none;
    }

    #progress-container a {
        display: block;
        color: inherit;
        text-decoration: none;
    }

    .current-question {
        box-shadow: 0 0 0 2px rgba(7, 93, 204, 0.25);
    }

    .current-question a {
        font-weight: 700;
        color: #060928;
    }

    #progress-container .flagged-question {
        border-color: #d97706 !important;
        background: #f59e0b !important;
        color: #2b1700;
        box-shadow: inset 0 0 0 1px rgba(120, 53, 15, 0.35);
    }

    #progress-container .flagged-question.current-question {
        border-color: #d97706 !important;
        box-shadow: 0 0 0 3px rgba(7, 93, 204, 0.35);
    }

    #progress-container .flagged-question a {
        color: #2b1700;
        font-weight: 700;
    }

    @media (max-width: 1300px) {
        .score-sidebar {
            width: 70px;
        }
    }

    .score-dashboard {
        margin-top: 26px;
        margin-bottom: 90px;
        --score-secondary: #5f6b85;
        --score-muted-surface: rgba(255, 255, 255, 0.82);
    }

    .score-dashboard .text-secondary,
    .score-dashboard .kpi-label,
    .score-dashboard .kpi-subtext,
    .score-dashboard .quick-stat {
        color: var(--score-secondary) !important;
    }

    .score-dashboard .dashboard-card {
        border-radius: 14px;
        border: 1px solid rgba(0, 0, 0, 0.08);
        background: var(--score-muted-surface);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    }

    .score-dashboard .dashboard-hero {
        border-radius: 18px;
        background:
            radial-gradient(circle at 15% 0%, rgba(232, 240, 255, 0.75), transparent 38%),
            radial-gradient(circle at 85% 0%, rgba(243, 232, 255, 0.65), transparent 38%),
            rgba(255, 255, 255, 0.86);
    }

    .score-dashboard .attempt-chip {
        display: inline-block;
        font-size: 0.8rem;
        border-radius: 999px;
        padding: 5px 12px;
        background: rgba(36, 40, 91, 0.08);
        color: var(--bs-secondary-color);
    }

    .score-dashboard .kpi-card {
        position: relative;
        overflow: hidden;
    }

    .score-dashboard .kpi-card::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        opacity: 0.9;
    }

    .score-dashboard .kpi-score::before {
        background: linear-gradient(180deg, rgba(24, 107, 73, 0.12), transparent 45%);
    }

    .score-dashboard .kpi-percent::before {
        background: linear-gradient(180deg, rgba(29, 87, 164, 0.12), transparent 45%);
    }

    .score-dashboard .kpi-time::before {
        background: linear-gradient(180deg, rgba(170, 104, 25, 0.12), transparent 45%);
    }

    .score-dashboard .kpi-pace::before {
        background: linear-gradient(180deg, rgba(103, 57, 178, 0.12), transparent 45%);
    }

    .kpi-label {
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        margin-bottom: 0.35rem;
        position: relative;
        z-index: 1;
    }

    .kpi-value {
        font-size: 2.05rem;
        font-weight: 700;
        line-height: 1.1;
        margin-bottom: 0.25rem;
        position: relative;
        z-index: 1;
    }

    .kpi-subtext {
        font-size: 0.85rem;
        margin-bottom: 0;
        position: relative;
        z-index: 1;
    }

    .score-dashboard .section-title {
        font-size: 1.05rem;
        font-weight: 700;
        margin-bottom: 0.75rem;
    }

    .score-dashboard .category-table th,
    .score-dashboard .category-table td {
        vertical-align: middle;
    }

    .score-dashboard .category-table th {
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    }

    .score-dashboard .category-table td {
        font-size: 0.92rem;
        border-bottom-color: rgba(0, 0, 0, 0.08);
    }

    .score-dashboard .accuracy-pill {
        display: inline-block;
        min-width: 54px;
        text-align: center;
        padding: 2px 10px;
        border-radius: 999px;
        font-weight: 600;
        background: rgba(36, 40, 91, 0.12);
    }

    .score-dashboard .meta-list p {
        margin-bottom: 0.45rem;
    }

    .score-dashboard .quick-stat {
        font-size: 0.9rem;
    }

    .score-dashboard .quick-stat strong {
        color: var(--bs-emphasis-color);
    }

    .score-dashboard .action-btn {
        border-radius: 20px;
        border-style: solid;
        border-color: var(--bs-btn-color);
        min-width: 136px;
    }

    .score-dashboard .delta-positive {
        color: #1d8f52;
        font-weight: 700;
    }

    .score-dashboard .delta-negative {
        color: #b44747;
        font-weight: 700;
    }

    .score-dashboard .benchmark-metric {
        border-radius: 12px;
        border: 1px solid rgba(0, 0, 0, 0.08);
        padding: 12px;
        background: rgba(255, 255, 255, 0.55);
    }

    .score-dashboard .benchmark-label {
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        margin-bottom: 0.35rem;
    }

    .score-dashboard .benchmark-value {
        font-size: 1.3rem;
        font-weight: 700;
        margin-bottom: 0.15rem;
    }

    [data-bs-theme="dark"] .score-dashboard .dashboard-card {
        border: 1px solid rgba(255, 255, 255, 0.08);
        background: rgba(11, 15, 58, 0.76);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.36);
    }

    [data-bs-theme="dark"] .score-dashboard {
        --score-secondary: #aab3e8;
        --score-muted-surface: rgba(11, 15, 58, 0.76);
    }

    [data-bs-theme="dark"] .score-dashboard .dashboard-hero {
        background:
            radial-gradient(circle at 15% 0%, rgba(10, 15, 74, 0.8), transparent 38%),
            radial-gradient(circle at 85% 10%, rgba(26, 15, 58, 0.74), transparent 42%),
            rgba(11, 15, 58, 0.82);
    }

    [data-bs-theme="dark"] .score-dashboard .attempt-chip {
        background: rgba(255, 255, 255, 0.12);
        color: #d8dcff;
    }

    [data-bs-theme="dark"] .score-dashboard .accuracy-pill {
        background: rgba(255, 255, 255, 0.14);
        color: #e6e9ff;
    }

    [data-bs-theme="dark"] .score-dashboard .category-table th {
        color: #b8c0ff;
        border-bottom-color: rgba(255, 255, 255, 0.2);
    }

    [data-bs-theme="dark"] .score-dashboard .category-table td {
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    [data-bs-theme="dark"] .score-dashboard .kpi-score::before {
        background: linear-gradient(180deg, rgba(44, 180, 121, 0.18), transparent 50%);
    }

    [data-bs-theme="dark"] .score-dashboard .kpi-percent::before {
        background: linear-gradient(180deg, rgba(67, 143, 240, 0.2), transparent 50%);
    }

    [data-bs-theme="dark"] .score-dashboard .kpi-time::before {
        background: linear-gradient(180deg, rgba(228, 156, 62, 0.2), transparent 50%);
    }

    [data-bs-theme="dark"] .score-dashboard .kpi-pace::before {
        background: linear-gradient(180deg, rgba(150, 103, 226, 0.22), transparent 50%);
    }

    .score-dashboard .rounded-table {
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid rgba(0, 0, 0, 0.08);
    }

    [data-bs-theme="dark"] .score-dashboard .rounded-table {
        border-color: rgba(255, 255, 255, 0.12);
    }

    [data-bs-theme="dark"] .score-dashboard .delta-positive {
        color: #5ace90;
    }

    [data-bs-theme="dark"] .score-dashboard .delta-negative {
        color: #ff8a8a;
    }

    [data-bs-theme="dark"] .score-dashboard .benchmark-metric {
        border-color: rgba(255, 255, 255, 0.12);
        background: rgba(11, 15, 58, 0.6);
    }

/* Authenticated quiz dashboard */
.quiz-dashboard {
    --quiz-dashboard-subtle: rgba(255, 255, 255, 0.72);
    --quiz-dashboard-control: rgba(248, 250, 252, 0.96);
    --quiz-dashboard-muted: #64748b;
    --quiz-dashboard-border: rgba(15, 23, 42, 0.08);
    --quiz-dashboard-accent: #1f4fa4;
    max-width: 1180px;
    padding-top: clamp(1.25rem, 3vw, 2.5rem);
    padding-bottom: clamp(3rem, 7vw, 5rem);
}

.quiz-dashboard__header {
    margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.quiz-dashboard__header h1 {
    margin-bottom: 0.35rem;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 750;
    letter-spacing: -0.025em;
}

.quiz-dashboard__header p,
.quiz-dashboard__title-row p,
.quiz-dashboard__preference p,
.quiz-dashboard__empty-copy,
.quiz-dashboard__builder-footer p {
    color: var(--quiz-dashboard-muted);
}

.quiz-dashboard__header p {
    max-width: 42rem;
    margin: 0;
    font-size: clamp(1rem, 2vw, 1.1rem);
}

.quiz-dashboard__card {
    overflow: hidden;
    border: 0;
    border-radius: 1.25rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.05);
}

.quiz-dashboard__card-body {
    padding: clamp(1.25rem, 3vw, 2rem);
}

.quiz-dashboard__title-row {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.quiz-dashboard__title-row h2,
.quiz-dashboard__section-title {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
    font-weight: 750;
    letter-spacing: -0.01em;
}

.quiz-dashboard__title-row p {
    margin: 0;
    font-size: 0.94rem;
}

.quiz-dashboard__icon {
    display: inline-grid;
    flex: 0 0 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border-radius: 0.85rem;
    background: rgba(54, 124, 235, 0.1);
    color: var(--quiz-dashboard-accent);
}

.quiz-dashboard__icon svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: currentColor;
}

.quiz-dashboard__category-field {
    min-height: 14rem;
}

.quiz-dashboard .form-text {
    color: var(--quiz-dashboard-muted);
}

.quiz-dashboard .select2-container {
    display: block;
    max-width: 100%;
}

.quiz-dashboard .select2-container--default .select2-selection--multiple {
    min-height: 3rem;
    padding: 0.3rem 0.4rem;
    border-color: var(--quiz-dashboard-border);
    border-radius: 0.65rem;
    background: var(--quiz-dashboard-control);
}

.quiz-dashboard .select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.2);
}

.quiz-dashboard .select2-container.is-invalid .select2-selection--multiple {
    border-color: var(--bs-danger);
}

.quiz-dashboard .select2-container--default .select2-selection__choice {
    border-color: var(--quiz-dashboard-border);
    border-radius: 0.4rem;
    background: rgba(54, 124, 235, 0.08);
    color: var(--bs-body-color);
}

.quiz-dashboard .select2-container--default .select2-selection__choice__remove {
    border-right-color: var(--quiz-dashboard-border);
    color: var(--quiz-dashboard-muted);
}

.quiz-dashboard__builder-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem clamp(1.25rem, 3vw, 2rem);
    border-top: 1px solid var(--quiz-dashboard-border);
    background: rgba(255, 255, 255, 0.58);
}

.quiz-dashboard__builder-footer p {
    font-size: 0.9rem;
    font-weight: 600;
}

.quiz-dashboard__start-button,
.quiz-dashboard__review-button {
    min-height: 2.75rem;
    border-radius: 20px !important;
    font-weight: 700;
}

.quiz-dashboard__start-button {
    min-width: 10.5rem;
}

.quiz-dashboard__sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.quiz-dashboard__flagged .quiz-dashboard__title-row {
    margin-bottom: 1.25rem;
}

.quiz-dashboard__empty-copy {
    padding: 0.9rem 1rem;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem;
    line-height: 1.5;
}

.quiz-dashboard__collapse-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}

.quiz-dashboard__collapse-toggle:focus-visible,
.quiz-dashboard a:focus-visible,
.quiz-dashboard button:focus-visible,
.quiz-dashboard input:focus-visible {
    outline: 3px solid rgba(var(--bs-primary-rgb), 0.35);
    outline-offset: 3px;
}

.quiz-dashboard__chevron {
    width: 1rem;
    height: 1rem;
    margin-left: 1rem;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.quiz-dashboard__collapse-toggle[aria-expanded="true"] .quiz-dashboard__chevron {
    transform: rotate(180deg);
}

.quiz-dashboard__preferences-body {
    padding: 0 1.25rem 1.25rem;
}

.quiz-dashboard__preference {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: 1px solid var(--quiz-dashboard-border);
}

.quiz-dashboard__preference-title {
    display: block;
    margin-bottom: 0.2rem;
    font-weight: 700;
    cursor: pointer;
}

.quiz-dashboard__preference p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.45;
}

.quiz-dashboard__preference .form-switch {
    flex: 0 0 auto;
    margin: 0.15rem 0 0;
    padding-left: 2.75rem;
}

.quiz-dashboard__preference .form-check-input {
    width: 2.35rem;
    height: 1.25rem;
    margin-left: -2.75rem;
    cursor: pointer;
}

.quiz-dashboard__select2-dropdown {
    border-color: var(--bs-border-color);
    background: rgba(255, 255, 255, 0.98);
    color: var(--bs-body-color);
}

.quiz-dashboard__select2-dropdown .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--bs-primary);
    color: var(--bs-white);
}

.quiz-dashboard__select2-dropdown .select2-results__option--selected {
    background: var(--bs-tertiary-bg);
}

[data-bs-theme="dark"] .quiz-dashboard {
    --quiz-dashboard-subtle: rgba(15, 23, 42, 0.72);
    --quiz-dashboard-control: rgba(11, 18, 32, 0.9);
    --quiz-dashboard-muted: #9aa8c0;
    --quiz-dashboard-border: rgba(255, 255, 255, 0.08);
    --quiz-dashboard-accent: #9dc1ff;
}

[data-bs-theme="dark"] .quiz-dashboard__card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(10, 16, 28, 0.98) 100%);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34), 0 2px 10px rgba(0, 0, 0, 0.22);
}

[data-bs-theme="dark"] .quiz-dashboard__icon {
    background: rgba(67, 143, 240, 0.18);
}

[data-bs-theme="dark"] .quiz-dashboard__builder-footer,
[data-bs-theme="dark"] .quiz-dashboard__empty-copy {
    background: rgba(15, 23, 42, 0.72);
}

[data-bs-theme="dark"] .quiz-dashboard__start-button {
   border-color: #fff;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

[data-bs-theme="dark"] .quiz-dashboard__start-button:hover,
[data-bs-theme="dark"] .quiz-dashboard__start-button:focus-visible {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

[data-bs-theme="dark"] .quiz-dashboard__review-button {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

[data-bs-theme="dark"] .quiz-dashboard__review-button:hover,
[data-bs-theme="dark"] .quiz-dashboard__review-button:focus-visible {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

[data-bs-theme="dark"] .quiz-dashboard .select2-container--default .select2-selection--multiple,
[data-bs-theme="dark"] .quiz-dashboard__select2-dropdown,
[data-bs-theme="dark"] .quiz-dashboard__select2-dropdown .select2-search__field {
    border-color: var(--quiz-dashboard-border);
    background: var(--quiz-dashboard-control);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .quiz-dashboard .select2-container--default .select2-selection__choice {
    background: rgba(67, 143, 240, 0.16);
}

@media (min-width: 768px) {
    .quiz-dashboard__main {
        display: flex;
    }

    .quiz-dashboard__builder {
        width: 100%;
    }

    .quiz-dashboard__preferences .collapse:not(.show) {
        display: block;
    }

    .quiz-dashboard__preferences .quiz-dashboard__collapse-toggle {
        cursor: default;
        pointer-events: none;
    }

    .quiz-dashboard__preferences .quiz-dashboard__chevron {
        display: none;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .quiz-dashboard__category-field {
        min-height: 14rem;
    }
}

@media (max-width: 575.98px) {
    .quiz-dashboard {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .quiz-dashboard__card-body,
    .quiz-dashboard__collapse-toggle,
    .quiz-dashboard__preferences-body {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .quiz-dashboard__category-field {
        min-height: 11rem;
    }

    .quiz-dashboard__builder-footer {
        align-items: stretch;
        flex-direction: column;
        padding: 1rem;
    }

    .quiz-dashboard__start-button,
    .quiz-dashboard__review-button {
        width: 100%;
    }
}

/* Modern question workspace */
.quiz-page {
    --quiz-surface: rgba(255, 255, 255, 0.96);
    --quiz-surface-muted: rgba(248, 250, 252, 0.92);
    --quiz-border: rgba(15, 23, 42, 0.1);
    --quiz-muted: #64748b;
    --quiz-accent: #1f5fbf;
    --quiz-success: #157347;
    --quiz-danger: #b02a37;
    max-width: 1180px;
    padding-top: clamp(1rem, 2.5vw, 2rem);
    padding-bottom: clamp(3rem, 7vw, 5rem);
}

.quiz-page__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--quiz-border);
}

.quiz-page__brand,
.quiz-question-card__eyebrow,
.quiz-progress-panel__eyebrow {
    color: var(--quiz-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.quiz-page__position {
    font-size: 1rem;
    font-weight: 700;
}

.quiz-icon {
    width: 1rem;
    height: 1rem;
    margin-right: 0.35rem;
    fill: currentColor;
}

.quiz-question-card,
.quiz-explanation-card,
.quiz-progress-panel,
.quiz-finish-modal {
    border: 1px solid var(--quiz-border);
    border-radius: 1.15rem;
    background: var(--quiz-surface);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.quiz-question-card {
    overflow: hidden;
}

.quiz-finish-modal__dialog {
    max-width: 31rem;
    padding: 0 0.75rem;
}

.quiz-finish-modal {
    --quiz-border: rgba(15, 23, 42, 0.1);
    --quiz-muted: #64748b;
    overflow: hidden;
    border-color: var(--quiz-border);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.quiz-finish-modal__header {
    position: relative;
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 1.5rem 3.5rem 0.75rem 1.5rem;
    border: 0;
}

.quiz-finish-modal__icon {
    display: grid;
    width: 3.25rem;
    height: 3.25rem;
    place-items: center;
    border-radius: 50%;
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
}

.quiz-finish-modal__icon svg {
    width: 1.55rem;
    height: 1.55rem;
    fill: currentColor;
}

.quiz-finish-modal__eyebrow {
    margin: 0 0 0.18rem;
    color: var(--quiz-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.quiz-finish-modal .modal-title {
    color: var(--bs-emphasis-color);
    font-size: 1.35rem;
    font-weight: 750;
    line-height: 1.2;
}

.quiz-finish-modal__close {
    position: absolute;
    top: 1.15rem;
    right: 1.15rem;
    margin: 0;
}

.quiz-finish-modal__body {
    padding: 0.5rem 1.5rem 1.4rem 5.75rem;
    color: var(--quiz-muted);
    font-size: 0.98rem;
    line-height: 1.55;
}

.quiz-finish-modal__footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 1rem 1.5rem 1.5rem;
    border-color: var(--quiz-border);
    background: var(--bs-tertiary-bg);
}

.quiz-finish-modal__footer .btn {
    min-height: 2.8rem;
    border-radius: 20px;
    font-weight: 700;
}

.quiz-finish-modal__cancel {
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.quiz-finish-modal__cancel:hover,
.quiz-finish-modal__cancel:focus-visible {
    border-color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.07);
    color: var(--bs-primary);
}

.quiz-finish-modal__confirm {
    border: 1px solid var(--bs-primary);
    background: var(--bs-primary);
    color: #fff;
}

.quiz-finish-modal__confirm:hover,
.quiz-finish-modal__confirm:focus-visible {
    border-color: var(--bs-primary);
    background: color-mix(in srgb, var(--bs-primary) 88%, #000);
    color: #fff;
}

.quiz-question-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem clamp(1rem, 3vw, 1.5rem);
    border-bottom: 1px solid var(--quiz-border);
    background: var(--quiz-surface-muted);
}

.quiz-question-card__number {
    font-size: 0.9rem;
    font-weight: 700;
}

.quiz-question-card__tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.quiz-question-card__body {
    padding: clamp(1.15rem, 3vw, 2rem);
}

.quiz-question-stem {
    margin-bottom: 1.6rem;
    font-size: clamp(1.08rem, 2vw, 1.28rem);
    font-weight: 650;
    line-height: 1.55;
    text-align: left;
    overflow-wrap: anywhere;
}

.quiz-question-stem > :last-child,
.quiz-explanation-content > :last-child {
    margin-bottom: 0;
}

.quiz-question-stem img,
.quiz-explanation-content img,
.quiz-question-stem figure,
.quiz-explanation-content figure {
    max-width: 100%;
    height: auto;
}

.quiz-question-stem table,
.quiz-explanation-content table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    -webkit-overflow-scrolling: touch;
}

.quiz-answer-list {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.quiz-page .custom-option.quiz-answer-option {
    display: grid;
    grid-template-columns: 2.35rem minmax(0, 1fr) 1.35rem;
    align-items: center;
    width: 100%;
    min-height: 3.75rem;
    gap: 0.85rem;
    margin: 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--quiz-border);
    border-radius: 0.8rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.quiz-page .quiz-answer-option:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.5);
    background: rgba(var(--bs-primary-rgb), 0.035);
    transform: translateY(-1px);
}

.quiz-page .quiz-answer-option:has(.quiz-answer-option__input:focus-visible) {
    outline: 3px solid rgba(var(--bs-primary-rgb), 0.28);
    outline-offset: 2px;
}

.quiz-page .quiz-answer-option.selected {
    border-color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.09);
    color: var(--bs-body-color);
    box-shadow: 0 0 0 1px rgba(var(--bs-primary-rgb), 0.15);
}

.quiz-answer-option__letter {
    display: inline-grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    border: 1px solid var(--quiz-border);
    border-radius: 0.65rem;
    background: var(--quiz-surface-muted);
    font-weight: 800;
}

.quiz-answer-option__text {
    min-width: 0;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.quiz-answer-option__indicator {
    width: 1.15rem;
    height: 1.15rem;
    border: 2px solid var(--bs-border-color);
    border-radius: 50%;
}

.quiz-answer-option.selected .quiz-answer-option__indicator {
    border: 0.3rem solid var(--bs-primary);
    background: var(--bs-body-bg);
}

.quiz-page .quiz-answer-option.is-correct {
    border-color: var(--quiz-success);
    background: rgba(25, 135, 84, 0.1);
}

.quiz-page .quiz-answer-option.is-incorrect {
    border-color: var(--quiz-danger);
    background: rgba(220, 53, 69, 0.09);
}

.quiz-answer-option.is-correct .quiz-answer-option__indicator,
.quiz-answer-option.is-incorrect .quiz-answer-option__indicator {
    display: grid;
    width: 1.35rem;
    height: 1.35rem;
    place-items: center;
    border: 0;
    background: transparent;
    font-size: 1.15rem;
    font-weight: 900;
}

.quiz-answer-option.is-correct .quiz-answer-option__indicator::before {
    color: var(--quiz-success);
    content: "✓";
}

.quiz-answer-option.is-incorrect .quiz-answer-option__indicator::before {
    color: var(--quiz-danger);
    content: "×";
}

.quiz-answer-option.is-locked {
    cursor: default;
    transform: none;
}

.quiz-review-page .quiz-answer-option.is-locked {
    cursor: default;
    transform: none;
}

.quiz-review-page .quiz-answer-option.is-locked:not(.is-correct):not(.is-incorrect):hover {
    border-color: var(--quiz-border);
    background: var(--bs-body-bg);
    transform: none;
}

.quiz-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem clamp(1rem, 3vw, 1.5rem);
    border-top: 1px solid var(--quiz-border);
    background: var(--quiz-surface-muted);
}

.quiz-navigation__primary {
    min-width: 10rem;
    margin-left: auto;
}

.quiz-navigation .btn,
.quiz-progress-panel__finish,
.quiz-page__progress-toggle,
.quiz-question-card__edit {
    border-radius: 0.7rem;
    font-weight: 700;
}

.quiz-question-card__secondary-actions {
    padding: 0.35rem 1rem 0.65rem;
    border-top: 1px solid var(--quiz-border);
    text-align: right;
}

.quiz-question-card__secondary-actions .btn-link {
    color: var(--quiz-muted);
    text-decoration: none;
}

.quiz-explanation-card {
    margin-top: 1.5rem;
    overflow: hidden;
}

.quiz-explanation-card__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem clamp(1rem, 3vw, 1.5rem);
    border-bottom: 1px solid var(--quiz-border);
    background: var(--quiz-surface-muted);
}

.quiz-explanation-card__header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.quiz-explanation-card__icon {
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 0.6rem;
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
}

.quiz-explanation-card__icon svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.quiz-explanation-content {
    max-width: 100%;
    padding: clamp(1.15rem, 3vw, 2rem);
    font-size: 1rem;
    line-height: 1.72;
    text-align: left;
    overflow-wrap: anywhere;
}

.quiz-explanation-content p,
.quiz-explanation-content ul,
.quiz-explanation-content ol {
    max-width: 70ch;
}

.quiz-explanation-content h1,
.quiz-explanation-content h2,
.quiz-explanation-content h3,
.quiz-explanation-content h4 {
    margin-top: 1.5em;
    margin-bottom: 0.65em;
    font-weight: 800;
}

.quiz-explanation-content th,
.quiz-explanation-content td,
.quiz-question-stem th,
.quiz-question-stem td {
    padding: 0.65rem;
    border: 1px solid var(--quiz-border);
    text-align: left;
}

.quiz-explanation-content figcaption {
    margin-top: 0.5rem;
    color: var(--quiz-muted);
    font-size: 0.875rem;
}

.quiz-explanation-content a {
    font-weight: 650;
    overflow-wrap: anywhere;
}

.quiz-progress-sticky {
    position: sticky;
    top: 6rem;
}

.quiz-progress-panel {
    padding: 1.25rem;
}

.quiz-progress-panel__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.quiz-progress-panel__count {
    font-size: 1.05rem;
    font-weight: 800;
}

.quiz-progress-panel__score {
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    font-size: 0.82rem;
    font-weight: 800;
}

.quiz-progress-panel__bar {
    height: 0.45rem;
    margin: 1rem 0 1.15rem;
    border-radius: 999px;
    background: var(--bs-tertiary-bg);
}

.quiz-progress-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(2.3rem, 1fr));
    gap: 0.5rem;
}

.quiz-progress-grid .progress-item {
    position: relative;
    aspect-ratio: 1;
    min-width: 0;
    margin: 0;
    border: 1px solid var(--quiz-border);
    border-radius: 0.65rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-size: 0.82rem;
    font-weight: 750;
}

.quiz-progress-grid .progress-item > a,
.quiz-progress-grid .progress-item > span {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    height: 100%;
    place-items: center;
    border-radius: inherit;
    color: inherit;
    text-decoration: none;
}

/* Override the legacy #progress-container a { all: unset; } rule so the
   complete numbered tile remains the interactive link target. */
.quiz-page #scoreSidebar #progress-container.quiz-progress-grid .progress-item > a,
.quiz-progress-offcanvas .quiz-progress-grid .progress-item > a {
    position: absolute;
    inset: 0;
    display: grid;
    width: auto;
    height: auto;
    place-items: center;
    border-radius: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
}

.quiz-progress-number {
    grid-area: 1 / 1;
    pointer-events: none;
}

.quiz-progress-grid .progress-item a:focus-visible {
    outline: 3px solid rgba(var(--bs-primary-rgb), 0.35);
    outline-offset: 2px;
}

#progress-container.quiz-progress-grid .progress-item.is-correct,
.quiz-progress-offcanvas .quiz-progress-grid .progress-item.is-correct {
    border-color: var(--quiz-success);
    background: #dcfce7 !important;
    color: #14532d;
}

#progress-container.quiz-progress-grid .progress-item.is-incorrect,
.quiz-progress-offcanvas .quiz-progress-grid .progress-item.is-incorrect {
    border-color: var(--quiz-danger);
    background: #fee2e2 !important;
    color: #7f1d1d;
}

#progress-container.quiz-progress-grid .progress-item.is-answered-neutral,
.quiz-progress-offcanvas .quiz-progress-grid .progress-item.is-answered-neutral {
    border-color: var(--bs-secondary);
    background: var(--bs-tertiary-bg) !important;
}

.quiz-progress-grid .progress-item.current-question {
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.28);
}

.quiz-progress-panel[data-exam-mode="0"] .progress-item.current-question.unanswered-question {
    border: 2px solid var(--bs-primary) !important;
    background: #fff !important;
    color: #0f172a;
}

#progress-container.quiz-progress-grid .progress-item.flagged-question,
.quiz-progress-offcanvas .quiz-progress-grid .progress-item.flagged-question {
    border-color: #d97706 !important;
    background: #f59e0b !important;
    color: #2b1700 !important;
}

.quiz-progress-grid .progress-item.flagged-question.current-question {
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.42);
}

.quiz-progress-grid .progress-item.is-locked {
    color: var(--quiz-muted);
    opacity: 0.62;
}

.quiz-progress-panel__finish {
    width: 100%;
    margin-top: 1.25rem;
}

.quiz-progress-offcanvas {
    --bs-offcanvas-width: min(92vw, 24rem);
    background: var(--bs-body-bg);
}

.quiz-progress-offcanvas .quiz-progress-panel--mobile {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.question-flag-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2rem;
    padding: 0.3rem 0.55rem;
    border: 1px solid var(--quiz-border);
    border-radius: 0.65rem;
    background: transparent;
    color: var(--quiz-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.question-flag-icon {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.question-flag-btn.is-flagged {
    border-color: #d97706;
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
}

.quiz-navigation .quiz-navigation__primary,
.quiz-navigation .quiz-navigation__previous,
.quiz-progress-panel__finish,
.question-flag-btn,
.quiz-question-card__edit {
    border-radius: 20px;
}

.quiz-page button:focus-visible,
.quiz-page a:focus-visible,
.question-flag-btn:focus-visible {
    outline: 3px solid rgba(var(--bs-primary-rgb), 0.32);
    outline-offset: 2px;
}

.question-feedback-modal {
    --quiz-border: rgba(15, 23, 42, 0.1);
    --quiz-muted: #64748b;
    width: min(100%, 35rem);
    overflow: hidden;
    border: 1px solid var(--quiz-border);
    border-radius: 1.15rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.question-feedback-modal__header {
    position: relative;
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 1.5rem 3.5rem 0.9rem 1.5rem;
}

.question-feedback-modal__icon {
    display: grid;
    width: 3.25rem;
    height: 3.25rem;
    place-items: center;
    border-radius: 50%;
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
}

.question-feedback-modal__icon svg {
    width: 1.55rem;
    height: 1.55rem;
    fill: currentColor;
}

.question-feedback-modal__eyebrow {
    margin: 0 0 0.18rem;
    color: var(--quiz-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.question-feedback-modal__header h2 {
    margin: 0;
    color: var(--bs-emphasis-color);
    font-size: 1.35rem;
    font-weight: 750;
    line-height: 1.2;
}

.question-feedback-modal__close {
    position: absolute;
    top: 1.15rem;
    right: 1.15rem;
}

.question-feedback-modal__body {
    padding: 0.45rem 1.5rem 1.5rem;
}

.question-feedback-modal__intro {
    margin: 0 0 1rem;
    color: var(--quiz-muted);
    font-size: 0.94rem;
    line-height: 1.55;
}

.question-feedback-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1055;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.48);
}

.question-feedback-modal-backdrop.is-open {
    display: flex;
}

.question-feedback-modal textarea {
    min-height: 10rem;
    padding: 0.9rem 1rem;
    border-color: var(--bs-border-color);
    border-radius: 0.9rem;
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    resize: vertical;
}

.question-feedback-modal textarea:focus {
    border-color: var(--bs-primary);
    background: var(--bs-body-bg);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.14);
}

.question-feedback-modal__footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid var(--quiz-border);
    background: var(--bs-tertiary-bg);
}

.question-feedback-modal__footer .btn {
    min-height: 2.8rem;
    border-radius: 20px;
    font-weight: 700;
}

.question-feedback-modal__cancel {
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.question-feedback-modal__cancel:hover,
.question-feedback-modal__cancel:focus-visible {
    border-color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.07);
    color: var(--bs-primary);
}

.question-feedback-modal__submit {
    border: 1px solid var(--bs-primary);
    background: var(--bs-primary);
    color: #fff;
}

.question-feedback-modal__submit:hover,
.question-feedback-modal__submit:focus-visible {
    border-color: var(--bs-primary);
    background: color-mix(in srgb, var(--bs-primary) 88%, #000);
    color: #fff;
}

.question-feedback-modal__cancel:focus-visible,
.question-feedback-modal__submit:focus-visible,
.question-feedback-modal__close:focus-visible {
    outline: 3px solid rgba(var(--bs-primary-rgb), 0.32);
    outline-offset: 2px;
}

[data-bs-theme="dark"] .question-feedback-modal {
    --quiz-border: rgba(255, 255, 255, 0.1);
    --quiz-muted: #9aa8c0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
}

[data-bs-theme="dark"] .quiz-page {
    --quiz-surface: rgba(15, 23, 42, 0.96);
    --quiz-surface-muted: rgba(11, 18, 32, 0.92);
    --quiz-border: rgba(255, 255, 255, 0.1);
    --quiz-muted: #9aa8c0;
    --quiz-accent: #9dc1ff;
    --quiz-success: #6ed6a0;
    --quiz-danger: #ff929c;
}

[data-bs-theme="dark"] .quiz-question-card,
[data-bs-theme="dark"] .quiz-explanation-card,
[data-bs-theme="dark"] .quiz-progress-panel,
[data-bs-theme="dark"] .quiz-finish-modal {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .quiz-finish-modal {
    --quiz-border: rgba(255, 255, 255, 0.1);
    --quiz-muted: #9aa8c0;
}

[data-bs-theme="dark"] .question-flag-btn.is-flagged {
    color: #fbbf24;
}

/* Keep the question controls distinct from the dark workspace surfaces. */
[data-bs-theme="dark"] .quiz-page .quiz-answer-option.selected:not(.is-correct):not(.is-incorrect) {
    border-color: #8bb8ff;
    background: rgba(75, 132, 230, 0.24);
    box-shadow: 0 0 0 2px rgba(139, 184, 255, 0.32);
}

[data-bs-theme="dark"] .quiz-answer-option.selected:not(.is-correct):not(.is-incorrect) .quiz-answer-option__letter {
    border-color: #8bb8ff;
    background: rgba(139, 184, 255, 0.14);
}

[data-bs-theme="dark"] .quiz-answer-option.selected:not(.is-correct):not(.is-incorrect) .quiz-answer-option__indicator {
    border-color: #b8d2ff;
    background: #8bb8ff;
}

[data-bs-theme="dark"] .quiz-navigation__primary {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

[data-bs-theme="dark"] .quiz-navigation__primary:hover,
[data-bs-theme="dark"] .quiz-navigation__primary:focus-visible {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

[data-bs-theme="dark"] .quiz-page__progress-toggle {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

[data-bs-theme="dark"] .quiz-page__progress-toggle:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

/* Override the legacy #progress-container tile background so each result
   matches the progress legend in the dark theme. */
[data-bs-theme="dark"] #progress-container.quiz-progress-grid .progress-item.is-correct,
[data-bs-theme="dark"] .quiz-progress-offcanvas .quiz-progress-grid .progress-item.is-correct {
    border-color: #6ed6a0 !important;
    background: rgba(110, 214, 160, 0.2) !important;
    color: #d7fae6;
}

[data-bs-theme="dark"] #progress-container.quiz-progress-grid .progress-item.is-incorrect,
[data-bs-theme="dark"] .quiz-progress-offcanvas .quiz-progress-grid .progress-item.is-incorrect {
    border-color: #ff929c !important;
    background: rgba(255, 146, 156, 0.2) !important;
    color: #ffdadd;
}

[data-bs-theme="dark"] #progress-container.quiz-progress-grid .progress-item.is-answered-neutral,
[data-bs-theme="dark"] .quiz-progress-offcanvas .quiz-progress-grid .progress-item.is-answered-neutral {
    border-color: var(--bs-secondary) !important;
    background: var(--bs-tertiary-bg) !important;
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] #progress-container.quiz-progress-grid .progress-item.flagged-question,
[data-bs-theme="dark"] .quiz-progress-offcanvas .quiz-progress-grid .progress-item.flagged-question {
    border-color: #d97706 !important;
    background: #f59e0b !important;
    color: #2b1700 !important;
}

[data-bs-theme="dark"] #progress-container.quiz-progress-grid .progress-item.flagged-question.current-question,
[data-bs-theme="dark"] .quiz-progress-offcanvas .quiz-progress-grid .progress-item.flagged-question.current-question {
    border-color: #d97706 !important;
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.58);
}

@media (max-width: 991.98px) {
    .quiz-page {
        max-width: 820px;
    }
}

@media (max-width: 575.98px) {
    .quiz-page {
        padding-right: 0.85rem;
        padding-left: 0.85rem;
    }

    .quiz-page__header {
        margin-bottom: 0.85rem;
    }

    .quiz-question-card,
    .quiz-explanation-card {
        border-radius: 0.9rem;
    }

    .quiz-question-card__header {
        align-items: flex-start;
        padding: 0.85rem;
    }

    .quiz-question-card__tools {
        flex-wrap: wrap;
    }

    .question-flag-label {
        display: none;
    }

    .quiz-question-card__body {
        padding: 1rem 0.85rem;
    }

    .quiz-question-stem {
        margin-bottom: 1.15rem;
        font-size: 1.05rem;
    }

    .quiz-page .custom-option.quiz-answer-option {
        grid-template-columns: 2.1rem minmax(0, 1fr) 1.25rem;
        gap: 0.65rem;
        min-height: 3.4rem;
        padding: 0.65rem 0.75rem;
    }

    .quiz-answer-option__letter {
        width: 2.1rem;
        height: 2.1rem;
    }

    .quiz-navigation {
        padding: 0.85rem;
    }

    .quiz-navigation__primary {
        min-width: 0;
    }

    .quiz-explanation-content {
        padding: 1rem;
    }

    .quiz-finish-modal__header {
        grid-template-columns: 2.75rem minmax(0, 1fr);
        gap: 0.8rem;
        padding: 1.25rem 3.25rem 0.65rem 1rem;
    }

    .quiz-finish-modal__icon {
        width: 2.75rem;
        height: 2.75rem;
    }

    .quiz-finish-modal__body {
        padding: 0.5rem 1rem 1.25rem;
    }

    .quiz-finish-modal__footer {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .question-feedback-modal-backdrop {
        padding: 0.75rem;
    }

    .question-feedback-modal__header {
        grid-template-columns: 2.75rem minmax(0, 1fr);
        gap: 0.8rem;
        padding: 1.25rem 3.25rem 0.75rem 1rem;
    }

    .question-feedback-modal__icon {
        width: 2.75rem;
        height: 2.75rem;
    }

    .question-feedback-modal__body {
        padding: 0.35rem 1rem 1.25rem;
    }

    .question-feedback-modal__footer {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
}
