html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

#map {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.leaflet-control-attribution {
  display: none;
}

#panel {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  padding: 12px 14px;
  width: 260px;
  font-size: 13px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}

#panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
}

#count-badge {
  background: #2563eb;
  color: white;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
}

#legend label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  cursor: pointer;
}

#legend .cnt {
  margin-left: auto;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0,0,0,0.25);
  flex-shrink: 0;
}

.dot-built { background: #22c55e; }
.dot-not_built { background: #ef4444; }
.dot-not_building { background: #9ca3af; }
.dot-invalid { background: #d1d5db; }
.dot-error { background: #f59e0b; }
.dot-other { background: #3b82f6; }

#search {
  width: 100%;
  box-sizing: border-box;
  margin-top: 10px;
  padding: 7px 9px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
}

.custom-marker {
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 3px rgba(0,0,0,0.6);
}
.custom-marker.built { background: #22c55e; }
.custom-marker.not_built { background: #ef4444; }
.custom-marker.not_building { background: #9ca3af; }
.custom-marker.invalid { background: #d1d5db; }
.custom-marker.error { background: #f59e0b; }
.custom-marker.other { background: #3b82f6; }

.marker-cluster div {
  border: 2px solid #ffffff !important;
  box-shadow: 0 0 4px rgba(0,0,0,0.5);
}

.leaflet-popup-content {
  font-size: 13px;
  line-height: 1.5;
  width: 280px !important;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.leaflet-popup-content b {
  font-size: 14px;
}

.popup-row {
  margin-top: 4px;
}

.popup-label {
  color: #6b7280;
}

.popup-status {
  display: block;
  padding: 4px 8px;
  border-radius: 8px;
  color: white;
  font-size: 12px;
  margin-top: 6px;
  white-space: normal;
  word-break: break-word;
}

.status-built { background: #22c55e; }
.status-not_built { background: #ef4444; }
.status-not_building { background: #9ca3af; }
.status-invalid { background: #9ca3af; }
.status-error { background: #f59e0b; }
.status-other { background: #3b82f6; }
