:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --border: rgba(11, 11, 11, 0.10);
  /* 군집 색: 검증한 4색 (파랑, 노랑, 청록, 빨강) */
  --c0: #2a78d6;
  --c1: #eda100;
  --c2: #1baf7a;
  --c3: #e34948;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  line-height: 1.5;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

h1 { font-size: 1.75rem; margin: 0 0 4px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
.sub { margin: 0 0 24px; color: var(--text-secondary); }
.note { margin: 10px 0 0; font-size: 0.85rem; color: var(--text-secondary); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.card .name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-primary);
}
.card .count {
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 4px;
}
.card .count small { font-size: 0.9rem; font-weight: 400; color: var(--text-secondary); }
.card .id { font-size: 0.8rem; color: var(--muted); }

.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 20px;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--grid); text-align: left; white-space: nowrap; }
th { color: var(--text-secondary); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 700; border-top: 2px solid var(--grid); border-bottom: none; }
td .label { display: inline-flex; align-items: center; gap: 8px; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin-bottom: 8px;
}
.filter-group { display: flex; flex-wrap: wrap; gap: 8px; }
.filters label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  user-select: none;
}
.filters label:hover { background: #f0efec; }
.top100 { font-weight: 600; }

.visible { margin: 4px 0 10px; color: var(--text-secondary); font-size: 0.9rem; }
.visible b { color: var(--text-primary); }

#map {
  height: 620px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.leaflet-popup-content { font-family: inherit; font-size: 0.9rem; line-height: 1.6; }
.leaflet-popup-content b { font-weight: 600; }

/* 사이트 메뉴 (대시보드와 소개 페이지 공통) */
.topnav {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
}
.topnav a {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
}
.topnav a:hover { background: #f0efec; color: var(--text-primary); }
.topnav a[aria-current="page"] {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-weight: 600;
}

/* 소개 페이지 */
.item-title { font-size: 1rem; margin: 0 0 8px; }
.item-title a, .contact a { color: var(--c0); }
.facts { margin: 0; padding-left: 20px; }
.facts li { margin-bottom: 6px; }
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chips li {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
}
.contact { margin: 0; }

@media (max-width: 600px) {
  #map { height: 460px; }
  h1 { font-size: 1.4rem; }
}
