.map-page {
    display: flex;
    height: calc(100vh - 64px);
    min-height: 560px;
}

.map-page--standalone {
    height: 100vh;
}

.map-page--standalone .real-map-shell {
    min-height: 100vh;
}

.map-top-bar {
    display: none;
}

.page-map .site-header {
    height: 60px;
}

.page-map main {
    min-height: 0;
    overflow: visible;
}

.page-map .map-page {
    height: calc(100vh - 60px);
}

@media (min-width: 961px) {
    .page-map .real-map-shell {
        height: calc(100vh - 60px);
    }
}

.map-list {
    z-index: 8;
    display: flex;
    flex: 0 0 380px;
    min-width: 0;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid var(--line);
}

.sheet-handle {
    display: none;
}

.map-filter {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 15px 16px 8px;
}

.map-filter .chip-cloud {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #c8bfb0 #f5f2ec;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
}

.map-filter .chip-cloud::-webkit-scrollbar {
    height: 4px;
}

.map-filter .chip-cloud::-webkit-scrollbar-track {
    background: #f5f2ec;
    border-radius: 4px;
}

.map-filter .chip-cloud::-webkit-scrollbar-thumb {
    background: #c8bfb0;
    border-radius: 4px;
}

.map-filter select {
    width: max-content;
    background: #f5f2ec;
    font-weight: 700;
}

.time-row {
    align-items: center;
}

.time-row b {
    color: #b4ab9a;
    font-size: 11px;
}

.time-row button {
    padding: 5px 10px;
    font-size: 10.5px;
}

.map-count {
    margin: 0;
    padding: 6px 16px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.map-card-list {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding: 8px 12px 16px;
}

.map-place-card {
    display: flex;
    gap: 10px;
    width: 100%;
    padding: 10px;
    text-align: left;
    border: 1.5px solid transparent;
    border-radius: 13px;
    background: #f9f7f3;
}

.map-place-card.active {
    border-color: var(--gold);
    background: #fbf3e7;
}

.map-thumb {
    display: grid;
    flex: 0 0 60px;
    height: 60px;
    place-items: center;
    border-radius: 10px;
    background: var(--sand);
    font-size: 20px;
}

.map-place-card strong,
.map-place-card small,
.map-place-card em,
.map-place-card i {
    display: block;
}

.map-place-card strong {
    font: 800 15px var(--font-head);
}

.map-place-card small {
    color: var(--muted);
    font-size: 11px;
}

.map-place-card em {
    position: relative;
    margin: 5px 0;
    padding-left: 12px;
    color: #5b5548;
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
}

.map-place-card em::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.map-place-card .is-open::before {
    background: #6e9c6e;
}

.map-place-card .is-closed::before {
    background: var(--danger);
}

.map-place-card i {
    width: max-content;
    padding: 3px 8px;
    border-radius: 7px;
    background: var(--sand);
    color: #8a6a35;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
}

.real-map-shell {
    position: relative;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    background: #dfe9df;
}

.real-map {
    position: absolute;
    inset: 0;
    z-index: 1;
    min-height: 100%;
}

.map-loading {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 500;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 8px 22px rgba(46, 42, 34, .12);
}

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

.real-map-shell .map-empty-state {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 520;
    width: min(360px, calc(100% - 32px));
    transform: translate(-50%, -50%);
}

.map-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-controls button {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .12);
}

.open-google {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 10;
    padding: 11px 16px;
    border-radius: 12px;
    background: var(--gold);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .15);
}

.map-location-prompt {
    position: absolute;
    left: 16px;
    top: 16px;
    z-index: 510;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 290px;
    padding: 14px 15px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(46, 42, 34, .16);
    animation: mapPromptIn .28s ease both;
}

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

.map-lp-icon {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 22px;
    line-height: 1;
}

.map-lp-body strong {
    display: block;
    margin-bottom: 3px;
    font-family: var(--font-head);
    font-size: 14px;
    line-height: 1.2;
}

