/* THE SOLUTIONS OPTION IS A BODY CLASS, NOT A DIFFERENT STYLESHEET (TT10). It used to be baked in
   per build, which meant the sheet varied between packs and could not be a single shared asset.
   Both branches ship; the page says which it wants. */
@media print{ body.no-solns .wsol-wrap{ display:none !important; } }

:root{ --ink:#1A1917; --muted:#6B6862; --line:#D6CFBF; --line-soft:#E7E1D6; --paper:#FFFFFF; --bg:#F6F3EC; --ash:#EFEBE2; --zebra:#F6F3EC; --red:#C8321F; --red-dark:#A82A19; --blue:#1D4ED8; --blue-dark:#1E40AF; --green:#047857; --sec-formula:#B91C1C; --sec-words:#0E7490; --sec-worked:#047857; --sec-mistake:#9A3412; --sec-table:#1D4ED8; --sec-exam:#3730A3; --sec-formula-bg:#FBF6F6; --sec-words-bg:#F4FAFB; --sec-worked-bg:#F5FAF6; --sec-mistake-bg:#FBF7F4; --tag-info-ink:#0E7490; --tag-info-bg:#CFFAFE; --tag-ref-ink:#3730A3; --tag-ref-bg:#E0E7FF; --tag-warn-ink:#92400E; --tag-warn-bg:#FEF3C7; --tag-warn-line:#FCD34D; --tag-note-bg:#EFF6FF; }
*{box-sizing:border-box}
@page{size:A4 portrait;margin:12mm 12mm 15mm}
body{font-family:Arial,Helvetica,sans-serif;color:var(--ink);margin:0;background:#fff;font-size:14px;line-height:1.45}
.wrap{max-width:820px;margin:0 auto;padding:16px}
/* NO EQUATION SPLIT across two lines (toolkit standing rule) */
.katex{white-space:nowrap}
.head{display:flex;align-items:center;gap:12px;border-bottom:2px solid var(--ink);padding-bottom:8px;margin-bottom:4px}
.head img{height:26px}
h1{font-size:19px;margin:0}
.sub{font-size:12px;color:var(--muted);margin:6px 0 14px}
.q{break-inside:avoid;page-break-inside:avoid;margin-bottom:14px}
.qh{display:flex;align-items:baseline;gap:9px;flex-wrap:wrap;margin-bottom:5px}
.qn{background:var(--ink);color:#fff;border-radius:5px;padding:1px 8px;font-weight:700;font-size:13px}
.src{font-weight:700;font-size:12px;color:var(--blue-dark)}
.meta{font-size:11px;color:var(--muted)}
.syn{background:var(--tag-ref-bg);color:var(--tag-ref-ink);border-radius:4px;padding:0 5px;font-size:10px;font-weight:700}
.qb .stem{margin:3px 0}
/* A DIAGRAM SIZING RULE MUST NOT REACH THE MATHS. An unscoped svg max-width/height:auto also
   matches the tiny <svg> KaTeX draws inside a radical, and height:auto collapses it to 0 — the LaTeX stays
   correct, every other gate stays green, and the sheet prints "Work out    16." for √16. That
   reached a class once already (owner flag 2026-08-11). Same paired fix as the student sheets. */
.qb svg:not(.katex *){max-width:100%;height:auto}
.qb .katex svg{max-width:none;height:revert-layer}
/* DIRECT CHILD ONLY. A descendant selector here also matches the <span class="katex"> that
   KaTeX injects for every $...$ fragment, turning each rendered fragment into its own block:
   a 1-mark MCQ then filled a whole page, stacked one word per line. Every automated check
   passed it (0 KaTeX errors, 0 unrendered $, no page errors); only the render showed it. */
.qb .opts > span{display:block;margin:2px 0 2px 14px}
/* Answer-line + working-space CSS copied VERBATIM from scripts/build_remix_paper.js, which is
   what renderQBody's markup is written against. Marks land in the right margin at the end of
   the answer space, which is both the real-exam convention and the toolkit standing rule. */
.aline{display:flex;align-items:flex-end;gap:5px}
.aslot{flex:1 1 auto;min-width:0}
.asuf{font-size:14px;white-space:nowrap}
.dots{flex:1 1 auto;min-width:80px;border-bottom:1.5px dotted #333;height:14px}
.mk{flex:0 0 auto;min-width:34px;text-align:right;white-space:nowrap;font-weight:bold}
.pend{display:flex;align-items:flex-end;gap:8px;margin-top:6px}
.ws{min-height:calc(var(--wsh,3) * 20px)}
/* the mark scheme ALWAYS starts on a fresh page (toolkit standing rule) */
.brk{break-before:page;page-break-before:always}
h2{font-size:16px;margin:0 0 10px;padding-bottom:5px;border-bottom:2px solid var(--ink)}
.ms{break-inside:avoid;page-break-inside:avoid;margin-bottom:12px;border:1px solid var(--line-soft);border-radius:8px;padding:9px 11px}
.msh{display:flex;align-items:baseline;gap:9px;flex-wrap:wrap;margin-bottom:6px}
.sch{border-collapse:collapse;width:100%;font-size:13px}
.sch td{border-top:1px solid var(--ash);padding:3px 6px;vertical-align:top}
.sch .mkc{width:44px;font-weight:700;color:#166534;white-space:nowrap}
.nosch{font-size:12.5px;color:var(--muted);font-style:italic}
.wsol-wrap{margin-top:6px;font-size:13px}

.wsol-wrap summary{cursor:pointer;font-weight:700;font-size:12px;color:var(--muted)}
.wsol-wrap svg:not(.katex *){max-width:100%;height:auto}
.wsol-wrap .katex svg{max-width:none;height:revert-layer}
/* footer pinned to EVERY printed page (toolkit standing rule) */
.ft{display:none}
@media print{
  .wrap{max-width:none;padding:0}
  .noprint{display:none!important}
  .ft{display:block;position:fixed;bottom:-11mm;left:0;right:0;font-size:9px;color:var(--muted);
      display:flex;justify-content:space-between;align-items:center}
  .ft img{height:11px;opacity:.75}
}
.bar{background:var(--ash);border:1px solid var(--line-soft);border-radius:8px;padding:9px 12px;font-size:12.5px;margin-bottom:14px}
.bar b{color:var(--ink)}
.proto{background:var(--tag-warn-bg);border:1px solid var(--tag-warn-line);color:var(--tag-warn-ink);border-radius:8px;padding:7px 11px;font-size:12px;margin-bottom:12px}
