html, body, #map { height: 100%; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; }
#app {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100vh;
  gap: 0;
}
#sidebar {
  padding: 12px;
  box-sizing: border-box;
  background: #f8f9fb;
  border-right: 1px solid #e2e6ea;
  overflow: auto;
  max-height: 100vh;
}
#map-wrap { position: relative; }
#controls { margin-bottom: 12px; }
h1 { font-size: 18px; margin: 0 0 8px 0; }
label.filter-item { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.badge { font-size: 12px; color: #666; margin-left: 6px; }
#status { font-size: 13px; color: #333; margin-top: 8px; }
button, .btn {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #bbb;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  min-height: 44px;
  touch-action: manipulation;
}
button:active, button:hover { transform: translateY(1px); background: #f5f5f5; }
.small { padding: 8px 12px; font-size: 13px; }
#filters { margin-top: 8px; }
#loadMore { margin-top: 8px; }
.muted { color: #666; font-size: 13px; }
a.link { color: #0366d6; text-decoration: none; }
pre { white-space: pre-wrap; word-wrap: break-word; font-size: 12px; background: #fff; padding: 8px; border-radius: 6px; border: 1px solid #eee; overflow-x: auto; }

/* Mobile responsiveness */
@media (max-width: 768px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 50vh;
    border-right: none;
    border-bottom: 1px solid #e2e6ea;
    padding: 10px;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
  }
  #sidebar.open {
    transform: translateY(0);
  }
  #map-wrap {
    grid-row: 1 / -1;
    margin-top: 50px;
  }
  #toggle-sidebar {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1001;
    background: #fff;
    border: 1px solid #bbb;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
  }
  h1 { font-size: 16px; }
  button, .btn { font-size: 14px; padding: 10px 12px; }
  .small { padding: 10px 12px; }
  #status { font-size: 12px; }
  .muted { font-size: 12px; }
  label.filter-item { margin-bottom: 8px; }
}

@media (max-width: 480px) {
  #sidebar { padding: 8px; }
  h1 { font-size: 14px; margin: 0 0 6px 0; }
  button, .btn { font-size: 13px; padding: 10px 10px; width: 100%; }
  .small { width: 100%; }
  #controls > div { display: grid; gap: 6px; }
  pre { font-size: 11px; padding: 6px; }
  .leaflet-popup-content { max-width: 250px !important; }
}
