*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #map { width: 100%; height: 100vh; }

/* ---- control panel ---- */
#panel {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  background: rgba(255,255,255,.92);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  width: 240px;
  font: 14px/1.4 system-ui, sans-serif;
}
#search {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font: inherit;
  margin-top: 10px;
}
#results {
  max-height: 200px;
  overflow-y: auto;
  margin-top: 4px;
  border-radius: 4px;
  display: none;
}
#results.active { display: block; }
.result {
  padding: 5px 8px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}
.result:hover { background: #e8f0fe; }

#slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#slider-wrap label { font-size: 13px; color: #444; }
#slider { width: 100%; }

/* ---- legend ---- */
#legend {
  position: fixed;
  bottom: 20px;
  right: 12px;
  z-index: 1000;
  background: rgba(255,255,255,.92);
  border-radius: 8px;
  padding: 10px 12px 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  font: 12px/1 system-ui, sans-serif;
  color: #333;
}
#legend-gradient {
  width: 140px;
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(to right, hsl(120,80%,55%), hsl(60,80%,55%), hsl(0,80%,55%));
}
#legend-labels { display: flex; justify-content: space-between; margin-top: 2px; }
#legend-size {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

/* ---- origin pin ---- */
.pin-wrapper { background: none !important; border: none !important; }
.pin-wrapper svg { filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }

/* ---- station label (pin + hover) ---- */
.station-label {
  background: rgba(255,255,255,.92) !important;
  border: 1px solid #bbb !important;
  border-radius: 4px !important;
  color: #222 !important;
  text-align: center !important;
  font: 12px/1.3 system-ui, sans-serif !important;
  padding: 2px 7px !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.15) !important;
}
.station-label::before { border-top-color: #bbb !important; }

/* ---- gradient elevation labels ---- */
.gradient-label {
  background: rgba(255,255,255,.85) !important;
  border: 1px solid #aaa !important;
  border-radius: 3px !important;
  color: #333 !important;
  font: bold 10px/1 system-ui, sans-serif !important;
  padding: 1px 4px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.12) !important;
}
.gradient-label::before { display: none !important; }
