/* css/style.css - extracted from index.html */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; overflow: hidden; height: 100vh; display: flex; flex-direction: column; }

#topbar { height: 52px; background: #1F4E79; display: flex; align-items: center; padding: 0 14px; gap: 10px; flex-shrink: 0; z-index: 100; box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
#topbar .logo { color: #fff; font-size: 15px; font-weight: 700; white-space: nowrap; }
#topbar .logo span { color: #7FC3F5; font-size: 12px; font-weight: 400; margin-left: 6px; }
#search-wrap { flex: 1; max-width: 480px; display: flex; gap: 6px; }
#search-input { flex: 1; padding: 7px 12px; border-radius: 5px; border: none; font-size: 13px; font-family: inherit; outline: none; }
#search-btn { padding: 7px 14px; background: #2E75B6; color: #fff; border: none; border-radius: 5px; cursor: pointer; font-size: 13px; font-family: inherit; white-space: nowrap; }
#search-btn:hover { background: #1a5c9e; }
.topbar-sep { width: 1px; height: 28px; background: rgba(255,255,255,0.2); }
.map-type-btn { padding: 6px 12px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.3); background: transparent; color: #cde; cursor: pointer; font-size: 12px; font-family: inherit; transition: all 0.15s; }
.map-type-btn:hover, .map-type-btn.active { background: rgba(255,255,255,0.18); color: #fff; }
#coord-display { color: #8ab0d0; font-size: 11px; white-space: nowrap; margin-left: auto; }

#main { flex: 1; display: flex; overflow: hidden; position: relative; }

#layer-panel { width: 260px; background: #0d2240; border-right: 1px solid #0a3d52; display: flex; flex-direction: column; overflow: hidden; flex-shrink: 0; transition: width 0.2s; z-index: 10; }
#layer-panel.collapsed { width: 0; }
#layer-panel-header { background: #081a30; color: #e2f0ef; padding: 11px 14px; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; border-bottom: 1px solid #0a3d52; }
#layer-panel-header .cnt { background: #0d9488; border-radius: 10px; padding: 1px 8px; font-size: 11px; color: #fff; }
#layer-body { flex: 1; overflow-y: auto; padding: 10px; }
#layer-body::-webkit-scrollbar-thumb { background: #1a4060; }
.layer-group { margin-bottom: 14px; }
.layer-group-title { font-size: 12px; font-weight: 800; color: #7dd3c8; letter-spacing: 0.3px; padding-bottom: 6px; border-bottom: 1px solid rgba(125,211,200,0.2); margin-bottom: 7px; }
.layer-item { display: flex; align-items: center; gap: 8px; padding: 7px 6px; border-radius: 5px; cursor: pointer; transition: background 0.12s; user-select: none; }
.layer-item:hover { background: rgba(13,148,136,0.15); }
.layer-dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.layer-label { flex: 1; font-size: 12px; color: #c8dff0; }
.layer-toggle { width: 34px; height: 18px; border-radius: 9px; background: #1a3a55; position: relative; cursor: pointer; transition: background 0.2s; flex-shrink: 0; }
.layer-toggle.on { background: #0d9488; }
.layer-toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.layer-toggle.on::after { left: 18px; }
.layer-opacity-row { padding: 2px 6px 4px 25px; }
.layer-opacity-row input[type=range] { width: 100%; height: 3px; cursor: pointer; accent-color: #0d9488; }

#map-wrap { flex: 1; position: relative; overflow: hidden; }
#map { width: 100%; height: 100%; }

/* 카카오맵 줌 버튼 위치 조정 */
.kakao-zoom { position: absolute; right: 12px; top: 12px; z-index: 5; }

/* 검색 결과 드롭다운 */
#search-results {
  position: absolute; top: 58px; left: 270px; width: 400px;
  background: #fff; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.1);
  z-index: 300; max-height: 280px; overflow-y: auto; display: none;
  border: 1px solid #D0D7E2;
  animation: srFadeIn 0.12s ease;
}
@keyframes srFadeIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }
#search-results-header {
  padding: 7px 14px 5px; font-size: 10px; font-weight: 700;
  color: #aaa; text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid #eef0f3;
}
.search-result-item {
  padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #f3f4f6;
  font-size: 12px; transition: background 0.1s; display: flex; align-items: flex-start; gap: 10px;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: #EAF2FB; }
.search-result-item .sr-icon {
  width: 28px; height: 28px; border-radius: 6px; background: #EAF2FB;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px;
  font-size: 13px;
}
.search-result-item .sr-text { flex: 1; min-width: 0; }
.search-result-item .addr-main { font-weight: 600; color: #1F4E79; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-item .addr-sub { color: #999; font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#panel-toggle { position: absolute; left: 260px; top: 50%; transform: translateY(-50%); z-index: 50; background: #0d2240; border: 1px solid #0a3d52; border-left: none; border-radius: 0 4px 4px 0; padding: 8px 4px; cursor: pointer; font-size: 12px; color: #7dd3c8; transition: left 0.2s; box-shadow: 2px 0 6px rgba(0,0,0,0.25); }

/* 미분양 마커 */
.unsold-marker {
  width: 36px; height: 36px; border-radius: 50%;
  background: #7B1FA2; border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(123,31,162,0.45);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform 0.15s;
  position: relative;
}
.unsold-marker:hover { transform: scale(1.18); }
.unsold-marker svg { width: 18px; height: 18px; fill: #fff; }
.unsold-badge {
  position: absolute; top: -6px; right: -6px;
  background: #E53935; color: #fff;
  font-size: 9px; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* 미분양 팝업 */
#unsold-popup {
  position: absolute; background: #fff; border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2); width: 300px;
  border-top: 4px solid #7B1FA2; display: none; z-index: 60;
}
#unsold-popup .up-header {
  background: #4A148C; color: #fff;
  padding: 10px 12px; display: flex; align-items: center; justify-content: space-between;
}
#unsold-popup .up-title { font-size: 13px; font-weight: 700; flex: 1; }
#unsold-popup .up-close { background: none; border: none; color: rgba(255,255,255,0.7); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; }
#unsold-popup .up-close:hover { color: #fff; }
#unsold-popup .up-body { padding: 12px; }
#unsold-popup .up-tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; margin-bottom: 8px; }
#unsold-popup .up-tag.apt { background: #EDE7F6; color: #4A148C; }
#unsold-popup .up-tag.ofc { background: #E3F2FD; color: #1565C0; }
#unsold-popup .up-tag.villa { background: #E8F5E9; color: #2E7D32; }
#unsold-popup .up-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
#unsold-popup .up-field { background: #F5F7FA; border-radius: 4px; padding: 7px 9px; }
#unsold-popup .up-field .uf-lbl { font-size: 10px; color: #888; margin-bottom: 2px; }
#unsold-popup .up-field .uf-val { font-size: 12px; font-weight: 700; color: #1F4E79; }
#unsold-popup .up-field .uf-val.red { color: #C62828; }
#unsold-popup .up-field .uf-val.purple { color: #6A1B9A; }
#unsold-popup .up-addr { font-size: 11px; color: #777; margin-bottom: 8px; }
#unsold-popup .up-arrow { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 10px solid #fff; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.08)); }

/* 검색 핀 */
#search-pin { display: none; }
.search-pin-el { display: flex; flex-direction: column; align-items: center; }
.search-pin-el .pin-icon { width: 28px; height: 36px; }
.search-pin-el .pin-label { background: rgba(31,78,121,0.9); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 10px; white-space: nowrap; margin-top: 3px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }

/* 실거래 마커 */
.trade-marker {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 64px; border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.85); box-shadow: 0 2px 8px rgba(0,0,0,0.38);
  cursor: pointer; transition: transform 0.12s, box-shadow 0.12s;
  color: #fff; font-family: 'Malgun Gothic','Apple SD Gothic Neo',sans-serif;
  white-space: nowrap; padding: 4px 7px 6px;
  position: relative; line-height: 1.3;
}
.trade-marker .tm-name  { font-size: 9px;  font-weight: 600; opacity: 0.92; max-width: 90px; overflow: hidden; text-overflow: ellipsis; margin-bottom: 1px; }
.trade-marker .tm-price { font-size: 12px; font-weight: 800; letter-spacing: -0.3px; }
.trade-marker .tm-sub   { font-size: 9px;  font-weight: 500; opacity: 0.88; margin-top: 1px; }
.trade-marker::after {
  content:''; position:absolute; bottom:-6px; left:50%;
  transform:translateX(-50%);
  border-left:5px solid transparent; border-right:5px solid transparent;
}
.trade-marker:hover { transform: scale(1.12); box-shadow: 0 4px 14px rgba(0,0,0,0.45); z-index: 9999 !important; }
.trade-cluster { display:flex; align-items:center; justify-content:center; gap:3px; border-radius:12px; border:2px solid rgba(255,255,255,0.85); box-shadow:0 2px 8px rgba(0,0,0,0.4); cursor:pointer; color:#fff; font-family:'Malgun Gothic','Apple SD Gothic Neo',sans-serif; font-weight:700; transition:transform 0.12s; padding:4px 8px; white-space:nowrap; }
.trade-cluster:hover { transform:scale(1.12); z-index:9999 !important; }
.trade-cluster .tc-cnt { font-size:12px; line-height:1.2; }
.trade-cluster .tc-lbl { font-size:10px; opacity:0.9; }
.trade-marker.price-low  { background: #2E7D32; }
.trade-marker.price-low::after  { border-top: 6px solid #2E7D32; }
.trade-marker.price-mid  { background: #E65100; }
.trade-marker.price-mid::after  { border-top: 6px solid #E65100; }
.trade-marker.price-high { background: #B71C1C; }
.trade-marker.price-high::after { border-top: 6px solid #B71C1C; }

/* 실거래 팝업 (CustomOverlay — 지도와 함께 이동) */
.trade-popup-ov {
  position: relative; background: #fff; border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.22); width: 230px;
  border-top: 4px solid #1976D2; z-index: 600; padding: 12px 14px 10px;
  pointer-events: auto;
}
.trade-popup-ov .tp-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; font-size: 16px; cursor: pointer; color: #aaa;
}
.trade-popup-ov .tp-name { font-size: 13px; font-weight: 700; color: #1F4E79; margin-bottom: 2px; }
.trade-popup-ov .tp-addr { font-size: 11px; color: #999; margin-bottom: 8px; }
.trade-popup-ov .tp-price { font-size: 18px; font-weight: 700; color: #C62828; margin-bottom: 4px; }
.trade-popup-ov .tp-meta { font-size: 11px; color: #777; }
.trade-popup-ov .tp-arrow { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 10px solid #fff; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.08)); }

/* 동별 거래현황 버블 기간 버튼 */
.bubble-period-btn { font-size:10px; padding:2px 8px; border-radius:10px; border:1px solid #ccc; background:#f5f7fa; color:#555; cursor:pointer; }
.bubble-period-btn.active { background:#00897B; color:#fff; border-color:#00897B; }
.bubble-period-btn:hover { border-color:#00897B; color:#00897B; }
.land-bubble-period-btn { font-size:10px; padding:2px 8px; border-radius:10px; border:1px solid #ccc; background:#f5f7fa; color:#555; cursor:pointer; }
.land-bubble-period-btn.active { background:#8D6E63; color:#fff; border-color:#8D6E63; }
.land-bubble-period-btn:hover { border-color:#8D6E63; color:#8D6E63; }

/* 동별 거래현황 버블 */
.stat-bubble {
  position: relative;
  background: rgba(0,105,92,0.92);
  color: #fff;
  border-radius: 10px;
  padding: 5px 9px 5px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.28);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  white-space: nowrap;
  text-align: center;
  border: 1.5px solid rgba(255,255,255,0.35);
  min-width: 62px;
}
.stat-bubble:hover { transform: scale(1.1); box-shadow: 0 5px 16px rgba(0,0,0,0.38); }
.stat-bubble::after {
  content: '';
  position: absolute;
  bottom: -7px; left: 50%; transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid rgba(0,105,92,0.92);
}
.stat-bubble .sb-dong  { font-size: 11px; font-weight: 700; letter-spacing: -0.3px; }
.stat-bubble .sb-meta  { font-size: 9px; opacity: 0.82; margin-top: 1px; }
.stat-bubble .sb-count { font-size: 13px; font-weight: 700; color: #A5F3EB; line-height: 1.2; }
.stat-bubble .sb-price { font-size: 9px; opacity: 0.9; margin-top: 1px; color: #FFE082; }
/* 건수에 따른 색상 */
.stat-bubble.cnt-low  { background: rgba(2,136,209,0.88); }
.stat-bubble.cnt-low::after  { border-top-color: rgba(2,136,209,0.88); }
.stat-bubble.cnt-mid  { background: rgba(0,105,92,0.92); }
.stat-bubble.cnt-mid::after  { border-top-color: rgba(0,105,92,0.92); }
.stat-bubble.cnt-high { background: rgba(183,28,28,0.88); }
.stat-bubble.cnt-high::after { border-top-color: rgba(183,28,28,0.88); }

/* 실거래 기간 필터 */
.trade-filter-row { display: flex; gap: 4px; padding: 4px 6px 6px; }
.trade-filter-btn {
  flex: 1; padding: 4px 0; font-size: 11px; font-family: inherit;
  border: 1px solid #D0D7E2; background: #F5F7FA; border-radius: 4px;
  cursor: pointer; color: #555; transition: all 0.12s; font-weight: 500;
}
.trade-filter-btn.active { background: #1F4E79; color: #fff; border-color: #1F4E79; }

/* 월 선택 버튼 */
.tmp-btn {
  padding: 3px 7px; font-size: 10px; font-family: inherit; font-weight: 600;
  border: 1px solid #D0D7E2; background: #F5F7FA; border-radius: 4px;
  cursor: pointer; color: #555; transition: all 0.12s;
}
.tmp-btn.active { background: #1565C0; color: #fff; border-color: #1565C0; }
.tmp-btn:hover:not(.active) { background: #e8ecf0; }
.land-tmp-btn { font-size:10px; padding:2px 7px; border-radius:8px; border:1px solid #ccc; background:#f5f7fa; color:#555; cursor:pointer; }
.land-tmp-btn.active { background:#6D4C41; color:#fff; border-color:#6D4C41; }
.land-tmp-btn:hover:not(.active) { background:#e8ecf0; }

/* 실거래 가격 그래프 */
#trade-chart-wrap, #land-chart-wrap {
  padding: 6px 8px 8px; display: none;
}
[id^="trade-chart-wrap"] .tc-title, #land-chart-wrap .tc-title { font-size:10px; font-weight:700; color:#888; margin-bottom:4px; letter-spacing:0.3px; display:flex; align-items:center; justify-content:space-between; }
[id^="trade-chart-wrap"] svg, #land-chart-svg { width:100%; }
/* 상세 통계 버튼 */
.tc-detail-btn {
  font-size:9px; font-weight:700; letter-spacing:0.4px;
  color:#fff; background:linear-gradient(135deg,#1565C0 0%,#42A5F5 100%);
  border:none; border-radius:10px; padding:2px 9px;
  cursor:pointer; opacity:0.88; transition:opacity 0.15s,transform 0.1s;
  white-space:nowrap;
}
.tc-detail-btn:hover { opacity:1; transform:scale(1.05); }
#trade-chart-svg, #land-chart-svg { width: 100%; }

/* 통계 모달 */
#stat-modal, #land-stat-modal { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.35); z-index:1000; }
#stat-modal.open, #land-stat-modal.open { display:block; }
#stat-modal-inner, #land-stat-modal-inner { background:#F8FAFB; border-radius:12px; width:min(900px,96vw); max-height:90vh; overflow:auto; box-shadow:0 12px 50px rgba(0,0,0,0.35); display:flex; flex-direction:column; position:fixed; top:5vh; left:50%; transform:translateX(-50%); }
#stat-modal-hd, #land-stat-modal-hd { background:linear-gradient(135deg,#1F4E79,#2E75B6); color:#fff; padding:16px 20px; border-radius:12px 12px 0 0; display:flex; align-items:center; justify-content:space-between; flex-shrink:0; cursor:move; user-select:none; }
#stat-modal-hd h2, #land-stat-modal-hd h2 { font-size:15px; font-weight:700; margin:0; }
#stat-modal-hd .sm-close { background:rgba(255,255,255,0.2); border:none; color:#fff; font-size:18px; cursor:pointer; border-radius:50%; width:28px; height:28px; display:flex; align-items:center; justify-content:center; }
#stat-modal-hd .sm-close:hover { background:rgba(255,255,255,0.35); }
#stat-modal-body, #land-stat-modal-body { padding:16px 20px 20px; }
/* 지역 필터 */
.sm-region-tabs { display:flex; gap:6px; margin-bottom:12px; }
.sm-region-tab { padding:6px 18px; border-radius:6px; border:none; font-size:13px; font-weight:600; cursor:pointer; background:#e8ecf2; color:#555; transition:all 0.15s; }
.sm-region-tab.active-all  { background:#1F4E79; color:#fff; }
.sm-region-tab.active-jeju { background:#1976D2; color:#fff; }
.sm-region-tab.active-seo  { background:#E65100; color:#fff; }
/* 데이터 탭 */
.sm-tabs { display:flex; gap:6px; margin-bottom:14px; flex-wrap:wrap; }
.sm-tab { padding:5px 14px; border-radius:14px; border:1px solid #D0D7E2; font-size:12px; cursor:pointer; background:#fff; color:#555; }
.sm-tab.active { background:#1976D2; color:#fff; border-color:#1976D2; }
.lsm-tab { padding:5px 14px; border-radius:14px; border:1px solid #D0D7E2; font-size:12px; cursor:pointer; background:#fff; color:#555; }
.lsm-tab.active { background:#5D4037; color:#fff; border-color:#5D4037; }
.lsm-jimok-tab { padding:5px 12px; border-radius:14px; border:1px solid #D0D7E2; font-size:12px; cursor:pointer; background:#fff; color:#555; }
.lsm-jimok-tab.active { background:#795548; color:#fff; border-color:#795548; }
.lsm-region-tab { padding:6px 18px; border-radius:6px; border:none; font-size:13px; font-weight:600; cursor:pointer; background:#e8ecf2; color:#555; transition:all 0.15s; }
.lsm-region-tab.active-all  { background:#1F4E79; color:#fff; }
.lsm-region-tab.active-jeju { background:#1976D2; color:#fff; }
.lsm-region-tab.active-seo  { background:#E65100; color:#fff; }
/* 인구이동 SVG 오버레이 */
#migration-svg-overlay { position:absolute; top:0; left:0; width:100%; height:100%; pointer-events:none; z-index:6; }
.mig-arrow-path { fill:none; stroke-linecap:round; }
.mig-dot { pointer-events:none; }
.mig-label { font-size:11px; font-weight:700; font-family:'Malgun Gothic',sans-serif; }
/* 인구이동 모달 */
#mig-modal { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.35); z-index:1000; }
#mig-modal.open { display:block; }
#mig-modal-inner { background:#F8FAFB; border-radius:12px; width:min(920px,96vw); max-height:90vh; overflow:auto; box-shadow:0 12px 50px rgba(0,0,0,0.35); display:flex; flex-direction:column; position:fixed; top:5vh; left:50%; transform:translateX(-50%); }
#mig-modal-hd { background:linear-gradient(135deg,#4A148C,#7B1FA2); color:#fff; padding:16px 20px; border-radius:12px 12px 0 0; display:flex; align-items:center; justify-content:space-between; flex-shrink:0; cursor:move; user-select:none; }
#mig-modal-hd h2 { font-size:15px; font-weight:700; margin:0; }
#mig-modal-hd .sm-close { background:rgba(255,255,255,0.2); border:none; color:#fff; font-size:18px; cursor:pointer; border-radius:50%; width:28px; height:28px; display:flex; align-items:center; justify-content:center; }
#mig-modal-body { padding:16px 20px 20px; }
.mig-tab { padding:5px 14px; border-radius:14px; border:1px solid #D0D7E2; font-size:12px; cursor:pointer; background:#fff; color:#555; }
.mig-tab.active { background:#7B1FA2; color:#fff; border-color:#7B1FA2; }
.mig-kpi { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:16px; }
.mig-kpi-card { background:#fff; border-radius:8px; padding:12px 14px; box-shadow:0 1px 4px rgba(0,0,0,0.08); }
.mig-kpi-lbl { font-size:10px; color:#999; margin-bottom:4px; }
.mig-kpi-val { font-size:20px; font-weight:700; color:#1F4E79; }
.mig-kpi-sub { font-size:10px; color:#888; margin-top:2px; }
#mig-chart-wrap { background:#fff; border-radius:8px; box-shadow:0 1px 4px rgba(0,0,0,0.08); padding:12px 8px 4px; margin-bottom:12px; }
.mig-region-table { width:100%; border-collapse:collapse; font-size:12px; margin-top:8px; }
.mig-region-table th { background:#f0f2f5; padding:6px 10px; text-align:left; font-weight:600; color:#555; border-bottom:2px solid #D0D7E2; }
.mig-region-table td { padding:6px 10px; border-bottom:1px solid #f0f2f5; }
.mig-region-table tr:hover td { background:#f8faff; }
.mig-bar-bg { background:#f0f2f5; border-radius:3px; height:8px; width:120px; display:inline-block; vertical-align:middle; }
.mig-bar-fill { height:8px; border-radius:3px; display:inline-block; }
/* 지가변동률 / 임대 모달 */
#jiga-modal, #imde-modal { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.35); z-index:1000; }
#jiga-modal.open, #imde-modal.open { display:block; }
#jiga-modal-inner, #imde-modal-inner { background:#F8FAFB; border-radius:12px; width:min(920px,96vw); max-height:90vh; overflow:auto; box-shadow:0 12px 50px rgba(0,0,0,0.35); display:flex; flex-direction:column; position:fixed; top:5vh; left:50%; transform:translateX(-50%); }
#jiga-modal-hd, #imde-modal-hd { background:linear-gradient(135deg,#2E7D32,#43A047); color:#fff; padding:16px 20px; border-radius:12px 12px 0 0; display:flex; align-items:center; justify-content:space-between; flex-shrink:0; cursor:move; user-select:none; }
#imde-modal-hd { background:linear-gradient(135deg,#E65100,#F57C00); }
#jiga-modal-hd h2, #imde-modal-hd h2 { font-size:15px; font-weight:700; margin:0; }
.jiga-region-tab { padding:6px 18px; border-radius:6px; border:none; font-size:13px; font-weight:600; cursor:pointer; background:#e8ecf2; color:#555; transition:all 0.15s; }
.jiga-region-tab.active-all  { background:#2E7D32; color:#fff; }
.jiga-region-tab.active-jeju { background:#1976D2; color:#fff; }
.jiga-region-tab.active-seo  { background:#E65100; color:#fff; }
.jiga-cat-tab { padding:5px 14px; border-radius:14px; border:1px solid #D0D7E2; font-size:12px; cursor:pointer; background:#fff; color:#555; }
.jiga-cat-tab.active { background:#2E7D32; color:#fff; border-color:#2E7D32; }
.jiga-sub-btn { padding:4px 10px; border-radius:12px; border:1px solid #D0D7E2; font-size:11px; cursor:pointer; background:#fff; color:#555; }
.jiga-sub-btn.active { background:#43A047; color:#fff; border-color:#43A047; }
.imde-sec-tab { padding:5px 14px; border-radius:14px; border:1px solid #D0D7E2; font-size:12px; cursor:pointer; background:#fff; color:#555; }
.imde-sec-tab.active { background:#E65100; color:#fff; border-color:#E65100; }
.imde-cat-tab { padding:5px 14px; border-radius:14px; border:1px solid #D0D7E2; font-size:12px; cursor:pointer; background:#fff; color:#555; }
.imde-cat-tab.active { background:#F57C00; color:#fff; border-color:#F57C00; }
/* KPI */
.sm-summary { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:16px; }
.sm-kpi { background:#fff; border-radius:8px; padding:10px 12px; text-align:center; box-shadow:0 1px 4px rgba(0,0,0,0.08); border-top:3px solid #1976D2; }
.sm-kpi.kpi-seo { border-top-color:#E65100; }
.sm-kpi .kpi-val { font-size:18px; font-weight:700; color:#1F4E79; }
.sm-kpi.kpi-seo .kpi-val { color:#E65100; }
.sm-kpi .kpi-lbl { font-size:10px; color:#888; margin-top:3px; }
/* 차트 */
#stat-chart-wrap, #land-stat-chart-wrap { background:#fff; border-radius:8px; box-shadow:0 1px 4px rgba(0,0,0,0.08); padding:12px 8px 4px; }
#stat-chart-main { width:100%; display:block; }
.sm-legend { display:flex; gap:16px; justify-content:center; margin-top:10px; font-size:12px; color:#555; flex-wrap:wrap; }
.sm-legend span { display:inline-flex; align-items:center; gap:5px; }
.sm-legend i { display:inline-block; width:22px; height:3px; border-radius:2px; }
#stat-tooltip { position:fixed; background:rgba(20,30,50,0.92); color:#fff; font-size:12px; padding:8px 12px; border-radius:6px; pointer-events:none; display:none; z-index:2000; line-height:1.7; white-space:nowrap; box-shadow:0 4px 16px rgba(0,0,0,0.3); }

/* ── 통합 유형 체크박스 ── */
.type-chk-lbl { display:flex; align-items:center; gap:3px; font-size:10px; color:#c8dff0; cursor:pointer; }
.type-chk-lbl input[type=checkbox] { accent-color:var(--tc,#1976D2); width:12px; height:12px; margin:0; cursor:pointer; }
/* ── 마커 타입 배지 ── */
.tm-type-badge { display:inline-block; font-size:8px; font-weight:700; padding:0 3px; border-radius:3px; color:#fff; margin-right:3px; }
/* ── 규제구역 레이어 ── */
.zone-legend-dot { display:inline-block; width:10px; height:10px; border-radius:2px; margin-right:4px; vertical-align:middle; }
.zone-filter-btn { font-size:10px; padding:2px 7px; border-radius:10px; border:1px solid #ccc; background:#f5f7fa; color:#555; cursor:pointer; }
.zone-filter-btn.active { background:#2E7D32; color:#fff; border-color:#2E7D32; }
.zone-query-popup {
  background:#fff; border-radius:8px; box-shadow:0 4px 20px rgba(0,0,0,0.28);
  width:240px; padding:10px 12px; position:fixed; font-size:10px;
  pointer-events:auto; z-index:12000;
}
.zone-query-popup .zq-title { font-size:12px; font-weight:800; color:#333; margin-bottom:6px; padding-right:22px; }
.zone-query-popup .zq-row { display:flex; align-items:center; margin-bottom:3px; gap:6px; }
.zone-query-popup .zq-label { color:#999; width:60px; flex-shrink:0; }
.zone-query-popup .zq-val { color:#333; font-weight:600; }
.zone-query-popup .zq-close {
  position:absolute; top:4px; right:6px; background:#eceff1; border:none;
  font-size:15px; cursor:pointer; color:#455a64; width:24px; height:24px; border-radius:50%;
  line-height:1; display:flex; align-items:center; justify-content:center; z-index:3;
  pointer-events:auto; touch-action:manipulation;
}
.zone-query-popup .zq-close:hover { background:#cfd8dc; color:#111; }
.zone-query-popup .zq-link { margin-top:8px; }
.zone-query-popup .zq-link a { color:#1976D2; font-size:10px; text-decoration:none; }
/* ── 입도객 통계 모달 ── */
.visitor-tab { font-size:12px;font-weight:600;padding:6px 14px;border:none;background:none;color:#888;cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-2px; }
.visitor-tab.active { color:#0277BD;border-bottom-color:#0277BD; }
.visitor-card { background:#fff;border-radius:8px;padding:10px 14px;box-shadow:0 1px 6px rgba(0,0,0,0.08);flex:1;min-width:120px; }
.visitor-card .vc-label { font-size:10px;color:#888;margin-bottom:3px; }
.visitor-card .vc-val { font-size:18px;font-weight:800;color:#01579B; }
.visitor-card .vc-sub { font-size:10px;color:#aaa;margin-top:1px; }
/* ── 경매/공매 마커 & 팝업 ── */
.bid-marker { display:flex; flex-direction:column; align-items:center; cursor:pointer; }
.bid-marker-pin {
  width:0; height:0;
  border-left:8px solid transparent; border-right:8px solid transparent;
  border-bottom:16px solid currentColor;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}
.bid-marker-label {
  background:rgba(0,0,0,0.68); color:#fff; font-size:8px; font-weight:600;
  padding:1px 4px; border-radius:3px; margin-top:2px; white-space:nowrap;
  max-width:80px; overflow:hidden; text-overflow:ellipsis;
}
.bid-popup {
  background:#fff; border-radius:10px; box-shadow:0 4px 20px rgba(0,0,0,0.22);
  width:260px; overflow:hidden; position:relative;
}
.bid-popup-header { padding:10px 12px 8px; color:#fff; }
.bid-popup-type { font-size:10px; opacity:0.9; margin-bottom:3px; }
.bid-popup-name { font-size:13px; font-weight:800; line-height:1.3; }
.bid-popup-body { padding:10px 12px; font-size:10px; }
.bid-popup-row { display:flex; gap:6px; margin-bottom:3px; }
.bid-popup-label { color:#999; flex-shrink:0; width:48px; }
.bid-popup-val { color:#333; font-weight:600; }
.bid-popup-amt { font-size:13px; font-weight:800; }
.bid-popup-close {
  position:absolute; top:8px; right:10px; background:rgba(255,255,255,0.25);
  border:none; color:#fff; font-size:14px; width:22px; height:22px;
  border-radius:50%; cursor:pointer; line-height:1; font-weight:700;
}
.bid-popup-arrow { width:0; height:0; border-left:8px solid transparent; border-right:8px solid transparent; border-top:10px solid #fff; margin:0 auto; }
.bid-filter-btn { font-size:10px; padding:2px 7px; border-radius:10px; border:1px solid #ccc; background:#f5f7fa; color:#555; cursor:pointer; }
.bid-filter-btn.active { background:#B71C1C; color:#fff; border-color:#B71C1C; }
.bid-ext-btn { font-size:10px; padding:3px 10px; border-radius:6px; border:1px solid #1976D2; color:#1976D2; background:#fff; cursor:pointer; font-weight:600; }
.bid-ext-btn:hover { background:#1976D2; color:#fff; }
/* ── 건축인허가 마커 & 팝업 ── */
.arch-marker {
  display:flex; flex-direction:column; align-items:center; cursor:pointer;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
  transition: transform 0.12s;
}
.arch-marker:hover { transform: scale(1.12); }
.arch-marker-badge {
  display:flex; align-items:center; gap:4px;
  color:#fff; font-size:11px; font-weight:700;
  padding:4px 8px 4px 6px; border-radius:14px;
  border:2px solid rgba(255,255,255,0.85);
  white-space:nowrap; max-width:140px;
  overflow:hidden; text-overflow:ellipsis;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.arch-marker-badge .arch-icon { font-size:13px; flex-shrink:0; }
.arch-marker-name { overflow:hidden; text-overflow:ellipsis; max-width:100px; }
.arch-marker-tail {
  width:0; height:0;
  border-left:5px solid transparent;
  border-right:5px solid transparent;
}
.arch-popup {
  background:#fff; border-radius:10px; box-shadow:0 4px 20px rgba(0,0,0,0.22);
  width:250px; overflow:hidden; position:relative;
}
.arch-popup-header { padding:10px 12px 8px; color:#fff; }
.arch-popup-status { font-size:10px; font-weight:600; opacity:0.9; margin-bottom:3px; }
.arch-popup-name { font-size:13px; font-weight:800; line-height:1.3; }
.arch-popup-body { padding:10px 12px; font-size:10px; color:#555; line-height:1.7; }
.arch-popup-row { display:flex; gap:6px; }
.arch-popup-label { color:#999; flex-shrink:0; width:44px; }
.arch-popup-val { color:#333; font-weight:600; }
.arch-popup-close {
  position:absolute; top:8px; right:10px; background:rgba(255,255,255,0.25);
  border:none; color:#fff; font-size:14px; width:22px; height:22px;
  border-radius:50%; cursor:pointer; line-height:1; font-weight:700;
}
.arch-popup-arrow { width:0; height:0; border-left:8px solid transparent; border-right:8px solid transparent; border-top:10px solid #fff; margin:0 auto; }
.arch-filter-btn { font-size:10px; padding:2px 7px; border-radius:10px; border:1px solid #ccc; background:#f5f7fa; color:#555; cursor:pointer; }
.arch-filter-btn.active { background:#4A148C; color:#fff; border-color:#4A148C; }
#arch-load-btn { font-size:10px; margin:4px 6px 6px 25px; padding:3px 10px; border-radius:6px; border:1px solid #7B1FA2; color:#7B1FA2; background:#fff; cursor:pointer; font-weight:600; }
#arch-load-btn:hover { background:#7B1FA2; color:#fff; }
/* ── 개발사업 마커 & 팝업 ── */
.dev-marker {
  display: flex; flex-direction: column; align-items: center; cursor: pointer;
}
.dev-marker-pin {
  width: 56px; height: 56px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); border: 3px solid rgba(255,255,255,0.95);
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
}
.dev-marker-icon {
  transform: rotate(45deg); font-size: 26px; line-height: 1;
}
.dev-marker-label {
  background: rgba(0,0,0,0.78); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 7px; border-radius: 5px; margin-top: 4px; white-space: nowrap;
  max-width: 110px; overflow: hidden; text-overflow: ellipsis;
}
.dev-tab-btn {
  font-size:10px; padding:3px 9px; border-radius:10px; border:1px solid #ccc;
  background:#f0f2f5; color:#666; cursor:pointer; font-weight:600; transition:all 0.15s;
}
.dev-tab-btn.active {
  border-color:#1565C0; background:#1565C0; color:#fff;
}
.dev-km-btn {
  font-size:10px; padding:3px 9px; border-radius:10px; border:1px solid #ccc;
  background:#f0f2f5; color:#666; cursor:pointer; font-weight:600; transition:all 0.15s;
}
.dev-km-btn.active {
  border-color:#37474F; background:#37474F; color:#fff;
}
.dev-chart-mode {
  font-size:10px; padding:4px 7px; border-radius:7px; border:1px solid #c5cae9;
  background:#f5f7ff; color:#3949ab; cursor:pointer; font-weight:700; white-space:nowrap;
}
.dev-chart-mode.active {
  border-color:#1565C0; background:#1565C0; color:#fff;
}
.dev-stat-collapse {
  font-size:10px; padding:4px 8px; border-radius:7px; border:1px solid #90a4ae;
  background:#eceff1; color:#455a64; cursor:pointer; font-weight:700; white-space:nowrap;
}
.dev-stat-toolbar {
  flex-wrap: wrap;
}
.dev-popup {
  background: #fff; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.22);
  width: 280px; overflow: hidden; position: fixed; z-index: 10050;
  pointer-events: auto;
}
.dev-popup.dragging { opacity: 0.96; box-shadow: 0 8px 28px rgba(0,0,0,0.28); }
.dev-popup-header {
  padding: 10px 12px 8px; color: #fff; font-size: 12px; font-weight: 800;
  cursor: move; user-select: none; touch-action: none;
}
.dev-popup-status {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 8px;
  background: rgba(255,255,255,0.25); display: inline-block; margin-bottom: 4px;
}
.dev-popup-name { font-size: 14px; font-weight: 800; line-height: 1.3; }
.dev-popup-body {
  padding: 10px 12px; max-height: 440px; overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y;
}
.dev-popup-area { font-size: 10px; color: #888; margin-bottom: 6px; }
.dev-popup-desc { font-size: 11px; color: #444; line-height: 1.55; }
.dev-popup-close {
  position: absolute; top: 8px; right: 10px; background: rgba(255,255,255,0.25);
  border: none; color: #fff; font-size: 14px; width: 22px; height: 22px;
  border-radius: 50%; cursor: pointer; line-height: 1; font-weight: 700;
}
.dev-popup-arrow {
  width: 0; height: 0; border-left: 8px solid transparent;
  border-right: 8px solid transparent; border-top: 10px solid #fff;
  margin: 0 auto;
}
.dev-trade-list {
  max-height: 180px; overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y;
}
.dev-chart-area { margin-bottom: 8px; }
.dev-status-badge {
  font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 6px;
  display: inline-block; margin-left: 4px;
}
.dev-filter-row { display:flex; gap:3px; flex-wrap:wrap; padding:3px 6px 6px 25px; }
.dev-filter-btn { font-size:10px; padding:2px 7px; border-radius:10px; border:1px solid #ccc; background:#f5f7fa; color:#555; cursor:pointer; }
.dev-filter-btn.active { background:#546E7A; color:#fff; border-color:#546E7A; }
.dev-radius-row { padding:3px 6px 6px 25px; font-size:10px; color:#888; }
.dev-radius-btn { font-size:10px; padding:2px 6px; border-radius:8px; border:1px solid #ccc; background:#f5f7fa; color:#555; cursor:pointer; margin-right:3px; }
.dev-radius-btn.active { background:#37474F; color:#fff; border-color:#37474F; }
/* 토지 실거래 마커 */
.land-marker {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 58px; border-radius: 5px;
  border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  cursor: pointer; color: #fff;
  font-family: 'Malgun Gothic','Apple SD Gothic Neo',sans-serif;
  white-space: nowrap; padding: 3px 7px 4px; position: relative;
  transition: transform 0.12s;
}
.land-marker .lm-dong {
  font-size: 9px; font-weight: 500; opacity: 0.88; line-height: 1.2; margin-bottom: 1px;
}
.land-marker .lm-price {
  font-size: 12px; font-weight: 800; line-height: 1.2;
}
.land-marker::after {
  content:''; position:absolute; bottom:-5px; left:50%;
  transform:translateX(-50%);
  border-left:4px solid transparent; border-right:4px solid transparent;
}
.land-marker:hover { transform: scale(1.15); }
.land-marker.lm-dae  { background:#C62828; }
.land-marker.lm-dae::after  { border-top:5px solid #C62828; }
.land-marker.lm-farm { background:#2E7D32; }
.land-marker.lm-farm::after { border-top:5px solid #2E7D32; }
.land-marker.lm-imya { background:#5D4037; }
.land-marker.lm-imya::after { border-top:5px solid #5D4037; }
.land-marker.lm-etc  { background:#1565C0; }
.land-marker.lm-etc::after  { border-top:5px solid #1565C0; }
#land-popup {
  position: fixed; background: #fff; border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.18); width: 240px;
  border-top: 4px solid #5D4037; display: none; z-index: 600; padding: 12px 14px 10px;
}
#land-popup .lp-close { position:absolute; top:8px; right:10px; background:none; border:none; font-size:16px; cursor:pointer; color:#aaa; }
#land-popup .lp-jimok { font-size:11px; font-weight:700; margin-bottom:2px; }
#land-popup .lp-addr  { font-size:11px; color:#999; margin-bottom:6px; }
#land-popup .lp-price { font-size:16px; font-weight:700; color:#C62828; margin-bottom:4px; }
#land-popup .lp-meta  { font-size:11px; color:#666; line-height:1.6; }
.land-jimok-btn { font-size:10px; padding:2px 7px; border-radius:10px; border:1px solid #ccc; background:#f5f7fa; color:#555; cursor:pointer; }
.land-jimok-btn.active { background:#5D4037; color:#fff; border-color:#5D4037; }
.land-pd-btn { font-size:10px; padding:2px 7px; border-radius:10px; border:1px solid #ccc; background:#f5f7fa; color:#555; cursor:pointer; }
.land-pd-btn.active { background:#1565C0; color:#fff; border-color:#1565C0; }

/* 용도지역 오버레이 */
#zoning-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; display: none; z-index: 200; }
#zoning-overlay img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: fill; }

/* 토지필지 형상 분석기 iframe 패널 */
#cadastral-panel {
  position: absolute; top: 0; right: 0; width: 0; height: 100%;
  background: #fff; z-index: 400;
  box-shadow: -4px 0 16px rgba(0,0,0,0.18);
  transition: width 0.28s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden; display: flex; flex-direction: column;
}
#cadastral-panel.open { width: 55%; }
#cadastral-panel-header {
  background: #1F4E79; color: #fff;
  padding: 10px 14px; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; gap: 8px;
}
#cadastral-panel-header .cp-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#cadastral-panel-header .cp-close {
  background: rgba(255,255,255,0.15); border: none; color: #fff;
  border-radius: 4px; padding: 3px 10px; cursor: pointer; font-size: 13px;
  transition: background 0.15s; flex-shrink: 0;
}
#cadastral-panel-header .cp-close:hover { background: rgba(255,255,255,0.3); }
#cadastral-panel iframe {
  flex: 1; border: none; width: 100%; display: block;
}

/* ── 데이터 연결 모달 ── */
#data-modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 900;
  align-items: center; justify-content: center;
}
#data-modal-backdrop.open { display: flex; }
#data-modal {
  background: #fff; border-radius: 12px; width: 520px; max-height: 90vh;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.28);
  animation: modalIn 0.18s ease;
}
@keyframes modalIn { from { opacity:0; transform:scale(0.95); } to { opacity:1; transform:scale(1); } }
#data-modal-head {
  background: #1F4E79; color: #fff; padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
}
#data-modal-head h3 { font-size: 14px; font-weight: 700; margin: 0; }
#data-modal-head button { background: none; border: none; color: rgba(255,255,255,0.7); font-size: 20px; cursor: pointer; line-height: 1; }
#data-modal-head button:hover { color: #fff; }
.dm-tabs { display: flex; border-bottom: 2px solid #e8ecf0; padding: 0 18px; background: #f8fafc; }
.dm-tab {
  padding: 10px 18px; font-size: 12px; font-weight: 700; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  color: #888; transition: all 0.15s; font-family: inherit;
  background: none; border-top: none; border-left: none; border-right: none;
}
.dm-tab.active { color: #1F4E79; border-bottom-color: #1F4E79; }
.dm-body { padding: 20px 18px; overflow-y: auto; flex: 1; }
.dm-section { display: none; }
.dm-section.active { display: block; }

/* CSV 드롭존 */
#csv-dropzone {
  border: 2px dashed #C5CAE9; border-radius: 8px; padding: 32px 20px;
  text-align: center; cursor: pointer; transition: all 0.15s;
  background: #F5F7FF; margin-bottom: 12px;
}
#csv-dropzone:hover, #csv-dropzone.drag-over { border-color: #1976D2; background: #E8F0FE; }
#csv-dropzone .dz-icon { font-size: 32px; margin-bottom: 8px; }
#csv-dropzone .dz-label { font-size: 13px; font-weight: 600; color: #1F4E79; margin-bottom: 4px; }
#csv-dropzone .dz-sub { font-size: 11px; color: #999; }
#csv-file-input { display: none; }
#csv-preview { font-size: 11px; background: #f3f4f6; border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; display: none; }
#csv-preview .cp-ok { color: #2E7D32; font-weight: 700; }
#csv-preview .cp-warn { color: #E65100; }

/* API 연결 */
.dm-field { margin-bottom: 14px; }
.dm-field label { display: block; font-size: 11px; font-weight: 700; color: #555; margin-bottom: 5px; }
.dm-field input, .dm-field select {
  width: 100%; padding: 8px 10px; border: 1px solid #D0D7E2;
  border-radius: 5px; font-size: 12px; font-family: inherit; outline: none;
  transition: border-color 0.15s;
}
.dm-field input:focus, .dm-field select:focus { border-color: #1976D2; }
.dm-field .hint { font-size: 10px; color: #aaa; margin-top: 4px; }
.dm-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 진행 상태 */
#dm-progress { display: none; margin-bottom: 12px; }
#dm-progress-bar-wrap { background: #e8ecf0; border-radius: 4px; height: 6px; overflow: hidden; margin-bottom: 4px; }
#dm-progress-bar { height: 100%; background: #1976D2; border-radius: 4px; transition: width 0.2s; width: 0%; }
#dm-progress-text { font-size: 11px; color: #666; }

/* 모달 하단 버튼 */
#data-modal-foot {
  padding: 12px 18px; border-top: 1px solid #eee;
  display: flex; gap: 8px; justify-content: flex-end;
}
.dm-btn {
  padding: 8px 20px; border-radius: 6px; font-size: 12px; font-family: inherit;
  font-weight: 700; cursor: pointer; border: none; transition: all 0.15s;
}
.dm-btn.primary { background: #1F4E79; color: #fff; }
.dm-btn.primary:hover { background: #163a5e; }
.dm-btn.secondary { background: #F5F7FA; color: #555; border: 1px solid #D0D7E2; }
.dm-btn.secondary:hover { background: #e8ecf0; }
.dm-btn:disabled { opacity: 0.5; pointer-events: none; }

/* 데이터 연결 버튼 (레이어 패널) */
#trade-data-btn {
  display: flex; align-items: center; gap: 6px;
  margin: 2px 6px 6px; padding: 6px 10px; border-radius: 5px;
  background: #EAF2FB; border: 1px solid #BBDEFB; cursor: pointer;
  font-size: 11px; font-weight: 700; color: #1565C0; font-family: inherit;
  transition: background 0.12s; width: calc(100% - 12px);
}
#trade-data-btn:hover { background: #BBDEFB; }
#trade-data-source { font-size: 10px; color: #888; padding: 0 6px 6px 6px; }

/* 색상 범례 */
#map-legend {
  position: absolute; bottom: 28px; right: 12px;
  background: rgba(255,255,255,0.96); border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.16); z-index: 300;
  font-size: 11px; min-width: 150px; overflow: hidden;
  pointer-events: none;
}
#map-legend:empty, #map-legend:not(:has(.ml-section[style*="block"])) { display: none; }
.ml-section { padding: 8px 11px 6px; border-top: 1px solid #eee; }
.ml-section:first-child { border-top: none; }
.ml-title { font-weight: 700; color: #1F4E79; margin-bottom: 5px; font-size: 10px; }
.ml-row { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; color: #444; }
.ml-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.ml-note { font-size: 9px; color: #999; margin-top: 3px; }

/* 용도지역 범례 */
#zoning-legend { display: none; position: absolute; bottom: 28px; left: 12px; background: rgba(255,255,255,0.95); border-radius: 7px; padding: 8px 11px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); z-index: 300; font-size: 11px; min-width: 130px; }
#zoning-legend .zl-title { font-weight: 700; color: #1F4E79; margin-bottom: 6px; font-size: 11px; border-bottom: 1px solid #e0e0e0; padding-bottom: 4px; }
#zoning-legend .zl-row { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
#zoning-legend .zl-dot { width: 13px; height: 13px; border-radius: 2px; flex-shrink: 0; }
#zoning-legend .zl-lbl { color: #444; }

#toast { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: #333; color: #fff; padding: 8px 18px; border-radius: 20px; font-size: 12px; z-index: 500; opacity: 0; transition: opacity 0.3s; pointer-events: none; white-space: nowrap; }

#info-panel { width: 240px; background: #0d2240; border-left: 1px solid #0a3d52; display: flex; flex-direction: column; overflow: hidden; flex-shrink: 0; z-index: 10; }
#info-panel .ip-header { background: #081a30; color: #e2f0ef; padding: 11px 12px; font-size: 12px; font-weight: 700; border-bottom: 1px solid #0a3d52; }
#info-panel .ip-body { flex: 1; overflow-y: auto; padding: 10px; }
.stat-chip { background: rgba(13,148,136,0.12); border: 1px solid rgba(125,211,200,0.12); border-radius: 5px; padding: 9px 10px; margin-bottom: 7px; }
.stat-chip .sc-lbl { font-size: 10px; color: #7dd3c8; margin-bottom: 2px; }
.stat-chip .sc-val { font-size: 17px; font-weight: 700; color: #e2f0ef; }
.stat-chip .sc-chg { font-size: 10px; margin-top: 1px; }
.sc-chg.up { color: #ff8a80; } .sc-chg.dn { color: #80d8ff; }
.area-rank .ar-title { font-size: 10px; font-weight: 700; color: #7dd3c8; margin-bottom: 5px; }
.rank-row { display: flex; align-items: center; padding: 6px 4px; border-bottom: 1px solid rgba(125,211,200,0.1); cursor: pointer; border-radius: 4px; transition: background 0.15s; }
.rank-row:hover { background: rgba(125,211,200,0.12); }
.rank-row .r-rank { color: #7dd3c8; font-weight: 700; width: 14px; flex-shrink: 0; font-size: 11px; }
.ar-period-btn { flex:1; background:rgba(125,211,200,0.08); border:1px solid rgba(125,211,200,0.2); color:#7dd3c8; font-size:10px; font-weight:600; padding:3px 0; border-radius:4px; cursor:pointer; transition:all 0.15s; }
.ar-period-btn:hover { background:rgba(125,211,200,0.18); }
.ar-period-btn.active { background:#0d9488; border-color:#0d9488; color:#fff; }
.rank-row-inner { display:flex; flex-direction:column; flex:1; min-width:0; padding:0 4px; }
.rank-row-name { color:#b0cce0; font-size:11px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rank-row-stats { display:flex; gap:6px; margin-top:1px; }
.rank-row-avg { color:#ffd180; font-size:10px; font-weight:700; }
.rank-row-max { color:#ff8a65; font-size:10px; font-weight:600; }
.dong-popup-item { display: flex; justify-content: space-between; align-items: center; padding: 7px 14px; border-bottom: 1px solid #f0f0f0; font-size: 11px; cursor: pointer; }
.dong-popup-item:hover { background: #f5f9ff; }
.dong-popup-item .dpi-name { font-weight: 600; color: #1F4E79; flex: 1; }
.dong-popup-item .dpi-area { color: #888; font-size: 10px; padding: 0 8px; }
.dong-popup-item .dpi-price { font-weight: 700; color: #C62828; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: #c0c8d0; border-radius: 2px; }

