/**
 * 地圖找店（view=map）
 *
 * 版面：桌機＝左側卡片清單＋右側地圖；手機＝全螢幕地圖＋可拖曳三段的底部清單。
 * 外觀一律跟隨主題變數（--card / --fg / --line / --accent），
 * 讓 dcinside／default 兩種外觀都不會破版。
 */

/* ---------------------------------------------------------------- 檢視切換 */

.home-view-switch {
    display: flex;
    width: fit-content;
    gap: 2px;
    margin: -2px 0 10px auto;
    padding: 3px;
    background: color-mix(in srgb, var(--fg) 5%, transparent);
    border: 1px solid color-mix(in srgb, var(--fg) 9%, transparent);
    border-radius: 999px;
}

.home-view-switch__btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--muted);
    text-decoration: none;
    border-radius: 999px;
    transition: color .12s ease, background-color .12s ease, box-shadow .12s ease;
}

.home-view-switch__btn:hover {
    color: var(--fg);
    text-decoration: none;
}

.home-view-switch__btn.is-active {
    color: var(--accent);
    background: var(--card);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

.home-view-switch__icon {
    font-size: 12px;
    opacity: .85;
}

/* 讓切換器靠右 */
.fate-page-heading + .home-view-switch {
    margin-left: auto;
}

/* ---------------------------------------------------------------- 地圖模式版面 */

/*
 * 寬度刻意不覆寫：沿用各主題的 .layout-shell 寬度（default 72rem／dcinside
 * 1100px／minimal 各自設定），地圖頁才不會比站內其他頁更寬而顯得突兀。
 * 之前這裡寫死 1560px，在 1152px 的站台上會硬撐出橫向捲動的觀感。
 */
html.fate-map-mode .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

html.fate-map-mode .home-view-switch {
    margin: 0;
}

/* 地圖頁不需要的區塊（PHP 端已不輸出，這裡只是保險） */
html.fate-map-mode .hero,
html.fate-map-mode .fate-weekly-slider,
html.fate-map-mode .home-district-nav,
html.fate-map-mode .fate-mobile-filter-bar {
    display: none !important;
}

/* ---------------------------------------------------------------- 地圖頁頁首
 *
 * 地圖頁只留「地圖找店」＋範圍／店數＋檢視切換一列，
 * 不再沿用列表頁的大標題與導言，避免地圖上方留一大塊無關文字。
 */
.fate-map-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin: 2px 0 12px;
}

.fate-map-head__titles {
    min-width: 0;
}

.fate-map-head__title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .01em;
    color: var(--fg);
}

.fate-map-head__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 0;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--muted);
}

.fate-map-head__meta strong {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--fg);
}

.fate-map-head__scope {
    padding: 1px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: color-mix(in srgb, var(--accent) 78%, var(--fg));
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border-radius: 999px;
    white-space: nowrap;
}

@supports not (background: color-mix(in srgb, red 10%, transparent)) {
    .fate-map-head__scope {
        color: var(--accent);
        background: rgba(31, 111, 235, .1);
    }
}

.fate-map__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* color-mix 不支援時的退路（舊版 Android／Safari） */
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
    .home-view-switch {
        background: rgba(128, 128, 128, .12);
    }

    .fate-map-card:hover,
    .fate-map-card.is-hover {
        background: rgba(31, 111, 235, .07);
    }

    .fate-map-card.is-active {
        background: rgba(31, 111, 235, .13);
    }

    .fate-map-card__thumb--empty {
        background: rgba(128, 128, 128, .1);
    }

    .fate-map__skeleton span {
        background: rgba(128, 128, 128, .14);
    }

    .fate-map__badge {
        background: rgba(255, 255, 255, .95);
    }

    .fate-map__grip {
        background: rgba(128, 128, 128, .4);
    }
}

.fate-map {
    --fate-map-panel-w: 300px;
    --fate-map-h: calc(100dvh - 140px);
    position: relative;
    display: grid;
    /* 地圖在左、清單在右：地圖是主要操作區，先給寬度；DOM 仍是清單在前，
       由下面的 order 對調，手機版（block）不受影響。 */
    grid-template-columns: minmax(0, 1fr) minmax(248px, var(--fate-map-panel-w));
    height: var(--fate-map-h);
    min-height: 440px;
    margin: 0 0 18px;
    background: var(--card);
    border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 12px 32px rgba(0, 0, 0, .07);
    overflow: hidden;
    /* Leaflet 內部件 z-index 會外溢，建立自己的堆疊上下文 */
    isolation: isolate;
}

