/* ============================================================
   Compound Interest Calculator — Print stylesheet
   ============================================================ */

@media print {

   /* --- Hide non-essential chrome --- */
   .site-header,
   .site-footer,
   .ad-mobile-sticky,
   .ad-banner-top,
   .ad-tower-left,
   .ad-tower-right,
   .breadcrumb {
      display: none !important;
   }

   /* --- Reset dark background for print --- */
   :root {
      --bg-void:       #fff;
      --bg-base:       #fff;
      --bg-surface:    #fff;
      --bg-card:       #f8f8fa;
      --bg-input:      #f4f4f6;
      --text:          #222;
      --text-muted:    #555;
      --text-heading:  #111;
      --border:        #ccc;
      --border-subtle: #ddd;
      --accent:        #2563eb;
      --accent-dim:    #2563eb;
      --accent-text:   #1d4ed8;
   }

   body {
      background: #fff;
      color: #222;
      font-size: 11pt;
   }

   /* --- Collapse the grid layout to single column --- */
   .tool-layout {
      display: block;
      max-width: none;
      padding: 0;
      margin: 0;
   }

   .tool-content {
      display: block;
   }

   /* --- Page header --- */
   .tool-page-header {
      margin-bottom: 16pt;
      page-break-after: avoid;
   }

   .tool-page-header h1 {
      font-size: 16pt;
   }

   /* --- Tool body card — remove background for cleaner print --- */
   .tool-body {
      background: none;
      border: none;
      padding: 0;
      min-height: 0;
   }

   .ci-calculator {
      gap: 20pt;
   }

   /* --- Input form: compact 2-column grid --- */
   .ci-form {
      grid-template-columns: 1fr 1fr;
      gap: 8pt;
      page-break-after: avoid;
   }

   .ci-field label {
      font-size: 7pt;
      margin-bottom: 2pt;
   }

   .ci-input-wrap input,
   .ci-input-wrap select {
      height: auto;
      padding: 4pt 8pt;
      font-size: 10pt;
      border: 1px solid #bbb;
   }

   .ci-input-wrap--currency input {
      padding-left: 18pt;
   }

   /* --- Summary cards: keep together --- */
   .ci-summary {
      grid-template-columns: repeat(3, 1fr);
      gap: 8pt;
      page-break-inside: avoid;
      page-break-before: avoid;
   }

   .ci-summary-card {
      padding: 10pt;
      border: 1px solid #ccc;
   }

   .ci-summary-card--total {
      background: #f0f4ff;
      border-color: #93b4ff;
   }

   .ci-summary-card__label {
      font-size: 6.5pt;
      margin-bottom: 4pt;
   }

   .ci-summary-card__value {
      font-size: 12pt;
   }

   .ci-summary-card__value--interest {
      color: #15803d;
   }

   .ci-summary-card--total .ci-summary-card__value {
      color: #1d4ed8;
   }

   /* --- Chart: keep together on one page --- */
   .ci-chart-section {
      page-break-inside: avoid;
      page-break-before: auto;
   }

   .ci-chart-section h3,
   .ci-table-section h3 {
      font-size: 11pt;
      margin-bottom: 8pt;
   }

   .ci-chart {
      height: 140pt;
      border-bottom: 1px solid #999;
   }

   .ci-chart__seg--contributions {
      background: #93b4ff;
      -webkit-print-color-adjust: exact;
      print-color-adjust: exact;
   }

   .ci-chart__seg--interest {
      background: #6ee7b7;
      -webkit-print-color-adjust: exact;
      print-color-adjust: exact;
   }

   .ci-legend__dot {
      -webkit-print-color-adjust: exact;
      print-color-adjust: exact;
   }

   .ci-legend--contributions .ci-legend__dot {
      background: #93b4ff;
   }

   .ci-legend--interest .ci-legend__dot {
      background: #6ee7b7;
   }

   .ci-chart-legend {
      font-size: 7.5pt;
      margin-top: 6pt;
   }

   /* --- Table: allow page breaks between rows, but not mid-row --- */
   .ci-table-section {
      page-break-before: auto;
   }

   .ci-table {
      font-size: 9pt;
   }

   .ci-table th {
      font-size: 7pt;
      padding: 4pt 8pt;
      border-bottom: 1.5pt solid #999;
   }

   .ci-table td {
      padding: 3pt 8pt;
      border-bottom: 0.5pt solid #ddd;
   }

   .ci-table thead {
      display: table-header-group;
   }

   .ci-table tr {
      page-break-inside: avoid;
   }

   .ci-table tbody tr:hover {
      background: none;
   }

   /* --- General print helpers --- */
   a {
      color: inherit;
      text-decoration: none;
   }
}
