#pp-audit-pack {
  display: none;
}

@media print {
  @page {
    size: A4;
    margin: 14mm 15mm 18mm;

    @bottom-left {
      content: "";
    }

    @bottom-right {
      content: "Page " counter(page) " of " counter(pages);
      font: 7.5pt Arial, sans-serif;
      color: #555;
    }
  }

  body > *:not(#pp-audit-pack) {
    display: none !important;
  }

  #pp-audit-pack {
    display: block;
    width: 100%;
    color: #000;
    background: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10pt;
    line-height: 1.3;
  }

  #pp-audit-pack .pp-pack-running-company,
  #pp-audit-pack .pp-pack-running-period {
    display: block;
    height: 0;
    overflow: hidden;
    width: 0;
  }

  #pp-audit-pack .pp-pack-running-company {
    string-set: packCompany content(text);
  }

  #pp-audit-pack .pp-pack-running-period {
    string-set: packPeriod content(text);
  }

  /* Chrome prints position:fixed at the top of every page, over the content,
     and has no string-set; the company name is on page 1, so footer = page numbers only. */
  #pp-audit-pack .pp-pack-running-footer {
    display: none;
  }

  #pp-audit-pack .pp-pack-first-page {
    break-after: page;
    page-break-after: always;
  }

  #pp-audit-pack .pp-pack-section,
  #pp-audit-pack .pp-pack-ppn,
  #pp-audit-pack .pp-pack-title {
    margin: 0 0 6mm;
  }

  #pp-audit-pack .pp-pack-section {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  #pp-audit-pack h1 {
    font-size: 21pt;
    line-height: 1.1;
    margin: 0 0 3mm;
  }

  #pp-audit-pack h2 {
    border-bottom: 0.35mm solid #222;
    font-size: 13pt;
    margin: 0 0 3mm;
    padding-bottom: 1.2mm;
  }

  #pp-audit-pack h3 {
    font-size: 10.5pt;
    margin: 3mm 0 1.5mm;
  }

  #pp-audit-pack h1,
  #pp-audit-pack h2,
  #pp-audit-pack h3 {
    color: #000;
    break-after: avoid;
    page-break-after: avoid;
  }

  #pp-audit-pack p {
    margin: 0 0 2.5mm;
  }

  #pp-audit-pack .pp-pack-wordmark {
    font-size: 12pt;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin: 0 0 4mm;
  }

  #pp-audit-pack .pp-pack-company {
    font-size: 13pt;
    font-weight: 700;
    margin-bottom: 3mm;
  }

  #pp-audit-pack .pp-pack-meta {
    display: grid;
    grid-template-columns: 34mm 1fr;
    margin: 0 0 6mm;
  }

  #pp-audit-pack .pp-pack-meta dt,
  #pp-audit-pack .pp-pack-meta dd {
    border-bottom: 0.2mm solid #bbb;
    margin: 0;
    padding: 1.3mm 0;
  }

  #pp-audit-pack .pp-pack-meta dt {
    font-weight: 700;
  }

  #pp-audit-pack table {
    width: 100%;
    border-collapse: collapse;
    break-inside: avoid;
    page-break-inside: avoid;
    margin: 0 0 3mm;
  }

  #pp-audit-pack thead {
    display: table-header-group;
  }

  #pp-audit-pack tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  #pp-audit-pack th,
  #pp-audit-pack td {
    border: 0.2mm solid #777;
    color: #000;
    padding: 1.25mm 1.6mm;
    text-align: left;
    vertical-align: top;
  }

  #pp-audit-pack thead th {
    font-size: 8.5pt;
    font-weight: 700;
  }

  #pp-audit-pack tbody th {
    font-weight: 600;
  }

  #pp-audit-pack .pp-pack-figures td {
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
  }

  #pp-audit-pack .pp-pack-figures th {
    width: 70%;
  }

  #pp-audit-pack .pp-pack-ppn {
    border: 0.35mm solid #333;
    break-inside: avoid;
    padding: 3mm;
  }

  #pp-audit-pack .pp-pack-ppn h2 {
    border: 0;
    font-size: 11pt;
    margin-bottom: 1.5mm;
    padding: 0;
  }

  #pp-audit-pack .pp-pack-ppn-result {
    font-size: 12pt;
    font-weight: 700;
  }

  #pp-audit-pack .pp-pack-code {
    color: #666;
    font-family: "Courier New", monospace;
    font-size: 8pt;
  }

  #pp-audit-pack .pp-pack-other-rules {
    font-size: 8.5pt;
  }

  #pp-audit-pack .pp-pack-other-rules th,
  #pp-audit-pack .pp-pack-other-rules td {
    padding-bottom: 0.8mm;
    padding-top: 0.8mm;
  }

  #pp-audit-pack .pp-pack-excluded-rows {
    break-inside: auto;
    page-break-inside: auto;
    font-size: 8pt;
    table-layout: fixed;
  }

  #pp-audit-pack .pp-pack-excluded-rows td {
    overflow-wrap: anywhere;
  }

  #pp-audit-pack .pp-pack-banner {
    border: 0.35mm solid #000;
    break-inside: avoid;
    font-weight: 700;
    margin: 3mm 0;
    padding: 2.5mm 3mm;
  }

  #pp-audit-pack .pp-pack-signature {
    border: 0.25mm solid #777;
    break-inside: avoid;
    display: grid;
    gap: 0;
    grid-template-columns: 1fr 1fr;
  }

  #pp-audit-pack .pp-pack-signature-field {
    border-bottom: 0.2mm solid #aaa;
    min-height: 12mm;
    padding: 2mm 3mm;
  }

  #pp-audit-pack .pp-pack-signature-field span {
    color: #555;
    display: block;
    font-size: 8pt;
  }

  #pp-audit-pack .pp-pack-signature-field strong {
    display: block;
    margin-top: 1.5mm;
  }

  #pp-audit-pack .pp-pack-signature > p {
    grid-column: 1 / -1;
    margin: 0;
    padding: 2mm 3mm;
  }

  #pp-audit-pack .pp-pack-mono {
    font-family: "Courier New", monospace;
    font-size: 8pt;
    overflow-wrap: anywhere;
    word-break: break-all;
  }
}
