/* ==================== PDF PRINT RULES (@media print) ==================== */
/* @page & @page :first margin boxes are injected dynamically by js/exam-renderer.js */
@page {
  size: A4 portrait;
  margin: 16mm 13mm 16mm 14mm;
}

@page :first {
  margin-top: 12mm;
}

@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .screen-only-hf {
    display: none !important;
  }

  html, body {
    height: auto;
    background: #ffffff !important;
    overflow: visible !important;
  }

  .studio-shell,
  .workspace {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }

  .topbar,
  .sidebar,
  .modal-backdrop,
  .batch-export-stage {
    display: none !important;
  }

  .preview-area {
    padding: 0 !important;
    display: block !important;
    background: #ffffff !important;
    overflow: visible !important;
  }

  .preview-stage {
    transform: none !important;
  }

  .exam-sheet {
    width: 100% !important;
    min-height: auto !important;
    padding: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  /* Repeat watermark & decorative frame across every printed PDF page */
  .watermark-layer {
    position: fixed;
    inset: 0;
  }

  .page-frame {
    position: fixed;
    inset: 0;
  }
}
