* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { display: flex; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 14px; color: #222; }

#sidebar { width: 310px; flex: none; overflow-y: auto; padding: 16px; border-right: 1px solid #ddd; background: #fff; position: relative; }
#map { flex: 1; }

header h1 { margin: 0; font-size: 22px; }
header p { margin: 4px 0 12px; color: #666; }

#search { width: 100%; padding: 8px; border: 1px solid #ccc; font-size: 14px; }
#results { list-style: none; margin: 0; padding: 0; border: 1px solid #ccc; border-top: 0; max-height: 240px; overflow-y: auto; position: absolute; left: 16px; right: 16px; background: #fff; z-index: 1000; }
#results li { padding: 6px 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
#results li:hover { background: #f0f0f0; }
#results small { color: #888; }

section { margin-top: 16px; border-top: 1px solid #eee; padding-top: 10px; }
section h2 { font-size: 15px; margin: 0 0 6px; }
.filters label { display: flex; align-items: center; gap: 8px; padding: 3px 0 3px 18px; cursor: pointer; }
.filters .count { margin-left: auto; color: #888; font-size: 12px; }
.swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.swatch.line { border-radius: 0; height: 4px; width: 18px; }
.swatch.square { border-radius: 0; border: 2px solid #333; background: #fff; }

.legend { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 0 0 18px; font-size: 12px; color: #555; }
.legend span { display: flex; align-items: center; gap: 4px; }
.legend i { width: 14px; height: 4px; display: inline-block; }

footer { margin-top: 18px; font-size: 12px; color: #888; }

.leaflet-popup-content { font-size: 13px; min-width: 200px; }
.leaflet-popup-content h3 { margin: 0 0 6px; font-size: 15px; }
.leaflet-popup-content table { border-collapse: collapse; }
.leaflet-popup-content td { padding: 2px 8px 2px 0; vertical-align: top; }
.leaflet-popup-content td:first-child { color: #777; }
.popup-src { margin-top: 6px; font-size: 11px; color: #888; }

@media (max-width: 700px) {
  body { flex-direction: column; }
  #sidebar { width: auto; max-height: 45vh; border-right: 0; border-bottom: 1px solid #ddd; }
}
