:root {
  --bg: #faf8f4;
  --panel: #ffffff;
  --ink: #23201c;
  --muted: #7a736a;
  --line: #e8e2d8;
  --accent: #b5502a;
  --cafe: #8a5a2b;
  --sight: #4a6fa5;
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

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

html, body, #app { height: 100%; }
body { background: var(--bg); color: var(--ink); }

#app { display: flex; }

/* ───── Sidebar ───── */
#sidebar {
  width: 400px; min-width: 320px; height: 100%;
  display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid var(--line);
  z-index: 1000;
}

#controls { padding: 18px 18px 10px; display: flex; flex-direction: column; gap: 8px; }

#search {
  width: 100%; padding: 9px 12px; font-size: 13.5px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--ink); outline: none;
}
#search:focus { border-color: var(--accent); }

.row { display: flex; gap: 6px; }

.type-btn {
  flex: 1; padding: 7px 0; font-size: 12.5px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
  color: var(--muted); transition: all .15s;
}
.type-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }

#area-select {
  padding: 8px 10px; font-size: 12.5px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--panel); color: var(--ink);
}

#count { padding: 4px 18px 6px; font-size: 11.5px; color: var(--muted); }

#list { flex: 1; overflow-y: auto; padding: 0 12px 12px; }

.card {
  padding: 12px 12px 10px; margin-bottom: 8px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: #cfc5b6; }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(181, 80, 42, .15); }

.card .top { display: flex; align-items: baseline; gap: 6px; }
.card .name { font-size: 14px; font-weight: 650; }
.card .kr { font-size: 12px; color: var(--muted); }
.card .badge {
  display: inline-block; margin-top: 5px; padding: 2.5px 8px;
  font-size: 10.5px; font-weight: 600; border-radius: 999px;
  background: #f6efe3; color: #8a6420; border: 1px solid #eadfc8;
}
.card.attraction .badge { background: #e9eff8; color: #3d5f91; border-color: #d5e1f2; }
.card .desc { font-size: 12px; color: #55504a; line-height: 1.45; margin-top: 6px; }
.card .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; }
.card .station { font-size: 11px; color: var(--muted); }
.card .tags { display: flex; gap: 3px; }
.card .tag { font-size: 12px; }

#foot {
  padding: 9px 18px; font-size: 10.5px; color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ───── Map ───── */
#map { flex: 1; height: 100%; background: #e8e4dc; }

.marker-pin {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg); border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.marker-pin span { transform: rotate(45deg); font-size: 14px; line-height: 1; }
.marker-pin.cafe { background: var(--cafe); }
.marker-pin.attraction { background: var(--sight); }
.marker-pin.dim { opacity: .25; filter: grayscale(.6); }

.leaflet-popup-content-wrapper { border-radius: 12px; font-family: inherit; }
.leaflet-popup-content { margin: 14px 16px; width: 260px !important; }
.pop .name { font-size: 14.5px; font-weight: 700; }
.pop .kr { font-size: 12px; color: var(--muted); }
.pop .badge {
  display: inline-block; margin: 6px 0 4px; padding: 2.5px 8px;
  font-size: 10.5px; font-weight: 600; border-radius: 999px;
  background: #f6efe3; color: #8a6420;
}
.pop .desc { font-size: 12px; line-height: 1.45; color: #45403a; }
.pop .station { font-size: 11px; color: var(--muted); margin-top: 6px; }
.pop .links { display: flex; gap: 8px; margin-top: 8px; }
.pop .links a {
  font-size: 11.5px; font-weight: 600; color: var(--accent); text-decoration: none;
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
}
.pop .links a:hover { background: var(--bg); }

/* ───── Mobile ───── */
@media (max-width: 760px) {
  #app { flex-direction: column-reverse; }
  #sidebar { width: 100%; height: 52%; border-right: none; border-top: 1px solid var(--line); }
  #map { height: 48%; }
}