.fate-map__stage {
    order: 1;
}

.fate-map__panel {
    order: 2;
}

/* ---------------------------------------------------------------- 右側清單 */

.fate-map__panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    border-left: 1px solid color-mix(in srgb, var(--fg) 9%, transparent);
    background: var(--card);
}

.fate-map__panel-head {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 9px 10px;
    border-bottom: 1px solid color-mix(in srgb, var(--fg) 9%, transparent);
    background: var(--card);
}

.fate-map__panel-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

/* 手機版才會出現的拖曳把手 */
.fate-map__grip {
    display: none;
}

.fate-map__count {
    margin: 0;
    font-size: 11.5px;
    color: var(--muted);
    white-space: nowrap;
}

.fate-map__count strong {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--fg);
}

.fate-map__panel-form {
    display: grid;
    /* 縣市／行政區幾個選單都均分同寬，且剛好貼齊表頭左右邊界；
       只有一個（全台）時也自動撐滿，不會出現長度不一的情況。 */
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 6px;
    min-width: 0;
    margin: 0;
}

.fate-map__select {
    min-width: 0;
    max-width: none;
    width: 100%;
    height: 30px;
    padding: 0 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--fg);
    background: color-mix(in srgb, var(--fg) 3%, var(--card));
    border: 1px solid color-mix(in srgb, var(--fg) 14%, transparent);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .12s ease, background-color .12s ease;
}

.fate-map__select:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.fate-map__select:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 1px;
}

.fate-map__labels-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.fate-map__labels-toggle input {
    margin: 0;
    accent-color: var(--accent);
}

.fate-map__cards {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.fate-map__empty {
    padding: 28px 18px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--muted);
    text-align: center;
}

.fate-map__more {
    padding: 8px 10px;
    border-top: 1px solid color-mix(in srgb, var(--fg) 9%, transparent);
}

.fate-map__more button {
    width: 100%;
    padding: 8px 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--fg);
    background: color-mix(in srgb, var(--fg) 3%, var(--card));
    border: 1px solid color-mix(in srgb, var(--fg) 14%, transparent);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .12s ease, color .12s ease, background-color .12s ease;
}

.fate-map__more button:hover {
    border-color: color-mix(in srgb, var(--accent) 50%, transparent);
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 6%, var(--card));
}

.fate-map__more[hidden] {
    display: none;
}

/* 卡片
 *
 * 密度優先：縮圖 46px、三行文字（店名／人氣／地區）＋右側箭頭。
 * 一張卡約 56px，300px 寬的面板一屏可看到 11–12 家。
 * 評分星號與評論數已移除，改為「人氣」量表（見 fate-map.js 的 heatValue）。
 */
.fate-map-card {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 8px 7px 10px;
    border-bottom: 1px solid color-mix(in srgb, var(--fg) 7%, transparent);
    cursor: pointer;
    transition: background-color .12s ease;
}

.fate-map-card:hover,
.fate-map-card.is-hover {
    background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.fate-map-card.is-active {
    background: color-mix(in srgb, var(--accent) 11%, transparent);
    box-shadow: inset 3px 0 0 var(--accent);
}

.fate-map-card__thumb {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background: color-mix(in srgb, var(--fg) 8%, transparent);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05);
}

.fate-map-card__thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6.5px;
    letter-spacing: .04em;
    color: var(--muted);
    border: 1px dashed color-mix(in srgb, var(--fg) 18%, transparent);
    box-shadow: none;
}

.fate-map-card__body {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.fate-map-card__name {
    margin: 0;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--fg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 人氣：五格量表 + 級別文字，取代星等與評論數 */
.fate-map-card__heat {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    font-size: 10px;
    line-height: 1;
    color: var(--muted);
}

.fate-map-card__meter {
    display: inline-flex;
    gap: 2px;
}

.fate-map-card__meter i {
    display: block;
    width: 7px;
    height: 4px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--fg) 12%, transparent);
}

.fate-map-card__meter i.is-on {
    background: var(--fate-heat, var(--accent));
}

.fate-map-card__heat-label {
    font-weight: 600;
    letter-spacing: .01em;
    color: color-mix(in srgb, var(--fate-heat, var(--accent)) 72%, var(--fg));
}

