/* EconFlow print styles (A4). Link with media="print" after the main stylesheets.
   Used by the public pages and the demand question papers; generic enough to link from the app
   for lesson notes: it targets .prose, the .no-print utility and the question-paper classes.
   Black on white regardless of theme. Open <details> are handled in two ways: the ::details-content
   rule below (Chrome 131+) and a beforeprint script on pages that need it. */
@page { size: A4; margin: 16mm 15mm 18mm; }

/* Force the light, ink-on-paper palette whatever the screen theme is. */
:root, :root[data-theme="dark"], :root[data-theme="light"] {
  color-scheme: light !important; /* theme.js sets an inline color-scheme; this keeps the page margins white too */
  --bg: #fff; --surface: #fff; --surface-2: #f3f3f1; --surface-3: #e9e9e6;
  --line: #cfcfcb; --line-strong: #b5b5b0; --control-border: #8a8a85;
  --ink: #000; --ink-2: #222; --ink-3: #444;
  --accent: #000; --accent-hover: #000; --accent-soft: #f3f3f1; --accent-line: #b5b5b0; --on-accent: #fff;
  --success: #000; --success-soft: #f3f3f1; --success-line: #b5b5b0;
  --paper: #fff; --paper-ink: #000; --paper-rule: #bbb;
  --shadow-1: none; --shadow-2: none; --shadow-3: none; --highlight: none;
}
html, body { background: #fff !important; color: #000; }
body { font-size: 11pt; line-height: 1.5; display: block !important; min-height: 0 !important; }
* { box-shadow: none !important; text-shadow: none !important; animation: none !important; transition: none !important; }

/* Chrome and chrome-like furniture */
.no-print, .skip-link, .site-top, .site-foot, .site-links, .site-actions, .pp-nav, .related, .cta,
.theme-toggle, .btn, .icon-btn, button, video, dialog, [data-no-print] { display: none !important; }
.site-main { max-width: none !important; margin: 0 !important; padding: 0 !important; display: block; }

/* Reading text */
.article, .prose { max-width: none; }
.article-head h1, .pp-head h1 { font-size: 24pt; line-height: 1.1; }
.article-head .lede, .pp-head .lede { font-size: 12pt; color: #222; }
.eyebrow { color: #444 !important; }
.article-body { border-top: 1px solid #999; }
.prose h1, .prose h2, .prose h3, .article-body > h2, .pp-section-head, .pp-qhead, .pp-part-label, summary, .pp-scheme-title {
  break-after: avoid-page; page-break-after: avoid;
}
.prose h2, .article-body > h2 { font-size: 15pt; margin-top: 18pt; }
.prose p, .prose li { orphans: 3; widows: 3; }
.prose figure, .prose img, .prose table, .prose pre, .points li { break-inside: avoid; page-break-inside: avoid; }
.points { border-color: #999; }
img { max-width: 100% !important; break-inside: avoid; page-break-inside: avoid; }

/* Only external links print their address (the papers already show their URLs as text) */
.prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #333; overflow-wrap: anywhere; word-break: break-all; }
a { color: #000; text-decoration: underline; text-underline-offset: 2px; }

/* Question papers */
.pp-stats dd { font-size: 16pt; }
.pp-group + .pp-group { break-before: page; margin-top: 0; }
.pp-section-head { margin: 0 0 10pt; }
.pp-section-index, .pp-section-head p { color: #333; }
.pp-question {
  background: #fff !important; color: #000 !important; border: 0.75pt solid #999; border-radius: 0;
  margin: 0 0 12pt; padding: 10pt 12pt 4pt; font-size: 10.5pt; line-height: 1.45;
  break-inside: auto; /* questions with stimulus and mark scheme can exceed a page; parts and scheme blocks stay whole */
}
.pp-qnum { background: none; color: #000; border: 0.75pt solid #000; border-radius: 0; height: 26px; min-width: 28px; font-size: 10pt; }
.pp-question h3 { font-size: 13pt; }
.pp-stem { background: #f6f6f4; border-radius: 0; border: 0.5pt solid #ccc; }
.pp-part, .pp-scheme-block { break-inside: avoid-page; page-break-inside: avoid; }
.pp-qhead + .pp-part { break-before: avoid-page; }
.pp-stem img, .pp-prompt img, .pp-explanation img { border-color: #ccc; border-radius: 0; max-height: 90mm; width: auto; object-fit: contain; }
.pp-scheme { background: #f6f6f4 !important; border: 0.5pt solid #bbb; border-radius: 0; color: #000; }
.pp-marks, .pp-answer-letter { background: none !important; color: #000 !important; border-color: #888 !important; }

/* Mark schemes always print open; the summary becomes a plain caption */
details > ::details-content { content-visibility: visible; display: block; height: auto; }
details > summary { display: block !important; border: 0 !important; background: none !important; min-height: 0 !important; padding: 0 !important;
  margin: 6pt 0 2pt; font: 700 9pt/1.2 var(--font-sans) !important; letter-spacing: 0.06em; text-transform: uppercase; color: #333 !important; }
details > summary::after, details > summary::marker { content: none; display: none; }

/* Generated Paper Studio answer sheets */
.has-ruled-answers .generated-paper-question{break-inside:auto}
.paper-question-stem,.paper-section-intro,.paper-choice-label{break-after:avoid}
.paper-question-stem,.paper-level-band{break-inside:avoid}
.paper-answer-space{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed;break-before:avoid;break-inside:auto}
.paper-answer-space thead,.paper-answer-space tr,.paper-answer-start{break-inside:avoid}
.paper-answer-space td{padding:0;border:0}
.paper-answer-space thead td{font:9pt sans-serif;color:#40555c}
.paper-answer-line td{height:8.5mm;border-bottom:0.25mm solid #888}
.paper-drawing-space{height:65mm;border:1px solid #aaa;margin-top:3mm;break-inside:avoid}
.paper-extra-answer-page{break-before:page}
