/* ============================================================
   TraceRecord — print styling for a saved output sheet
   Screen is untouched: every rule here lives inside @media print.
   ============================================================ */
#tr-print-sheet { display: none; }

@media print {
  @page { size: A4; margin: 16mm; }

  /* only the cloned sheet prints. It is a direct child of body and stays in
     normal flow, so long schedules paginate instead of being cut at page one. */
  body.tr-printing-sheet > *:not(#tr-print-sheet) { display: none !important; }
  body.tr-printing-sheet #tr-print-sheet {
    display: block !important;
    color: #24313f;
    font: 10pt/1.5 "Source Sans 3", system-ui, sans-serif;
  }

  .tr-print-head {
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1.6px solid #182c46;
  }
  .tr-print-title {
    margin: 0;
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 15pt;
    font-weight: 700;
    color: #0f1b2d;
  }
  .tr-print-meta {
    margin: 3px 0 0;
    font-size: 8pt;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #3c6081;
  }
  .tr-print-prov {
    margin: 8px 0 0;
    padding: 6px 9px;
    border-left: 2px solid #b7791f;
    background: #fbf5e8;
    font-size: 8.5pt;
    line-height: 1.45;
    color: #40525f;
  }

  #tr-print-sheet .u-output-sheet,
  #tr-print-sheet .tool-caption-list,
  #tr-print-sheet ul,
  #tr-print-sheet ol { border: 0; padding: 0; margin: 0; list-style: none; }
  #tr-print-sheet .u-output-sheet { border: 1px solid #8b8578; padding: 12px 14px; }
  #tr-print-sheet h2, #tr-print-sheet h3 {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 11.5pt;
    color: #182c46;
    margin: 12px 0 5px;
    break-after: avoid;
  }
  #tr-print-sheet li,
  #tr-print-sheet .u-output-line,
  #tr-print-sheet .u-doc-line,
  #tr-print-sheet .tool-caption-card {
    break-inside: avoid;
    padding: 5px 0;
    border-bottom: 1px solid #e8e2d3;
  }
  #tr-print-sheet .u-ref { font-family: ui-monospace, Menlo, monospace; font-weight: 700; color: #3c6081; }
  #tr-print-sheet .u-output-missing,
  #tr-print-sheet .tr-print-missing { color: #944238; }
  #tr-print-sheet .tr-print-value { color: #24313f; }
  /* screen-only framing that should not survive into the document */
  #tr-print-sheet [class*="boundary"],
  #tr-print-sheet [class*="local-box"],
  #tr-print-sheet .u-output-dest,
  #tr-print-sheet .u-output-section { display: none; }
  /* the quote/invoice prints as the firm's document: full width, own rules */
  #tr-print-sheet .u-doc-head { display: flex; justify-content: space-between; gap: 20pt;
    padding-bottom: 8pt; border-bottom: 1.5pt solid #14181c; }
  #tr-print-sheet .u-doc-logo { max-width: 150pt; max-height: 46pt; }
  #tr-print-sheet .u-doc-meta { text-align: right; }
  #tr-print-sheet .u-doc-line { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 12pt; }
  #tr-print-sheet .u-doc-totals { margin-left: auto; max-width: 200pt; }
  #tr-print-sheet .u-doc-credit { margin-top: 16pt; padding-top: 6pt; border-top: .75pt solid #d8d0be;
    font-size: 7.5pt; color: #8b8578; }
  #tr-print-sheet .u-hint, #tr-print-sheet .u-output-kicker { display: none; }
}
