math { font-family: "STIX Two Math", "Latin Modern Math", "Cambria Math", math; font-size: 1.08em; math-style: normal; }
mtable.mleft mtd { text-align: left; }
/* Angle hat and bar over any width. Gradients make the two strokes of the hat in the text colour. */
mrow.mbar { border-top: .065em solid currentColor; padding-top: .06em; }
mrow.mhat {
  padding-top: .34em;
  background:
    linear-gradient(to top left, transparent calc(50% - .75px), currentColor calc(50% - .35px) calc(50% + .35px), transparent calc(50% + .75px)) left top / 50% .28em no-repeat,
    linear-gradient(to top right, transparent calc(50% - .75px), currentColor calc(50% - .35px) calc(50% + .35px), transparent calc(50% + .75px)) right top / 50% .28em no-repeat;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
/* Scrolls sideways only; the bottom padding holds tall formulas so no vertical scrollbar appears. */
.qtext { margin: .8rem 0 .5rem; padding-block: .15rem .45rem; line-height: 1.75; overflow-x: auto; overflow-y: hidden; overflow-wrap: break-word; display: flow-root; }
.qtext p { margin: .45rem 0; }
.qfig { display: block; max-width: 100%; height: auto; margin: .6rem auto; background: #fff; border-radius: .4rem; }
.qfig.side { float: right; max-width: 42%; margin: 0 0 .5rem 1rem; }
/* 2 columns until options.mjs picks 4, 2 or 1 from the measured widths. */
.qoptions { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1rem; }
.qoptions li { display: flex; gap: .45rem; align-items: baseline; min-width: 0; }
.qoptions li > span { min-width: 0; }
.qoptions[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.qoptions[data-cols="1"] { grid-template-columns: minmax(0, 1fr); }
.qoptions[data-cols="measure"] { grid-template-columns: max-content; }
.qoptions[data-cols="measure"] li { justify-self: start; }
.qtable { overflow-x: auto; margin: .6rem 0; }
.qtable table { border-collapse: collapse; margin-inline: auto; }
.qtable td { border: 1px solid var(--edge); padding: .2rem .6rem; text-align: center; }
.qtable caption { padding-bottom: .25rem; }
.feature-question { margin: 0; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: .65rem; font-size: .88rem; }
@media (max-width: 540px) { .qoptions:not([data-cols]) { grid-template-columns: minmax(0, 1fr); } .qfig.side { float: none; max-width: 100%; margin: .6rem auto; } }

#print-sheet { display: none; }
/* Laid out off screen at the A4 text width so options can be measured before printing. */
#print-sheet.measuring { display: block; position: absolute; left: -10000px; top: 0; width: 182mm; font-size: 11pt; }
@page { margin: 14mm; }
@media print {
  :root, :root[data-theme="dark"] { color-scheme: light; --ink: #000; --muted: #333; --ground: #fff; --paper: #fff; --line: #999; --edge: #666; }
  body.printing-sheet > :not(#print-sheet) { display: none !important; }
  body.printing-sheet #print-sheet { display: block; font-size: 11pt; }
  #print-sheet h1 { font: 700 16pt/1.3 var(--heading); letter-spacing: 0; margin: 0 0 8pt; }
  #print-sheet h2 { font: 700 12.5pt/1.3 var(--heading); letter-spacing: 0; margin: 12pt 0 4pt; break-after: avoid; }
  #print-sheet h3 { font-size: 11pt; margin: 8pt 0 0; break-after: avoid; }
  .print-question { break-inside: avoid; }
  .print-question .qtext { margin: 2pt 0; overflow: visible; }
  .print-blank { margin: 4pt 0 0; white-space: pre-wrap; }
  .print-key { break-before: page; }
  .print-answers { columns: 2; list-style: none; padding: 0; }
}

/* Page layout for the downloaded PDF (pdf.mjs). It is measured in the document and drawn inside an
   SVG image, which sees only this file and system fonts, so every property is set here. */
.pdf-page { --edge: #666; --line: #999; width: 688px; color: #000; background: #fff; font: 14px/1.5 "Helvetica Neue", Arial, sans-serif; text-align: left; display: flow-root; }
.pdf-page * { box-sizing: border-box; letter-spacing: normal; }
.pdf-page h1, .pdf-page h2, .pdf-page h3 { font-family: "Times New Roman", Times, serif; font-weight: 700; line-height: 1.3; margin: 0; padding: 0; }
.pdf-page h1 { font-size: 21px; margin-bottom: 8px; }
.pdf-page h2 { font-size: 16.5px; margin: 14px 0 4px; }
.pdf-page h3 { font-family: "Helvetica Neue", Arial, sans-serif; font-size: 14px; margin-top: 8px; }
.pdf-page p { margin: 0; }
.pdf-page article { display: flow-root; }
.pdf-page .qtext { margin: 2px 0; padding: 0; overflow: visible; }
.pdf-page .qtext p { margin: 4px 0; }
.pdf-page .qfig { border-radius: 0; margin: 6px auto; }
.pdf-page .qfig.side { float: right; max-width: 42%; margin: 0 0 6px 14px; }
.pdf-page .qoptions { margin-top: 4px; }
/* A column that renders a hair narrower must not push the closing "." onto a new line. */
.pdf-page .qoptions[data-cols="4"] li > span, .pdf-page .qoptions[data-cols="2"] li > span { white-space: nowrap; }
.pdf-page .print-blank { margin: 4px 0 0; white-space: pre-wrap; }
.pdf-page .print-key { display: block; }
.pdf-page .print-answers { columns: 2; list-style: none; margin: 0; padding: 0; }
.pdf-bench { position: absolute; left: -10000px; top: 0; }

/* Georgia lacks Vietnamese precomposed glyphs, so diacritics render detached. */
:root { --heading: "Times New Roman", Times, serif; }
