@media print {
    * {
      -webkit-print-color-adjust: exact;
      print-color-adjust: exact;
    }

    html {
      font-size: 8pt; /* Slightly increased font size for better readability */
    }
    html:not(.light) {
        filter: invert(0);
      }
    @page {
      size: A4;
      /* margin: 10mm; */
    }
    body {
      width: 210mm;
      height: 297mm;
      margin: 0 auto;
      background-color: white !important;
      /* zoom: 0.7; */
    
    }

    [data-theme='skeleton'] {
      background-image: none !important;
      background-attachment: fixed;
      background-position: center;
      background-repeat: no-repeat;
      background-size: cover;
    } 

    /* Fix for page breaks - updating to use section instead of .page */
    section {
      page-break-after: always;
      break-after: page;
      margin-bottom: 20mm;
      clear: both;
    }

    /* Ensure tables don't break across pages */
    table {
      page-break-before: avoid;
      page-break-inside: auto;
    }

    /* Hide non-printable elements */
    .print\:hidden {
      display: none !important;
    }

    /* Ensure content elements don't break across pages when possible */
    h1,
    h2,
    h3 {
      page-break-after: avoid;
    }

    /* Ensure images and charts don't break */
    #dispersigram {
      page-break-inside: avoid;
    }

    /* Adjust layout for print - make sure all content fits */
    .flex-row {
      display: flex;
      flex-direction: row;
    }

    /* Control the scaling of the content */
    #page-content {
      /* zoom: 0.9; Slightly reduce content size to fit more on each page */
    }

    #page {overflow: visible !important;}

    /* Footnotes section special handling */
    #sdfootnote1,
    #sdfootnote2,
    #sdfootnote3,
    #sdfootnote4,
    #sdfootnote5,
    #sdfootnote6,
    #sdfootnote7,
    #sdfootnote8,
    #sdfootnote9,
    #sdfootnote10,
    #sdfootnote11,
    #sdfootnote12 {
      page-break-inside: avoid;
    }
  }