/* The printed worksheet. Shared by the app preview and the /api/sheet page.
   Brand colours come from theme.css (the Avery Studio kit, never edited here);
   the game-only tokens below derive from it. Page size comes from pageCss().
   Never redefine a kit token here (--paper, --ink-soft...): the whole app page
   would change with it. */
:root {
  --white: var(--card);
  --sheet-paper: #FFFFFF; /* printed paper stays plain white: no tint on the page */
  --grid-border: var(--mascot-2);
  --grid-guide: #8FD0B8;
  --grid-diag: #CDEBDF;
  --stroke-build: #B9C1C7;
  --stroke-trace: #DCE1E4;
  --rule: #B9C1C7;
  --shadow: rgba(66, 41, 29, 0.12);
}
.sheet-page {
  display: block;
  width: 100%;
  height: auto;
  background: var(--sheet-paper);
  overflow: visible;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
/* Grid shapes are reused with <use>, so their clones live in a shadow tree
   where ancestor selectors like `.sheet-page .x` do not match. Keep these
   three rules ancestor-free. */
.g-border { fill: none; stroke: var(--grid-border); }
.g-guide { stroke: var(--grid-guide); }
.g-diag { fill: var(--grid-diag); stroke: none; }
.sheet-page .ink-model { fill: var(--ink); }
.sheet-page .ink-build { fill: var(--stroke-build); }
.sheet-page .ink-trace { fill: var(--stroke-trace); }
.sheet-page .glyph-font {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "BiauKai", "DFKai-SB", "Noto Serif CJK SC", "Songti SC", serif;
}
.sheet-page .sheet-label,
.sheet-page .sheet-foot {
  fill: var(--ink-soft);
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}
/* The footer wordmark is the one brand mark on paper: Baloo 2, like the header. */
.sheet-page .sheet-brand { font-family: var(--font-head); font-weight: 700; }
.sheet-page .sheet-rule { stroke: var(--rule); }
.sheet-page .sheet-count {
  fill: var(--ink-soft);
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

@media print {
  .sheet-page {
    break-after: page;
    page-break-after: always;
    box-shadow: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
  .sheet-page:last-child { break-after: auto; page-break-after: auto; }
}
