:root {
    --map-food: #a84932;
    --map-clothing: #8d5b88;
    --map-stay: #557287;
    --map-transit: #2b7771;
    --map-education: #2f5e91;
    --map-leisure: #aa7623;
    --map-family: #8b6948;
}

.map-guide {
    min-height: 100vh;
    padding: calc(var(--header-height) + 54px) 0 72px;
    color: var(--navy);
    background:
        radial-gradient(circle at 82% 8%, rgba(212, 169, 82, 0.14), transparent 30%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 42%),
        var(--paper);
}

.map-guide-shell {
    width: min(1720px, calc(100% - clamp(32px, 5vw, 96px)));
    margin: 0 auto;
}

.map-guide-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 48px;
    margin-bottom: 30px;
}

.map-guide-kicker {
    margin: 0 0 10px;
    color: #916b25;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.28em;
}

.map-guide-heading h1 {
    margin: 0;
    font-family: var(--display-font);
    font-size: clamp(3.4rem, 5.4vw, 5.8rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1;
}

.map-guide-heading > div:first-child > p:last-child {
    max-width: 680px;
    margin: 18px 0 0;
    color: #52666b;
    line-height: 1.8;
}

.map-guide-count {
    display: grid;
    min-width: 178px;
    justify-items: end;
    padding: 0 0 8px 24px;
    border-left: 1px solid rgba(16, 37, 45, 0.2);
}

.map-guide-count strong {
    font-family: var(--display-font);
    font-size: clamp(2.75rem, 4vw, 4.3rem);
    line-height: 0.9;
}

.map-guide-count span {
    margin-top: 10px;
    color: #6a5a35;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.map-routes {
    margin: 0 0 30px;
}

.map-routes-heading {
    display: grid;
    grid-template-columns: minmax(360px, 0.92fr) minmax(420px, 1.08fr);
    gap: clamp(32px, 7vw, 110px);
    align-items: end;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(16, 37, 45, 0.22);
}

.map-routes-heading > div > p {
    margin: 0 0 7px;
    color: #966f28;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.2em;
}

.map-routes-heading h2 {
    margin: 0;
    font-family: var(--display-font);
    font-size: clamp(1.75rem, 3vw, 2.7rem);
    letter-spacing: 0.06em;
}

.map-routes-heading > p {
    max-width: 720px;
    margin: 0;
    color: #576a6e;
    font-size: 0.84rem;
    line-height: 1.75;
}

.map-route-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.map-route-card {
    --route-accent: #a87a27;
    --route-tint: #f0dfb7;
    position: relative;
    display: flex;
    min-height: 340px;
    flex-direction: column;
    overflow: hidden;
    padding: 20px 22px 18px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.2), transparent 54%),
        var(--route-tint);
    border-top: 5px solid var(--route-accent);
    box-shadow: inset 0 0 0 1px rgba(17, 43, 48, 0.16);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.map-route-card:hover {
    z-index: 1;
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(25, 42, 46, 0.15), inset 0 0 0 1px rgba(17, 43, 48, 0.2);
}

.map-route-art {
    --route-accent: #315f86;
    --route-tint: #dbe5e8;
}

.map-route-maokong {
    --route-accent: #397268;
    --route-tint: #dce6d8;
}

.map-route-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-right: 76px;
    color: #344c52;
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.map-route-card-top span:last-child {
    color: var(--route-accent);
    letter-spacing: 0.05em;
}

.map-route-emblem {
    position: absolute;
    top: 17px;
    right: 20px;
    display: grid;
    width: 56px;
    height: 56px;
    color: #fffdf8;
    background: var(--route-accent);
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(255, 253, 248, 0.45);
    place-items: center;
}

.map-route-emblem::after {
    position: absolute;
    width: 76px;
    height: 76px;
    border: 1px solid var(--route-accent);
    border-radius: 50%;
    content: "";
    opacity: 0.42;
}

.map-route-emblem span {
    font-family: var(--display-font);
    font-size: 1.45rem;
    font-weight: 900;
}

.map-route-card h3 {
    max-width: calc(100% - 56px);
    margin: 38px 0 8px;
    font-family: var(--display-font);
    font-size: clamp(1.45rem, 2vw, 2.05rem);
    line-height: 1.15;
}

.map-route-card > p {
    min-height: 3.8em;
    margin: 0 0 15px;
    color: #455b60;
    font-size: 0.78rem;
    line-height: 1.65;
}

