/* Setup-sheet export (Pro, planning/v2-plan.md §4/§14) — a zero-dependency
   "PDF export" built on the browser's own print-to-PDF, not a PDF library.
   #print-sheet is built and populated by bridgeCompensation.js right before
   calling window.print(); it's invisible on screen (display:none outside of
   @media print) and is the ONLY thing visible once printing, regardless of
   which calculator/theme was on screen when the button was clicked. */

#print-sheet {
  display: none;
}

@media print {
  @page {
    margin: 1.5cm;
  }

  /* Take everything else OUT of the layout (not just hide it): hidden elements still
     occupy space, which printed blank pages after the sheet whenever the screen was long. */
  body > *:not(#print-sheet) {
    display: none !important;
  }

  html, body {
    overflow: visible !important;
    background: #fff !important;
    height: auto !important;
  }

  #print-sheet {
    display: block;
    position: static;
    width: 100%;
    color: #111;
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  }

  #print-sheet h2 {
    break-after: avoid;
  }

  #print-sheet thead {
    display: table-header-group;   /* repeat the column headings on each page */
  }

  #print-sheet tr {
    break-inside: avoid;
  }

  #print-sheet h1 {
    font-size: 1.3rem;
    margin: 0 0 2px;
  }

  #print-sheet .print-meta {
    color: #444;
    font-size: 0.85rem;
    margin: 0 0 18px;
  }

  #print-sheet h2 {
    font-size: 1rem;
    margin: 22px 0 8px;
    border-bottom: 1px solid #999;
    padding-bottom: 4px;
  }

  #print-sheet .print-note {
    font-size: 0.78rem;
    color: #444;
    margin: 0 0 8px;
  }

  #print-sheet table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
  }

  #print-sheet th, #print-sheet td {
    border: 1px solid #999;
    padding: 4px 8px;
    text-align: left;
  }

  #print-sheet th {
    background: #eee;
  }

  #print-sheet .print-footer {
    margin-top: 20px;
    font-size: 0.72rem;
    color: #666;
  }
}

/* Button styling for the inline export trigger, screen-only (this button
   itself is hidden by the rule above once printing). */
.export-sheet-row {
  margin-top: 16px;
}

.export-sheet-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 9px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
}
