.document-preview {
  width:min(1080px,calc(100vw - 32px)); height:min(920px,calc(100dvh - 32px));
  max-width:none; max-height:none; padding:0; border:1px solid #dce2d8;
  border-radius:20px; background:#fff; color:#263e33; box-shadow:0 18px 80px #123f3733;
}
.document-preview[open] { display:grid; grid-template-rows:auto auto auto minmax(0,1fr) auto; }
.document-preview::backdrop { background:rgba(13,48,42,.48); }
.document-preview-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:20px 24px 10px; }
.document-preview-heading>div { min-width:0; }
.document-preview-heading .eyebrow { margin:0 0 5px; }
.document-preview h2 { font-size:24px; line-height:1.2; margin:0; overflow-wrap:anywhere; }
.document-preview-info { margin:0; padding:0 24px 14px; font-size:13px; color:#5e7066; overflow-wrap:anywhere; }
.document-preview-tools { display:flex; gap:10px; align-items:center; flex-wrap:wrap; padding:12px 24px; border-top:1px solid #dce2d8; }
.document-preview-counter { font-size:14px; font-variant-numeric:tabular-nums; }
.document-preview-stage { overflow:auto; background:#e9ede7; padding:20px; overscroll-behavior:contain; }
.document-preview-image { display:block; width:auto; max-width:100%; height:auto; margin:0 auto; background:#fff; box-shadow:0 2px 15px #123f3722; }
.document-preview-image[hidden],.document-preview [hidden] { display:none!important; }
.document-preview-stage.is-enlarged .document-preview-image { max-width:none; margin:0; }
.document-preview-status { text-align:center; }
.document-preview-message { margin:20px auto; max-width:650px; line-height:1.6; }
.document-preview-footer { padding:14px 24px; display:flex; gap:14px; justify-content:space-between; align-items:center; border-top:1px solid #dce2d8; }
.document-preview-footer p { margin:0; color:#5e7066; font-size:12px; }
.document-preview-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; flex-shrink:0; }
.document-preview a { text-decoration:none; text-align:center; }
.document-preview :is(button,a) { box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:10px 14px;border:1px solid #aebfb0;border-radius:8px;background:#fff;color:#123f37;font:500 14px/1.3 system-ui,sans-serif;cursor:pointer; }
.document-preview :is(button,a):focus-visible { outline:3px solid #bd8738;outline-offset:3px; }
.document-preview .primary-button { background:#123f37;color:#fff;border-color:#123f37; }
.pdf-preview-page { max-width:760px;margin:10vh auto;padding:24px;color:#123f37;font:16px/1.6 system-ui,sans-serif; }
.document-preview button:disabled { opacity:.45; cursor:default; }
@media(max-width:640px) {
  .document-preview { width:calc(100vw - 12px); height:calc(100dvh - 12px); border-radius:12px; }
  .document-preview-heading { padding:14px 14px 10px; gap:10px; }
  .document-preview h2 { font-size:20px; }
  .document-preview-info { padding:0 14px 10px; }
  .document-preview-tools { padding:10px; gap:7px; }
  .document-preview-tools button { padding:9px 10px; font-size:12px; }
  .document-preview-counter { font-size:12px; }
  .document-preview-stage { padding:8px; }
  .document-preview-footer { padding:12px; flex-direction:column; align-items:stretch; }
  .document-preview-actions { display:grid; grid-template-columns:1fr 1fr; }
  .document-preview-actions .primary-button { grid-column:1/-1; }
  .document-preview-actions a { padding:12px 8px; font-size:12px; }
}
