.result-visual { position:relative; overflow:hidden; border-radius:8px; line-height:0; }
.result-image .result-visual img { display:block; width:100%; height:auto; aspect-ratio:auto; object-fit:initial; }
.result-visual svg { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.image-download-dialog { width:min(420px,calc(100vw - 32px)); padding:24px; border:1px solid #b6c9be; border-radius:18px; background:#fafcf9; color:#203a31; box-shadow:0 24px 90px #142b3633; }
.image-download-dialog::backdrop { background:#20372b66; backdrop-filter:blur(3px); }
.image-download-dialog h2 { margin:0; font-size:20px; }
.download-scope { margin:6px 0 20px; color:#617469; font-size:13px; }
.download-choices { display:grid; gap:10px; }
.download-choice { display:flex; align-items:center; gap:12px; padding:14px; margin:0; border:1px solid #c7d4cb; border-radius:10px; cursor:pointer; background:#fff; }
.download-choice:has(input:checked) { border-color:#47816b; background:#edf5ef; }
.download-choice:focus-within { outline:2px solid #47816b; outline-offset:2px; }
.download-choice input[type="checkbox"] { flex:0 0 18px; width:18px; height:18px; min-height:18px; padding:0; margin:0; accent-color:#2a7255; }
.download-choice strong { display:block; font-size:14px; font-weight:600; }
.download-choice small { display:block; margin-top:3px; color:#64796b; font-size:12px; }
.download-status { font-size:13px; min-height:20px; margin:16px 0; overflow-wrap:anywhere; }
.image-download-dialog [hidden] { display:none!important; }
.image-download-dialog .dialog-actions { margin:0; display:flex; justify-content:flex-end; }
.history-owner { color:#536b5c; margin-left:auto; font-size:12px; }
.output-records { margin-top:24px; padding:24px; background:#f3f7f4; border:1px solid #cbd9d0; border-radius:16px; }
.output-records .section-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.output-records h2 { font-size:19px; margin:0; }
.output-list { min-height:72px; }
.output-record { margin-top:12px; border:1px solid #cad7ce; border-radius:10px; background:#fff; overflow:hidden; }
.output-record > summary { display:flex; align-items:center; gap:16px; cursor:pointer; padding:16px 18px; background:#eaf1ec; list-style:none; }
.output-record > summary::-webkit-details-marker { display:none; }
.operation-description { display:grid; gap:4px; min-width:0; flex:1; }
.operation-description strong { overflow-wrap:anywhere; }
.operation-description time { font-size:13px; color:var(--muted); }
.output-record .history-owner { margin:0; font-size:14px; }
.output-record .operation-delete { flex:0 0 auto; min-height:40px; padding:8px 14px; font-size:14px; }
.output-record-body figure { margin:0 0 16px; }
.output-record-body .photo-pair img { max-height:440px; }
.output-record-body .photo-pair { grid-template-columns:repeat(2,minmax(0,1fr)); }
.output-record-body .photo-pair > div { min-width:0; }
@media(max-width:760px) { .output-record-body .photo-pair { grid-template-columns:minmax(0,1fr); } }
.operation-result { max-height:320px; overflow:auto; }
.output-record > summary strong { font-size:14px; font-variant-numeric:tabular-nums; }
.output-record > summary::before { content:''; width:7px; height:7px; flex:0 0 7px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(-45deg); color:#496354; }
.output-record[open] > summary::before { transform:rotate(45deg); }
.output-record-body { padding:18px; }
.output-records .run-log { max-height:280px; overflow:auto; }
.output-status { font-size:13px; color:#8a4436; }
@media(max-width:600px) { .output-records { padding:12px; } .output-record > summary { padding:12px; gap:10px; flex-wrap:wrap; } .operation-description { flex-basis:calc(100% - 30px); } .output-record .mode-tag { margin-left:17px; } .output-record .operation-delete { margin-left:auto; } }
.records-filter { display:flex; align-items:end; gap:16px; margin-bottom:20px; }
.records-filter label { display:grid; gap:8px; min-width:220px; }
.records-filter [hidden] { display:none; }

/* Results first: one image, optional comparison and compact controls. */
#workspace .photo-pair { grid-template-columns:minmax(0,1fr); }
#workspace .photo-pair.comparing { grid-template-columns:repeat(2,minmax(0,1fr)); }
#workspace .photo-pair > [hidden],#workspace .photo-controls [hidden] { display:none; }
#workspace .photo-gallery img { aspect-ratio:1.2; min-height:220px; max-height:clamp(260px,48vh,520px); border:0; background:#101711; }
#workspace .photo-gallery figcaption { justify-content:flex-end; gap:12px; padding-bottom:12px; }
#workspace .photo-pair h3 { font-size:14px; font-weight:600; color:var(--ink); }
#workspace .photo-controls { gap:12px; padding:8px 0; border:0; }
#workspace .photo-controls select { width:auto; min-width:180px; }
#workspace .photo-controls label { font-size:14px; }
#workspace .photo-controls input[type=checkbox] { accent-color:#28694d; }
.photo-downloads { position:relative; margin-left:auto; }
.photo-downloads summary,.photo-compare { cursor:pointer; padding:8px 14px; font-size:14px; }
.photo-downloads[open] { padding-bottom:8px; }
.photo-downloads a { display:block; padding:8px 14px; font-size:14px; }
.photo-downloads a[hidden] { display:none; }
.photo-info,.photo-versions,.operation-details { margin-top:12px; font-size:13px; color:var(--muted); }
.photo-info summary,.photo-versions summary,.operation-details summary { cursor:pointer; padding:6px 0; }
#workspace .colour-status { min-height:300px; border:0; background:#f2f5f2; color:var(--muted); }
.photo-retry { margin:8px 0; }
.result-visual { min-height:180px; }
.image-load-state { padding:32px 12px; color:var(--muted); font-size:14px; text-align:center; }
.output-record .photo-gallery figure { border:0; }
@media(max-width:760px) { #workspace .photo-pair.comparing { grid-template-columns:minmax(0,1fr); } }

.z-window-survey { display: block; width: 100%; height: auto; cursor: zoom-in; }
.z-survey-colour { margin-top:16px; padding:16px; border:1px solid #cbd9d0; border-radius:12px; background:#fff; }
.z-survey-colour h3 { margin:0 0 8px; font-size:16px; }
.z-survey-colour > .mode-tag { display:inline-block; margin:0 0 12px; }
.z-survey-colour .result-gallery { margin:0; }
