/* 강남구 부동산 지도 — 페이지 전용 스타일 */

/* === 풀스크린 지도 레이아웃 === */
:root {
  --map-header-h: 56px;
  --map-sidebar-w: 360px;
}

html.map-page-root,
html.map-page-root body.map-page {
  height: 100%;
  overflow: hidden;
}

body.map-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
}

body.map-page .site-header {
  flex-shrink: 0;
  position: relative;
  z-index: 200;
}

body.map-page .site-header .header-inner {
  padding-top: 10px;
  padding-bottom: 10px;
  min-height: var(--map-header-h);
  box-sizing: border-box;
}

body.map-page .map-page-header {
  display: none;
}

body.map-page .site-footer {
  display: none;
}

.map-page-header {
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border-subtle);
  padding: 1rem 0;
}

.map-page-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.map-page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text);
}

.map-page-meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

body.map-page .map-status-chip {
  display: none;
}

body.map-page .map-error-banner {
  position: absolute;
  top: var(--map-header-h);
  left: 0;
  right: 0;
  z-index: 150;
  margin: 0;
}

body.map-page .map-layout {
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 0;
  height: calc(100vh - var(--map-header-h));
  height: calc(100dvh - var(--map-header-h));
  overflow: hidden;
  background: #e5e7eb;
}

.map-layout {
  display: flex;
  min-height: calc(100vh - 140px);
  background: var(--color-bg);
}

body.map-page .map-panel {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.map-panel {
  flex: 0 0 70%;
  position: relative;
  min-height: 520px;
}

body.map-page #map {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 520px;
}

body.map-page .sidebar-panel {
  flex: 0 0 var(--map-sidebar-w);
  width: var(--map-sidebar-w);
  min-width: 320px;
  max-width: 400px;
  height: 100%;
  min-height: 0;
}

.sidebar-panel {
  flex: 0 0 30%;
  min-width: 280px;
  max-width: 420px;
  background: var(--color-card);
  border-left: 1px solid var(--color-border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-mobile-toggle {
  display: none;
}

/* 바텀시트 (모바일) */
.bottom-sheet-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1400;
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
}

.bottom-sheet-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet-handle {
  display: none;
  width: 40px;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: 10px auto 6px;
  flex-shrink: 0;
  cursor: pointer;
}

.bottom-sheet-close {
  display: none;
  position: absolute;
  top: 8px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.mobile-search-fab {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 1100;
  border: none;
  cursor: pointer;
  padding: 0;
}

.mobile-search-fab:active {
  transform: scale(0.96);
}

.mobile-search-float {
  position: fixed;
  top: 112px;
  left: 12px;
  right: 12px;
  z-index: 1002;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
}

.mobile-search-float[hidden] {
  display: none !important;
}

.mobile-search-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 6px;
}

.mobile-search-float input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--color-bg);
  box-sizing: border-box;
}

.mobile-search-float .search-results {
  margin-top: 0.5rem;
  max-height: 200px;
}

.map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.92);
  z-index: 10;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

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

.sidebar-search {
  padding: 1rem;
  border-bottom: 1px solid var(--color-border-subtle);
}

.sidebar-search label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.sidebar-search input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--color-bg);
}

.sidebar-search input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.search-index-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.search-results {
  margin-top: 0.5rem;
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  background: var(--color-card);
  display: none;
}

.search-results.is-open {
  display: block;
}

.search-result-item {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: none;
  border-bottom: 1px solid var(--color-border-subtle);
  background: transparent;
  text-align: left;
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--color-text);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover,
.search-result-item:focus {
  background: var(--color-primary-muted);
  outline: none;
}

.search-result-item small {
  display: block;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

.search-result-name {
  display: block;
  font-weight: 500;
  line-height: 1.35;
}

.search-result-item.is-current-district .search-result-name {
  font-weight: 700;
  color: #1d4ed8;
}

.search-result-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #1d4ed8;
  background: #eff6ff;
  border-radius: 4px;
  vertical-align: middle;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.sidebar-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.sidebar-empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: 2rem 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.apt-info-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border-subtle);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.apt-info-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  color: var(--color-text);
}

