:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #6b7686;
  --line: #e2e6ec;
  --accent: #2563eb;
  --red: #e00000;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Apple SD Gothic Neo", "Malgun Gothic",
    "Noto Sans KR", sans-serif;
  line-height: 1.5;
}

.top { padding: 20px 24px 8px; }
.top h1 { margin: 0; font-size: 22px; }
.top p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

main {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  padding: 12px 24px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}
.panel h2 { margin: 0 0 12px; font-size: 16px; }

/* 슬라이더 */
.slider-item { margin-bottom: 14px; }
.slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}
.slider-head .name { display: flex; align-items: center; gap: 6px; }
.dot {
  width: 12px; height: 12px; border-radius: 50%;
  display: inline-block;
}
.slider-head .cnt { color: var(--muted); }
.slider-head .cnt strong { color: var(--text); font-size: 15px; }
input[type=range] { width: 100%; }

.total-line {
  font-size: 14px; padding: 8px 0; border-top: 1px dashed var(--line);
}

.btn-row { display: flex; gap: 8px; margin-top: 4px; }
button {
  font: inherit; font-size: 13px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--text); cursor: pointer;
}
button:hover { background: #f0f3f8; }
button.primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
  font-weight: 600;
}
button.primary:hover { background: #1d4ed8; }
button.primary.dirty { box-shadow: 0 0 0 3px rgba(37, 99, 235, .3); }

.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.check { font-size: 13px; display: flex; gap: 6px; align-items: center; }

#legend { margin-top: 10px; font-size: 12px; color: var(--muted); }

/* 지도 */
.mapwrap { position: relative; }
#map {
  height: 620px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.map-note {
  position: absolute; left: 12px; bottom: 12px; z-index: 500;
  background: rgba(255, 255, 255, .92);
  padding: 4px 10px; border-radius: 6px; font-size: 12px;
}
.swatch-red {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 3px solid var(--red); vertical-align: -2px;
}

/* 표 영역 */
.tables { padding: 4px 24px 24px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px;
}
.card .lbl { font-size: 12px; color: var(--muted); }
.card .val { font-size: 22px; font-weight: 700; }

.grid2 {
  display: grid; grid-template-columns: 340px 1fr;
  gap: 16px; margin-top: 16px;
}
.row-between {
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px;
}
.row-gap { display: flex; gap: 10px; align-items: center; font-size: 13px; }
select {
  font: inherit; font-size: 13px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 8px;
}

.scroll { max-height: 360px; overflow: auto; }
.scroll.tall { max-height: 460px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
  padding: 6px 8px; border-bottom: 1px solid var(--line);
  text-align: left; white-space: nowrap;
}
th {
  position: sticky; top: 0; background: #f0f3f8;
  cursor: pointer; user-select: none;
}
#tbl-gu th { cursor: default; }
.num { text-align: right; }
tbody tr:hover { background: #f6f9ff; }
#tbl-st tbody tr { cursor: pointer; }
.bar {
  height: 8px; background: var(--accent); border-radius: 4px; opacity: .7;
}
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  color: #fff; font-size: 12px;
}

footer {
  padding: 16px 24px 28px; font-size: 12px; color: var(--muted);
}

/* 모바일 */
@media (max-width: 900px) {
  main { grid-template-columns: 1fr; padding: 12px 16px; }
  .tables { padding: 4px 16px 24px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  #map { height: 460px; }
}
