/* H3.7.8.16.15 — only the shared document preview; no global page-size override. */
#sw1615-viewer{position:fixed;inset:0;z-index:2147483000;display:flex;flex-direction:column;background:#dfe4ed;color:#0b1739;font:13px system-ui,-apple-system,Segoe UI,sans-serif}
#sw1615-viewer .sw1615-toolbar{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:12px 22px;background:#0b1739;color:white;min-height:64px;flex:none}
#sw1615-viewer .sw1615-title{display:flex;flex-direction:column;min-width:0;gap:4px}
#sw1615-viewer .sw1615-title strong{font-weight:650;font-size:15px;overflow-wrap:anywhere}
#sw1615-viewer .sw1615-title small{font-size:11px;color:#cbd5e1}
#sw1615-viewer .sw1615-actions{display:flex;align-items:center;flex-wrap:wrap;gap:9px}
#sw1615-viewer .sw1615-actions button,#sw1615-viewer .sw1615-actions select{border:1px solid #bdc7db;background:white;color:#0b1739;border-radius:4px;font:600 12px system-ui;padding:9px 13px;cursor:pointer}
#sw1615-viewer .sw1615-actions .sw1615-print{background:#2954e5;border-color:#2954e5;color:white}
#sw1615-viewer .sw1615-actions button:disabled{background:#8c99b4;border-color:#8c99b4;cursor:not-allowed}
#sw1615-viewer .sw1615-page-count{font-size:11px;color:#cbd5e1;white-space:nowrap}
#sw1615-viewer .sw1615-message{padding:8px 24px;margin:0;font-size:11px;line-height:1.5;background:#f1f5fb;color:#38445a;flex:none}
#sw1615-viewer .sw1615-message.sw1615-error{background:#fff0ec;color:#982d20;font-weight:600}
#sw1615-viewer .sw1615-stage{flex:1;min-height:0;overflow:auto;padding:20px 25px 45px;display:block}
#sw1615-viewer .sw1615-stack{display:flex;flex-direction:column;align-items:center;gap:22px;width:max-content;min-width:100%;box-sizing:border-box}
#sw1615-viewer .sw1615-slot{display:flex;flex-direction:column;align-items:flex-start;flex:none;gap:6px}
#sw1615-viewer .sw1615-sheet-label{background:#e9edf4;color:#435574;padding:3px 8px;border-radius:4px;font-size:11px}
#sw1615-viewer .sw1615-paper{background:#fff!important;color:#172338;display:block;flex:none;position:relative;box-shadow:0 4px 16px rgba(16,29,51,.16)!important}
#sw1615-viewer .sw1615-paper table{max-width:100%}
#sw1615-viewer .sw1615-paper thead{display:table-header-group}
#sw1615-viewer .sw1615-paper td,#sw1615-viewer .sw1615-paper th{overflow-wrap:break-word}
#sw1615-viewer .sw1615-paper[data-sw1615-sample="1"]::after{content:"SAMPLE — NOT FOR EXECUTION";position:absolute;pointer-events:none;top:42%;left:5%;transform:rotate(-30deg);font-size:42px;font-weight:800;color:rgba(200,60,60,.17);white-space:nowrap;z-index:8}
@media(max-width:800px){#sw1615-viewer .sw1615-toolbar{align-items:flex-start;flex-direction:column}#sw1615-viewer .sw1615-stage{padding:10px}#sw1615-viewer .sw1615-actions{gap:6px}}
/* Print exactly the SAME paper nodes that were reviewed on screen. */
@media print{
  html,body{margin:0!important;padding:0!important;width:auto!important;height:auto!important;min-height:0!important;overflow:visible!important;background:white!important}
  body>*:not(#sw1615-viewer):not(#sw1615-page-rule){display:none!important}
  body.sw1615-active #sw1615-viewer{display:block!important;position:static!important;inset:auto!important;width:auto!important;height:auto!important;min-height:0!important;overflow:visible!important;margin:0!important;padding:0!important;background:white!important;box-shadow:none!important}
  body.sw1615-active #sw1615-viewer.sw1615-invalid .sw1615-stack{display:none!important}
  body.sw1615-active #sw1615-viewer.sw1615-invalid .sw1615-message{display:block!important;color:#982d20!important;font:700 16px system-ui!important;padding:35px!important}
  body.sw1615-active #sw1615-viewer .sw1615-toolbar,
  body.sw1615-active #sw1615-viewer .sw1615-message,
  body.sw1615-active #sw1615-viewer .sw1615-sheet-label{display:none!important}
  body.sw1615-active #sw1615-viewer .sw1615-stage,
  body.sw1615-active #sw1615-viewer .sw1615-stack,
  body.sw1615-active #sw1615-viewer .sw1615-slot{display:block!important;position:static!important;inset:auto!important;width:auto!important;min-width:0!important;max-width:none!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;margin:0!important;padding:0!important;gap:0!important;zoom:1!important;transform:none!important;background:white!important}
  body.sw1615-active #sw1615-viewer .sw1615-paper{display:block!important;position:relative!important;margin:0!important;box-shadow:none!important;overflow:hidden!important;box-sizing:border-box!important;break-inside:avoid!important;page-break-inside:avoid!important;break-after:page!important;page-break-after:always!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  body.sw1615-active #sw1615-viewer .sw1615-slot:last-child .sw1615-paper{break-after:auto!important;page-break-after:auto!important}
  body.sw1615-active #sw1615-viewer .sw1615-paper.page-break-marker,
  body.sw1615-active #sw1615-viewer .sw1615-paper .page-break-marker{break-before:auto!important;page-break-before:auto!important}
  body.sw1615-active #sw1615-viewer .sw1615-paper .no-print{display:none!important}
}

/* H3.7.8.16.17 — layout-affecting zoom for print, NOT transform:scale().
   Browsers reserve layout space for transforms, which causes blank extra sheets.
   The identical zoom is visible in the in-app preview. Only A4 landscape
   reports expose the fit mode; legal documents remain full-size unchanged. */
#sw1615-viewer.sw1615-printer-fit .sw1615-paper{zoom:.75!important}
@media print{
  body.sw1615-active #sw1615-viewer.sw1615-printer-fit .sw1615-paper{zoom:.75!important}
}

/* H3.7.8.16.18 — isolate this viewer from the original React modal's
   print-only `body * {visibility:hidden}` rule. The cloned, validated paper
   is visible for both PDF and physical printing, while fields that were
   already hidden in the original source remain hidden. Only when this
   preview is open; no global effect on CTS/SPA/other document previews. */
@media print {
  body.sw1615-active #sw1615-viewer,
  body.sw1615-active #sw1615-viewer .sw1615-paper,
  body.sw1615-active #sw1615-viewer .sw1615-paper * {
    visibility:visible!important;
  }
  body.sw1615-active #sw1615-viewer .sw1615-paper .sw1615-originally-hidden,
  body.sw1615-active #sw1615-viewer .sw1615-paper .sw1615-originally-hidden * {
    visibility:hidden!important;
  }
}

/* H3.7.8.16.19 — retain authored Legal page flex flow in actual printing.
   Old DocumentViewer's global print rule removes this layout, which can
   relocate footer/signature blocks. The screen preview and printed paper
   must use the same column structure and calibrated inner zoom. */
@media print {
  body.sw1615-active #sw1615-viewer .sw1615-paper.legal-page{
    display:flex!important;flex-direction:column!important;
    align-items:stretch!important;justify-content:flex-start!important;
  }
}
