/* ──────────────────────────────────────────────────────────────────────
   OWC Knowledge Quest — mobile-first stylesheet.
   Design language borrowed from QualifyIQ's public assessment:
   slate-50 canvas, white cards, 16px radii, sticky progress header,
   sticky thumb-reach footer, >=48px tap targets.
   ────────────────────────────────────────────────────────────────────── */

:root {
    --bg:            #f8fafc;
    --surface:       #ffffff;
    --surface-soft:  #f1f5f9;
    --border:        #e2e8f0;
    --border-strong: #cbd5e1;
    --text:          #0f172a;
    --muted:         #475569;
    --faint:         #94a3b8;

    --primary:       #0b4f6c;
    --primary-dark:  #083a50;
    --primary-soft:  #e6f1f6;
    --accent:        #2563eb;
    --success:       #16a34a;
    --success-soft:  #f0fdf4;
    --danger:        #dc2626;
    --danger-soft:   #fef2f2;

    --radius:        16px;
    --radius-lg:     24px;
    --radius-sm:     10px;
    --shadow:        0 1px 2px rgba(15, 23, 42, .04);
    --shadow-lg:     0 10px 30px rgba(15, 23, 42, .07);

    --tap:           52px;
}

* { box-sizing: border-box; }

html {
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100dvh;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }

.shell {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.wrap {
    width: 100%;
    max-width: 44rem;
    margin: 0 auto;
    padding: 0 16px;
}

/* ── Sticky progress header ─────────────────────────────────────────── */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 10px 0 12px;
}

.topbar-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    color: var(--muted);
}

.topbar-chapter { font-weight: 600; color: var(--text); }

.topbar-count {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--faint);
    font-size: 12px;
}

.topbar-sub {
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--faint);
    margin: 1px 0 0;
}

.bar {
    margin-top: 9px;
    height: 6px;
    border-radius: 999px;
    background: var(--surface-soft);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--primary);
    transition: width .35s ease;
}

/* Chapter pips */
.pips { display: flex; gap: 6px; margin-top: 10px; }

.pip {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: var(--border);
    text-decoration: none;
}

.pip.is-done    { background: var(--success); }
.pip.is-current { background: var(--primary); }

/* Chapters ahead of the current one are not reachable yet. */
.pip.is-locked {
    background: var(--border);
    opacity: .5;
    cursor: not-allowed;
}

/* ── Main ───────────────────────────────────────────────────────────── */

.main { flex: 1 1 auto; padding: 22px 0 28px; }

.page-head { margin-bottom: 22px; }

.eyebrow {
    font-size: 11px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--faint);
    margin: 0 0 6px;
    font-weight: 600;
}

h1 { font-size: 26px; line-height: 1.25; margin: 0 0 8px; letter-spacing: -.02em; }
h2 { font-size: 19px; line-height: 1.3;  margin: 0 0 6px; letter-spacing: -.01em; }

.lede { color: var(--muted); margin: 0; font-size: 15px; }

/* ── Cards ──────────────────────────────────────────────────────────── */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 14px;
}

.card-lg { border-radius: var(--radius-lg); padding: 24px 20px; box-shadow: var(--shadow-lg); }

/* ── Question blocks ────────────────────────────────────────────────── */

.q {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 12px;
    scroll-margin-top: 110px;
    transition: border-color .2s ease;
}

.q.is-answered { border-color: #bbf7d0; }

/* The question the student was sent back to answer. */
.q.is-missing {
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, .18);
    animation: nudge .5s ease;
}

.q.is-missing .q-num { background: #fef3c7; color: #92400e; }

@keyframes nudge {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-4px); }
    75%      { transform: translateX(4px); }
}

.q-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }

.q-num {
    flex: 0 0 auto;
    min-width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
    padding: 0 6px;
    transition: background .2s ease, color .2s ease;
}

.q.is-answered .q-num { background: var(--success); color: #fff; }

.q-prompt {
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--text);
}

.q-body { display: flex; flex-direction: column; gap: 10px; }

/* Labelled / numbered sub-answers */
.sub { display: flex; align-items: center; gap: 10px; }

.sub-label {
    flex: 0 0 auto;
    min-width: 26px;
    font-weight: 700;
    color: var(--primary);
    font-size: 14px;
}

.sub-label.is-wide {
    min-width: 0;
    flex: 0 0 100%;
    font-weight: 600;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: -4px;
}

.sub.is-stacked { flex-wrap: wrap; }

/* ── Inputs ─────────────────────────────────────────────────────────── */