.fate-map-card[data-heat="hot"] { --fate-heat: #e04a38; }
.fate-map-card[data-heat="warm"] { --fate-heat: #e07f34; }
.fate-map-card[data-heat="mild"] { --fate-heat: #c99a2e; }
.fate-map-card[data-heat="soft"] { --fate-heat: #8a94a6; }
.fate-map-card[data-heat="quiet"] { --fate-heat: #9aa3b0; }
.fate-map-card[data-heat="none"] { --fate-heat: #a6aeb9; }

.fate-map-card__area {
    margin: 0;
    font-size: 10.5px;
    line-height: 1.2;
    color: var(--muted);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.fate-map-card__chevron {
    flex: 0 0 auto;
    align-self: center;
    margin-left: -2px;
    font-size: 16px;
    line-height: 1;
    color: var(--muted);
    opacity: .38;
}

.fate-map-card:hover .fate-map-card__chevron,
.fate-map-card.is-active .fate-map-card__chevron {
    opacity: .8;
}

.fate-map__skeleton {
    display: flex;
    gap: 9px;
    padding: 9px 11px;
}

.fate-map__skeleton span {
    display: block;
    border-radius: 6px;
    background: color-mix(in srgb, var(--fg) 8%, transparent);
    animation: fate-map-pulse 1.2s ease-in-out infinite;
}

.fate-map__skeleton span:nth-child(1) { width: 52px; height: 52px; }
.fate-map__skeleton span:nth-child(2) { flex: 1; height: 36px; }

@keyframes fate-map-pulse {
    0%, 100% { opacity: .55; }
    50% { opacity: 1; }
}

/* ---------------------------------------------------------------- 地圖舞台 */

.fate-map__stage {
    position: relative;
    min-width: 0;
    min-height: 0;
    background: #dfe6ec;
}

.fate-map__canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.fate-map__badge {
    position: absolute;
    top: 12px;
    /* 左上角是 Leaflet 的縮放鈕（含 12px 邊距約 56px 寬），徽章必須讓開。 */
    left: 60px;
    z-index: 420;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 600;
    color: var(--fg);
    background: color-mix(in srgb, var(--card) 92%, transparent);
    border: 1px solid color-mix(in srgb, var(--fg) 10%, transparent);
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.fate-map__search-area {
    position: absolute;
    top: 10px;
    left: 50%;
    z-index: 421;
    transform: translateX(-50%);
}

.fate-map__search-area[hidden] {
    display: none;
}

.fate-map__search-area button {
    padding: 8px 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
    cursor: pointer;
}

.fate-map__search-area button:hover {
    filter: brightness(1.06);
}

.fate-map__geo {
    position: absolute;
    right: 12px;
    bottom: 78px;
    z-index: 421;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    line-height: 1;
    color: var(--fg);
    background: var(--card);
    border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .16);
    cursor: pointer;
    transition: color .12s ease, border-color .12s ease;
}

.fate-map__geo:hover {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}

.fate-map__geo.is-busy {
    opacity: .55;
    cursor: progress;
}

.fate-map__loading {
    position: absolute;
    left: 50%;
    bottom: 16px;
    z-index: 422;
    transform: translateX(-50%);
    padding: 7px 14px;
    font-size: 12px;
    color: #fff;
    background: rgba(20, 22, 28, .82);
    border-radius: 999px;
}

.fate-map__loading[hidden] {
    display: none;
}

.fate-map__toast {
    position: absolute;
    top: 56px;
    left: 50%;
    z-index: 423;
    transform: translateX(-50%);
    padding: 7px 14px;
    font-size: 12px;
    color: #fff;
    background: rgba(160, 40, 40, .92);
    border-radius: 8px;
}

/* ---------------------------------------------------------------- 圖釘 */

.fate-map-cluster__inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: color-mix(in srgb, var(--accent, #1f6feb) 84%, #06121f);
    border: 2px solid #fff;
    border-radius: 999px;
    box-shadow: 0 2px 9px rgba(10, 22, 40, .28);
    white-space: nowrap;
}

.fate-map-cluster--lg .fate-map-cluster__inner {
    min-width: 44px;
    height: 44px;
    font-size: 13px;
    background: color-mix(in srgb, var(--accent, #1f6feb) 72%, #06121f);
    box-shadow: 0 3px 12px rgba(10, 22, 40, .34);
}

@supports not (background: color-mix(in srgb, red 10%, transparent)) {
    .fate-map-cluster__inner {
        background: rgba(24, 60, 104, .94);
    }

    .fate-map-cluster--lg .fate-map-cluster__inner {
        background: rgba(16, 46, 84, .96);
    }
}

.fate-map-label__inner {
    display: inline-block;
    max-width: 132px;
    padding: 3px 9px;
    font-size: 11.5px;
    line-height: 1.35;
    font-weight: 600;
    color: #1c2430;
    background: #fff;
    border: 1px solid rgba(20, 30, 45, .14);
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(10, 22, 40, .16);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: box-shadow .12s ease;
}

.fate-map-label.is-active .fate-map-label__inner {
    color: #fff;
    background: var(--accent, #1f6feb);
    border-color: var(--accent, #1f6feb);
}

.fate-map-label.is-hover .fate-map-label__inner {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #1f6feb) 26%, transparent), 0 1px 4px rgba(10, 22, 40, .16);
}

.fate-map-dot {
    cursor: pointer;
}

.fate-map-dot.is-active {
    /* circleMarker 用 SVG，直接改屬性較穩；這裡只留 hover 放大 */
    stroke-width: 3;
}

/* ---------------------------------------------------------------- 彈出卡片 */

.fate-map .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .24);
}

.fate-map .leaflet-popup-content {
    margin: 0;
    width: 236px !important;
    line-height: 1.35;
}

.fate-map .leaflet-container a.leaflet-popup-close-button {
    width: 22px;
    height: 22px;
    padding: 1px 0 0;
    font-size: 15px;
    color: #fff;
    text-align: center;
    background: rgba(0, 0, 0, .3);
    border-radius: 999px;
    top: 4px;
    right: 4px;
}

/* 彈出卡：左縮圖＋右資訊，整體約 104px 高（直式封面版為 249px）。
   縮圖只做辨識用途，店家資訊仍以文字為主，地圖遮擋面積極小。 */
.fate-map-pop {
    padding: 7px 8px 8px;
}

/* Leaflet 內建的 `.leaflet-popup-content p { margin: 18px 0 }` 會替三段文字
   各加上近 30px 的上下空白（實測讓彈出卡多出 49px 高度）。此處以更高特異度歸零。 */
.fate-map .leaflet-popup-content p {
    margin: 0;
}

.fate-map-pop__top {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.fate-map-pop__thumb {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 8px;
    object-fit: cover;
    background: #e7ecf1;
}

.fate-map-pop__info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.fate-map-pop__name {
    margin: 0;
    padding-right: 14px;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.25;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 人氣：級別徽章 + 五格量表 + 數值（皆為站內換算，非圖資評分） */
.fate-map-pop__heat {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    font-size: 10px;
    line-height: 1;
    color: #6b7482;
}

.fate-map-pop__heat-badge {
    padding: 2px 6px;
    font-size: 9.5px;
    font-weight: 700;
    color: #fff;
    background: #8a94a6;
    border-radius: 999px;
}

.fate-map-pop__heat-badge[data-heat="hot"] { background: #e04a38; }
.fate-map-pop__heat-badge[data-heat="warm"] { background: #e07f34; }
.fate-map-pop__heat-badge[data-heat="mild"] { background: #c99a2e; }
.fate-map-pop__heat-badge[data-heat="soft"] { background: #8a94a6; }
.fate-map-pop__heat-badge[data-heat="quiet"] { background: #a6aeb9; }
.fate-map-pop__heat-badge[data-heat="none"] { background: #b0b7c1; }

.fate-map-pop__meter {
    display: inline-flex;
    gap: 2px;
}

.fate-map-pop__meter i {
    display: block;
    width: 7px;
    height: 4px;
    border-radius: 2px;
    background: #dde2e8;
}

.fate-map-pop__meter i.is-on {
    background: #46505f;
}

.fate-map-pop__heat-badge[data-heat="hot"] ~ .fate-map-pop__meter i.is-on { background: #e04a38; }
.fate-map-pop__heat-badge[data-heat="warm"] ~ .fate-map-pop__meter i.is-on { background: #e07f34; }
.fate-map-pop__heat-badge[data-heat="mild"] ~ .fate-map-pop__meter i.is-on { background: #c99a2e; }

.fate-map-pop__heat-val {
    margin-left: 1px;
    font-size: 9.5px;
    color: #8a929e;
}

.fate-map-pop__area {
    margin: 0;
    font-size: 10.5px;
    color: #5b6472;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fate-map-pop__actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.fate-map-pop__btn {
    flex: 1 1 auto;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 7px;
    transition: filter .12s ease, background-color .12s ease;
}

.fate-map-pop__btn--primary {
    color: #fff;
    background: var(--accent, #1f6feb);
}

.fate-map-pop__btn--ghost {
    color: #1c2430;
    background: #eef1f5;
}

.fate-map-pop__btn:hover {
    filter: brightness(.96);
    text-decoration: none;
}

/* 地圖控制項：縮小一點，避免和右側浮動按鈕打架 */
.fate-map .leaflet-control-zoom {
    margin: 12px 0 0 12px;
    border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);
    border-radius: 9px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
    overflow: hidden;
}

.fate-map .leaflet-control-zoom a {
    width: 32px;
    height: 32px;
    line-height: 32px;
    font-size: 16px;
    color: var(--fg);
    background: var(--card);
    border-bottom-color: color-mix(in srgb, var(--fg) 10%, transparent);
}

.fate-map .leaflet-control-zoom a:hover {
    background: color-mix(in srgb, var(--accent) 10%, var(--card));
    color: var(--accent);
}

.fate-map .leaflet-control-attribution {
    padding: 1px 6px;
    font-size: 10px;
    color: var(--muted);
    background: color-mix(in srgb, var(--card) 82%, transparent);
    border-radius: 6px 0 0 0;
}

/* ---------------------------------------------------------------- 手機：底部清單 */

@media (max-width: 991px) {
    .fate-map {
        display: block;
        height: var(--fate-map-h);
        min-height: 380px;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        box-shadow: none;
        margin-bottom: 0;
    }

    .fate-map__panel {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 460;
        height: 168px;
        border-left: 0;
        border-right: 0;
        border-top: 1px solid color-mix(in srgb, var(--fg) 9%, transparent);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -6px 24px rgba(0, 0, 0, .16);
        overflow: hidden;
        transition: height .2s ease;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    /* 手機版外殼是 block，舞台必須自己撐滿整個外殼，否則高度會是 0。 */
    .fate-map__stage {
        position: absolute;
        inset: 0;
    }

    .fate-map[data-sheet="drag"] .fate-map__panel {
        transition: none;
    }

    .fate-map[data-sheet="half"] .fate-map__panel {
        height: 52dvh;
    }

    .fate-map[data-sheet="full"] .fate-map__panel {
        height: calc(100% - 10px);
    }

    .fate-map__panel-head {
        gap: 6px;
        padding: 0 12px 9px;
        touch-action: none;
        cursor: grab;
    }

    .fate-map__panel-top {
        padding-top: 2px;
    }

    .fate-map__grip {
        display: block;
        flex: 0 0 auto;
        width: 44px;
        height: 4px;
        margin: 7px auto 4px;
        border-radius: 999px;
        background: color-mix(in srgb, var(--fg) 22%, transparent);
    }

    .fate-map-head {
        gap: 8px;
        margin: 6px 0 10px;
    }

    .fate-map-head__title {
        font-size: 1.12rem;
    }

    .fate-map-head__meta {
        margin-top: 3px;
    }

    .fate-map__badge {
        top: auto;
        bottom: 182px;
        left: 10px;
        transition: bottom .2s ease;
    }

    .fate-map[data-sheet="half"] .fate-map__badge,
    .fate-map[data-sheet="full"] .fate-map__badge {
        bottom: auto;
        top: 10px;
        left: 52px;
    }

    .fate-map__geo {
        bottom: 184px;
    }

    .fate-map[data-sheet="half"] .fate-map__geo,
    .fate-map[data-sheet="full"] .fate-map__geo {
        /* 半開／全開時地圖幾乎被抽屜蓋住，定位鈕沒有意義，直接收起來。 */
        display: none;
    }

    .fate-map[data-sheet="full"] .fate-map__search-area {
        /* 全開時抽屜頂端就是工具列，避免按鈕蓋住縣市選單與店名開關。 */
        display: none;
    }

    .fate-map__search-area {
        top: 8px;
        left: auto;
        right: 10px;
        transform: none;
    }

    /* 手機抽屜高度只有 132px，縮圖跟著桌面版收小，一屏才看得到近 2 家。 */
    .fate-map-card__thumb {
        width: 52px;
        height: 52px;
    }
}

@media (max-width: 991px) and (max-height: 620px) {
    .fate-map[data-sheet="half"] .fate-map__panel {
        height: 62dvh;
    }
}

/* 尊重減少動態偏好 */
@media (prefers-reduced-motion: reduce) {
    .fate-map__panel,
    .fate-map-card,
    .fate-map__badge,
    .fate-map__geo {
        transition: none !important;
    }

    .fate-map__skeleton span {
        animation: none;
    }
}
