/* ============================================================
   Print styles: Meeting Prep Card, Case File, utility sheets
   Usage: window.print() with body.print-mode-card / .print-mode-file
   ============================================================ */

@page { size: A4; margin: 12mm; }

@media print {
  body:is(.print-mode-card, .card-active) .free-card-content[hidden] { display: block !important; }
  html, body { background: #fff !important; color: #111 !important; font-size: 10pt; }
  body::before { display: none !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; }

  /* Hide the interface with display:none. The old rule hid everything with
     visibility:hidden and then revealed the document, which left every hidden box
     in the flow, so the printout ran on into blank pages after the document. */
  .app-bar, .tool-sticky, .site-head, .site-foot, .mobile-cta, .toast, .skip-link,
  .result-head, .step-head, .progress-wrap, .step-nav, .screen-count, .badge-done,
  .file-toc, .file-topbar, .sec-rail, .to-top, .sec-toggle, .print-toolbar,
  .edit-btn, .check-progress, .cta-row, .upsell, .no-print { display: none !important; }
  /* The meeting-request draft sits outside the card and is meant to be copied
     into an email. On paper it printed a second page carrying an Edit button
     and a Copy button, which broke the one-page promise. */
  .request-note { display: none !important; }

  body:is(.print-mode-card, .card-active) #print-card,
  body.print-mode-file #print-file,
  body.print-sheet #print-sheet { display: block; width: 100%; }
  body:is(.print-mode-card, .card-active) .free-card-print-source { display: block !important; }
  .case-sec.collapsed .sec-body { display: block !important; }

  /* The free card is a one-page A4 working sheet. Keep its hierarchy clear while
     leaving enough room for the longest answer-driven questions. */
  body:is(.print-mode-card, .card-active) #print-card { border: 0 !important; box-shadow: none !important; padding: 0 !important; }
  body:is(.print-mode-card, .card-active) #print-card .card-doc-head { align-items: end !important; margin-bottom: 7pt !important; padding-bottom: 5pt !important; border-bottom: 1.5pt solid #111 !important; }
  body:is(.print-mode-card, .card-active) #print-card .card-doc-head h2 { font-size: 17pt !important; line-height: 1 !important; }
  body:is(.print-mode-card, .card-active) #print-card .doc-meta { max-width: 48%; font-size: 8pt !important; line-height: 1.25 !important; }
  body:is(.print-mode-card, .card-active) #print-card .card-sec { margin-bottom: 5pt !important; padding-top: 4pt !important; border-top: .5pt solid #aaa !important; break-inside: avoid !important; }
  body:is(.print-mode-card, .card-active) #print-card .card-sec:first-of-type { border-top: 0 !important; padding-top: 0 !important; }
  body:is(.print-mode-card, .card-active) #print-card .card-sec > header { margin-bottom: 3pt !important; padding-bottom: 2pt !important; }
  body:is(.print-mode-card, .card-active) #print-card .sec-head { margin-bottom: 0 !important; }
  body:is(.print-mode-card, .card-active) #print-card p { margin-bottom: 3pt !important; }
  body:is(.print-mode-card, .card-active) #print-card .big-line { font-size: 10pt !important; line-height: 1.3 !important; }
  body:is(.print-mode-card, .card-active) #print-card .check-row { padding: 2pt 0 !important; gap: 6pt !important; }
  body:is(.print-mode-card, .card-active) #print-card .card-list li { padding: 1pt 0 !important; font-size: 9pt !important; line-height: 1.25 !important; }
  body:is(.print-mode-card, .card-active) #print-card .quote-block { padding: 5pt 7pt !important; font-size: 9.5pt !important; line-height: 1.3 !important; border-left: 1.5pt solid #111 !important; }
  body:is(.print-mode-card, .card-active) #print-card .check-why { font-size: 7.5pt !important; line-height: 1.25 !important; margin-top: .5pt !important; }
  body:is(.print-mode-card, .card-active) #print-card .card-sec-label { margin-bottom: 2pt !important; font-size: 7.5pt !important; letter-spacing: .08em !important; }
  body:is(.print-mode-card, .card-active) #print-card .edit-value { padding: 0 !important; }

  /* the tick boxes are the point of the printout: empty squares to fill in by hand */
  .check { border: 1pt solid #000 !important; background: #fff !important; color: transparent !important; width: 12px !important; height: 12px !important; }
  .check::before { content: none !important; }
  .check[aria-checked="true"] { color: #000 !important; }
  .check[aria-checked="true"] svg { width: 10px !important; height: 10px !important; }
  .check-row.is-done .edit-value strong { text-decoration: line-through; }

  /* the on-screen inset for the fixed action bar would print as blank space */
  body.tool-page { padding-bottom: 0 !important; }
  /* so would the screen padding around the result: @page already sets the paper margin */
  .result-wrap, .file-shell { padding: 0 !important; }

  /* the hint is useful on paper, but "tap" is not a paper action */
  .sec-hint { display: block !important; }
  .sec-hint .on-screen { display: none !important; }
  .sec-hint .on-paper { display: inline !important; }

  /* nothing follows the last section in either document, so its bottom margin
     would only show up as blank space at the end of the last page */
  body.print-mode-file #print-file .case-sec:last-of-type { margin-bottom: 0 !important; }
  body:is(.print-mode-card, .card-active) #print-card .card-sec:last-of-type { margin-bottom: 0 !important; }

  .only-print { display: block !important; }
  a { color: #111 !important; text-decoration: none; }
  .case-sec, .card-doc { box-shadow: none !important; break-inside: avoid; }
  .case-sec { margin-bottom: 18pt; }

  /* serif, ink-on-paper document feel */
  .print-doc, #print-card, #print-file { font-family: 'IBM Plex Serif', Georgia, serif; }
  .print-doc h1, .print-doc h2, .print-doc h3, #print-card h2, #print-file h2 { font-family: 'IBM Plex Serif', Georgia, serif; }

  .case-sec.doc-page-break { break-before: page; }

  table.doc-table, table.tracker-table { border-collapse: collapse; width: 100%; font-size: 9pt; }
  .doc-table th, .tracker-table th { border-bottom: 1.5pt solid #111; font-size: 7.5pt; }
  .doc-table td, .tracker-table td { border-bottom: 0.5pt solid #bbb; padding: 4pt 3pt; }

  input, textarea, select { border: 0 !important; background: transparent !important; box-shadow: none !important; color: #111 !important; font-family: inherit !important; }
  .doc-blank { border-bottom: 0.75pt solid #999; min-height: 22pt; }

  .print-footer-note { display: block !important; font-size: 7pt; line-height: 1.2; color: #555; border-top: 0.5pt solid #999; margin-top: 5pt; padding-top: 3pt; }
}

.print-footer-note { display: none; }

/* ---------- on-screen preview of the printable doc ---------- */
.print-doc { color: #111; }
