.exam-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.exam-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.exam-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
}

.exam-modal-card {
    position: relative;
    width: min(1080px, calc(100vw - 40px));
    max-height: calc(100dvh - 32px);
    border-radius: 24px;
    border: 1px solid #dce8df;
    background: #fff;
    box-shadow: 0 28px 80px rgba(15, 36, 27, 0.24);
    overflow: hidden auto;
    overscroll-behavior: contain;
}

.exam-result-accent {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #2ea855 0%, #23b08b 52%, #2b7de9 100%);
}

.exam-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex: 0 0 auto;
    min-height: 52px;
}

.exam-modal-head-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.62rem;
}

.exam-modal-student-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    border-radius: 16px;
    background: #eaf7ee;
    border: 1px solid #d4ecdd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.exam-modal-student-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.exam-modal-student-avatar-fallback {
    color: #24864b;
    font-weight: 900;
    letter-spacing: 0.02em;
    font-size: 1rem;
}

.exam-modal-head-copy {
    min-width: 0;
    display: grid;
    gap: 0.08rem;
}

.exam-modal-head h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 900;
    color: #213f30;
    line-height: 1.3;
}

.exam-modal-student-name {
    margin: 2px 0 0;
    color: #708379;
    font-size: 0.85rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.exam-modal-close {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.3rem;
    cursor: pointer;
}

.exam-modal-close:hover,
.exam-modal-close:focus-visible {
    background: rgba(255, 255, 255, 0.3);
    outline: none;
}

.exam-modal-body {
    display: grid;
    grid-template-columns: minmax(230px, 0.42fr) minmax(0, 1fr);
    gap: 24px;
    min-height: 0;
    flex: 1;
}

.exam-modal-hero {
    border-radius: 20px;
    border: 1px solid #d9eddf;
    background: linear-gradient(145deg, #edf9ef, #f6fbf7);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    min-width: 0;
}

.exam-modal-score {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 4.25rem;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -0.06em;
    color: #20824a;
    font-variant-numeric: tabular-nums;
}

.exam-modal-hero-meta {
    display: grid;
    gap: 7px;
    justify-items: center;
}

.exam-modal-badge,
.exam-modal-accuracy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 800;
}

.exam-modal-badge {
    background: #d9efdf;
    color: #236b3d;
    padding: 6px 16px;
    font-size: 0.83rem;
}

.exam-modal-accuracy {
    background: none;
    color: #6c8275;
    font-size: 0.82rem;
    padding: 0;
}

.exam-modal-summary {
    margin: 0;
    display: grid;
    gap: 12px;
    width: 100%;
}

.exam-modal-summary-lead {
    margin: 0;
    color: #5e7567;
    font-size: 0.75rem;
    line-height: 1.45;
    text-align: center;
}

.exam-modal-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding-top: 16px;
    border-top: 1px solid #d5e9dc;
}

.exam-modal-summary-item {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 0 4px;
    text-align: center;
}

.exam-modal-summary-item--wide {
    grid-column: 1 / -1;
}

.exam-modal-summary-label {
    display: block;
    margin: 0;
    font-size: 0.69rem;
    font-weight: 700;
    color: #718678;
}

.exam-modal-summary-value {
    display: block;
    margin: 0;
    font-size: 1rem;
    font-weight: 900;
    color: #2b4936;
    line-height: 1.3;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.exam-modal-reward {
    border-radius: 16px;
    border: 1px solid #e8dfcc;
    background: #fffcf5;
    padding: 12px 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 12px;
    align-content: center;
}

.exam-modal-reward__head {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.exam-modal-reward__eyebrow {
    margin: 0 0 2px;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #8b7b58;
}

.exam-modal-reward__head h4 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 900;
    color: #554729;
    overflow-wrap: anywhere;
}

.exam-modal-reward__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 5px 10px;
    background: #f2e9d4;
    color: #7d673a;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.exam-modal-reward__message {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: #7b7057;
    line-height: 1.5;
}

.exam-modal-reward__meta {
    grid-column: 2;
    grid-row: 2;
    margin: 0;
    font-size: 0.72rem;
    color: #857c69;
    text-align: right;
    line-height: 1.5;
}

.exam-modal-reward__track {
    grid-column: 1 / -1;
    position: relative;
    padding: 0;
}

.exam-modal-reward__pins {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1.5rem;
    pointer-events: none;
}

.exam-modal-reward__pin {
    position: absolute;
    top: 0;
    width: 18px;
    height: 22px;
    transform: translateX(-50%);
}

