.map-tools #map-layers-toggle,.map-tools #fit{display:grid;place-items:center;min-height:44px;padding:0}
.map-tools #map-layers-toggle svg,.map-tools #fit svg{display:block;width:26.4px;height:26.4px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.map-tools{--map-control-active:#113d30;--map-control-active-ink:#fff}
[data-theme=dark] .map-tools{--map-control-active:var(--green);--map-control-active-ink:var(--accent-ink)}
.map-tools button,.map-tools button:hover{background:var(--paper);color:var(--forest);-webkit-tap-highlight-color:transparent}
.map-tools button:is([aria-expanded=true],[aria-pressed=true]){background:var(--map-control-active);color:var(--map-control-active-ink)}
.map-tools button:focus-visible{outline:2px solid currentColor;outline-offset:-4px}
@media(hover:hover){.map-tools button:not([aria-expanded=true]):not([aria-pressed=true]):hover{background:color-mix(in srgb,var(--green) 10%,var(--paper))}}
.map-layers-panel{position:absolute;right:78px;top:25px;z-index:900;display:flex;flex-direction:column;width:min(300px,calc(100% - 96px));max-height:calc(100% - 50px);overflow:hidden;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--paper);color:var(--ink);box-shadow:0 6px 28px #10251d35}
.map-layers-panel[hidden]{display:none}
.map-layers-heading{display:flex;flex:none;align-items:center;justify-content:space-between;gap:10px;margin-bottom:4px}
.map-layers-heading h2{font-size:1.125rem;line-height:1.35;margin:0}
.ghw-carto-tiles{filter:none}
.high-contrast .ghw-carto-tiles{filter:contrast(1.15)}
/* Labels have transparent backgrounds and their own halo. Keep theme classes
   on each tile layer so a pending theme switch cannot restyle the old map. */
