﻿/* Image-only document preview; PDF links retain their original behavior. */
#agencyDocumentPreviewModal .modal-dialog { width:calc(100% - 32px); max-width:1080px; margin:16px auto; }
#agencyDocumentPreviewModal .modal-content { max-height:calc(100dvh - 32px); border:1px solid var(--agency-inner-edge, #e4e9f2); border-radius:12px; background:#fff; overflow:hidden; }
#agencyDocumentPreviewModal .modal-header { align-items:flex-start; gap:16px; padding:18px 22px; border-bottom:1px solid #edf0f5; }
#agencyDocumentPreviewModal .modal-title { flex:1; min-width:0; margin:0; color:var(--agency-heading-color, #17223a); font-size:17px; font-weight:700; line-height:1.5; overflow-wrap:anywhere; }
#agencyDocumentPreviewModal .btn-close { flex:0 0 auto; margin:0 0 0 auto; }
#agencyDocumentPreviewModal .modal-body { min-height:0; padding:16px; overflow:auto; }
#agencyDocumentPreviewStage { position:relative; display:grid; place-items:center; min-height:180px; height:min(68dvh, 720px); max-height:calc(100dvh - 210px); padding:12px; border:1px solid #edf0f5; border-radius:8px; background:#f6f8fb; }
#agencyDocumentPreviewImage { display:flex; align-items:center; justify-content:center; width:100%; height:100%; min-height:0; overflow:hidden; }
#agencyDocumentPreviewImage img { display:block; max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain; }
#agencyDocumentPreviewImage img[hidden], #agencyDocumentPreviewModal [hidden] { display:none !important; }
#agencyDocumentPreviewLoading { position:absolute; display:flex; align-items:center; justify-content:center; gap:10px; color:#526078; font-size:13px; }
#agencyDocumentPreviewError { position:absolute; inset-inline:20px; margin:0; text-align:center; font-size:13px; line-height:1.7; color:#b42318; }
#agencyDocumentPreviewModal .modal-footer { flex:0 0 auto; gap:10px; padding:14px 22px; border-top:1px solid #edf0f5; background:#fafbfd; }
#agencyDocumentPreviewModal .document-preview-button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:40px; padding:8px 14px; border:1px solid var(--agency-inner-edge, #e4e9f2); border-radius:8px; background:#fff; color:var(--agency-heading-color, #17223a); text-decoration:none; font-size:13px; font-weight:700; }
#agencyDocumentPreviewModal .document-preview-button:focus-visible { outline:2px solid #8f9eb5; outline-offset:2px; }
@media (max-width:575px) {
  #agencyDocumentPreviewModal .modal-dialog { width:calc(100% - 24px); margin:12px auto; }
  #agencyDocumentPreviewModal .modal-content { max-height:calc(100dvh - 24px); }
  #agencyDocumentPreviewModal .modal-header { padding:16px; }
  #agencyDocumentPreviewModal .modal-title { font-size:15px; }
  #agencyDocumentPreviewModal .modal-body { padding:12px; }
  #agencyDocumentPreviewModal .modal-footer { padding:12px 16px; }
  #agencyDocumentPreviewStage { height:64dvh; }
}
