/* ==========================================================================
   PDF quiz mode
   --------------------------------------------------------------------------
   A fixed two-pane overlay: the exam PDF on the left, the answer sheet on the
   right. The surfaces and controls come from css/primitives.css — .card
   .card--row .card--sunken for an answer row, .btn for every button — so what
   is left here is the overlay geometry.

   This file used to be 100% !important, because the dead neon block that step 2
   removed from styles.css was fighting it, and a second copy of these same
   overrides sat in styles.css fighting both. Only .pdf-quiz-layout still needs
   it: it has to escape whatever the page around it is doing.
   ========================================================================== */

/* The one place !important is load-bearing: this pane covers the running app,
   so no page-level layout rule may reach inside it. */
.pdf-quiz-layout {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 999999;
    display: flex !important;
    flex-direction: row;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    background: var(--canvas);
    visibility: visible;
    opacity: 1;
}

.pdf-viewer-side {
    position: relative;
    flex: 1;
    height: 100vh;
    background: var(--accent-wash);
    border-right: 1px solid var(--line);
}

.pdf-viewer-side iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* A full-height layout region, not a floating panel: the border separates it
   from the viewer, so the -10px/30px cast shadow it used to have was carrying
   no information. */
.pdf-answers-side {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    width: 320px;
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--line);
}

.pdf-side-header {
    padding: var(--space-4);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.pdf-header-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.pdf-back-btn {
    align-self: flex-start;
}

/* Time remaining: a readout, so the digits are monospaced and the label is a
   quiet uppercase kicker. */
.pdf-timer-pill {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    color: var(--accent);
    background: var(--surface-sunken);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.pdf-timer-pill span {
    font-size: var(--fs-eyebrow);
    font-weight: 800;
    letter-spacing: var(--ls-label);
    text-transform: uppercase;
}

.pdf-timer-pill strong {
    font-family: var(--font-mono);
    font-size: var(--fs-lg);
    font-weight: 800;
}

/* Was --fs-md at opacity .8 — an unmanaged colour faked with transparency. It is
   --ink-soft now, and it stays at --fs-base so the panel title is not smaller
   than the question numbers under it. */
.pdf-title-area h3 {
    margin: 0;
    color: var(--ink-soft);
    font-size: var(--fs-base);
    font-weight: 700;
    text-align: center;
}

.pdf-answer-scroll {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
}

/* Surface, padding and the flex row come from .card .card--row .card--sunken. */
.pdf-answer-row {
    justify-content: space-between;
}

.pdf-answer-row + .pdf-answer-row {
    margin-top: var(--space-3);
}

.pdf-q-num {
    min-width: 25px;
    color: var(--muted);
    font-size: var(--fs-base);
    font-weight: 700;
}

.pdf-answer-options {
    display: flex;
    gap: var(--space-2);
}

/* A square answer toggle. .btn .btn--secondary carries the surface, the border,
   the hover and the focus ring; only the square geometry is local. */
.pdf-opt-btn {
    width: 44px;
    min-height: 44px;
    padding: 0;
}

.pdf-opt-btn.selected {
    color: var(--surface);
    background: var(--accent);
    border-color: var(--accent);
}

.pdf-side-footer {
    padding: var(--space-4);
    border-top: 1px solid var(--line);
}

@media (max-width: 800px) {
    .pdf-quiz-layout {
        flex-direction: column;
        overflow-y: auto;
    }

    .pdf-viewer-side {
        flex: 0 0 48vh;
        width: 100%;
        min-height: 48vh;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .pdf-answers-side {
        width: 100%;
        height: auto;
        min-height: 52vh;
        border-left: 0;
    }
}
