
@media print {
    body {
		top-margin:3em !important;
        min-width: 50vh !important;
    }
	
	.panel_space_badge {
        right: 0 !important;
        left: 0px !important;
        margin: -17px;
        font-size: 1.4em;
        position: inherit !important;
	}
	
}

  #printable-svg {
	  height: 297mm; !important;
	  position: block !important;
	  /* margin: 3% auto auto auto; */
	  width: 210mm !important;
  }

  #svg358 {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-width: 210mm !important;
	max-height: 297mm; !important;
	width: 100% !important;
    height: 100% !important;
    page-break-before: always;
    page-break-after: always;
    page-break-inside: avoid;
	pointer-events:none !important;
  }
  
    #cards-scroll {
    page-break-before: always;
    page-break-after: avoid;
    width: 100% !important;
    margin: 0 !important;
    padding: 0.5in !important;
	pointer-events:none !important;
  }
  
  .cards-container {
            flex: 1;
            display: flex;
            flex-direction: column;
						 page-break-before: always;
    page-break-after: avoid;
        }
  .cards-grid {
            display: grid;
            /* grid-template-columns: repeat(auto-fill, minmax(80mm, 1fr)); */
			grid-template-columns: repeat(3, 1fr);
            gap: 25px;
            flex: 1;
            align-content: start;
			 page-break-before: avoid;
    page-break-after: avoid;
	margin-top: 500px;
        }
		

		
	.cards_header {
	/* position: fixed !important; */
    /* top: 4em !important; */
	}
	
	.a4-container {
            width: 210mm;
            height: 297mm;
            background: white;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
            padding: 15mm;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
        }

.card {
        width: 100% !important;
		background:white !important;
		
}

.card > * {
    /* Prevent inner elements from breaking */
    break-inside: avoid;
  }

@media print {
	
	.body {
		display: block !important; /* Override any flex/grid on body */
	}
	

 
	
  /* Reset margins and padding for the entire document */
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
 .card {
   /* Prevent splitting items across pages */
    break-inside: avoid;
    page-break-inside: avoid;
    
    /* Control text orphans/widows inside items */
    orphans: 13; /* Minimum 3 lines at bottom of page */
    widows: 13;  /* Minimum 3 lines at top of page */
    
    /* Ensure entire item moves to next page if it doesn't fit */
    page-break-before: auto;
    page-break-after: auto;
 }
  
  

  /* Ensure SVG is visible and properly scaled */


  /* Container for cards - ensure it starts on new page */
  
      #cards-scroll {
   
    page-break-after: avoid;
    /* width: 100% !important; */
    /* margin: 0 !important; */
    /* padding: 0.5in !important; */
	
	
	  }


  /* Individual card styling */
  #cards-scroll > div {
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 10pt;
    margin-top: 25pt;
    padding: 10pt;
    border: 1pt solid #ccc !important;
    background: white !important;
    color: black !important;
    box-shadow: none !important;
  }

  /* General print optimizations */
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
    color: black !important;
    font-size: 12pt;
    line-height: 1.4;
  }

  /* Hide unnecessary elements */
  nav, footer, header, .no-print {
    display: none !important;
  }

  /* Link handling */
  a {
    color: black !important;
    text-decoration: underline !important;
  }

  /* Ensure adequate contrast */
  * {
    color: black !important;
    background: transparent !important;
  }

  /* Page size and margins */
  @page {
    size: A4;
    margin: 0.1in;
    /* margin-top: 2in; */
  }

  /* Prevent orphaned/widowed lines in cards */
  #cards-scroll > div {
    orphans: 3;
    widows: 3;
  }
}