/* Scoped map controls; existing map canvas and legends remain native siblings. */
#map-modal .map-dialog:has(.free-nav-v75){max-height:94dvh;overflow:auto}
.free-nav-v75{margin:0 0 12px;padding:12px;border:1px solid #cedfc238;border-radius:6px;background:#0b201c;color:#f3f5e9;font-size:13px}
.free-nav-v75-quick-row{display:flex;align-items:flex-end;gap:10px;margin-bottom:10px}
.free-nav-v75-quick-label{display:flex;flex:1;min-width:0;flex-direction:column;gap:6px;font-weight:600}
.free-nav-v75-quick{width:100%;min-width:0;min-height:52px;padding:12px;border:1px solid #dfff83;border-radius:4px;background:#162f29;color:#f3f5e9;font:inherit;font-size:16px}
.free-nav-v75-tools{display:flex;align-items:center;gap:8px}
.free-nav-v75-search{min-width:0;flex:1;width:100%;min-height:44px;padding:10px 12px;border:1px solid #a7bfa46b;border-radius:4px;background:#162f29;color:#f3f5e9;font:inherit;font-size:16px}
.free-nav-v75-search::placeholder{color:#bbcbb9;opacity:1}
.free-nav-v75 .free-nav-v75-button{min-height:44px;padding:9px 12px;border:1px solid #a7bfa45c;border-radius:4px;background:#1e3930;color:#f3f5e9;font:inherit;line-height:1.35}
.free-nav-v75 .free-nav-v75-button[aria-pressed=true]{background:#dfff83;color:#142824;border-color:#dfff83}
.free-nav-v75 :is(button,input,select):focus-visible{outline:3px solid #dfff83;outline-offset:2px}
.free-nav-v75-results{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:10px;max-height:min(32dvh,280px);overflow-y:auto;overscroll-behavior:contain;padding:2px;scrollbar-gutter:stable}
.free-nav-v75-results[hidden],.free-nav-v75 [hidden]{display:none!important}
.free-nav-v75 .free-nav-v75-destination{min-height:56px;display:flex;flex-direction:column;gap:3px;align-items:flex-start;text-align:left;overflow-wrap:anywhere}
.free-nav-v75-name{font-weight:600}
.free-nav-v75-detail{color:#bdcdbd;font-size:12px}
.free-nav-v75-empty{grid-column:1/-1;margin:5px 0;color:#bdcdbd}
.free-nav-v75-bottom{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px}
.free-nav-v75-status{flex:1;min-width:0;margin:0;line-height:1.6;overflow-wrap:anywhere}
.free-nav-v75-actions{display:flex;flex-wrap:wrap;gap:6px}
.free-nav-v75 [data-action=return]{min-height:52px;flex-shrink:0;background:#dfff83;color:#142824;font-weight:600}
#map-modal .map-dialog:has(.free-nav-v75) #bigmap{display:block;width:100%;height:34dvh;max-height:34dvh;min-height:120px;object-fit:fill}
#map-modal .map-dialog:has(.free-nav-v75[data-results-open=true]) :is(#bigmap,#city-map-legend,#ferry-map-legend){display:none!important}
@media(max-width:600px){
 #map-modal:has(.free-nav-v75){padding:10px}
 #map-modal .map-dialog:has(.free-nav-v75){padding:12px;max-height:96dvh}
 .free-nav-v75{padding:8px;font-size:12px;margin-bottom:8px}
 .free-nav-v75-tools{flex-wrap:wrap;gap:6px}
 .free-nav-v75-search{flex-basis:100%}
 .free-nav-v75-quick-row{gap:6px}
 .free-nav-v75-quick-label{font-size:12px}
 .free-nav-v75 [data-action=return]{max-width:116px;padding:9px 10px}
 .free-nav-v75-results{grid-template-columns:1fr;max-height:min(30dvh,260px);margin-top:6px}
 .free-nav-v75-bottom{align-items:flex-start;flex-direction:column;gap:6px;margin-top:6px}
 .free-nav-v75-actions{width:100%}
 .free-nav-v75-actions .free-nav-v75-button{flex:1}
 #map-modal .map-dialog:has(.free-nav-v75) #bigmap{height:36dvh;max-height:36dvh;min-height:120px}
}
@media(max-height:520px){
 .free-nav-v75-results{max-height:28dvh}
 #map-modal .map-dialog:has(.free-nav-v75) #bigmap{height:40dvh;max-height:40dvh;min-height:100px}
}

@media(min-width:700px) and (max-height:700px) and (orientation:landscape){
 #map-modal .map-dialog:has(.free-nav-v75) #city-map-legend{display:none!important}
}

/* Short desktop landscapes share vertical space instead of stacking independent
   absolute panels. The route footer stays outside the scrollable description. */
@media(min-width:700px) and (max-width:1000px) and (max-height:650px) and (orientation:landscape){
 #hud{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;gap:12px;align-items:start;padding:74px 20px 34px}
 #hud .mission-card{position:relative;inset:auto;grid-row:1;width:300px;max-height:100%;min-height:0;padding:10px;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:44px auto minmax(0,1fr) auto 3px;grid-template-areas:"meta action" "title title" "description description" "route route" "progress progress";gap:6px 8px}
 #hud .delivery-hud-open{grid-area:action;float:none;align-self:start;min-height:44px;padding:8px;font-size:11px}
 #hud .mission-card>.eyebrow{grid-area:meta;align-self:center;min-width:0;gap:6px;font-size:10px;line-height:1.4;letter-spacing:.03em}
 #hud #mission-count{font-size:9px;line-height:1.4}
 #hud #mission-title{grid-area:title;min-width:0;margin:0;font-size:16px;line-height:1.35;overflow-wrap:anywhere}
 #hud #mission-description{grid-area:description;min-height:0;max-height:3em;margin:0;overflow-y:auto;overscroll-behavior:contain;pointer-events:auto;font-size:12px;line-height:1.5;scrollbar-width:thin}
 #hud .mission-bottom{grid-area:route;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:3px;margin:0}
 #hud #distance{max-width:100%;font-size:20px;line-height:1.25;overflow-wrap:anywhere}
 #hud #reward{font-size:10px;line-height:1.4}
 #hud .progress-track{grid-area:progress;margin:0}
 #hud .bottom-left{position:relative;inset:auto;grid-row:2;width:300px;min-width:0}
 #hud .map-shell{width:160px;height:110px}
 #hud .map-shell canvas{display:block;width:100%;height:100%}
 #hud .location{min-width:0;gap:8px;margin-top:8px;font-size:12px;line-height:1.4}
 #hud #street{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 #hud .key-guide{display:none}
}
