/* ==========================================================================
   quiz.css — the per-topic interactive quiz.

   Everything is scoped under .qz. The quiz shares a document with the site
   navigation, the floating video stage and (on the syllabus page) whatever CSS
   a lesson body brought with it, so a bare `.card` or `li` rule here would leak
   straight into them.
   ========================================================================== */

.qz {
    --qz-navy:  #1a1d23;
    --qz-green: #2ecc71;
    --qz-green-dark: #219a52;
    --qz-amber: #f39c12;
    --qz-red:   #e74c3c;
    --qz-line:  #e2e8f0;
    --qz-muted: #64748b;
    --qz-purple:#9b59b6;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: #2d3748;
}
.qz *, .qz *::before, .qz *::after { box-sizing: border-box; }

/* --------------------------------------------------------------- shell --- */

.qz-wrap { width: 92%; max-width: 900px; margin: 0 auto; padding: 34px 0 70px; }
.qz-wrap--wide { max-width: 1100px; }

.qz-head { margin-bottom: 24px; }
.qz-crumb {
    font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--qz-muted);
    text-decoration: none; display: inline-block; margin-bottom: 10px;
}
.qz-crumb:hover { color: var(--qz-navy); }
.qz-head h1 { margin: 0 0 8px; font-size: 1.9rem; color: var(--qz-navy); line-height: 1.25; }
.qz-head .qz-sub { margin: 0; color: var(--qz-muted); font-size: 0.95rem; }

.qz-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.qz-badge {
    display: inline-flex; align-items: center; gap: 7px;
    background: #fff; border: 1px solid var(--qz-line);
    padding: 6px 13px; border-radius: 999px;
    font-size: 0.8rem; font-weight: 600; color: #445;
}
.qz-badge i { color: var(--qz-green); }
.qz-badge--alevel i { color: var(--qz-purple); }

/* ---------------------------------------------------------------- card --- */

.qz-card {
    background: #fff; border: 1px solid var(--qz-line); border-radius: 16px;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
    padding: 26px; margin-bottom: 22px;
}
.qz-card h2 {
    margin: 0 0 6px; font-size: 1.15rem; color: var(--qz-navy);
    display: flex; align-items: center; gap: 10px;
}
.qz-card > p { color: var(--qz-muted); font-size: 0.92rem; margin: 0 0 18px; }

/* ------------------------------------------------------------ progress --- */