.exam-modal-reward__pin.is-first {
    left: 0 !important;
    transform: none;
}

.exam-modal-reward__pin.is-last {
    transform: translateX(-100%);
}

.exam-modal-reward__pin::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 16px;
    height: 16px;
    border-radius: 50% 50% 50% 0;
    border: 2px solid rgba(119, 132, 136, 0.42);
    background: rgba(255, 255, 255, 0.98);
    transform: translateX(-50%) rotate(-45deg);
    box-sizing: border-box;
    box-shadow: 0 4px 10px rgba(31, 47, 30, 0.08);
}

.exam-modal-reward__pin::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(119, 132, 136, 0.68);
    transform: translateX(-50%);
}

.exam-modal-reward__pin.is-claimed::before {
    border-color: rgba(46, 168, 85, 0.4);
    background: rgba(233, 250, 238, 0.98);
}

.exam-modal-reward__pin.is-claimed::after {
    background: #2ea855;
}

.exam-modal-reward__pin.is-next::before {
    border-color: rgba(255, 91, 145, 0.46);
    background: rgba(255, 240, 246, 0.98);
}

.exam-modal-reward__pin.is-next::after {
    background: #ff5b91;
}

.exam-modal-reward__pin.is-new::before {
    border-color: rgba(255, 157, 58, 0.54);
    background: rgba(255, 248, 236, 0.99);
    box-shadow: 0 0 0 4px rgba(255, 157, 58, 0.12), 0 4px 12px rgba(255, 157, 58, 0.2);
}

.exam-modal-reward__pin.is-new::after {
    background: #ff9d3a;
}

.exam-modal-reward__progress {
    position: relative;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #ede8db;
}

.exam-modal-reward__progress span {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #59c66d 0%, #2ea855 100%);
    transition: width 0.24s ease;
}

.exam-modal-reward__progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: #1f6a36;
    letter-spacing: 0.01em;
    z-index: 1;
    pointer-events: none;
}

.exam-modal-reward__milestones {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.exam-modal-reward__milestone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    border: 1px solid #e5dfd1;
    border-radius: 7px;
    padding: 3px 8px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #8a8476;
    background: #fff;
}

.exam-modal-reward__milestone.is-claimed {
    border-style: solid;
    border-color: rgba(46, 168, 85, 0.26);
    background: rgba(46, 168, 85, 0.14);
    color: #1f6a36;
}

.exam-modal-reward__milestone.is-next {
    border-style: solid;
    border-color: rgba(255, 91, 145, 0.32);
    background: rgba(255, 91, 145, 0.12);
    color: #b12d60;
}

.exam-modal-reward__milestone.is-new {
    border-style: solid;
    border-color: rgba(255, 157, 58, 0.36);
    background: rgba(255, 157, 58, 0.16);
    color: #9a520a;
}

.exam-modal-reward__gift {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    border: 1px solid #d9eadb;
    border-radius: 10px;
    background: #f2fbf0;
}

.exam-modal-reward__gift-thumb {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 8px;
    background: #fff;
    display: grid;
    place-items: center;
    overflow: hidden;
    font-size: 0.7rem;
    font-weight: 900;
    color: #268549;
}

.exam-modal-reward__gift-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.exam-modal-reward__gift-copy {
    display: grid;
    gap: 0.18rem;
}

.exam-modal-reward__gift-copy strong,
.exam-modal-reward__gift-copy p {
    margin: 0;
}

.exam-modal-reward__gift-copy strong {
    font-size: 0.78rem;
    color: #2c5633;
}

.exam-modal-reward__gift-copy p {
    font-size: 0.82rem;
    color: rgba(31, 47, 30, 0.7);
    line-height: 1.45;
}

.exam-modal-arena {
    border-radius: 18px;
    border: 1px solid rgba(79, 134, 214, 0.18);
    background: linear-gradient(180deg, rgba(242, 248, 255, 0.98), rgba(255, 255, 255, 0.96));
    padding: 0.82rem 0.9rem;
    display: grid;
    gap: 0.62rem;
}

.exam-modal-arena__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
}

.exam-modal-arena__eyebrow {
    margin: 0 0 0.14rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(31, 47, 30, 0.54);
}

.exam-modal-arena__head h4,
.exam-modal-arena__meta,
.exam-modal-arena__tie,
.exam-modal-arena__empty {
    margin: 0;
}

