.trip-map-box { position:relative; isolation:isolate; margin:.75rem 0; }
.trip-map-canvas,.pin-picker { height:clamp(13rem,36vw,26rem); border:1px solid #aebbaa; border-radius:10px; background:#e7ecdf; z-index:0; }
.pin-picker {height:clamp(11rem,32vh,21rem); margin:.65rem 0}
.trip-pin {background:transparent;border:0}
.trip-pin svg {width:100%;height:100%;display:block}
.map-expand { position:absolute; z-index:1; top:.6rem; right:.6rem; min-height:40px; background:#fffefa; border:1px solid #8d9e91; border-radius:6px; color:#19342d; padding:0 .7rem; cursor:pointer; }
.trip-map-box.map-expanded {position:fixed; inset:0; z-index:2000; margin:0; background:#f8f7f1;}
.map-expanded .trip-map-canvas {height:100%; border-radius:0}
.tile-note,.map-key,.map-links,.map-edit-list {font: .93rem/1.5 system-ui,sans-serif;color:#3a544a}
.map-key,.map-links {padding:0;list-style:none;margin:.55rem 0}
.map-key li,.map-links li {margin:.45rem 0}
.map-key b::before {content:"";display:inline-block;width:1.5rem;border-top:4px solid #16483f;vertical-align:middle;margin-right:.5rem;}
.map-key .hike::before {border-top:4px dashed #a74624}
.map-links a,.map-key a {display:inline-block;padding:.35rem 0;color:#16483f;text-underline-offset:.2em;}
.map-editor-row {padding:.65rem 0;border-bottom:1px solid #cdd3c6;}
.map-editor-row .buttons {margin-top:.35rem}
.map-edit-list {margin:.5rem 0;padding:0;list-style:none}
.map-edit-list button {font:inherit;text-align:left; padding:.5rem; width:100%; background:white;border:1px solid #cdd3c6}
.mapped-plan {max-width:1140px;}
/* Published map itineraries also load this sheet from older, immutable snapshots. */
@media screen {
  .mapped-plan > .cover {display:block;width:auto;height:auto;max-width:100%;max-height:275px;object-fit:contain;margin:1.5rem auto 0}
}
@media print { .mapped-plan > .cover {object-fit:contain} }
.mapped-plan section.map-itinerary {display:grid;gap:0 2rem;grid-template-columns:minmax(0,1fr); align-items:start}
.map-itinerary .itinerary-cards {display:contents}
.map-itinerary .trip-geography {grid-row:var(--map-row);min-width:0;}
.trip-geography h2 {font-size:1.45rem;margin:.3rem 0}
@media(min-width:800px) {
  .mapped-plan section.map-itinerary {grid-template-columns:repeat(2,minmax(0,1fr));align-content:start}
  .map-itinerary .itinerary-cards {display:block;grid-column:1}
  .map-itinerary .trip-geography {grid-column:2;grid-row:1;position:sticky;top:1rem;}
  .map-itinerary .trip-map-box {margin-top:0}
}
@media print { .map-expand,.trip-map-canvas,.leaflet-control {display:none} .map-itinerary .trip-geography {position:static} }
@font-face {font-family:TripSerif;src:url('/assets/serif.woff2') format('woff2');font-display:swap}
@font-face {font-family:TripSans;src:url('/assets/sans.woff2') format('woff2');font-display:swap}
.mapped-plan {font-family:TripSans,system-ui,sans-serif;color:#19342d}
.mapped-plan h1,.mapped-plan h2 {font-family:TripSerif,Georgia,serif;font-weight:400}
.mapped-plan h1 {line-height:.98}
.mapped-plan .trip-map-canvas {height:clamp(14rem,35vw,26rem)}
.mapped-plan .map-expanded .trip-map-canvas {height:100%}
.trip-map-canvas:has(.google-route) {overflow:hidden}
.google-route {width:100%;height:100%;display:block;border:0}
.trip-map-box:has(.google-route) .map-expand {top:auto;bottom:1.6rem;right:.55rem}
.shared-route-panel .route-visits {margin-top:.25rem}
@media(min-width:850px){
  .shared-route-panel {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:2rem;align-items:start}
  .shared-route-panel .section-head,.shared-route-panel .route-visits {grid-column:1}
  .shared-route-panel .trip-map-box {grid-column:2;grid-row:1 / span 2}
  .shared-route-panel .map-usage {grid-column:2}
  .shared-route-panel .route-visits {grid-row:2}
}
.trip-map-box [hidden] {display:none!important}
.map-key b:not(.hike)::before {display:none}
.map-usage {font:.88rem/1.4 system-ui,sans-serif;color:#526259}
.map-external {font:inherit;color:#16483f;text-decoration:underline;text-underline-offset:.2em;border:0;background:transparent;padding:.45rem .15rem;cursor:pointer}
.map-signin {display:inline-block;margin:.6rem 0;color:#16483f;font-weight:650}

.route-visits{counter-reset:visit;list-style:none;padding-inline-start:0}
.route-visits li{counter-increment:visit;position:relative;padding:.5rem 0 .5rem 2.4rem;--stop:#f5aba0}
.route-visits li:nth-child(7n+2){--stop:#8cd9cb}.route-visits li:nth-child(7n+3){--stop:#f1c57b}
.route-visits li:nth-child(7n+4){--stop:#b8b0ef}.route-visits li:nth-child(7n+5){--stop:#94c8ed}
.route-visits li:nth-child(7n+6){--stop:#e8afd6}.route-visits li:nth-child(7n){--stop:#b6d58b}
.route-visits li::before{content:counter(visit);position:absolute;left:0;top:.48rem;display:grid;place-items:center;width:1.65rem;height:1.65rem;border:1px solid #314147;border-radius:50%;color:#172f29;background:var(--stop);font-weight:750;font-size:.9rem}