.qz-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.qz-bar { flex: 1; height: 8px; background: #eef2f6; border-radius: 999px; overflow: hidden; }
.qz-bar span {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, var(--qz-green), #27ae60);
    border-radius: 999px; transition: width 0.35s ease;
}
.qz-step { font-size: 0.8rem; font-weight: 800; color: var(--qz-muted); white-space: nowrap; }

/* ------------------------------------------------------------ question --- */

.qz-q { display: none; }
.qz-q.is-active { display: block; animation: qz-in 0.25s ease; }
@keyframes qz-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.qz-q-meta {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 0.7rem; font-weight: 800; letter-spacing: 0.07em;
    text-transform: uppercase; color: var(--qz-muted); margin-bottom: 12px;
}
.qz-chip {
    background: #f1f5f9; border-radius: 5px; padding: 3px 9px; color: #475569;
}
.qz-chip--recall  { background: #e8f8ef; color: #1e8449; }
.qz-chip--apply   { background: #eef4fd; color: #2471a3; }
.qz-chip--stretch { background: #f6eefb; color: #7d3c98; }

.qz-prompt { font-size: 1.08rem; line-height: 1.6; color: #1f2933; margin-bottom: 18px; }
.qz-prompt code {
    background: #f1f5f9; padding: 2px 6px; border-radius: 4px;
    font-family: 'Consolas', 'Menlo', monospace; font-size: 0.92em;
}
.qz-hint {
    font-size: 0.82rem; color: var(--qz-muted); margin: -8px 0 16px;
    display: flex; align-items: center; gap: 7px;
}

/* ------------------------------------------------------- options (mcq) --- */

.qz-options { display: grid; gap: 10px; }
.qz-opt {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 13px 16px; border: 2px solid var(--qz-line); border-radius: 11px;
    background: #fff; cursor: pointer; text-align: left; width: 100%;
    font: inherit; color: inherit; line-height: 1.5;
    transition: border-color 0.15s, background 0.15s;
}
.qz-opt:hover { border-color: #b9c3cf; background: #fbfdff; }
.qz-opt .qz-key {
    flex: 0 0 26px; height: 26px; border-radius: 7px; background: #f1f5f9;
    display: grid; place-items: center; font-size: 0.78rem; font-weight: 800; color: #64748b;
}
.qz-opt.is-picked { border-color: var(--qz-green); background: #f2fcf6; }
.qz-opt.is-picked .qz-key { background: var(--qz-green); color: #fff; }

/* --------------------------------------------------- drag: order/ranking - */

.qz-order { display: grid; gap: 9px; counter-reset: qz-rank; }
.qz-drag {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 15px; border: 2px solid var(--qz-line); border-radius: 11px;
    background: #fff; cursor: grab; line-height: 1.45;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.qz-drag:active { cursor: grabbing; }
.qz-drag.is-dragging { opacity: 0.45; border-style: dashed; }
.qz-drag.is-over { border-color: var(--qz-green); box-shadow: 0 0 0 3px rgba(46,204,113,0.15); }
.qz-drag .qz-grip { color: #cbd5e1; flex: 0 0 auto; }
.qz-drag .qz-rank {
    flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--qz-navy); color: #fff;
    display: grid; place-items: center; font-size: 0.75rem; font-weight: 800;
}
.qz-drag .qz-drag-text { flex: 1; }
.qz-drag .qz-move {
    display: none; background: none; border: 1px solid var(--qz-line); border-radius: 6px;
    width: 28px; height: 28px; cursor: pointer; color: #64748b; font-size: 0.75rem;
}
/* Touch screens get buttons: HTML5 drag events do not fire there. */
.qz-touch .qz-drag .qz-move { display: inline-block; }
.qz-touch .qz-drag { cursor: default; }
.qz-drag .qz-move:hover { background: #f1f5f9; color: var(--qz-navy); }

/* ----------------------------------------------------------- drag: match - */

.qz-match { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.qz-match-col h4 {
    margin: 0 0 9px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.07em;
    text-transform: uppercase; color: var(--qz-muted);
}
.qz-bank-list { display: grid; gap: 9px; }
.qz-tile {
    padding: 11px 14px; border: 2px solid var(--qz-line); border-radius: 10px;
    background: #fff; cursor: grab; font-size: 0.92rem; line-height: 1.45;
}
.qz-tile.is-dragging { opacity: 0.45; }
.qz-tile.is-used { display: none; }
.qz-slot {
    min-height: 52px; display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border: 2px dashed #cbd5e1; border-radius: 10px;
    background: #f8fafc; font-size: 0.92rem; line-height: 1.45;
}
.qz-slot.is-over { border-color: var(--qz-green); background: #f2fcf6; }
.qz-slot.is-filled { border-style: solid; border-color: var(--qz-green); background: #fff; }
.qz-slot .qz-slot-hint { color: #94a3b8; font-size: 0.85rem; }
.qz-slot .qz-clear {
    margin-left: auto; background: none; border: none; color: #94a3b8;
    cursor: pointer; font-size: 0.85rem;
}
.qz-slot .qz-clear:hover { color: var(--qz-red); }
.qz-match-row { display: grid; gap: 9px; }
.qz-match-term {
    padding: 11px 14px; border-radius: 10px; background: var(--qz-navy); color: #fff;
    font-size: 0.9rem; font-weight: 600; line-height: 1.4;
}

/* --------------------------------------------- code / statement completion */

.qz-code {
    background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 18px 20px;
    font-family: 'Consolas', 'Menlo', 'Courier New', monospace;
    font-size: 0.92rem; line-height: 2.1; overflow-x: auto;
    white-space: pre; tab-size: 4;
}
.qz-code .qz-cmt { color: #64748b; }
.qz-blank {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 108px; height: 30px; padding: 0 10px; margin: 0 3px;
    border: 2px dashed #475569; border-radius: 7px; background: #1e293b;
    color: #f8fafc; font: inherit; text-align: center; vertical-align: middle;
    transition: border-color 0.15s, background 0.15s;
}
.qz-blank::placeholder { color: #64748b; }
.qz-blank:focus { outline: none; border-color: var(--qz-green); background: #16342a; }
.qz-blank.is-over { border-color: var(--qz-green); background: #16342a; }
.qz-blank.is-filled { border-style: solid; border-color: var(--qz-green); background: #16342a; }

.qz-tokens { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.qz-token {
    padding: 7px 13px; border-radius: 8px; background: #eef2f7;
    border: 1px solid #d8e0e9; cursor: grab;
    font-family: 'Consolas', 'Menlo', monospace; font-size: 0.85rem; color: #1f2933;
}
.qz-token:hover { background: #e2e8f0; }
.qz-token.is-dragging { opacity: 0.45; }
.qz-token.is-armed { background: var(--qz-green); border-color: var(--qz-green); color: #fff; }

/* ------------------------------------------------------------- controls --- */

.qz-nav { display: flex; align-items: center; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.qz-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 20px; border-radius: 10px; border: 1px solid #ccd3da;
    background: #fff; color: #2c3e50; font: inherit; font-weight: 700; font-size: 0.88rem;
    cursor: pointer; text-decoration: none; transition: background 0.15s, border-color 0.15s;
}
.qz-btn:hover:not(:disabled) { background: #f1f5f9; border-color: #9aa5b1; }
.qz-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.qz-btn--primary { background: var(--qz-green); border-color: var(--qz-green); color: #fff; }
.qz-btn--primary:hover:not(:disabled) { background: var(--qz-green-dark); border-color: var(--qz-green-dark); }
.qz-btn--dark { background: var(--qz-navy); border-color: var(--qz-navy); color: #fff; }
.qz-btn--dark:hover:not(:disabled) { background: #000; border-color: #000; }
.qz-spacer { flex: 1; }

.qz-dots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.qz-dot {
    width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--qz-line);
    background: #fff; color: #94a3b8; font-size: 0.75rem; font-weight: 800; cursor: pointer;
}
.qz-dot.is-answered { border-color: var(--qz-green); color: var(--qz-green-dark); background: #f2fcf6; }
.qz-dot.is-current { background: var(--qz-navy); border-color: var(--qz-navy); color: #fff; }

/* --------------------------------------------------------------- review --- */

.qz-score {
    display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
    padding: 24px; border-radius: 16px; color: #fff; margin-bottom: 22px;
    background: linear-gradient(135deg, #1a1d23, #2c3e50);
}
.qz-score .qz-ring {
    flex: 0 0 96px; width: 96px; height: 96px; border-radius: 50%;
    display: grid; place-items: center; font-size: 1.6rem; font-weight: 800;
    background: conic-gradient(var(--qz-green) calc(var(--pct) * 1%), rgba(255,255,255,0.14) 0);
    position: relative;
}
.qz-score .qz-ring::after {
    content: ''; position: absolute; inset: 8px; border-radius: 50%; background: #1a1d23;
}
.qz-score .qz-ring span { position: relative; z-index: 1; }
.qz-score h3 { margin: 0 0 6px; font-size: 1.3rem; }
.qz-score p { margin: 0; opacity: 0.8; font-size: 0.92rem; }

.qz-review-item {
    border: 1px solid var(--qz-line); border-left-width: 5px;
    border-radius: 12px; padding: 18px 20px; margin-bottom: 14px; background: #fff;
}
.qz-review-item.is-correct { border-left-color: var(--qz-green); }
.qz-review-item.is-partial { border-left-color: var(--qz-amber); }
.qz-review-item.is-wrong   { border-left-color: var(--qz-red); }
.qz-review-head {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.06em; margin-bottom: 10px;
}
.qz-verdict { padding: 3px 10px; border-radius: 999px; }
.is-correct .qz-verdict { background: #e8f8ef; color: #1e8449; }
.is-partial .qz-verdict { background: #fdf3e3; color: #b9770e; }
.is-wrong   .qz-verdict { background: #fdecea; color: #b03a2e; }
.qz-review-item .qz-q-text { font-size: 1rem; line-height: 1.55; margin-bottom: 12px; color: #1f2933; }
.qz-answer {
    background: #f8fafc; border-radius: 9px; padding: 12px 15px;
    font-size: 0.9rem; line-height: 1.6; margin-bottom: 10px;
}
.qz-answer strong { color: var(--qz-navy); }
.qz-answer ol, .qz-answer ul { margin: 7px 0 0; padding-left: 20px; }
.qz-why {
    font-size: 0.9rem; line-height: 1.6; color: #475569;
    border-left: 3px solid var(--qz-line); padding-left: 13px;
}

/* ---------------------------------------------------------- drill panel --- */

.qz-drill { border-top: 4px solid var(--qz-purple); }
.qz-drill h2 i { color: var(--qz-purple); }
.qz-wallet {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: #fdf9ef; border: 1px solid #f3e2bb; border-radius: 11px;
    padding: 12px 16px; font-size: 0.88rem; margin-bottom: 16px;
}
.qz-wallet i { color: #d4a017; }
.qz-wallet b { color: var(--qz-navy); }
.qz-wallet--empty { background: #fdecea; border-color: #f5c6c0; }
.qz-wallet--empty i { color: var(--qz-red); }
.qz-wallet a { color: var(--qz-green-dark); font-weight: 700; text-decoration: none; }
.qz-wallet a:hover { text-decoration: underline; }

.qz-sizes { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.qz-size {
    flex: 1 1 130px; padding: 14px; border: 2px solid var(--qz-line); border-radius: 12px;
    background: #fff; cursor: pointer; text-align: center; font: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.qz-size:hover:not(:disabled) { border-color: #b9c3cf; }
.qz-size.is-picked { border-color: var(--qz-purple); background: #faf5fd; }
.qz-size:disabled { opacity: 0.45; cursor: not-allowed; }
.qz-size .qz-size-n { display: block; font-size: 1.4rem; font-weight: 800; color: var(--qz-navy); }
.qz-size .qz-size-c { display: block; font-size: 0.76rem; color: var(--qz-muted); margin-top: 3px; }
/* Marks the option that is everything the topic holds, so a short ladder does
   not read as a bug. */
.qz-size .qz-size-all {
    display: block; margin-top: 6px; font-size: 0.66rem; font-weight: 800;
    letter-spacing: 0.05em; text-transform: uppercase; color: var(--qz-purple);
}

.qz-paper {
    border: 1px solid var(--qz-line); border-radius: 12px; padding: 20px;
    background: #fff; margin-top: 18px;
}
.qz-paper-q { padding: 16px 0; border-bottom: 1px dashed var(--qz-line); }
.qz-paper-q:last-child { border-bottom: none; }
.qz-paper-q img { max-width: 100%; height: auto; }
.qz-paper-meta {
    font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--qz-muted); margin-bottom: 8px;
    display: flex; gap: 10px; flex-wrap: wrap;
}
/* The saved-paper confirmation sits between the questions and the actions. */
.qz-paper > .qz-wallet { margin: 18px 0 0; background: #eefaf2; border-color: #c8e9d8; }
.qz-paper > .qz-wallet i { color: var(--qz-green-dark); }

/* ------------------------------------------------- printed paper heading --- */
/* A header, not a cover page: who set it, which topic, who sat it, and room
   to record the marks. Shown on screen too, because the title is editable. */

.qz-paper-head {
    border: 2px solid var(--qz-navy); border-radius: 10px;
    padding: 16px 18px; margin-bottom: 20px;
}
.qz-exam-name {
    margin: 0; font-size: 1.15rem; font-weight: 800; text-align: center;
    text-transform: uppercase; letter-spacing: 0.05em; color: var(--qz-navy);
    line-height: 1.35; border-radius: 6px; padding: 5px 10px; outline: none;
}
.qz-exam-name:hover { background: #fffdf0; box-shadow: 0 0 0 1px #e6cf8b inset; cursor: text; }
.qz-exam-name:focus { background: #fffdf0; box-shadow: 0 0 0 2px var(--qz-amber) inset; }
.qz-paper-sub {
    margin: 5px 0 0; text-align: center; font-size: 0.78rem;
    font-weight: 700; letter-spacing: 0.04em; color: var(--qz-muted);
    text-transform: uppercase;
}
.qz-edit-hint {
    margin: 9px 0 0; text-align: center; font-size: 0.75rem; color: #94a3b8;
}
.qz-edit-hint i { margin-right: 5px; }

.qz-candidate {
    display: grid; grid-template-columns: 2fr 1fr 1fr;
    border: 1px solid var(--qz-navy); border-radius: 6px; overflow: hidden;
    margin-top: 15px;
}
.qz-candidate > div {
    padding: 9px 12px 26px; font-size: 0.72rem; font-weight: 800;
    letter-spacing: 0.06em; text-transform: uppercase; color: #55606d;
    border-right: 1px solid var(--qz-navy);
}
.qz-candidate > div:last-child { border-right: none; }

.qz-marks-wrap { margin-top: 12px; overflow-x: auto; }
.qz-marks-table {
    width: 100%; border-collapse: collapse; font-size: 0.72rem;
}
.qz-marks-table th, .qz-marks-table td {
    border: 1px solid var(--qz-navy); padding: 6px 5px;
    text-align: center; white-space: nowrap;
}
.qz-marks-table th { background: #eef2f6; font-weight: 800; color: var(--qz-navy); }
.qz-marks-table th:first-child, .qz-marks-table td:first-child {
    text-align: left; background: #eef2f6; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.04em; color: #55606d;
}
.qz-marks-table tbody tr:last-child td { height: 30px; }
.qz-marks-table .qz-total-col { background: #e3e9ef; font-weight: 800; }

.qz-note {
    font-size: 0.85rem; color: var(--qz-muted); margin-top: 12px;
    display: flex; gap: 8px; align-items: flex-start;
}

/* ----------------------------------------------------------- topic list --- */

.qz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.qz-topic {
    display: block; text-decoration: none; color: inherit;
    background: #fff; border: 1px solid var(--qz-line); border-radius: 14px;
    padding: 18px 20px; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.qz-topic:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15,23,42,0.08); border-color: #cbd5e1; }
.qz-topic .qz-topic-num {
    font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em;
    color: var(--qz-green-dark); text-transform: uppercase;
}
.qz-topic h3 { margin: 5px 0 12px; font-size: 1rem; color: var(--qz-navy); line-height: 1.4; }
.qz-topic-foot {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    font-size: 0.78rem; color: var(--qz-muted);
}
.qz-topic-foot .qz-pill {
    background: #f1f5f9; border-radius: 999px; padding: 3px 10px; font-weight: 700;
}
.qz-topic-foot .qz-pill--best { background: #e8f8ef; color: #1e8449; }
.qz-topic-foot .qz-pill--soon { background: #fdf3e3; color: #b9770e; }
.qz-topic-foot .qz-topic-nopp { color: #a3aebb; }

/* --------------------------------------------------------------- states --- */

.qz-empty {
    text-align: center; padding: 50px 20px; color: var(--qz-muted);
    background: #fff; border: 1px dashed var(--qz-line); border-radius: 14px;
}
.qz-empty i { font-size: 2.4rem; color: #cbd5e1; display: block; margin-bottom: 14px; }
.qz-loading { text-align: center; padding: 40px; color: var(--qz-muted); }
.qz-error {
    background: #fdecea; border: 1px solid #f5c6c0; color: #b03a2e;
    border-radius: 10px; padding: 13px 16px; font-size: 0.9rem; margin-top: 14px;
}
.qz-error[hidden] { display: none; }

/* ---------------------------------------------------------------- entry --- */
/* The strip that sits on a syllabus topic page and sends you to the quiz. */
.qz-entry {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    background: linear-gradient(135deg, #1a1d23, #2c3e50);
    color: #fff; border-radius: 14px; padding: 20px 24px; margin-bottom: 26px;
}
.qz-entry i.qz-entry-icon { font-size: 1.7rem; color: var(--qz-green); }
.qz-entry-text { flex: 1; min-width: 220px; }
.qz-entry-text strong { display: block; font-size: 1.05rem; margin-bottom: 3px; }
.qz-entry-text span { font-size: 0.86rem; opacity: 0.78; }
.qz-entry .qz-btn { flex: 0 0 auto; }

/* --------------------------------------------------------------- mobile --- */

@media (max-width: 720px) {
    .qz-wrap { width: 94%; padding: 22px 0 60px; }
    .qz-card { padding: 20px 16px; }
    .qz-head h1 { font-size: 1.45rem; }
    .qz-match { grid-template-columns: 1fr; }
    .qz-nav .qz-btn { flex: 1 1 auto; justify-content: center; }
    .qz-spacer { display: none; }
    .qz-score { gap: 16px; }
    .qz-score .qz-ring { flex-basis: 76px; width: 76px; height: 76px; font-size: 1.3rem; }
    .qz-code { font-size: 0.82rem; padding: 14px; }
}

@media print {
    .qz-nav, .qz-dots, .qz-progress, .qz-entry, .qz-crumb { display: none !important; }
    .qz-card { box-shadow: none; border: 1px solid #ccc; }

    /* Ctrl+P on the quiz page prints the quiz; the drill panel is a workbench,
       not a document. */
    body:not(.qz-print-paper) .qz-drill { display: none !important; }

    /* ...unless Print was pressed inside the drill, in which case the generated
       paper becomes the document and everything else gets out of the way.
       Hiding by visibility rather than display keeps the ancestors in the flow
       so the paper can be pulled to the top of the page. */
    body.qz-print-paper * { visibility: hidden !important; }
    body.qz-print-paper #qz-drill-out,
    body.qz-print-paper #qz-drill-out * { visibility: visible !important; }
    body.qz-print-paper #qz-drill-out {
        position: absolute; top: 0; left: 0; width: 100%;
        margin: 0; padding: 0;
    }

    /* Controls and status lines are not part of a printed paper. The marking
       scheme is not either — it prints from its own view. */
    body.qz-print-paper #qz-drill-out .qz-btn,
    body.qz-print-paper #qz-drill-out .qz-note,
    body.qz-print-paper #qz-drill-out .qz-wallet,
    body.qz-print-paper #qz-drill-out .qz-cost-note { display: none !important; }

    body.qz-print-paper .qz-paper {
        border: none; padding: 0;
        font-family: 'Times New Roman', Georgia, serif;
    }
    body.qz-print-paper .qz-paper-q {
        page-break-inside: avoid; border-bottom: none; padding: 10px 0 18px;
    }

    /* The heading stays with question 1 rather than taking a page of its own. */
    body.qz-print-paper .qz-paper-head {
        border-color: #000; page-break-inside: avoid; page-break-after: avoid;
        padding: 12px 14px; margin-bottom: 16px;
    }
    body.qz-print-paper .qz-exam-name { background: none !important; box-shadow: none !important; }
    body.qz-print-paper .qz-edit-hint { display: none !important; }
    body.qz-print-paper .qz-candidate,
    body.qz-print-paper .qz-candidate > div,
    body.qz-print-paper .qz-marks-table th,
    body.qz-print-paper .qz-marks-table td { border-color: #000; }
    body.qz-print-paper .qz-marks-wrap { overflow: visible; }
    body.qz-print-paper .qz-marks-table { font-size: 0.62rem; }
    body.qz-print-paper .qz-marks-table th,
    body.qz-print-paper .qz-marks-table td { padding: 4px 3px; }
    /* Grey fills are printer ink nobody asked for; keep the rules, drop the tint. */
    body.qz-print-paper .qz-marks-table th,
    body.qz-print-paper .qz-marks-table td:first-child,
    body.qz-print-paper .qz-marks-table .qz-total-col { background: none; }
}