.exam-modal-arena__head h4 {
    font-size: 1rem;
    font-weight: 800;
    color: rgba(31, 47, 30, 0.96);
}

.exam-modal-arena__rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    min-width: 64px;
    padding: 0.34rem 0.72rem;
    border-radius: 999px;
    background: rgba(79, 134, 214, 0.12);
    color: #245da8;
    font-size: 0.84rem;
    font-weight: 800;
    white-space: nowrap;
}

.exam-modal-arena__meta,
.exam-modal-arena__tie,
.exam-modal-arena__empty {
    color: rgba(31, 47, 30, 0.76);
    line-height: 1.5;
}

.exam-modal-arena__meta {
    font-size: 0.84rem;
    font-weight: 700;
}

.exam-modal-arena__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.48rem;
}

.exam-modal-arena__item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.72rem;
    padding: 0.65rem 0.78rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(79, 134, 214, 0.12);
}

.exam-modal-arena__item.is-me {
    border-color: rgba(63, 156, 70, 0.32);
    background: linear-gradient(180deg, rgba(242, 255, 242, 0.98), rgba(255, 255, 255, 0.96));
}

.exam-modal-arena__item-rank,
.exam-modal-arena__item-score {
    font-size: 0.82rem;
    font-weight: 800;
    color: rgba(31, 47, 30, 0.78);
}

.exam-modal-arena__item-name {
    min-width: 0;
    font-size: 0.92rem;
    font-weight: 800;
    color: rgba(31, 47, 30, 0.95);
}

.exam-modal-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.exam-modal-overview-item {
    border-radius: 12px;
    border: 1px solid #e5eae7;
    background: #fafcfb;
    padding: 8px 6px;
    display: flex;
    flex-direction: column-reverse;
    gap: 1px;
    align-items: center;
    justify-content: center;
}

.exam-modal-overview-item h4 {
    margin: 0;
    font-size: 0.65rem;
    font-weight: 700;
    color: #6b7e71;
}

.exam-modal-overview-item p {
    margin: 0;
    font-size: 1.3rem;
    line-height: 1.2;
    font-weight: 900;
    color: #284333;
}

.exam-modal-overview-item--good {
    background: #edf8f0;
    border-color: #d8eede;
}

.exam-modal-overview-item--warn {
    background: #fff3eb;
    border-color: #f3e0d2;
}

.exam-modal-overview-item--muted {
    background: #f2f5f8;
    border-color: #e0e7ed;
}

.exam-modal-sections {
    display: grid;
    gap: 8px;
}

.exam-modal-section-score {
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid #edf1ee;
    background: none;
    padding: 5px 0 9px;
    display: grid;
    gap: 4px;
}

.exam-modal-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.65rem;
}

.exam-modal-section-score h4 {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 800;
    color: #3a5142;
}

.exam-modal-section-score strong {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 900;
    color: #2c6943;
    font-variant-numeric: tabular-nums;
}

.exam-modal-section-meta {
    margin: 0;
    font-size: 0.7rem;
    color: #819086;
}

.exam-modal-section-bar {
    position: relative;
    height: 5px;
    border-radius: 999px;
    background: #edf2ee;
    overflow: hidden;
}

.exam-modal-section-bar span {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #2ea855 0%, #27b99b 100%);
}

.exam-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid #edf1ee;
    background: #fafcfb;
}



/* The shareable result is a 16:9 card; actions stay outside the image. */
.exam-result-capture {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #fff;
}

.exam-modal-head .exam-modal-close {
    color: #718478;
    background: #f3f7f4;
    border: 1px solid #e3ebe5;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
}

.exam-modal-head .exam-modal-close:hover,
.exam-modal-head .exam-modal-close:focus-visible {
    background: #e2f1e7;
    outline: 2px solid #82bd95;
    outline-offset: 2px;
}