.ghw-carto-labels{pointer-events:none}
/* Filter the actual images, not Leaflet's zero-size transformed layer wrapper. */
.ghw-carto-labels-light .leaflet-tile{filter:grayscale(1) brightness(.8) contrast(2)}
.ghw-carto-labels-dark .leaflet-tile{filter:grayscale(1) brightness(.8) contrast(3) invert(1)}
.map-detail-choice{border:0;padding:0;margin:0 0 16px;min-width:0}
.map-detail-choice legend{position:relative;font-size:.875rem;font-weight:650;margin-bottom:8px}
.map-detail-choice legend::after{content:"";position:absolute;inset-inline-start:calc(100% + 8px);top:calc(50% - 7px);width:10px;height:10px;border:2px solid currentColor;border-inline-end-color:transparent;border-radius:50%;visibility:hidden}
.map-detail-choice[aria-busy=true] legend::after{visibility:visible;animation:map-detail-loading .8s linear infinite}
@keyframes map-detail-loading{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.map-detail-choice[aria-busy=true] legend::after{animation:none}}
.map-detail-choice>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.map-detail-choice label{position:relative;cursor:pointer;min-width:0}
.map-detail-choice input{position:absolute;width:1px;height:1px;opacity:0}
.map-detail-choice span{display:flex;align-items:center;justify-content:center;min-height:44px;padding:8px;border:1px solid var(--line);border-radius:8px;font-size:.875rem;background:var(--paper);color:var(--ink)}
.map-detail-choice input:checked+span{background:#113d30;color:#fff;border-color:#113d30;font-weight:700}
[data-theme=dark] .map-detail-choice input:checked+span{background:var(--green);color:var(--accent-ink);border-color:var(--green)}
.map-detail-choice input:focus-visible+span{outline:3px solid var(--green);outline-offset:2px}
.large-text .map-detail-choice span{font-size:1.125rem}
.map-provider-choice{margin-bottom:12px}
.map-provider-choice span{white-space:nowrap;height:100%;padding-inline:6px}
/* Instant frame correction, zoom easing and rotation have separate wrappers.
   The SDK's later stylesheet cannot collapse its absolute canvas container. */
:is(#map,.station-access-map)>.ghw-maptiler-view{position:absolute;inset:0;width:100%;height:100%;z-index:150;pointer-events:none;transform-origin:50% 50%}
.ghw-maptiler-view>.ghw-maptiler-zoom,.ghw-maptiler-view .ghw-maptiler-renderer{position:absolute;inset:0;width:100%;height:100%;transform-origin:0 0;will-change:transform}
:is(#map,.station-access-map)>.ghw-basemap-loading{position:absolute;inset:0;z-index:650;display:flex;align-items:center;justify-content:center;gap:10px;background:var(--paper);color:var(--ink);font:500 .9375rem/1.5 'DM Sans',sans-serif;cursor:progress}
:is(#map,.station-access-map)>.ghw-basemap-loading[hidden]{display:none}
.ghw-basemap-loading::before{content:'';width:20px;height:20px;flex:none;border:2px solid var(--line);border-top-color:var(--green);border-radius:50%;animation:map-detail-loading .8s linear infinite}
@media(prefers-reduced-motion:reduce){.ghw-basemap-loading::before{animation:none}}
.ghw-maptiler-zoom.is-zooming{transition:transform .25s cubic-bezier(0,0,.25,1)}
/* The same official logo and linked credits live in Leaflet's unrotated
   controls, where route overlays cannot cover them or capture their clicks. */
.ghw-maptiler-view .maplibregl-control-container{display:none}
.ghw-maptiler-logo{display:block;margin:0 0 3px 6px!important;line-height:0;pointer-events:auto}
.ghw-maptiler-logo img{display:block;width:80px;height:24px}
:is(#map,.station-access-map).has-maptiler .leaflet-bottom.leaflet-right{max-width:calc(100% - 92px)}
:is(#map,.station-access-map).has-maptiler .leaflet-control-attribution{white-space:normal}
.map-wrap:has(#map.has-maptiler) .map-bottom-controls{bottom:32px}
.map-layer-option{display:flex;align-items:center;gap:10px;min-height:54px;padding:10px 0;cursor:pointer;font-size:.9375rem;line-height:1.4}
.map-layer-option input{flex:0 0 22px;width:22px;height:22px;margin:0;accent-color:var(--green)}
.map-layer-option .legend-line{flex:0 0 24px;width:24px}
.map-layer-note,.map-layer-status{font-size:.875rem;line-height:1.5;margin:8px 0 0;color:var(--muted)}
.map-layer-status{color:var(--ink)}
.additional-line,.walking-line{height:2px;border:0;box-shadow:none}
.additional-line{background:#58856b}
.walking-line{background:#467e9d}
[data-theme=dark] .additional-line{background:#6a9c7e}
[data-theme=dark] .walking-line{background:#6aaac9}
.high-contrast .additional-line,.high-contrast .walking-line{height:3px}
.high-contrast .additional-line{background:#35694c}
.high-contrast .walking-line{background:#17618c}
[data-theme=dark] .high-contrast .additional-line{background:#9bcaac}
[data-theme=dark] .high-contrast .walking-line{background:#9edbfa}
.approximate-walking-line{mask-image:repeating-linear-gradient(to right,#000 0 2px,transparent 2px 6px)}
.hauptweg-number{background:transparent;border:0;pointer-events:none}
.hauptweg-number span{display:grid;place-items:center;width:30px;height:24px;border-radius:6px;border:1px solid #fff;background:#247647;color:#fff;font:700 .875rem/1 'DM Sans',sans-serif;box-shadow:0 1px 5px #10251d30}
[data-theme=dark] .hauptweg-number span{background:#74bc88;color:#10251d;border-color:#14261c}
.additional-path-popup{font-size:.875rem;line-height:1.5}.additional-path-popup strong{font-size:1rem}.additional-path-popup p{margin:7px 0}
body .map-legend{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px 14px;font-size:.875rem}
.map-legend .legend-key[hidden]{display:none}
/* Use the restriction key's dash treatment so narrow legend swatches keep complete dashes. */
.map-legend .ferry-line{height:0;border:0;border-top:3.5px dashed #146da5;border-radius:0;background:none;box-shadow:none}
[data-theme=dark] .map-legend .ferry-line{border-top-color:#86d3ff}
@media(max-width:700px),(max-width:1000px) and (pointer:coarse){
 .map-layers-panel{top:14px;right:66px;width:min(300px,calc(100% - 80px));padding:12px;max-height:calc(100% - 28px)}
 .map-bottom-controls .map-legend{gap:6px 10px}
 .map-legend .legend-key{flex:1 1 72px;max-width:140px;font-size:.875rem;min-width:0;overflow-wrap:normal}
 .map-legend .hide-stops{flex:1 0 100%}
}
@media(max-height:500px) and (orientation:landscape){
 .map-tools{display:grid;grid-template-columns:repeat(2,48px)}
 .map-tools button{width:44px;min-height:44px}
 .map-layers-panel{right:110px;width:min(300px,calc(100% - 124px))}
}
