/* The Workbook: only what it needs on top of books.css. Black and white. The sheet size and the print rules come from books.css. */
.pbody > .wb, .pbody > .akey { flex: none; }
.wb { line-height: 1.35; }
.wb > * { flex: none; }

/* ---------- the top of a page: subject, title, instruction, name, corner picture ---------- */
.wh { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.wtx { flex: 1; min-width: 0; }
.ws { font-size: .6em; font-weight: bold; letter-spacing: 1.5px; text-transform: uppercase; border-bottom: 2px solid #000; display: inline-block; padding: 0 .1em .1em; margin: 0 0 .35em; }
.wb .pt { text-align: left; margin: 0 0 .15em; line-height: 1.1; }
.wb .pi { text-align: left; margin: 0 0 .4em; font-size: 1em; font-weight: bold; }
.wnm { margin: .4em 0 0; font-weight: bold; font-size: .95em; }
.wul { display: inline-block; width: 11em; border-bottom: 2px solid #000; height: 1em; vertical-align: baseline; }
.wc { flex: none; }
.wp, .wf { display: inline-block; vertical-align: middle; max-width: 100%; }
.unk { display: inline-flex; align-items: center; justify-content: center; border: 2px dashed #000; font-weight: bold; font-size: 1.2em; box-sizing: border-box; }

/* ---------- blocks ---------- */
.bh { font-weight: 900; font-size: 1.05em; margin: 0 0 .2em; }
.bn { margin: 0 0 .5em; font-size: .95em; }
.q { margin: 0 0 .35em; }
.q .no, .no { margin-right: .1em; }
.av { font-weight: 900; }
.bl { display: inline-block; border-bottom: 2px solid #000; height: 1em; vertical-align: baseline; margin: 0 .1em; }
.tx { font-weight: bold; }
.th { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; vertical-align: middle; }
.grd { display: grid; gap: 0 1.2em; }

/* sums and stacked sums */
.sums { row-gap: .85em; }
.sm { font-size: 1.12em; white-space: nowrap; }
.stacks { row-gap: 1em; justify-items: center; }
.st { position: relative; font-size: 1.25em; font-variant-numeric: tabular-nums; }
.st .n { text-align: right; line-height: 1.25; }
.st .u { border-bottom: 3px solid #000; }
.st .u i { position: absolute; left: 0; font-style: normal; }
.st .a { height: 1.5em; }
.works { row-gap: .8em; }
.wk { border: 1.5px solid #000; border-radius: 8px; padding: .4em .6em .5em; }
.wk .space { border: 1.5px dashed #000; border-radius: 6px; margin: .3em 0; }
.ansl { text-align: right; font-weight: bold; }

/* tracing (SVG rows that fill the width) */
.trs, .tpr { display: block; }
.tr { display: block; max-width: 100%; margin: 0 0 .25em; }
.tpr { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tpr svg { flex: 1 1 auto; max-width: 100%; height: auto; }
.tpe { flex: none; }

/* counting, circling, matching */
.counts { row-gap: .8em; }
.cnt { display: flex; align-items: center; gap: .6em; border: 1.5px solid #000; border-radius: 10px; padding: .3em .5em; }
.cth { flex: 1; }
.nbox { flex: none; display: inline-block; width: 1.9em; height: 1.9em; border: 2.5px solid #000; border-radius: 6px; background: #fff; }
.nbox.sm { width: 1.6em; height: 1.6em; }
.crc { margin: 0 0 .7em; }
.opts { display: flex; flex-wrap: wrap; gap: .6em 1.2em; }
.opt { display: inline-flex; align-items: center; justify-content: center; padding: .3em .6em; min-width: 2.2em; }
.mt { margin-top: .2em; }
.mrow { display: flex; align-items: center; justify-content: space-between; margin: .5em 0; }
.ml, .mr { flex: 0 0 38%; display: flex; align-items: center; gap: .5em; }
.ml { justify-content: space-between; }
.md { display: inline-block; flex: none; width: .7em; height: .7em; border: 2px solid #000; border-radius: 50%; }

/* choosing, filling in, writing */
.chs { margin: 0 0 .7em; break-inside: avoid; }
.ops .op { display: block; margin: .15em 0 .15em 1.2em; }
.ops.row .op { display: inline-block; margin: .1em 1.4em .1em 1.2em; }
.lt { display: inline-block; min-width: 1.5em; text-align: center; padding: 0 .2em; }
.qf { margin: .2em 0 .4em; }
.bank { display: flex; flex-wrap: wrap; gap: .3em 1.1em; justify-content: center; border: 2px solid #000; border-radius: 10px; padding: .4em .8em; margin: .1em 0 .7em; font-weight: bold; }
.bls { margin: 0 0 .55em; line-height: 1.9; }
.shq { margin: 0 0 .5em; }
.rls { position: relative; }
.rl { position: relative; border-bottom: 1.8px solid #000; }
.rls.pri .rl::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed #000; }
.dbox { border: 2.5px solid #000; border-radius: 10px; margin: .2em 0 .4em; }
.rd { border: 2px solid #000; border-radius: 10px; padding: .6em .9em; }
.rd p { margin: 0 0 .5em; line-height: 1.5; }
.rd p:last-child { margin-bottom: 0; }
.rdt { text-align: center; font-weight: 900; font-size: 1.1em; margin: 0 0 .4em; }
.tfr { display: flex; align-items: center; justify-content: space-between; gap: 1em; margin: 0 0 .45em; }
.tfr .q { flex: 1; margin: 0; }
.tfo { flex: none; display: flex; gap: .7em; }
.tf { font-weight: bold; padding: .1em .7em; }
.ord { display: flex; align-items: center; gap: .7em; margin: 0 0 .5em; }
.srt, .wtab { width: 100%; border-collapse: collapse; }
.srt th, .srt td, .wtab th, .wtab td { border: 2px solid #000; }
.srt th, .wtab th { padding: .3em .5em; font-weight: 900; text-align: center; }
.wtab td { padding: .45em .7em; text-align: center; }
.srt td { width: auto; }

/* maths pictures */
.figs { row-gap: .9em; }
.fgi { text-align: center; }
.fq { margin: .2em 0 .2em; }
.fl { border-bottom: 2px solid #000; height: 1.6em; margin: 0 .5em; }
.onefig, .pat { text-align: center; }
.pat { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.pbox { display: inline-block; border: 2.5px dashed #000; border-radius: 8px; box-sizing: border-box; }
.coins { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; }

/* ---------- the answer key (small, for grown-ups) ---------- */
.apt { font-size: 22px !important; margin: 0 0 .5em !important; text-align: center !important; }
.akey { font-size: 13px; line-height: 1.45; }
.ag { margin: 0 0 9px; }
.ag h3 { margin: 0 0 2px; font-size: 14.5px; border-bottom: 1.5px solid #000; }
.ab { margin: 2px 0; }
.al { font-weight: bold; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; margin-right: 8px; }
.ai { display: inline-block; margin-right: 14px; }
.ak { margin: 1px 0; }
.wtab.small { width: auto; margin: 3px 0; }
.wtab.small th, .wtab.small td { padding: 1px 8px; border-width: 1px; font-size: 12.5px; }
.akey .av { font-weight: 900; }

@media print {
  .wb, .akey { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* tracing: short things two to a row */
.trs.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
