.branch-map {
    --bm-bg: #f5f6f8;
    --bm-card: #ffffff;
    --bm-card-hover: #eceef3;
    --bm-border: #dfe2e9;
    --bm-title: #12151c;
    --bm-muted: #6a7285;
    --bm-brand: var(--sc-accent);
    --bm-map-bg: #eceef3;
    --bm-control-bg: #12151c;
    --bm-control-fg: #ffffff;
    --bm-attribution-bg: rgba(245, 246, 248, 0.8);
    background: var(--bm-bg);
    color: var(--bm-muted);
}

:root[data-sc-theme="dark"] .branch-map {
    --bm-bg: #12151c;
    --bm-card: #161a22;
    --bm-card-hover: #1f2430;
    --bm-border: #2a303d;
    --bm-title: #eef0f5;
    --bm-muted: #8e95a8;
    --bm-map-bg: #2a303d;
    --bm-control-bg: #eef0f5;
    --bm-control-fg: #0d0f14;
    --bm-attribution-bg: rgba(13, 15, 20, 0.8);
}

.branch-map__inner {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 16px;
}

@media (min-width: 640px) {
    .branch-map__inner {
        padding: 48px 24px;
    }
}

@media (min-width: 1024px) {
    .branch-map__inner {
        padding: 64px 32px;
    }
}

.branch-map__head {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@media (min-width: 1024px) {
    .branch-map__head {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }
}

.branch-map__intro {
    max-width: 672px;
}

.branch-map__title {
    margin: 0;
    color: var(--bm-title);
    font-size: 24px;
    font-weight: 700;
    line-height: 32px;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

@media (min-width: 640px) {
    .branch-map__title {
        font-size: 30px;
        line-height: 36px;
    }
}

@media (min-width: 1024px) {
    .branch-map__title {
        font-size: 36px;
        line-height: 40px;
    }
}

.branch-map__text {
    margin: 12px 0 0;
    color: var(--bm-muted);
    font-size: 16px;
    line-height: 26px;
}

.branch-map__stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
}

.branch-map__number {
    margin: 0;
    color: var(--bm-title);
    font-size: 30px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 36px;
}

.branch-map__label {
    margin: 0;
    color: var(--bm-muted);
    font-size: 14px;
    line-height: 20px;
}

.branch-map__grid {
    display: grid;
    gap: 16px;
    margin-top: 32px;
}

@media (min-width: 1024px) {
    .branch-map__grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }

    .branch-map__map {
        order: 2;
        grid-column: span 7 / span 7;
    }

    .branch-map__side {
        order: 1;
        grid-column: span 5 / span 5;
        height: 560px;
    }
}

.branch-map__map {
    position: relative;
    height: 288px;
    overflow: hidden;
    border: 1px solid var(--bm-border);
    border-radius: 16px;
    background: var(--bm-map-bg);
}

@media (min-width: 640px) {
    .branch-map__map {
        height: 384px;
    }
}

@media (min-width: 1024px) {
    .branch-map__map {
        height: 560px;
    }
}

.branch-map__map:fullscreen {
    height: 100%;
    border-radius: 0;
}

.branch-map__canvas {
    position: absolute;
    inset: 0;
}

