/* Timber Cruise Practice: a cruiser's field tally book. Khaki waterproof-paper ground, spruce-green ink, a blaze
   orange like flagging tape for actions and question tags, and condensed headings like a stamped tree tag. The
   drawings are a maple stick, brown bark and black graduations on white, so they read the same in print. */
:root {
  --bg: #ece6d3;
  --paper: #fbf9f2;
  --ink: #1b241c;
  --muted: #4d564a;
  --line: #cfc6ab;
  --edge: #7c7660;
  --band: #24382a;
  --band-ink: #f5f2e6;
  --accent: #b8430f;
  --accent-ink: #ffffff;
  --accent-soft: #f6e2d4;
  --info: #1f5a85;
  --ok: #1d6a35;
  --ok-soft: #dcefdf;
  --close: #7a5300;
  --close-soft: #f5ead0;
  --bad: #a3241d;
  --bad-soft: #f8e0dd;
  --focus: #1b5fd0;
  --head: "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --r: 3px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161a14;
    --paper: #20261e;
    --ink: #e8e6da;
    --muted: #b1b4a3;
    --line: #353c31;
    --edge: #6d7462;
    --band: #3a5642;
    --band-ink: #f2f0e4;
    --accent: #f08a4b;
    --accent-ink: #1e0d02;
    --accent-soft: #3b2416;
    --info: #9cc5ec;
    --ok: #8ed8a0;
    --ok-soft: #173020;
    --close: #f0c56b;
    --close-soft: #352a12;
    --bad: #ff9c8f;
    --bad-soft: #3a1c18;
    --focus: #8ab8ff;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--sans); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
a { color: var(--info); text-underline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--head); font-stretch: condensed; line-height: 1.12; font-weight: 700; }
.crumbs { padding-top: 12px; font-size: 15px; color: var(--muted); }
.hero { padding: 16px 0 12px; margin: 0 0 10px; border-bottom: 3px solid var(--band); }
.hero h1 { font-size: clamp(32px, 6vw, 50px); margin: 0 0 4px; letter-spacing: 0.005em; }
.lede { margin: 0; max-width: 68ch; }

/* ---------- controls ---------- */
.tool { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.tool > * { min-width: 0; }
.setup { display: grid; gap: 10px; padding: 4px 0; }
.setrow { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font: 600 14px var(--sans); color: var(--muted); padding: 0; margin-bottom: 4px; }
.seg { display: grid; border: 1.5px solid var(--band); border-radius: var(--r); overflow: hidden; background: var(--paper); }
.seg5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sg { position: relative; display: block; min-width: 0; }
.sg + .sg { border-left: 1px solid var(--edge); }
.sg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sg span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 4px 6px; font-size: 15px; line-height: 1.15; }
.sg input:checked + span { background: var(--band); color: var(--band-ink); font-weight: 600; }
.sg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: -3px; }
.also { margin: 0; font-size: 15.5px; }
.tdet summary, .rules summary { cursor: pointer; font-weight: 600; min-height: 44px; padding: 10px 0; }
.tsum { font-weight: 400; color: var(--muted); font-size: 15px; }
.toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; padding-top: 4px; }
.tg { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; min-height: 44px; background: var(--paper); }
.tg input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.tg b { display: block; font-weight: 600; font-size: 15.5px; }
.tg small { display: block; color: var(--muted); font-size: 14px; line-height: 1.3; }
.inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; flex-wrap: wrap; }
select, input { font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 1px solid var(--edge); border-radius: var(--r); min-height: 44px; padding: 6px 10px; max-width: 100%; }
.btn { font: 600 16px var(--sans); min-height: 44px; padding: 8px 16px; border-radius: var(--r); border: 1px solid var(--edge); background: var(--paper); color: var(--ink); cursor: pointer; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: 15px; }
.link { font: inherit; background: none; border: 0; color: var(--info); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; min-height: 44px; padding: 0 4px; }

