* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: #1f2937;
}

body { display: flex; }

#sidebar {
  width: 360px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e5e7eb;
  background: #fff;
}

#sidebar header { padding: 16px 16px 8px; }
#sidebar h1 { margin: 0; font-size: 18px; }

#updated {
  margin: 4px 0 0;
  font-size: 12px;
  color: #9ca3af;
}

#notice {
  margin: 8px 0 0;
  padding: 8px 10px;
  font-size: 12px;
  background: #fef3c7;
  border-radius: 6px;
}

.filters {
  display: grid;
  gap: 10px;
  padding: 8px 16px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.filters label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}

.filters select, .filters input[type="search"], .filters input[type="text"] {
  padding: 8px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
}

.combo { position: relative; }
.combo input {
  width: 100%;
  padding-right: 28px !important;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%236b7280' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center !important;
}

.combo-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 1000;
  max-height: 320px;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  list-style: none;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}

.combo-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  font-size: 14px;
  font-weight: 400;
  color: #1f2937;
  cursor: pointer;
}

.combo-list li:hover, .combo-list li.active { background: #eff6ff; }
.combo-list li.selected { font-weight: 700; color: #1d4ed8; }
.combo-list li.empty { color: #9ca3af; cursor: default; }
.combo-list .count { color: #9ca3af; font-size: 12px; }

#status {
  padding: 8px 16px;
  font-size: 12px;
  color: #6b7280;
}

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

#list li {
  padding: 10px 16px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
}

#list li:hover, #list li.active { background: #eff6ff; }

#list .name {
  font-size: 14px;
  font-weight: 600;
  color: #1d4ed8;
  text-decoration: none;
}

#list .name:hover { text-decoration: underline; }

#list .meta {
  margin-top: 2px;
  font-size: 12px;
  color: #6b7280;
}

#list .badge {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  font-size: 11px;
  color: #047857;
  background: #ecfdf5;
  border-radius: 4px;
}

#more {
  margin: 8px 16px 16px;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

#map { flex: 1; height: 100%; }

.popup-name {
  font-size: 14px;
  font-weight: 700;
  color: #03c75a;
}

.popup-meta { margin-top: 4px; color: #4b5563; }

.highlight-marker {
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, .6);
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  to { box-shadow: 0 0 0 18px rgba(239, 68, 68, 0); }
}

@media (max-width: 720px) {
  body { flex-direction: column-reverse; }
  #sidebar { width: 100%; height: 50%; border-right: 0; border-top: 1px solid #e5e7eb; }
  #map { height: 50%; }
}
