/* ---- Print (DocxEditor.printToPdf() / Ctrl+P) ---------------------- */
/* Only .docx-editor-content (the actual document) is revealed; everything
   else on the page — our own chrome and any host-app markup around us —
   stays hidden regardless of where it lives in the DOM. */
@media print {
  /* Without this, Chrome/Safari/Firefox all drop background-color and
   * background-image by default when printing (the "Background graphics"
   * checkbox most users never see, let alone enable) — so table header
   * shading, cell backgrounds, and the watermark silently disappear in the
   * exported PDF even though they render fine on screen. Forcing this at
   * the html/body level (not just on .docx-editor-content) because some
   * browsers only honor it set that high up. */
  html, body {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
  body * {
    visibility: hidden !important;
  }
  .docx-editor-content,
  .docx-editor-content * {
    visibility: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
  .docx-editor-content {
    position: fixed !important;
    inset: 0 !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    /* Match the on-screen page margin (--de-page-margin-x/y, default 1in)
     * instead of a hardcoded 0.5in — a mismatched margin here is what makes
     * printed line-wrap/table widths drift from what the editor showed. */
    padding: var(--de-page-margin-y, 1in) var(--de-page-margin-x, 1in) !important;
    background: #fff !important;
  }
  .docx-page-break,
  .docx-editor-content .ProseMirror .docx-page-break {
    break-after: page;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
  }
  .docx-page-break::before,
  .docx-page-break::after,
  .docx-editor-content .ProseMirror .docx-page-break::before,
  .docx-editor-content .ProseMirror .docx-page-break::after {
    content: none !important;
  }
}
