/* Print report ------------------------------------------------------------ */
/* The report layout lives on html.print-layout so "Print report" can switch it on, let the map
   load its tiles at the final size, and only then open the print dialog. Ctrl+P adds the class
   in beforeprint. */
.print-only { display: none; }
@media print {
  @page { size: letter landscape; margin: 12mm; }
  html, body { background: #fff !important; color: #000; }
}
html.print-layout { color-scheme: light; --page: #fff; --surface: #fff; --surface-2: #f3f3f0; --raised: #fff; --ink: #0b0b0b; --ink-2: #52514e;
  --muted: #6f6d68; --line: #e1e0d9; --line-2: #c3c2b7; --grid: #e1e0d9; --axis: #c3c2b7; --band: rgba(82, 81, 78, 0.13);
  --good-ink: #006300; --warning-ink: #8a5a00; --accent: #2f6b3a;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948; --other-year: #c9c7bf; }
html.print-layout, html.print-layout body { height: auto; background: #fff; }
html.print-layout .topbar, html.print-layout .settings-page, html.print-layout #progWrap,
html.print-layout .chart-bar, html.print-layout .chart-sub, html.print-layout #btnLayerFold, html.print-layout #optsFold, html.print-layout #statsFold,
html.print-layout #layerCard select, html.print-layout #layerCard .field, html.print-layout .leaflet-control-container .leaflet-top,
html.print-layout #toasts, html.print-layout #tableView, html.print-layout #opsSmoke, html.print-layout #btnOpsRefresh,
html.print-layout #insights .note, html.print-layout #progress, html.print-layout .ranch { display: none !important; }
html.print-layout .print-only { display: block; }
html.print-layout #printHead { position: absolute; top: 0; left: 0; width: 960px; font: 13px var(--font); color: #000; }
html.print-layout #printHead h1 { font-size: 20px; margin: 0; }
html.print-layout #printHead p { margin: 2px 0 0; color: #555; }
html.print-layout #app { display: block; width: 960px; height: auto; padding-top: 56px; }
html.print-layout main { height: 612px; padding: 0; gap: 8px; overflow: hidden; }
html.print-layout #layerCard { width: 200px; max-height: none; overflow: visible; box-shadow: none; backdrop-filter: none; background: #fff; padding: 7px 9px; }
/* the chart is copied into the report as a picture: this is the shape it is drawn at for that */
html.print-layout:not(.print-map) #chartWrap, html.print-layout:not(.print-map) #chartWrap.split { height: 250px; max-height: none; transition: none; }

/* Print map: the same page, holding only the title line and the map with its legend */
html.print-map :is(#overview, #insights, #chartWrap, #findings, #filterBar, #mapTools, #timeBar, #entry) { display: none !important; }
html.print-map main { display: block; }
html.print-map .work { display: block; height: 100%; }
html.print-map #mapWrap { height: 100%; }
html.no-blocks #btnPrintMap { display: none; }

/* PDF report (app/report.js) ------------------------------------------------
   A page of its own, letter portrait. The app is taken off the page; the live map is moved into
   .rp-mapbox for as long as the report is open. Sizes are in points and inches: this is paper. */
@page report { size: letter portrait; margin: 13mm 14mm; }
html.print-report #app { position: absolute; left: -200vw; top: 0; visibility: hidden; height: 0; overflow: hidden; }
html.print-report #printHead, html.print-report #filterBar { display: none !important; }
html.print-report #report { display: block; page: report; width: 7.4in; margin: 0 auto; color: #111; font: 10pt/1.4 var(--font); }
#report h1 { font: 600 22pt/1.15 var(--font-head); letter-spacing: -.01em; margin: 14px 0 2px; }
#report h2 { font: 650 8pt/1.2 var(--font); text-transform: uppercase; letter-spacing: .09em; color: #666; margin: 0 0 6px; }
#report h3 { font: 650 9pt/1.2 var(--font); color: #333; margin: 9px 0 3px; }
#report ul { list-style: none; margin: 0; padding: 0; }
.rp-top { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1.5px solid #111; }
.rp-top img { width: 34px; height: 34px; object-fit: contain; }
.rp-brand { display: flex; flex-direction: column; line-height: 1.2; }
.rp-brand b { font: 600 14pt/1.1 var(--font-head); }
.rp-brand span, .rp-when { font-size: 8.5pt; color: #555; }
.rp-when { margin-left: auto; text-align: right; line-height: 1.35; }
.rp-facts { margin: 0 0 14px; font-size: 10pt; color: #444; }
.rp-facts i { font-style: normal; color: #aaa; margin: 0 3px; }
.rp-none { margin: 0; font-size: 9.5pt; color: #666; }
.rp-find { margin-bottom: 14px; padding: 2px 0 2px 12px; border-left: 3px solid var(--accent); break-inside: avoid; }
.rp-find:has(li.warn) { border-left-color: #b45309; }
.rp-find li + li { margin-top: 7px; }
.rp-find b { font-size: 11.5pt; font-weight: 650; }
.rp-find p { margin: 1px 0 0; color: #444; }
.rp-nums { display: flex; margin-bottom: 14px; border: 1px solid #d9d7cf; border-radius: 4px; break-inside: avoid; }
.rp-nums > div { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 8px 10px 9px; border-left: 1px solid #d9d7cf; }
.rp-nums > div:first-child { border-left: none; }
.rp-nums .l, .rp-nums .s { font-size: 7.5pt; color: #666; line-height: 1.25; }
.rp-nums .v { font: 650 15pt/1.2 var(--font); white-space: nowrap; }
.rp-nums .v small { font-size: 8pt; font-weight: 500; color: #555; margin-left: 2px; }
.rp-nums .b { align-self: flex-start; font-size: 7.5pt; font-weight: 650; color: #1f5a2a; }
.rp-mid { display: grid; grid-template-columns: 3.9in minmax(0, 1fr); gap: 16px; margin-bottom: 14px; break-inside: avoid; }
.rp-map { margin: 0; }
.rp-mapbox { position: relative; height: 2.6in; border: 1px solid #d9d7cf; border-radius: 4px; overflow: hidden; }
.rp-mapbox #mapWrap { position: absolute; inset: 0; width: auto; height: auto; min-height: 0; border: none; border-radius: 0; }
.rp-mapbox #map { height: 100%; }
.rp-mapbox :is(.wind-ctl, #editBar, #mapEmpty, .leaflet-control-zoom, .leaflet-control-attribution) { display: none !important; }
.rp-mapbox #layerCard { top: 6px; left: 6px; width: 150px; padding: 5px 7px; font-size: 7.5pt; }
.rp-map figcaption { margin-top: 4px; font-size: 7.5pt; color: #666; }
.rp-ahead li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid #eceae3; font-size: 9.5pt; }
.rp-ahead li .d { color: #666; white-space: nowrap; }
.rp-note { margin: 7px 0 0; font-size: 8.5pt; color: #444; }
.rp-chart { margin-bottom: 12px; break-inside: avoid; }
.rp-chart img { display: block; width: 100%; }
.rp-legend { display: flex; flex-wrap: wrap; gap: 3px 14px; margin: 0 0 2px; font-size: 8.5pt; color: #444; }
.rp-legend i { display: inline-block; width: 14px; height: 3px; margin-right: 5px; border-radius: 2px; vertical-align: middle; }
.rp-log { margin-bottom: 12px; break-inside: avoid; }
.rp-log table { width: 100%; border-collapse: collapse; font-size: 9pt; }
.rp-log td { padding: 3px 10px 3px 0; border-bottom: 1px solid #eceae3; vertical-align: top; }
.rp-log td:nth-child(-n+2) { white-space: nowrap; color: #555; }
.rp-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-top: 14px; padding-top: 6px; border-top: 1px solid #d9d7cf; font-size: 7.5pt; color: #777; }
.rp-foot span:last-child { white-space: nowrap; font-weight: 650; color: #333; }
/* map tiles fade in on screen; a page being prepared for print may never run that fade */
.rp-mapbox .leaflet-tile { opacity: 1 !important; }
html.print-map .leaflet-tile { opacity: 1 !important; }
