@page { margin:12mm; }

@media print {
  html,body { background:#fff!important;color:#111!important; }
  header,footer,.tool-form,.tool-depth,.explain,.nav-toggle,.actions,section:has(>.card-grid) { display:none!important; }
  main { padding:0!important;max-width:none!important;width:auto!important; }
  .workspace { display:block!important; }
  .tool-hero { padding:0 0 8mm!important;break-after:avoid-page; }
  .tool-hero .lede,.meter { display:none!important; }
  .result { box-shadow:none!important;border:1px solid #555!important;position:static!important;overflow:visible!important;padding:6mm!important;max-width:none!important; }
  .result table { display:table!important;width:100%!important;max-width:none!important;overflow:visible!important;table-layout:auto!important; }
  .result thead { display:table-header-group!important; }
  .result tfoot { display:table-footer-group!important; }
  .result .money-table { table-layout:fixed!important; }
  .result .money-table th:first-child { width:55%!important; }
  .result .money-table th:nth-child(2) { width:10%!important; }
  .result .money-table th:nth-child(3),.result .money-table th:nth-child(4) { width:17.5%!important; }
  .result .money-table th:not(:first-child),.result .money-table td:not(:first-child) { text-align:right!important;overflow-wrap:normal!important; }
  .result tr,.result th,.result td { min-width:0!important;break-inside:avoid-page;page-break-inside:avoid;white-space:normal!important;color:#111!important; }
  .result h2,.result h3 { break-after:avoid-page;page-break-after:avoid; }
  .result p,.result li { orphans:3;widows:3; }
  h1 { font-size:26pt!important; }

  .calibration { break-inside:avoid-page; }
  .template-page { max-width:none!important;border:0;padding:0;margin:0;overflow:visible;break-after:page; }
  .template-page:last-child,.template-page:last-of-type { break-after:auto; }
  .geometry-scroll { overflow:visible; }
  .geometry-table,.coordinate-table { display:table!important;width:100%!important;max-width:none!important;table-layout:auto!important; }
  .geometry-table thead,.coordinate-table thead { display:table-header-group; }
  .geometry-table tr,.coordinate-table tr { break-inside:avoid-page; }
  .slot-strip { overflow:visible; }
  .reference-ruler { max-width:none; }
}
