/* Link with media="print". A4 single puzzle sheet; screen UI never prints. */
@page { size: A4 portrait; margin: 14mm; }
@media print {
  :root, :root[data-theme], :root[data-size] {
    color-scheme: light; font-size: 11pt;
    --paper: #fff; --surface: #fff; --surface-raised: #fff; --surface-sunken: #fff;
    --ink: #000; --muted: #333; --grid: #555; --line: #888; --line-strong: #555;
    --indigo: #000; --madder: #000; --leaf: #000; --stamp: #000;
    --block: #000; --on-block: #fff; --selected: #fff; --related: #fff; --same: #fff;
    --ng-fill: #000; --on-ng-fill: #fff;
    --indigo-soft: #fff; --madder-soft: #fff; --leaf-soft: #fff; --error-soft: #fff; --error: #000;
    --board-number: 21pt; --board-kana: 19pt; --board-note: 7pt;
  }
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .drawer, .modal, .toast-area, .slot, .crumbs, .tools, .numpad, .kana-pad, .mode-toggle, .game__head, .game__status, .pause-veil, .skip-link, .no-print, .print-sheet button:not(.cell):not(.xw-cell):not(.ng-cell), .print-sheet .btn { display: none !important; }
  body:has(.print-sheet) > :not(main):not(.print-sheet) { display: none !important; }
  main:has(.print-sheet) > :not(.print-sheet):not(:has(.print-sheet)) { display: none !important; }
  main:has(.print-sheet) section:has(.print-sheet) > :not(.print-sheet) { display: none !important; }
  .container, .page { width: auto; max-width: none; padding: 0; margin: 0; }
  .section + .section { margin-block-start: 0; }
  .print-sheet { width: 100%; max-width: 182mm; min-height: 0; aspect-ratio: auto; padding: 0; margin: 0 auto; border: 0; break-after: page; break-inside: avoid; }
  .print-sheet:last-child { break-after: auto; }
  .print-sheet__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8mm; border-bottom: 1pt solid #000; padding-bottom: 5mm; margin-bottom: 8mm; }
  .print-sheet__head h1, .print-sheet__head h2 { font-size: 19pt; }
  .print-sheet .board-wrap { width: 138mm; max-width: 100%; margin: 0 auto 6mm; }
  .print-sheet .sudoku, .print-sheet .xw { width: 138mm; max-width: 100%; }
  .print-sheet .ng { width: 154mm; max-width: 100%; }
  .print-sheet--nonogram .board-wrap { width: 154mm; }
  .sudoku, .xw, .ng__grid { border: 1.5pt solid #000; break-inside: avoid; }
  .cell, .xw-cell, .ng-cell { border-color: #555; box-shadow: none !important; outline: none !important; background: #fff !important; color: #000 !important; }
  .edge-r { border-right: 1.5pt solid #000 !important; } .edge-b { border-bottom: 1.5pt solid #000 !important; }
  .xw-cell.is-block, .ng-cell.is-filled { background: #000 !important; color: #fff !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .cell__value { color: #000; } .cell.is-given .cell__value { font-weight: 700; }
  .xw-cell.is-key::before { border-color: #000; }
  .cell.is-error::after, .xw-cell.is-error::after, .ng-cell.is-hint::before { display: none; }
  .cell__value, .xw-cell__char { text-decoration: none !important; }
  .board-wrap.is-paused > :is(.sudoku, .xw, .ng) { visibility: visible; }
  .game__body { display: block; } .game__side { display: block; }
  .xw-clues { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; font-size: 9pt; }
  .clue { padding: 1mm 0; min-height: 0; font-size: 9pt; }
  .ng-clue, .ng--large .ng-clue { font-size: 10pt; color: #000; } .ng-clue.is-active { box-shadow: none; }
  /* Reserve room below a crossword for both complete clue columns. */
  .print-sheet--crossword { font-size: 9pt; line-height: 1.4; --board-kana: 16pt; }
  .print-sheet--crossword .print-sheet__head { margin-bottom: 4mm; padding-bottom: 3mm; gap: 4mm; }
  .print-sheet--crossword .print-sheet__head h2 { font-size: 16pt; }
  .print-sheet--crossword .board-wrap, .print-sheet--crossword .xw { width: 96mm; }
  .print-sheet--crossword .board-wrap { margin-bottom: 3mm; }
  .print-sheet--crossword .print-keyword { margin: 2mm 0; gap: 2mm; }
  .print-sheet--crossword .print-kw { width: 8mm; height: 8mm; }
  .print-sheet--crossword .xw-clues { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 5mm; }
  .print-sheet--crossword .xw-clues__group h3 { font-size: 10pt; padding-bottom: 1mm; }
  .print-sheet--crossword .xw-clues__group ol { margin-top: 1mm; }
  .print-sheet--crossword .clue { font-size: 8.5pt; line-height: 1.35; padding: .5mm 0; gap: 2mm; break-inside: avoid; }
  .print-sheet--crossword > p { margin-top: 2mm; }
  .print-sheet .xw-cell__num, .print-sheet .xw-cell__key { font-size: 6pt; }
  a { color: #000; text-decoration: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; box-shadow: none !important; }
}
