* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; font-family: -apple-system, "Hiragino Sans", "Yu Gothic", sans-serif; }
body { display: flex; flex-direction: column; height: 100vh; }

.topbar {
  background: #1f4e79;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.topbar h1 { margin: 0; font-size: 18px; font-weight: 600; }
.filter { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.filter label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.filter input { margin: 0; }
.counter { opacity: 0.85; font-size: 13px; }

main { flex: 1; min-height: 0; position: relative; }
#map { width: 100%; height: 100%; min-height: 480px; position: absolute; inset: 0; }

.city-marker {
  background: #1f4e79;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  width: 36px !important;
  height: 36px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.city-marker.all-visited { background: #2e7d32; }
.city-marker.partial-visited { background: #ef6c00; }

.popup-city { font-weight: 700; font-size: 15px; margin-bottom: 6px; color: #1f4e79; }
.popup-list { max-height: 280px; overflow-y: auto; padding: 0; margin: 0; list-style: none; }
.popup-list li {
  border-top: 1px solid #eee;
  padding: 8px 4px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.popup-list li:first-child { border-top: none; }
.popup-list label { flex: 1; cursor: pointer; }
.popup-list .name { font-weight: 600; color: #222; }
.popup-list .meta { font-size: 12px; color: #555; line-height: 1.45; margin-top: 2px; }
.popup-list .visited .name { text-decoration: line-through; color: #888; }
.leaflet-popup-content { width: 320px !important; margin: 12px 14px; }
