.kaki-foto-dialog{box-sizing:border-box;width:min(1280px,96vw);height:94dvh;max-width:96vw;max-height:94dvh;margin:auto;padding:0;border:1px solid #d6ddcf;border-radius:18px;background:#f7f8f3;color:#213b2a;box-shadow:0 18px 80px #0005;overflow:hidden}
.kaki-foto-dialog[open]{display:flex;flex-direction:column}
.kaki-foto-dialog::backdrop{background:#13241bd9;backdrop-filter:blur(5px)}
.kaki-foto-dialog header{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px 20px;border-bottom:1px solid #dce2d5;flex:none;background:#f7f8f3}
.kaki-foto-dialog h2{margin:0;font-family:inherit;font-weight:500;font-size:18px;line-height:1.3;overflow-wrap:anywhere}
.kaki-foto-actions{display:flex;gap:8px;flex:none}
.kaki-foto-dialog button{min-height:44px;padding:9px 15px;border:1px solid #b6c5b1;border-radius:24px;background:#fff;color:#213b2a;font:inherit;cursor:pointer}
.kaki-foto-dialog button:disabled{opacity:.45;cursor:wait}
.kaki-foto-dialog button:focus-visible,.kaki-foto-viewport:focus-visible{outline:3px solid #d19c36;outline-offset:2px}
.kaki-foto-dialog .kaki-foto-close{background:#213b2a;color:#fff;border-color:#213b2a}
.kaki-foto-viewport{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;background:#edf0e8}
.kaki-foto-frame{box-sizing:border-box;display:grid;place-items:center;width:max-content;min-width:100%;min-height:100%;padding:20px}
.kaki-foto-dialog .kaki-foto-img{display:block;width:auto;height:auto;max-width:none;max-height:none;object-fit:contain;border-radius:2px}
.kaki-foto-status{margin:0;padding:10px 18px;font-size:13px;text-align:center;flex:none}
.kaki-foto-status:empty{padding:0}
@media(max-width:600px){.kaki-foto-dialog{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border-radius:0;border:0}.kaki-foto-dialog header{padding:12px;gap:8px;align-items:flex-start}.kaki-foto-dialog h2{font-size:15px}.kaki-foto-dialog button{padding:8px 12px;font-size:13px}.kaki-foto-actions{gap:5px}}

.kaki-foto-navigation{display:flex;align-items:center;justify-content:center;gap:18px;padding:10px 14px;border-top:1px solid #dce2d5;flex:none}
.kaki-foto-navigation[hidden]{display:none}
.kaki-foto-counter{font-size:13px;white-space:nowrap}
.kaki-foto-navigation button:disabled{cursor:default}
@media(max-width:600px){.kaki-foto-navigation{gap:10px;padding:8px}.kaki-foto-navigation button{padding:8px 10px}}

/* v213 · Captions stay with the photograph; safe areas and explicit light/dark themes. */
.kaki-foto-dialog{height:94vh;height:94dvh;max-height:94vh;max-height:94dvh}
.kaki-foto-dialog .kaki-foto-img[hidden]{display:none}
.kaki-foto-dialog button:disabled{cursor:default}
.kaki-foto-viewport{touch-action:pan-y pinch-zoom}
.kaki-foto-viewport[data-zoomed="true"]{touch-action:pan-x pan-y pinch-zoom}
.kaki-foto-caption{flex:none;max-height:19vh;max-height:19dvh;overflow:auto;margin:0;padding:12px 20px;border-top:1px solid #dce2d5;font-size:13px;line-height:1.55;overflow-wrap:anywhere;overscroll-behavior:contain}
.kaki-foto-caption[hidden],.kaki-foto-retry[hidden]{display:none}
.kaki-foto-caption>span{display:block;margin:5px 0}
.kaki-foto-caption a{color:inherit;text-decoration:underline;text-underline-offset:3px}
.kaki-foto-caption a:focus-visible{outline:3px solid #bf8826;outline-offset:3px}
.kaki-foto-feedback{flex:none;text-align:center}
.kaki-foto-retry{margin:0 0 12px}
html[data-theme="dark"] .kaki-foto-dialog{background:#1c1c1e;color:#f2f2f7;border-color:#38383a;color-scheme:dark}
html[data-theme="dark"] .kaki-foto-dialog header{background:#1c1c1e;border-color:#38383a}
html[data-theme="dark"] .kaki-foto-viewport{background:#000}
html[data-theme="dark"] .kaki-foto-dialog button{background:#2c2c2e;color:#f2f2f7;border-color:#636366}
html[data-theme="dark"] .kaki-foto-dialog .kaki-foto-close{background:#d9e8d8;color:#15201a;border-color:#d9e8d8}
html[data-theme="dark"] .kaki-foto-navigation,html[data-theme="dark"] .kaki-foto-caption{border-color:#38383a}
@media(prefers-color-scheme:dark){
 html:not([data-theme]) .kaki-foto-dialog{background:#1c1c1e;color:#f2f2f7;border-color:#38383a;color-scheme:dark}
 html:not([data-theme]) .kaki-foto-dialog header{background:#1c1c1e;border-color:#38383a}
 html:not([data-theme]) .kaki-foto-viewport{background:#000}
 html:not([data-theme]) .kaki-foto-dialog button{background:#2c2c2e;color:#f2f2f7;border-color:#636366}
 html:not([data-theme]) .kaki-foto-dialog .kaki-foto-close{background:#d9e8d8;color:#15201a;border-color:#d9e8d8}
 html:not([data-theme]) .kaki-foto-navigation,html:not([data-theme]) .kaki-foto-caption{border-color:#38383a}
}
@media(max-width:600px){
 .kaki-foto-dialog{height:100vh;height:100dvh;max-height:100vh;max-height:100dvh;padding-bottom:env(safe-area-inset-bottom,0px)}
 .kaki-foto-dialog header{padding:calc(12px + env(safe-area-inset-top,0px)) max(12px,env(safe-area-inset-right,0px)) 12px max(12px,env(safe-area-inset-left,0px));flex-wrap:wrap;align-items:center}
 .kaki-foto-dialog h2{flex:1 1 135px;font-size:16px}
 .kaki-foto-caption{padding:10px 14px;max-height:21vh;max-height:21dvh;font-size:12px}
}
@media(max-height:480px) and (orientation:landscape){
 .kaki-foto-dialog header{padding:8px max(12px,env(safe-area-inset-right,0px)) 8px max(12px,env(safe-area-inset-left,0px))}
 .kaki-foto-caption{max-height:18vh;padding:5px 14px}
 .kaki-foto-navigation{padding:4px 12px}
}
