/* Functional map, inspection and hold-control primitives. The UI lives in gpt-ride-ui.css. */
.hidden,[hidden]{display:none!important}
#tileLayer{position:absolute;inset:0;overflow:hidden;pointer-events:none}
#tileLayer img{position:absolute;user-select:none;pointer-events:none}
#fallbackCanvas,#overlayCanvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
#fallbackCanvas{z-index:0}
#tileLayer{z-index:1}
#overlayCanvas{z-index:2}
#mapMarkers{position:absolute;inset:0;z-index:3;pointer-events:none}
.marker{position:absolute;transform:translate(-50%,-50%);border:3px solid #fff;box-shadow:0 2px 9px #172e3460;background:#244d37;color:white;min-width:25px;height:25px;border-radius:50%;font-weight:800;font-size:10px;display:grid;place-items:center;pointer-events:auto;touch-action:none;cursor:grab;padding:0 5px}
.marker.start{background:#d4fb69;color:#21372c;border-color:#fff}
.marker.end{background:#233e34}
.marker.dragging{transform:translate(-50%,-50%) scale(1.16)}
.marker.selected{outline:3px solid #f7ba55;outline-offset:3px}
.marker.dragging{cursor:grabbing}
.waypoint-editor{position:absolute;z-index:10;width:248px;background:#fffefa;border:1px solid #d5e4d3;padding:14px;border-radius:14px;box-shadow:0 15px 50px #203b3270;pointer-events:auto}
.point-editor-head{display:flex;justify-content:space-between;align-items:start;margin-bottom:12px}
.point-editor-head div{display:flex;flex-direction:column;gap:3px}
.point-editor-head small{font-size:9px;letter-spacing:1.2px;font-weight:850;color:#759476}
.point-editor-head strong{font-size:16px;font-weight:850;color:#2c4d37}
.point-input-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.point-input-grid label{font-size:9px;font-weight:850;color:#849685;letter-spacing:.7px}
.point-input-grid input{width:100%;border-radius:7px;border:1px solid #dbe6d7;background:#fff;color:#2f4637;font-size:12px;padding:9px 6px;margin-top:5px;min-width:0}
.point-editor-actions{display:flex;gap:7px;margin-top:11px}
.point-editor-actions button{border:0;border-radius:7px;padding:10px 8px;font-size:10px;font-weight:800;cursor:pointer}
.point-apply{background:#2c694a;color:#fff;flex:1}
.point-remove{background:#fdeee8;color:#aa543e}
.point-edit-small{display:flex;gap:7px;margin-top:8px}
.point-edit-small button{flex:1;background:#f1f5ed;border:1px solid #e3eadd;border-radius:7px;padding:7px;color:#57755a;font-size:10px;cursor:pointer}
.point-edit-small button:disabled{opacity:.35;cursor:default}
@media(max-width:700px){
.waypoint-editor{width:min(252px,calc(100% - 20px))}
}
#tileLayer{position:absolute;inset:0;overflow:hidden;z-index:1;pointer-events:auto}
#tileLayer .maplibregl-map,#tileLayer .maplibregl-canvas-container{width:100%;height:100%}
#tileLayer .maplibregl-control-container{display:none}
#fallbackCanvas{z-index:0;pointer-events:none}
#overlayCanvas{pointer-events:none;z-index:2}
#mapMarkers{z-index:4;pointer-events:none}
#mapMarkers button{pointer-events:auto}
#tileLayer .maplibregl-control-container{display:none}
#tileLayer .maplibregl-canvas{position:absolute;left:0;top:0;width:100%;height:100%}
#tileLayer .maplibregl-canvas-container{position:absolute;inset:0}
#tileLayer .maplibregl-map{position:relative;overflow:hidden}
#tileLayer .maplibregl-canvas:focus{outline:none}
.cycling-legend{z-index:4;position:absolute;left:20px;bottom:36px;max-width:calc(100% - 150px);display:flex;flex-wrap:wrap;gap:9px 13px;align-items:center;background:rgba(255,255,255,.94);border:1px solid #d0ddd4;box-shadow:0 3px 20px #153c3126;border-radius:12px;padding:10px 14px;color:#234c45;font-size:11px;font-weight:650;backdrop-filter:blur(9px)}
.cycling-legend[hidden]{display:none}
.cycling-legend>span{display:flex;align-items:center;white-space:nowrap;gap:5px}
.cycling-legend a{color:#176cb9;text-decoration:none;font-weight:750;white-space:nowrap}
.legend-mark{width:24px;height:0;display:inline-block;border-top:4px solid #1768dc;border-radius:3px}
@media(max-width:700px){
.cycling-legend{left:9px;bottom:24px;max-width:calc(100% - 20px);padding:6px 8px;border-radius:9px;gap:5px 8px;font-size:9px}
.legend-mark{width:15px}
.cycling-legend a{font-size:9px}
}
.cycling-legend[hidden]{display:none!important}
.cycling-legend{left:390px;bottom:34px;max-width:calc(100% - 470px);gap:7px 11px;font-size:10px;padding:10px 12px}
@media(min-width:701px) and (max-width:1100px){
.cycling-legend{left:340px;max-width:calc(100% - 365px)}
}
@media(max-width:700px){
.cycling-legend{left:10px;bottom:calc(182px + env(safe-area-inset-bottom));max-width:calc(100% - 20px);font-size:9px;padding:7px 9px;gap:6px 10px;border-radius:10px}
.cycling-legend .legend-title{width:100%}
.planner-expanded .cycling-legend{display:none}
.waypoint-editor{z-index:13}
}
.cycling-legend>span[data-detail]{white-space:normal;flex-basis:100%;line-height:1.4}
.stop-row .stop-row-action,.point-edit-small button,#pointEditorClose{background:var(--cream);color:var(--ink);border:1px solid var(--line)}
.cycling-legend>span,.cycling-legend>a{padding:3px 5px;background:var(--bg);border-radius:3px;font-weight:650;color:var(--ink)}
.cycling-legend[hidden]{display:none}
@media(max-width:700px){
.cycling-legend{grid-auto-flow:row;grid-template-columns:repeat(4,max-content);grid-template-rows:repeat(2,auto);overflow-x:auto;max-width:calc(100% - 20px);font-size:10px;gap:3px}
}
.cycling-legend:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.cycling-legend{left:388px;max-width:calc(100% - 460px)}
@media(max-width:700px){
.cycling-legend{left:10px;max-width:calc(100% - 20px)}
}
@media(max-width:700px){
.cycling-legend{grid-auto-flow:column;grid-template-columns:none;grid-template-rows:repeat(2,auto)}
}
.map-filters{position:absolute;z-index:30;right:20px;top:74px;width:292px;max-width:calc(100% - 20px);max-height:calc(100dvh - 170px);overflow:auto;margin:0;padding:10px;border:1px solid var(--line);border-radius:5px;background:var(--bg);color:var(--ink);box-shadow:0 4px 18px #0003}
.map-filters legend{padding:0 5px;font-size:13px;font-weight:700;background:var(--bg);color:var(--ink)}
.map-filters label{display:grid;grid-template-columns:20px 1fr;align-items:center;gap:3px 9px;min-height:44px;padding:6px;font-size:12px;cursor:pointer;color:var(--ink);border-radius:3px}
.map-filters label:hover,.map-filters label:focus-within{background:var(--cream)}
.map-filters input{width:18px;height:18px;margin:0;accent-color:var(--accent);grid-row:1 / span 2}
.map-filters small{grid-column:2;font-size:11px;color:var(--muted)}
.map-filters small:empty{display:none}
.map-filters label:has(input:disabled){cursor:default}
@media(max-width:700px){
.map-filters{top:calc(119px + env(safe-area-inset-top));right:10px;max-height:calc(100dvh - 210px);width:292px}
}
.legend-corner .cycling-legend>span:first-child{min-height:42px;padding-right:33px}
.legend-corner[data-mode=mellow] .cycling-legend>span:first-child{min-height:31px;padding-right:0}
.legend-corner .map-filters{position:static;top:auto;right:auto;width:100%;max-width:none;max-height:calc(100dvh - 170px);padding:4px 8px 8px;border:0;border-radius:0;box-shadow:none;background:transparent}
.legend-corner .map-filters legend{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.legend-corner .map-filters label{grid-template-columns:32px 1fr 20px;gap:3px 9px;min-height:46px;font-weight:500}
.legend-corner .map-filters label:first-of-type{padding-right:40px;min-height:46px}
.legend-corner .map-filters .feature-swatch{grid-column:1;grid-row:1 / span 2}
.legend-corner .map-filters input{grid-column:3;grid-row:1 / span 2}
.legend-corner .map-filters label>span{grid-column:2;grid-row:1}
.legend-corner .map-filters small{grid-column:2;grid-row:2}
@media(max-width:700px){
.legend-corner .cycling-legend,.legend-corner .map-filters{max-height:calc(100dvh - 320px)}
}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
[data-panel=plan] .stop-row.stop-drop-before:before,[data-panel=plan] .stop-row.stop-drop-after:before{content:"";position:absolute;left:33px;right:0;height:3px;background:var(--ink);z-index:3;pointer-events:none}
[data-panel=plan] .stop-row.stop-drop-before:before{top:-2px}
[data-panel=plan] .stop-row.stop-drop-after:before{bottom:-2px}
.route-elevation{padding-top:14px;border-top:1px solid var(--soft-line);margin:0}
.route-elevation-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.route-elevation-heading h2{margin:0;font-size:12px;line-height:1.4;font-weight:700;letter-spacing:0}
.route-elevation-values{display:flex;gap:12px;font-size:10px;color:var(--muted)}
.route-elevation-values b{font-weight:650;color:var(--ink)}
.route-elevation-status{font-size:11px;line-height:1.5;color:var(--muted);margin:10px 0 2px}
.route-elevation-status:not([hidden])+.route-elevation-chart:not([hidden]){margin-top:6px}
.route-elevation-chart{height:140px;position:relative;cursor:crosshair;touch-action:none;user-select:none;-webkit-user-select:none}
.route-elevation-chart svg{width:100%;height:100%;overflow:visible}
.route-elevation-chart svg text{font:9px Inter,ui-sans-serif,system-ui,sans-serif;fill:var(--muted)}
.route-elevation-grid{stroke:var(--soft-line);stroke-width:1;stroke-dasharray:2 4;fill:none}
.route-elevation-area{fill:var(--soft-line);fill-opacity:.6;stroke:none}
.route-elevation-line{fill:none;stroke:var(--ink);stroke-width:1.7;stroke-linejoin:round}
.route-elevation-line:is(circle){fill:var(--ink);stroke:none}
.route-elevation-cursor{stroke:var(--ink);stroke-width:1;stroke-dasharray:3 3}
.route-elevation-dot{fill:var(--ink);stroke:var(--bg);stroke-width:2}
.route-elevation-readout{position:absolute;top:0;transform:translateX(-50%);padding:4px 6px;background:var(--ink);color:var(--bg);border-radius:3px;font-size:10px;font-weight:650;white-space:nowrap;pointer-events:none;max-width:100%}
.route-elevation-axes{display:flex;justify-content:space-between;margin:0 0 0 28px;padding-right:8px;font-size:9px;color:var(--muted)}
@media(max-width:700px){
.route-elevation-chart{height:126px}
}
.hold-action{ position:relative; overflow:hidden; touch-action:none; user-select:none; }
.hold-action > span:not(.hold-action-progress){ position:relative; z-index:1; }
.hold-action-progress{ position:absolute; inset:0; transform:scaleX(0); transform-origin:left; background:var(--accent); opacity:.24; pointer-events:none; }
.hold-action.holding .hold-action-progress{ transform:scaleX(1); transition:transform 1.5s linear; }
.hold-help{ color:var(--muted); font-size:11px; line-height:1.5; margin:0 0 12px; }
