html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

#map {
  width: 100%;
  height: calc(100vh - 60px);
  min-height: 500px;
}

#sidebar {
  position: absolute;
  top: 60px;
  left: 0;
  width: 330px;
  height: calc(100vh - 60px);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  z-index: 1000;
  background: #fff;
}

.sidebar-wrapper,
#features,
#features .panel-body {
  height: 100%;
}

#features .panel-body {
  overflow-y: auto;
  padding-bottom: 80px;
}

#custom-draw {
  position: absolute;
  right: 15px;
  bottom: 30px;
  z-index: 900;
  width: 260px;
  max-height: 45vh;
  overflow-y: auto;
}

#open-sidebar-button {
  position: absolute;
  top: 80px;
  left: 10px;
  z-index: 1100;
}

.leaflet-control-layers {
  max-height: 45vh;
  overflow-y: auto;
}

.leaflet-popup-content {
  max-width: 280px;
  max-height: 300px;
  overflow-y: auto;
}

.map-popup table {
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  #map {
    height: calc(100vh - 56px);
    min-height: 420px;
  }

  #sidebar {
    top: 56px;
    width: 85%;
    max-width: 340px;
    height: calc(100vh - 56px);
  }

  #custom-draw {
    right: 10px;
    left: 10px;
    bottom: 20px;
    width: auto;
    max-height: 30vh;
  }

  .leaflet-control-layers {
    max-width: 220px;
    max-height: 35vh;
  }

  .leaflet-popup-content {
    max-width: 230px;
  }
}