.exam-modal-exam-name { color: #8a988f; font-weight: 600; }

.exam-modal-brand {
    margin-left: auto;
    width: 126px;
    height: auto;
}

.exam-modal-details {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.exam-modal-detail-title {
    margin: 0 0 2px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8a988f;
}

.exam-modal-score-ring {
    position: relative;
    width: 204px;
    aspect-ratio: 1;
    flex-shrink: 0;
    display: grid;
    place-items: center;
}

.exam-modal-score-orbit { position: absolute; inset: 0; width: 100%; height: 100%; }
.exam-modal-score-inner { position: relative; text-align: center; }
.exam-modal-score-label { display: block; margin-bottom: 10px; font-size: 0.68rem; font-weight: 800; color: #809586; }
.exam-modal-score-max { font-size: 1.1rem; font-weight: 700; color: #8da395; letter-spacing: 0; }
.exam-modal-summary-item + .exam-modal-summary-item { border-left: 1px solid #d5e9dc; }
.exam-modal-actions .btn { min-height: 42px; gap: 8px; }
.exam-modal-download-icon { width: 17px; height: 17px; flex-shrink: 0; }
.exam-modal-export-status { margin: 0 auto 0 0; color: #718478; font-size: 0.75rem; }
.exam-modal-export-status:empty { display: none; }
.exam-modal-actions .btn:disabled { opacity: 0.65; cursor: wait; }
.exam-modal [hidden] { display: none !important; }
.exam-modal-arena { padding: 10px 14px; gap: 5px; }
.exam-modal-arena__head { align-items: center; gap: 8px; }
.exam-modal-arena__eyebrow { margin: 0 0 2px; font-size: 0.58rem; }
.exam-modal-arena__head h4 { font-size: 0.82rem; }
.exam-modal-arena__rank { font-size: 1rem; min-width: 36px; padding: 4px 8px; }
.exam-modal-arena__meta { margin: 0; font-size: 0.68rem; line-height: 1.35; }
.exam-modal-arena__tie, .exam-modal-arena__empty { font-size: 0.63rem; line-height: 1.35; }
.exam-modal-arena__list { gap: 4px; max-height: 80px; overflow-y: auto; }
.exam-modal-arena__item { padding: 4px 8px; }
.exam-modal-arena__item-name, .exam-modal-arena__item-rank, .exam-modal-arena__item-score { font-size: 0.7rem; }
.exam-modal-details:has(.exam-modal-arena:not([hidden])) { gap: 10px; }

@media (max-width: 1100px) and (min-width: 701px) {
    .exam-result-capture { padding: 20px; gap: 14px; }
    .exam-modal-body { gap: 18px; grid-template-columns: 230px minmax(0, 1fr); }
    .exam-modal-details { gap: 10px; }
    .exam-modal-hero { padding: 18px 12px; gap: 14px; }
    .exam-modal-score-ring { width: 180px; }
    .exam-modal-score { font-size: 3.75rem; }
    .exam-modal-overview-item { padding: 6px; }
    .exam-modal-sections { gap: 4px; }
    .exam-modal-section-score { padding: 3px 0 6px; }
    .exam-modal-reward { gap: 5px 10px; padding: 10px 12px; }
}

@media (max-width: 900px) and (min-width: 701px) {
    .exam-result-capture { padding: 12px; gap: 8px; }
    .exam-modal-head { min-height: 36px; }
    .exam-modal-head h3 { font-size: 1rem; }
    .exam-modal-student-avatar { width: 36px; height: 36px; border-radius: 12px; }
    .exam-modal-student-name { font-size: 0.7rem; }
    .exam-modal-brand { width: 100px; }
    .exam-modal-body { grid-template-columns: 180px minmax(0, 1fr); gap: 14px; }
    .exam-modal-hero { padding: 12px; gap: 10px; }
    .exam-modal-score-ring { width: 138px; }
    .exam-modal-score { font-size: 2.8rem; }
    .exam-modal-score-label { font-size: 0.56rem; margin-bottom: 5px; }
    .exam-modal-score-max { font-size: 0.85rem; }
    .exam-modal-badge { padding: 4px 10px; font-size: 0.7rem; }
    .exam-modal-accuracy { font-size: 0.68rem; }
    .exam-modal-summary-grid { padding-top: 10px; }
    .exam-modal-summary-value { font-size: 0.82rem; }
    .exam-modal-summary-label, .exam-modal-summary-lead { font-size: 0.62rem; }
    .exam-modal-details { gap: 8px; }
    .exam-modal-overview-item { padding: 4px; }
    .exam-modal-overview-item p { font-size: 1.1rem; }
    .exam-modal-overview-item h4 { font-size: 0.6rem; }
    .exam-modal-sections { gap: 3px; }
    .exam-modal-detail-title { font-size: 0.58rem; }
    .exam-modal-section-score { padding: 2px 0 4px; gap: 2px; }
    .exam-modal-section-score h4, .exam-modal-section-score strong { font-size: 0.72rem; }
    .exam-modal-section-meta { font-size: 0.6rem; }
    .exam-modal-section-bar { height: 4px; }
    .exam-modal-reward { padding: 8px 10px; gap: 4px 8px; }
    .exam-modal-reward__eyebrow { font-size: 0.54rem; }
    .exam-modal-reward__head h4 { font-size: 0.72rem; }
    .exam-modal-reward__status { padding: 4px 7px; font-size: 0.63rem; }
    .exam-modal-reward__message, .exam-modal-reward__meta { font-size: 0.62rem; }
    .exam-modal-reward__milestone { font-size: 0.58rem; padding: 2px 6px; }
    .exam-modal-reward__gift { padding: 4px 6px; }
    .exam-modal-reward__gift-thumb { width: 24px; height: 24px; }
}

@media (max-width: 700px) {
    .exam-modal { padding: 10px; }
    .exam-modal-card { width: min(540px, calc(100vw - 20px)); max-height: calc(100dvh - 20px); border-radius: 20px; }
    .exam-result-capture { aspect-ratio: auto; padding: 18px; gap: 16px; }
    .exam-modal-head { min-height: 42px; gap: 10px; }
    .exam-modal-head h3 { font-size: 1.05rem; }
    .exam-modal-student-avatar { width: 40px; height: 40px; border-radius: 12px; }
    .exam-modal-student-name { font-size: 0.75rem; }
    .exam-modal-brand { display: none; }
    .exam-modal-body { grid-template-columns: 1fr; gap: 18px; }
    .exam-modal-hero { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 8px 14px; padding: 14px 12px; }
    .exam-modal-score-ring { grid-row: 1 / 3; width: 128px; }
    .exam-modal-score { font-size: 2.6rem; }
    .exam-modal-score-label { font-size: 0.58rem; margin-bottom: 6px; }
    .exam-modal-score-max { font-size: 0.85rem; }
    .exam-modal-hero-meta { align-self: end; gap: 5px; }
    .exam-modal-badge { font-size: 0.7rem; padding: 5px 10px; white-space: normal; text-align: center; }
    .exam-modal-accuracy { font-size: 0.7rem; }
    .exam-modal-summary { align-self: start; gap: 8px; }
    .exam-modal-summary-grid { padding-top: 10px; }
    .exam-modal-summary-label { font-size: 0.61rem; }
    .exam-modal-summary-value { font-size: 0.86rem; }
    .exam-modal-summary-lead { font-size: 0.64rem; }
    .exam-modal-details { gap: 16px; }
    .exam-modal-overview { gap: 7px; }
    .exam-modal-overview-item h4 { font-size: 0.61rem; }
    .exam-modal-overview-item p { font-size: 1.2rem; }
    .exam-modal-reward { padding: 12px; gap: 7px; }
    .exam-modal-reward__head { gap: 8px; }
    .exam-modal-reward__head h4 { font-size: 0.78rem; }
    .exam-modal-reward__message { grid-column: 1 / -1; grid-row: auto; font-size: 0.7rem; }
    .exam-modal-reward__meta { grid-column: 1 / -1; grid-row: auto; text-align: left; font-size: 0.67rem; }
    .exam-modal-reward__milestone { padding: 3px 6px; font-size: 0.64rem; }
    .exam-modal-actions { position: sticky; bottom: 0; padding: 12px 18px max(12px, env(safe-area-inset-bottom)); flex-wrap: wrap; }
    .exam-modal-actions .btn { flex: 1; font-size: 0.8rem; padding: 0.5rem 0.7rem; white-space: nowrap; }
    .exam-modal-export-status { flex-basis: 100%; }
}


.exam-modal .btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 999px;
    min-height: 40px;
    padding: 0.48rem 1rem;
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.exam-modal .btn:hover,
.exam-modal .btn:focus-visible {
    transform: translateY(-1px);
    outline: none;
}

.exam-modal .btn.primary {
    color: #fff;
    border-color: rgba(27, 122, 52, 0.72);
    background: #1f8f3d;
    box-shadow: 0 12px 22px rgba(31, 132, 63, 0.26);
}

.exam-modal .btn.primary:hover,
.exam-modal .btn.primary:focus-visible {
    background: #177033;
    box-shadow: 0 16px 28px rgba(26, 110, 52, 0.3);
}

.exam-modal .btn.ghost {
    color: rgba(31, 47, 30, 0.82);
    border-color: rgba(31, 47, 30, 0.2);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 16px rgba(31, 47, 30, 0.1);
}


body.modal-open { overflow: hidden; }
.exam-modal, .exam-modal button, .exam-modal a { font-family: 'Nunito', sans-serif; }
