* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: #1a1a1a;
  background: #f4f6f8;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid #e2e8f0;
  backdrop-filter: blur(8px);
}

.header h1 {
  margin: 0;
  font-size: 1.15rem;
}

.subtitle {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: #64748b;
}

.stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 0.82rem;
  color: #475569;
}

.sidebar {
  position: fixed;
  top: 72px;
  left: 0;
  bottom: 0;
  width: 360px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  box-shadow: 2px 0 12px rgba(15, 23, 42, 0.06);
}

.sidebar-header {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.sidebar-header input,
.sidebar-header select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9rem;
}

.listing-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.listing-item {
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f7;
  cursor: pointer;
  transition: background 0.15s ease;
}

.listing-item:hover,
.listing-item.active {
  background: #eff6ff;
}

.listing-item h3 {
  margin: 0 0 6px;
  font-size: 0.92rem;
  line-height: 1.4;
}

.listing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.78rem;
  color: #64748b;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
}

.badge.price {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
}

#map {
  position: fixed;
  top: 72px;
  left: 360px;
  right: 0;
  bottom: 0;
  background: #e8eef4;
}

.map-toolbar {
  position: fixed;
  top: 84px;
  right: 16px;
  z-index: 950;
}

.export-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  color: #1d4ed8;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.export-btn:hover {
  background: #eff6ff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.export-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.popup-content h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.popup-content p {
  margin: 4px 0;
  font-size: 0.82rem;
  color: #475569;
}

.popup-content a {
  display: inline-block;
  margin-top: 8px;
  color: #2563eb;
  font-size: 0.82rem;
  text-decoration: none;
}

@media (max-width: 900px) {
  .sidebar {
    width: 100%;
    height: 38vh;
    top: auto;
    bottom: 0;
    border-right: none;
    border-top: 1px solid #e2e8f0;
  }

  #map {
    left: 0;
    right: 0;
    bottom: 38vh;
  }

  .map-toolbar {
    top: auto;
    bottom: calc(38vh + 12px);
    right: 12px;
  }
}