/* ---------- rules and tables ---------- */
.side { display: grid; gap: 10px; min-width: 0; }
.rules { border-top: 3px solid var(--accent); background: var(--paper); padding: 2px 14px 10px; min-width: 0; }
.rl { margin: 4px 0 0; padding-left: 20px; font-size: 15px; line-height: 1.45; }
.rl li { margin: 0 0 4px; }
.rnote { font-size: 14.5px; color: var(--muted); margin: 6px 0 0; }
.vtwrap { overflow-x: auto; margin: 4px 0 8px; }
table.vt { border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; background: #fff; color: #1b241c; }
table.vt caption { text-align: left; font-weight: 600; padding: 4px 0; color: var(--ink); caption-side: top; }
table.vt th, table.vt td { border: 1px solid #cfc6ab; padding: 2px 5px; text-align: right; }
table.vt thead th { background: #efe9d6; font-weight: 600; }
table.vt tbody th { background: #f6f2e4; }
table.vt tbody tr:nth-child(5n) td, table.vt tbody tr:nth-child(5n) th { border-bottom: 2px solid #8a8268; }

/* ---------- the sheet ---------- */
.note { margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--bad); background: var(--bad-soft); font-size: 16px; border-radius: var(--r); }
#store-note { overflow-wrap: anywhere; }
.note.info { border-color: var(--info); background: var(--paper); }
.sheet:focus { outline: none; }
.sheet-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 14px; }
.sheet-head h2 { font-size: 30px; margin: 6px 0 0; }
.code { font-family: var(--mono); letter-spacing: 0.06em; }
.score { margin: 0; color: var(--muted); font-size: 15px; }
.sline { margin: 2px 0 10px; color: var(--muted); font-size: 14.5px; }
.qs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.q { background: var(--paper); border: 1px solid var(--line); min-width: 0; }
.q h3 { margin: 0; font-size: 23px; padding: 0 14px 0 0; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.qn { font: 700 16px var(--mono); background: var(--accent); color: var(--accent-ink); padding: 8px 12px 8px 14px; clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 50%, 100% 100%, 0 100%); min-width: 3.2ch; }
.scen { margin: 8px 14px 8px; max-width: 75ch; }
.figview { padding: 0 14px; min-width: 0; }
.qparts > * { min-width: 0; }
.qparts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 10px 14px 14px; }

/* ---------- drawings: always on white, like the real thing ---------- */
.pair { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-start; }
.stack { display: grid; gap: 8px; }
.fg { margin: 0; min-width: 0; max-width: 100%; }
.fg figcaption { font-weight: 600; font-size: 14.5px; color: var(--muted); margin-bottom: 3px; }
svg.doc { display: block; max-width: 100%; height: auto; background: #fff; border: 1px solid #b9b199; }
svg.doc.stickall { width: 640px; }
svg.doc.stickzoom { width: 360px; }
svg.doc.dtape { width: 400px; }
svg.doc.merritt { width: 230px; }
svg.doc.clino { width: 150px; }
.pair .fg figcaption { max-width: 200px; }
svg.doc.logend { width: 300px; }
svg.doc.endzoom { width: 330px; }
svg.doc.loglen { width: 400px; }
svg.doc.pview { width: 120px; border: 0; }
.trunk { fill: #8a6a4a; }
.trunk.shift { fill: #6e5236; }
.barkl { stroke: #5c4430; stroke-width: 2; }
.stick { fill: #ecd59b; stroke: #6b5626; stroke-width: 1.2; }
.smk, .mk, .hk, .tk { stroke: #111; stroke-width: 1.4; }
.hk { stroke-width: 1.1; }
.sml { fill: #111; font: 600 10px Arial, Helvetica, sans-serif; }
.ml { fill: #111; font: 700 15px Arial, Helvetica, sans-serif; }
.zero { stroke: #b8430f; stroke-width: 2; }
.edge { stroke: #b8430f; stroke-width: 2; stroke-dasharray: 5 3; }
.cap { fill: #4d564a; font: 600 12px Arial, Helvetica, sans-serif; }
.kt { fill: #1f5a85; font: 700 15px Arial, Helvetica, sans-serif; }
.karrow { fill: #1f5a85; }
.kline { stroke: #1f5a85; stroke-width: 2.4; stroke-dasharray: 6 3; }
.tree { fill: #9b7b58; }
.tape { fill: #f6d94a; stroke: #6b5a10; stroke-width: 1; }
.tl { fill: #111; font: 700 16px Arial, Helvetica, sans-serif; }
.hookend { fill: #f6d94a; stroke: #6b5a10; stroke-width: 1; fill-opacity: 0.94; }
.zline { stroke: #b0170f; stroke-width: 2.4; }
.hz { fill: #b0170f; font: 700 14px Arial, Helvetica, sans-serif; }
.sky { fill: #fff; }
.ground { stroke: #5f6b4e; stroke-width: 3; }
.crown { fill: #cfe0bf; stroke: #6d8a57; stroke-width: 1.4; }
.stem { fill: #8a6a4a; stroke: #4e3a27; stroke-width: 1; }
.stump { stroke: #111; stroke-width: 1.6; stroke-dasharray: 3 2; }
.stop { stroke: #e05a12; stroke-width: 4; }
.stopl { fill: #111; font: 700 13px Arial, Helvetica, sans-serif; }
.sight { stroke: #555; stroke-width: 1; stroke-dasharray: 2 3; }
.lensbg { fill: #fff; }
.scalebg { fill: #f3f1ea; stroke: #888; stroke-width: 1; }
.cl { fill: #111; font: 700 15px Arial, Helvetica, sans-serif; }
.sightln { stroke: #b0170f; stroke-width: 2; }
.prismglass { fill: #dfeaf2; }
.bark { fill: #7a5a3c; }
.wood { fill: #ecd3a6; }
.ring { fill: none; stroke: #c9a46d; stroke-width: 1; }
.pith { fill: #6b4b2c; }
.cross { stroke: #b0170f; stroke-width: 2; }
.logside { fill: #9b7b58; }
.logcut { fill: #ecd3a6; stroke: #7a5a3c; stroke-width: 2; }
.tape2 { fill: #f6d94a; stroke: #6b5a10; stroke-width: 1; }
.ftl { fill: #b0170f; font: 700 14px Arial, Helvetica, sans-serif; }
.inl { fill: #111; font: 600 11px Arial, Helvetica, sans-serif; }

/* records */
table.doc { border-collapse: collapse; background: #fff; color: #1b241c; font-size: 15px; font-variant-numeric: tabular-nums; border: 1.5px solid #1b241c; }
table.doc caption { caption-side: top; text-align: left; background: #24382a; color: #fff; padding: 6px 10px; }
table.doc caption .dn { display: block; font: 700 15px var(--sans); }
table.doc caption .dy { display: block; font-size: 13.5px; color: #dbe5d8; }
table.doc th, table.doc td { border: 1px solid #cfc6ab; padding: 5px 8px; text-align: left; vertical-align: middle; }
table.doc td { text-align: right; white-space: nowrap; }
table.doc td.tm { text-align: left; white-space: normal; }
table.doc thead th { font-size: 13px; font-weight: 600; color: #4d564a; background: #f1ecdc; }
table.doc tfoot th { text-align: right; background: #f6f2e4; }
table.doc.notes td { text-align: left; white-space: normal; }
table.prismt td.pv { padding: 2px 4px; }
td.blank { background: #f4f8ff; min-width: 70px; }
td.fill { color: #1f5a85; font-weight: 700; background: #eaf1fd; }

/* plot */
.tcards { list-style: none; margin: 4px 0 0; padding: 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 14px; }
.tcard { border: 1px solid var(--line); border-top: 3px solid var(--band); padding: 6px 0 10px; min-width: 0; }
.tcard h4 { margin: 0 10px 6px; font-size: 19px; }
.tcard h4 small { font: 400 15px var(--sans); color: var(--muted); }
.tcard .figview { padding: 0 10px; }
.tcard .pair.tight { gap: 8px 12px; }
.tcard svg.doc.merritt { width: 170px; }
.tcard svg.doc.stickzoom { width: 300px; }
.tcard svg.doc.dtape { width: 330px; }
.tcard svg.doc.clino { width: 120px; }
.cparts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 8px 10px 0; }
.cparts .part .prompt { font-size: 15px; }
.cparts .ain input { width: 100%; }
.cparts .ain { gap: 4px; }
.cparts .unit { font-size: 13px; }
.scorebox:empty { display: none; }
.cscore { margin: 0; padding: 8px 10px; background: var(--accent-soft); font-size: 15.5px; }
.cscore span { display: block; color: var(--muted); font-size: 14.5px; }
.tally td.blank { min-width: 60px; }

/* answer boxes */
.part { border: 0; margin: 0; padding: 0; min-width: 0; }
.part .prompt, .part legend { display: block; font-weight: 600; font-size: 16px; line-height: 1.3; margin-bottom: 4px; color: var(--ink); }
.ain { display: flex; align-items: center; gap: 8px; }
.ain input { width: 9.5em; max-width: 100%; font-variant-numeric: tabular-nums; }
.part.wide .ain input { width: 15em; }
.ain .unit { color: var(--muted); white-space: nowrap; }
.opts { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.opt { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 1px solid var(--edge); border-radius: var(--r); background: var(--paper); cursor: pointer; }
.opt input { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); margin: 0; }
.part.is-right input:not([type="radio"]) { border-color: var(--ok); background: var(--ok-soft); }
.part.is-wrong input:not([type="radio"]) { border-color: var(--bad); background: var(--bad-soft); }
.part.is-close input:not([type="radio"]), .part.is-unread input:not([type="radio"]) { border-color: var(--close); background: var(--close-soft); }
.fb { margin: 4px 0 0; font-size: 15px; line-height: 1.4; padding: 4px 8px; }
.fb.right { color: var(--ok); background: var(--ok-soft); }
.fb.wrong { color: var(--bad); background: var(--bad-soft); }
.fb.close, .fb.unread { color: var(--close); background: var(--close-soft); }
.qfoot { display: flex; gap: 10px; align-items: center; }
details.work { margin-top: 2px; border-top: 1px dashed var(--line); padding-top: 4px; }
details.work summary { cursor: pointer; color: var(--info); min-height: 44px; display: flex; align-items: center; font-weight: 600; }
details.work .figview { padding: 0; margin: 6px 0 8px; overflow-x: auto; }
.ans { margin: 8px 0 2px; }
.steps { margin: 0 0 4px; padding-left: 20px; color: var(--muted); font-size: 15.5px; }
.sheet-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 14px 0 6px; }
.ask { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; background: var(--accent-soft); padding: 6px 10px; }
.share { margin: 16px 0 6px; }
.print-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.print-row label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; max-width: 100%; }
.share-out label { display: grid; gap: 4px; font-weight: 600; margin-top: 8px; }
.share-out input { width: 100%; }
.recent { margin-top: 12px; background: var(--paper); border: 1px solid var(--line); padding: 4px 12px; }
.recent summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.recent ul { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.recent small { display: block; color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-size: 14.5px; margin: 0; }
.toast { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%) translateY(150%); background: var(--ink); color: var(--paper); padding: 10px 16px; max-width: min(92vw, 520px); font-size: 15.5px; transition: transform 0.2s; z-index: 20; }
.toast.on { transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* ---------- content ---------- */
.content { max-width: 75ch; padding: 26px 0 20px; }
.content h2 { font-size: 29px; margin: 26px 0 6px; }
.faq details { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; padding: 10px 0; min-height: 44px; }
.faq p { margin: 0 0 12px; }
.sources { font-size: 14.5px; color: var(--muted); }
footer { border-top: 1px solid var(--line); padding: 16px 0 28px; font-size: 14.5px; color: var(--muted); }
.indep { margin: 0 0 10px; }
.sb-footer p { margin: 6px 0; }
.sb-more { line-height: 1.8; }
.print-root { display: none; }

@media (min-width: 900px) {
  .tool { grid-template-columns: minmax(0, 1fr) 380px; }
  .setup { grid-column: 1; }
  .side { grid-column: 2; grid-row: 1 / span 2; }
  .work-area { grid-column: 1 / -1; }
  .qparts { grid-template-columns: 1fr 1fr; gap: 12px 22px; }
  .qparts .qfoot, .qparts details.work, .qparts .part.wide, .qparts .scorebox { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .seg5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .seg5 .sg:nth-child(4) { border-left: 0; }
  .seg5 .sg:nth-child(n+4) { border-top: 1px solid var(--edge); }
  .seg5 .sg:nth-child(5) { grid-column: span 2; }
}
@media (max-width: 480px) {
  .sg span { font-size: 14px; padding: 4px 2px; }
  .hero { padding-top: 6px; padding-bottom: 8px; }
  .hero h1 { font-size: 32px; }
  .lede { font-size: 15.5px; line-height: 1.42; }
  .q h3 { font-size: 20px; }
  .scen { margin: 6px 10px 6px; }
  .figview, .tcards { padding: 0 8px; }
  .qparts { padding: 8px 10px 12px; }
  table.doc { font-size: 13.5px; }
  table.doc th, table.doc td { padding: 4px 4px; }
  .tcard .figview { padding: 0 6px; }
  .cparts { padding: 8px 6px 0; gap: 6px; }
  .tcard svg.doc.merritt { width: 170px; }
  .tcard svg.doc.clino { width: 104px; }
  table.tally td.tm, table.tally thead th:nth-child(2) { display: none; }
  .tdet summary, .rules summary { min-height: 40px; padding: 8px 0; }
}
@media (max-width: 360px) {
  .cparts { grid-template-columns: 1fr 1fr; }
  table.doc.prismt th, table.doc.prismt td { padding: 3px 2px; font-size: 12.5px; }
}

/* ---------- print ---------- */
@media print {
  :root { --ink: #000; --muted: #333; --line: #999; --paper: #fff; --edge: #555; }
  @page { margin: 11mm 11mm; }
  body { background: #fff; color: #000; font: 10.3pt/1.34 var(--sans); }
  main, footer, .toast, .skip { display: none !important; }
  .print-root { display: block; }
  svg, table.doc, table.doc caption, td.blank, td.fill, table.vt { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  svg.doc { border: 0.5pt solid #777; }
  table.pt { width: 100%; border-collapse: collapse; }
  table.pt > tbody > tr > td, table.pt > thead > tr > td { padding: 0; }
  .prun { font: 8.5pt var(--sans); color: #444; padding-bottom: 4pt !important; display: flex; justify-content: space-between; gap: 10pt; }
  .pprac { text-align: right; }
  .ph { display: flex; justify-content: space-between; align-items: baseline; gap: 10pt; border-bottom: 2pt solid #000; margin-bottom: 4pt; }
  .ph h2 { font: 700 18pt var(--head); font-stretch: condensed; margin: 0; white-space: nowrap; }
  .ph p { margin: 0; font-size: 9pt; text-align: right; }
  .pmeta { display: flex; justify-content: space-between; gap: 12pt; margin: 4pt 0 4pt; }
  .pround { margin: 0 0 5pt; font-size: 8.4pt; line-height: 1.3; border: 0.8pt solid #000; padding: 3pt 6pt; }
  .pq, .pk { list-style: none; margin: 0; padding: 0; }
  .pq > li, .pk > li { padding: 5pt 0 6pt; border-bottom: 0.75pt solid #999; break-inside: avoid; page-break-inside: avoid; }
  .pq h3, .pk h3 { font: 700 12pt var(--head); font-stretch: condensed; margin: 0 0 2pt; }
  .pscen { margin: 0 0 3pt; font-size: 9.8pt; }
  .pfig, .pkfig { margin: 0 0 3pt; }
  .fg figcaption { font-size: 8.4pt; color: #000; margin-bottom: 1pt; }
  .pair { gap: 2mm 5mm; flex-wrap: nowrap; }
  .pair .pair { flex-wrap: nowrap; }
  svg.doc.stickall { width: 110mm; }
  svg.doc.stickzoom { width: 64mm; }
  svg.doc.dtape { width: 74mm; }
  svg.doc.merritt { width: 40mm; }
  svg.doc.clino { width: 30mm; }
  svg.doc.logend { width: 52mm; }
  svg.doc.endzoom { width: 60mm; }
  svg.doc.loglen { width: 96mm; }
  svg.doc.pview { width: 15mm; border: 0; }
  .pk-logvol .pair, .pk-logend .pair { flex-wrap: wrap; }
  table.doc { font-size: 9pt; border-width: 1pt; }
  table.doc caption { background: #fff; color: #000; border: 1pt solid #000; border-bottom-width: 1.5pt; padding: 2pt 6pt; }
  table.doc caption .dy { color: #333; font-size: 8.4pt; }
  table.doc caption .dn { font-size: 9.6pt; }
  table.doc th, table.doc td { padding: 1pt 5pt; line-height: 1.2; }
  table.doc thead th { font-size: 8.2pt; }
  table.prismt td.pv { padding: 0 2pt; }
  td.fill { color: #000; background: #e8e8e8; }
  .kline { stroke: #000; }
  .kt, .karrow { fill: #000; }
  .pparts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2pt 6mm; font-size: 9.6pt; margin-top: 2pt; }
  .pparts .pp { break-inside: avoid; }
  .pparts .pp p { margin: 0; }
  .pline { margin: 6pt 0 2pt !important; }
  .uline { display: inline-block; width: 30mm; border-bottom: 0.8pt solid #000; }
  .uline.sm { width: 14mm; }
  /* plot: tree cards two to a row, the tally lines on each card */
  .pcards { display: grid; grid-template-columns: 1fr 1fr; gap: 2mm 4mm; }
  .pcard { border: 0.6pt solid #888; padding: 1.5mm 2mm; break-inside: avoid; }
  .pcard h4 { font: 700 9.6pt var(--head); font-stretch: condensed; margin: 0 0 1mm; }
  .pcard .fg figcaption { font-size: 7.6pt; max-width: 40mm; }
  .pcards:not(.wide) .fg figcaption { display: none; }
  .pq > li.plotq { break-inside: auto; page-break-inside: auto; }
  .pcard svg.doc.merritt { width: 27mm; }
  .pcard svg.doc.stickzoom { width: 54mm; }
  svg.doc.merritt .ml { font-size: 21px; }
  svg.doc.merritt .stopl { font-size: 17px; }
  svg.doc.merritt .cap { font-size: 16px; }
  .pcard svg.doc.dtape { width: 50mm; }
  .pcards.wide { grid-template-columns: 1fr; }
  .pcards.wide .pcard { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 6mm; align-items: center; }
  .pcards.wide .pcard h4 { grid-column: 1 / -1; }
  .pcards.wide svg.doc.dtape { width: 66mm; }
  .pcard svg.doc.clino { width: 26mm; }
  .pcards.wide .cline { flex-direction: column; gap: 4mm; }
  .pcard .pair { align-items: center; }
  .cline { display: flex; justify-content: space-between; gap: 2mm; margin: 1.5mm 0 0; font-size: 9pt; }
  li.plotq .pparts { grid-template-columns: 1fr 1fr; }
  .pq > li.ptable { break-inside: auto; page-break-inside: auto; border-bottom: 0; }
  table.vt { break-inside: avoid; page-break-inside: avoid; }
  table.vt { font-size: 8pt; line-height: 1.12; border-collapse: collapse; }
  table.vt caption { text-align: left; font-weight: 700; padding: 0 0 2pt; color: #000; }
  table.vt th, table.vt td { padding: 0.2pt 4pt; border: 0.5pt solid #888; }
  table.vt thead th { background: #eee; }
  table.vt tbody th { background: #f4f4f4; }
  .pkey { break-before: page; page-break-before: always; }
  .psheet + .psheet { break-before: page; page-break-before: always; }
  .pkey + .pkey { break-before: page; page-break-before: always; }
  table.pkt { width: 100%; border-collapse: collapse; font-size: 8.8pt; margin-top: 2pt; table-layout: fixed; }
  table.pkt td { border-top: 0.5pt solid #bbb; padding: 1.5pt 4pt; vertical-align: top; }
  table.pkt td.pkq { width: 26%; }
  table.pkt td.pka { width: 16%; font-weight: 700; }
  .pkscore { font-size: 8.8pt; margin: 2pt 0 0; }
  .pscore { margin: 6pt 0 0; font-size: 9.8pt; font-weight: 700; }
  .pscore span { font-weight: 400; font-size: 8.8pt; }
  table.tally { font-size: 8.8pt; }
}
@media print {
  /* narrow drawings: answer lines beside the drawing */
  .pq > li.pk-merritt, .pq > li.pk-dtape, .pq > li.pk-clino, .pq > li.pk-logend, .pq > li.pk-loglen, .pq > li.pk-prism { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 8mm; align-items: start; }
  .pq > li.pk-merritt > h3, .pq > li.pk-merritt > .pscen, .pq > li.pk-dtape > h3, .pq > li.pk-dtape > .pscen, .pq > li.pk-clino > h3, .pq > li.pk-clino > .pscen,
  .pq > li.pk-logend > h3, .pq > li.pk-logend > .pscen, .pq > li.pk-loglen > h3, .pq > li.pk-loglen > .pscen, .pq > li.pk-prism > h3, .pq > li.pk-prism > .pscen { grid-column: 1 / -1; }
  .pq > li.pk-merritt .pparts, .pq > li.pk-dtape .pparts, .pq > li.pk-clino .pparts, .pq > li.pk-logend .pparts, .pq > li.pk-loglen .pparts, .pq > li.pk-prism .pparts { grid-template-columns: 1fr; margin-top: 4mm; }
  .pq > li.pk-merritt svg.doc.merritt { width: 34mm; }
  .pk > li.pk-merritt svg.doc.merritt { width: 30mm; }
}
