.meter-photo-dialog{width:min(900px,94vw);max-width:94vw;max-height:92vh;overflow:auto;padding:24px}.meter-photo-dialog p{line-height:1.5}.meter-photo-dialog canvas{display:block;width:100%;height:auto;max-width:100%;touch-action:none;border:1px solid #d6e4df;border-radius:10px;background:#eef3f0}.meter-photo-dialog .photo-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0}.meter-photo-dialog .photo-tools label{display:flex;gap:10px;align-items:center}.meter-photo-dialog [data-image]{margin:18px 0}.meter-photo-dialog [data-status]{white-space:pre-wrap}.meter-photo-dialog [data-identity]{font-weight:600}.meter-photo-dialog details{border-top:1px solid #d6e4df;padding-top:18px;margin-top:20px}.meter-photo-dialog summary{cursor:pointer}.meter-photo-dialog [data-saved]{padding-left:22px}.meter-photo-dialog [data-registry]{margin-top:12px}.meter-photo-dialog [data-reading]{margin-top:20px}

.meter-photo-dialog [hidden]{display:none!important}.photo-original{display:block;max-width:100%;max-height:70vh;object-fit:contain;margin:12px auto}.photo-review{border-bottom:1px solid #d6e4df;padding:16px 0}.photo-review form{display:grid;gap:12px}.photo-upload{margin-top:18px}.meter-photo-dialog [data-preview]{max-height:40vh;object-fit:contain;touch-action:auto}.meter-photo-dialog [data-status]{padding:12px;background:#edf5f1;border-radius:8px;}

/* Keep the close control outside the scrolling content, including iOS Safari. */
.meter-photo-dialog{position:fixed;inset:0;margin:auto;max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);overscroll-behavior:contain;scroll-padding-top:76px}
.meter-photo-dialog:has(>.photo-dialog-body){padding:0;overflow:hidden}
.meter-photo-dialog[open]:has(>.photo-dialog-body){display:flex;flex-direction:column}
.meter-photo-dialog>.dialog-top{flex:none;position:sticky;top:0;z-index:2;background:white;gap:12px;align-items:center;margin:0;padding:16px;border-bottom:1px solid #d6e4df}
.meter-photo-dialog>.dialog-top h2{margin:0;min-width:0;line-height:1.3}
.meter-photo-dialog [data-close]{flex:none;min-width:44px;min-height:44px;padding:8px;font-size:28px;color:#246b58;background:#edf5f1;border-radius:8px}
.photo-dialog-body{min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:20px;touch-action:pan-y}
.photo-dialog-body [data-preview]{max-height:32vh;max-height:32dvh;touch-action:pan-y}
.photo-success{padding:12px 0}.photo-success h3{font-size:1.3rem;color:#246b58}.photo-success button{display:block;min-height:44px;width:100%;margin-top:12px}
@media(max-width:600px){.meter-photo-dialog{width:calc(100% - 16px);max-width:calc(100% - 16px);max-height:calc(100dvh - 16px);border-radius:12px}.photo-dialog-body{padding:16px;padding-bottom:max(20px,env(safe-area-inset-bottom))}.meter-photo-dialog input,.meter-photo-dialog select{font-size:16px}.meter-photo-dialog [data-as-is],.meter-photo-dialog [data-submit]{width:100%;min-height:48px;margin-top:10px}}
