/* ==========================================================================
   Print stylesheet — only the Maintenance Risk Brief prints, on-brand,
   fitted to A4 / US Letter. Activated via window.print() on Screen 5.
   ========================================================================== */

@page {
  size: A4;
  margin: 18mm 16mm 20mm;
}

@media print {
  /* Hide all app chrome */
  .app-header, .app-footer, .brief-toolbar, #toast-host, .flow-rail { display: none !important; }

  html, body { background: #fff !important; }
  body { font-size: 11pt; color: #374151; }

  #view, .page, .page-wide { margin: 0; padding: 0; max-width: none; }

  /* The document itself becomes the page — strip the screen card chrome */
  .brief-doc {
    border: none !important; border-radius: 0 !important;
    padding: 0 !important; max-width: none !important; margin: 0 !important;
    background: #fff !important;
  }

  .brief-doc-head { border-bottom: 1px solid rgba(55,65,81,0.2); }
  .brief-section { margin-top: 22pt; }
  .brief-section h2 { font-size: 18pt; }

  /* Keep logical blocks together across page breaks */
  .brief-section, .brief-asset, .gap-item, .review-note-item, .stat { break-inside: avoid; }
  .disclaimer { break-inside: avoid; }

  /* Wordmark + emblem footer on the printed page */
  .wordmark { color: #374151 !important; }
  .wordmark .a { color: #5FB8D6 !important; }

  .brief-doc-foot {
    display: flex !important; align-items: center; justify-content: space-between;
    margin-top: 24pt; padding-top: 8pt; border-top: 1px solid rgba(55,65,81,0.15);
  }
  .brief-doc-foot .emblem { height: 22px; width: auto; }
  .brief-doc-foot .foot-text { font-size: 8pt; color: #9CA3AF; }

  /* Running footer with emblem on every printed sheet */
  a[href]::after { content: ""; } /* don't print URLs */

  .stat-row { border-color: rgba(55,65,81,0.2) !important; }
  .stat { background: #fff !important; }
  .stat-value { font-size: 18pt; }

  .ai-placeholder { background: #fff !important; border: 1px dashed rgba(55,65,81,0.25) !important; }

  /* Chat assistant is screen-only; never print it. */
  .chat-launcher, .chat-panel { display: none !important; }

  /* AI narration prints as plain prose within the brief. */
  .ai-narration-text { color: #000 !important; }
  .ai-fallback-note { color: rgba(55,65,81,0.7) !important; }
}