.branch-map__tools {
    position: absolute;
    right: 10px;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

.branch-map__tools--top {
    top: 10px;
    gap: 18px;
}

.branch-map__tools--zoom {
    bottom: 32px;
    gap: 4px;
}

.branch-map__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: var(--bm-control-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    color: var(--bm-control-fg);
    cursor: pointer;
}

.branch-map__button:focus-visible {
    outline: 2px solid var(--bm-brand);
    outline-offset: 2px;
}

.branch-map__button:disabled {
    cursor: wait;
    opacity: 0.6;
}

.branch-map__attribution {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 2;
    margin: 0;
    padding: 2px 6px;
    border-top-left-radius: 6px;
    background: var(--bm-attribution-bg);
    backdrop-filter: blur(4px);
    color: var(--bm-muted);
    font-size: 10px;
    line-height: 16px;
}

.branch-map__attribution a {
    color: inherit;
    text-decoration: none;
}

.branch-map__attribution a:hover {
    color: var(--bm-title);
}

.branch-map__side {
    display: flex;
    min-height: 0;
    flex-direction: column;
}

.branch-map__list-wrap {
    position: relative;
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
}

.branch-map__list {
    display: flex;
    min-height: 0;
    max-height: 28rem;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    padding: 0 4px 40px 0;
    overflow-y: auto;
    scrollbar-width: thin;
}

@media (min-width: 1024px) {
    .branch-map__list {
        max-height: none;
    }
}

.branch-map__card {
    flex: none;
    padding: 16px;
    border: 1px solid var(--bm-border);
    border-radius: 16px;
    background: var(--bm-card);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.branch-map__card:hover,
.branch-map__card.is-active {
    background: var(--bm-card-hover);
}

.branch-map__card.is-active {
    border-color: color-mix(in srgb, var(--bm-brand) 50%, transparent);
}

.branch-map__card:focus-visible {
    outline: 2px solid var(--bm-brand);
    outline-offset: 2px;
}

.branch-map__card-body {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.branch-map__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-top: 2px;
    border-radius: 10px;
    background: var(--bm-brand);
}

.branch-map__icon img {
    width: 72%;
    height: 72%;
}

.branch-map__card-text {
    min-width: 0;
    flex: 1;
}

.branch-map__card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.branch-map__name {
    margin: 0;
    color: var(--bm-title);
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
}

.branch-map__distance {
    flex: none;
    color: var(--bm-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    line-height: 24px;
}

.branch-map__address {
    margin: 2px 0 0;
    color: var(--bm-muted);
    font-size: 14px;
    line-height: 20px;
}

.branch-map__fade {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    height: 80px;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 4px;
    background: linear-gradient(to top, var(--bm-bg) 0%, color-mix(in srgb, var(--bm-bg) 80%, transparent) 50%, transparent 100%);
    color: var(--bm-muted);
    pointer-events: none;
}

.branch-map__fade[hidden] {
    display: none;
}

.branch-map__fade svg {
    animation: branch-map-bounce 1s infinite;
}

@keyframes branch-map-bounce {
    0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
    50% { transform: none; animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
}

@media (prefers-reduced-motion: reduce) {
    .branch-map__fade svg {
        animation: none;
    }
}

.branch-map__user {
    width: 16px;
    height: 16px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    background: var(--bm-brand);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--bm-brand) 25%, transparent);
}

.branch-map__popup {
    position: absolute;
    bottom: 24px;
    left: 16px;
    z-index: 3;
    display: flex;
    width: min(300px, calc(100% - 32px));
    max-height: calc(100% - 40px);
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    overflow-y: auto;
    border: 1px solid var(--bm-border);
    border-radius: 16px;
    background: var(--bm-card);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.branch-map__popup[hidden] {
    display: none;
}

.branch-map__popup-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.branch-map__popup-name {
    flex: 1;
    min-width: 0;
    margin: 0;
    color: var(--bm-title);
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
}

.branch-map__popup-close {
    display: grid;
    flex: none;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: var(--bm-card-hover);
    color: var(--bm-muted);
    cursor: pointer;
}

.branch-map__popup-close:hover {
    color: var(--bm-title);
}

.branch-map__popup-close:focus-visible,
.branch-map__route:focus-visible {
    outline: 2px solid var(--bm-brand);
    outline-offset: 2px;
}

.branch-map__popup-address {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    color: var(--bm-title);
    font-size: 14px;
    line-height: 20px;
}

.branch-map__popup-address svg {
    flex: none;
    margin-top: 1px;
    color: var(--bm-muted);
}

.branch-map__hours {
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--bm-card-hover);
}

.branch-map__hours[hidden] {
    display: none;
}

.branch-map__hours-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    color: var(--bm-title);
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
}

.branch-map__hours-title svg {
    color: var(--bm-brand);
}

.branch-map__hours-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px 8px;
    margin: 0;
}

.branch-map__hours-list div {
    display: flex;
    gap: 8px;
    padding: 2px 6px;
    border-radius: 6px;
    color: var(--bm-muted);
    font-size: 12px;
    line-height: 18px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.branch-map__hours-list dt {
    width: 24px;
    flex: none;
}

.branch-map__hours-list dd {
    margin: 0;
}

.branch-map__hours-list .is-today {
    background: color-mix(in srgb, var(--bm-brand) 15%, transparent);
    color: var(--bm-title);
    font-weight: 600;
}

.branch-map__route {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    border-radius: 10px;
    background: var(--bm-brand);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: filter 0.2s;
}

.branch-map__route:hover {
    filter: brightness(0.92);
}

.branch-map__share {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--bm-border);
    border-radius: 10px;
    background: transparent;
    color: var(--bm-title);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.branch-map__share:hover {
    background: var(--bm-card-hover);
}

.branch-map__share:focus-visible {
    outline: 2px solid var(--bm-brand);
    outline-offset: 2px;
}

