/* Scale the complete design, not its text layout, into the printable area.
   The wrapper owns the page height; the full-size artwork cannot add a page. */
@media print {
  .sheet-wrap {
    container-type: size;
    width: calc(100% - 1px) !important;
    max-width: none !important;
    height: calc(100vh - 1px) !important;
    overflow: hidden !important;
    break-inside: avoid;
  }

  .print-sheet {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 1056px !important;
    height: 816px !important;
    transform-origin: center !important;
    /* Conservative fallback for older browsers without typed calc division. */
    transform: translate(-50%, -50%) scale(.8) !important;
    transform: translate(-50%, -50%) scale(min(calc(100cqw / 1056px), calc(100cqh / 816px))) !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .print-sheet.paper-a4 {
    width: 1122px !important;
    height: 794px !important;
    transform: translate(-50%, -50%) scale(min(calc(100cqw / 1122px), calc(100cqh / 794px))) !important;
  }
}
