.chat-photo-viewer{box-sizing:border-box;width:min(1100px,calc(100vw - 24px));height:min(900px,calc(100dvh - 24px));max-width:none;max-height:none;padding:0;border:1px solid var(--line,#dfe2da);border-radius:16px;background:var(--white,#fff);color:var(--ink,#242a26);overflow:hidden}
.chat-photo-viewer[open]{display:flex;flex-direction:column}.chat-photo-viewer::backdrop{background:#161c19cc}
.chat-photo-viewer-head{display:flex;align-items:center;gap:10px;flex:none;padding:8px 12px;border-bottom:1px solid var(--line,#dfe2da);background:var(--white,#fff);z-index:1}.chat-photo-viewer-head>span{flex:1;text-align:center;font-size:13px}.chat-photo-viewer-head button{min-height:48px;min-width:80px;margin:0;white-space:nowrap;font-size:14px}
.chat-photo-viewer-stage{flex:1;min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;background:#202621;display:flex;align-items:center;justify-content:center;touch-action:pan-x pan-y pinch-zoom}
.chat-photo-viewer-stage img{display:block;max-width:100%;max-height:100%;object-fit:contain;image-orientation:from-image}.chat-photo-viewer-stage.is-zoomed{display:block}.chat-photo-viewer-stage.is-zoomed img{max-width:none;max-height:none;margin:auto;object-fit:initial}
.chat-photo-viewer-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding:8px 12px;background:var(--white,#fff);font-size:12px;overflow-wrap:anywhere}.chat-photo-viewer-foot a{flex:none;display:flex;align-items:center;min-height:44px;color:var(--brand,#b33f29)}
@media(max-width:760px){.chat-photo-viewer{position:fixed;inset:var(--photo-view-top,0px) 0 auto 0;margin:0;width:100%;height:var(--photo-view-height,100dvh);border:0;border-radius:0}.chat-photo-viewer-head{padding:calc(6px + env(safe-area-inset-top,0px)) 8px 6px}.chat-photo-viewer-head>span{display:none}.chat-photo-viewer-head #chatPhotoZoom{margin-left:auto}.chat-photo-viewer-foot{padding:6px 10px calc(6px + env(safe-area-inset-bottom,0px))}.chat-photo-viewer-foot span{font-size:11px}}
/* The earlier camera-sheet preview needs the same always-visible escape control. */
#chuwiDocumentDialog .chat-document-back{position:sticky;top:0;z-index:2;display:block;min-height:48px;margin:0 0 10px;background:var(--white,#fff)}