.map-route-card ol {
    display: grid;
    gap: 8px;
    margin: auto 0 15px;
    padding: 0;
    list-style: none;
}

.map-route-card li {
    display: flex;
    min-height: 27px;
    align-items: center;
    gap: 10px;
    color: #1b363d;
    font-size: 0.76rem;
    font-weight: 700;
}

.map-route-card li span {
    color: var(--route-accent);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
}

.map-route-card button {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    padding: 9px 13px;
    color: #fffdf8;
    background: #173139;
    border: 1px solid #173139;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.map-route-card button:hover,
.map-route-card button:focus-visible,
.map-route-card button[aria-pressed="true"] {
    color: #173139;
    background: #fffdf8;
    outline: 3px solid rgba(49, 95, 134, 0.28);
    outline-offset: 2px;
}

.map-route-card button span {
    font-size: 1.1rem;
}

.map-filter-panel {
    position: relative;
    z-index: 3;
    padding: 18px 20px;
    color: #fffdf8;
    background: #16292f;
    border-top: 3px solid var(--gold);
    box-shadow: 0 18px 48px rgba(17, 31, 35, 0.18);
}

.map-filter-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.65fr) repeat(2, minmax(150px, 0.65fr)) auto;
    gap: 12px;
    align-items: end;
}

.map-field {
    display: grid;
    gap: 6px;
}

.map-field label {
    color: #d9c99f;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.map-field input,
.map-field select {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    color: #15292f;
    background: #fffdf8;
    border: 1px solid transparent;
    border-radius: 0;
}

.map-field input:focus,
.map-field select:focus {
    border-color: var(--gold);
    outline: 3px solid rgba(212, 169, 82, 0.3);
}

.map-clear {
    min-height: 44px;
    padding: 8px 20px;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.42);
}

.map-clear:hover,
.map-clear:focus-visible {
    color: #18292e;
    background: var(--gold);
    border-color: var(--gold);
}

.map-category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
}

.map-category-list button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    color: rgba(255, 255, 255, 0.82);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.map-category-list button span {
    display: grid;
    width: 22px;
    height: 22px;
    color: #17282e;
    background: #d8b45f;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 800;
    place-items: center;
}

.map-category-list button[aria-pressed="true"] {
    color: #17282e;
    background: #f5e9c9;
    border-color: #f5e9c9;
}

.map-view-switch {
    display: none;
}

.map-results-status {
    min-height: 24px;
    margin: 18px 0 10px;
    color: #56686c;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.map-explorer {
    display: grid;
    min-height: 650px;
    grid-template-columns: minmax(360px, 0.72fr) minmax(620px, 1.28fr);
    overflow: hidden;
    background: #fffdf8;
    border: 1px solid rgba(16, 37, 45, 0.16);
    box-shadow: 0 26px 80px rgba(31, 43, 45, 0.13);
}

.map-list-pane {
    position: relative;
    max-height: 72vh;
    min-height: 650px;
    overflow: auto;
    background:
        linear-gradient(135deg, rgba(212, 169, 82, 0.08), transparent 26%),
        #f8f5ed;
    border-right: 1px solid rgba(16, 37, 45, 0.13);
    scrollbar-color: #b9964b #e8e1d2;
    scrollbar-width: thin;
}

.map-card-list {
    display: grid;
}

.map-card {
    position: relative;
    display: grid;
    gap: 11px;
    padding: 24px 24px 22px 29px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(16, 37, 45, 0.13);
    text-align: left;
    transition: background-color 180ms ease, transform 180ms ease;
}

.map-card::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 5px;
    content: "";
    background: var(--marker-color, var(--gold));
    opacity: 0;
}

.map-card:hover,
.map-card:focus-within,
.map-card.is-selected {
    background: #fffdf8;
}

.map-card.is-selected::before {
    opacity: 1;
}

.map-card-topline,
.map-card-meta,
.map-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.map-card-topline {
    justify-content: space-between;
    gap: 8px;
}