.map-lp-body small {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.map-lp-actions {
    display: flex;
    gap: 6px;
}

.map-lp-actions button {
    padding: 7px 12px;
    border: none;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.map-lp-actions [data-prompt-allow] {
    background: var(--ink);
    color: #fff;
}

.map-lp-actions [data-prompt-skip] {
    background: var(--sand);
    color: var(--ink);
}

@keyframes mapPromptIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.leaflet-place-chip {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    padding: 4px 9px 4px 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(46, 42, 34, .22);
    white-space: nowrap;
    overflow: visible !important;
    cursor: pointer;
    border: none;
    transition: background .15s;
    width: auto !important;
    height: auto !important;
}


.leaflet-place-chip.active {
    background: var(--gold) !important;
}

.leaflet-place-chip.icon-only {
    padding: 4px;
}

.leaflet-place-chip-icon {
    display: grid;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 50% 50% 50% 0;
    background: var(--ink);
    color: #fff;
    font-size: 14px;
    transform: rotate(-45deg);
    overflow: visible;
}

.leaflet-place-chip-icon > span {
    display: inline-block;
    transform: rotate(45deg);
    line-height: 1;
}

.leaflet-place-chip.active .leaflet-place-chip-icon {
    background: rgba(255, 255, 255, 0.3);
}

.leaflet-place-chip-name {
    max-width: 130px;
    overflow: hidden;
    font-size: 11px;
    font-weight: 700;
    color: #2e2a22;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.leaflet-place-chip.active .leaflet-place-chip-name {
    color: #fff;
}

.leaflet-popup-content-wrapper {
    border-radius: 16px;
    box-shadow: 0 16px 36px rgba(46, 42, 34, .18);
}

.leaflet-place-popup {
    min-width: 190px;
    font-family: var(--font-body);
}

.leaflet-place-popup strong,
.leaflet-place-popup small,
.leaflet-place-popup span {
    display: block;
}

.leaflet-place-popup strong {
    font-family: var(--font-head);
    font-size: 18px;
    line-height: 1.1;
}

.leaflet-place-popup small {
    margin: 3px 0 8px;
    color: var(--muted);
    font-size: 12px;
}

.leaflet-place-popup span {
    width: max-content;
    margin-bottom: 10px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--sand);
    color: #8a6a35;
    font-size: 11px;
    font-weight: 800;
}

.leaflet-place-popup a {
    display: block;
    padding: 9px 10px;
    border-radius: 10px;
    background: var(--ink);
    color: #fff;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
}

.leaflet-container {
    font-family: var(--font-body);
}

.map-filter .ts-wrapper {
    min-width: 140px;
}

.map-filter .ts-wrapper.single .ts-control {
    padding: 0 14px;
    border-radius: 999px;
    font-size: 0.9em;
}

@media (max-width: 960px) {
    .map-page {
        position: relative;
    }

    .map-top-bar {
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        z-index: 25;
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 10px 12px 8px;
        border-radius: 0 0 18px 18px;
        background: #fff;
        box-shadow: 0 4px 18px rgba(46, 42, 34, .13);
    }

    .map-top-search-input {
        width: 100%;
    }

    .map-top-chips {
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        scrollbar-width: thin;
        scrollbar-color: #c8bfb0 #f5f2ec;
        padding-bottom: 6px;
    }

    .map-top-chips::-webkit-scrollbar {
        height: 3px;
    }

    .map-top-chips::-webkit-scrollbar-track {
        background: transparent;
    }

    .map-top-chips::-webkit-scrollbar-thumb {
        background: #c8bfb0;
        border-radius: 4px;
    }

    .map-location-prompt {
        top: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
    }

    .real-map-shell {
        position: relative;
        height: calc(100vh - 60px);
        overflow: hidden;
    }

    .real-map-shell .map-empty-state {
        width: calc(100% - 32px);
        padding: 20px 16px;
    }

    .real-map-shell .map-empty-state strong {
        font-size: 18px;
    }

    .real-map-shell .map-empty-state p {
        font-size: 13px;
    }

    .map-list {
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 20;
        width: auto;
        height: 92%;
        flex-basis: auto;
        overflow: hidden;
        border-radius: 22px 22px 0 0;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, .18);
        transform: translateY(calc(100% - 32px));
        transition: transform .38s cubic-bezier(.32,.72,0,1);
    }

    .map-list.mid {
        transform: translateY(52%);
    }

    .map-list.expanded {
        transform: translateY(0);
    }

    .map-list .map-filter {
        display: none;
    }

    .sheet-handle {
        display: flex;
        justify-content: center;
        padding: 9px 0 2px;
        background: transparent;
    }

    .sheet-handle span {
        width: 40px;
        height: 4px;
        border-radius: 999px;
        background: rgba(46, 42, 34, .2);
    }
}

@media (max-width: 520px) {
    .map-popup {
        width: 190px;
    }
}