.apt-info-card .apt-address {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.apt-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.apt-meta-item {
  background: var(--color-card);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font-size: 0.8rem;
}

.apt-meta-item span {
  display: block;
  color: var(--color-text-muted);
  margin-bottom: 0.15rem;
}

.apt-meta-item strong {
  color: var(--color-text);
  font-size: 0.9rem;
}

.transactions-section h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--color-text);
}

.transactions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.transactions-table th,
.transactions-table td {
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--color-border-subtle);
  text-align: left;
}

.transactions-table th {
  color: var(--color-text-muted);
  font-weight: 600;
  background: var(--color-bg);
}

.transactions-table td.amount {
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}

.transactions-empty {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  padding: 0.75rem 0;
}

/* 가격 변화 차트 */
.chart-section {
  background: var(--color-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.chart-section h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--color-text);
}

.chart-controls {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.area-selector {
  margin-bottom: 0.75rem;
}

.area-selector h4 {
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.area-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.area-tab {
  flex-shrink: 0;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  background: var(--color-bg);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.area-tab:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.area-tab.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.period-btn {
  flex: 1;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  background: var(--color-bg);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.period-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.period-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.chart-hint {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.chart-wrapper {
  position: relative;
  height: 250px;
  margin-bottom: 0.75rem;
}

.chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-loading,
.chart-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 250px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-align: center;
  gap: 0.35rem;
}

.chart-message small {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.chart-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--color-border-subtle);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: chart-spin 0.7s linear infinite;
}

@keyframes chart-spin {
  to {
    transform: rotate(360deg);
  }
}

.chart-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.stat-item {
  background: #f3f4f6;
  border-radius: 8px;
  padding: 0.55rem 0.5rem;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-bottom: 0.2rem;
}

.stat-value {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
  word-break: keep-all;
}

.stat-max .stat-value {
  color: #dc2626;
}

.stat-min .stat-value {
  color: #16a34a;
}

.stat-avg .stat-value {
  color: #2563eb;
}

.sidebar-actions {
  padding: 1rem;
  border-top: 1px solid var(--color-border-subtle);
}

.sidebar-actions .btn-primary {
  width: 100%;
}

.sidebar-actions .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.map-error-banner {
  margin: 0;
  padding: 0.75rem 1rem;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.875rem;
  border-bottom: 1px solid #fecaca;
}

/* 가격대별 마커 */
.marker-pill {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 14px;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  transition: transform 0.15s;
  border: 1.5px solid #fff;
  font-family: Pretendard, -apple-system, sans-serif;
  line-height: 1.2;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

.marker-pill.size-md {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 12px;
}

.marker-pill.size-sm {
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 10px;
  font-weight: 800;
}

.marker-pill:hover,
.marker-pill:focus {
  transform: scale(1.1);
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  outline: none;
}

.marker-low {
  background: #10b981;
}

.marker-mid {
  background: #f59e0b;
}

.marker-high {
  background: #ef4444;
}

.marker-none {
  background: #9ca3af;
}

.marker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

.marker-dot:hover {
  transform: scale(1.25);
}

.marker-dot.marker-low {
  background: #10b981;
}

.marker-dot.marker-mid {
  background: #f59e0b;
}

.marker-dot.marker-high {
  background: #ef4444;
}

.marker-dot.marker-none {
  background: #9ca3af;
}

/* 지도 범례 */
.map-legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 20;
  background: #fff;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  font-size: 0.75rem;
  min-width: 130px;
}

.map-legend h4 {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text);
}

.map-legend-toggle {
  display: none;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.3rem;
  color: var(--color-text-muted);
}

.legend-item:last-child {
  margin-bottom: 0;
}

.legend-item .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-low {
  background: #10b981;
}

.dot-mid {
  background: #f59e0b;
}

.dot-high {
  background: #ef4444;
}

.dot-none {
  background: #9ca3af;
}

/* 지역 선택 — 상단 중앙 */
.region-selector {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: #fff;
  border-radius: 24px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  max-width: min(560px, calc(100% - 32px));
  overflow: visible;
  white-space: nowrap;
}

.region-pin {
  color: #ef4444;
  font-size: 16px;
  flex-shrink: 0;
}

.region-item {
  color: #374151;
  font-weight: 500;
  white-space: nowrap;
}

.region-item--gu {
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.region-item--gu:hover {
  color: #2563eb;
  background: #eff6ff;
}

.region-divider {
  color: #9ca3af;
}

.region-dropdown-wrap {
  position: relative;
  flex-shrink: 0;
}

.region-dropdown-btn {
  position: relative;
  background: none;
  border: none;
  color: #2563eb;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
  font-family: inherit;
  font-size: 14px;
  white-space: nowrap;
}

.region-gu-btn {
  color: #1f2937;
  font-weight: 600;
}

.region-gu-wrap .region-dropdown-menu {
  min-width: 140px;
}

.dropdown-arrow {
  font-size: 10px;
}

  .region-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 0;
  z-index: 9999;
  border: 1px solid #e5e7eb;
}

.region-dropdown-menu[hidden] {
  display: none;
}

.region-dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

.region-dropdown-menu::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.dong-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
  transition: background 0.15s;
  text-align: left;
  font-family: inherit;
  white-space: nowrap;
}

.dong-item:hover {
  background: #f3f4f6;
}

.dong-item.active {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 600;
}

/* 지도 필터 바 — 좌측 상단 */
.map-filter-bar {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1001;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  padding: 8px 10px;
  max-width: calc(100% - 32px);
  overflow: visible;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: visible;
}

.filter-dropdown-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 9999;
}