.map-card-badge,
.map-card-district,
.map-card-representative {
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.map-card-badge {
    padding: 4px 8px;
    color: #fff;
    background: var(--marker-color, var(--gold));
}

.map-card-district {
    color: #6f613d;
}

.map-card-representative {
    color: #7b4d24;
}

.map-card h2 {
    margin: 0;
    font-family: var(--display-font);
    font-size: 1.34rem;
    font-weight: 700;
    line-height: 1.42;
}

.map-card-location {
    margin: -4px 0 0;
    color: #53676b;
    font-size: 0.82rem;
    line-height: 1.6;
}

.map-card-offer {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: #233c42;
    font-size: 0.9rem;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.map-card-meta {
    gap: 7px 14px;
    color: #6b6f69;
    font-size: 0.75rem;
    line-height: 1.55;
}

.map-card-meta span:first-child {
    color: #4a3c1f;
    font-weight: 700;
}

.map-card-note {
    margin: 0;
    padding-left: 11px;
    color: #735a24;
    border-left: 2px solid var(--gold);
    font-size: 0.75rem;
    line-height: 1.6;
}

.map-card-actions {
    gap: 9px;
    margin-top: 2px;
}

.map-card-actions button,
.map-card-actions a {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    padding: 8px 13px;
    color: #274149;
    background: rgba(23, 49, 57, 0.07);
    border: 1px solid transparent;
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
}

.map-card-actions a[data-map-navigation] {
    background: rgba(23, 49, 57, 0.12);
}

.map-card-actions button:hover,
.map-card-actions a:hover {
    color: #17282e;
    background: rgba(212, 169, 82, 0.22);
    border-color: transparent;
}

.map-card-actions button:focus-visible,
.map-card-actions a:focus-visible {
    color: #17282e;
    background: rgba(212, 169, 82, 0.22);
    border-color: transparent;
    outline: 3px solid rgba(49, 95, 134, 0.2);
    outline-offset: 2px;
}

.map-empty {
    padding: 64px 34px;
    text-align: center;
}

.map-empty strong {
    font-family: var(--display-font);
    font-size: 1.5rem;
}

.map-empty p {
    margin: 16px auto 24px;
    color: #5f7073;
    line-height: 1.8;
}

.map-empty a {
    color: #17333b;
    font-weight: 700;
}

.map-canvas-pane {
    position: relative;
    min-width: 0;
    min-height: 650px;
    background: #d8ddd6;
}

.map-canvas {
    width: 100%;
    height: 100%;
    min-height: 650px;
}

.map-unavailable {
    position: absolute;
    z-index: 600;
    inset: auto 20px 48px;
    display: grid;
    padding: 15px 18px;
    color: #fff;
    background: rgba(20, 39, 46, 0.94);
    border-left: 4px solid var(--gold);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

.map-unavailable[hidden] {
    display: none;
}

.map-unavailable span {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.78rem;
}

.map-source-note {
    position: absolute;
    z-index: 500;
    right: 10px;
    bottom: 8px;
    padding: 3px 7px;
    color: #273b40;
    background: rgba(255, 253, 248, 0.86);
    font-size: 0.62rem;
    pointer-events: none;
}

.map-no-script {
    margin-top: 20px;
    padding: 16px;
    color: #fff;
    background: #7b3a2c;
}

.map-marker {
    --marker-color: var(--gold);
    position: relative;
    display: grid;
    width: 38px;
    height: 38px;
    color: #fff;
    background: var(--marker-color);
    border: 3px solid #fffdf8;
    border-radius: 50% 50% 50% 8px;
    box-shadow: 0 5px 14px rgba(19, 37, 43, 0.35);
    font-size: 0.76rem;
    font-weight: 900;
    transform: rotate(-45deg);
    place-items: center;
}

.map-marker span {
    transform: rotate(45deg);
}

.map-category-food { --marker-color: var(--map-food); }
.map-category-clothing { --marker-color: var(--map-clothing); }
.map-category-stay { --marker-color: var(--map-stay); }
.map-category-transit { --marker-color: var(--map-transit); }
.map-category-education { --marker-color: var(--map-education); }
.map-category-leisure { --marker-color: var(--map-leisure); }
.map-category-family { --marker-color: var(--map-family); }

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background: rgba(212, 169, 82, 0.32);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    color: #fff;
    background: #17323a;
    font-family: var(--body-font);
    font-weight: 800;
}

.leaflet-popup-content-wrapper {
    color: #173139;
    border-radius: 0;
    box-shadow: 0 12px 36px rgba(15, 31, 36, 0.24);
}

.leaflet-popup-content {
    width: min(290px, 66vw) !important;
    margin: 17px 18px;
}

.map-popup-kicker {
    color: #8a6725;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.map-popup-title {
    margin: 7px 0 8px;
    font-family: var(--display-font);
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.4;
}

.map-popup-address {
    margin: 0;
    color: #5b6c70;
    font-size: 0.77rem;
    line-height: 1.55;
}

.map-popup-link {
    display: inline-block;
    margin-top: 12px;
    color: #173139;
    font-weight: 800;
}

.leaflet-control-attribution {
    padding: 2px 5px !important;
    color: #34494e;
    background: rgba(255, 253, 248, 0.86) !important;
    font-size: 9px !important;
}

@media (max-width: 991.98px) {
    .map-guide {
        padding-top: calc(var(--header-height) + 36px);
    }

    .map-guide-heading {
        align-items: start;
    }

    .map-routes-heading {
        grid-template-columns: minmax(290px, 0.9fr) minmax(350px, 1.1fr);
        gap: 34px;
    }

    .map-route-card {
        padding-inline: 18px;
    }

    .map-route-card h3 {
        font-size: 1.45rem;
    }

    .map-filter-row {
        grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(130px, 0.8fr));
    }

    .map-clear {
        grid-column: 3;
        justify-self: end;
    }

    .map-explorer {
        grid-template-columns: minmax(310px, 0.82fr) minmax(430px, 1.18fr);
    }
}

@media (max-width: 767.98px) {
    .map-guide {
        padding: calc(var(--header-height) + 30px) 0 40px;
    }

    .map-guide-shell {
        width: min(100% - 24px, 680px);
    }

    .map-guide-heading {
        gap: 18px;
        margin-bottom: 22px;
    }

    .map-guide-heading h1 {
        font-size: clamp(3.35rem, 18vw, 5.2rem);
    }

    .map-guide-heading > div:first-child > p:last-child {
        margin-top: 12px;
        font-size: 0.88rem;
    }

    .map-guide-count {
        min-width: 74px;
        padding-left: 12px;
    }

    .map-guide-count strong {
        font-size: 2.8rem;
    }

    .map-guide-count span {
        font-size: 0.57rem;
        letter-spacing: 0.05em;
        text-align: right;
    }

    .map-routes {
        margin-bottom: 24px;
    }

    .map-routes-heading {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 12px;
    }

    .map-routes-heading > p {
        font-size: 0.76rem;
    }

    .map-route-grid {
        grid-template-columns: none;
        grid-auto-columns: min(82vw, 320px);
        grid-auto-flow: column;
        overflow-x: auto;
        padding: 2px 2px 12px;
        scroll-padding-left: 2px;
        scroll-snap-type: x mandatory;
        scrollbar-color: #ad8a43 #e9e1d2;
        scrollbar-width: thin;
    }

    .map-route-card {
        min-height: 330px;
        scroll-snap-align: start;
    }

    .map-filter-panel {
        padding: 14px;
    }

    .map-filter-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .map-search-field {
        grid-column: 1 / -1;
    }

    .map-clear {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    .map-category-list {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }

    .map-category-list button {
        justify-content: center;
        padding-inline: 5px;
        font-size: 0.72rem;
    }

    .map-category-list button span {
        display: none;
    }

    .map-view-switch {
        display: grid;
        grid-template-columns: 1fr 1fr;
        margin-top: 12px;
        border: 1px solid #173139;
    }

    .map-view-switch button {
        min-height: 44px;
        color: #173139;
        background: transparent;
        border: 0;
        font-weight: 800;
    }

    .map-view-switch button[aria-pressed="true"] {
        color: #fff;
        background: #173139;
    }

    .map-results-status {
        margin-top: 12px;
    }

    .map-explorer {
        display: block;
        min-height: 0;
    }

    .map-list-pane,
    .map-canvas-pane,
    .map-canvas {
        min-height: 56svh;
        max-height: none;
    }

    .map-explorer.is-map-view .map-list-pane,
    .map-explorer.is-list-view .map-canvas-pane {
        display: none;
    }

    .map-card {
        padding: 22px 20px 20px 25px;
    }
}

@media (max-width: 389.98px) {
    .map-guide-heading {
        display: block;
    }

    .map-guide-count {
        display: flex;
        align-items: baseline;
        justify-content: flex-start;
        gap: 8px;
        margin-top: 18px;
        padding: 0;
        border: 0;
    }

    .map-guide-count strong {
        font-size: 2.2rem;
    }

    .map-category-list {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* 地圖頁減法整理：以排版與留白取代層層卡片。 */
.map-route-grid { gap: 0; }

.map-route-card {
    min-height: 310px;
    padding: 20px clamp(22px, 2.4vw, 40px) 14px;
    background: transparent;
    border: 0;
    box-shadow: none;
    transition: background-color 180ms ease;
}
.map-route-card:hover {
    z-index: auto;
    background: rgba(255, 253, 248, 0.34);
    box-shadow: none;
    transform: none;
}
.map-route-card + .map-route-card { border-left: 1px solid rgba(16, 37, 45, 0.18); }
.map-route-card-top { padding-right: 0; }
.map-route-emblem { display: none; }
.map-route-card h3 { max-width: none; margin-top: 28px; }
.map-route-card button {
    justify-content: flex-start;
    gap: 10px;
    width: fit-content;
    padding: 8px 0 6px;
    color: #173139;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(23, 49, 57, 0.45);
}
.map-route-card button:hover,
.map-route-card button:focus-visible,
.map-route-card button[aria-pressed="true"] {
    color: #173139;
    background: transparent;
    border-color: var(--route-accent);
    outline-color: rgba(49, 95, 134, 0.2);
}
.map-filter-panel {
    padding: 22px 0 20px;
    color: #173139;
    background: transparent;
    border-top: 1px solid rgba(16, 37, 45, 0.22);
    border-bottom: 1px solid rgba(16, 37, 45, 0.22);
    box-shadow: none;
}
.map-field label { color: #6d5a31; }
.map-field input,
.map-field select {
    background: rgba(255, 253, 248, 0.48);
    border: 0;
    border-bottom: 1px solid rgba(16, 37, 45, 0.42);
}
.map-clear {
    padding-inline: 4px;
    color: #173139;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(23, 49, 57, 0.42);
}
.map-clear:hover,
.map-clear:focus-visible {
    color: #18292e;
    background: rgba(212, 169, 82, 0.16);
    border-color: var(--gold);
}
.map-category-list { gap: 4px 20px; }
.map-category-list button {
    gap: 6px;
    padding: 7px 0 6px;
    color: #52666b;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
}
.map-category-list button span {
    display: inline;
    width: auto;
    height: auto;
    color: #9a7227;
    background: transparent;
    border-radius: 0;
}
.map-category-list button[aria-pressed="true"] {
    color: #17282e;
    background: transparent;
    border-color: var(--gold);
}
.map-explorer {
    gap: 12px;
    background: transparent;
    border: 0;
    box-shadow: none;
}
.map-list-pane { border: 1px solid rgba(16, 37, 45, 0.13); }
.map-card::before,
.map-card.is-selected::before { width: 0; opacity: 0; }
.map-card-badge {
    padding: 0;
    color: var(--marker-color, #8a6725);
    background: transparent;
}
@media (max-width: 767.98px) {
    .map-route-grid { padding-inline: 0; }
    .map-route-card { min-height: 310px; padding-inline: 18px; }
    .map-filter-panel { padding: 18px 0; }
    .map-category-list { column-gap: 10px; }
    .map-category-list button { padding-inline: 0; }
}

/* 地圖頁觸控範圍 */
.map-route-card button,
.map-category-list button { min-height: 44px; }

/* 手機頁名保持完整 */
@media (max-width: 767.98px) {
    .map-guide-heading h1 {
        font-size: clamp(2.85rem, 14vw, 4.2rem);
        letter-spacing: 0.04em;
        white-space: nowrap;
    }
}


/* 主題路線收合 */
.map-routes {
    margin-bottom: 18px;
}

.map-routes-heading {
    grid-template-columns: minmax(330px, 0.8fr) minmax(420px, 1fr) auto;
    align-items: center;
    gap: clamp(24px, 4vw, 68px);
    margin-bottom: 0;
    padding: 17px 0;
    border-top: 1px solid rgba(16, 37, 45, 0.22);
}

.map-routes-toggle {
    grid-column: 3;
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-width: 184px;
    padding: 9px 13px;
    color: #173139;
    background: rgba(255, 253, 248, 0.55);
    border: 1px solid rgba(23, 49, 57, 0.5);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.map-routes-toggle:hover,
.map-routes-toggle:focus-visible,
.map-routes-toggle[aria-expanded="true"] {
    background: #173139;
    color: #fffdf8;
    border-color: #173139;
}

.map-routes-toggle [data-map-routes-label] {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-routes-toggle [data-map-routes-icon] {
    flex: 0 0 auto;
    font-size: 1.1rem;
    line-height: 1;
}

.map-route-grid[hidden] {
    display: none;
}

.map-routes.is-open .map-route-grid {
    padding-top: 18px;
}

.map-results-status {
    scroll-margin-top: calc(var(--header-height) + 18px);
}

@media (max-width: 991.98px) {
    .map-routes-heading {
        grid-template-columns: minmax(270px, 0.85fr) minmax(300px, 1fr) auto;
        gap: 20px;
    }

    .map-routes-toggle {
        min-width: 150px;
    }
}

@media (max-width: 767.98px) {
    .map-routes-heading {
        grid-template-columns: minmax(0, 1fr) minmax(126px, 0.58fr);
        gap: 9px 14px;
        padding-block: 14px;
    }

    .map-routes-heading > p {
        grid-column: 1 / -1;
    }

    .map-routes-toggle {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        width: 100%;
    }

    .map-routes.is-open .map-route-grid {
        padding-top: 12px;
    }
}


/* 搜尋工具操作帶 */
.map-filter-panel {
    padding: 20px 22px 18px;
    background: #dfe5e2;
    border: 0;
    box-shadow:
        inset 0 1px rgba(255, 255, 255, 0.58),
        inset 0 -1px rgba(16, 37, 45, 0.12);
}

.map-field label {
    color: #4f5c53;
}

.map-field input,
.map-field select {
    background: rgba(255, 253, 248, 0.82);
    border-bottom-color: rgba(16, 37, 45, 0.38);
}

.map-clear {
    border-bottom-color: rgba(23, 49, 57, 0.38);
}

@media (max-width: 767.98px) {
    .map-filter-panel {
        padding: 16px 14px 15px;
    }
}


/* 柔和路線色塊 */
.map-route-grid {
    gap: 12px;
}

.map-route-card {
    background: rgba(214, 185, 117, 0.16);
}

.map-route-card.map-route-art {
    background: rgba(151, 179, 194, 0.17);
}

.map-route-card.map-route-maokong {
    background: rgba(135, 171, 155, 0.17);
}

.map-route-card + .map-route-card {
    border-left: 0;
}

.map-route-card:hover {
    background: rgba(214, 185, 117, 0.24);
}

.map-route-card.map-route-art:hover {
    background: rgba(151, 179, 194, 0.25);
}

.map-route-card.map-route-maokong:hover {
    background: rgba(135, 171, 155, 0.25);
}

.map-route-card button {
    padding: 9px 13px;
    background: rgba(23, 49, 57, 0.08);
    border: 0;
}

.map-route-card button:hover,
.map-route-card button[aria-pressed="true"] {
    background: rgba(23, 49, 57, 0.14);
    outline: 0;
}

.map-route-card button:focus-visible {
    background: rgba(23, 49, 57, 0.14);
    outline: 3px solid rgba(49, 95, 134, 0.2);
    outline-offset: 2px;
}


/* 選路時聚焦單一操作 */
.map-guide.is-route-picker-open .map-filter-panel {
    display: none;
}


/* 搜尋與推薦路線模式切換 */
.map-routes[hidden] {
    display: none;
}

.map-routes-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
}

.map-routes-heading h2 {
    font-size: clamp(1.65rem, 2.4vw, 2.25rem);
}

.map-routes-close {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 9px 13px;
    color: #274149;
    background: rgba(23, 49, 57, 0.08);
    border: 0;
    font-size: 0.76rem;
    font-weight: 800;
}

.map-routes-close:hover,
.map-routes-close:focus-visible {
    background: rgba(23, 49, 57, 0.14);
}

.map-routes-close:focus-visible {
    outline: 3px solid rgba(49, 95, 134, 0.2);
    outline-offset: 2px;
}

.map-filter-actions {
    display: flex;
    align-items: end;
    gap: 8px;
}

.map-filter-actions .map-routes-toggle {
    grid-column: auto;
    min-width: 148px;
    color: #274149;
    background: rgba(23, 49, 57, 0.08);
    border: 0;
}

.map-filter-actions .map-routes-toggle:hover,
.map-filter-actions .map-routes-toggle:focus-visible {
    color: #274149;
    background: rgba(23, 49, 57, 0.14);
    border-color: transparent;
}

.map-filter-actions .map-routes-toggle:focus-visible {
    outline: 3px solid rgba(49, 95, 134, 0.2);
    outline-offset: 2px;
}

@media (max-width: 991.98px) {
    .map-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media (max-width: 767.98px) {
    .map-routes-heading {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .map-filter-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .map-filter-actions .map-clear,
    .map-filter-actions .map-routes-toggle {
        grid-column: auto;
        width: 100%;
        min-width: 0;
        justify-self: stretch;
    }
}
