/* Printable maths worksheets (4 Nov 2026): the Grown-ups tab (js/features/worksheets.js), its print window (body.ws-doc)
   and the free public pages in maths-worksheets/ and nz/maths-worksheets/ (tools/build_worksheets.mjs). A4, black on white. */
.ws-list { list-style: none; margin: 0; padding: 0; }
.ws-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 0; border-top: 1px solid #E5E7EB; }
.ws-list li:first-child { border-top: 0; }
.ws-topic { font-weight: 600; }
.ws-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-btns .btn { min-width: 44px; }
.ws-years { margin-top: 12px; }

.ws-pair { margin: 28px 0; }
.ws-sheet { background: #fff; color: #111827; border: 1px solid #D1D5DB; border-radius: 12px; padding: 28px 30px; margin: 0 0 18px; font-family: Inter, "Inter Fallback", system-ui, sans-serif; }
.ws-head { border-bottom: 2px solid #111827; padding-bottom: 12px; margin-bottom: 16px; }
.ws-brand { display: block; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: #4B5563; }
.ws-sheet h2 { font-size: 24px; line-height: 1.25; margin: 4px 0 10px; color: #111827; }
.ws-name { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 0 0 8px; font-size: 15px; }
.ws-name span { display: inline-flex; align-items: flex-end; gap: 6px; }
.ws-name i { display: inline-block; width: 150px; border-bottom: 1px solid #6B7280; height: 1.1em; }
.ws-name i.short { width: 40px; }
.ws-tip { margin: 0; font-size: 14px; color: #4B5563; }
.ws-qs, .ws-keys { list-style: none; margin: 0; padding: 0; }
.ws-q { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid #E5E7EB; break-inside: avoid; page-break-inside: avoid; }
.ws-q:first-child { border-top: 0; }
.ws-n { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #111827; display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.ws-body { flex: 1; min-width: 0; }
.ws-body p { margin: 3px 0 8px; font-size: 17px; line-height: 1.45; }
.ws-pic svg { display: block; max-width: min(100%, 360px); height: auto; margin: 4px 0 8px; }
.ws-opts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px 18px; }
.ws-opts li { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.ws-bub { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #374151; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.ws-ans { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 4px; }
.ws-field { display: inline-flex; align-items: flex-end; gap: 6px; font-size: 16px; }
.ws-line { display: inline-block; width: 140px; border-bottom: 1.5px solid #374151; height: 1.4em; }
.ws-keys { counter-reset: k; }
.ws-keys li { counter-increment: k; padding: 8px 0 8px 34px; position: relative; border-top: 1px solid #E5E7EB; font-size: 15px; line-height: 1.45; break-inside: avoid; }
.ws-keys li:first-child { border-top: 0; }
.ws-keys li::before { content: counter(k) "."; position: absolute; left: 0; font-weight: 700; }
.ws-keys span { display: block; color: #374151; }

/* the public pages: a print button per sheet, and a list of every topic in the full set */
.ws-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.ws-jump { columns: 2 220px; padding-left: 1.2em; }
.ws-all { columns: 2 240px; padding-left: 1.2em; }
.ws-cta { border: 2px solid currentColor; border-radius: 14px; padding: 18px 20px; margin: 26px 0; }
.ws-cta p { margin: 0 0 10px; }

/* the print window from the app */
body.ws-doc { background: #fff; margin: 0; padding: 16px; }
body.ws-doc .ws-pair { margin: 0; }

@media print {
  @page { size: A4; margin: 14mm; }
  html, body { background: #fff !important; }
  body > header, body > footer, .skip, .guide-hero, .ws-noprint, .guide-side { display: none !important; }
  .guide-body > :not(.ws-pair) { display: none !important; }
  .guide-wrap, .guide-body, main { display: block !important; max-width: none !important; padding: 0 !important; margin: 0 !important; }
  .ws-pair { margin: 0; }
  .ws-sheet { border: 0; border-radius: 0; padding: 0; margin: 0; break-after: page; page-break-after: always; }
  .ws-pair:last-of-type .ws-sheet:last-child { break-after: auto; page-break-after: auto; }
  .ws-q { padding: 10px 0; }
  .ws-pic svg { max-width: 300px; }
  /* "Print this worksheet" on a public page prints that one pair only */
  body.ws-only .ws-pair:not(.ws-this) { display: none !important; }
  body.ws-only .ws-this .ws-key { break-after: auto; page-break-after: auto; }
}
