.card-gallery{margin:5px 0 30px}.gallery-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:20px}.gallery-heading span{font-size:9px;letter-spacing:.16em;color:#8a9ab1}.gallery-heading h3{font-size:23px!important;letter-spacing:-.04em;margin:10px 0 0;color:#283f60}.gallery-heading>small{font-size:11px;color:#8a9ab1;white-space:nowrap}.archive-image{margin:0 0 25px;background:#f4f6fa;border-radius:22px;overflow:hidden;border:1px solid #eaf0f7}.image-open{display:block;padding:20px 18px 45px;width:100%;position:relative;background:#eff2f7;cursor:zoom-in;border:0;min-height:160px}.image-open img{width:100%;height:auto;max-height:500px;object-fit:contain;display:block;border-radius:9px}.image-open>span{position:absolute;bottom:14px;left:0;right:0;text-align:center;font-size:11px;color:#7489a8}.archive-image figcaption{padding:19px 19px 16px;background:#fff}.archive-image figcaption>div:first-child{display:flex;justify-content:space-between;align-items:center;gap:10px}.archive-image strong{font-size:15px;color:#3f5879}.archive-image small{font-size:10px;color:#8e9cb1}.image-actions{display:flex;gap:9px;margin-top:16px;flex-wrap:wrap}.image-actions button,.image-actions a{padding:11px 15px;font-size:12px;background:#edf3ff;color:#426fb7;border-radius:99px;text-decoration:none;line-height:1.3;border:0}.image-actions a{background:#2b63dd;color:white}.archive-image figcaption>p{font-size:10px;color:#8d9db3;margin:13px 0 0;line-height:1.6}.image-unavailable{min-height:180px}@media(max-width:600px){.gallery-heading h3{font-size:20px!important}.archive-image{border-radius:20px}.archive-image figcaption{padding:17px 15px}.image-actions{gap:8px}.image-actions button,.image-actions a{font-size:11px;padding:11px 13px}}

.gallery-heading [data-content="galleryTitle"]{white-space:pre-line;overflow-wrap:anywhere}

/* A bounded canvas keeps zoom independent of document layout and image pixels. */
:root body dialog.image-viewer {
  width: min(1120px, calc(100vw - 32px)); max-width: 1120px;
  height: min(940px, calc(100dvh - 32px)); max-height: calc(100dvh - 32px);
  padding: 0; border: 0; border-radius: 16px; margin: auto;
  background: #fff; color: #192638; box-shadow: 0 24px 90px #07132755;
  overflow: hidden;
}
:root body dialog.image-viewer[open] { display: flex; flex-direction: column; }
:root body .image-viewer::backdrop { background: #0d1729c9; }
:root body .image-viewer .viewer-header {
  display: flex; align-items: center; justify-content: space-between;
  flex: 0 0 auto; gap: 16px; padding: 18px 24px;
  background: #fff; border-bottom: 1px solid #e4e9ef;
}
:root body .image-viewer .viewer-header > div { min-width: 0; }
:root body .image-viewer .viewer-header span { color: #68778a; font-size: 10px; letter-spacing: .12em; }
:root body .image-viewer .viewer-header h2 { margin: 5px 0 0; font-size: 22px; line-height: 1.35; overflow-wrap: anywhere; }
:root body .image-viewer .viewer-close { flex-shrink: 0; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: #eef2f7; color: #203349; font-size: 28px; line-height: 1; box-shadow: none; }
:root body .image-viewer .viewer-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 16px; padding: 14px 22px 0; flex: 0 0 auto; }
:root body .image-viewer .viewer-modes { display: flex; flex-wrap: wrap; gap: 6px; }
:root body .image-viewer :is(.viewer-toolbar button, .viewer-download, .viewer-controls button, .viewer-retry) { min-height: 42px; border: 1px solid #dde4ee; border-radius: 999px; padding: 9px 15px; background: #fff; color: #294564; font-size: 14px; line-height: 1.4; text-decoration: none; box-shadow: none; }
:root body .image-viewer .viewer-toolbar button[aria-pressed=true] { background: #0755d8; color: #fff; border-color: #0755d8; }
:root body .image-viewer .viewer-download { color: #0755d8; }
:root body .image-viewer button:disabled { cursor: default; opacity: .45; }
:root body .image-viewer .viewer-info { flex: 0 0 auto; color: #596c82; font-size: 14px; line-height: 1.6; margin: 12px 24px; }
:root body .image-viewer .viewer-canvas {
  position: relative; flex: 1 1 auto; min-height: 160px; height: auto;
  overflow: hidden; margin: 0 18px; border: 1px solid #e0e6ee; border-radius: 10px;
  background: #f2f4f7; isolation: isolate; overscroll-behavior: contain;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
:root body .image-viewer .viewer-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; pointer-events: none; }
:root body .image-viewer .viewer-stage :is(img, canvas) { display: block; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
:root body .image-viewer .viewer-canvas.is-zoomed { cursor: grab; }
:root body .image-viewer .viewer-canvas.is-dragging { cursor: grabbing; }
:root body .image-viewer .viewer-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; color: #63748a; font-size: 14px; pointer-events: none; }
:root body .image-viewer .viewer-loading { position: absolute; z-index: 1; inset: 0 0 auto; height: 3px; overflow: hidden; pointer-events: none; background: #d7e5fc; }
:root body .image-viewer .viewer-loading > span { display: block; width: 35%; height: 100%; background: #0755d8; animation: viewer-progress 1.2s ease-in-out infinite; }
@keyframes viewer-progress { from { transform: translateX(-100%); } to { transform: translateX(390%); } }
:root body .image-viewer .viewer-controls { display: flex; justify-content: center; align-items: center; flex: 0 0 auto; gap: 8px; padding: 12px 18px 0; }
:root body .image-viewer .viewer-controls button[data-zoom] { width: 42px; height: 42px; padding: 0; font-size: 22px; }
:root body .image-viewer .viewer-scale { min-width: 54px; text-align: center; color: #405771; font-size: 14px; font-variant-numeric: tabular-nums; }
:root body .image-viewer .viewer-controls .viewer-zoom { margin-left: 8px; }
:root body .image-viewer .viewer-feedback { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; gap: 12px; min-height: 38px; padding: 8px 22px 0; }
:root body .image-viewer .viewer-status { margin: 0; color: #53677f; font-size: 14px; line-height: 1.6; }
:root body .image-viewer .viewer-retry { flex-shrink: 0; min-height: 34px; padding: 6px 12px; color: #0755d8; }
:root body .image-viewer .viewer-help { margin: 6px 22px 14px; color: #6b7d92; font-size: 13px; line-height: 1.6; text-align: center; }
:root body .image-viewer :is(button, a, .viewer-canvas):focus-visible { outline: 3px solid #78a6ef; outline-offset: -3px; }
:root body .image-viewer [hidden] { display: none !important; }
@media(max-width:600px) {
  :root body dialog.image-viewer { width: calc(100vw - 12px); height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); border-radius: 12px; }
  :root body .image-viewer .viewer-header { padding: 12px 16px; }
  :root body .image-viewer .viewer-header h2 { font-size: 18px; }
  :root body .image-viewer .viewer-toolbar { padding: 10px 12px 0; gap: 8px; }
  :root body .image-viewer :is(.viewer-toolbar button, .viewer-download) { min-height: 40px; font-size: 13px; padding: 9px 11px; }
  :root body .image-viewer .viewer-info { margin: 9px 14px; font-size: 13px; }
  :root body .image-viewer .viewer-canvas { margin: 0 8px; min-height: 120px; }
  :root body .image-viewer .viewer-controls { padding-top: 10px; }
  :root body .image-viewer .viewer-feedback { padding: 8px 14px 0; gap: 8px; }
  :root body .image-viewer .viewer-status { font-size: 13px; }
  :root body .image-viewer .viewer-help { margin: 5px 14px max(10px, env(safe-area-inset-bottom)); font-size: 13px; }
}
@media(max-height:580px) {
  :root body dialog.image-viewer { overflow-y: auto; }
  :root body .image-viewer .viewer-canvas { flex: 0 0 45dvh; min-height: 140px; }
}
@media(prefers-reduced-motion:reduce) { :root body .image-viewer .viewer-loading > span { animation: none; width: 100%; opacity: .65; } }