.filter-dropdown {
  pointer-events: auto;
}

.filter-chip-wrap {
  position: relative;
  flex-shrink: 0;
}

.filter-btn {
  padding: 8px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  min-width: 80px;
  justify-content: center;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #f8faff;
}

.filter-btn.default {
  background: #fff;
  color: #374151;
  border-color: #e5e7eb;
}

.filter-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  font-weight: 600;
}

.filter-btn.active .filter-arrow {
  color: rgba(255, 255, 255, 0.85);
}

.filter-btn.is-open {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.filter-arrow {
  font-size: 10px;
  opacity: 0.7;
  line-height: 1;
}

.filter-reset-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 18px;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
}

.filter-reset-btn::before {
  content: "↻";
  font-size: 14px;
}

.filter-reset-btn:hover {
  background: #f3f4f6;
  color: #ef4444;
}

.filter-result-count {
  flex-shrink: 0;
  padding: 6px 12px;
  background: #f3f4f6;
  border-radius: 14px;
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
  margin-left: 2px;
  white-space: nowrap;
}

.filter-result-count strong {
  color: #2563eb;
  font-weight: 700;
}

.filter-dropdown {
  position: fixed;
  top: auto;
  left: auto;
  right: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 4px 0;
  min-width: 180px;
  width: max-content;
  max-height: 320px;
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 9999;
  border: 1px solid #e5e7eb;
}

.filter-dropdown::-webkit-scrollbar {
  width: 6px;
}

.filter-dropdown::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.filter-dropdown.align-right {
  left: auto;
  right: 0;
}

.filter-dropdown[hidden] {
  display: none;
}

.filter-option {
  display: block;
  padding: 10px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s;
  color: #374151;
  white-space: nowrap;
  line-height: 1.35;
  box-sizing: border-box;
}

.filter-option:hover {
  background: #f3f4f6;
}

.filter-option.selected {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 600;
}

/* 거래 유형 탭 */
.deal-type-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.6rem;
}

.deal-tab {
  flex: 1;
  padding: 0.45rem 0.3rem;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  transition: all 0.15s ease;
}

.deal-tab:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.deal-tab.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

@media (min-width: 769px) and (max-width: 1280px) {
  .region-selector > .region-item:first-of-type,
  .region-selector > .region-divider:nth-of-type(1) {
    display: none;
  }
}

