/* Phone-first preview. All layout overrides stay inside the existing phone breakpoint. */
.phone-camera-header,.phone-map-status,.phone-main-age,.phone-selected-thumb,.phone-settings-icon,.phone-capture-age,.phone-road-sheet{display:none}
.phone-view-bar svg{display:none}
.phone-target-sheet{color:var(--ink);background:var(--surface);border:1px solid var(--border)}
@media(max-width:760px),(max-width:1024px) and (max-height:500px){
 body:not(.calibration-active){grid-template-rows:54px 48px minmax(0,1fr) auto 52px 30px}
 .app-header{padding:0 12px;gap:10px}
 .brand-mark{width:26px;height:26px;flex-basis:26px}
 .phone-wordmark{font-size:23px;line-height:24px;letter-spacing:-1px}
 .app-header h1{font-size:10px;line-height:12px}
 .header-right{gap:7px}
 .header-right .pill{font-size:9px;max-width:84px;padding:5px 6px}
 .desktop-settings-label{display:none}
 .phone-settings-icon{display:block;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round}
 .header-right #openSettings{padding:10px;width:44px;height:44px;border:0;background:transparent}
 .drive-controls{padding:0 10px 5px;border:0}
 .control-row{height:100%}
 .mode-group{background:var(--surface-alt);border:1px solid var(--border);border-radius:11px;gap:3px;padding:3px;height:43px}
 .mode-group button{min-height:35px;height:35px;padding:4px;border:0;border-radius:8px;background:transparent;font-size:13px}
 .mode-group button.active{background:var(--accent);color:var(--accent-ink)}
 .mode-explanation{display:none!important}
 .dashboard{grid-row:3;padding:0 8px 4px;gap:8px;grid-template-rows:minmax(0,1fr) 104px}
 .map-panel{position:relative;border-radius:12px;overflow:hidden}
 .map-stage{position:relative;display:block;flex:1;min-height:0}
 #map{height:100%;width:100%}
 .map-top{position:absolute;bottom:30px;right:7px;z-index:500;padding:0;max-width:calc(100% - 80px);pointer-events:none}
 .map-actions{width:auto;gap:5px;pointer-events:auto}
 .map-actions button{min-height:38px;padding:6px 10px;font-size:11px;background:var(--glass);box-shadow:0 1px 6px #0003}
 .phone-map-status{display:flex;position:absolute;top:8px;right:8px;z-index:500;max-width:calc(100% - 76px);flex-direction:column;align-items:flex-end;gap:6px;pointer-events:none}
 .phone-map-status button{display:flex;align-items:center;gap:8px;min-height:44px;max-width:100%;border-radius:22px;padding:7px 12px;background:var(--glass);font-size:12px;box-shadow:0 2px 9px #0003;pointer-events:auto}
 #phoneTargetLabel{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 #phoneResumeMap{color:var(--accent);font-size:11px;min-height:38px}
 .target-summary{display:none!important}
 .map-bottom{min-height:23px;justify-content:center;padding:4px 8px;background:var(--surface)}
 .legend{font-size:9px;gap:6px}.legend i{width:11px;height:8px;border-radius:2px}
 .leaflet-control-attribution{font-size:8px!important;background:var(--glass)!important;color:var(--subtle)!important}
 .leaflet-control-attribution a{color:var(--subtle)!important}
 .leaflet-touch .leaflet-control-zoom{border:1px solid var(--border);overflow:hidden;border-radius:9px;box-shadow:0 2px 8px #0003}
 .leaflet-touch .leaflet-bar a{width:42px;height:42px;line-height:42px;background:var(--surface);color:var(--ink);border-color:var(--border);font-size:23px}
 .map-layer-controls{gap:5px!important;border:0!important;background:none!important;box-shadow:none!important}
 .map-layer-controls button{border:1px solid var(--border);border-radius:9px!important;background:var(--glass);box-shadow:0 2px 8px #0002}
 .phone-view-bar{gap:4px;margin:0 8px 2px;padding:3px;border:1px solid var(--border);background:var(--surface-alt);border-radius:12px}
 .phone-view-bar button{display:flex;gap:7px;justify-content:center;align-items:center;min-height:42px;border:0;border-radius:8px;background:transparent;font-size:14px}
 .phone-view-bar button.active{background:var(--accent);color:var(--accent-ink)}
 .phone-view-bar svg{display:block;width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linejoin:round}
 #phoneViewCount{display:inline-flex;white-space:nowrap;align-items:center;border:0;padding:0;margin:0;min-width:0;font-size:12px}
 #phoneViewCount:not(:empty):before{content:'·';margin-right:5px}
 footer{font-size:9px;gap:8px;line-height:12px}
 body>footer .site-status{line-height:12px}
 /* Quiet, full-card camera previews; freshness is always visible. */
 body[data-phone-layout="map"]:not(.calibration-active) .camera-panel,
 body[data-phone-layout="map"]:not(.calibration-active) .comparison-card{position:relative;border-radius:9px;box-shadow:none}
 body[data-phone-layout="map"]:not(.calibration-active) .camera-chrome,
 body[data-phone-layout="map"]:not(.calibration-active) .comparison-card-header{position:absolute;z-index:3;bottom:18px;left:0;right:0;background:linear-gradient(transparent,#080f18e6);height:27px;padding:0}
 body[data-phone-layout="map"]:not(.calibration-active) .camera-heading{height:27px;padding:5px 5px;gap:4px}
 body[data-phone-layout="map"]:not(.calibration-active) .camera-heading h2,
 body[data-phone-layout="map"]:not(.calibration-active) .comparison-card-title{color:#fff;font-size:11px;font-weight:650;line-height:17px}
 body[data-phone-layout="map"]:not(.calibration-active) .comparison-card-header{padding:5px 5px}
 body[data-phone-layout="map"]:not(.calibration-active) .comparison-role,
 body[data-phone-layout="map"]:not(.calibration-active) .camera-number{font-size:10px}
 body[data-phone-layout="map"]:not(.calibration-active) .compass,
 body[data-phone-layout="map"]:not(.calibration-active) .comparison-aim-label,
 body[data-phone-layout="map"]:not(.calibration-active) #targetBearingMarker{display:none!important}
 body[data-phone-layout="map"]:not(.calibration-active) .phone-main-age,
 body[data-phone-layout="map"]:not(.calibration-active) .comparison-card-meta{display:block;position:absolute;bottom:0;left:0;right:0;height:19px;z-index:3;background:#080f18e6;padding:0 6px 4px;color:#d1dae5;font-size:9px;pointer-events:none}
 body[data-phone-layout="map"] .comparison-capture{display:none}
 .phone-capture-age{display:block}
 .phone-main-age.stale,.is-stale .phone-capture-age{color:#f4cf8a!important}
 body[data-phone-layout="map"]:not(.calibration-active) .camera-loading{top:5px;bottom:auto}
 body[data-phone-layout="map"]:not(.calibration-active) .comparison-image-status{font-size:10px;padding:5px;bottom:42px}
 body[data-phone-layout="map"]:not(.calibration-active) .comparison-card-header{pointer-events:none}
 /* One large camera, with a compact three-view filmstrip. */
 body[data-phone-layout="cameras"]:not(.calibration-active){grid-template-rows:54px 0 minmax(0,1fr) auto 52px 30px}
 body[data-phone-layout="cameras"]:not(.calibration-active) .drive-controls,
 body[data-phone-layout="cameras"]:not(.calibration-active) .app-header .brand,
 body[data-phone-layout="cameras"]:not(.calibration-active) #sourceBadge{display:none}
 body[data-phone-layout="cameras"] .phone-camera-header{display:flex;gap:8px;align-items:center;min-width:0;flex:1}
 .phone-camera-header button{background:none;border:0;padding:5px 3px;min-height:44px;font-size:14px;color:var(--accent)}
 .phone-camera-header strong{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:16px;text-align:center}
 .phone-camera-header .camera-number{width:21px;height:21px;flex-basis:21px;font-size:12px}
 body[data-phone-layout="cameras"] .camera-stack,
 body[data-phone-layout="cameras"].pano-peeking .camera-stack{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) 104px;gap:8px}
 body[data-phone-layout="cameras"] .camera-panel{border-radius:10px}
 body[data-phone-layout="cameras"] .camera-chrome{padding:5px;gap:5px}
 body[data-phone-layout="cameras"] .main-camera-actions #skipView{display:none}
 body[data-phone-layout="cameras"] .camera-select:before{display:none}
 body[data-phone-layout="cameras"] .camera-select select{font-size:13px;min-height:40px;background:var(--surface);border-color:transparent}
 body[data-phone-layout="cameras"] #fullscreen{min-height:40px;font-size:12px}
 body[data-phone-layout="cameras"] .overview{height:34px;min-height:34px;flex-basis:34px;margin:3px 5px 5px;border-radius:5px;overflow:hidden}
 body[data-phone-layout="cameras"] .pano-bottom{padding:7px;display:flex;flex-direction:column;align-items:stretch;gap:7px;background:linear-gradient(transparent,#07111acc)}
 body[data-phone-layout="cameras"] .pano-bottom #imageAge{font-size:10px;padding:0;order:2}
 body[data-phone-layout="cameras"] .pano-bottom>div{justify-content:flex-end;gap:6px}
 body[data-phone-layout="cameras"] .pano-bottom button{min-width:44px;min-height:44px;border-radius:9px}
 body[data-phone-layout="cameras"] .compass{font-size:10px;top:8px;left:8px;max-width:calc(100% - 16px)}
 body[data-phone-layout="cameras"] #targetBearingMarker{top:53px;bottom:86px}
 body[data-phone-layout="cameras"] #resumeTarget{top:40px;right:8px;min-height:44px}
 body[data-phone-layout="cameras"] #comparisonPanel,
 body[data-phone-layout="cameras"].pano-peeking #comparisonPanel{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:minmax(0,1fr);gap:6px;border:0;background:transparent;overflow:visible}
 body[data-phone-layout="cameras"] #comparisonViews{display:contents}
 body[data-phone-layout="cameras"] .comparison-top,
 body[data-phone-layout="cameras"] .comparison-status{display:none}
 body[data-phone-layout="cameras"] .comparison-card{position:relative;border-radius:9px}
 body[data-phone-layout="cameras"] .comparison-card-header{position:absolute;z-index:3;bottom:18px;left:0;right:0;background:linear-gradient(transparent,#080f18e6);height:27px;min-height:27px;padding:5px;pointer-events:none}
 body[data-phone-layout="cameras"] .comparison-card-title{font-size:11px;line-height:17px;color:#fff}
 body[data-phone-layout="cameras"] .comparison-card-meta{position:absolute;bottom:0;left:0;right:0;height:19px;background:#080f18e6;color:#d1dae5;padding:0 5px 4px;font-size:9px;pointer-events:none}
 body[data-phone-layout="cameras"] .comparison-capture,
 body[data-phone-layout="cameras"] .comparison-aim-label{display:none}
 body[data-phone-layout="cameras"] .comparison-image-status{font-size:10px;padding:5px;bottom:42px}
 body[data-phone-layout="cameras"] .phone-selected-thumb{display:block;position:relative;padding:0;overflow:hidden;border:2px solid var(--main);border-radius:9px;min-width:0;background:var(--surface-deep)}
 #phoneInsetMap{position:absolute;inset:0;z-index:0;background:var(--surface-deep)}
 #phoneInsetMap .leaflet-tile-pane{filter:var(--tile-filter)}
 #openPhoneInset{position:absolute;inset:0;z-index:500;background:transparent;border:0;padding:0;border-radius:inherit}
 #openPhoneInset:focus-visible{outline-offset:-3px}
 .phone-inset-north{position:absolute;right:4px;top:3px;z-index:450;font-size:9px;color:#fff;text-shadow:0 1px 3px #000;pointer-events:none}
 .phone-inset-label{position:absolute;left:0;right:0;bottom:13px;z-index:450;font-size:9px;padding:4px;color:#edfff8;background:linear-gradient(transparent,#071710c9);pointer-events:none;text-align:left;white-space:nowrap}
 .phone-inset-credit{position:absolute;bottom:0;left:0;right:0;z-index:600;font-size:7px;padding:1px 3px;background:var(--surface);color:var(--subtle);text-align:right;line-height:11px}
 body[data-phone-layout="cameras"] #comparisonEmpty{position:static;grid-column:2/span 2;align-self:center;font-size:12px;padding:8px}
 body[data-phone-layout="cameras"].mode-explore .camera-stack{grid-template-rows:minmax(0,1fr)}
 /* Short bottom sheets keep the underlying map visible. */
 .phone-target-sheet{position:fixed;inset:auto 8px max(8px,env(safe-area-inset-bottom));width:auto;max-width:none;max-height:calc(100dvh - 60px);margin:0;padding:0;border-radius:18px;overflow:auto;box-shadow:0 16px 50px #0007}
 .phone-target-sheet::backdrop{background:#050c1670}
 .phone-sheet-heading{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid var(--border)}
 .phone-sheet-heading small{font-size:9px;letter-spacing:1.4px;color:var(--subtle)}
 .phone-sheet-heading h2{font-size:18px;margin-top:4px}
 .phone-sheet-heading button{min-width:44px;min-height:44px;font-size:24px;background:none;border:0}
 .phone-sheet-body{padding:14px 16px;display:grid;gap:16px}
 .phone-sheet-body p{font-size:13px;color:var(--subtle);line-height:1.5}
 #phoneTargetSheet .cell-picker{display:flex!important;flex-wrap:wrap;gap:8px}
 #phoneTargetSheet .cell-picker select{min-height:44px;width:100%;flex-basis:100%}
 #phoneTargetSheet .cell-picker button{min-height:44px;flex:1}
 .phone-target-actions{display:flex;gap:8px}.phone-target-actions button{flex:1;min-height:44px;font-size:12px}
 .phone-sheet-body .phone-sheet-note{font-size:11px;border-top:1px solid var(--border);padding-top:12px}
 .map-options[open]{border-radius:18px;inset:auto 8px max(8px,env(safe-area-inset-bottom))}
 .map-options-content{gap:10px;padding:12px 14px}
 .map-options-heading{min-height:50px;padding:6px 14px}
 .map-options .webcam-toggle{padding:8px 0;min-height:50px}.map-options input[type=checkbox]{width:20px;height:20px;flex-shrink:0}
 .map-options #goAkamaiLayerStatus{display:none}
 .phone-road-sheet:not(:empty){display:block;position:fixed;bottom:calc(90px + env(safe-area-inset-bottom));left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));z-index:1200}
 .phone-road-sheet .goakamai-map-popup{position:relative!important;transform:none!important;left:0!important;bottom:0!important;top:0!important;width:100%!important;margin:0}
 .phone-road-sheet .leaflet-popup-tip-container{display:none}
 .phone-road-sheet .leaflet-popup-content-wrapper{padding:0;border:1px solid var(--border);border-radius:16px;overflow:hidden;background:var(--surface);color:var(--ink);box-shadow:0 6px 30px #0008}
 .phone-road-sheet .leaflet-popup-content{margin:0!important;padding:12px!important;width:100%!important;max-height:none!important;overflow:visible}
 .phone-road-sheet .goakamai-preview h3{font-size:14px;margin:0 28px 8px 0;line-height:20px}
 .phone-road-sheet .goakamai-preview-stage{height:min(30dvh,240px)!important;background:#080e14;border-radius:8px;overflow:hidden}
 .phone-road-sheet .goakamai-preview-footer{padding-top:4px}
 .phone-road-sheet .leaflet-popup-close-button{position:absolute;z-index:2;right:3px;top:3px;width:44px;height:44px;line-height:40px;text-align:center;font-size:25px;color:var(--subtle);text-decoration:none}
 body:has(.phone-road-sheet:not(:empty)) .phone-map-status{display:none}
 body:has(.phone-road-sheet:not(:empty)) .map-top{display:none}
 body:has(.phone-road-sheet:not(:empty)) .camera-stack{visibility:hidden}
 body:has(.phone-road-sheet:not(:empty)) .leaflet-control-zoom,
 body:has(.phone-road-sheet:not(:empty)) .map-layer-controls{visibility:visible}
 .calibration-active .phone-map-status{display:none}
}
@media(max-width:380px){.brand-mark{display:none}.header-right{gap:3px}.phone-wordmark{font-size:21px}}
@media(max-width:760px) and (max-height:680px){
 body:not(.calibration-active){grid-template-rows:50px 46px minmax(0,1fr) auto 48px 28px}
 body[data-phone-layout="cameras"]:not(.calibration-active){grid-template-rows:50px 0 minmax(0,1fr) auto 48px 28px}
 .dashboard{grid-template-rows:minmax(0,1fr) 88px;gap:6px}
 body[data-phone-layout="cameras"] .camera-stack{grid-template-rows:minmax(0,1fr) 88px;gap:6px}
 .phone-view-bar button{min-height:38px}
 .phone-road-sheet:not(:empty){bottom:calc(82px + env(safe-area-inset-bottom))}
}
@media(min-width:600px) and (max-width:1024px) and (max-height:500px){
 body:not(.calibration-active){grid-template-rows:44px 0 minmax(0,1fr) auto 42px 22px}
 body[data-phone-layout="cameras"]:not(.calibration-active){grid-template-rows:44px 0 minmax(0,1fr) auto 42px 22px}
 .drive-controls{position:absolute;top:0;left:35%;right:140px;height:44px;padding:3px 8px;z-index:5}
 .mode-group{height:38px}.mode-group button{min-height:30px;height:30px}
 .dashboard{grid-template-columns:minmax(0,1fr) 128px;grid-template-rows:minmax(0,1fr)}
 body[data-phone-layout="cameras"] .dashboard{grid-template-columns:minmax(0,1fr)}
 body[data-phone-layout="cameras"] .camera-stack{grid-template-columns:minmax(0,1fr) 128px;grid-template-rows:minmax(0,1fr)}
 body[data-phone-layout="cameras"] #comparisonPanel{grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(3,minmax(0,1fr))}
 .phone-view-bar{max-width:350px;min-height:38px}.phone-view-bar button{min-height:32px;font-size:12px}
 .phone-view-bar svg{width:17px;height:17px}
 body>footer{flex-wrap:nowrap}body>footer .site-status{flex-basis:auto}
 body[data-phone-layout="cameras"] .camera-chrome{padding:0 4px}.camera-select select{min-height:30px!important}
 body[data-phone-layout="cameras"] #fullscreen{min-height:30px}
 body[data-phone-layout="cameras"] .overview{height:20px;min-height:20px;flex-basis:20px}
 .phone-road-sheet:not(:empty){left:auto;width:340px;bottom:calc(66px + env(safe-area-inset-bottom))}
 .phone-road-sheet .goakamai-preview-stage{height:125px!important}
 .phone-target-sheet{max-width:460px;left:50%;right:auto;width:calc(100% - 16px);transform:translateX(-50%)}
}

@media(max-width:760px),(max-width:1024px) and (max-height:500px){
 body[data-phone-layout="map"]:not(.calibration-active) .camera-panel,
 body[data-phone-layout="map"]:not(.calibration-active) .comparison-card,
 body[data-phone-layout="cameras"] .comparison-card,
 body[data-phone-layout="cameras"] .phone-selected-thumb{order:var(--phone-slot,1)}
}

@media(max-width:760px),(max-width:1024px) and (max-height:500px){
 body[data-phone-layout="cameras"].mode-explore .camera-stack{grid-template-rows:minmax(0,1fr) 104px}
 body[data-phone-layout="cameras"].mode-explore #comparisonPanel{display:grid!important}
}
@media(max-width:760px) and (max-height:680px){body[data-phone-layout="cameras"].mode-explore .camera-stack{grid-template-rows:minmax(0,1fr) 88px}}
@media(min-width:600px) and (max-width:1024px) and (max-height:500px){
 body[data-phone-layout="cameras"].mode-explore .camera-stack{grid-template-columns:minmax(0,1fr) 128px;grid-template-rows:minmax(0,1fr)}
 body[data-phone-layout="cameras"] #comparisonEmpty{grid-column:auto;grid-row:2/span 2}
}
