/* The book's own page CSS (KDP\veteran-tinnitus-log\build.mjs), scoped to the
 * print root, plus the handful of rules that place typed values on the forms.
 * On screen the pages show inside the preview overlay; in print only they
 * exist. */
#print-root { display: none; }
#print-root .sheet { font-family: "Helvetica Neue", Arial, sans-serif; color: #000; font-size: 9pt; line-height: 1.3; }
#print-root .sheet * { box-sizing: border-box; }
#print-root .page { page-break-after: always; break-after: page; background: #fff; }
#print-root .page:last-child { page-break-after: auto; break-after: auto; }

#print-root h2 { font-size: 12.5pt; margin: 0 0 .3em; font-weight: 700; color: #000; letter-spacing: 0; }
#print-root h3 { font-size: 9.5pt; margin: .5em 0 .18em; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #000; }
#print-root p { margin: 0 0 .5em; line-height: 1.45; font-size: 9pt; color: #000; }
#print-root p.hint { font-size: 8pt; color: #333; margin-bottom: .3em; }
#print-root p.tight { line-height: 1.4; margin-bottom: .4em; }
#print-root p.fine { font-size: 7.5pt; color: #444; margin-top: .6em; line-height: 1.35; }

#print-root table.grid { width: 100%; border-collapse: collapse; margin-bottom: .18em; table-layout: fixed; }
#print-root table.grid th, #print-root table.grid td { border: .75pt solid #000; padding: 2px 4px; font-size: 8pt; vertical-align: top; }
#print-root table.grid td { overflow-wrap: anywhere; }
#print-root table.grid th { background: #e8e8e8; font-weight: 700; text-align: left; line-height: 1.15; }
#print-root table.grid td { height: 17pt; }
#print-root table.grid.tall td { height: 21pt; }
#print-root table.grid tr.alt td { background: #f6f6f6; }
#print-root .cal-n { font-size: 8pt; }
#print-root .cal-m { display: block; font-weight: 700; font-size: 9pt; letter-spacing: .1em; }

#print-root .dayhead { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2pt solid #000; padding-bottom: 2px; margin-bottom: .4em; }
#print-root .dayfields span { font-size: 9pt; margin-left: .5em; }
#print-root .val { font-weight: 700; border-bottom: .75pt solid #000; padding: 0 .3em; }

#print-root .checks { display: grid; gap: 2px 8px; margin-bottom: .3em; }
#print-root .chk { font-size: 8pt; line-height: 15pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#print-root .chk .box { display: inline-block; width: 9pt; height: 9pt; border: .75pt solid #000; margin-right: 4px; vertical-align: -1px; position: relative; }
#print-root .chk .box.on::after { content: ""; position: absolute; left: 2.2pt; top: -.5pt; width: 2.6pt; height: 6pt; border: solid #000; border-width: 0 1.4pt 1.4pt 0; transform: rotate(40deg); }

#print-root .prost { border: 1.5pt solid #000; padding: 5px 7px 3px; margin: .45em 0 .3em; }
#print-root .prosthead { font-size: 9.5pt; font-weight: 700; margin: 0 0 .25em; text-transform: uppercase; letter-spacing: .05em; }

#print-root .lines { position: relative; }
#print-root .lines .line { border-bottom: .75pt solid #999; height: 19pt; }
#print-root .lines .linetext { position: absolute; inset: 0; padding: 4pt 2pt 0; font-size: 8.5pt; line-height: 19pt; overflow: hidden; white-space: pre-wrap; }

#print-root .signoff { display: flex; gap: .5in; margin-top: .5em; }
#print-root .sigrule { display: inline-block; border-bottom: .75pt solid #000; width: 2.6in; height: 1.15em; }
#print-root .sigrule.short { width: 1.3in; }
#print-root .siglabel { display: block; font-size: 7.5pt; padding-top: 1px; }

/* On-screen preview: letter-size sheets on a gray desk, scaled to fit the phone. */
body.previewing #print-root { display: block; position: fixed; inset: 0; z-index: 60; overflow: auto; background: #58524a; padding: 76px 0 40px; -webkit-overflow-scrolling: touch; }
body.previewing #print-root .sheet { width: 8.5in; margin: 0 auto; zoom: var(--pv-scale, 1); }
body.previewing #print-root .page { width: 8.5in; min-height: 11in; padding: .75in; margin: 0 0 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.preview-bar { display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 61; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; background: #221B0C; color: #fff; align-items: center; gap: 10px; }
body.previewing .preview-bar { display: flex; }
.preview-bar .pv-title { flex: 1; font-weight: 700; font-size: 16px; }
.preview-bar button { min-height: 44px; }

@page { size: 8.5in 11in; margin: 0.75in; }
@media print {
  html, body { background: #fff !important; height: auto !important; overflow: visible !important; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; position: static !important; padding: 0 !important; background: #fff !important; overflow: visible !important; }
  #print-root .sheet { width: auto !important; zoom: 1 !important; margin: 0 !important; }
  #print-root .page { width: auto !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; box-shadow: none !important; }
}