@media (max-width: 768px) {
  :root {
    --map-mobile-chrome-top: calc(var(--map-header-h) + 8px);
    --map-mobile-region-w: 200px;
  }

  body.map-page .map-layout {
    flex: 1 1 auto;
    position: relative;
    height: calc(100dvh - var(--map-header-h));
    min-height: 0;
    overflow: hidden;
  }

  body.map-page .map-panel {
    position: fixed;
    top: var(--map-header-h);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: calc(100dvh - var(--map-header-h));
    z-index: 1;
  }

  body.map-page #map {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
  }

  /* 사이드바 → 바텀시트 */
  body.map-page .sidebar-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 55vh;
    max-height: 70vh;
    flex: none;
    border-left: none;
    border-top: none;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1500;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-top: 4px;
  }

  body.map-page .sidebar-panel.is-open {
    transform: translateY(0);
  }

  body.map-page .sidebar-panel .sidebar-search {
    display: none;
  }

  .sidebar-mobile-toggle {
    display: none !important;
  }

  .bottom-sheet-backdrop:not([hidden]) {
    display: block;
  }

  .bottom-sheet-backdrop[hidden] {
    display: none !important;
    pointer-events: none;
  }

  .bottom-sheet-handle,
  .bottom-sheet-close {
    display: block;
  }

  .mobile-search-fab {
    display: flex;
  }

  body.bottom-sheet-open .mobile-search-fab {
    bottom: calc(55vh + 12px);
    transition: bottom 0.3s ease;
  }

  /* 지역 선택 — 좌측 상단 컴팩트 */
  .region-selector {
    position: fixed;
    top: var(--map-mobile-chrome-top);
    left: 8px;
    right: auto;
    transform: none;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 18px;
    max-width: var(--map-mobile-region-w);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    gap: 4px;
  }

  .region-pin {
    display: none;
  }

  .region-item:nth-of-type(1),
  .region-divider:nth-of-type(1) {
    display: none;
  }

  .region-dropdown-btn {
    font-size: 12px;
    padding: 2px 4px;
  }

  /* 필터 바 — 한 줄 가로 스크롤 */
  .map-filter-bar {
    position: fixed;
    top: var(--map-mobile-chrome-top);
    left: calc(8px + var(--map-mobile-region-w) + 6px);
    right: 8px;
    max-width: none;
    padding: 4px 6px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  .map-filter-bar::-webkit-scrollbar {
    display: none;
  }

  .filter-group {
    min-width: max-content;
    gap: 4px;
    scroll-snap-align: start;
  }

  .filter-btn {
    font-size: 12px;
    padding: 6px 10px;
    min-width: auto;
    border-radius: 16px;
    flex-shrink: 0;
    scroll-snap-align: start;
  }

  .filter-reset-btn {
    padding: 6px 8px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .filter-result-count {
    font-size: 11px;
    padding: 5px 8px;
    flex-shrink: 0;
  }

  .filter-arrow {
    font-size: 9px;
  }

  /* 범례 — 컴팩트 + 접기 */
  .map-legend {
    position: fixed;
    left: 8px;
    bottom: 80px;
    padding: 8px 10px;
    font-size: 11px;
    border-radius: 10px;
    max-width: 130px;
    z-index: 100;
  }

  .map-legend h4 {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .legend-item {
    font-size: 10px;
    margin-bottom: 2px;
  }

  .map-legend-toggle {
    display: block;
    width: 100%;
    margin-bottom: 0.35rem;
    padding: 0.35rem;
    border: 1px solid var(--color-border-subtle);
    border-radius: 6px;
    background: var(--color-bg);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
  }

  .map-legend.is-collapsed {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    padding: 8px;
    overflow: hidden;
  }

  .map-legend.is-collapsed .map-legend-toggle {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 0.65rem;
    text-align: center;
  }

  .map-legend.is-collapsed h4,
  .map-legend.is-collapsed .legend-item {
    display: none;
  }

  .marker-pill-lg {
    font-size: 11px;
    padding: 6px 10px;
  }

  .marker-pill-sm {
    font-size: 10px;
  }

  .sidebar-content {
    padding-bottom: 1rem;
  }
}

@media (max-width: 900px) and (min-width: 769px) {
  body.map-page .sidebar-panel {
    --map-sidebar-w: 320px;
    flex: 0 0 320px;
    width: 320px;
    min-width: 300px;
    max-width: 360px;
  }

  .region-selector > .region-item:first-of-type,
  .region-selector > .region-divider:nth-of-type(1) {
    display: none;
  }
}
