:root { color-scheme: light; font-family: system-ui, sans-serif; color: #171717; background: #eee; }
* { box-sizing: border-box; }
body { margin: 0; }
.print-controls { max-width: 210mm; margin: 1rem auto; padding: 1rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.print-controls p { flex-basis: 100%; margin: 0; }
button, input { font: inherit; }
a { color: #174b80; }
:focus-visible { outline: 3px solid #174b80; outline-offset: 3px; }
.print-preview { width: 210mm; margin: 1rem auto 2rem; padding: 6mm 6mm 12mm 12mm; background: white; box-shadow: 0 2px 16px #0002; }
.sheet { display: flow-root; width: 192mm; min-height: 279mm; margin: 0; padding: 0; background: white; }
header { margin-right: 38mm; padding-top: 6mm; padding-bottom: 5mm; }
header div { min-width: 0; }
h1 { margin: 0 0 3mm; font-size: 18pt; overflow-wrap: anywhere; }
header a { font-size: 9pt; overflow-wrap: anywhere; }
/* Keep the QR inside the page content area. Positive header/lyric spacing
   preserves their original placement while the QR sits 6mm from the page edges. */
.qr-caption { float: right; width: 35mm; margin: 0 0 3mm 3mm; break-inside: avoid; text-align: center; }
.qr { display: block; width: 35mm; height: auto; aspect-ratio: 1 / 1; object-fit: contain; }
.qr-caption figcaption { margin-top: 0; font-size: 7pt; line-height: 1.25; }
pre { margin: 2mm 6mm 0 0; text-align: justify; white-space: pre-wrap; overflow-wrap: anywhere; font: 11pt/1.35 system-ui, sans-serif; }
@page { size: A4; margin: 6mm 6mm 12mm 12mm; }
@media screen and (max-width: 730px) { body { overflow-x: auto; } .print-controls { width: 100vw; } }
@media print {
  :root, body { background: white; }
  .print-controls { display: none; }
  .print-preview { display: contents; }
  .sheet { display: flow-root; width: 100%; min-height: 0; margin: 0; }
  header { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
