
html, body { margin: 0; height: 100%; }
#map-wrap {
  position: relative;
  height: 100%;
  width: 100%;
}
#map {
  position: absolute;
  inset: 0;
}
#controls {
  position: absolute;
  top: 10px;
  left: 10px;
  background: white;
  padding: 10px;
  z-index: 1000;
  box-shadow: 0 0 6px rgba(0,0,0,0.3);
  font-family: sans-serif;
  width: 220px;
}
#controlsHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  cursor: move;
  font-size: 12px;
  font-weight: 600;
}
#controlsHeader button {
  width: auto;
  margin: 0;
  padding: 2px 6px;
  font-size: 11px;
}
.controls-collapsed details {
  display: none;
}
.controls-collapsed #metroDropdown {
  display: none;
}
select, button { width: 100%; margin: 4px 0; }
#metroSelect { width: 100%; margin: 4px 0; }
.metro-dropdown {
  display: none;
  max-height: 180px;
  overflow: auto;
  border: 1px solid #ddd;
  background: #fff;
  padding: 4px;
  margin-bottom: 6px;
}
.metro-dropdown.open { display: block; }
.metro-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 4px 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}
.metro-option:hover { background: #f3f3f3; }
.metro-divider {
  border: none;
  border-top: 1px solid #ddd;
  margin: 6px 0;
}
label.control-group {
  display: block;
  margin: 6px 0;
  font-size: 12px;
}
label.control-group input {
  width: 100%;
  margin-top: 4px;
}
label.control-group input[type="color"] {
  height: 28px;
  padding: 0;
  border: none;
}
label.control-group span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #333;
}
.foodbank-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
}
.foodbank-controls button {
  flex: 0 0 auto;
  width: 32px;
  height: 28px;
  padding: 0;
}
.foodbank-controls #foodBankValue {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  font-weight: 600;
  margin: 0;
}
.foodbank-star {
  color: #f2c400;
  font-size: 16px;
  line-height: 16px;
  text-shadow: 0 0 2px rgba(0,0,0,0.4);
}
.control-section {
  border-top: 1px solid #e3e3e3;
  margin-top: 8px;
  padding-top: 8px;
}
.control-section:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}
.section-title {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 4px;
}
.axis-hist {
  position: absolute;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.85);
  z-index: 900;
  width: 100%;
  height: 100%;
}
.axis-hist rect {
  cursor: pointer;
}

#histogramTooltip {
  position: absolute;
  z-index: 950;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 4px;
  pointer-events: none;
  transform: translate(-50%, -100%);
  white-space: nowrap;
}
.axis-hist-x {
  top: 6px;
  left: 6px;
  right: 6px;
  height: 70px;
  border: 1px solid #e6e6e6;
}
.axis-hist-y {
  top: 6px;
  right: 6px;
  bottom: 6px;
  width: 70px;
  border: 1px solid #e6e6e6;
}
details.control-section {
  padding-top: 4px;
}
details.control-section > summary.section-title {
  list-style: none;
  cursor: pointer;
  margin-bottom: 6px;
}
details.control-section > summary.section-title::-webkit-details-marker {
  display: none;
}
details.control-section > summary.section-title::after {
  content: "▾";
  float: right;
  color: #777;
}
details.control-section:not([open]) > summary.section-title::after {
  content: "▸";
}
.grocery-icon {
  font-size: 16px;
  line-height: 18px;
  text-align: center;
}
.train-icon {
  font-size: 16px;
  line-height: 18px;
  text-align: center;
}
