* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  background: #f4f4f4;
}

.app-header {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  background: #1f2937;
  color: white;
}

.app-header h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.map-wrapper {
  flex: 1;
  width: 100%;
  min-height: 0;
}

#map {
  width: 100%;
  height: 100%;
}

.map-controls {
  position: absolute;
  bottom: 100px;
  left: 16px;
  z-index: 1000;
  background: white;
  padding: 12px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  font-family: sans-serif;
}

.radio-group,
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-group {
  margin-top: 12px;
}

#map-slider {
  width: 160px;
}

.map-legend {
    position: absolute;   
    bottom: 100px;
    right: 1rem;
    z-index: 1000;
    width: fit-content;
    min-width: 88px;
    padding: 0.55rem 0.65rem;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-size: 0.85rem;
    line-height: 1.2;
}

.legend-title {
  margin-bottom: 0.4rem;
  font-weight: 700;
  text-align: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.25rem 0;
  white-space: nowrap;
}

.legend-color {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 1px solid rgba(0, 0, 0, 0.35);
}

.legend-label {
  min-width: 1ch;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .app-header {
    height: 48px;
    padding: 0 12px;
  }

  .app-header h1 {
    font-size: 1rem;
  }
}