/* One route sheet with distinct setup, review, editing and detail screens. */
.route-panel{--route-gutter:20px;position:absolute;z-index:26;right:calc(var(--edge) + 60px);bottom:calc(64px + env(safe-area-inset-bottom));width:380px;max-height:calc(100dvh - 180px - env(safe-area-inset-top));padding:16px var(--route-gutter);display:flex;flex-direction:column;gap:12px;border-radius:24px;background:#f6f5ef;color:#28382e;overflow:clip;box-shadow:0 8px 36px #12251822}
.route-panel [hidden],.route-panel[hidden]{display:none!important}
.route-panel button{font:inherit;cursor:pointer;color:inherit}
.route-panel button:disabled{cursor:default;opacity:.48}
.route-panel button:focus-visible,.route-panel a:focus-visible,.route-panel summary:focus-visible{outline:2px solid #1769ed;outline-offset:3px}
.route-panel button svg{width:22px;height:22px;flex:none}
.route-heading{display:flex;align-items:center;gap:4px;min-height:44px}
.route-heading h2{font-size:20px;font-weight:600;letter-spacing:-.5px;margin:0;flex:1;min-width:0;line-height:1.2;overflow-wrap:anywhere}
.route-heading h2:focus{outline:none}
.route-panel[data-phase=preview]>.route-content>.route-preview-name{margin:0;line-height:1.3;font-size:17px;font-weight:550;overflow-wrap:anywhere}
.route-close,.route-back,.route-quick-undo{display:grid;place-items:center;width:44px;height:44px;flex:none;background:transparent;border-radius:50%;padding:0}
.route-back{margin:0}
.route-heading .route-clear{margin:0;flex:none;min-height:44px;padding:0 8px;font-size:13px;font-weight:500;background:none;color:#795747}
.route-panel .route-close{font-size:26px;background:radial-gradient(circle,#e8ece6 16px,transparent 17px)}
.route-quick-undo svg{width:20px;height:20px}.route-quick-redo svg{transform:scaleX(-1)}
.route-tray-toggle{display:grid;place-items:center;width:100%;min-height:24px;margin:0;padding:0;background:transparent;touch-action:none}.route-tray-toggle::before{content:"";width:36px;height:4px;background:#bcc4b8;border-radius:4px}
.route-activity{display:flex;gap:4px;background:#e8ece6;padding:4px;border-radius:16px;flex:none}
.route-activity button{min-width:0;display:flex;align-items:center;justify-content:center;gap:8px;flex:1;min-height:44px;border-radius:12px;background:transparent;font-size:15px;font-weight:550}
.route-activity button span{min-width:0;overflow-wrap:anywhere}
.route-activity button[aria-pressed=true]{background:#fff;box-shadow:0 1px 4px #1825180c}
.route-entry{display:grid;gap:4px;min-height:0;overflow:auto;overscroll-behavior:contain}
.route-primary,.route-secondary{display:flex;align-items:center;justify-content:center;min-height:52px;width:100%;padding:12px 18px;border-radius:16px;font-size:16px!important;font-weight:550!important;line-height:1.25}
.route-panel .route-primary{background:#28382e;color:#fff}
.route-panel .route-primary:disabled{opacity:1;background:#e1e5de;color:#627067}
.route-secondary{background:#e8ece6}
.route-entry>.route-primary{margin-bottom:8px}
.route-entry-link{display:flex;align-items:center;gap:12px;width:100%;min-height:52px;padding:12px 4px;background:transparent;text-align:left;font-size:16px;line-height:1.35}
.route-entry-link span{flex:1;min-width:0}
.route-entry-link+.route-entry-link{border-top:1px solid #dce0d6}
.route-entry-link svg:last-child{width:16px;height:16px;color:#718074}
.route-tray-grab,.route-heading{flex:none}.route-tray-grab{position:relative;padding-top:16px}.route-tray-toggle{position:absolute;top:-8px;left:calc(50% - 44px);width:88px;height:44px;min-height:44px}.route-heading{position:relative;pointer-events:none}.route-heading>button{pointer-events:auto}
.route-setup{min-height:0;overflow:auto;overscroll-behavior:contain}
.route-setup p{margin:14px 0 0;line-height:1.4}.route-candidate{font-size:14px;color:#627067}.route-candidate[data-selected=true]{font-size:16px;font-weight:550;color:#28382e}
.route-setup .route-setup-instruction{margin:0 0 12px;font-size:16px;color:#28382e}
.route-candidate:empty{margin:0}
.route-setup-context{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:44px;margin-top:12px;padding:12px 0 0;text-align:left;background:none;border-top:1px solid #dce1d7;font-size:14px;font-weight:400;overflow-wrap:anywhere}
.route-setup-context:not(:disabled)::after{content:"›";color:#718074;font-size:22px;font-weight:400}.route-panel .route-setup-context:disabled{opacity:1}
.route-setup-alternatives{display:flex;flex-wrap:wrap;align-items:center;gap:12px}
.route-setup-alternatives button{display:flex;align-items:center;justify-content:center;gap:8px;flex:1;background:#e8ece6;border-radius:14px;min-height:48px;font-size:15px;padding:8px 12px}.route-setup-alternatives svg{width:18px!important;height:18px!important}
.route-use-location{display:inline-flex;align-items:center;gap:6px;color:#1769ed!important}
.route-use-location svg{width:18px!important;height:18px!important}
.route-tray-peek{flex:0 1 auto;min-width:0;min-height:0;overflow:auto}
.route-preview-name{font-size:19px;line-height:1.2;letter-spacing:-.6px;font-weight:600;margin:0 0 6px;overflow-wrap:anywhere}
.route-preview-subtitle{font-size:12px;line-height:1.35;color:#637066;margin:0 0 8px}
.route-review-endpoints{margin:0;border:1px solid #dde2d9;border-radius:14px;background:#fff;overflow:hidden}
.route-review-endpoint{display:flex;align-items:center;gap:10px;width:100%;min-height:52px;padding:7px 10px;background:transparent;text-align:left}
.route-review-endpoint+.route-review-endpoint{border-top:1px solid #e8ece6}
.route-review-endpoint .route-endpoint-copy{flex:1}.route-review-endpoint .route-endpoint-copy strong{white-space:normal;overflow-wrap:anywhere;line-height:1.3}
.route-review-edit{flex:none;font-size:12px;color:#526459}
.route-review-stops{min-height:44px;width:100%;padding:7px 10px;background:#f0f3ed;text-align:left;font-size:13px}
.route-review-profile{margin-top:8px}.route-review-profile p{margin:0;font-size:12px;color:#637066;line-height:1.4}
.route-review-profile .route-profile,.route-review-profile .route-profile svg{height:52px}
.route-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;font-variant-numeric:tabular-nums}
.route-stats[data-metrics="1"]{grid-template-columns:1fr}
.route-stats strong{display:block;font-size:22px;line-height:1.2;letter-spacing:-.6px;font-weight:550;white-space:normal}
.route-stats span{display:block;font-size:12px;margin-top:4px;color:#637066}
.route-tray-note{font-size:12px;line-height:1.4;color:#5c695f;margin:12px 0 0;padding:8px 12px;background:#ecefe8;border-radius:10px;overflow-wrap:anywhere}
.route-tray-note[data-error=true]{color:#8b4e29}
.route-secondary-actions{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;flex:none;border-top:1px solid #dce1d7;padding-top:4px}
.route-secondary-actions button{flex:1;background:transparent;min-height:44px;padding:0 8px;font-size:14px}
.route-primary-bar{display:flex;align-items:center;gap:8px;flex:none}
.route-edit-toolbar{display:flex;align-items:center;flex-wrap:wrap;flex:none;gap:2px;min-width:0}
.route-edit-toolbar>button:last-child{min-height:44px;background:none;flex:1;min-width:0;padding:0 4px;font-size:14px;line-height:1.15}
.route-panel[data-phase=edit] .route-edit-toolbar{flex:1}
.route-panel[data-phase=edit] .route-primary-bar>.route-primary{width:auto;min-width:76px;min-height:48px;padding:10px 14px}
.route-options{min-height:44px;width:100%;padding:0 4px;text-align:left;background:none;color:#516254!important;font-size:14px!important}
.route-clear-receipt{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#e8ece6;border-radius:14px;padding:4px 12px;font-size:14px;flex:none}
.route-clear-receipt button{min-width:44px;min-height:44px;background:none;font-weight:600;color:#155abe}
.route-editor{min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
.route-editor>*{margin-top:0}.route-editor>:not([hidden])~:not([hidden]){margin-top:12px}
.route-endpoints{display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;gap:6px}
.route-endpoint-fields{background:#fff;border:1px solid #dde2d9;border-radius:16px;overflow:hidden;min-width:0}
.route-endpoint{display:flex;align-items:center;gap:10px;width:100%;min-height:54px;padding:8px 12px;background:white;text-align:left}
.route-endpoint+.route-endpoint{border-top:1px solid #e8ece6}.route-endpoint[aria-pressed=true]{box-shadow:inset 3px 0 #1769ed}
.route-endpoint-copy{min-width:0;display:block}.route-endpoint-caption{display:block;color:#627067;font-size:11px;margin-bottom:3px}.route-endpoint-copy strong{display:block;font-weight:550;font-size:14px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.route-endpoint-symbol{display:grid;place-items:center;width:24px;height:28px;flex:none;background:#28382e;color:white;border-radius:9px 9px 12px 12px;font-size:12px;font-weight:600}
.route-swap{width:44px;height:44px;display:grid;place-items:center;background:none}
.route-waypoints{margin:0}.route-panel summary{cursor:pointer;font-size:14px;min-height:44px;display:flex;align-items:center;color:#526459}
.route-waypoints ol{list-style:none;margin:0;padding:0}.route-waypoints li{display:flex;gap:6px;align-items:center;border-top:1px solid #dce1d7;min-height:48px}
.route-point-number{display:grid;place-items:center;flex:none;width:24px;height:24px;border-radius:50%;background:#e5edfb;color:#155abe;font-size:12px}
.route-waypoints li button{background:none;min-width:44px;min-height:44px;border-radius:8px;font-size:17px}
.route-waypoints li .route-point-name{flex:1;min-width:0;font-size:14px;text-align:left;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:0 3px}
.route-point-name[aria-pressed=true]{background:#e5edfb!important}
.route-point-tools{display:flex;flex-wrap:wrap;align-items:center;gap:4px;flex:none}
.route-selected-label{font-size:14px;font-weight:600;margin-right:auto}.route-point-tools button{background:#e8ece6;min-width:44px;min-height:44px;border-radius:12px;font-size:13px;padding:0 10px}.route-point-tools button[aria-pressed=true]{background:#dce8f9;color:#155abe}
.route-point-tools .route-delete-point{color:#884e38}.route-point-tools .route-cancel-point{font-size:23px;padding:0;background:transparent}
.route-segment{display:flex;gap:4px;padding:4px;background:#e8ece6;border-radius:12px}.route-segment button{flex:1;background:none;min-height:44px;border-radius:9px;font-size:14px}.route-segment button[aria-pressed=true]{background:white}
.route-note,.route-details p{font-size:13px;line-height:1.5;color:#627067}.route-details a{text-underline-offset:3px}
.route-manage,.route-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.route-manage button,.route-actions button{min-width:44px;min-height:44px;padding:0 12px;border-radius:10px;background:#e8ece6;font-size:14px}.route-actions>button{flex:1}
.route-panel[data-phase=details] .route-details>summary{display:none}
.route-panel[data-clear-review=true] .route-clear{visibility:hidden}
.route-panel[data-clear-review=true]>:not(.route-tray-grab):not(.route-clear-review){display:none!important}
.route-clear-review{flex:0 1 auto;min-height:0;overflow:auto;background:#f0ebe3;border:1px solid #e0d8cc;padding:14px;border-radius:16px}.route-clear-review h3{font-size:17px;margin:0 0 6px}.route-clear-review p{font-size:13px;line-height:1.45;margin:0}.route-clear-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px;justify-content:flex-end}.route-clear-actions button{min-height:44px;background:white;border-radius:12px;padding:0 12px;font-size:14px}.route-clear-confirm{background:#854e3b!important;color:white!important}
.route-coverage{min-height:44px;padding:0;background:none;font-size:13px;text-decoration:underline;text-underline-offset:3px}.route-regions{display:flex;gap:6px;flex-wrap:wrap}.route-coverage-note{margin:0 0 8px;font-size:13px;line-height:1.45;color:#627067}.route-regions button{min-height:44px;text-align:left;background:#e8ece6;border-radius:12px;padding:0 12px;font-size:13px}
.route-profile{height:70px}.route-profile svg{width:100%;height:70px;overflow:visible;stroke:#1769ed;stroke-width:1.7;fill:none}
.route-selection{display:flex;align-items:center;gap:8px;font-size:14px}.route-selection span{flex:1}.route-selection button{width:auto;font-size:14px!important}
.route-open .place-panel{display:none}.search-open .route-panel{visibility:hidden;pointer-events:none}.search-open .route-toggle,.search-open .sun-resume{visibility:hidden;pointer-events:none}
.sun-resume{left:var(--edge);top:calc(100px + env(safe-area-inset-top))}
@media(max-width:600px),(max-height:520px){
 .route-panel{position:fixed;left:0;right:0;top:auto;bottom:0;width:100%;max-width:none;max-height:calc(100dvh - 118px - env(safe-area-inset-top));padding:8px calc(var(--route-gutter) + env(safe-area-inset-right)) calc(36px + env(safe-area-inset-bottom)) calc(var(--route-gutter) + env(safe-area-inset-left));gap:12px;border-radius:28px 28px 0 0;box-shadow:0 -8px 34px #15291b20}
 .route-panel[data-phase=preview][data-tray=collapsed]{max-height:min(660px,70dvh)}
 .route-panel[data-phase=edit][data-starting=false][data-tray=collapsed]{max-height:min(max(48dvh,320px),calc(100dvh - 90px - env(safe-area-inset-top)))}
 .route-panel[data-tray=expanded],.route-panel[data-phase=preview][data-following=true]{max-height:calc(100dvh - 90px - env(safe-area-inset-top))}
 .route-tray-grab{flex:none;touch-action:none;user-select:none;cursor:ns-resize}
 .route-heading{min-height:44px}.route-heading h2{font-size:22px}
 .route-panel[data-phase=edit] .route-tray-peek{display:none}
 .route-panel[data-phase=edit] .route-editor{max-height:32dvh}
 .route-panel[data-phase=details] .route-editor,.route-panel[data-phase=options] .route-editor{max-height:45dvh}
 .route-tray-open .map-footer{position:fixed;z-index:28;color:#63745f;text-shadow:none;justify-content:flex-end;bottom:calc(4px + env(safe-area-inset-bottom))}
 .route-tray-open .community-links{display:none}
 .route-tray-open .map-footer a,.route-tray-open .cesium-credit-textContainer a{color:#63745f!important}
 .route-tray-open .cesium-credit-textContainer,.route-tray-open .cesium-credit-textContainer *{text-shadow:none!important}
 .route-tray-open .map-about-content{max-height:calc(100dvh - 150px);overflow:auto}
 .route-panel[data-dragging=true]{transition:none}.route-panel[data-dragging=true] .route-editor{pointer-events:none}
}
@media(max-height:520px){.route-panel[data-tray=expanded]{max-height:calc(100dvh - 12px)}.route-panel{left:auto;width:min(430px,100%);padding-left:var(--route-gutter);max-height:calc(100dvh - 12px);padding-bottom:calc(32px + env(safe-area-inset-bottom));border-radius:24px 0 0 0;gap:8px}.route-preview-name{font-size:17px}.route-preview-subtitle{margin-bottom:8px}.route-tray-note{margin-top:8px;font-size:12px}.route-stats strong{font-size:17px}.route-primary{min-height:46px}.route-entry-link{min-height:44px;padding-block:10px}.route-entry{gap:2px}.route-panel[data-phase=edit] .route-editor{max-height:24dvh}}
.route-message{font-size:13px;line-height:1.4;color:#5c695f;margin:0;flex:none}.route-message[data-error=true]{color:#8b4e29}

/* Building is a small map dock. The full route is reviewed only on request. */
.route-panel[data-phase=edit]{gap:10px}
.route-panel[data-phase=edit] .route-heading h2{font-size:20px}
.route-build-stats{font-size:14px;font-variant-numeric:tabular-nums;line-height:1.4;margin:0;font-weight:550}
.route-panel .route-edit-toolbar{flex:1}
.route-edit-toolbar .route-build-search{display:grid;place-items:center;min-width:44px;width:44px;height:44px;padding:0!important;border-radius:50%;background:none;flex:none!important}
.route-edit-toolbar .route-use-location{min-height:44px;padding:0 8px;white-space:nowrap;font-size:14px;background:none}
.route-panel .route-library-link{min-height:44px;background:none;padding:0;font-size:14px}
.route-panel[data-phase=edit] .route-editor,.route-panel[data-phase=preview] .route-editor{max-height:38dvh}

.route-panel #route-add-stop{min-width:44px;min-height:44px;padding:0 12px;background:#e8ece6;border-radius:10px;font-size:14px}

/* One quiet estimate opens a separate pace view; it never expands the builder form. */
.route-panel .route-time{align-self:stretch;min-height:44px;padding:10px 12px;margin:0;background:#e8ece6;border-radius:12px;font-size:13px;font-weight:500;color:#40574a;text-align:left;font-variant-numeric:tabular-nums;line-height:1.4}
.route-panel .route-time:active{background:#e8ece6}.route-panel .route-time:disabled{opacity:1;color:#627067}
.route-pace p{margin:0;font-size:15px;line-height:1.5}.route-pace{display:grid;gap:20px;padding:0 0 4px}
.route-pace-fields{display:grid;gap:16px}.route-pace-fields label{display:grid;gap:8px;font-size:14px;font-weight:550}
.route-pace input{box-sizing:border-box;width:100%;min-height:48px;border:1px solid #bcc4b8;background:#fff;border-radius:12px;padding:10px 12px;font:inherit;font-size:17px;color:#28382e}
.route-pace .route-pace-help{font-size:13px;color:#5c695f}.route-pace .route-pace-status:empty{display:none}.route-pace .route-pace-status{color:#8b4e29}
.route-panel .route-pace-reset{min-height:44px;padding:8px 0;background:none;text-align:left;font-size:14px;text-decoration:underline;text-underline-offset:3px}
.route-panel[data-phase=pace] .route-editor{max-height:48dvh}
.route-walking-policy{padding:14px 0;border-top:1px solid #d9ded5;border-bottom:1px solid #d9ded5}
.route-walking-policy>.route-attention-switch{margin:0;padding:10px 0}
.route-walking-policy p{margin:4px 0 14px;font-size:13px;line-height:1.5;color:#627067}
.route-walking-policy p:last-child{margin-bottom:0}
.route-walking-policy a{color:inherit;text-decoration:underline;text-underline-offset:3px}
.route-walking-policy a:focus-visible{outline:2px solid #1769ed;outline-offset:3px}
.route-panel .route-walking-warning{align-self:flex-start;text-align:left;min-height:44px;padding:10px 12px;margin:0;border-radius:10px;background:#f1e9dc;color:#765023;font-size:13px;line-height:1.4}
.route-details .route-walking-details{padding:12px;background:#f1e9dc;color:#765023;border-radius:12px}
.route-ski-policy{padding:14px 0;border-top:1px solid #d9ded5;border-bottom:1px solid #d9ded5}
.route-ski-policy label{display:flex;align-items:center;gap:12px;min-height:44px;font-size:15px;font-weight:550;line-height:1.4}
.route-ski-policy input{flex:none;width:22px;height:22px;accent-color:#344e3e}
.route-ski-policy p{margin:8px 0 0;font-size:13px;line-height:1.5;color:#627067}
.route-panel .route-ski-warning{align-self:flex-start;text-align:left;min-height:44px;padding:10px 12px;margin:0;border-radius:10px;background:#f1e9dc;color:#765023;font-size:13px;line-height:1.4}
.route-details .route-ski-warning-details{padding:12px;background:#f1e9dc;color:#765023;border-radius:12px}
@media(max-width:360px){.route-activity button{gap:4px;font-size:14px}.route-activity button svg{width:20px}}

.route-follow-directions{display:flex;flex:1 1 100%;flex-wrap:wrap;gap:4px;padding:3px;border-radius:13px;background:#f0f3f5}.route-follow-directions[hidden]{display:none}.route-follow-directions button{flex:1 1 8.25em;min-width:44px;min-height:44px;padding:8px;line-height:1.2;overflow-wrap:anywhere;border-radius:10px;background:transparent}.route-follow-directions button[aria-pressed=true]{background:#fff;color:#175fc2;box-shadow:0 1px 5px #172b4220;font-weight:650}

/* Following adds direction choices; its actions scroll while Save stays pinned. */
.route-panel[data-following=true] .route-secondary-actions{flex:0 1 auto;min-height:44px;max-height:32dvh;overflow:auto;overscroll-behavior:contain}
.route-panel[data-following=true] .route-heading{flex-wrap:wrap}
.route-panel[data-following=true] .route-heading h2{flex:1 1 8em}

/* Setup cannot expand; keep its instruction and choices ahead of a disabled handle. */
.route-panel[data-phase=setup] .route-tray-toggle{display:none}
/* Reserve a usable map strip while keeping enlarged setup text visible in landscape. */
@media(max-height:520px) and (min-aspect-ratio:1/1){
 .route-panel[data-phase=setup]{width:min(430px,calc(100% - 100px - env(safe-area-inset-left)));gap:4px;padding-top:6px}
 .route-panel[data-phase=setup] .route-heading h2{font-size:20px}
 .route-panel[data-phase=setup] .route-setup-instruction{margin-bottom:8px;line-height:1.25}
}

/* Scroll the route content as one region; keep the main action outside it. */
.route-content{display:flex;flex-direction:column;gap:12px;flex:0 1 auto;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scroll-padding-block:4px;overflow-anchor:none}
.route-content>*{flex-shrink:0;min-width:0;max-width:100%}
.route-content>.route-tray-peek{flex:none;overflow:visible}
.route-panel[data-phase=edit] .route-content{gap:10px}
.route-panel #route-add-stop{max-width:100%;white-space:normal;overflow-wrap:anywhere;padding:6px 8px}
@media(max-width:360px),(max-height:520px){
 .route-panel,.route-content{gap:8px}
 .route-heading h2{font-size:20px}
 .route-activity button{flex-direction:column;gap:4px;padding:6px 3px}
}

.route-clear-review{display:flex;flex-direction:column;overflow:hidden}
.route-clear-review h3,.route-clear-actions{flex:none}
.route-clear-review p{min-height:0;overflow:auto;overscroll-behavior:contain}

.route-panel[data-phase] .route-content>.route-editor{max-height:none;overflow:visible;overscroll-behavior:auto}

/* Activity first, with direct map input still available from the opening dock. */
.route-introduction{margin:0;color:#627067;font-size:14px;line-height:1.45;max-width:38ch}
.route-activity{gap:6px;background:#e8ece6;padding:4px;border-radius:16px}
.route-activity button{position:relative;flex-direction:row;gap:8px;min-height:48px;padding:10px 8px;border:1px solid transparent;border-radius:12px;background:transparent;line-height:1.25}
.route-activity button svg{width:22px;height:22px}
.route-activity button[aria-pressed=true]{background:#fff;border-color:#cbd5c7;box-shadow:0 1px 3px #1825180c;color:#283e2d}
.route-introduction-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.route-introduction-actions button{min-height:44px;background:none;text-align:left;font-size:13px;padding:8px 0}
.route-introduction-actions .route-start-search{grid-column:1/-1;background:#fff;border:1px solid #d6ded2;border-radius:14px;min-height:52px;padding:12px 15px;font-size:16px}
.route-start-search{display:flex;align-items:center;gap:10px}.route-start-search svg{fill:none;stroke:currentColor;stroke-width:1.6}
.route-panel[data-starting=true] .route-heading h2{font-size:24px;letter-spacing:-.6px}
.route-panel[data-starting=true] .route-method .route-note{margin:7px 0 0;font-size:12px}
.route-build-context{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.route-build-context .route-build-stats{flex:1;text-align:right;font-size:13px}.route-build-context .route-options{flex:none;min-width:44px;width:auto;margin:0;border:1px solid #d6ded2;background:#fff;border-radius:12px;padding:8px 12px;font-weight:550}
.route-method>.route-note{margin:8px 0 0}
/* The graph owns pointer gestures; the range retains keyboard and AT semantics. */
.route-profile,.route-review-profile .route-profile{height:auto;margin-top:8px;min-width:0}
.route-profile-plot{display:grid;grid-template-columns:48px minmax(0,1fr);gap:8px;height:72px}
.route-profile-axis{height:72px}
.route-profile-graph{position:relative;min-width:0;height:72px;cursor:ew-resize;touch-action:none}
.route-profile svg,.route-review-profile .route-profile svg{display:block;width:100%;height:72px;overflow:visible;fill:none;stroke:none}
.route-profile svg .route-profile-guide{stroke:#597565;stroke-width:1;stroke-dasharray:3 3;vector-effect:non-scaling-stroke}
.route-profile svg .route-profile-dot{fill:#83f34b;stroke:#183e24;stroke-width:1.5;vector-effect:non-scaling-stroke}
.route-profile-range{position:absolute;inset:0;box-sizing:border-box;width:100%;height:100%;margin:0;padding:0;border:0;appearance:none;-webkit-appearance:none;pointer-events:none;background:transparent}
.route-profile-range::-webkit-slider-runnable-track{height:100%;border:0;background:transparent}
.route-profile-range::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:1px;height:1px;border:0;background:transparent}
.route-profile-range::-moz-range-track,.route-profile-range::-moz-range-progress{height:100%;border:0;background:transparent}
.route-profile-range::-moz-range-thumb{width:1px;height:1px;border:0;background:transparent}
.route-profile-distance{display:flex;justify-content:space-between;margin-left:56px}
.route-profile .route-profile-readout{min-height:32px;margin:7px 0 0;font-size:12px;line-height:1.35;color:#40574a;font-variant-numeric:tabular-nums}
@media(max-height:520px){.route-panel[data-starting=true] .route-heading h2{font-size:22px}.route-panel[data-phase=preview][data-tray=collapsed],.route-panel[data-phase=edit][data-starting=false][data-tray=collapsed]{max-height:calc(100dvh - 12px)}}

.route-panel[data-phase=preview],.route-panel[data-phase=preview] .route-content{gap:8px}

/* A portrait keyboard can cross the short-height breakpoint without becoming landscape. */
@media(max-height:520px) and (max-aspect-ratio:1/1){.route-panel{left:0;right:0;width:100%;border-radius:28px 28px 0 0}}

/* Editable default origin and destination, with location identity kept visible. */
.route-introduction-actions .route-start-search{gap:12px;padding:10px 14px;min-height:60px;text-align:left}
.route-opening-copy{display:grid;gap:3px;flex:1;min-width:0}.route-opening-copy strong{font-size:15px;line-height:1.3;font-weight:500;overflow-wrap:anywhere}
.route-opening-symbol{width:13px;height:13px;flex:none;border:2px solid #758276;border-radius:50%;box-sizing:border-box}
.route-start-search[data-location=true] .route-opening-symbol{border:2px solid #fff;background:#1769ed;box-shadow:0 0 0 1px #1769ed}
#route-start-destination .route-opening-symbol{border-radius:3px;border-color:#344e3e}
#route-start-destination{border-color:#b7c6b6}
.route-panel[data-starting=true] .route-introduction{font-size:12px;line-height:1.4}

/* Keep the review on the map as an accessible, reopenable tray. */
@media(max-width:600px),(max-height:520px){
 .route-panel[data-phase=preview][data-tray=minimized]{gap:0;padding-top:8px;padding-bottom:calc(28px + env(safe-area-inset-bottom));max-height:none}
 .route-panel[data-phase=preview][data-tray=minimized] .route-heading h2{font-size:18px}
 .route-panel[data-phase=preview][data-tray=minimized] .route-tray-toggle{width:100%;left:0;top:0;height:100%;z-index:1;align-items:start;padding-top:3px}
 .route-panel[data-phase=preview][data-tray=minimized] .route-close{position:relative;z-index:2}
 .route-panel[data-phase=edit][data-starting=false][data-tray=collapsed]{max-height:min(max(55dvh,380px),calc(100dvh - 90px - env(safe-area-inset-top)))}
}
@media(max-height:520px){.route-panel[data-phase=edit][data-starting=false][data-tray=collapsed]{max-height:calc(100dvh - 12px)}}

/* One endpoint group, a quiet method row, and secondary information at the foot. */
.route-opening-fields{grid-column:1/-1;overflow:hidden;border:1px solid #cdd7c9;border-radius:16px;background:#fff}
.route-introduction-actions .route-opening-fields .route-start-search{width:100%;border:0;border-radius:0;background:transparent;min-height:58px;padding:10px 14px}
.route-opening-fields .route-start-search+.route-start-search{border-top:1px solid #e1e6dc!important}
.route-opening-fields .route-start-search:focus-visible{outline-offset:-3px}
.route-opening-copy strong{font-size:15px;font-weight:550;line-height:1.35}
.route-build-context{gap:8px;margin:0;min-height:0}
.route-build-context .route-options{min-height:44px;padding:8px 0;border:0;border-radius:0;background:none;font-size:13px;font-weight:500;text-align:left;color:#4e6356}
.route-build-context .route-build-stats{margin:0;text-align:left;font-size:12px;font-weight:500;line-height:1.4;color:#4e6356}
.route-build-context .route-options:not([hidden])+.route-build-stats{text-align:right}
.route-content>.route-coverage-section{margin-top:4px;border-top:1px solid #dce1d7;display:flex;flex-direction:column;align-items:stretch}
.route-content>.route-coverage-section>.route-coverage{align-self:flex-end;min-height:44px;padding:8px 0;font-size:12px;font-weight:400;color:#627067;text-decoration:none}
.route-content>.route-coverage-section>.route-coverage::after{content:" ⓘ"}
.route-content>.route-coverage-section>a.route-coverage{display:inline-flex;align-items:center;gap:4px}
.route-content>.route-coverage-section>a.route-coverage::after{content:"↗"}
.route-tray-note[data-caution=false]{background:none;padding:0;margin-top:8px;font-size:12px;line-height:1.4}
.route-profile .route-profile-readout{min-height:20px;margin-top:6px;font-size:12px}
@media(max-width:600px),(max-height:520px){.route-panel[data-phase=edit][data-starting=false][data-tray=collapsed]{max-height:min(max(50dvh,360px),calc(100dvh - 90px - env(safe-area-inset-top)))}}
@media(max-height:520px){.route-panel[data-phase=edit][data-starting=false][data-tray=collapsed]{max-height:calc(100dvh - 12px)}}

.route-panel[data-phase=edit] .route-editor:not(:has(> :not([hidden]))),.route-panel[data-phase=preview] .route-editor:not(:has(> :not([hidden]))){display:none}

/* The routing method is a direct on/off choice; detailed policy lives in Options. */
.route-panel .route-method-switch{display:flex;align-items:center;justify-content:space-between;gap:12px;position:relative;box-sizing:border-box;width:100%;min-width:0;min-height:44px;padding:8px 0;border:0;border-radius:8px;background:none;color:#40574a;font-size:14px;font-weight:500;line-height:1.4;text-align:left;cursor:pointer}
.route-switch-label{min-width:0;overflow-wrap:anywhere}
.route-switch-track{display:block;position:relative;flex:none;width:36px;height:22px;border-radius:14px;background:#809086;box-shadow:inset 0 0 0 1px #0000000a;transition:background .15s}
.route-switch-track::after{content:"";position:absolute;left:3px;top:3px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #00000020;transition:transform .15s}
.route-method-switch[aria-checked=true] .route-switch-track,.route-attention-switch input:checked~.route-switch-track{background:#365d45}
.route-method-switch[aria-checked=true] .route-switch-track::after,.route-attention-switch input:checked~.route-switch-track::after{transform:translateX(14px)}
.route-build-context>.route-method-switch{flex:1;font-size:13px}
.route-build-context>.route-options{flex:none;width:44px;height:44px;min-width:44px;padding:11px;border:0;border-radius:10px;background:none;text-align:center}
.route-build-context>.route-options svg{display:block;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round}
.route-build-context>.route-build-stats{flex-basis:100%;text-align:left!important}
.route-ski-policy>.route-attention-switch{margin:0;padding:10px 0}
.route-attention-switch input{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.route-attention-switch:has(input:focus-visible){outline:2px solid #1769ed;outline-offset:2px}
@media(prefers-reduced-motion:reduce){.route-switch-track,.route-switch-track::after{transition:none}}

/* Task layout: compact Draw, editable Directions/summary, one scrolling body. */
.route-panel{--route-gutter:18px;width:400px;gap:10px;background:#f8f9f5;border:1px solid #dbe2d780;box-shadow:0 12px 48px #17291f25}
.route-heading h2,.route-panel[data-starting=true] .route-heading h2{font-size:19px;letter-spacing:-.35px}
.route-heading>.route-options{display:grid;place-items:center;flex:none;width:44px;min-width:44px;height:44px;padding:10px;margin:0;background:none;border:0;border-radius:50%}
.route-heading>.route-options svg{fill:none;stroke:currentColor;stroke-width:1.6}
.route-panel[data-phase=setup] .route-tray-toggle{display:grid}
.route-content{gap:10px}
.route-introduction-actions{display:flex;flex-direction:column;gap:4px}
.route-opening-fields{position:relative;padding-right:44px;background:white;border-color:#d9e1d5;border-radius:14px}
.route-introduction-actions .route-opening-fields .route-start-search{min-height:48px;padding:7px 12px;gap:10px}
.route-opening-copy{gap:1px}.route-opening-copy .route-endpoint-caption{font-size:10px;line-height:1.2}
.route-opening-copy strong{font-size:14px;line-height:1.3}
.route-opening-fields>.route-swap{position:absolute;top:calc(50% - 22px);right:0;width:44px;height:44px;min-height:44px;padding:10px;border:0;background:none}
.route-opening-fields>.route-swap svg{fill:none;stroke:currentColor;stroke-width:1.5}
.route-activity{padding:3px;border-radius:12px;gap:3px}
.route-activity button{min-height:42px;padding:8px 6px;font-size:14px;border-radius:9px}
.route-activity button svg{width:20px;height:20px}
.route-build-context{gap:8px;align-items:center;flex-wrap:wrap}
.route-build-context>.route-method-switch{flex:1;max-width:250px;gap:14px}
.route-panel .route-waypoint-toggle{min-height:44px;padding:8px 10px;background:transparent;border:0;border-radius:10px;font-size:13px;font-weight:550;text-decoration:none}
.route-build-stats{margin:0!important;font-size:13px!important}
.route-panel[data-phase=preview] .route-build-stats{display:none}
.route-panel[data-phase=edit] .route-introduction{display:none}
.route-panel[data-phase=edit] .route-message{font-size:13px;line-height:1.4}
.route-panel .route-quick-undo{width:auto;min-width:60px;border:0;border-radius:10px;font-size:14px;padding:8px}
.route-panel .route-quick-redo{min-width:44px;width:44px;padding:10px}
.route-primary-bar{gap:8px;align-items:center;border-top:1px solid #dce3d8;padding-top:8px}
.route-primary-bar>.route-primary{width:auto;min-width:90px;flex:1;min-height:48px;border-radius:24px;padding:10px 16px}
.route-edit-toolbar{flex:0 1 auto!important;flex-wrap:nowrap;gap:0}
.route-panel .route-resume-draw{flex:1;min-height:48px;min-width:0;padding:10px;border:0;border-radius:12px;background:#2d4936;color:white;font-size:14px;font-weight:550;line-height:1.25}
.route-panel[data-paused=true][data-phase=edit] .route-primary{flex:0 1 auto;min-width:60px;padding:10px;background:#e8ede4;color:#28382e}
.route-panel[data-phase=edit] #route-build-location{display:none}
.route-secondary-actions{border:0;padding:0;gap:8px}.route-secondary-actions button{min-height:48px;border-radius:24px;background:#e9eee5;font-weight:500}
.route-stats strong{font-size:21px}.route-stats span{font-size:11px}
.route-preview-subtitle{margin-bottom:7px}
.route-more{display:flex;flex-direction:column;gap:6px}
.route-more>button,.route-more .route-manage>button{width:100%;min-height:48px;background:#e9eee5;border:0;border-radius:12px;padding:12px;text-align:left;font-size:14px}
.route-more>.route-clear{color:#8a4438;background:#f6ebe6}
.route-waypoints ol{margin:0;padding:0;list-style:none}
.route-waypoints li{display:flex;align-items:center;gap:4px;min-height:48px;border-bottom:1px solid #e0e6db}
.route-waypoints li>button{min-width:44px;min-height:44px;border:0;background:none;padding:6px;font-size:14px}
.route-waypoints li>.route-point-name{flex:1;text-align:left;min-width:0;overflow-wrap:anywhere}
.route-waypoints .route-point-number{flex:none;font-size:12px;color:#5c705e}
.route-waypoints>#route-add-stop{width:100%;margin-top:8px;min-height:44px}
.route-panel[data-tray=minimized] .route-heading h2{font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:600px),(max-height:520px){
 .route-panel{width:100%;padding-top:6px;padding-bottom:calc(30px + env(safe-area-inset-bottom));gap:8px;border-radius:24px 24px 0 0;border-bottom:0}
 .route-panel[data-phase=preview][data-tray=collapsed]{max-height:min(680px,76dvh)}
 .route-panel[data-phase=edit][data-tray=collapsed]{max-height:min(400px,52dvh)}
 .route-panel[data-phase=edit][data-tray=expanded],.route-panel[data-tray=expanded]{max-height:calc(100dvh - 80px - env(safe-area-inset-top))}
 .route-panel[data-tray=minimized]{gap:0;padding-top:6px;padding-bottom:calc(26px + env(safe-area-inset-bottom));max-height:none}
 .route-panel[data-tray=minimized] .route-options,.route-panel[data-tray=minimized] .route-back{display:none}
 .route-panel[data-tray=minimized] .route-tray-toggle{width:100%;left:0;top:0;height:100%;z-index:1;align-items:start;padding-top:3px}
 .route-panel[data-tray=minimized] .route-close{position:relative;z-index:2}
}
@media(max-height:520px) and (min-aspect-ratio:1/1){
 .route-panel{left:auto;width:min(420px,calc(100% - 90px));border-radius:20px 0 0 0}
 .route-panel[data-phase=preview][data-tray=collapsed],.route-panel[data-phase=edit][data-tray=collapsed],.route-panel[data-tray=expanded]{max-height:calc(100dvh - 16px)}
}

.route-preferences{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);align-items:center;gap:12px}
.route-preferences .route-activity{gap:1px;padding:2px}.route-preferences .route-activity button{gap:3px;padding:6px 3px;font-size:12px;min-height:44px}.route-preferences .route-activity svg{width:16px;height:18px}
.route-preferences .route-build-context{width:100%}.route-preferences .route-method-switch{gap:8px;line-height:1.3;font-size:12px}
.route-heading>.route-waypoint-toggle{flex:none;min-width:44px;max-width:72px;padding:8px 5px;text-decoration:none;font-size:12px;line-height:1.2}
.route-primary-bar>.route-secondary-actions{flex:2;min-width:0;gap:6px;align-self:stretch}.route-primary-bar>.route-secondary-actions button{min-width:0;padding:6px;font-size:14px;line-height:1.2}
.route-primary-bar>.route-secondary-actions:has(#route-follow[hidden]){flex:1}
.route-primary-bar button{white-space:normal;overflow-wrap:anywhere}
.route-panel[data-phase=preview] .route-primary-bar>.route-primary{flex:1;min-width:0;padding:10px 8px;font-size:14px!important}
@media(max-width:600px),(max-height:520px){.route-panel[data-phase=preview][data-tray=collapsed]{max-height:min(610px,70dvh)}}
@media(max-width:350px){.route-preferences{gap:8px}.route-preferences .route-activity button{flex-direction:column;gap:1px}.route-heading h2{font-size:17px}}

@media(max-height:520px) and (min-aspect-ratio:1/1){.route-panel{right:calc(var(--edge) + 60px);width:min(420px,calc(100% - 100px));border-radius:20px}.route-panel[data-phase=preview][data-tray=collapsed]{max-height:calc(100dvh - 16px)}}
/* The landscape rail wraps horizontally; keep it outside the right-hand sheet. */
@media(max-height:520px) and (min-aspect-ratio:1/1){body.route-tray-open .map-tools{left:var(--edge);right:auto}}


/* Fixed draft management remains reachable while route content scrolls. */
.route-draft-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;flex:none}
.route-draft-bar>.route-build-stats,.route-draft-bar>.route-preview-subtitle{flex:1;min-width:0;margin:0}
.route-draft-bar>.route-clear{flex:0 1 auto;min-width:44px;min-height:44px;max-width:55%;padding:8px 4px;background:transparent;border:0;border-radius:12px;color:#795747;font-size:13px;font-weight:500;line-height:1.3;text-align:right;overflow-wrap:anywhere}
.route-panel .route-time{display:flex;align-items:center;gap:10px;min-height:66px;padding:11px 12px;background:#fff;border:1px solid #dce3d7;border-radius:14px;color:#28382e}
.route-time-icon{display:grid;place-items:center;flex:none;color:#61745f}.route-time-icon svg{fill:none;stroke:currentColor;stroke-width:1.5}
.route-time-copy{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.route-time-caption{font-size:11px;line-height:1.35;color:#61745f;font-weight:400}
.route-time-value{font-size:19px;line-height:1.25;letter-spacing:-.3px;font-weight:600}
.route-time-pace{display:flex;align-items:center;gap:6px;flex:none;max-width:43%;padding:7px 8px;border-radius:8px;background:#edf1e9;font-size:11px;line-height:1.3;font-weight:500}
.route-time-pace::after{content:"";width:5px;height:5px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg) translateY(-2px);flex:none}
.route-time[data-ready=false]{min-height:44px;background:#edf1e9;border-color:transparent}.route-time[data-ready=false] .route-time-value{font-size:13px;letter-spacing:0;font-weight:400}
.route-pace-fields{padding:16px;border:1px solid #dce3d7;border-radius:16px;background:#fff;gap:18px}
.route-pace-fields input{background:#f4f6f0;border-color:#dce3d7;font-variant-numeric:tabular-nums}
.route-pace .route-pace-intro{font-size:15px;color:#4f6154}
.route-pace-calculation{border-top:1px solid #dce3d7;padding-top:4px}.route-pace-calculation summary{display:list-item;min-height:44px;padding:12px 0;font-size:13px;cursor:pointer;list-style-position:inside;color:#526459}
.route-pace-calculation p{font-size:13px;line-height:1.5;color:#5c695f}.route-pace-calculation p+p{margin-top:12px}
@media(max-width:350px){.route-panel .route-time{gap:7px;padding:10px}.route-time-icon{display:none}.route-time-value{font-size:18px}}

@media(max-width:600px) and (min-height:760px){.route-panel[data-phase=preview][data-tray=collapsed]{max-height:min(680px,78dvh)}}

/* Walking options belong to this draft; route warnings reflect traversed paths. */
.route-walking-policy{padding:12px 0;border-top:1px solid #d9ded5;border-bottom:1px solid #d9ded5}
.route-walking-policy p{margin:4px 0 14px;color:#627067;font-size:13px;line-height:1.5}
.route-walking-policy p:last-child{margin-bottom:0}
.route-panel .route-walking-notice{min-height:44px;width:100%;padding:11px 12px;text-align:left;border-radius:10px;background:#f1e9dc;color:#765023;font-size:13px;line-height:1.5}
.route-details .route-walking-details{padding:12px;background:#f1e9dc;color:#765023;border-radius:12px}
.route-walking-policy .route-walking-reset{min-height:44px;padding:10px 12px}
.route-walking-policy .route-method-switch:has(input:disabled){opacity:.6;cursor:default}

/* Pace guidance stays inside the editor, below the user's manual controls. */
.route-pace-equivalent{color:#607063;font-size:13px;font-weight:400;line-height:1.4}
.route-pace .route-pace-preview{padding:12px 14px;border-radius:12px;background:#eaf0e5;color:#304b36;font-weight:550;font-variant-numeric:tabular-nums}
.route-pace-garmin{display:grid;gap:10px;border:1px solid #dce3d7;border-radius:16px;padding:16px;background:#f6f8f2;min-width:0}
.route-pace-garmin h3{margin:0;font-size:16px}.route-pace-garmin p{font-size:14px;color:#4f6154}.route-pace-garmin .route-pace-coverage{font-size:12px}
.route-pace-garmin-actions{display:flex;flex-wrap:wrap;gap:8px}.route-pace-garmin-actions button{min-height:44px;max-width:100%;padding:10px 12px;white-space:normal;font-size:14px;text-align:left;border:1px solid #cbd7c4;border-radius:10px;background:#fff;color:#294b31}
.route-pace-garmin-actions button[hidden]{display:none}

.route-pace-review-metrics{display:grid;gap:6px;padding-top:10px;border-top:1px solid #dce3d7}.route-pace-review-metrics strong{font-size:13px;font-weight:550}.route-pace-review-metrics .route-pace-review-note{font-size:12px}

/* Keep the chosen activity explicit, including a paused drawing task. */
.route-activity button[aria-pressed=true]{background:#2d4936;border-color:#2d4936;color:#fff;box-shadow:none;font-weight:650}
.route-activity button[aria-pressed=true]::after{content:"";width:8px;height:4px;border-left:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(-45deg);flex:none}

/* Shared tray vocabulary: drawing, Directions, review and Options use the same controls. */
.route-panel .route-preferences{grid-template-columns:104px minmax(0,1fr);gap:12px;align-items:stretch}
.route-panel .route-activity{align-self:center;padding:3px;gap:2px;border-radius:28px;background:#e7ede3}
.route-panel .route-activity button{flex:1 0 44px;min-width:44px;min-height:44px;padding:10px;border-radius:50%;border:1px solid transparent}
.route-panel .route-activity button>span,.route-panel .route-activity button::after{display:none}
.route-panel .route-activity button>svg{width:22px;height:22px}
.route-panel .route-activity button[aria-pressed=true]{background:#2d4936;border-color:#2d4936;box-shadow:inset 0 0 0 1px #ffffff45;color:#fff}
.route-panel .route-build-context{min-width:0}
.route-panel .route-build-context>.route-method-switch{max-width:none;min-height:50px;gap:8px;padding:8px 12px;border:1px solid #d9e2d3;border-radius:26px;background:#edf2e9;font-size:13px;line-height:1.3}
.route-panel .route-draw-status{display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;min-width:0;min-height:22px;font-variant-numeric:tabular-nums}
.route-draw-status>.route-message{flex:1 1 170px;min-width:0;overflow-wrap:anywhere}
.route-draw-status>.route-build-stats{flex:1 1 100%;min-width:0;text-align:left;line-height:1.45;overflow-wrap:anywhere;color:#40574a}
.route-draw-status>.route-draw-retry{flex:none;min-width:44px;min-height:44px;padding:8px 12px;border:1px solid #d9bca7;border-radius:12px;background:#f7eee5;color:#784b2b;font-size:13px;font-weight:550}
.route-draw-status[data-pending=true]::before{content:"";flex:none;width:12px;height:12px;border:2px solid #c8d5c4;border-top-color:#3c5d44;border-radius:50%;animation:route-draw-busy .9s linear infinite}
.route-panel[data-phase=edit] .route-primary-bar{justify-content:space-between;gap:12px;padding-top:8px}
.route-panel[data-phase=edit] .route-primary-bar>.route-clear{flex:0 1 auto;min-width:44px;min-height:48px;max-width:60%;padding:8px 4px;border:0;border-radius:12px;background:transparent;color:#795747;font-size:14px;font-weight:500;line-height:1.3;text-align:left;overflow-wrap:anywhere}
.route-panel[data-phase=edit] .route-primary-bar>.route-primary{flex:0 0 auto;min-width:96px;min-height:48px;max-width:45%;margin-left:auto;padding:10px 20px;border-radius:24px;white-space:normal;overflow-wrap:anywhere}
.route-panel>.route-resume-draw{flex:none;width:100%;border-radius:24px}
.route-panel[data-phase=edit][data-paused=true] .route-primary-bar>.route-primary{background:#e8ede4;color:#28382e}
.route-panel[data-phase=edit] .route-point-tools{gap:6px}
.route-panel[data-phase=edit] .route-selected-label{flex-basis:100%;margin:0;font-size:13px}

/* Only the actual history buttons accept pointers; empty map space stays with Cesium. */
.route-map-history{position:fixed;z-index:27;left:max(var(--edge,18px),calc(env(safe-area-inset-left) + 12px));bottom:calc(76px + env(safe-area-inset-bottom));display:flex;align-items:center;gap:8px;width:max-content;max-width:calc(100vw - 36px - env(safe-area-inset-left) - env(safe-area-inset-right));pointer-events:none}
.route-map-history[hidden],.route-map-history [hidden]{display:none!important}
.route-map-history>.route-quick-undo{display:grid;place-items:center;flex:none;width:48px;height:48px;min-width:44px;min-height:44px;padding:12px;border:1px solid #dbe2d7;border-radius:50%;background:#f8f9f5;color:#2d4936;box-shadow:0 4px 14px #17291f25;pointer-events:auto;touch-action:manipulation;cursor:pointer}
.route-map-history>.route-quick-undo:disabled{color:#7e8a7b;cursor:default}
.route-map-history svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.route-map-history>button:focus-visible{outline:2px solid #1769ed;outline-offset:3px}
.search-open .route-map-history{visibility:hidden;pointer-events:none}
.search-open .route-map-history>button{pointer-events:none}

/* Focus follows the visible rounded grip, including its full-header minimized hit area. */
.route-heading>button{position:relative;z-index:2}
.route-panel .route-tray-toggle:focus-visible{outline:none}
.route-panel .route-tray-toggle:focus-visible::before{outline:2px solid #1769ed;outline-offset:5px}
.route-panel .route-tray-toggle[data-pointer-focus=true]:focus-visible::before{outline:none}
@media(max-width:600px),(max-height:520px){
 .route-map-history{bottom:calc(var(--route-tray-height,0px) + 12px)}
 .route-panel[data-phase=edit]:not([data-tray=minimized]){padding-bottom:calc(34px + env(safe-area-inset-bottom))}
}
@media(max-height:520px) and (min-aspect-ratio:1/1){
 /* The sheet sits at the right in landscape, leaving history beside it. */
 .route-map-history{bottom:calc(60px + env(safe-area-inset-bottom))}
 .route-panel[data-phase=edit]{right:var(--edge,18px);width:min(420px,calc(100% - 2 * var(--edge,18px) - 116px));padding-inline:var(--route-gutter)}
}
@media(max-height:520px) and (min-aspect-ratio:1/1) and (max-width:650px){
 .route-panel[data-phase=edit]:not([data-tray=minimized]) .route-heading{flex-wrap:wrap}
 .route-panel[data-phase=edit]:not([data-tray=minimized]) .route-heading h2{flex-basis:100%}
 .route-panel[data-phase=edit]:not([data-tray=minimized]) .route-close{margin-left:auto}
}
@media(max-width:350px){
 .route-panel[data-phase=preview]:not([data-tray=minimized]) .route-heading{flex-wrap:wrap}
 .route-panel[data-phase=preview]:not([data-tray=minimized]) .route-heading h2{flex-basis:6em;min-width:6em}
 .route-panel[data-phase=preview]:not([data-tray=minimized]) .route-close{margin-left:auto}
 .route-panel .route-preferences{gap:8px}
 .route-panel .route-build-context>.route-method-switch{gap:6px;padding-inline:9px}
 .route-panel[data-phase=edit] .route-primary-bar>.route-primary{min-width:84px;padding-inline:16px}
}
@media(max-height:520px) and (min-aspect-ratio:1/1){
 .route-panel[data-phase=setup]{right:max(80px,calc(var(--edge,18px) + 60px));padding-bottom:calc(22px + env(safe-area-inset-bottom))}
}
@keyframes route-draw-busy{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.route-draw-status[data-pending=true]::before{animation:none}}

.route-closure-choice{padding:12px;border:1px solid #cfa79c;border-radius:12px;background:#fff8ef;color:#733a30;overflow-wrap:anywhere}.route-closure-choice h3{font-size:14px;margin:0 0 8px}.route-closure-choice p{font-size:12px;line-height:1.5;margin:6px 0}.route-closure-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.route-closure-actions button{min-height:44px;flex:1 1 150px;padding:9px 12px;border:1px solid #ad796d;border-radius:9px;background:#fffdf8;color:inherit;font:inherit;font-size:12px}.route-closure-actions button.route-primary{border-color:#28382e;background:#28382e;color:#fff;font-size:12px!important;min-height:44px}.route-closure-actions button:disabled{opacity:.5}.route-closure-actions button.route-primary:disabled{border-color:#c3cbc1;background:#e1e5de;color:#627067}.route-closure-links a{display:inline-flex;align-items:center;min-height:44px;font-size:12px;color:inherit;margin-right:12px}.route-closure-choice [hidden],.route-closure-choice[hidden]{display:none!important}

/* Route time: result first, explicit device-local changes and evidence on demand. */
.route-pace{gap:16px}
.route-pace-hero{display:grid;gap:5px;padding:16px 18px;background:#eaf0e5;border-radius:16px;color:#304b36}
.route-pace .route-pace-preview{padding:0;background:none;font-size:25px;line-height:1.25;letter-spacing:-.5px}
.route-pace .route-pace-source,.route-pace .route-pace-delta{font-size:13px;line-height:1.45;color:#4f6154}
.route-pace .route-pace-intro{font-size:12px;line-height:1.5}
.route-pace-manual{display:grid;gap:10px}.route-pace-manual-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.route-pace-manual h3{margin:0;font-size:15px}.route-pace-unit{display:flex;gap:6px;align-items:center;flex-shrink:0}.route-pace-unit>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.route-pace-unit select{font:inherit;font-size:14px;min-height:44px;padding:6px 8px;color:#294b31;background:#fff;border:1px solid #cbd7c4;border-radius:10px}
.route-pace-fields{grid-template-columns:repeat(2,minmax(0,1fr));padding:12px;gap:12px}.route-pace-fields label{font-size:13px;gap:6px;align-content:start}.route-pace-fields input{font-size:18px}
.route-pace-fields label[hidden]+label{grid-column:1/-1}.route-pace-equivalent{font-size:12px}.route-pace-garmin{padding:14px;gap:8px}.route-pace-garmin h3{font-size:15px}.route-pace-garmin p{font-size:13px;line-height:1.5}
.route-pace-evidence summary{display:list-item;list-style-position:inside;min-height:44px;padding:10px 0;box-sizing:border-box;font-size:13px;cursor:pointer;color:#294b31}
.route-pace-evidence-steps{list-style:none;margin:0 0 10px;padding:0;display:grid;gap:10px}.route-pace-evidence-steps li{display:grid;grid-template-columns:18px 1fr;column-gap:8px;font-size:13px}.route-pace-evidence-steps li:before{content:'○';grid-row:1/3;color:#69786b}.route-pace-evidence-steps li[data-complete=true]:before{content:'✓';color:#294b31}.route-pace-evidence-steps small{grid-column:2;font-size:12px;color:#617164}.route-pace-garmin .route-pace-evidence-note{font-size:12px}
.route-pace-garmin-actions button{padding:8px 10px;font-size:13px}.route-pace-garmin-actions{gap:6px}.route-panel .route-pace-reset{padding:4px 0;min-height:44px}
.route-primary-bar .route-pace-cancel{min-height:48px;padding:10px 16px;border:1px solid #cbd7c4;border-radius:24px;color:#294b31;background:#fff;font-size:14px;flex:0 0 auto}.route-primary-bar .route-pace-cancel[hidden]{display:none}
.route-pace select:focus-visible,.route-pace input:focus-visible,.route-pace summary:focus-visible{outline:2px solid #9ebb83;outline-offset:3px}
@media(max-width:350px){.route-pace-fields{grid-template-columns:1fr}.route-pace-manual-heading{flex-wrap:wrap}}
/* Compact evidence milestones; detailed provenance stays behind a disclosure. */
.route-pace-evidence-steps{display:flex;gap:0;margin:2px 0 0;padding:0;justify-content:space-between}
.route-pace-evidence-steps[hidden]{display:none}
.route-pace-evidence-steps li{position:relative;display:flex;flex:1;min-width:0;flex-direction:column;align-items:center;gap:5px;text-align:center;font-size:11px}
.route-pace-evidence-steps li:before{display:grid;place-items:center;content:'';box-sizing:border-box;width:20px;height:20px;border:1.5px solid #bdcabb;border-radius:50%;background:#f6f8f2;z-index:1}
.route-pace-evidence-steps li:not(:last-child):after{content:'';position:absolute;height:1.5px;top:9px;left:50%;width:100%;background:#d8e2d3}
.route-pace-evidence-steps li[data-complete=true]:before{content:'✓';border-color:#4b6c4e;background:#4b6c4e;color:white;font-size:12px}
.route-pace-evidence-steps small{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.route-pace-garmin{gap:6px;padding:12px 14px}.route-pace-garmin>p{font-size:12px}.route-pace-evidence summary{font-size:12px;padding:8px 0;min-height:36px}
.route-pace-evidence[open] .route-pace-coverage{margin:4px 0 10px}.route-pace-evidence[open] .route-pace-garmin-actions{margin-top:10px}
.route-panel[data-phase=pace] .route-editor{max-height:65dvh}
.route-pace{gap:12px}.route-pace-manual{gap:6px}.route-pace .route-pace-intro{font-size:11px}.route-pace-hero{padding:14px 16px}
@media(pointer:coarse){.route-pace-evidence summary{min-height:44px}}
