/* One compact, intrinsic-ratio viewer for every image role. */
#imageDialog{width:fit-content;height:fit-content;min-height:0;max-width:min(94vw,1100px);max-height:90dvh;padding:0;overflow:hidden;margin:auto;background:white;color:#252a30;border:1px solid #d0d7de;border-radius:10px}
#imageDialog[open]{display:flex;flex-direction:column}
#imageDialog .dialog-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:54px;padding:10px 12px;background:white;flex:none}
#dialogTitle{font:650 13px/1.4 system-ui;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
#imageDialog .dialog-bar button{width:34px;height:34px;min-width:34px;padding:0;display:grid;place-items:center;background:#f0f4f8;color:#0550ae;border:0;border-radius:6px;flex:none}
#imageDialog svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#imageDialog .image-scroll{height:auto;min-height:0;max-height:calc(90dvh - 54px);max-width:calc(94vw - 2px);padding:16px;overflow:auto;overscroll-behavior:contain;flex:0 1 auto}
#imageDialog #dialogImage{display:block;width:auto;height:auto;max-width:min(calc(94vw - 34px),1066px);max-height:calc(90dvh - 88px);margin:auto;object-fit:contain}
#imageDialog.zoomed{width:min(94vw,1100px);height:min(90dvh,1000px)}
#imageDialog.zoomed #dialogImage{width:var(--zoom-width,1600px);max-width:none;max-height:none;margin:0}
#imageDialog.zoomed .image-scroll{cursor:grab}
#imageDialog .image-scroll.dragging{cursor:grabbing}
body:has(dialog[open]){overflow:hidden}
#imageDialog .dialog-bar button{min-height:34px;max-height:34px;aspect-ratio:1;box-sizing:border-box}
