.map-page { padding-top: 2rem; padding-bottom: 4rem; }
.map-page h1 { font-size: clamp(2rem, 4vw, 3rem); }
.map-back-link { display: inline-block; margin-bottom: 0.65rem; font-size: 0.9rem; font-weight: 600; text-decoration: none; }
.map-back-link:hover { text-decoration: underline; }
.map-intro { max-width: 760px; }
.map-content { min-width: 0; margin-top: 1.25rem; }
.map-panel { position: relative; }
.map-panel:not(.is-expanded) .map-controls { display: grid; grid-template-columns: minmax(0, 600px) minmax(0, 360px); align-items: start; gap: 0.75rem; margin-bottom: 0.75rem; }
.map-panel:not(.is-expanded) .map-search { min-width: 0; margin-bottom: 0; }
.map-panel:not(.is-expanded) .map-toolbar { margin: 1.7rem 0 0; }
.map-search { position: relative; z-index: 4; max-width: 600px; margin-bottom: 0.9rem; }
.map-search > label { display: block; margin-bottom: 0.35rem; font-size: 0.85rem; font-weight: 700; }
.map-search-row { display: flex; gap: 0.5rem; }
.map-search-row button { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; }
.map-search-row button svg { width: 1.15rem; height: 1.15rem; }
.map-search input { flex: 1 1 auto; min-width: 0; min-height: 2.75rem; padding: 0.55rem 0.75rem; color: var(--color-primary); background: white; border: 1px solid var(--color-secondary); border-radius: var(--border-radius); font: inherit; }
.map-search input:focus-visible { outline: 3px solid #e8ab3c; outline-offset: 3px; }
.map-search button:disabled { cursor: not-allowed; opacity: 0.6; }
.map-search-status { margin-top: 0.35rem; color: #485e4c; font-size: 0.75rem; line-height: 1.4; }
.map-search-status:empty { display: none; }
.map-search-status.error { color: #8d2924; font-weight: 600; }
.map-search-note { margin-top: 0.35rem; color: #586a5c; font-size: 0.72rem; line-height: 1.4; }
.map-search-note a { color: var(--color-link); }
.map-panel.is-expanded .map-search-note { display: none; }
.map-search-results { position: absolute; top: 100%; left: 0; right: 0; max-height: min(45vh, 20rem); overflow-y: auto; margin: 0.25rem 0 0; padding: 0.35rem; list-style: none; background: white; border: 1px solid var(--color-secondary); border-radius: var(--border-radius); box-shadow: var(--shadow-heavy); }
.map-search-results[hidden] { display: none; }
.map-search-results button { display: block; width: 100%; padding: 0.55rem 0.65rem; color: var(--color-primary); background: transparent; border: 0; border-radius: 0.4rem; cursor: pointer; font: inherit; text-align: left; }
.map-search-results button:hover, .map-search-results button:focus-visible { background: #e7f1e4; }
.map-search-results small { display: block; color: #586a5c; font-size: 0.75rem; }
.map-toolbar { position: relative; z-index: 3; margin-bottom: 0.75rem; }
.map-menu { position: relative; width: min(100%, 360px); }
.map-menu summary { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 3.25rem; padding: 0.55rem 0.85rem; color: var(--color-primary); background: white; border: 1px solid var(--color-secondary); border-radius: var(--border-radius); box-shadow: var(--shadow-light); cursor: pointer; font-size: 0.9rem; font-weight: 700; list-style: none; }
.map-menu summary::-webkit-details-marker { display: none; }
.map-menu summary::after { content: ""; flex: 0 0 auto; width: 0.5rem; height: 0.5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.map-menu[open] summary::after { transform: rotate(225deg) translate(-2px, -1px); }
.map-menu summary:focus-visible { outline: 3px solid #e8ab3c; outline-offset: 3px; }
.map-menu-current { color: #586a5c; font-size: 0.75rem; font-weight: 500; text-align: right; }
.map-menu-content { position: absolute; top: calc(100% + 0.45rem); left: 0; width: min(360px, calc(100vw - 2rem)); max-height: min(70vh, 36rem); overflow-y: auto; padding: 1rem; background: white; border: 1px solid var(--color-secondary); border-radius: var(--border-radius); box-shadow: var(--shadow-heavy); }
.map-panel:not(.is-expanded) .map-menu-content { right: auto; left: 0; width: min(360px, calc(100% - 3rem)); }
.map-filters { display: grid; gap: 0.2rem; margin: 1rem 0; border: 0; }
.map-filters legend { margin-bottom: 0.5rem; font-size: 0.8rem; font-weight: 700; }
.map-filters label { display: flex; align-items: center; gap: 0.65rem; min-height: 2.75rem; cursor: pointer; font-size: 0.9rem; }
.map-filters input { width: 1.1rem; height: 1.1rem; accent-color: var(--color-link); }
.map-filters input:focus-visible { outline: 3px solid #e8ab3c; outline-offset: 3px; }
.map-filters:disabled label { cursor: default; opacity: 0.7; }
.layer-count { margin-left: auto; color: #586a5c; font-size: 0.8rem; }
.map-swatch { width: 0.85rem; height: 0.85rem; flex: 0 0 auto; border: 1px solid white; border-radius: 50%; box-shadow: 0 0 0 1px currentColor; }
.map-swatch.trail { width: 1rem; height: 0.3rem; border: 0; border-radius: 0; box-shadow: none; background: #d83e28; }
.map-swatch.water, .map-swatch.parking, .map-swatch.interest { width: 0.85rem; height: 0.95rem; border: 0; border-radius: 0; box-shadow: none; background-color: transparent; background-repeat: no-repeat; background-position: center; background-size: contain; }
.map-swatch.water { color: #0f7d97; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 54'%3E%3Cpath d='M24 2C13.5 2 5 10.5 5 21c0 14 19 31 19 31s19-17 19-31C43 10.5 34.5 2 24 2Z' fill='%230f7d97' stroke='%23fff' stroke-width='3' stroke-linejoin='round'/%3E%3Ccircle cx='24' cy='20' r='9' fill='%23fff'/%3E%3Cpath d='M24 12.4C26 16.2 29.6 19.4 29.6 21.8A5.6 5.6 0 0 1 18.4 21.8C18.4 19.4 22 16.2 24 12.4Z' fill='%230f7d97'/%3E%3C/svg%3E"); }
.map-swatch.parking { color: #4a44a8; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 54'%3E%3Cpath d='M24 2C13.5 2 5 10.5 5 21c0 14 19 31 19 31s19-17 19-31C43 10.5 34.5 2 24 2Z' fill='%234a44a8' stroke='%23fff' stroke-width='3' stroke-linejoin='round'/%3E%3Ccircle cx='24' cy='20' r='9' fill='%23fff'/%3E%3Ctext x='24' y='24' text-anchor='middle' font-family='system-ui,sans-serif' font-size='14' font-weight='700' fill='%234a44a8'%3EP%3C/text%3E%3C/svg%3E"); }
.map-swatch.interest { color: #7c3aed; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 54'%3E%3Cpath d='M24 2C13.5 2 5 10.5 5 21c0 14 19 31 19 31s19-17 19-31C43 10.5 34.5 2 24 2Z' fill='%237c3aed' stroke='%23fff' stroke-width='3' stroke-linejoin='round'/%3E%3Ccircle cx='24' cy='20' r='9' fill='%23fff'/%3E%3Cpath d='M24 12 25.82 16.49 30.66 16.84 26.95 19.96 28.11 24.66 24 22.1 19.89 24.66 21.05 19.96 17.34 16.84 22.18 16.49Z' fill='%237c3aed'/%3E%3C/svg%3E"); }
.map-reset { width: 100%; margin-top: 0.5rem; color: var(--color-primary); background: #e7f1e4; border: 1px solid var(--color-secondary); }
.map-reset:disabled { cursor: not-allowed; opacity: 0.55; }
.trail-card { font-size: 0.9rem; }
.trail-card h3 { margin: 1.1rem 0 0.45rem; font-size: 1.05rem; }
.trail-card-note { margin-top: 0.8rem; padding: 0.7rem; background: #f3f7f0; border-radius: var(--border-radius); font-size: 0.82rem; }
.trail-card-sources { display: grid; gap: 0.4rem; margin-top: 1rem; font-size: 0.82rem; }
.trail-card-sources a { overflow-wrap: anywhere; }
.map-style-controls { display: grid; gap: 0.35rem; padding: 0 0 1rem; border: 0; border-bottom: 1px solid #e3ebe0; }
.map-style-controls legend { margin-bottom: 0.5rem; font-size: 0.8rem; font-weight: 700; }
.map-style-controls label { display: flex; align-items: center; gap: 0.65rem; padding: 0.4rem; border-radius: 0.4rem; cursor: pointer; font-size: 0.9rem; }
.map-style-controls label:hover { background: #f3f7f0; }
.map-style-controls input { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; accent-color: var(--color-link); }
.map-style-controls input:focus-visible { outline: 3px solid #e8ab3c; outline-offset: 3px; }
.map-style-controls small { display: block; color: #586a5c; font-size: 0.75rem; }
.map-style-controls:disabled label { cursor: wait; opacity: 0.65; }
.map-terrain-controls { display: grid; gap: 0.35rem; padding: 0.85rem 0 1rem; border: 0; border-bottom: 1px solid #e3ebe0; }
.map-terrain-controls legend { margin-bottom: 0.5rem; font-size: 0.8rem; font-weight: 700; }
.map-terrain-toggle { display: flex; align-items: center; gap: 0.65rem; padding: 0.4rem; border-radius: 0.4rem; cursor: pointer; font-size: 0.9rem; }
.map-terrain-toggle:hover { background: #f3f7f0; }
.map-terrain-toggle input { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; accent-color: var(--color-link); }
.map-terrain-toggle input:focus-visible { outline: 3px solid #e8ab3c; outline-offset: 3px; }
.map-terrain-toggle small { display: block; color: #586a5c; font-size: 0.75rem; }
.map-terrain-settings { display: grid; gap: 0.4rem; padding: 0.65rem; background: #f3f7f0; border: 1px solid #e3ebe0; border-radius: var(--border-radius); }
.map-terrain-settings[hidden] { display: none; }
.map-terrain-settings > label { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: 0.82rem; font-weight: 700; cursor: default; }
.map-terrain-settings output { color: var(--color-link); font-variant-numeric: tabular-nums; }
.map-terrain-settings input[type="range"] { width: 100%; min-height: 1.75rem; accent-color: var(--color-link); }
.map-terrain-settings input[type="range"]:focus-visible { outline: 3px solid #e8ab3c; outline-offset: 3px; }
.map-terrain-settings p { color: #586a5c; font-size: 0.75rem; line-height: 1.4; }
.map-terrain-controls:disabled label { cursor: wait; opacity: 0.65; }
.map-notice { margin-top: 1.25rem; padding: 0.9rem; border-left: 4px solid #bd8d27; background: #fff8e6; border-radius: 0 var(--border-radius) var(--border-radius) 0; font-size: 0.85rem; }
.map-notice p { margin-top: 0.35rem; }
.map-frame { position: relative; overflow: hidden; border: 1px solid var(--color-secondary); border-radius: var(--border-radius); box-shadow: var(--shadow-light); background: #e7f1e4; }
.map-loading { position: absolute; z-index: 5; inset: 0; display: flex; align-items: center; justify-content: center; gap: 0.75rem; color: var(--color-primary); background: #e7f1e4; font-size: 1rem; font-weight: 750; transition: opacity 0.2s ease, visibility 0.2s ease; }
.map-loading[hidden] { display: flex; opacity: 0; visibility: hidden; pointer-events: none; }
.map-loading-spinner { width: 28px; height: 28px; flex: 0 0 auto; border: 3px solid var(--color-secondary); border-top-color: var(--color-link); border-radius: 50%; animation: map-loading-spin 0.85s linear infinite; }
@keyframes map-loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .map-loading-spinner { animation-duration: 1.8s; }
}
#map { width: 100%; height: clamp(420px, 65vh, 700px); z-index: 0; }
.map-expand { position: absolute; z-index: 2; top: 0.65rem; left: 0.65rem; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.75rem; padding: 0.5rem 0.75rem; color: var(--color-primary); background: white; border: 1px solid var(--color-secondary); border-radius: var(--border-radius); box-shadow: var(--shadow-light); cursor: pointer; font: inherit; font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
.map-expand svg { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; }
.map-expand:hover, .map-menu summary:hover { border-color: var(--color-link); }
.map-expand[hidden] { display: none; }
.map-close { position: absolute; z-index: 3; top: 0.75rem; left: 0.75rem; display: grid; width: 2.75rem; height: 2.75rem; place-items: center; padding: 0; color: #fff; background: var(--color-primary); border: 1px solid #10241d; border-radius: var(--border-radius); box-shadow: var(--shadow-light); font: inherit; font-size: 1.75rem; line-height: 1; cursor: pointer; }
.map-close:hover { background: var(--color-link); }
.map-close:focus-visible { outline: 3px solid #e8ab3c; outline-offset: 3px; }
.map-close[hidden] { display: none; }
.map-guide-button { position: absolute; z-index: 3; top: 4.6rem; left: 0.65rem; display: grid; width: 2.75rem; height: 2.75rem; place-items: center; color: var(--color-primary); background: #fff; border: 1px solid var(--color-secondary); border-radius: 50%; box-shadow: var(--shadow-light); font: inherit; font-size: 1.25rem; font-weight: 750; cursor: pointer; }
.map-guide-button:hover { border-color: var(--color-link); background: #f3f7f0; }
.map-guide-button:focus-visible { outline: 3px solid #e8ab3c; outline-offset: 3px; }
.map-panel.is-expanded .map-guide-button { left: 0.75rem; }
.map-tools { position: absolute; z-index: 3; top: 7.75rem; left: 0.65rem; display: grid; gap: 0.5rem; }
.map-tool-button { display: grid; width: 2.75rem; height: 2.75rem; place-items: center; padding: 0; color: var(--color-primary); background: #fff; border: 1px solid var(--color-secondary); border-radius: var(--border-radius); box-shadow: var(--shadow-light); cursor: pointer; transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease; }
.map-tool-button svg { width: 1.35rem; height: 1.35rem; }
.map-tool-button:hover { color: var(--color-link); background: #eef5ea; border-color: var(--color-accent); }
.map-tool-button:focus-visible { outline: 3px solid #e8ab3c; outline-offset: 3px; }
.map-tool-button:disabled { cursor: not-allowed; opacity: 0.55; }
.map-tool-button.is-active { color: #fff; background: var(--color-primary); border-color: var(--color-primary); }
.map-tool-button.is-active:hover { background: var(--color-link); border-color: var(--color-link); }
.map-tool-button.is-busy svg { animation: map-tool-busy 1.1s ease-in-out infinite; }
@keyframes map-tool-busy { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.map-panel.is-expanded .map-tools { left: 0.75rem; }
@media (prefers-reduced-motion: reduce) {
    .map-tool-button { transition: none; }
    .map-tool-button.is-busy svg { animation: none; }
}
.map-location-control { position: absolute; z-index: 3; right: 0.65rem; bottom: 2.5rem; left: 0.65rem; display: flex; justify-content: flex-end; align-items: center; pointer-events: none; }
.map-location-button { position: relative; display: grid; width: 2.75rem; height: 2.75rem; flex: 0 0 auto; place-items: center; color: var(--color-primary); background: #fff; border: 1px solid var(--color-secondary); border-radius: var(--border-radius); box-shadow: var(--shadow-light); cursor: pointer; pointer-events: auto; transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; }
.map-location-button::before { position: absolute; inset: -0.35rem; content: ""; border: 2px solid var(--color-accent); border-radius: inherit; opacity: 0; pointer-events: none; }
.map-location-button svg { width: 1.35rem; height: 1.35rem; }
.map-location-button:hover { color: var(--color-link); background: #eef5ea; border-color: var(--color-accent); transform: translateY(-1px); }
.map-location-button:active { transform: none; }
.map-location-button:focus-visible { outline: 3px solid #e8ab3c; outline-offset: 3px; }
.map-location-button:disabled { cursor: wait; }
.map-location-button.is-loading::before { animation: map-location-pulse 1.4s ease-out infinite; }
.map-location-button.is-active { color: var(--color-primary); background: var(--color-secondary); border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(143, 187, 130, 0.3), var(--shadow-light); }
@keyframes map-location-pulse { from { opacity: 0.9; transform: scale(0.85); } to { opacity: 0; transform: scale(1.2); } }
.map-location-tooltip { position: absolute; top: 50%; right: 3.6rem; width: max-content; max-width: min(17rem, calc(100vw - 5.5rem)); padding: 0.6rem 0.8rem; color: #485e4c; background: #fff; border: 1px solid var(--color-secondary); border-radius: var(--border-radius); box-shadow: var(--shadow-light); font-size: 0.85rem; line-height: 1.4; opacity: 0; visibility: hidden; transform: translate(0.4rem, -50%); transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s; pointer-events: none; }
.map-location-tooltip::after { position: absolute; top: 50%; right: -0.44rem; width: 0.72rem; height: 0.72rem; content: ""; background: #fff; border-top: 1px solid var(--color-secondary); border-right: 1px solid var(--color-secondary); transform: translateY(-50%) rotate(45deg); }
.map-location-control:hover .map-location-tooltip, .map-location-control:focus-within .map-location-tooltip { opacity: 1; visibility: visible; transform: translate(0, -50%); transition-delay: 0s; }
.map-user-marker { width: 32px; height: 32px; cursor: pointer; }
.map-user-marker::before { position: absolute; inset: 0; content: ""; background: rgba(143, 187, 130, 0.45); border-radius: 50%; animation: map-user-marker-pulse 2.2s ease-out infinite; }
.map-user-marker::after { position: absolute; inset: 7px; content: ""; background: var(--color-accent); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(24, 49, 40, 0.35), 0 2px 6px rgba(10, 28, 19, 0.45); }
@keyframes map-user-marker-pulse { 0% { opacity: 0.85; transform: scale(0.35); } 70%, 100% { opacity: 0; transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) {
    .map-location-button { transition: none; }
    .map-location-button.is-loading::before, .map-user-marker::before { animation: none; }
    .map-location-tooltip { transition: none; }
}
.map-panel.is-expanded .map-location-control { left: auto; right: 0.75rem; bottom: 3.5rem; }
#map .maplibregl-ctrl-group { overflow: hidden; border: 1px solid var(--color-secondary); border-radius: var(--border-radius); box-shadow: var(--shadow-light); background: #fff; }
#map .maplibregl-ctrl-group button { width: 2.75rem; height: 2.75rem; background: #fff; }
#map .maplibregl-ctrl-group button + button { border-top: 1px solid #e3ebe0; }
#map .maplibregl-ctrl-group button:hover { background: #f3f7f0; }
#map .maplibregl-ctrl-group button:focus-visible { outline: 3px solid #e8ab3c; outline-offset: 2px; }
#map .maplibregl-ctrl-scale { padding: 2px 6px; color: var(--color-primary); background: rgba(255, 255, 255, 0.95); border: 2px solid var(--color-link); border-top: 0; border-radius: 0 0 0.3rem 0.3rem; font: 600 0.75rem/1.3 var(--font-family-system); }
#map .maplibregl-ctrl-attrib { background: rgba(255, 255, 255, 0.92); border-radius: 0.4rem; font-size: 0.72rem; }
#map .maplibregl-ctrl-attrib a { color: var(--color-link); }
.map-panel:not(.is-expanded) #map .maplibregl-ctrl-bottom-left { bottom: 0.65rem; }
.map-panel.is-expanded #map .maplibregl-ctrl-bottom-left { bottom: 4.6rem; }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; margin-top: 0.75rem; color: #485e4c; font-size: 0.8rem; }
.map-legend > span:not([hidden]) { display: inline-flex; align-items: center; gap: 0.45rem; }
.map-legend-title { color: var(--color-primary); font-weight: 700; }
.map-panel.is-expanded { position: fixed; z-index: 1000; inset: 0; width: 100%; height: 100vh; height: 100dvh; margin: 0; padding: 0; overflow: hidden; background: #e7f1e4; }
.map-panel.is-expanded .map-frame { position: absolute; inset: 0; border: 0; border-radius: 0; box-shadow: none; }
.map-panel.is-expanded #map { height: 100%; min-height: 0; }
.map-panel.is-expanded .map-controls { position: absolute; z-index: 6; top: 0.75rem; left: 4.25rem; display: grid; gap: 0.45rem; width: min(42rem, calc(100% - 8.5rem)); margin: 0; pointer-events: none; }
.map-panel.is-expanded .map-controls > * { min-width: 0; margin: 0; pointer-events: auto; }
.map-panel.is-expanded .map-search { width: 100%; max-width: none; margin: 0; }
.map-panel.is-expanded .map-search > label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; }
.map-panel.is-expanded .map-search-status:not(:empty) { padding: 0.3rem 0.55rem; background: rgba(255, 255, 255, 0.95); border-radius: 0.4rem; box-shadow: 0 1px 5px rgba(24, 49, 40, 0.18); }
.map-panel.is-expanded .map-search-results { max-height: min(50vh, 20rem); }
.map-panel.is-expanded .map-toolbar { margin: 0; }
.map-panel.is-expanded .map-menu { width: 100%; }
.map-panel.is-expanded .map-menu summary { min-height: 2.75rem; box-shadow: 0 1px 5px rgba(24, 49, 40, 0.18); }
.map-panel.is-expanded .map-menu-current { display: none; }
.map-panel.is-expanded .map-menu-content { left: 0; right: 0; width: auto; max-height: min(60vh, 32rem); box-shadow: 0 8px 24px rgba(24, 49, 40, 0.2); }
.map-panel.is-expanded .map-expand { display: none; }
.map-panel.is-expanded .map-legend { position: absolute; z-index: 2; bottom: 2.2rem; left: 0.75rem; max-width: min(42rem, calc(100% - 1.5rem)); margin: 0; padding: 0.45rem 0.65rem; gap: 0.2rem 0.75rem; background: rgba(255, 255, 255, 0.95); border: 1px solid var(--color-secondary); border-radius: var(--border-radius); box-shadow: var(--shadow-light); }
body.map-expanded { overflow: hidden; }
.map-status { margin-top: 0.75rem; color: #485e4c; font-size: 0.85rem; }
.map-status p + p { margin-top: 0.25rem; }
.map-status.error, .map-status .error, .trail-detail-content .error { color: #8d2924; font-weight: 600; }
.map-no-script { margin-top: 0.75rem; font-weight: 600; }
.maplibregl-map { font-family: var(--font-family-system); }
#map .maplibregl-cooperative-gesture-screen { display: none; }
.map-gesture-hint { position: absolute; z-index: 4; inset: 0; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(10, 28, 19, 0.42); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.2s ease, visibility 0s linear 0.2s; }
.map-gesture-hint.is-visible { opacity: 1; visibility: visible; transition-delay: 0s; }
.map-gesture-hint-card { max-width: min(34rem, calc(100% - 1.5rem)); padding: clamp(1.15rem, 4vw, 1.55rem) clamp(1.2rem, 4.5vw, 1.8rem); color: var(--color-primary); background: rgba(255, 255, 255, 0.97); border: 1px solid var(--color-secondary); border-top: 5px solid var(--color-accent); border-radius: var(--border-radius); box-shadow: var(--shadow-heavy); text-align: center; pointer-events: auto; transform: translateY(0.5rem); transition: transform 0.25s ease; }
.map-gesture-hint.is-visible .map-gesture-hint-card { transform: translateY(0); }
.map-gesture-hint-text { margin: 0; font-size: clamp(1.08rem, 2.6vw, 1.25rem); font-weight: 700; line-height: 1.4; text-wrap: balance; }
.map-gesture-hint-action { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 1rem; padding: 0.55rem 1rem; color: var(--color-primary); background: #e7f1e4; border: 1px solid var(--color-secondary); border-radius: 0.55rem; font: inherit; font-size: 0.92rem; font-weight: 700; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.map-gesture-hint-action:hover { background: #dcebd7; border-color: var(--color-link); transform: translateY(-1px); }
.map-gesture-hint-action:focus-visible { outline: 3px solid #e8ab3c; outline-offset: 3px; }
.map-gesture-hint-action svg { width: 1.05rem; height: 1.05rem; flex: 0 0 auto; }
@media (prefers-reduced-motion: reduce) {
    .map-gesture-hint,
    .map-gesture-hint-card,
    .map-gesture-hint-action { transition: none; }
}
.map-wakelock-hint .map-gesture-hint-card, .map-offline-hint .map-gesture-hint-card { position: relative; padding-top: clamp(1.6rem, 5vw, 2rem); }
.map-gesture-hint-close { position: absolute; top: 0.35rem; right: 0.35rem; display: grid; width: 2.25rem; height: 2.25rem; place-items: center; padding: 0; color: var(--color-primary); background: transparent; border: 0; border-radius: 50%; font: inherit; font-size: 1.65rem; line-height: 1; cursor: pointer; }
.map-gesture-hint-close:hover { background: #e7f1e4; }
.map-gesture-hint-close:focus-visible { outline: 3px solid #e8ab3c; outline-offset: 2px; }
.map-gesture-hint-action[hidden] { display: none; }
.maplibregl-popup-content { line-height: 1.5; }
.map-place-popup .maplibregl-popup-content { width: 300px; max-width: 100%; padding: 1.15rem 1.25rem 1.25rem; border-radius: var(--border-radius); box-shadow: var(--shadow-heavy); font-family: var(--font-family-system); }
.map-place-popup strong { display: block; padding-right: 1.75rem; color: var(--color-primary); font-size: 1.16rem; line-height: 1.25; }
.map-place-popup-type { margin-top: 0.2rem; color: var(--color-link); font-size: 0.9rem; font-weight: 700; }
.map-place-popup-poi .map-place-popup-type { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--poi-color, var(--color-link)); }
.map-place-popup-poi .map-place-popup-type::before { width: 0.3rem; height: 1rem; content: ""; background: var(--poi-color, currentColor); border-radius: 999px; }
.map-place-popup p, .map-place-popup-description { margin: 0.45rem 0 0; color: #485e4c; font-size: 0.85rem; line-height: 1.45; }
.map-place-popup-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.65rem; }
.map-place-popup-length { display: inline-flex; align-items: baseline; gap: 0.35rem; color: var(--color-primary); }
.map-place-popup-length span { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.03em; }
.map-place-popup-length small { display: inline; margin: 0; color: #485e4c; font-size: 0.82rem; font-weight: 700; }
.map-place-popup-trail::before { display: block; width: 2.5rem; height: 0.3rem; margin-bottom: 0.6rem; content: ""; background: var(--trail-color, #d83e28); border-radius: 999px; }
.map-place-popup > small { display: block; margin-top: 0.35rem; color: #586a5c; font-size: 0.78rem; line-height: 1.35; }
.map-place-popup .maplibregl-popup-close-button { top: 0.55rem; right: 0.55rem; width: 34px; height: 34px; background: transparent; border: 0; border-radius: 0.35rem; color: var(--color-primary); font: 1.5rem/1 var(--font-family-system); }
.map-place-popup .maplibregl-popup-close-button:hover { background: #e7f1e4; }
.map-place-popup .map-place-popup-button { flex: 0 0 auto; margin-top: 0; padding: 0.5rem 1.15rem; border-radius: 999px; }
.maplibregl-ctrl button:focus-visible { outline: 3px solid #e8ab3c; outline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline-color: #7a4a00; }
.map-close:focus-visible { outline-color: #ffe08a; }
.map-guide-button:focus-visible, .map-location-button:focus-visible, .map-expand:focus-visible, .map-tool-button:focus-visible, .map-menu summary:focus-visible, .map-search input:focus-visible, .map-search-results button:focus-visible, .map-style-controls input:focus-visible, .map-terrain-toggle input:focus-visible, .map-terrain-settings input:focus-visible, .map-filters input:focus-visible, .map-reset:focus-visible, .map-gesture-hint-action:focus-visible, .map-guide-actions button:focus-visible, .maplibregl-ctrl button:focus-visible, #map .maplibregl-ctrl-group button:focus-visible { outline-color: #7a4a00; }
.map-guide-dialog { position: fixed; inset: 0; width: min(440px, calc(100% - 2rem)); max-width: none; max-height: calc(100vh - 2rem); margin: auto; overflow-y: auto; padding: 0; border: 0; border-radius: 0.8rem; color: var(--color-primary); box-shadow: 0 16px 50px rgba(10, 28, 19, 0.4); }
.map-guide-dialog::backdrop { background: rgba(10, 28, 19, 0.72); }
.map-guide-panel { padding: 1.4rem; background: var(--color-background); }
.map-guide-count { margin: 0 0 0.35rem; color: #485e4c; font-size: 0.9rem; }
.map-guide-panel h2 { margin: 0; padding-bottom: 0.5rem; border: 0; font-size: 1.35rem; }
.map-guide-progress { display: block; width: 100%; height: 3px; margin: 0 0 0.65rem; appearance: none; border: 0; background: #dcebed; }
.map-guide-progress::-webkit-progress-bar { background: #dcebed; }
.map-guide-progress::-webkit-progress-value { background: var(--color-accent); transition: width 0.2s ease; }
.map-guide-progress::-moz-progress-bar { background: var(--color-accent); transition: width 0.2s ease; }
.map-guide-panel > p:not(.map-guide-count) { min-height: 3.2em; margin: 0; line-height: 1.5; }
.map-guide-actions { display: flex; justify-content: space-between; gap: 0.6rem; margin-top: 1.25rem; }
.map-guide-actions > div { display: flex; gap: 0.5rem; }
.map-guide-actions button { min-height: 2.75rem; }
.map-guide-actions button[hidden] { display: none; }
.map-guide-secondary { color: var(--color-primary); background: #e7f1e4; border: 1px solid var(--color-secondary); }
.map-guide-secondary:hover { box-shadow: none; }

.trail-list-page, .trail-detail-page { padding-top: 3rem; padding-bottom: 4rem; }
.trail-list-page h1, .trail-detail-page h1 { font-size: clamp(2rem, 4vw, 3rem); }
.trail-list-intro, .trail-detail-intro { max-width: 760px; }
.badge { display: inline-block; padding: 0.2rem 0.5rem; color: var(--color-primary); background: var(--color-accent); border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.btn-secondary { color: var(--color-primary); background: transparent; border: 2px solid var(--color-accent); }
.btn-secondary:hover { background: #e7f1e4; box-shadow: none; }
.trail-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
.trail-list-card { display: flex; flex-direction: column; overflow: hidden; background: white; border: 1px solid var(--color-secondary); border-radius: var(--border-radius); box-shadow: var(--shadow-light); }
.trail-card-visual { position: relative; flex: 0 0 auto; aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(145deg, #dcebd7, #f5f8f2 55%, #e7f1e4); }
.trail-card-visual svg { display: block; width: 100%; height: 100%; }
.trail-preview-contour { fill: none; stroke: #c9dfbf; stroke-width: 1.2; opacity: 0.7; }
.trail-preview-line-halo { fill: none; stroke: #ffffff; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; opacity: 0.9; }
.trail-preview-line { fill: none; stroke: #d83e28; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.trail-preview-start { fill: #267a4a; stroke: #ffffff; stroke-width: 2; }
.trail-preview-finish { fill: #bd3528; stroke: #ffffff; stroke-width: 2; }
.trail-list-body { display: flex; flex: 1; flex-direction: column; padding: 1.25rem; }
.trail-list-body .badge { align-self: flex-start; }
.trail-list-body h2 { margin: 0.75rem 0 0.35rem; padding: 0; border: 0; font-size: 1.2rem; line-height: 1.25; }
.trail-list-area { margin: 0 0 0.5rem; color: #485e4c; font-size: 0.82rem; font-weight: 600; }
.trail-list-summary { margin: 0 0 0.65rem; color: #586a5c; font-size: 0.9rem; }
.trail-list-description { margin: 0 0 0.65rem; color: #485e4c; font-size: 0.88rem; line-height: 1.45; }
.trail-card-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: auto; padding-top: 0.35rem; }
.trail-card-actions .btn { margin-top: 0; }
@media (min-width: 900px) {
    .trail-card-grid { grid-template-columns: repeat(3, minmax(0, 370px)); gap: 1.5rem; }
}
@media (max-width: 600px) {
    .trail-card-grid { gap: 0.75rem; }
    .trail-list-body { padding: 0.75rem; overflow-wrap: anywhere; }
    .trail-list-body h2 { font-size: 1.05rem; }
    .trail-list-area, .trail-list-description { display: none; }
    .trail-list-summary { font-size: 0.8rem; }
    .trail-card-actions { flex-direction: column; }
    .trail-card-actions .btn { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: center; padding: 0.55rem 0.4rem; font-size: 0.85rem; line-height: 1.2; text-align: center; }
}
@media (max-width: 420px) {
    .trail-card-grid { grid-template-columns: 1fr; }
}
.trail-figure { min-width: 0; margin: 0; }
.trail-figure .trail-card-visual { border: 1px solid var(--color-secondary); border-radius: var(--border-radius); }
.trail-elevation { display: grid; place-items: center; }
.trail-elevation-empty { margin: 0; padding: 1.25rem; color: #485e4c; font-size: 0.85rem; line-height: 1.5; text-align: center; }
.trail-figure figcaption { margin-top: 0.45rem; color: #485e4c; font-size: 0.8rem; line-height: 1.4; }
.trail-figure figcaption strong { color: var(--color-primary); }
.trail-elevation-label { fill: #586a5c; font-family: var(--font-family-system); font-size: 12px; font-weight: 600; }
.trail-elevation-grid { stroke: #c9dfbf; stroke-width: 1; stroke-dasharray: 4 4; }
.trail-elevation-area { fill: rgba(143, 187, 130, 0.3); }
.trail-elevation-line { fill: none; stroke: var(--color-link); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.trail-elevation-start { fill: #267a4a; stroke: #fff; stroke-width: 2; }
.trail-elevation-finish { fill: #bd3528; stroke: #fff; stroke-width: 2; }
.trail-detail-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
@media (max-width: 760px) {
    .map-page { padding-top: 1.5rem; padding-bottom: 3rem; }
    .trail-list-page, .trail-detail-page { padding-top: 2rem; padding-bottom: 3rem; }
    #map { height: 55vh; min-height: 340px; }
    .map-menu-current { display: none; }
    .map-panel:not(.is-expanded) .map-controls { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.65rem; }
    .map-panel:not(.is-expanded) .map-toolbar { position: static; width: 100%; margin: 0; }
    .map-panel:not(.is-expanded) .map-menu { width: 100%; }
    .map-panel:not(.is-expanded) .map-menu summary { min-height: 2.75rem; }
    .map-panel:not(.is-expanded) .map-menu-content { right: auto; left: 0; width: 100%; }
    .map-expand span { display: none; }
    .map-expand { width: 2.75rem; }
    .map-expand svg { width: 1.3rem; height: 1.3rem; }
    .map-panel.is-expanded .map-controls { left: 3.75rem; width: calc(100% - 7.5rem); }
    .map-panel.is-expanded .map-search-results { max-height: 45vh; }
    .map-panel.is-expanded .map-menu-content { right: 0; left: 0; width: auto; max-height: min(55vh, 24rem); }
    .map-panel.is-expanded .map-legend { bottom: 3.25rem; max-width: calc(100% - 4.5rem); }
    .map-panel.is-expanded #map .maplibregl-ctrl-bottom-left { bottom: 6.5rem; }
    .map-panel.is-expanded .map-location-control { bottom: 6.5rem; }
    .map-panel.is-expanded .map-search-row button { padding: 0.55rem 0.7rem; }
    .map-panel.is-expanded .map-search-row button span { display: none; }
    .map-panel.is-expanded .map-search-row button svg { width: 1.25rem; height: 1.25rem; }
}
@media (max-width: 360px) {
    .map-page h1 { font-size: 1.65rem; }
    .map-panel:not(.is-expanded) .map-search-row button { padding: 0.55rem 0.7rem; }
    .map-panel:not(.is-expanded) .map-search-row button span { display: none; }
}


.trail-back-link { display: inline-block; margin-bottom: 0.75rem; color: var(--color-link); font-size: 0.9rem; font-weight: 600; text-decoration: none; }
.trail-back-link:hover { text-decoration: underline; }
.trail-hero { display: grid; gap: 1.5rem; align-items: center; margin-top: 0.5rem; padding: clamp(1.15rem, 4vw, 2rem); background: linear-gradient(145deg, #fff 0%, #eef5ea 100%); border: 1px solid var(--color-secondary); border-top: 5px solid var(--color-accent); border-radius: var(--border-radius); box-shadow: var(--shadow-light); }
.trail-hero-content { min-width: 0; }
.trail-hero h1 { margin-bottom: 0.35rem; font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.15; overflow-wrap: anywhere; }
.trail-hero .trail-detail-intro { margin: 0; color: #485e4c; font-size: 0.95rem; }
.trail-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.8rem; }
.trail-hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.15rem; }
.trail-hero-actions .btn { min-height: 44px; }
.trail-hero-note { margin-top: 0.9rem; color: #586a5c; font-size: 0.8rem; line-height: 1.45; }
.trail-hero-note a { font-weight: 600; }
.trail-hero-figure { min-width: 0; }
.trail-hero-figure .trail-figure { margin: 0; }
.trail-hero-figure .trail-card-visual { border: 1px solid var(--color-secondary); border-radius: var(--border-radius); }
.trail-detail-body { max-width: 1040px; margin-top: 2.25rem; }
.trail-section { margin-top: 2rem; }
.trail-section h2, .trail-panel h2 { margin: 0 0 0.85rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--color-secondary); font-size: 1.45rem; }
.trail-prose { max-width: 860px; color: #3f5244; font-size: 1.05rem; line-height: 1.7; }
.trail-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; margin: 0; }
.trail-fact { padding: 0.95rem 1.05rem; background: #fff; border: 1px solid var(--color-secondary); border-radius: var(--border-radius); box-shadow: var(--shadow-light); }
.trail-fact dt { color: #586a5c; font-size: 0.8rem; font-weight: 700; }
.trail-fact dd { margin: 0.2rem 0 0; color: var(--color-primary); font-size: 1.2rem; font-weight: 750; line-height: 1.3; }
.trail-fact dd small { display: block; margin-top: 0.25rem; color: #586a5c; font-size: 0.76rem; font-weight: 400; line-height: 1.4; }
.trail-detail-columns { display: grid; gap: 1.25rem; margin-top: 2rem; }
.trail-panel { padding: 1.3rem; background: #fff; border: 1px solid var(--color-secondary); border-top: 4px solid var(--color-accent); border-radius: var(--border-radius); box-shadow: var(--shadow-light); font-size: 1rem; }
.trail-access-list { display: grid; grid-template-columns: minmax(6.5rem, auto) 1fr; gap: 0.4rem 0.8rem; margin: 0; }
.trail-access-list dt { color: #586a5c; font-size: 0.9rem; font-weight: 600; }
.trail-access-list dd { margin: 0; font-size: 1.02rem; font-weight: 600; }
.trail-access-empty { color: #586a5c; font-size: 0.95rem; line-height: 1.55; }
.trail-section-link { margin-top: 0.9rem; font-size: 0.95rem; font-weight: 700; }
.trail-elevation-panel .trail-figure { margin: 0; }
.trail-elevation-panel .trail-elevation-empty { margin: 0; padding: 1.25rem; color: #586a5c; background: #f3f7f0; border-radius: var(--border-radius); font-size: 0.9rem; line-height: 1.55; }
.trail-details { margin-top: 2rem; background: #fff; border: 1px solid var(--color-secondary); border-radius: var(--border-radius); box-shadow: var(--shadow-light); }
.trail-details summary { min-height: 44px; padding: 1rem 1.3rem; color: var(--color-primary); cursor: pointer; font-size: 1rem; font-weight: 700; }
.trail-details summary:hover { background: #f3f7f0; }
.trail-details[open] summary { border-bottom: 1px solid #e3ebe0; }
.trail-details-body { padding: 1.3rem; }
.trail-tech { display: grid; grid-template-columns: minmax(7rem, auto) 1fr; gap: 0.5rem 0.8rem; margin: 0; font-size: 0.96rem; }
.trail-tech dt { color: #586a5c; font-weight: 600; }
.trail-tech dd { margin: 0; }
.trail-tech dd small { display: block; margin-top: 0.18rem; color: #586a5c; font-size: 0.8rem; line-height: 1.45; }
.trail-details-body .trail-card-sources { margin-top: 1rem; }
@media (min-width: 900px) {
    .trail-hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
    .trail-detail-columns { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 760px) {
    .trail-hero { padding: 1rem; }
    .trail-hero-actions { flex-direction: column; }
    .trail-hero-actions .btn { width: 100%; }
    .trail-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .trail-access-list, .trail-tech { grid-template-columns: 1fr; gap: 0.15rem; }
    .trail-access-list dd, .trail-tech dd { margin-bottom: 0.35rem; }
}
@media print {
    header, .site-footer, .site-menu, .skip-link, .trail-back-link, .trail-hero-actions, .trail-detail-actions { display: none !important; }
    .trail-detail-page { padding: 0; }
    .trail-hero { display: block; padding: 0; background: none; border: 0; box-shadow: none; }
    .trail-hero-figure { margin-top: 1rem; }
    .trail-panel, .trail-fact, .trail-details { box-shadow: none; break-inside: avoid; }
    .trail-detail-columns { display: block; }
    .trail-panel { margin-top: 1rem; }
    .trail-details { display: none; }
}
