/* Shared, isolated viewer: it must also work above an existing Bootstrap modal. */
.jq-file-preview[hidden],
.jq-file-preview [hidden] { display: none !important; }
.jq-file-preview {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 22, 38, .78);
  color: #173247;
  font: 14px/1.5 "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  overscroll-behavior: contain;
}
.jq-file-preview *, .jq-file-preview *::before, .jq-file-preview *::after { box-sizing: border-box; }
.jq-file-preview-panel {
  display: flex;
  flex-direction: column;
  width: 1120px;
  max-width: 100%;
  height: 86vh;
  height: min(900px, 90dvh);
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #f5f7f9;
  border: 1px solid rgba(182, 143, 117, .6);
  border-radius: 8px;
  box-shadow: 0 20px 72px rgba(0, 0, 0, .25);
}
.jq-file-preview-header {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 16px;
  min-height: 64px;
  padding: 12px 20px;
  background: #003153;
  color: #fff;
  border-bottom: 3px solid #b68f75;
}
.jq-file-preview-heading { flex: 1; min-width: 0; }
.jq-file-preview-title { margin: 0; color: inherit; font: inherit; font-weight: 650; overflow-wrap: anywhere; }
.jq-file-preview-type { display: block; margin-top: 2px; color: #c8d4dd; font-size: 12px; }
.jq-file-preview-actions, .jq-file-preview-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.jq-file-preview button, .jq-file-preview-download {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 36px;
  margin: 0;
  padding: 5px 12px;
  color: #173247;
  background: #fff;
  border: 1px solid #c8d4dd;
  border-radius: 4px;
  font: inherit;
  line-height: 1.5;
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
}
.jq-file-preview-header button, .jq-file-preview-download { color: #fff; background: transparent; border-color: #91a6b5; }
.jq-file-preview button:disabled { cursor: not-allowed; opacity: .45; }
.jq-file-preview button:focus-visible, .jq-file-preview a:focus-visible { outline: 2px solid #b68f75; outline-offset: 3px; }
.jq-file-preview-close { min-width: 42px; }
.jq-file-preview-toolbar { flex-shrink: 0; justify-content: center; padding: 8px 12px; border-bottom: 1px solid #dce3e8; background: #fff; }
.jq-file-preview-toolbar input { width: 56px; min-height: 36px; padding: 4px; border: 1px solid #c8d4dd; border-radius: 4px; color: #173247; background: #fff; font: inherit; text-align: center; }
.jq-file-preview-toolbar select { min-height: 36px; padding: 4px 8px; color: #173247; border: 1px solid #c8d4dd; border-radius: 4px; background: #fff; font: inherit; }
.jq-file-preview-stage {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  padding: 16px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.jq-file-preview-content { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 0; }
.jq-file-preview-content img, .jq-file-preview-content video { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; background: #10202c; }
.jq-file-preview-content video { width: 100%; }
.jq-file-preview-stage.is-pdf { display: block; }
.jq-file-preview-content.is-pdf { display: block; height: auto; width: max-content; margin: 0 auto; }
.jq-file-preview-content canvas { display: block; background: #fff; box-shadow: 0 2px 12px rgba(0, 25, 45, .12); }
.jq-file-preview-content pre { width: 100%; align-self: flex-start; margin: 0; padding: 16px; color: #173247; background: #fff; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.8 monospace; }
.jq-file-preview-status { flex-shrink: 0; min-height: 36px; margin: 0; padding: 8px 20px; color: #516978; background: #fff; font-size: 12px; border-top: 1px solid #dce3e8; }
.jq-file-preview-status.is-error { color: #a13a32; background: #fff3f1; }
.jq-preview-trigger { cursor: pointer; touch-action: manipulation; }
button.jq-media-preview-trigger { display: block; position: relative; width: 100%; padding: 0; border: 0; background: #10202c; color: #fff; overflow: hidden; text-align: center; cursor: pointer; }
.jq-media-preview-trigger img, .jq-media-preview-trigger video { display: block; width: 100%; max-height: 360px; object-fit: contain; pointer-events: none; }
.jq-media-preview-trigger > .jq-preview-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 10px 16px; border-radius: 4px; background: rgba(0, 49, 83, .88); color: #fff; font-size: 14px; white-space: nowrap; pointer-events: none; }
.report-media-tile > .jq-media-preview-trigger { height: 112px; }
.report-media-tile > .jq-media-preview-trigger img, .report-media-tile > .jq-media-preview-trigger video { height: 112px; object-fit: cover; }
.report-media-tile > .report-media-remove { z-index: 3; }
.case-gallery-edit-item button[data-file-preview] { position: static; width: 100%; height: 100%; background: transparent; border-radius: 0; }
.case-gallery-edit-item button[data-file-preview] img { width: 100%; height: 100%; object-fit: cover; }
.case-video-preview .jq-media-preview-trigger, .case-video-player .jq-media-preview-trigger { min-height: 180px; }
.case-video-preview .jq-media-preview-trigger, .case-video-player .jq-media-preview-trigger { height: 100%; }
.case-video-preview .jq-media-preview-trigger img, .case-video-player .jq-media-preview-trigger img { height: 100%; max-height: none; object-fit: cover; }
#websiteCaseCoverPreview[data-file-preview], [data-image-preview][data-file-preview] { cursor: zoom-in; }
@media (max-width: 600px) {
  .jq-file-preview { padding: 8px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .jq-file-preview-panel { width: 100%; height: 94vh; height: 94dvh; }
  .jq-file-preview-header { gap: 8px; padding: 10px 12px; }
  .jq-file-preview-actions { flex-wrap: nowrap; gap: 6px; }
  .jq-file-preview-stage { padding: 8px; }
  .jq-file-preview-toolbar { gap: 6px; }
  .jq-file-preview button, .jq-file-preview-download { min-height: 40px; padding: 5px 10px; }
}
