@media print {
  @page {
    size: landscape;
    margin: 0.4in 0.5in;
  }

  /* Hide interactive chrome */
  #page_header, header, form, #breadcrumbs, .profiler-results, .no-print {
    display: none !important;
  }

  body, main {
    font-size: 9pt;
    color: #000;
    background: #fff;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
  }

  h4, h5 {
    margin: 0;
    font-size: 10pt;
  }

  /* Collapse paragraph margins — base styles add 0.75rem which wastes space */
  p {
    margin: 1pt 0;
  }

  /* Farm section breaks — only break before sections that follow another section.
     Can't use :first-of-type because there's a .no-print div before the first
     .farm-section, making it the actual first div of its type. */
  .farm-section + .farm-section {
    break-before: page;
  }

  /* Space between records */
  tr.entry-pesticides + tr.entry-main td {
    padding-top: 8pt;
    border-top: 1pt solid #333;
  }
  tr.entry-main:first-child td {
    border-top: none;
    padding-top: 3pt;
  }

  /* Reset DaisyUI table decorations */
  .table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
  }

  table, th, td {
    border: 0.5pt solid #555;
    font-size: 8pt;
  }

  th, td {
    padding: 3pt 4pt;
  }

  th {
    background: #eee !important;
    font-size: 7.5pt;
    text-align: left;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  thead {
    display: table-header-group;
  }

  ul {
    margin: 0;
    padding: 0 0 0 10pt;
  }

  li {
    margin-bottom: 1pt;
  }

  /* ── Farm-grouped layout column widths (6 cols, pesticides in row 2) ── */
  .pesticide-applications.farm-grouped th:nth-child(1),
  .pesticide-applications.farm-grouped td:nth-child(1) { width: 1.9in; } /* Date / applicator / method / wind / notes */
  .pesticide-applications.farm-grouped th:nth-child(2),
  .pesticide-applications.farm-grouped td:nth-child(2) { width: 1.3in; } /* Blocks */
  .pesticide-applications.farm-grouped th:nth-child(3),
  .pesticide-applications.farm-grouped td:nth-child(3) { width: 1.3in; } /* Crops */
  .pesticide-applications.farm-grouped th:nth-child(4),
  .pesticide-applications.farm-grouped td:nth-child(4) { width: 0.55in; } /* Acres */
  .pesticide-applications.farm-grouped th:nth-child(5),
  .pesticide-applications.farm-grouped td:nth-child(5) { width: 1.4in; } /* Re-entry */
  .pesticide-applications.farm-grouped th:nth-child(6),
  .pesticide-applications.farm-grouped td:nth-child(6) { width: 0.75in; } /* Gallons */

  /* ── Chronological layout column widths (7 cols, pesticides in row 2) ── */
  .pesticide-applications.chronological th:nth-child(1),
  .pesticide-applications.chronological td:nth-child(1) { width: 1.8in; } /* Date / applicator / method / wind / notes */
  .pesticide-applications.chronological th:nth-child(2),
  .pesticide-applications.chronological td:nth-child(2) { width: 0.9in; } /* Farm */
  .pesticide-applications.chronological th:nth-child(3),
  .pesticide-applications.chronological td:nth-child(3) { width: 1.1in; } /* Blocks */
  .pesticide-applications.chronological th:nth-child(4),
  .pesticide-applications.chronological td:nth-child(4) { width: 1.1in; } /* Crops */
  .pesticide-applications.chronological th:nth-child(5),
  .pesticide-applications.chronological td:nth-child(5) { width: 0.5in; } /* Acres */
  .pesticide-applications.chronological th:nth-child(6),
  .pesticide-applications.chronological td:nth-child(6) { width: 1.3in; } /* Re-entry */
  .pesticide-applications.chronological th:nth-child(7),
  .pesticide-applications.chronological td:nth-child(7) { width: 0.7in; } /* Gallons */

  /* ── Pesticide row (row 2 per entry) ── */
  tr.entry-pesticides td {
    border-top: none;
    padding-top: 1pt;
    background: #f9f9f9 !important;
  }

  tr.entry-main td {
    border-bottom: none;
  }

  .pesticide-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4pt 12pt;
    margin-top: 1pt;
  }

  .pesticide-entry {
    font-size: 7.5pt;
  }

  hr.tight {
    margin: 2pt 0;
    border-color: #999;
  }
}
