* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
}

#map {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0; left: 0;
}

/* ── 컨트롤 패널 ── */
#panel {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(255,255,255,0.96);
  border: 1px solid #dde0ea;
  border-radius: 14px;
  padding: 12px 18px;
  backdrop-filter: blur(12px);
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 300px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.lang-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#map-title {
  font-size: 1rem;
  font-weight: 800;
  color: #3344aa;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 언어 토글 ── */
.credit-box {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0,0,0,0.03);
  border: 1px solid #dde0ea;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.72rem;
  color: #667799;
  white-space: nowrap;
  user-select: none;
  cursor: default;
}
.credit-box a { color: #4455bb; text-decoration: none; }
.credit-box a:hover { color: #2233aa; text-decoration: underline; }

.lang-opt {
  color: #aabbcc;
  cursor: pointer;
  transition: color 0.15s;
}
.lang-opt.active { color: #3344aa; font-weight: 700; }
.lang-opt:hover { color: #2233aa; }
.lang-sep { color: #ccddee; }

/* ── 레이어 체크박스 ── */
#layer-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.74rem;
}
#layer-controls label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #556688;
  cursor: pointer;
  user-select: none;
}
#layer-controls input[type=checkbox] {
  accent-color: #4455ff;
  width: 12px; height: 12px;
  cursor: pointer;
}

/* ── 필터 슬라이더 ── */
#filter-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #778899;
}
#min-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: #dde0ea;
  border-radius: 2px;
  outline: none;
  flex: 1;
  min-width: 70px;
  cursor: pointer;
}
#min-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #4455ff;
  cursor: pointer;
}
#min-slider::-moz-range-thumb {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #4455ff;
  border: none;
  cursor: pointer;
}

/* ── 통계 ── */
#stats-area {
  font-size: 0.7rem;
  color: #889aaa;
}
#shown-cnt { color: #3344aa; font-weight: 800; }

/* ── 범례 ── */
#legend {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.leg-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.67rem;
  color: #778899;
}
.leg-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── 리포트 링크 & 크레딧 ── */
#src-report-link {
  font-size: 0.72rem;
  color: #4466cc;
  text-decoration: none;
  transition: color 0.15s;
  display: inline-block;
}
#src-report-link:hover { color: #2244aa; }

#credit-dev, #credit-source {
  font-size: 0.63rem;
  color: #99aabb;
}
#credit-dev a, #credit-source a {
  color: #7788aa;
  text-decoration: none;
}
#credit-dev a:hover, #credit-source a:hover { color: #4455bb; }

#disclaim {
  font-size: 0.6rem;
  color: #aabbcc;
}

/* ── 검색 버튼 ── */
#search-btn {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1000;
  background: rgba(255,255,255,0.96);
  border: 1px solid #dde0ea;
  border-radius: 10px;
  padding: 7px 14px;
  color: #4455bb;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.15s;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
#search-btn:hover, #search-btn.active {
  background: rgba(68,85,255,0.1);
  border-color: #4455ff;
  color: #2233cc;
}

/* ── 검색 모달 ── */
#search-modal {
  position: fixed;
  z-index: 1500;
  background: rgba(255,255,255,0.98);
  border: 1px solid #dde0ea;
  border-radius: 12px;
  padding: 14px;
  width: 340px;
  max-width: 90vw;
  max-height: 65vh;
  overflow-y: auto;
  display: none;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
#search-input {
  width: 100%;
  background: #f5f6fa;
  border: 1px solid #dde0ea;
  border-radius: 8px;
  padding: 8px 12px;
  color: #1a1a2e;
  font-size: 0.85rem;
  outline: none;
  font-family: inherit;
  margin-bottom: 10px;
  display: block;
}
#search-input::placeholder { color: #aabbcc; }
#search-input:focus { border-color: #4455ff; }

#party-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}
.party-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 10px;
  font-size: 0.69rem;
  border: 1px solid;
  background: rgba(0,0,0,0.02);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

#member-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.member-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 0.79rem;
  color: #1a1a2e;
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
}
.member-chip:hover { background: rgba(68,85,255,0.07); }
.member-chip.selected { background: rgba(68,85,255,0.15); color: #2233cc; }

.member-party-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.member-chip-cnt {
  margin-left: auto;
  font-size: 0.68rem;
  color: #99aacc;
}

#no-member-results {
  font-size: 0.78rem;
  color: #aabbcc;
  padding: 10px;
  text-align: center;
  display: none;
}

