/* Responsive evidence views and installed-app safe areas. Original files stay unchanged. */
body{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
img,video{max-width:100%;height:auto}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
button,select,input:not([type=checkbox]):not([type=hidden]){min-height:44px}
select,textarea{min-width:0;max-width:100%}figure{min-width:0}
.pwa-tools{max-width:1200px;margin:0 auto;padding:8px 24px;display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap}
.pwa-tools:has(>[hidden]):not(:has(>:not([hidden]))){display:none}
.pwa-tools p{margin:0;flex-basis:100%;color:#f1c878}.pwa-tools button{font-size:.875rem}
#pwa-update:not([hidden]){display:flex;gap:10px;align-items:center;flex-wrap:wrap}
#pwa-help{max-width:min(520px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto}
#list .record-thumb{object-fit:contain;background:#070c10}
.visit-gallery img,.report-photo img,.evidence img{height:auto;object-fit:contain;background:#070c10}
.report-photo figcaption label,.viewer-controls label{display:flex;align-items:center;gap:8px}
.report-photo input,.viewer-controls input{display:inline-block;margin:0;flex:none}
/* Repeated taps must change photos, not trigger Safari's page zoom. Keep pinch zoom available. */
.photo-viewer .viewer-controls,.photo-viewer .viewer-header,.photo-viewer .zoom-toolbar{touch-action:manipulation}
.photo-viewer button,.photo-viewer label,.photo-viewer input{touch-action:manipulation;-webkit-user-select:none;user-select:none}
.photo-viewer{overscroll-behavior:contain}
@media(max-width:760px){
 .shell{width:100%;min-width:0;padding:16px 12px}.pwa-tools{padding:8px 12px}
 .shell header{flex-wrap:wrap;gap:12px;margin-bottom:18px}.shell header h1{flex:1;min-width:0;overflow-wrap:anywhere}
 .zone-toolbar{align-items:center}.zone-toolbar label{flex-basis:100%}.zone-toolbar select{flex:1;min-width:0;max-width:100%}
 .zone-toolbar a{display:inline-flex;align-items:center;min-height:44px;padding:6px 4px}
 .metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.metrics article{min-width:0;padding:12px}.metrics span{overflow-wrap:anywhere}.metrics strong{font-size:1.75rem}
 .panel{padding:14px}.records{margin:14px -14px -14px;min-width:0;grid-template-columns:minmax(0,1fr)}
 .records>div:first-child,#detail{min-width:0}#detail{padding:14px;overflow-wrap:anywhere}
 #filters{gap:12px}#filters label{min-width:0;flex-basis:100%}
 #list button{padding:14px}#list .record-thumb{height:auto;max-height:120px}
 .tabs{gap:6px}.tabs a,.tabs button{min-height:44px;display:inline-flex;align-items:center;padding:8px 10px}
 .status #updated{font-size:.85rem}.review button{flex:1 1 130px}
 .pagination{gap:8px;flex-wrap:wrap}.pagination button{min-height:44px}.visit-gallery{padding:8px}.visit-gallery .pagination{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)}
 .visit-gallery .pagination button{padding:8px 4px;font-size:.8rem}
 .evidence,.report-photos{grid-template-columns:minmax(0,1fr);gap:14px}
 .report-fields{padding:14px}.report-toolbar{position:static;padding:12px;gap:10px}.report-toolbar>*{max-width:100%}
 #report-filter{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}.report-toolbar button{flex:1 1 140px}
 #selected-only{display:inline-block;width:22px;height:22px;margin:0 8px 0 0;vertical-align:middle}
 .report-table-wrap{overflow:visible}.report-table,.report-table tbody{display:block;width:100%}
 .report-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 .report-table tr{display:block;margin:0 0 16px;padding:12px;border:1px solid #354553;border-radius:12px;background:#192530}
 .report-table td{display:block;border:0;padding:7px 0;overflow-wrap:anywhere;min-width:0}
 .report-table td[data-label]::before{content:attr(data-label);display:block;color:#aec0cc;font-size:.8rem;font-weight:600;margin-bottom:3px}
 .report-transfer label{min-width:0;min-height:44px}.report-actions{gap:10px}.report-actions a{display:inline-flex;align-items:center;min-height:44px;padding:6px 0}
 .photo-viewer{width:100%;height:100dvh;max-height:100dvh;margin:0;border:0;border-radius:0;padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));gap:8px}
 .photo-viewer .viewer-header{gap:8px}.photo-viewer .viewer-header h2{font-size:.9rem;line-height:1.25;max-height:3.75em;overflow:hidden}
 .photo-viewer .viewer-header button{flex:none;padding:8px 10px}
 .photo-viewer .zoom-stage{min-height:80px}.photo-viewer .zoom-toolbar{gap:6px}.photo-viewer .zoom-toolbar button{min-height:44px;padding:6px 12px}
 .photo-viewer .viewer-controls{gap:8px}.photo-viewer .viewer-controls label{flex-basis:100%;justify-content:center;order:2;margin:0;min-height:44px}
 .photo-viewer>p{font-size:.8rem;max-height:3em;overflow:auto;flex-shrink:0}
 .login{max-width:calc(100% - 24px);padding:22px;margin:6vh auto}
}
@media(max-height:500px) and (orientation:landscape){
 .photo-viewer{padding:6px max(10px,env(safe-area-inset-right)) 6px max(10px,env(safe-area-inset-left));gap:4px}
 .photo-viewer .viewer-header h2{font-size:.85rem;max-height:1.3em}
 .photo-viewer .zoom-toolbar{gap:6px}.photo-viewer .zoom-toolbar button{min-height:36px;padding:4px 10px}
 .photo-viewer .zoom-status{flex-basis:auto;font-size:.7rem}.photo-viewer .viewer-controls label{flex-basis:auto;order:0;min-height:36px}
 .photo-viewer>p{max-height:1.5em}.photo-viewer .zoom-stage{min-height:40px}
}