.input, .textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 16px; /* 16px stops iOS Safari zooming on focus */
    line-height: 1.5;
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
    -webkit-appearance: none;
}

.input { min-height: 48px; }

.textarea {
    min-height: 92px;
    resize: vertical;
    overflow: hidden; /* JS auto-grows it */
}

.input:focus, .textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11, 79, 108, .13);
}

.input::placeholder, .textarea::placeholder { color: #b6c2cf; }

/* True / False */
.tf { display: flex; gap: 10px; }

.tf-opt { flex: 1 1 0; }

.tf-opt input { position: absolute; opacity: 0; pointer-events: none; }

.tf-opt span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--tap);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 16px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: all .15s ease;
    user-select: none;
}

.tf-opt input:checked + span {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(11, 79, 108, .25);
}

.tf-opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(11, 79, 108, .25); }

/* ── Sticky footer ──────────────────────────────────────────────────── */

.footbar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border);
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
}

.footbar-row { display: flex; align-items: center; gap: 10px; }

.savestate {
    text-align: center;
    font-size: 12px;
    color: var(--faint);
    margin: 7px 0 0;
    min-height: 16px;
    transition: color .2s ease;
}

.savestate.is-saving { color: var(--muted); }
.savestate.is-saved  { color: var(--success); }
.savestate.is-error  { color: var(--danger); }

/* ── Buttons ────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--tap);
    padding: 0 20px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: var(--primary);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, transform .08s ease, opacity .15s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn:hover  { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }

.btn:focus-visible { outline: 3px solid rgba(11, 79, 108, .35); outline-offset: 2px; }

.btn-block { width: 100%; }
.btn-grow  { flex: 1 1 auto; }

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: var(--border-strong);
    padding: 0 16px;
    flex: 0 0 auto;
}

.btn-ghost:hover { background: var(--surface-soft); color: var(--text); }

.btn-success { background: var(--success); }
.btn-success:hover { background: #15803d; }

.btn[disabled], .btn[aria-disabled="true"] {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-sm { min-height: 40px; font-size: 14px; padding: 0 14px; border-radius: 12px; }

/* Chapter not finished yet. Still tappable on purpose — tapping it is how the
   student gets taken to the question they missed. */
.btn.is-gated {
    background: var(--surface);
    color: var(--muted);
    border-color: var(--border-strong);
}

.btn.is-gated:hover { background: var(--surface-soft); color: var(--text); }

/* ── Notices ────────────────────────────────────────────────────────── */

.notice {
    border-radius: var(--radius);
    padding: 13px 15px;
    font-size: 14.5px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    line-height: 1.55;
}