/* ── 방문 의원 필터바 ── */
#visitor-filter-bar {
  position: fixed;
  z-index: 1200;
  background: rgba(255,255,255,0.97);
  border: 1px solid #dde0ea;
  border-radius: 10px;
  padding: 6px 14px;
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: #556688;
  backdrop-filter: blur(12px);
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
#visitor-filter-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
#reset-visitor-filter {
  background: rgba(68,85,255,0.08);
  border: 1px solid rgba(68,85,255,0.25);
  border-radius: 6px;
  padding: 3px 10px;
  color: #4455bb;
  font-size: 0.7rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
#reset-visitor-filter:hover { background: rgba(68,85,255,0.18); color: #2233cc; }

/* ── 레스토랑 모달 ── */
#overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.2);
  z-index: 2000;
  display: none;
}
#modal-fixed {
  position: fixed;
  top: 0; left: 0;
  width: 360px;
  max-width: 90vw;
  height: 100%;
  z-index: 2100;
  display: none;
  background: rgba(255,255,255,0.99);
  border-right: 1px solid #dde0ea;
  padding: 60px 24px 32px;
  box-shadow: 6px 0 30px rgba(0,0,0,0.1);
  overflow-y: auto;
  color: #1a1a2e;
  line-height: 1.7;
}
#modal-close {
  position: absolute;
  top: 18px; right: 18px;
  cursor: pointer;
  color: #4455bb;
  transition: color 0.2s;
  width: 24px; height: 24px;
}
#modal-close:hover { color: #1a1a2e; }
#modal-close svg { width: 24px; height: 24px; }

/* ── 모달 콘텐츠 ── */
.tip-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1a1a2e;
  display: block;
  margin-bottom: 10px;
  word-break: keep-all;
  line-height: 1.3;
}
.tip-kata {
  display: block;
  font-size: 0.82rem;
  color: #99aabb;
  font-weight: 400;
  margin-top: 3px;
  letter-spacing: 0.02em;
}
.tip-popular {
  color: #dd3333;
  font-weight: bold;
  font-size: 0.74rem;
}
.tip-press-badge {
  color: #0099bb;
  font-weight: bold;
  font-size: 0.74rem;
}
.tip-jinsook-badge {
  color: #cc7700;
  font-weight: bold;
  font-size: 0.74rem;
}
.tip-row {
  font-size: 0.92rem;
  color: #556688;
  display: block;
  margin-bottom: 5px;
}
.tip-val { color: #1a1a2e; font-weight: 700; }
.tip-btn {
  display: block;
  padding: 7px 14px;
  background: #f5f6fa;
  border: 1px solid #dde0ea;
  color: #4455bb;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s;
}
.tip-btn:hover { background: #eaedf5; border-color: #aabbdd; color: #2233aa; }

/* ── 방문 의원 칩 ── */
.visitors-section {
  margin-top: 16px;
  border-top: 1px solid #edf0f5;
  padding-top: 12px;
}
.visitors-title {
  font-size: 0.73rem;
  color: #99aabb;
  margin-bottom: 8px;
}
.visitors-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.visitor-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px 2px 0;
  border-radius: 10px;
  font-size: 0.68rem;
  border: 1px solid #dde0ea;
  background: #f8f9fc;
  color: #445566;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.1s, color 0.1s;
}
.visitor-chip:hover { border-color: #aabbdd; color: #1a1a2e; }

.visitor-party-dot {
  width: 12px;
  align-self: stretch;
  flex-shrink: 0;
  margin-right: 5px;
}

.visitor-more-btn {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 0.68rem;
  border: 1px dashed #ccddee;
  color: #889aaa;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.visitor-more-btn:hover { color: #4455bb; border-color: #4455bb; }

/* ── Leaflet 기본 오버라이드 ── */
.leaflet-container { background: #f0f2f5 !important; }
.leaflet-control-zoom a {
  background: rgba(255,255,255,0.95) !important;
  color: #4455bb !important;
  border: 1px solid #dde0ea !important;
}
.leaflet-control-zoom a:hover {
  background: rgba(230,235,255,0.95) !important;
  color: #2233cc !important;
}
.leaflet-control-attribution {
  background: rgba(255,255,255,0.75) !important;
  color: #99aabb !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: #7788aa !important; }

/* ── 모바일 ── */
@media (max-width: 500px) {
  #panel { min-width: 88vw; padding: 10px 14px; gap: 6px; }
  #map-title { font-size: 0.88rem; }
  #search-btn { padding: 6px 10px; font-size: 0.72rem; }
  #modal-fixed {
    width: 100%;
    height: 72%;
    top: auto; bottom: 0;
    border-right: none;
    border-top: 1px solid #dde0ea;
    padding: 36px 16px 24px;
    max-width: 100vw;
  }
  #search-modal { width: 92vw; }
}
