/* Single-frame camera timeline and hourly gauge chart. */
.camera-history .history-quick{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0}
.camera-history .history-quick button,.gauge-history .history-head button{min-height:36px;padding:6px 10px;border:1px solid var(--border,#cfdbe0);border-radius:8px;background:#fff;color:inherit;font:inherit;font-size:13px;cursor:pointer}
.gauge-history .history-head button[aria-pressed=true]{border-color:#087d80;background:#ebf7f5;font-weight:700}
/* The history image shares the live frame; controls stay directly below it. */
.camera-history{margin:10px 0 16px;padding-top:0;border-bottom:1px solid var(--border,#cfdbe0);padding-bottom:12px}
.camera-history h3{font-size:13px;margin:0 0 8px}
.camera-history .history-caption{min-height:3.4em;font-size:12px;line-height:1.7;margin:0;overflow-wrap:anywhere}
.camera-history .history-frame-status{font-size:12px;color:#9b3440;margin:4px 0}
body[data-camera-history=true] #camera-image,body[data-camera-history=true] #camera-overlay,body[data-camera-history=true] #image-placeholder,body[data-camera-history=true] #toggle-overlay,body[data-camera-history=true] #overlay-note,body[data-camera-history=true] .capture-info{display:none!important}
.camera-history .history-controls{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0}
.camera-history .history-controls button{min-height:44px;font-size:12px;padding:8px 10px}
.camera-history input[type=range]{display:block;margin:0;width:100%;min-height:44px;accent-color:#087d80;cursor:ew-resize}
.camera-history .history-ends{display:flex;justify-content:space-between;gap:12px;font-size:10px;color:var(--muted,#536974)}
.camera-history>p,.camera-history .history-body>small{line-height:1.8;overflow-wrap:anywhere}
.gauge-history{margin-top:18px;padding-top:14px;border-top:1px solid var(--border,#cfdbe0)}
.gauge-history h3{font-size:17px;margin:0 0 8px}
.gauge-history .history-head{display:flex;gap:6px;margin-bottom:8px}
.gauge-history button{min-height:44px;max-width:100%;white-space:normal}
.gauge-history button:disabled{opacity:.55;cursor:default}
.gauge-history .history-readout{overflow-wrap:anywhere}
.gauge-history>small{display:block;margin:8px 0}
.gauge-history>button{display:block;margin:10px 0}
.gauge-history>a{display:inline-block;margin-top:8px}
.gauge-history .history-chart{display:block;width:100%;height:auto;touch-action:pan-y;background:#f6fafb;border-radius:10px}
.gauge-history .history-chart .grid{stroke:#dfe8ec;stroke-width:1}
.gauge-history .history-chart .axis{font-size:11px;fill:#5b707a}
.gauge-history .history-chart .level{fill:none;stroke:#1565c0;stroke-width:2.2;stroke-linejoin:round}
.gauge-history .history-chart .bank{stroke:#c62828;stroke-width:1.5;stroke-dasharray:6 4}
.gauge-history .history-chart .base{stroke:#7b8b93;stroke-width:1.2;stroke-dasharray:3 4}
.gauge-history .history-chart .label{font-size:11px;font-weight:700}
.gauge-history .history-chart .label.bank{fill:#c62828;stroke:none}.gauge-history .history-chart .label.base{fill:#5b707a;stroke:none}
.gauge-history .history-chart .dot{fill:#1565c0;stroke:#fff;stroke-width:2}
.gauge-history .history-readout{font-weight:700;margin:8px 0 2px}

/* Expanded camera reuses the same timeline and frame, avoiding duplicate history downloads. */
#image-dialog{width:min(1100px,96vw);max-height:94dvh;overflow:auto;padding:14px}
#image-dialog .dialog-top{position:sticky;top:-14px;z-index:4;background:#fff;padding:10px 0;gap:12px}
#image-dialog .dialog-top h2{font-size:18px;overflow-wrap:anywhere}
#image-dialog #close-image{min-height:44px;flex-shrink:0}
#image-dialog .large-frame{background:#edf3f4;min-height:160px;aspect-ratio:16/9;max-height:58dvh;display:flex;align-items:center;justify-content:center}
#image-dialog .large-frame>#large-image,#image-dialog .large-frame>#history-image{width:100%;height:100%;max-height:58dvh;object-fit:contain;margin:0;position:static}
#image-dialog #history-image[hidden]{display:none}
body[data-camera-history=true] #image-dialog #large-image,body[data-camera-history=true] #image-dialog #large-overlay,body[data-camera-history=true] #image-dialog #large-time,body[data-camera-history=true] #image-dialog #toggle-large-overlay,body[data-camera-history=true] #image-dialog #large-overlay-note{display:none!important}
#image-dialog .camera-history{margin:10px 0}
#image-dialog .history-caption{min-height:1.8em;font-size:14px;font-weight:600}
#image-dialog .history-controls{justify-content:center}
#image-dialog input[type=range]{min-height:44px;touch-action:pan-y}
#image-dialog .history-controls button{min-width:76px}
@media(max-width:650px){#image-dialog{padding:10px;width:96vw}#image-dialog .dialog-top{top:-10px}#image-dialog .dialog-top h2{font-size:15px}#image-dialog .history-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}#image-dialog .history-ends{font-size:9px}#image-dialog .camera-history>p{font-size:11px}}

/* Historical frames receive attribution only, never today's calibrated guides. */
body[data-camera-history=true] #image-frame:has(#history-image:not([hidden])):after,body[data-camera-history=true] #image-dialog .large-frame:has(#history-image:not([hidden])):after{content:"";position:absolute;inset:0;background:url('/v2/overlays/scccrn-credit-v1.svg') center/contain no-repeat;pointer-events:none;z-index:4}