.notice-info    { background: var(--primary-soft); border-color: #cfe3ec; color: #0a4257; }
.notice-success { background: var(--success-soft); border-color: #bbf7d0; color: #14532d; }
.notice-error   { background: var(--danger-soft);  border-color: #fecaca; color: #991b1b; }
.notice-warn    { background: #fffbeb;             border-color: #fde68a; color: #854d0e; }

.notice strong { font-weight: 700; }

/* ── Login ──────────────────────────────────────────────────────────── */

.centered {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 0;
}

.brandmark {
    text-align: center;
    margin-bottom: 22px;
}

.brandmark .eyebrow { margin-bottom: 8px; }

.field { margin-bottom: 16px; }

.label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.hint { font-size: 12.5px; color: var(--faint); margin: 6px 0 0; line-height: 1.5; }

/* ── Review list ────────────────────────────────────────────────────── */

.chapter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    margin-bottom: 10px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: border-color .15s ease, transform .08s ease;
}

.chapter-row:hover { border-color: var(--border-strong); }
.chapter-row:active { transform: translateY(1px); }

.chapter-row-main { flex: 1 1 auto; min-width: 0; }

/* Both must be block: as inline spans they sat on one line for short
   subtitles and wrapped for long ones, so no two rows lined up. */
.chapter-row-title {
    display: block;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.35;
}

.chapter-row-sub {
    display: block;
    font-size: 12.5px;
    color: var(--faint);
    margin-top: 1px;
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tally {
    flex: 0 0 auto;
    font-size: 12.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    white-space: nowrap;
}

.tally.is-complete { background: var(--success-soft); color: #15803d; }

.chev { flex: 0 0 auto; color: var(--faint); font-size: 18px; line-height: 1; }

/* ── Misc ───────────────────────────────────────────────────────────── */

.stack-gap { height: 10px; }

.center { text-align: center; }

.muted { color: var(--muted); }

.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.big-tick {
    width: 64px; height: 64px;
    border-radius: 999px;
    background: var(--success-soft);
    color: var(--success);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 700;
    margin: 0 auto 18px;
    border: 2px solid #bbf7d0;
}

@media (min-width: 640px) {
    h1 { font-size: 30px; }
    .main { padding: 30px 0 36px; }
    .q { padding: 20px; }
    .card-lg { padding: 30px 28px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ══════════════════════════════════════════════════════════════════════
   Manual reader
   ══════════════════════════════════════════════════════════════════════ */

.reader {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #0e1a22;          /* dark surround makes the pages pop */
    overscroll-behavior: none;
}

/* ── Bars ───────────────────────────────────────────────────────────── */

.rbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(10, 22, 30, .96);
    backdrop-filter: blur(8px);
    color: #e6eef3;
    z-index: 10;
}

.rbar-top    { border-bottom: 1px solid rgba(255, 255, 255, .08); }
.rbar-bottom {
    border-top: 1px solid rgba(255, 255, 255, .08);
    flex-direction: column;
    gap: 4px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

.rbar-mid {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.rbar-chapter {
    font-size: 13.5px;
    font-weight: 600;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rbar-page {
    font-size: 11.5px;
    color: #8fa9b8;
    font-variant-numeric: tabular-nums;
    margin-top: 1px;
}

.rbtn {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 11px;
    background: rgba(255, 255, 255, .08);
    color: #e6eef3;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.rbtn:hover { background: rgba(255, 255, 255, .15); }

.ico-lines, .ico-exit {
    display: block;
    width: 17px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    position: relative;
}
.ico-lines::before, .ico-lines::after {
    content: ""; position: absolute; left: 0; width: 17px; height: 2px;
    background: currentColor; border-radius: 2px;
}
.ico-lines::before { top: -5px; }
.ico-lines::after  { top: 5px; }

.ico-exit { width: 15px; height: 15px; background: none; border: 2px solid currentColor;
            border-radius: 4px; border-right-color: transparent; }

/* ── Stage ──────────────────────────────────────────────────────────── */

.rstage {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 8px;
}

.flipwrap { margin: 0 auto; }

.pf-page { background: #fff; overflow: hidden; }

.pf-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;      /* taps go to the flip handler, not the image */
}

/* No-JS / library-missing fallback: just show the page. */
.flipwrap.is-plain { display: block; max-height: 100%; }
.flipwrap.is-plain .pf-page { display: none; }
.flipwrap.is-plain .pf-page:has(img[src]) { display: block; max-height: 100%; }
.flipwrap.is-plain .pf-img { max-height: 78vh; width: auto; margin: 0 auto; }

/* Edge tap targets for turning pages */
.rnav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15%;
    max-width: 90px;
    border: 0;
    background: transparent;
    cursor: pointer;
    z-index: 5;
    -webkit-tap-highlight-color: transparent;
}
.rnav-prev { left: 0; }
.rnav-next { right: 0; }

@media (hover: hover) {
    .rnav:hover { background: linear-gradient(to right, rgba(255,255,255,.05), transparent); }
    .rnav-next:hover { background: linear-gradient(to left, rgba(255,255,255,.05), transparent); }
}

/* ── Slider ─────────────────────────────────────────────────────────── */

.rslider {
    width: 100%;
    appearance: none;
    height: 26px;
    background: transparent;
    cursor: pointer;
}
.rslider::-webkit-slider-runnable-track {
    height: 4px; border-radius: 999px; background: rgba(255,255,255,.18);
}
.rslider::-webkit-slider-thumb {
    appearance: none; width: 18px; height: 18px; border-radius: 999px;
    background: #fff; margin-top: -7px; border: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.rslider::-moz-range-track { height: 4px; border-radius: 999px; background: rgba(255,255,255,.18); }
.rslider::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 999px; background: #fff; }

.rhint {
    margin: 0;
    min-height: 15px;
    font-size: 12px;
    color: #8fa9b8;
    text-align: center;
}
.rhint.is-lock { color: #fbbf24; }

/* ── Toast ──────────────────────────────────────────────────────────── */

.toast {
    position: absolute;
    left: 50%;
    bottom: 86px;
    transform: translateX(-50%);
    background: rgba(11, 79, 108, .97);
    color: #fff;
    padding: 11px 14px 11px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 20;
    box-shadow: 0 6px 20px rgba(0,0,0,.35);
    max-width: calc(100% - 32px);
}
.toast-x {
    border: 0; background: transparent; color: #a9d3e6;
    font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px;
}

/* ── Contents drawer ────────────────────────────────────────────────── */

/* [hidden] sets display:none, but any explicit display wins over it — so the
   attribute has to be honoured explicitly or the drawer never closes. */
.drawer[hidden] { display: none; }

.drawer {
    position: fixed;
    inset: 0;
    background: rgba(5, 12, 17, .6);
    z-index: 30;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.drawer-sheet {
    width: 100%;
    max-width: 34rem;
    max-height: 85vh;
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.drawer-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 10px;
    border-bottom: 1px solid var(--border);
}
.drawer-head h2 { margin: 0; font-size: 17px; }
.drawer-head .rbtn { background: var(--surface-soft); color: var(--muted); }

.drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 10px 12px calc(16px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
}

.ch-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    text-decoration: none;
    color: inherit;
    background: var(--surface);
}
.ch-row:hover    { border-color: var(--border-strong); }
.ch-row.is-here  { border-color: var(--primary); background: var(--primary-soft); }
.ch-row.is-locked { opacity: .55; background: var(--surface-soft); cursor: not-allowed; }

.ch-main  { flex: 1 1 auto; min-width: 0; }
.ch-title { display: block; font-weight: 600; font-size: 15px; }
.ch-sub   { display: block; font-size: 12.5px; color: var(--faint); margin-top: 2px; }

.ch-tick { flex: 0 0 auto; color: var(--success); font-weight: 700; font-size: 16px; }
.ch-lock { flex: 0 0 auto; font-size: 14px; }

@media (min-width: 640px) {
    .drawer { align-items: center; }
    .drawer-sheet { border-radius: 20px; max-height: 80vh; }
}

/* Review call-to-action, shown on the last page of an unreviewed chapter. */
.reviewcta {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    width: min(26rem, calc(100% - 28px));
    background: rgba(255, 255, 255, .97);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
    z-index: 15;
}

.reviewcta[hidden] { display: none; }

.reviewcta-txt {
    margin: 0 0 11px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    text-align: center;
}

/* Review link inside the contents drawer */
.ch-review {
    display: block;
    margin: -4px 0 8px 14px;
    padding: 9px 13px;
    border-left: 2px solid var(--primary);
    border-radius: 0 10px 10px 0;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.ch-review:hover { background: #d9ebf3; }

.ch-review.is-done {
    border-left-color: var(--success);
    background: var(--success-soft);
    color: #15803d;
}

/* ── Zoom ───────────────────────────────────────────────────────────── */

.zoomctl {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(10, 22, 30, .85);
    backdrop-filter: blur(6px);
    border-radius: 999px;
    padding: 4px;
    z-index: 16;
}

.zbtn {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #e6eef3;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.zbtn:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.zbtn:disabled { opacity: .35; cursor: default; }

.zlvl {
    min-width: 46px;
    text-align: center;
    font-size: 12px;
    color: #a8c0cd;
    font-variant-numeric: tabular-nums;
    user-select: none;
}

/* The flip canvas is transformed, so it must not be clipped by the stage. */
.flipwrap { transition: transform .18s ease-out; will-change: transform; }

.reader.is-zoomed .flipwrap { transition: none; }      /* panning must not lag */
.reader.is-zoomed .rstage   { cursor: grab; overflow: hidden; }
.reader.is-zoomed .rstage:active { cursor: grabbing; }

/* Edge tap-to-turn would fight panning while zoomed. */
.reader.is-zoomed .rnav { display: none; }

/* Final-exam banner, shown in the reader once the course work is done. */
.examcta {
    position: absolute;
    left: 50%;
    top: 12px;
    transform: translateX(-50%);
    width: min(26rem, calc(100% - 28px));
    background: rgba(255, 255, 255, .97);
    border: 1px solid var(--success);
    border-radius: var(--radius);
    padding: 13px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
    z-index: 14;
}

/* ── Result panel (exam result) ───────────────────────────────────────── */

.scorepanel {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border-radius: var(--radius);
    border: 1.5px solid;
    margin: 20px 0 18px;
}

.scorepanel.is-pass { background: var(--success-soft); border-color: #bbf7d0; }
.scorepanel.is-fail { background: var(--danger-soft);  border-color: #fecaca; }

.score-verdict {
    flex: 0 0 auto;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 2px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff;
}

.is-pass .score-verdict { color: #15803d; }
.is-fail .score-verdict { color: #b91c1c; }

.score-figures { flex: 1 1 auto; min-width: 0; }

.score-big {
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.score-big span { font-size: 18px; color: var(--faint); font-weight: 600; }

.score-sub { font-size: 13px; color: var(--muted); margin-top: 5px; }

