/*
  CostBleed print stylesheet
  ------------------------------------------------------------------------
  Loaded with <link media="print">. Goals: legible in plain black-on-white
  greyscale, no colour-only meaning survives the trip to paper, no wasted
  chrome (navigation, toasts, action buttons) on the page.
*/

@media print {
  /*
    The screen palette is light-on-dark (bone ivory text on obsidian/
    charcoal). Every component below reads its colour from these tokens, so
    without reassigning them here the *rules* on this page (borders, layout)
    would print correctly while the *text* -- anything set in
    --text-secondary / --text-muted -- would render as a pale grey close to
    invisible on the forced white background. Redefining the tokens for
    print is what actually delivers "legible in plain black-on-white
    greyscale": every component downstream inherits a real dark-on-white
    pair for free, with no per-selector patching.
  */
  :root {
    --surface-canvas: #fff;
    --surface-raised: #fff;
    --surface-overlay: #f2f2f2;
    --surface-sunken: #fff;
    --border-subtle: #bbb;
    --border-strong: #666;
    --text-primary: #000;
    --text-secondary: #222;
    --text-muted: #444;
    --text-on-fill: #000;
    --text-link: #000;
    --accent-info: #333;
    --accent-support: #000;
    --accent-warning: #000;
    --accent-risk: #000;
    --accent-risk-fill: transparent;
    --accent-action: #000;
  }

  * {
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  html, body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
  }

  a {
    color: #000 !important;
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #444 !important;
  }

  .rail,
  .topbar,
  .skip-link,
  .toast-region,
  .btn,
  .finding-card__review-form,
  .page-header__actions,
  .tabs {
    display: none !important;
  }

  .app-shell {
    display: block !important;
  }

  .content,
  .content--wide {
    max-width: none !important;
    padding: 0 !important;
  }

  .card,
  .finding-card,
  .ledger,
  .stat-tile,
  .empty-state,
  .review-column,
  .chip,
  .pill,
  .calc-proof {
    border: 1px solid #333 !important;
    break-inside: avoid;
  }

  .pill {
    border-width: 1.5px !important;
  }

  .ledger__row[data-bucket="potential_bleed"],
  .ledger__row[data-bucket="recommended_hold"] {
    border-left: 4px solid #000 !important;
  }

  /* Underline mark survives the trip to paper as a solid black rule under
     bold text -- no fill to lose in greyscale. */
  mark.cited-span {
    background: transparent !important;
    color: #000 !important;
    font-weight: 700;
    border-bottom: 2px solid #000 !important;
  }

  .data-table thead th {
    border-bottom: 1.5px solid #000 !important;
    color: #000 !important;
  }

  .data-table tbody td {
    border-bottom: 1px solid #999 !important;
  }

  .finding-card__amount-value,
  .ledger__amount,
  .stat-tile__value {
    color: #000 !important;
  }

  h1, h2, h3, .finding-card__title, .display {
    color: #000 !important;
  }

  .review-grid {
    display: block !important;
  }

  .review-column {
    max-height: none !important;
    overflow: visible !important;
    margin-bottom: 12pt;
  }
}
