/* ============================================================
   Shared worksheet chrome — one copy for every printable sheet.
   Issue #57: the five generators used to carry identical copies
   of this block. Sheet-specific layout (a 10x10 chart, a card
   grid, ten-frames) belongs in the sheet's own small <style>,
   never in a second copy of these rules.

   Everything sized for A4 portrait. Screen shows the same page
   the printer gets, so what a parent sees is what comes out.
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --sheet-font: "Comic Sans MS", "Chalkboard SE", "Marker Felt", sans-serif;
  --ui-font: -apple-system, "Helvetica Neue", Arial, sans-serif;

  /* Per-sheet typography: a sheet that needs different type overrides these in
     its own <style> block (the hundred chart does). Columns are NOT here — the
     engine sets grid-template-columns from its `columns` config, so the printed
     grid and the configured count cannot disagree. */
  --grid-gap: 3mm 6mm;
  --title-size: 24pt;
  --instruction-size: 12pt;
  --instruction-color: #555;
  --header-gap: 5mm;
}

body {
  font-family: var(--sheet-font);
  background: #e8ecf1;
  color: #000;
}

/* ---------- screen-only toolbar ---------- */
.toolbar {
  position: sticky; top: 0; z-index: 10;
  background: #fff; border-bottom: 1px solid #ccc;
  padding: 10px 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  font-family: var(--ui-font);
  font-size: 14px; color: #333;
}
.toolbar button {
  font-size: 14px; padding: 6px 14px; cursor: pointer;
  background: #2563eb; color: #fff; border: none; border-radius: 6px;
}
.toolbar button:hover { background: #1d4ed8; }
.toolbar label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.toolbar select {
  font-size: 14px; padding: 4px 6px; border: 1px solid #bbb; border-radius: 5px;
}
.toolbar .hint { color: #888; }

/* ---------- A4 page ---------- */
.page {
  width: 210mm; height: 297mm;
  margin: 12mm auto;
  background: #fff;
  padding: 12mm 14mm;
  display: flex; flex-direction: column;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}

/* ---------- header ---------- */
.header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: var(--header-gap); }
.field { font-size: 13pt; }
.field .blank { display: inline-block; width: 34mm; border-bottom: 1.2px solid #000; height: 6mm; }
.eyebrow {
  text-align: center; font-size: 10pt; letter-spacing: .18em;
  text-transform: uppercase; color: #777; margin-bottom: 1.5mm;
}
.title { text-align: center; font-size: var(--title-size); font-weight: 700; margin-bottom: 2mm; }
.instructions {
  text-align: center; font-size: var(--instruction-size); color: var(--instruction-color); margin-bottom: 5mm;
}

/* ---------- the work area ---------- */
.sheet {
  flex: 1;
  display: grid;
  gap: var(--grid-gap);
}

.footer {
  text-align: center;
  font-size: 10pt;
  color: #999;
  margin-top: 3mm;
  font-variant-numeric: tabular-nums;
}

.footnote {
  margin-top: 4mm; font-size: 9.5pt; color: #666;
  font-family: var(--ui-font);
  display: flex; justify-content: space-between; gap: 8mm;
}

/* ---------- answer key page ---------- */
.answer-page { page-break-before: always; }
.answer-page .title { font-size: 20pt; margin-bottom: 6mm; }
[hidden] { display: none !important; }

/* ---------- page intro (screen only, never printed) ---------- */
.sheet-intro {
  max-width: 210mm; margin: 12mm auto 0; padding: 22px 24px 20px;
  background: #fff; border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,.08);
  font-family: var(--ui-font); color: #1f2937;
}
.sheet-intro h1 { font-size: 26px; line-height: 1.25; margin-bottom: 10px; color: #0f172a; }
.sheet-intro p { font-size: 15px; line-height: 1.55; margin-bottom: 10px; }
.sheet-intro .points { margin: 0 0 12px 20px; font-size: 15px; line-height: 1.55; }
.sheet-intro .points li { list-style: disc; margin-bottom: 4px; }
.sheet-intro .more {
  display: flex; flex-wrap: wrap; gap: 8px 18px; row-gap: 8px;
  font-size: 14px; padding-top: 12px; margin-top: 4px; border-top: 1px solid #e5e7eb;
}
.sheet-intro .more a { color: #2563eb; text-decoration: none; }
.sheet-intro .more a:hover { text-decoration: underline; }

/* ---------- print ---------- */
@page { size: A4 portrait; margin: 0; }
@media print {
  body { background: #fff; }
  .toolbar { display: none !important; }
  .sheet-intro { display: none !important; }
  .page { margin: 0; box-shadow: none; }
}
