/* Full-height map explorer. All layout overrides are scoped to this page. */
.search-portal.portal-nearby-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
.portal-nearby-page > .portal-header { flex: 0 0 auto; }
.portal-nearby-page > #portalMain { flex: 1 1 auto; min-height: 0; }
.portal-nearby-page > footer, .portal-nearby-page > nav[aria-label="모바일 하단 빠른 메뉴"], .portal-nearby-page > #portalGalleryBottom { display: none; }
.portal-nearby { height: 100%; background: #edf2f3; }
.nearby-workspace { --nearby-sidebar-width: 360px; position: relative; isolation: isolate; width: 100%; height: 100%; overflow: hidden; }
.nearby-workspace.is-streetview-wide { --nearby-sidebar-width: min(600px, 48vw); }
.nearby-map-frame, #nearbyMap { position: absolute; inset: 0; width: 100%; height: 100%; }
/* SDK tiles intentionally exceed ordinary content image bounds. */
#nearbyMap img { max-width: none; }
.nearby-search-panel { position: absolute; z-index: 4; top: 20px; left: 20px; width: min(380px, calc(100% - var(--nearby-sidebar-width) - 64px)); }
.nearby-filters { margin: 0; }
.nearby-search-field { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 18px; background: white; border: 1px solid #dce5e9; border-radius: 30px; box-shadow: 0 4px 18px #173b4a1a; }
.nearby-search-field > .portal-icon { width: 20px; color: var(--portal-muted); }
.nearby-search-field input { min-width: 0; flex: 1; width: 100%; height: 42px; padding: 6px 0; border: 0; background: transparent; font-size: 15px; outline-offset: 0; }
.nearby-search-field > button { flex-shrink: 0; min-width: 48px; height: 44px; padding: 0 12px; border: 0; border-radius: 24px; background: var(--portal-point); color: white; font-size: 13px; font-weight: 700; }
.nearby-filter-row { display: flex; gap: 7px; margin-top: 10px; align-items: center; }
.nearby-filter-row > div { min-width: 0; }
.nearby-filter-row select, .nearby-filter-row > button { max-width: 100%; height: 40px; padding: 0 11px; background: #fff; border: 1px solid #e3e9ed; border-radius: 22px; box-shadow: 0 2px 8px #173b4a12; color: var(--portal-text); font-size: 12px; font-weight: 600; }
.nearby-filter-row select { max-width: 160px; }
.nearby-filter-row > button { flex-shrink: 0; }
.nearby-location-status { margin: 10px 0 0; padding: 12px 14px; border: 1px solid #bde3de; border-radius: 12px; background: #f4fffd; color: var(--portal-point-strong); font-size: 12px; line-height: 1.6; box-shadow: 0 3px 12px #173b4a12; }
.nearby-map-message { position: absolute; z-index: 6; top: 160px; left: 20px; width: min(380px, calc(100% - 40px)); padding: 18px; border-radius: 12px; background: white; color: var(--portal-muted); box-shadow: 0 4px 18px #173b4a20; font-size: 14px; }
.nearby-sidebar { position: absolute; z-index: 5; right: 16px; top: 16px; bottom: 28px; width: var(--nearby-sidebar-width); display: flex; flex-direction: column; min-height: 0; background: #fff; border: 1px solid #dfe6ea; border-radius: 18px; box-shadow: 0 6px 28px #173b4a26; overflow: hidden; }
.nearby-results-heading { flex-shrink: 0; display: flex; justify-content: space-between; gap: 8px; padding: 20px; background: white; border-bottom: 1px solid var(--portal-line); }
.nearby-eyebrow { color: var(--portal-point); font-size: 11px; font-weight: 700; }
.nearby-results-heading .nearby-eyebrow { margin: 0 0 5px; }
.nearby-results-heading h1 { display: flex; align-items: center; gap: 8px; margin: 0 0 7px; font-size: 21px; letter-spacing: -.04em; }
.nearby-results-heading h1 span { padding: 3px 9px; border-radius: 20px; background: var(--portal-mint); color: var(--portal-point); font-size: 12px; letter-spacing: 0; white-space: nowrap; }
.nearby-results-heading [data-nearby-summary] { margin: 0; color: var(--portal-muted); font-size: 11px; }
.nearby-sheet-toggle { display: none; }
.nearby-sidebar-content { min-height: 0; flex: 1; display: flex; flex-direction: column; overflow: auto; overscroll-behavior: contain; }
.nearby-results { display: flex; flex-direction: column; flex: 1; min-height: 160px; overflow: hidden; }
.nearby-list { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 10px; background: #f7f9fb; scrollbar-width: thin; }
.nearby-result { margin-bottom: 8px; min-width: 0; padding: 0 14px 12px; border: 1px solid var(--portal-line); border-radius: 12px; background: white; transition: border-color .16s, background .16s; }
.nearby-result:last-child { margin-bottom: 0; }
.nearby-result.is-selected, .nearby-result:hover, .nearby-result:focus-within { background: #f0fcf9; border-color: #67b9af; }
.nearby-result-select { display: block; width: 100%; border: 0; padding: 14px 0 10px; text-align: left; background: transparent; }
.nearby-result-body { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 5px; }
.nearby-result-department { padding: 2px 6px; border-radius: 4px; color: var(--portal-point); background: var(--portal-mint); font-size: 10px; font-weight: 600; }
.nearby-result-name { font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.nearby-result-address { font-size: 12px; color: var(--portal-muted); line-height: 1.6; }
.nearby-distance { color: var(--portal-blue); font-size: 12px; font-weight: 700; }
.nearby-coordinate-note { color: var(--portal-muted); font-size: 11px; }
.nearby-detail-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.nearby-detail-link { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 5px 8px; border: 1px solid var(--portal-line); border-radius: 6px; font-size: 11px; background: white; }
.nearby-detail-link:hover { border-color: var(--portal-point); color: var(--portal-point); }
.nearby-more { flex-shrink: 0; display: block; width: 100%; min-height: 44px; color: var(--portal-point); background: white; border: 0; border-top: 1px solid var(--portal-line); font-size: 13px; font-weight: 700; }
.nearby-empty { padding: 24px 12px; color: var(--portal-muted); font-size: 14px; }
.nearby-empty h3 { font-size: 17px; }
.nearby-notes { flex-shrink: 0; margin: 0; padding: 10px 16px; border-top: 1px solid var(--portal-line); color: var(--portal-muted); font-size: 11px; background: #fff; }
.nearby-notes summary { font-weight: 600; }
.nearby-notes p { margin: 8px 0 0; }
.nearby-map-actions { position: absolute; z-index: 4; left: 78px; bottom: 42px; display: flex; gap: 8px; }
.nearby-map-actions button { min-height: 42px; padding: 9px 14px; border: 1px solid #dce5e9; border-radius: 24px; background: white; color: var(--portal-dark); font-size: 12px; font-weight: 700; box-shadow: 0 3px 12px #173b4a1a; }
.nearby-search-again { position: absolute; z-index: 4; left: calc((100% - var(--nearby-sidebar-width)) / 2); bottom: 42px; transform: translateX(-50%); display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 11px 18px; border: 0; border-radius: 28px; background: #007bff; color: #fff; box-shadow: 0 3px 12px #0069df33; font-size: 14px; font-weight: 700; line-height: 1.4; white-space: nowrap; cursor: pointer; }
.nearby-search-again svg { flex-shrink: 0; }
.nearby-search-again:hover { background: #0065db; }
.nearby-search-again:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px #0065db; }
.nearby-map-controls { position: absolute; z-index: 4; left: 20px; bottom: 42px; display: flex; flex-direction: column; gap: 8px; }
.nearby-map-controls button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #dce5e9; border-radius: 12px; background: #fff; box-shadow: 0 3px 12px #173b4a1a; color: var(--portal-text); }
.nearby-map-controls [data-nearby-locate] { color: var(--portal-point); border-radius: 50%; }
.nearby-zoom-controls { overflow: hidden; border-radius: 12px; box-shadow: 0 3px 12px #173b4a1a; }
.nearby-zoom-controls button { border-radius: 0; box-shadow: none; font-size: 24px; line-height: 1; }
.nearby-zoom-controls button + button { border-top: 0; }
.nearby-map-controls button:hover, .nearby-map-actions button:hover { background: var(--portal-mint); }
.nearby-map-mode { position: absolute; z-index: 3; left: 20px; top: 140px; margin: 0; padding: 6px 11px; border-radius: 16px; background: #ffffffed; box-shadow: 0 2px 8px #173b4a12; color: var(--portal-muted); font-size: 11px; pointer-events: none; }
.nearby-search-panel:has(.nearby-location-status:not([hidden])) ~ .nearby-map-mode { display: none; }
.portal-nearby button:disabled { cursor: wait; opacity: .55; }
.nearby-pin { position: relative; display: grid; place-items: center; width: 34px; height: 40px; background: #245fd5; border: 2px solid white; border-radius: 18px 18px 18px 5px; color: white; box-shadow: 0 3px 9px #172b3a40; transform-origin: 50% 100%; transition: background .16s, transform .16s, box-shadow .16s; cursor: pointer; }
.nearby-pin-symbol { position: relative; width: 16px; height: 16px; }
.nearby-pin-symbol::before, .nearby-pin-symbol::after { content: ''; position: absolute; background: white; border-radius: 1px; }
.nearby-pin-symbol::before { left: 6px; top: 1px; width: 4px; height: 14px; }
.nearby-pin-symbol::after { left: 1px; top: 6px; width: 14px; height: 4px; }
.nearby-pin.is-active { background: #087f79; box-shadow: 0 0 0 5px #12b8b033, 0 4px 12px #172b3a30; }
.nearby-pin.is-highlighted { background: #e57235; transform: translateY(-7px) scale(1.12); box-shadow: 0 0 0 5px #e5723529, 0 5px 12px #172b3a30; }
.nearby-pin-label { position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 230px; padding: 8px 12px; border: 1px solid var(--portal-line-strong); border-radius: 9px; background: white; color: var(--portal-dark); box-shadow: 0 4px 14px #172b3a26; font: 700 13px/1.45 Pretendard, sans-serif; text-align: center; white-space: normal; overflow-wrap: anywhere; pointer-events: none; visibility: hidden; }
.nearby-pin.is-highlighted .nearby-pin-label, .nearby-pin.is-active .nearby-pin-label, .nearby-pin:focus-visible .nearby-pin-label { visibility: visible; }
.nearby-cluster { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 76px; height: 76px; gap: 2px; border: 3px solid white; border-radius: 50%; background: #087f79; color: #fff; box-shadow: 0 0 0 5px #087f7926, 0 4px 12px #172b3a30; font: 700 12px/1.35 Pretendard, sans-serif; text-align: center; white-space: nowrap; cursor: pointer; transition: background .16s, transform .16s; }
.nearby-cluster.is-district { width: 106px; height: 64px; padding: 4px; border-radius: 20px; }
.nearby-cluster-label { max-width: calc(100% - 6px); overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.nearby-cluster-count { font-size: 22px; line-height: 1.2; }
.nearby-cluster.is-active { background: #245fd5; }
.nearby-cluster.is-highlighted, .nearby-cluster:hover { background: #d9692c; transform: translateY(-4px); }
.nearby-origin { display: block; width: 24px; height: 24px; background: #087f79; border: 4px solid white; border-radius: 50%; box-shadow: 0 0 0 7px #12b8b033, 0 2px 8px #172b3a40; }
.nearby-selection { display: none; }
.portal-nearby.has-selection .nearby-selection { display: block; }
.portal-nearby.has-selection .nearby-results { display: none; }
.nearby-detail { position: relative; display: grid; gap: 8px; padding: 22px 18px 18px; background: #fff; }
.nearby-detail h3 { margin: 4px 0 10px; padding-right: 0; font-size: 22px; font-weight: 700; overflow-wrap: anywhere; }
.nearby-detail p { margin: 0 0 8px; font-size: 13px; }
.nearby-detail .nearby-eyebrow { min-height: 28px; padding-right: 65px; font-size: 12px; }
.nearby-detail .nearby-detail-phone { margin: 6px 0 14px; font-size: 25px; font-weight: 700; letter-spacing: -.5px; }
.nearby-detail .nearby-detail-link { gap: 5px; min-height: 40px; font-size: 12px; }
.nearby-action-icon { display: inline-flex; flex-shrink: 0; color: var(--portal-point); }
.nearby-action-icon .portal-icon { width: 17px; height: 17px; }
.nearby-detail-address { color: var(--portal-muted); overflow-wrap: anywhere; }
.nearby-detail-close { position: absolute; top: 16px; right: 14px; border: 0; background: var(--portal-soft); border-radius: 7px; padding: 8px 10px; font-size: 12px; }
.nearby-streetview { display: flex; flex-direction: column; border-top: 1px solid var(--portal-line); overflow: hidden; background: #fff; }
.nearby-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; }
.nearby-panel-heading h2 { min-width: 0; margin: 0; font-size: 14px; line-height: 1.5; }
.nearby-panel-heading .nearby-detail-link { flex-shrink: 0; }
.nearby-streetview-frame { display: block; width: 100%; height: 300px; border: 0; background: var(--portal-soft); }
.is-streetview-wide .nearby-streetview-frame { height: 420px; }
.nearby-streetview-help { padding: 10px 16px; margin: 0; font-size: 11px; line-height: 1.7; color: var(--portal-muted); }
.nearby-streetview-empty { padding: 24px 16px; color: var(--portal-muted); font-size: 13px; }
.portal-nearby [hidden] { display: none !important; }
.portal-nearby.has-map-search-again .nearby-map-actions { visibility: hidden; }
@media (max-width: 1100px) and (min-width: 768px) {
    .nearby-workspace { --nearby-sidebar-width: 320px; }
    .nearby-search-panel { left: 14px; width: min(340px, calc(100% - var(--nearby-sidebar-width) - 44px)); }
    .nearby-filter-row { flex-wrap: wrap; }
    .nearby-filter-row select { max-width: 146px; }
    .nearby-map-actions { bottom: 42px; flex-direction: column; }
    .nearby-map-mode { top: 185px; }
}
@media (max-width: 767px) {
    .nearby-workspace, .nearby-workspace.is-streetview-wide { --nearby-sidebar-width: 100%; --nearby-sheet-height: 88px; }
    .portal-nearby.is-list-open .nearby-workspace { --nearby-sheet-height: min(62%, 560px, calc(100% - 280px)); }
    .nearby-search-panel { top: 12px; left: 10px; width: calc(100% - 20px); }
    .nearby-search-field { gap: 7px; padding-left: 14px; }
    .nearby-search-field input { font-size: 16px; }
    .nearby-filter-row { gap: 6px; margin-top: 8px; }
    .nearby-filter-row > div:first-child { flex: 1; }
    .nearby-filter-row select { width: 100%; max-width: 100%; font-size: 11px; padding-inline: 8px; }
    .nearby-filter-row > button { padding-inline: 10px; font-size: 11px; }
    .nearby-map-frame { bottom: calc(var(--nearby-sheet-height) + env(safe-area-inset-bottom)); height: auto; }
    .nearby-map-mode { top: 124px; left: 12px; font-size: 10px; }
    .portal-nearby.is-list-open .nearby-map-mode { display: none; }
    .nearby-map-message { top: 160px; left: 12px; width: calc(100% - 24px); font-size: 12px; }
    .nearby-sidebar { top: auto; right: 0; bottom: 0; width: 100%; height: calc(var(--nearby-sheet-height) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); border-radius: 20px 20px 0 0; border-bottom: 0; box-shadow: 0 -4px 22px #173b4a1f; }
    .nearby-results-heading { position: relative; min-height: 87px; padding: 19px 18px 11px; align-items: center; }
    .nearby-results-heading::before { content: ''; position: absolute; top: 7px; left: calc(50% - 18px); width: 36px; height: 4px; border-radius: 4px; background: #cdd7de; }
    .nearby-results-heading .nearby-eyebrow { display: none; }
    .nearby-results-heading h1 { margin-bottom: 4px; font-size: 18px; }
    .nearby-results-heading h1 span { font-size: 11px; }
    .nearby-results-heading [data-nearby-summary] { font-size: 10px; }
    .nearby-sheet-toggle { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--portal-soft); color: var(--portal-dark); font-size: 22px; }
    .is-list-open .nearby-sheet-toggle span { transform: rotate(180deg); }
    .portal-nearby:not(.is-list-open) .nearby-sidebar-content { display: none; }
    .nearby-map-controls { left: auto; right: 12px; bottom: calc(var(--nearby-sheet-height) + env(safe-area-inset-bottom) + 32px); gap: 6px; }
    .nearby-map-controls [data-nearby-map-type], .nearby-zoom-controls { display: none; }
    .nearby-map-controls button { width: 42px; height: 42px; }
    .nearby-map-actions { left: 12px; bottom: calc(var(--nearby-sheet-height) + env(safe-area-inset-bottom) + 32px); gap: 5px; max-width: calc(100% - 72px); }
    .nearby-map-actions button { min-height: 38px; padding: 7px 10px; font-size: 10px; }
    .nearby-search-again { left: 50%; bottom: calc(var(--nearby-sheet-height) + env(safe-area-inset-bottom) + 32px); }
    .nearby-streetview-frame, .is-streetview-wide .nearby-streetview-frame { height: 250px; }
    [data-nearby-streetview-expand] { display: none; }
    .nearby-result-select { padding-top: 12px; }
    .nearby-result .nearby-detail-link { min-height: 36px; }
    .nearby-notes { padding: 8px 16px; }
    .nearby-cluster { width: 64px; height: 64px; }
    .nearby-cluster.is-district { width: 106px; height: 64px; }
}
@media (max-height: 540px) and (max-width: 767px) {
    .portal-nearby.is-list-open .nearby-workspace { --nearby-sheet-height: 76%; }
    .portal-nearby.is-list-open .nearby-search-again { bottom: calc(var(--nearby-sheet-height) + env(safe-area-inset-bottom) + 8px); min-height: 40px; padding-block: 8px; font-size: 12px; }
    .portal-nearby.is-list-open .nearby-search-panel, .portal-nearby.is-list-open .nearby-map-mode, .portal-nearby.is-list-open .nearby-map-actions { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
    .nearby-pin, .nearby-cluster, .nearby-result { transition: none; }
    .nearby-pin.is-highlighted, .nearby-cluster.is-highlighted, .nearby-cluster:hover { transform: none; }
}
.nearby-detail-close { display: inline-flex; }
.nearby-detail-close, .nearby-streetview-heading .nearby-detail-link { align-items: center; justify-content: center; gap: 5px; }
.nearby-detail-close .portal-icon, .nearby-streetview-heading .portal-icon { width: 15px; height: 15px; }

.nearby-hospital-heading { display: flex; align-items: center; gap: 8px; }
.nearby-hospital-heading > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.nearby-hospital-symbol { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: 0 0 32px; overflow: hidden; border-radius: 7px; background: #fff; color: #087c80; }
.nearby-hospital-symbol .portal-icon { width: 24px; height: 24px; }
.nearby-hospital-symbol img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.nearby-hospital-symbol img[hidden] { display: none; }

.nearby-result { position: relative; }
.nearby-result.has-homepage .nearby-result-name { width: 100%; box-sizing: border-box; padding-right: 104px; min-height: 30px; }
.nearby-result-homepage { position: absolute; top: 38px; right: 14px; }
.nearby-result-homepage .nearby-detail-link { min-height: 28px; padding: 4px 6px; white-space: nowrap; }

.nearby-search-panel .nearby-location-notice { position: relative; margin-top: 14px; }
.nearby-search-panel .nearby-location-status { margin: 0; padding-right: 46px; }
.nearby-location-dismiss { position: absolute; top: 6px; right: 6px; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--portal-point-strong); cursor: pointer; }
.nearby-location-dismiss:hover { background: #def3ee; }
.nearby-location-dismiss:focus-visible { outline: 2px solid var(--portal-point); outline-offset: 2px; }
.nearby-location-dismiss .portal-icon { width: 16px; height: 16px; }
