.route-atlas-page,.route-explorer,.route-embed,.route-elevation {
  --at-ink:#173e41;--at-muted:#476563;--at-accent:#146858;--at-line:#c6d8d1;--at-surface:#fff;--at-soft:#eef6f1;--at-warm:#aa5025;
  color:var(--at-ink);text-align:left;
}
:root[data-theme=dark] :is(.route-atlas-page,.route-explorer,.route-embed,.route-elevation) {
  --at-ink:#e5f4ef;--at-muted:#abc4ba;--at-accent:#8bd9ba;--at-line:#405e55;--at-surface:#172c29;--at-soft:#203a34;--at-warm:#ffad80;color-scheme:dark;
}
.route-atlas-page {max-width:86rem;margin:auto;}
.route-atlas-intro {margin:1.3rem 0 1.4rem;}
.route-atlas-intro h1 {margin:0 0 .25rem;font-size:clamp(2.4rem,5vw,4.4rem);letter-spacing:-.065em;line-height:1.02;color:var(--at-ink);}
.route-atlas-intro p {color:var(--at-muted);margin:.6rem 0 0;font-size:1.05rem;}
.route-explorer [hidden],.route-elevation [hidden] {display:none!important;}
.route-embed {margin:1.15rem 0;border:1px solid var(--at-line);border-radius:.95rem;padding:.1rem .9rem;background:var(--at-surface);}
.route-embed>summary,.route-profile>summary {min-height:2.9rem;cursor:pointer;list-style:none;display:flex;align-items:center;gap:.65rem;font-size:1.02rem;font-weight:730;}
.route-embed>summary::-webkit-details-marker,.route-profile>summary::-webkit-details-marker {display:none;}
.route-embed>summary::after,.route-profile>summary::after {content:"";width:.52rem;height:.52rem;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);margin:-.2rem .2rem 0 auto;flex:none;}
.route-embed[open]>summary::after,.route-profile[open]>summary::after {transform:rotate(225deg);margin-top:.18rem;}
.route-embed[open]>.route-explorer {margin:.6rem 0;}
.open-route-map {display:inline-block;margin:.3rem 0 .8rem;font-weight:650;color:var(--at-accent);}
.route-atlas-page nav {font-size:.9rem;}
.route-map-tools {display:flex;align-items:center;flex-wrap:wrap;gap:.6rem;margin-bottom:.8rem;}
.route-explorer :is(button,input),.route-elevation button {font:inherit;letter-spacing:normal;}
.route-explorer button,.profile-landmarks button {cursor:pointer;min-height:2.65rem;border:1px solid var(--at-line);border-radius:.7rem;padding:.45rem .8rem;font-size:.9rem;font-weight:650;color:var(--at-ink);background:var(--at-surface);}
.route-explorer :is(a,button,input):focus-visible,.route-elevation :is(summary,button,input,a):focus-visible,.route-embed>summary:focus-visible {outline:3px solid #2697c1;outline-offset:2px;}
.route-explorer button:hover,.profile-landmarks button:hover {border-color:var(--at-accent);}
.route-place-search {display:flex;position:relative;align-items:center;margin:0!important;padding:0!important;flex:1 1 17rem;max-width:30rem;}
.route-place-search label {display:flex;align-items:center;gap:.5rem;flex:1;min-width:0;margin:0;padding:0 .55rem;color:var(--at-muted);background:var(--at-surface);border:1px solid var(--at-line);height:2.8rem;border-radius:.7rem 0 0 .7rem;}
.route-place-search input {width:100%;padding:.3rem 0;min-width:0;background:transparent;color:var(--at-ink);border:none;box-shadow:none;border-radius:0;font-size:1rem;}
.route-place-search label:focus-within {outline:2px solid #2697c1;outline-offset:-2px;}
.route-place-search label input:focus {outline:none;}
.route-place-search>button {height:2.8rem;border-radius:0 .7rem .7rem 0;border-left:0;color:var(--at-accent);}
.route-suggestions {position:absolute;z-index:1050;top:100%;left:0;width:100%;max-height:16rem;overflow:auto;background:var(--at-surface);border:1px solid var(--at-line);box-shadow:0 8px 30px #15343125;border-radius:.6rem;}
.route-suggestions button {display:block;text-align:left;width:100%;border:0;border-radius:0;background:none;}
.route-suggestions button:is(:hover,:focus) {background:var(--at-soft);}
.route-explorer .route-locate,.route-kinds button {display:inline-flex;align-items:center;justify-content:center;gap:.4rem;}
.route-kinds {display:flex;gap:.3rem;flex-wrap:wrap;margin-left:auto;}
.route-kinds button {border-radius:2rem;}
.route-explorer button[data-kind][aria-pressed=true],.profile-landmarks button[aria-pressed=true] {background:var(--at-ink);border-color:var(--at-ink);color:var(--at-surface);}
.route-map-layout {display:grid;grid-template-columns:minmax(0,1.95fr) minmax(16rem,1fr);border:1px solid var(--at-line);border-radius:1.05rem;overflow:hidden;background:var(--at-surface);}
.route-map-wrap {position:relative;isolation:isolate;min-width:0;}
.route-map-canvas {height:clamp(24rem,61vh,40rem);width:100%;background:#c7dfe4;color:#173e41;z-index:0;}
.route-map-wrap .search-this-area {position:absolute;z-index:2;top:.75rem;left:50%;transform:translateX(-50%);border-color:#d9ece2;border-radius:2rem;background:#125c50;color:white;box-shadow:0 3px 16px #102b3440;display:flex;gap:.4rem;align-items:center;white-space:nowrap;}
.route-list-panel {min-width:0;max-height:clamp(24rem,61vh,40rem);overflow:auto;padding:.95rem;background:var(--at-surface);}
.route-list-head {display:flex;align-items:center;justify-content:space-between;gap:.5rem;}
.route-list-head h2 {font-size:1.17rem!important;margin:0!important;letter-spacing:-.025em;}
.route-explorer .all-routes {font-size:.85rem;min-height:2.5rem;padding:.2rem .6rem;}
.route-status {margin:.5rem 0;color:var(--at-muted);font-size:.9rem;}
.route-status:empty {display:none;}
.route-results {list-style:none!important;margin:.65rem 0 0!important;padding:0!important;display:grid;gap:.45rem;}
.route-results>li {margin:0!important;padding:0;border:1px solid var(--at-line);border-radius:.8rem;overflow:hidden;}
.route-results>li>a {display:grid;gap:.2rem;padding:.65rem .8rem;text-decoration:none;color:var(--at-ink);background:var(--at-surface);}
.route-results>li>a:hover {background:var(--at-soft);}
.route-results strong {font-size:1.03rem;line-height:1.24;}
.route-results small,.route-popup small {color:var(--at-muted);font-size:.86rem;}
.route-category {display:flex;align-items:center;gap:.35rem;font-size:.83rem;font-weight:750;color:var(--at-accent);}
.route-category svg {width:1.1rem;height:1.1rem;}
.route-results .route-card-tools {display:flex;flex-wrap:wrap;gap:.45rem;padding:0 .8rem .55rem;}
.route-card-tools button,.route-card-tools a {font:inherit;font-size:.84rem;font-weight:650;display:inline-flex;align-items:center;color:var(--at-accent);border:0;background:transparent;min-height:2rem;margin:0;padding:.1rem .12rem;text-decoration:underline;text-underline-offset:.15em;}
.route-pin {display:grid!important;place-items:center;color:white;background:#147567;border:2px solid white;border-radius:50%;box-shadow:0 1px 5px #102b3466;font:700 14px/1 system-ui;}
.route-pin.hike {background:#a64d25;}.route-pin.walk {background:#64579e;}.route-pin.cluster {background:#304f61;}
.route-pin svg {width:20px;height:20px;}
.route-map-canvas .leaflet-control-attribution {max-width:100%;font:11px/1.35 system-ui;color:#25474d;background:#ffffffed;padding:2px 4px;}
.route-map-canvas .leaflet-control-attribution a,.route-map-canvas .leaflet-control a {color:#175b63;}
.route-place-label {background:none;border:none;box-shadow:none;font:650 12px/1.2 system-ui;color:#304943;text-shadow:0 1px 2px white;-webkit-text-stroke:2px #fff;paint-order:stroke fill;pointer-events:none;white-space:nowrap;}
.route-map-canvas .leaflet-popup-content-wrapper {background:var(--at-surface);color:var(--at-ink);}
.route-map-canvas .leaflet-popup-content {margin:.85rem 1.15rem .85rem .95rem;font:1rem/1.35 system-ui;max-height:14rem;overflow:auto;}
.route-popup {display:grid;gap:.3rem;min-width:10rem;}
.route-popup+.route-popup {margin-top:.7rem;border-top:1px solid var(--at-line);padding-top:.5rem;}
.route-map-canvas .route-popup a {color:var(--at-accent);font-weight:650;}
.route-elevation {clear:both;margin:clamp(1.5rem,3vw,2.7rem) 0;padding:clamp(.9rem,2.2vw,1.65rem);border:1px solid var(--at-line);border-radius:1.15rem;background:var(--at-surface);scroll-margin:1rem;}
.profile-heading {display:flex;align-items:center;gap:.7rem;margin-bottom:.65rem;}
.route-elevation .profile-heading h2 {margin:0;line-height:1.05;font-size:clamp(1.4rem,3vw,2.2rem);letter-spacing:-.045em;color:var(--at-ink);}
.profile-heading>svg {color:var(--at-accent);width:2rem;height:2rem;flex:none;}
.route-profile {border-top:1px solid var(--at-line);padding:.2rem 0;scroll-margin:1rem;}
.route-profile>summary {color:var(--at-accent);font-size:1.07rem;}
.profile-inner {padding:.2rem .1rem .7rem;}
.route-elevation .profile-facts {display:flex;flex-wrap:wrap;gap:.65rem 1.75rem;padding:0;margin:.2rem 0 1.25rem;}
.profile-facts div {display:grid;gap:.1rem;}
.profile-facts dt {font-size:.84rem;font-weight:550;color:var(--at-muted);}
.profile-facts dd {margin:0;font-size:1.2rem;font-variant-numeric:tabular-nums;font-weight:750;line-height:1.1;}
.profile-frame {display:grid;grid-template-columns:auto minmax(0,1fr);gap:.28rem .6rem;margin:.35rem 0;}
.profile-y,.profile-x {color:var(--at-muted);font-size:.78rem;line-height:1;font-variant-numeric:tabular-nums;}
.profile-y {display:flex;flex-direction:column;justify-content:space-between;text-align:right;}
.profile-x {grid-column:2;display:flex;justify-content:space-between;gap:.3rem;}
.profile-plot {position:relative;touch-action:pan-y;cursor:crosshair;min-width:0;background:linear-gradient(0deg,var(--at-soft),transparent);height:clamp(8rem,17vw,12.5rem);}
.profile-plot svg {display:block;width:100%;height:100%;overflow:visible;}
.profile-grid,.profile-line {fill:none;stroke-width:1;vector-effect:non-scaling-stroke;}
.profile-grid {stroke:var(--at-line);stroke-dasharray:3 4;}
.profile-line {stroke:var(--at-accent);stroke-width:2.4;stroke-linejoin:round;stroke-linecap:round;}
.profile-cursor {position:absolute;top:0;bottom:0;border-left:1px dashed var(--at-warm);pointer-events:none;}
.profile-cursor i {position:absolute;display:block;left:-1px;width:.7rem;height:.7rem;border:2px solid var(--at-surface);border-radius:50%;background:var(--at-warm);transform:translate(-50%,-50%);}
.profile-inspect {display:grid;grid-template-columns:1fr auto;gap:.1rem .5rem;margin:1rem 0 .45rem;align-items:center;}
.profile-inspect label,.profile-inspect output {color:var(--at-ink);font-size:.92rem;font-weight:675;}
.profile-inspect output {color:var(--at-accent);font-variant-numeric:tabular-nums;}
.profile-inspect input {grid-column:1/-1;width:100%;margin:0;height:1.8rem;accent-color:var(--at-accent);cursor:pointer;}
.profile-highlight,.profile-source,.route-checkpoints p,.route-checkpoints ol {font-size:.91rem!important;line-height:1.45!important;color:var(--at-muted)!important;margin:.75rem 0!important;}
.profile-highlight strong {color:var(--at-ink);margin-right:.3rem;}
.profile-landmarks {display:flex;gap:.35rem;flex-wrap:wrap;}
.profile-landmarks button {min-height:2.45rem;font-size:.84rem;padding:.35rem .55rem;}
.profile-source a,.route-checkpoints a {color:var(--at-accent);font-weight:650;}
@media(max-width:780px){
  .route-map-layout {grid-template-columns:minmax(0,1fr);}
  .route-map-canvas {height:clamp(18rem,45svh,28rem);}
  .route-list-panel {max-height:none;overflow:visible;border-top:1px solid var(--at-line);padding:.75rem;}
  .route-kinds {width:100%;margin:0;}
}
@media(max-width:500px){
  .route-map-tools {gap:.45rem;}
  .route-place-search {flex-basis:12rem;}
  .route-kinds button,.route-explorer .route-locate {font-size:.83rem;padding:.4rem .57rem;}
  .route-kinds button svg {width:1rem;}
  .route-kinds {gap:.23rem;}
  .profile-inspect {grid-template-columns:auto 1fr;}
  .profile-inspect output {text-align:right;}
}
.route-elevation .profile-inner>a,.route-elevation .profile-data-sources summary,.trail-card .trail-profile-link {color:var(--at-accent,#17675c);font-size:.91rem;font-weight:650;}
.profile-data-sources {margin:.45rem 0;font-size:.9rem;}
.profile-data-sources summary {display:list-item;cursor:pointer;}
.route-elevation .profile-data-sources ul {margin:.45rem 0 .55rem;padding-inline-start:1.2rem;}
.trail-card .trail-profile-link {display:inline-block;padding:.45rem .9rem .75rem;}
@media(prefers-reduced-motion:no-preference){
  .route-explorer :is(.route-locate,.search-this-area,.route-kinds button):is(:hover,:focus-visible) svg,
  .route-embed>summary:is(:hover,:focus-visible)>svg,.route-elevation .profile-heading:hover>svg {animation:route-lift .5s ease-out;}
  @keyframes route-lift{0%,100%{transform:translateY(0)}45%{transform:translateY(-2px)}}
}
.profile-frame,.profile-inspect input {direction:ltr;}

/* Give shared panels a consistent gutter, including pages with local section resets. */
main :is(.route-elevation,.route-embed)[id] {margin-block:clamp(1.5rem,3vw,2.7rem);}
.route-kinds .route-kind-count {font-size:.73rem;line-height:1.35;font-variant-numeric:tabular-nums;color:inherit;opacity:.85;}
.route-empty {border:1px solid var(--at-line);border-radius:.9rem;background:var(--at-soft);padding:.85rem 1rem;margin:.7rem 0;}
.route-empty>strong {display:block;color:var(--at-ink);}
.route-explorer .route-empty p {margin:.25rem 0 .65rem;color:var(--at-muted);line-height:1.45;}
.route-empty-actions {display:flex;gap:.4rem .75rem;flex-wrap:wrap;align-items:center;}
.route-empty-actions a {color:var(--at-accent);font-weight:650;padding:.4rem;text-underline-offset:.18em;}
.route-results .route-start-distance {font-weight:650;color:var(--at-accent);}
@media(max-width:600px){.route-kinds {row-gap:.4rem;}.route-kinds button {gap:.25rem;}.route-empty-actions button {min-height:2.65rem;}}
