:root { color-scheme: light; --map-label-size:12px; --bg:#eef1f4; --panel:#fff; --text:#1f2933; --muted:#62707d; --border:#cfd7df; --accent:#1557a0; --accent-dark:#0f447f; --danger:#a22a2a; }
* { box-sizing:border-box; }
html,body { height:100%; margin:0; }
body { font-family:Arial,Helvetica,sans-serif; background:var(--bg); color:var(--text); display:flex; flex-direction:column; }
.topbar { display:flex; gap:24px; justify-content:space-between; align-items:center; padding:14px 18px; background:var(--panel); border-bottom:1px solid var(--border); box-shadow:0 2px 8px rgba(0,0,0,.06); z-index:1000; }
h1 { margin:0 0 4px; font-size:1.35rem; }.topbar p{margin:0;color:var(--muted);font-size:.92rem}.actions{display:flex;gap:8px;flex-wrap:wrap}
.button{appearance:none;border:1px solid var(--border);background:#fff;color:var(--text);padding:9px 13px;border-radius:7px;font-weight:700;cursor:pointer;font-size:.9rem}.button:hover{background:#f5f7f9}.button.primary{background:var(--accent);color:#fff;border-color:var(--accent)}.button.primary:hover{background:var(--accent-dark)}
main{min-height:0;flex:1;display:grid;grid-template-columns:330px 1fr}.sidebar{overflow:auto;padding:14px;background:#f7f9fb;border-right:1px solid var(--border)}
.drop-zone{min-height:105px;border:2px dashed #9aa8b6;border-radius:10px;background:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;text-align:center;color:var(--muted);cursor:pointer;padding:12px}.drop-zone strong{color:var(--text)}.drop-zone.drag-over{border-color:var(--accent);background:#eaf3fc}
.field-label{display:block;margin:14px 0 5px;font-weight:700;font-size:.86rem}.text-input{width:100%;padding:9px 10px;border:1px solid var(--border);border-radius:7px;font:inherit;background:#fff}.range-input{width:100%;accent-color:var(--accent);cursor:pointer}
.status-card,.help{margin-top:14px;padding:13px;background:#fff;border:1px solid var(--border);border-radius:9px}.status-card>div{display:flex;justify-content:space-between;gap:12px;padding:6px 0;border-bottom:1px solid #edf0f2}.status-card>div:last-child{border-bottom:0}.status-card span{color:var(--muted)}.status-card strong{text-align:right;overflow-wrap:anywhere}
.help h2{margin:0 0 9px;font-size:1rem}.help p{margin:8px 0;color:var(--muted);line-height:1.35;font-size:.88rem}.help code{font-family:inherit;background:#f2f4f6;border-radius:3px;padding:1px 3px}.message{margin-top:12px;min-height:22px;font-size:.88rem;color:var(--muted)}.message.error{color:var(--danger);font-weight:700}
.map-wrap{min-width:0;min-height:0}#map{width:100%;height:100%;min-height:450px;background:#d9dde1}.leaflet-container{background:#fff}.leaflet-container,.leaflet-grab,.leaflet-container.leaflet-crosshair{cursor:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2715%27 height=%2715%27 viewBox=%270 0 15 15%27%3E%3Cpath d=%27M7.5 2v11M2 7.5h11%27 stroke=%27%238896a3%27 stroke-width=%271%27 stroke-linecap=%27round%27/%3E%3Ccircle cx=%277.5%27 cy=%277.5%27 r=%271%27 fill=%27%238896a3%27/%3E%3C/svg%3E") 7 7,crosshair!important}.map-label{background:rgba(255,255,255,.96);border:1.5px solid #26323d;border-radius:50%;box-shadow:0 1px 4px rgba(0,0,0,.25);color:#111;font-size:var(--map-label-size);font-weight:700;width:calc(var(--map-label-size) * 2.65);height:calc(var(--map-label-size) * 2.65);display:flex;align-items:center;justify-content:center;box-sizing:border-box;white-space:nowrap;overflow:hidden}.label-marker-container{background:transparent;border:0}.label-marker-container .map-label{transform:translate(-50%,-50%)}.draggable-map-label{cursor:move;user-select:none}.leaflet-dragging .draggable-map-label{cursor:grabbing}
.capturing-map .leaflet-control-zoom{display:none!important}
.capturing-map .map-label{border-width:2.5px;font-weight:800;text-rendering:geometricPrecision}
.photo-popup img{display:block;width:330px;max-height:225px;object-fit:contain;margin:7px 0;background:#eee}.photo-list{display:flex;flex-direction:column;gap:5px;margin-top:14px}.photo-list-item{display:grid;grid-template-columns:24px 52px 1fr;align-items:center;gap:7px;width:100%;border:1px solid var(--border);background:#fff;border-radius:7px;padding:5px;text-align:left;cursor:pointer}.photo-list-item:hover{background:#f1f6fb}.photo-list-item.missing-gps{opacity:.62;cursor:default}.photo-list-item img{width:52px;height:40px;object-fit:cover;border-radius:4px;background:#ddd}.photo-list-item span:last-child{min-width:0}.photo-list-item strong,.photo-list-item small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.photo-list-item small{color:var(--muted);margin-top:2px}.photo-number{font-weight:700;text-align:center;color:var(--muted)}
.report-fields{display:grid;grid-template-columns:1fr 1fr;gap:0 8px}.report-fields .field-label{margin-top:10px}.print-options{margin-top:12px;padding:10px;border:1px solid var(--border);border-radius:8px;background:#fff;display:grid;gap:8px}.print-options>label:first-child{display:grid;grid-template-columns:1fr 80px;align-items:center;gap:8px;font-size:.84rem;font-weight:700}.check-row{display:flex;align-items:center;gap:7px;font-size:.84rem;font-weight:700}.map-wrap{position:relative}.map-capture-overlay{position:absolute;inset:0;z-index:650;pointer-events:none}.north-arrow{display:none;position:absolute;right:18px;top:18px;width:42px;height:58px;border:1px solid rgba(0,0,0,.55);border-radius:5px;background:rgba(255,255,255,.9);font-weight:800;text-align:center;padding-top:4px;box-shadow:0 1px 4px rgba(0,0,0,.22)}.north-arrow span{display:block;font-size:27px;line-height:29px}.show-north-arrow .north-arrow{display:block}.print-report{display:none}
@media(max-width:760px){.topbar{align-items:flex-start;flex-direction:column;gap:10px}main{grid-template-columns:1fr;grid-template-rows:auto minmax(480px,1fr)}.sidebar{border-right:0;border-bottom:1px solid var(--border)}}
@page{size:A3 landscape;margin:0}
@media print{
  html,body{width:100%;height:auto;margin:0;overflow:visible;background:#fff;-webkit-print-color-adjust:exact;print-color-adjust:exact}.topbar,.sidebar,.leaflet-control-container{display:none!important}main{display:none!important}.print-report{display:block;background:#fff}.report-page{box-sizing:border-box;width:420mm;height:297mm;padding:10mm;display:grid;grid-template-rows:auto 1fr;gap:4mm;background:#fff;page-break-after:always;break-after:page;overflow:hidden}.report-page:last-child{page-break-after:auto;break-after:auto}.report-page-header{display:flex;justify-content:space-between;align-items:flex-end;border-bottom:.35mm solid #555;padding-bottom:2.5mm;background:#fff}.report-page-header h2{margin:0;font-size:17pt}.report-kicker{font-size:9pt;color:#555;text-transform:uppercase;letter-spacing:.4px}.report-title-small{font-size:10pt;color:#555}.report-header-brand{display:flex;align-items:center;justify-content:flex-end;gap:5mm;min-width:62mm}.report-logo{display:block;width:50mm;height:auto;max-height:18mm;object-fit:contain;object-position:right center}.map-report-page{grid-template-rows:auto auto minmax(0,1fr)}.map-title-block{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border:.25mm solid #888;background:#fff;font-size:9pt}.map-title-block>div{padding:2mm 2.5mm;border-right:.2mm solid #aaa}.map-title-block>div:last-child{border-right:0}.map-title-block span{display:block;color:#666;font-size:7.5pt;text-transform:uppercase;margin-bottom:.6mm}.map-capture-frame{min-height:0;border:.25mm solid #666;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#d9dde1}.map-capture-frame img{display:block;max-width:100%;max-height:100%;width:100%;height:100%;object-fit:contain}.report-photo-grid{min-height:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:4mm}.report-photo-card{min-width:0;min-height:0;display:grid;grid-template-rows:minmax(0,1fr) auto;border:.25mm solid #999;background:#fff;overflow:hidden}.report-photo-image{min-width:0;min-height:0;display:flex;align-items:center;justify-content:center;background:#f3f3f3;padding:2mm;overflow:hidden}.report-photo-image img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;image-rendering:auto}.report-photo-caption{border-top:.2mm solid #aaa;padding:1.8mm 2mm;line-height:1.2;min-height:13mm}.report-photo-caption strong{display:block;font-size:10pt;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.report-photo-caption span{display:block;margin-top:.8mm;font-size:8pt;color:#444;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}

.arrow-head-icon{display:block;transform-origin:0 50%;cursor:grab}.arrow-head-icon svg{display:block;width:100%;height:100%}.leaflet-dragging .arrow-head-icon{cursor:grabbing}.arrow-marker-container{background:transparent;border:0}.arrow-marker-container,.arrow-head-icon,.arrow-head-icon svg{overflow:visible}

.download-photos-button{width:100%;margin-top:14px;background:#1557a0;color:#fff;border-color:#1557a0}.download-photos-button:hover{background:#0f447f}.download-photos-button:disabled{opacity:.5;cursor:not-allowed;background:#8795a3;border-color:#8795a3}
.photo-popup{min-width:405px;max-width:460px}.leaflet-popup.draggable-photo-popup .leaflet-popup-content{margin:16px 20px 18px;min-width:405px}.leaflet-popup.draggable-photo-popup .leaflet-popup-content-wrapper{cursor:default}.photo-popup-title{cursor:move;user-select:none;padding:3px 28px 7px 0;border-bottom:1px solid #d9e0e6}.photo-popup-title:active{cursor:grabbing}.photo-popup-title{font-weight:700;margin-bottom:5px}.photo-popup-label-row{display:grid;grid-template-columns:1fr auto;gap:6px;align-items:center;margin:8px 0}.photo-popup-label-input{min-width:0;width:100%;padding:7px 8px;border:1px solid #aeb8c2;border-radius:5px;font:inherit}.photo-popup-rename{padding:7px 10px;border:1px solid #1557a0;border-radius:5px;background:#1557a0;color:#fff;font-weight:700;cursor:pointer}.photo-popup-delete{width:100%;margin-top:8px;padding:7px 10px;border:1px solid #a22a2a;border-radius:5px;background:#fff;color:#a22a2a;font-weight:700;cursor:pointer}.photo-popup-delete:hover{background:#fff0f0}.photo-popup-note{font-size:11px;color:#62707d;margin-top:3px}

.draw-panel{margin-top:14px;padding:11px;border:1px solid var(--border);border-radius:9px;background:#fff}.draw-panel-title{font-weight:800;margin-bottom:8px}.draw-options{display:grid;gap:8px}.draw-options label{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:8px;font-size:.82rem;font-weight:700}.draw-options input[type=color]{width:46px;height:30px;padding:1px;border:1px solid var(--border);border-radius:5px;background:#fff;cursor:pointer}.draw-options input[type=range]{min-width:0;width:100%}.draw-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:9px}.draw-actions .button:last-child{grid-column:1/-1}.draw-hint{margin:8px 0 0;color:var(--muted);font-size:.76rem;line-height:1.35}.drawing-active #map{outline:2px solid rgba(21,87,160,.45);outline-offset:-2px}.draggable-map-label,.arrow-head-icon,.leaflet-popup-close-button,.photo-popup input,.photo-popup button,.photo-popup-title,.leaflet-control{cursor:auto}.draggable-map-label,.photo-popup-title{cursor:move!important}.arrow-head-icon{cursor:grab!important}.photo-popup button,.leaflet-popup-close-button,.leaflet-control a{cursor:pointer!important}.photo-popup input{cursor:text!important}


/* v21 text annotations */
.text-options label:first-child{grid-template-columns:auto 1fr}.text-input.compact{padding:6px 8px}.single-action{grid-template-columns:1fr 1fr}.single-action .button:last-child{grid-column:auto}.map-text-annotation{white-space:nowrap;font-weight:700;line-height:1;color:#111;text-shadow:0 1px 2px rgba(255,255,255,.95),1px 0 2px rgba(255,255,255,.95),-1px 0 2px rgba(255,255,255,.95);transform-origin:center;cursor:move;user-select:none}.map-text-icon{background:transparent;border:0;overflow:visible}.text-popup{min-width:230px}.text-popup-row{display:grid;grid-template-columns:1fr auto;gap:6px;margin:7px 0}.text-popup input[type=text]{min-width:0;padding:6px;border:1px solid #aeb8c2;border-radius:5px}.text-popup input[type=range]{width:100%}.text-popup-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}.text-popup button{padding:6px;border:1px solid #999;border-radius:5px;background:#fff;cursor:pointer}.text-popup .danger{color:#a22a2a;border-color:#a22a2a}.placing-text #map{outline:2px solid rgba(21,87,160,.45);outline-offset:-2px}

/* v22 selectable multi-segment polylines */
.polyline-move-icon{background:transparent;border:0}.polyline-move-handle{width:24px;height:24px;border:2px solid #1557a0;border-radius:50%;background:#fff;color:#1557a0;display:flex;align-items:center;justify-content:center;font-size:17px;font-weight:700;cursor:move;box-shadow:0 1px 4px rgba(0,0,0,.3)}

/* v25 top tabs, inspection info and live photo grid */
.app-tabs{display:flex;gap:0;padding:0 18px;background:#fff;border-bottom:1px solid var(--border);z-index:999;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.app-tab{appearance:none;border:0;border-bottom:3px solid transparent;background:transparent;padding:12px 22px;font:700 .94rem Arial,Helvetica,sans-serif;color:#52606d;cursor:pointer}
.app-tab:hover{background:#f5f7f9;color:#1f2933}.app-tab.active{color:var(--accent);border-bottom-color:var(--accent);background:#f7fbff}
.tab-panel{display:none;min-height:0;flex:1}.tab-panel.active{display:block}.tab-panel#mapTab.active{display:flex;min-height:0}.tab-panel#mapTab main{width:100%;height:100%}
.info-tab{overflow:auto;padding:28px;background:#eef1f4}.info-card{max-width:900px;margin:0 auto;background:#fff;border:1px solid var(--border);border-radius:11px;padding:24px;box-shadow:0 3px 14px rgba(0,0,0,.06)}.info-card h2{margin:0 0 20px;font-size:1.3rem}.info-form{display:grid;grid-template-columns:1fr 1fr;gap:17px 20px}.info-form label,.info-print-options>label:first-child{display:grid;gap:6px;font-size:.86rem;font-weight:700}.info-form .wide-field{grid-column:1/-1}.info-print-options{display:flex;align-items:center;gap:24px;flex-wrap:wrap;margin-top:22px;padding-top:20px;border-top:1px solid var(--border)}.info-print-options>label:first-child{grid-template-columns:auto 85px;align-items:center}.info-note{margin:18px 0 0;color:var(--muted);font-size:.84rem}
.picture-grid-tab{overflow:auto;background:#e7ebef;padding:18px}.picture-grid-toolbar{max-width:1280px;margin:0 auto 14px;display:flex;align-items:flex-end;justify-content:space-between;gap:20px}.picture-grid-toolbar h2{margin:0 0 4px}.picture-grid-toolbar p{margin:0;color:var(--muted)}.picture-grid-toolbar>span{font-weight:700;color:var(--muted)}
.live-picture-grid{max-width:1280px;margin:0 auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.live-photo-card{min-width:0;background:#fff;border:1px solid #aeb8c2;border-radius:8px;overflow:hidden;box-shadow:0 2px 7px rgba(0,0,0,.07);display:grid;grid-template-rows:250px auto}.live-photo-image{display:flex;align-items:center;justify-content:center;background:#f3f3f3;padding:8px;min-width:0;overflow:hidden}.live-photo-image img{display:block;max-width:100%;max-height:100%;object-fit:contain}.live-photo-details{border-top:1px solid #c7cfd7;padding:10px;display:grid;gap:7px}.live-photo-title{font-size:.92rem;font-weight:800}.live-photo-note{width:100%;min-height:78px;resize:vertical;border:1px solid #aeb8c2;border-radius:6px;padding:8px;font:inherit;line-height:1.35;background:#fff}.grid-empty{grid-column:1/-1;padding:50px 20px;text-align:center;color:var(--muted);background:#fff;border:1px dashed #aeb8c2;border-radius:9px}
.report-photo-caption span.report-photo-note-text{white-space:normal;overflow:visible;text-overflow:clip;color:#222;font-size:8.5pt;line-height:1.25;margin-top:1mm}
@media(max-width:1000px){.live-picture-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:680px){.app-tabs{padding:0}.app-tab{flex:1;padding:11px 6px}.info-tab{padding:14px}.info-form{grid-template-columns:1fr}.info-form .wide-field{grid-column:auto}.live-picture-grid{grid-template-columns:1fr}.picture-grid-tab{padding:10px}}
@media print{.app-tabs,.tab-panel{display:none!important}.print-report{display:block!important}}

/* v26 polyline vertex editing */
.polyline-vertex-icon{background:transparent!important;border:0!important}
.polyline-vertex-handle{box-sizing:border-box;width:14px;height:14px;border:2px solid #a60000;border-radius:50%;background:#fff;cursor:move;box-shadow:0 1px 4px rgba(0,0,0,.45)}
.polyline-vertex-handle.endpoint{width:16px;height:16px;background:#d71920;border-color:#fff;outline:2px solid #a60000}
.polyline-vertex-handle:hover{transform:scale(1.18)}

/* v27 georeferenced PDF/image underlay */
.underlay-tab { padding: 18px; overflow: auto; }
.underlay-toolbar { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:12px; }
.underlay-toolbar h2 { margin:0 0 4px; }
.underlay-toolbar p { margin:0; color:#5b6571; }
.underlay-actions { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }
.registration-status { padding:10px 12px; border:1px solid #cfd6dd; background:#f7f9fa; border-radius:8px; margin-bottom:12px; font-weight:600; }
.registration-status.active { background:#fff6d8; border-color:#d8b94f; }
.registration-status.good { background:#eaf6ee; border-color:#8bc59d; }
.registration-workspace { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:14px; min-height:520px; }
.registration-pane { display:flex; flex-direction:column; min-width:0; border:1px solid #c8d0d8; border-radius:9px; overflow:hidden; background:#fff; }
.registration-pane-title { padding:9px 12px; font-weight:700; background:#eef2f5; border-bottom:1px solid #c8d0d8; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.registration-map { flex:1; min-height:480px; cursor:crosshair; }
.underlay-canvas-wrap { position:relative; flex:1; min-height:480px; overflow:auto; background:#d9dde1; display:flex; align-items:flex-start; justify-content:center; }
#underlayCanvas { display:block; max-width:none; background:white; cursor:crosshair; box-shadow:0 1px 8px rgba(0,0,0,.22); }
.underlay-empty { position:absolute; inset:0; display:grid; place-items:center; color:#6c757d; font-weight:700; pointer-events:none; }
.underlay-empty[hidden] { display:none!important; }
.plan-control-point { position:absolute; width:18px; height:18px; margin:-9px 0 0 -9px; border:3px solid #fff; border-radius:50%; background:#d71920; box-shadow:0 0 0 2px #111; color:white; font-size:10px; line-height:12px; text-align:center; pointer-events:none; z-index:4; }
.control-point-summary { display:flex; gap:28px; flex-wrap:wrap; margin:14px 0 8px; padding:10px 12px; border:1px solid #d6dce1; border-radius:8px; background:#fff; }
.underlay-help { color:#4f5964; max-width:1100px; }
.fine-tune-tab{min-height:0;background:#e9edf1}
.fine-tune-tab.active{display:flex;flex-direction:column}
.fine-tune-toolbar{display:flex;align-items:stretch;justify-content:space-between;gap:8px;padding:8px;border-bottom:1px solid #aeb7c0;background:#eef1f4}
.underlay-fine-controls{display:flex;align-items:center;gap:9px;flex-wrap:wrap;flex:1;padding:6px 8px;border:1px solid #b8c1ca;background:#fff;font-size:12px}
.fine-control-group{display:flex;align-items:center;gap:3px}
.fine-control-group>span{margin-right:2px;color:#4f5964;font-weight:600}
.fine-control-group button,.fine-refit-button{height:24px;min-width:27px;padding:0 7px;border:1px solid #919ca6;border-radius:2px;background:#f7f7f7;color:#111;font:700 12px/1 "Segoe UI",Arial,sans-serif;cursor:pointer}
.fine-control-group button:hover:not(:disabled),.fine-refit-button:hover:not(:disabled){background:#fff;border-color:#53606c}
.fine-control-group .fine-adjust-button{touch-action:none;user-select:none;-webkit-user-select:none}
.fine-control-group .fine-adjust-button.holding:not(:disabled){border-color:#1557a0;background:#dcecff;box-shadow:inset 0 0 0 1px #1557a0}
.fine-control-group button:disabled,.fine-refit-button:disabled{opacity:.42;cursor:not-allowed}
.fine-control-hint{color:#68737e;font-size:10px}
.fine-tune-status{flex-basis:100%;color:#334252;font-size:11px;font-weight:600}
.fine-tune-layers{display:flex;align-items:center;gap:8px;flex-wrap:wrap;max-width:620px;padding:6px 8px;border:1px solid #b8c1ca;background:#fff;font-size:11px}
.fine-tune-layers label{display:flex;align-items:center;gap:5px}
.fine-tune-layers .opacity-row{display:grid;grid-template-columns:auto auto;align-items:center;gap:3px 6px}
.fine-tune-layers .opacity-row input{width:120px}
.fine-tune-layers output{font-weight:700}
.fine-tune-map{flex:1 1 auto;min-height:0}
.help-tab{overflow:auto;padding:18px;background:#eef1f4}
.help-card{max-width:900px;margin:0 auto;padding:20px 24px;border:1px solid #b8c1ca;background:#fff}
.help-card h2{margin:0 0 18px;color:#173b6a;font-size:20px}
.help-card h3{margin:20px 0 5px;padding-bottom:4px;border-bottom:1px solid #d9dee3;color:#214f8c;font-size:14px}
.help-card p{margin:6px 0;color:#3f4c59;font-size:13px;line-height:1.45}
.help-card code{padding:1px 3px;background:#eef1f4;font-family:inherit}
.live-photo-image{border:6px solid transparent}
.live-photo-card.issue-red .live-photo-image{border-color:#d71920}
.live-photo-card.issue-green .live-photo-image{border-color:#16823b}
.live-photo-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}
.photo-issue-switch{display:flex;align-items:center;gap:2px;white-space:nowrap}
.photo-issue-switch>span{margin-right:2px;color:#596570;font-size:9px;font-weight:600}
.photo-issue-switch button{height:21px;padding:0 5px;border:1px solid #9ba4ad;background:#fff;color:#26323d;font:600 9px/1 "Segoe UI",Arial,sans-serif;cursor:pointer}
.photo-issue-switch button[aria-pressed=true]{box-shadow:inset 0 0 0 1px #fff;color:#fff}
.photo-issue-switch button[data-issue=none][aria-pressed=true]{background:#596570}
.photo-issue-switch button[data-issue=red][aria-pressed=true]{border-color:#9f1117;background:#d71920}
.photo-issue-switch button[data-issue=green][aria-pressed=true]{border-color:#0d642b;background:#16823b}
.map-label.issue-red{border-color:#d71920;box-shadow:0 0 0 4px #d71920,0 1px 4px rgba(0,0,0,.25)}
.map-label.issue-green{border-color:#16823b;box-shadow:0 0 0 4px #16823b,0 1px 4px rgba(0,0,0,.25)}
.report-photo-card.issue-red{border:1.5mm solid #d71920}
.report-photo-card.issue-green{border:1.5mm solid #16823b}
.paint-toolbar,.map-underlay-controls{margin-top:10px;padding:6px;border:1px solid #aeb7c0;background:#fff}
.paint-toolbar-title,.map-underlay-title{margin-bottom:5px;color:#243342;font-size:11px;font-weight:700}
.paint-tool-row{display:flex;align-items:center;gap:4px}
.paint-text-row{margin-top:5px}
.paint-tool-button{display:inline-flex;align-items:center;justify-content:center;gap:5px;height:28px;padding:0 8px;border:1px solid #8f99a3;background:linear-gradient(#fff,#eceff1);color:#17212b;font:600 11px/1 "Segoe UI",Arial,sans-serif;cursor:pointer}
.paint-tool-button:hover:not(:disabled){background:#fff;border-color:#214f8c}
.paint-tool-button.active{border-color:#173b6a;background:#dbe9f8;box-shadow:inset 0 0 0 1px #5b86b6}
.paint-tool-button:disabled{opacity:.4;cursor:not-allowed}
.paint-line-icon{display:block;width:15px;height:2px;background:#111;transform:rotate(-35deg)}
.paint-text-icon{font:bold 15px/1 Georgia,serif}
.paint-colour{display:flex;align-items:center;gap:3px;margin-left:auto;color:#596570;font-size:9px}
.paint-colour input{width:28px;height:25px;padding:1px;border:1px solid #8f99a3;background:#fff;cursor:pointer}
.paint-width{display:grid;grid-template-columns:auto 52px 15px;align-items:center;gap:3px;color:#596570;font-size:9px}
.paint-width input{width:52px}
.paint-width strong{text-align:right;color:#17212b;font-size:9px}
.paint-text-input{min-width:0;flex:1;height:28px;padding:3px 6px;border:1px solid #8f99a3;font:11px "Segoe UI",Arial,sans-serif}
.map-underlay-list{display:grid;gap:3px}
.map-layer-switches{display:flex;align-items:center;gap:10px;margin-bottom:6px;padding-bottom:5px;border-bottom:1px solid #d9dee3;font-size:10px}
.map-layer-switches strong{margin-right:auto;font-size:11px}
.map-layer-switches label{display:flex;align-items:center;gap:3px;white-space:nowrap}
.map-layer-switches input{margin:0}
.map-underlay-controls.imports-hidden .map-underlay-list{opacity:.4}
.map-underlay-row{display:grid;grid-template-columns:minmax(70px,1fr) 92px 31px;align-items:center;gap:4px;font-size:10px}
.map-underlay-row>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.map-underlay-row input{width:92px}
.map-underlay-row output{text-align:right;font-size:9px;font-weight:700}
.underlay-layer-picker{display:flex;align-items:center;gap:4px;font-size:10px;font-weight:600}
.underlay-layer-picker select{height:20px;max-width:230px;padding:0 4px;border:1px solid #999;background:#fff;font:11px "Segoe UI",Arial,sans-serif}
.underlay-layer-list{display:grid;gap:2px;width:100%;max-height:126px;overflow:auto}
.layer-list-empty{padding:4px;color:#68737e;font-size:10px}
.underlay-layer-row{display:grid;grid-template-columns:18px minmax(120px,1fr) 58px 90px 35px 46px;align-items:center;gap:4px;padding:2px 3px;border:1px solid transparent;background:#f5f6f7}
.underlay-layer-row.active{border-color:#1a6fc4;background:#eaf3fc}
.underlay-layer-select,.underlay-layer-delete{height:20px;padding:0 5px;border:1px solid #a2aab2;background:#fff;font:600 10px "Segoe UI",Arial,sans-serif;cursor:pointer}
.underlay-layer-select{overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}
.underlay-layer-delete{color:#9b2020}
.underlay-layer-state{color:#596570;font-size:9px}
.underlay-layer-row input[type=range]{width:90px}
.underlay-layer-row output{font-size:9px;font-weight:700}
@media(max-width:950px){.fine-tune-toolbar{flex-direction:column}.fine-tune-layers{max-width:none}.fine-tune-map{min-height:500px}}
.leaflet-underlay-image { position:absolute; user-select:none; -webkit-user-drag:none; transform-origin:0 0; }
@media (max-width: 980px) { .registration-workspace { grid-template-columns:1fr; } .underlay-toolbar { flex-direction:column; } .underlay-actions { justify-content:flex-start; } }

/* v56 Stage 1 manual alignment console */
.topbar h1 span{
  margin-left:5px;
  color:#7c8996;
  font-size:.82em;
  font-weight:600;
}
.transform-console{
  display:grid;
  grid-template-columns:minmax(150px,1.2fr) auto auto minmax(210px,1fr) minmax(330px,1.7fr) auto;
  align-items:center;
  gap:7px;
  padding:7px 9px;
  border-bottom:1px solid #aeb7c0;
  background:#172330;
  color:#f7fafc;
}
.transform-console-heading{
  display:grid;
  min-width:0;
  line-height:1.1;
}
.transform-console-heading .eyebrow{
  color:#92a4b7;
  font-size:9px;
  font-weight:800;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.transform-console-heading strong{
  overflow:hidden;
  font-size:12px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.transform-tool,.transform-reset{
  height:28px;
  padding:0 10px;
  border:1px solid #536476;
  border-radius:4px;
  background:#253546;
  color:#fff;
  font:700 11px/1 inherit;
  cursor:pointer;
}
.transform-tool:hover:not(:disabled),.transform-reset:hover:not(:disabled){background:#30475e}
.transform-tool.active{border-color:#64b5f6;background:#0c5f9b;box-shadow:0 0 0 2px rgba(100,181,246,.2)}
.transform-tool.locked{border-color:#70b98b;background:#23603b}
.transform-tool:disabled,.transform-reset:disabled{cursor:not-allowed;opacity:.42}
.base-style-control{
  display:flex;
  align-items:center;
  gap:4px;
  height:20px;
  padding:0 4px 0 6px;
  border:1px solid #aeb7c0;
  background:#f7f8f9;
  color:#334252;
  font-size:10px;
  font-weight:700;
  white-space:nowrap;
}
.base-style-control select{
  height:17px;
  max-width:150px;
  padding:0 2px;
  border:0;
  background:#fff;
  color:#18232e;
  font:inherit;
}
.leaflet-container .leaflet-tile-pane img{
  transition:filter .18s ease;
}
.leaflet-container.osm-style-mono .leaflet-tile-pane img{
  filter:grayscale(1) contrast(1.85) brightness(1.12);
}
.leaflet-container.osm-style-red .leaflet-tile-pane img{
  filter:grayscale(1) sepia(1) saturate(7) hue-rotate(315deg) contrast(1.7) brightness(1.12);
}
.leaflet-container.osm-style-green .leaflet-tile-pane img{
  filter:grayscale(1) sepia(1) saturate(6) hue-rotate(72deg) contrast(1.7) brightness(1.12);
}
.leaflet-container.osm-style-blue .leaflet-tile-pane img{
  filter:grayscale(1) sepia(1) saturate(7) hue-rotate(168deg) contrast(1.7) brightness(1.12);
}
.leaflet-container.base-provider-esri .leaflet-tile-pane img{
  filter:none;
}

/* v58 visible GPS control-point records */
.base-map-coordinate-readout{
  min-width:210px;
  padding:2px 6px;
  border:1px solid #b7c2cc;
  background:#fff;
  color:#24384b;
  font:600 10px/1.2 Consolas,monospace;
  text-align:right;
  white-space:nowrap;
}
.control-point-summary{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:center;
  gap:8px 18px;
}
.control-point-metrics{
  display:flex;
  flex-wrap:wrap;
  gap:8px 22px;
}
.control-point-gps-list{
  display:flex;
  min-width:0;
  gap:6px;
  overflow-x:auto;
}
.control-point-gps-record{
  display:grid;
  grid-template-columns:auto minmax(165px,1fr) auto;
  align-items:center;
  flex:1 1 270px;
  min-width:270px;
  max-width:390px;
  gap:7px;
  padding:4px 5px;
  border:1px solid #b9c4ce;
  background:#f7f9fb;
}
.control-point-gps-record.pending{
  border-color:#d0a83b;
  background:#fff8dc;
}
.control-point-gps-record>strong{
  display:grid;
  place-items:center;
  width:28px;
  height:28px;
  border-radius:50%;
  background:#d71920;
  color:#fff;
  font-size:10px;
}
.control-point-gps-record>span{display:grid;min-width:0}
.control-point-gps-record small{
  overflow:hidden;
  color:#66737f;
  font-size:8px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.control-point-gps-record code{
  color:#142b40;
  font-size:11px;
  font-weight:700;
  white-space:nowrap;
}
.control-point-gps-record button{
  height:24px;
  padding:0 7px;
  border:1px solid #8d9aa6;
  background:#fff;
  color:#25394c;
  font-size:9px;
  font-weight:700;
  cursor:pointer;
}
.control-point-gps-record button:hover{border-color:#214f8c;color:#214f8c}
.control-point-gps-empty{color:#6c7781;font-size:10px;font-style:italic}
.gps-control-tooltip{
  border:1px solid #516170;
  border-radius:2px;
  font:600 10px/1.3 Consolas,monospace;
}

/* v65: reusable project-level Base Map reference points */
.base-point-panel{
  flex:0 0 auto;
  min-width:0;
  border-top:1px solid #aeb7c0;
  background:#fff;
}
.base-point-panel-heading{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:8px;
  padding:4px 7px;
  background:#eef2f5;
  color:#23384b;
  font-size:10px;
}
.base-point-panel-heading span{color:#66737f;font-size:8px;text-align:right}
.base-point-table-scroll{max-height:152px;overflow:auto}
.base-point-table{
  width:100%;
  border-collapse:collapse;
  table-layout:auto;
  color:#1d2f3f;
  font-size:9px;
}
.base-point-table th,
.base-point-table td{
  padding:3px 5px;
  border-top:1px solid #d6dde3;
  text-align:left;
  vertical-align:middle;
  white-space:nowrap;
}
.base-point-table thead th{
  position:sticky;
  top:0;
  z-index:1;
  background:#f6f8fa;
  color:#52616e;
  font-size:8px;
  text-transform:uppercase;
  letter-spacing:.25px;
}
.base-point-table tbody tr.active-match{background:#eef7ff}
.base-point-table code{font:700 9px/1.25 Consolas,monospace;color:#142b40}
.base-point-table .base-point-dms{display:block;margin-bottom:1px}
.base-point-table .base-point-decimal{display:block;color:#687785;font-size:8px}
.base-point-label{
  display:inline-grid;
  place-items:center;
  min-width:29px;
  height:22px;
  padding:0 4px;
  border-radius:12px;
  background:#d71920;
  color:#fff;
  font-weight:800;
}
.base-point-match-state{color:#697783;font-style:italic}
.base-point-match-state.matched{color:#176c39;font-style:normal;font-weight:700}
.base-point-actions{display:flex;gap:3px}
.base-point-actions button,
.base-point-popup-actions button{
  min-height:22px;
  padding:1px 6px;
  border:1px solid #8797a5;
  border-radius:2px;
  background:#fff;
  color:#21394d;
  font:700 8px/1.15 Arial,sans-serif;
  cursor:pointer;
}
.base-point-actions button:hover,
.base-point-popup-actions button:hover{border-color:#214f8c;color:#214f8c}
.base-point-actions button:disabled{cursor:not-allowed;opacity:.45}
.base-point-actions button.danger{color:#a51e25}
.base-point-empty-row td{padding:10px;color:#6c7781;text-align:center;font-style:italic}
.control-point-pairing-hint{min-width:0;color:#627180;font-size:9px;font-style:italic}
.base-point-popup{min-width:270px;color:#1a2d3f;font:11px/1.3 Arial,sans-serif}
.base-point-popup h3{margin:0 0 5px;font-size:13px}
.base-point-popup-grid{display:grid;grid-template-columns:auto 1fr;gap:3px 8px;align-items:baseline}
.base-point-popup-grid span{color:#657382;font-size:9px}
.base-point-popup-grid code{font:700 10px/1.25 Consolas,monospace;white-space:nowrap}
.base-point-popup-note{margin:5px 0 0;color:#6b7782;font-size:8px}
.base-point-popup-actions{display:flex;flex-wrap:wrap;gap:4px;margin-top:7px}
.registration-map.base-point-capture{cursor:crosshair}
.button.capture-active{border-color:#d19b14!important;background:#fff3c7!important;color:#573d00!important}
.base-reference-marker{background:transparent;border:0}
.base-reference-marker span{
  display:grid;
  place-items:center;
  min-width:30px;
  height:30px;
  padding:0 3px;
  border:3px solid #fff;
  border-radius:17px;
  outline:2px solid #20262c;
  background:#d71920;
  color:#fff;
  box-shadow:0 2px 5px rgba(0,0,0,.4);
  font:800 10px/1 Arial,sans-serif;
}
.base-reference-marker.matched span{background:#176c39}
@media(max-width:900px){
  .control-point-summary{grid-template-columns:1fr}
  .base-map-coordinate-readout{min-width:0}
  .base-point-table-scroll{max-height:180px}
}
.transform-opacity{
  display:grid;
  grid-template-columns:auto 1fr 36px;
  align-items:center;
  gap:6px;
  font-size:10px;
  font-weight:700;
}
.transform-opacity input{min-width:80px;accent-color:#64b5f6}
.transform-opacity output{text-align:right;font-variant-numeric:tabular-nums}
.transform-values{
  display:grid;
  grid-template-columns:repeat(4,minmax(64px,1fr));
  overflow:hidden;
  border:1px solid #425365;
  border-radius:4px;
  background:#0e1822;
}
.transform-values label{min-width:0;padding:4px 7px;border-right:1px solid #425365}
.transform-values label:last-child{border-right:0}
.transform-values span{display:block;color:#8ea1b3;font-size:8px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.transform-values output{display:block;overflow:hidden;font:600 10px/1.25 Consolas,monospace;text-overflow:ellipsis;white-space:nowrap}
.transform-reset{border-color:#7b5d5d;background:transparent;color:#f1c9c9}
.fine-tune-map.move-underlay-active{cursor:move}
.fine-tune-map.moving-underlay{cursor:grabbing}
@media(max-width:1100px){
  .transform-console{grid-template-columns:minmax(150px,1fr) auto auto minmax(190px,1fr) auto}
  .transform-values{grid-column:1/-1;grid-row:2}
}

/* v28 StructCalc interface and live georeferencing */
:root{
  --sc-blue:#214f8c;
  --sc-blue-dark:#173b6a;
  --sc-blue-pale:#eaf1fa;
  --sc-grey-0:#f4f5f7;
  --sc-grey-1:#e2e6ea;
  --sc-grey-2:#b9c1ca;
  --sc-ink:#17212b;
  --sc-muted:#5d6874;
  --accent:var(--sc-blue);
  --accent-dark:var(--sc-blue-dark);
  --bg:#e9edf1;
  --border:#bec6ce;
}
body{font-family:"Segoe UI",Arial,sans-serif;background:var(--bg);color:var(--sc-ink)}
.topbar{padding:8px 12px;min-height:58px;background:linear-gradient(#fff,#f7f8fa);border-bottom:1px solid #aeb7c0;box-shadow:none}
.topbar h1{font-size:1.16rem;letter-spacing:.1px;margin-bottom:2px}.topbar p{font-size:.78rem}
.actions{gap:5px}.button{border-radius:3px;padding:7px 10px;font-size:.78rem;box-shadow:inset 0 1px 0 rgba(255,255,255,.7)}
.button.primary{background:linear-gradient(#2d65aa,#214f8c);border-color:#173b6a}.button:disabled{opacity:.45;cursor:not-allowed}
.app-tabs{padding:0 8px;background:#f2f4f6;border-bottom:1px solid #aeb7c0;box-shadow:none}.app-tab{padding:9px 18px;font-size:.82rem;border-right:1px solid transparent;border-left:1px solid transparent}.app-tab.active{background:#fff;border-left-color:#b8c0c8;border-right-color:#b8c0c8;border-bottom-color:var(--sc-blue)}
.info-card,.registration-pane,.live-photo-card,.status-card,.help,.draw-panel{border-radius:4px;box-shadow:none}
.sidebar{background:#eef1f4;padding:10px}.field-label{font-size:.78rem}.text-input{border-radius:3px;padding:7px 8px}
.underlay-tab{padding:12px;background:#e9edf1}.underlay-toolbar{background:#fff;border:1px solid #bec6ce;padding:12px;margin-bottom:8px}.underlay-toolbar h2{font-size:1.05rem}.underlay-toolbar p{font-size:.8rem}
.registration-status{border-radius:3px;margin-bottom:8px;padding:8px 10px;font-size:.82rem}
.registration-workspace{gap:8px;min-height:500px}.registration-pane{border-color:#aeb7c0}.registration-pane-title{background:linear-gradient(#f8f9fa,#e8ebee);font-size:.8rem;padding:7px 9px}.registration-map,.underlay-canvas-wrap{min-height:480px}
.control-point-summary{border-radius:3px;margin:8px 0;padding:8px 10px;font-size:.78rem}.underlay-help{font-size:.77rem;margin:8px 0}
.registration-control-marker{background:transparent;border:0}.registration-control-marker span,.plan-control-point{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:#d71920;color:#fff;border:3px solid #fff;outline:2px solid #20262c;box-shadow:0 2px 5px rgba(0,0,0,.35);font:700 12px/1 "Segoe UI",Arial,sans-serif;cursor:move}
.plan-control-point{position:absolute;margin:-13px 0 0 -13px;pointer-events:auto;z-index:8;padding:0}.plan-control-point.dragging{background:#214f8c;transform:scale(1.08)}
.plan-view-controls,.plan-zoom-controls,.plan-rotate-controls{display:flex;align-items:center;gap:3px}
.plan-view-controls{gap:9px}
.plan-zoom-controls>span,.plan-rotate-controls>span{color:#596570;font-size:10px;font-weight:600}
.plan-zoom-controls button,.plan-rotate-controls button{height:22px;min-width:25px;padding:0 6px;border:1px solid #aaa;border-radius:2px;background:#f7f7f7;color:#111;font:600 11px/1 "Segoe UI",Arial,sans-serif;cursor:pointer}
.plan-zoom-controls button:hover:not(:disabled),.plan-rotate-controls button:hover:not(:disabled){background:#fff;border-color:#777}
.plan-zoom-controls button:disabled,.plan-rotate-controls button:disabled{opacity:.45;cursor:not-allowed}
.plan-zoom-controls button:nth-child(3){min-width:48px}
.plan-rotate-controls button:nth-child(3){min-width:42px}
.live-picture-grid{gap:10px}.live-photo-card{border-color:#aeb7c0}.live-photo-note{border-radius:3px}

/* v30 performance: skip layout/paint for off-screen report cards and keep map transforms on the compositor. */
.live-photo-card{content-visibility:auto;contain-intrinsic-size:420px 360px;contain:layout paint style}
.photo-list-item{content-visibility:auto;contain-intrinsic-size:64px 300px}
.leaflet-underlay-image{will-change:transform;backface-visibility:hidden}

/* v32: compact StructCalc desktop interface, aligned with FrameCalc 2D */
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  font-size:13px;
  background:#f0f0f0;
  color:#111;
  overflow:hidden;
}
.topbar{
  min-height:30px;
  padding:2px 8px;
  gap:6px;
  flex-shrink:0;
  background:linear-gradient(#ececec,#e1e1e1);
  border-bottom:1px solid #aaa;
}
.topbar>div:first-child{
  min-width:205px;
  padding-right:6px;
}
.topbar h1{
  margin:0;
  color:#3e4b59;
  font-size:12px;
  line-height:1.1;
  letter-spacing:.2px;
  white-space:nowrap;
}
.topbar p{display:none}
.actions{
  flex:1;
  align-items:center;
  flex-wrap:nowrap;
  gap:5px;
  min-width:0;
  overflow-x:auto;
  scrollbar-width:none;
}
.actions::-webkit-scrollbar{display:none}
.button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  vertical-align:middle;
  min-height:24px;
  height:24px;
  padding:0 7px;
  border:1px solid #b8b8b8;
  border-radius:3px;
  background:#f7f7f7;
  color:#111;
  box-shadow:none;
  font:600 12px/1.1 -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  white-space:nowrap;
}
.button:hover{background:#fff;border-color:#888}
.button.primary{
  background:#1a6fc4;
  border-color:#155aa0;
  color:#fff;
}
.button.primary:hover{background:#155aa0}
.app-tabs{
  flex-shrink:0;
  padding:0;
  background:#ddd;
  border-bottom:2px solid #aaa;
}
.app-tab{
  padding:5px 16px;
  border:0;
  border-right:1px solid #bbb;
  border-bottom:2px solid transparent;
  background:#ddd;
  color:#555;
  font:600 12px/1.2 -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
}
.app-tab:hover{background:#e8e8e8;color:#111}
.app-tab.active{
  margin-bottom:-2px;
  border-right-color:#bbb;
  border-left:0;
  border-bottom-color:#1a6fc4;
  background:#fff;
  color:#111;
}
.info-tab{
  padding:10px;
  background:#f0f0f0;
}
.info-card{
  max-width:none;
  margin:0;
  padding:0;
  border:1px solid #bbb;
  border-radius:0;
  background:#fff;
  box-shadow:none;
}
.info-card h2{
  margin:0;
  padding:6px 8px;
  border-bottom:1px solid #bbb;
  background:#d0d8e0;
  color:#222;
  font-size:12px;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.info-form{
  padding:10px;
  gap:10px 12px;
}
.info-form label,.info-print-options>label:first-child{
  gap:4px;
  font-size:12px;
}
.text-input{
  height:28px;
  padding:3px 6px;
  border:1px solid #b8b8b8;
  border-radius:0;
  color:#111;
  font-size:12px;
}
.text-input:focus{
  outline:2px solid #1a6fc4;
  outline-offset:-2px;
  background:#fffde7;
}
.info-print-options{
  margin:0 10px;
  padding:9px 0;
  gap:20px;
  border-top:1px solid #d6d6d6;
}
.info-note{
  margin:0;
  padding:6px 10px;
  border-top:1px solid #eee;
  background:#fafafa;
  color:#777;
  font-size:11px;
}
.sidebar{border-right:2px solid #aaa}
.status-card,.help,.draw-panel,.drop-zone,.photo-list-item,
.registration-status,.registration-pane,.control-point-summary,
.live-photo-card,.live-photo-note{
  border-radius:0;
  box-shadow:none;
}
.picture-grid-tab,.underlay-tab{background:#f0f0f0}
.underlay-toolbar,.picture-grid-toolbar{
  border-radius:0;
  box-shadow:none;
}
.registration-map{
  overflow:hidden;
  overscroll-behavior:contain;
  touch-action:none;
  user-select:none;
  -webkit-user-drag:none;
}
.underlay-tab.map-panning{overflow:hidden}
#underlayTab.active{
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
#underlayTab .underlay-toolbar,
#underlayTab .registration-status,
#underlayTab .control-point-summary,
#underlayTab .underlay-help{
  flex-shrink:0;
}
#underlayTab .registration-workspace{
  flex:1 1 auto;
  min-height:250px;
  height:0;
  overflow:hidden;
}
#underlayTab .registration-pane{
  min-height:0;
  height:100%;
}
#underlayTab .registration-map,
#underlayTab .underlay-canvas-wrap{
  flex:1 1 auto;
  min-height:0;
  height:0;
}
#underlayTab .underlay-canvas-wrap{
  display:block;
  position:relative;
  cursor:grab;
  touch-action:none;
  user-select:none;
}
.underlay-plan-stage{
  position:relative;
  margin:0 auto;
  min-width:0;
  min-height:0;
  will-change:transform;
}
#underlayTab .underlay-canvas-wrap.panning{cursor:grabbing}
#underlayTab .underlay-canvas-wrap.placing-control-point{cursor:crosshair}
#underlayTab .underlay-canvas-wrap canvas{
  display:block;
  position:absolute;
  margin:0;
  max-width:none;
  transform-origin:center center;
}
@media(max-width:760px){
  body{overflow:auto}
  .topbar{align-items:stretch;flex-direction:column;padding:5px 8px}
  .topbar>div:first-child{min-width:0}
  .actions{width:100%}
  .info-tab{padding:6px}
  #underlayTab.active{overflow:auto}
  #underlayTab .registration-workspace{height:auto;min-height:720px;overflow:visible}
}

/* v34: maximise map and plan workspace */
.topbar{
  min-height:22px;
  padding:1px 5px;
  gap:4px;
}
.topbar>div:first-child{min-width:188px;padding-right:3px}
.topbar h1{font-size:11px;line-height:1}
.actions{gap:3px}
.button{
  min-height:20px;
  height:20px;
  padding:0 6px;
  font-size:11px;
}
.app-tabs{border-bottom-width:1px}
.app-tab{
  padding:3px 13px;
  border-bottom-width:1px;
  font-size:11px;
  line-height:1.15;
}
.app-tab.active{margin-bottom:-1px}
.underlay-tab{padding:4px}
#underlayTab .underlay-toolbar{
  align-items:center;
  gap:8px;
  margin-bottom:3px;
  padding:4px 6px;
}
#underlayTab .underlay-toolbar>div:first-child{
  display:flex;
  align-items:baseline;
  gap:9px;
  min-width:0;
}
#underlayTab .underlay-toolbar h2{
  flex-shrink:0;
  margin:0;
  font-size:12px;
  line-height:1.15;
}
#underlayTab .underlay-toolbar p{
  overflow:hidden;
  margin:0;
  font-size:10px;
  line-height:1.15;
  text-overflow:ellipsis;
  white-space:nowrap;
}
#underlayTab .underlay-actions{gap:4px}
#underlayTab .registration-status{
  margin-bottom:3px;
  padding:3px 6px;
  font-size:10px;
  line-height:1.2;
}
#underlayTab .registration-workspace{gap:4px}
#underlayTab .registration-pane-title{
  min-height:20px;
  padding:3px 6px;
  font-size:11px;
  line-height:1.1;
}
#underlayTab .plan-zoom-controls button,
#underlayTab .plan-rotate-controls button{
  height:18px;
  min-width:22px;
  font-size:10px;
}
#underlayTab .control-point-summary{
  margin:3px 0;
  padding:3px 6px;
  gap:18px;
  font-size:10px;
}
#underlayTab .underlay-help{
  overflow:hidden;
  margin:2px 0 0;
  font-size:10px;
  line-height:1.2;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.fine-tune-toolbar{gap:4px;padding:4px}
.underlay-fine-controls,.fine-tune-layers{padding:3px 6px}
.fine-control-group button,.fine-refit-button{height:20px;min-width:24px}

/* v59 full working-interface night mode. Print output deliberately remains light. */
@media screen{
  html[data-theme="night"]{
    color-scheme:dark;
    --bg:#0f151c;
    --panel:#18212b;
    --text:#e6edf4;
    --muted:#9eacb9;
    --border:#394958;
    --accent:#65aef5;
    --accent-dark:#3d8dd8;
    --danger:#ff8585;
    --sc-ink:#e6edf4;
    --sc-blue:#65aef5;
  }
  html[data-theme="night"] body{background:#0f151c;color:#e6edf4}
  html[data-theme="night"] .topbar{background:linear-gradient(#202b36,#17212b);border-color:#3a4957;color:#edf4fa}
  html[data-theme="night"] .topbar h1 span,
  html[data-theme="night"] .topbar p{color:#9dadbb}
  html[data-theme="night"] .button,
  html[data-theme="night"] .theme-toggle,
  html[data-theme="night"] button:not(.app-tab):not(.plan-control-point):not(.underlay-layer-delete){border-color:#536676;background:#253340;color:#edf4fa;box-shadow:none}
  html[data-theme="night"] .button:hover:not(:disabled),
  html[data-theme="night"] button:hover:not(:disabled){border-color:#78a7cf;background:#304456}
  html[data-theme="night"] .fine-control-group .fine-adjust-button.holding:not(:disabled){border-color:#78bdf5;background:#214c6d;box-shadow:inset 0 0 0 1px #78bdf5}
  html[data-theme="night"] .theme-toggle[aria-pressed="true"]{border-color:#7eb8ed;background:#173f63;color:#d9efff}
  html[data-theme="night"] .base-style-control{border-color:#506171;background:#202c37;color:#dce7f0}
  html[data-theme="night"] input,
  html[data-theme="night"] textarea,
  html[data-theme="night"] select,
  html[data-theme="night"] output.base-map-coordinate-readout{border-color:#4b5d6d;background:#111a22;color:#e8f0f7}
  html[data-theme="night"] input::placeholder,
  html[data-theme="night"] textarea::placeholder{color:#7f8e9b}
  html[data-theme="night"] .app-tabs{background:#131c24;border-color:#3b4a58}
  html[data-theme="night"] .app-tab{color:#aebbc6;background:#131c24}
  html[data-theme="night"] .app-tab:hover{background:#202c36;color:#fff}
  html[data-theme="night"] .app-tab.active{border-color:#445767;border-bottom-color:#65aef5;background:#202b35;color:#fff}
  html[data-theme="night"] .info-tab,
  html[data-theme="night"] .underlay-tab,
  html[data-theme="night"] .fine-tune-tab,
  html[data-theme="night"] .picture-grid-tab,
  html[data-theme="night"] .help-tab{background:#10171e}
  html[data-theme="night"] .info-card,
  html[data-theme="night"] .help-card,
  html[data-theme="night"] .underlay-toolbar,
  html[data-theme="night"] .registration-pane,
  html[data-theme="night"] .control-point-summary,
  html[data-theme="night"] .underlay-fine-controls,
  html[data-theme="night"] .fine-tune-layers,
  html[data-theme="night"] .status-card,
  html[data-theme="night"] .paint-toolbar,
  html[data-theme="night"] .map-underlay-controls,
  html[data-theme="night"] .live-photo-card,
  html[data-theme="night"] .live-photo-details,
  html[data-theme="night"] .photo-list-item{border-color:#3b4c5b;background:#18222c;color:#e5edf4;box-shadow:none}
  html[data-theme="night"] .info-form,
  html[data-theme="night"] .info-print-options,
  html[data-theme="night"] .picture-grid-toolbar,
  html[data-theme="night"] .fine-tune-toolbar{border-color:#394957;background:#16202a;color:#e5edf4}
  html[data-theme="night"] .registration-pane-title{border-color:#3b4b59;background:linear-gradient(#26333f,#1b2630);color:#e9f0f6}
  html[data-theme="night"] .registration-status{border-color:#435463;background:#18232d;color:#d8e4ed}
  html[data-theme="night"] .registration-status.active{border-color:#967b34;background:#3a321b;color:#ffeca8}
  html[data-theme="night"] .registration-status.good{border-color:#47775b;background:#173123;color:#bfe8cb}
  html[data-theme="night"] .sidebar{border-color:#3c4b58;background:#131c24}
  html[data-theme="night"] .drop-zone{border-color:#536575;background:#1a2630;color:#dfe8ef}
  html[data-theme="night"] .drop-zone.drag-over{border-color:#72b9f4;background:#19364d}
  html[data-theme="night"] .status-card span,
  html[data-theme="night"] .field-label,
  html[data-theme="night"] .fine-control-group>span,
  html[data-theme="night"] .fine-tune-status,
  html[data-theme="night"] .layer-list-empty{color:#a3b1bd}
  html[data-theme="night"] .photo-list-item:hover{background:#233341}
  html[data-theme="night"] .live-photo-image,
  html[data-theme="night"] .grid-empty{border-color:#435362;background:#111920;color:#a8b5c0}
  html[data-theme="night"] .control-point-gps-record{border-color:#465968;background:#17232d;color:#e1eaf1}
  html[data-theme="night"] .control-point-gps-record.pending{border-color:#927b38;background:#342e1b}
  html[data-theme="night"] .control-point-gps-record small,
  html[data-theme="night"] .control-point-gps-empty{color:#94a4b1}
  html[data-theme="night"] .control-point-gps-record code{color:#d9ecfb}
  html[data-theme="night"] .base-point-panel{border-color:#465968;background:#121c24}
  html[data-theme="night"] .base-point-panel-heading{background:#202c36;color:#e9f0f6}
  html[data-theme="night"] .base-point-panel-heading span,
  html[data-theme="night"] .control-point-pairing-hint{color:#94a4b1}
  html[data-theme="night"] .base-point-table{color:#e1eaf1}
  html[data-theme="night"] .base-point-table th,
  html[data-theme="night"] .base-point-table td{border-color:#3c4d5b}
  html[data-theme="night"] .base-point-table thead th{background:#1a2731;color:#aebbc6}
  html[data-theme="night"] .base-point-table tbody tr.active-match{background:#183047}
  html[data-theme="night"] .base-point-table code{color:#d9ecfb}
  html[data-theme="night"] .base-point-table .base-point-decimal,
  html[data-theme="night"] .base-point-empty-row td{color:#94a4b1}
  html[data-theme="night"] .base-point-match-state.matched{color:#7cd59b}
  html[data-theme="night"] .base-point-popup{color:#1a2d3f}
  html[data-theme="night"] .underlay-canvas-wrap{background:#232e37}
  html[data-theme="night"] .underlay-empty{color:#a2afba}
  html[data-theme="night"] .underlay-layer-row{border-color:#435462;background:#18232d;color:#e2ebf2}
  html[data-theme="night"] .underlay-layer-row.active{border-color:#6ca8db;background:#1a3850}
  html[data-theme="night"] .underlay-layer-delete{border-color:#925c5c;background:#2e1c1c;color:#ffaaaa}
  html[data-theme="night"] .map-underlay-title,
  html[data-theme="night"] .map-layer-switches{border-color:#3f4e5b;color:#cbd7e0}
  html[data-theme="night"] .leaflet-container{background:#111820}
  html[data-theme="night"] .leaflet-control-zoom a,
  html[data-theme="night"] .leaflet-control-layers,
  html[data-theme="night"] .leaflet-control-attribution{border-color:#4b5d6b!important;background:#18232d!important;color:#dbe6ee!important}
  html[data-theme="night"] .leaflet-control-zoom a:hover{background:#263746!important;color:#fff!important}
  html[data-theme="night"] .leaflet-control-attribution a{color:#78bdf5!important}
  html[data-theme="night"] .leaflet-control-scale-line{border-color:#dbe5ec;color:#e6eef4;background:rgba(18,27,35,.72)}
  html[data-theme="night"] .leaflet-container.osm-style-original .leaflet-tile-pane img{
    filter:brightness(.66) invert(.93) contrast(1.18) hue-rotate(180deg) saturate(.55);
  }
  html[data-theme="night"] .leaflet-container.osm-style-mono .leaflet-tile-pane img{
    filter:grayscale(1) invert(.92) contrast(1.45) brightness(.72);
  }
  html[data-theme="night"] .leaflet-container.osm-style-red .leaflet-tile-pane img{
    filter:grayscale(1) invert(1) sepia(1) saturate(7) hue-rotate(310deg) contrast(1.45) brightness(.78);
  }
  html[data-theme="night"] .leaflet-container.osm-style-green .leaflet-tile-pane img{
    filter:grayscale(1) invert(1) sepia(1) saturate(6) hue-rotate(68deg) contrast(1.45) brightness(.72);
  }
  html[data-theme="night"] .leaflet-container.osm-style-blue .leaflet-tile-pane img{
    filter:grayscale(1) invert(1) sepia(1) saturate(7) hue-rotate(168deg) contrast(1.45) brightness(.78);
  }
  html[data-theme="night"] .leaflet-container.base-provider-esri .leaflet-tile-pane img{
    filter:none;
  }
}
@media print{
  html,body{background:#fff!important;color:#111!important;color-scheme:light!important}
  .print-report,.report-page,.report-page-header,.map-title-block,.report-photo-card{background:#fff!important;color:#111!important}
}

/* v60 Google Maps-compatible GPS field on picture cards */
.live-photo-gps{display:block;min-width:0}
.live-photo-gps label{display:grid;min-width:0;gap:3px}
.live-photo-gps label>span{color:#596570;font-size:9px;font-weight:700;letter-spacing:.02em}
.live-photo-gps-input{
  box-sizing:border-box;
  width:100%;
  height:30px;
  padding:5px 8px;
  border:1px solid #8d9ba7;
  border-radius:3px;
  background:#f7fbff;
  color:#142b40;
  font:700 12px/1.2 Consolas,"Courier New",monospace;
  cursor:copy;
}
.live-photo-gps-input:focus{border-color:#1557a0;outline:2px solid rgba(21,87,160,.2);outline-offset:0}
.live-photo-gps-input.copied{border-color:#16823b;background:#e8f7ed;outline:2px solid rgba(22,130,59,.22)}
.live-photo-gps.missing .live-photo-gps-input{background:#eceff1;color:#78838c;cursor:not-allowed;font-style:italic;font-weight:600}
@media screen{
  html[data-theme="night"] .live-photo-gps label>span{color:#9eacb8}
  html[data-theme="night"] .live-photo-gps-input{border-color:#506474;background:#111c25;color:#dceeff}
  html[data-theme="night"] .live-photo-gps-input:focus{border-color:#65aef5;outline-color:rgba(101,174,245,.25)}
  html[data-theme="night"] .live-photo-gps-input.copied{border-color:#5fbd7d;background:#173425;color:#dff8e7;outline-color:rgba(95,189,125,.25)}
  html[data-theme="night"] .live-photo-gps.missing .live-photo-gps-input{background:#202a33;color:#7f8d98}
}

/* v61: native cursor remains visible over every part of the main map canvas. */
#map,
#map.leaflet-container,
#map.leaflet-grab,
#map .leaflet-map-pane,
#map .leaflet-tile-pane,
#map .leaflet-overlay-pane{cursor:crosshair!important}
