$panelBorderColor: #888 !default;

.mb-element-overview {
  user-select: none;
  position: relative; // For .toggleOverview absolute

  .toggleOverview {
    position: absolute;
    padding: 3px;
    border-radius: 3px;
  }

  .olMap, .ol-overviewmap-map {
    background-color: white;
    transition: all .2s linear;
    .ol-viewport, .olMapViewport {
      border: 1px solid $panelBorderColor;
    }
    .olMapViewport {
      > div {
        // Overrule inline style z-index to prevent overview punching through sidepane
        z-index: 0 !important;
      }
    }
  }
  .ol-overviewmap, .ol-overviewmap-map {
    height: 100%;
  }
  .ol-overviewmap {
    button {
      // Open Layers renders a toggle button which we delegate to for visibility
      // toggling, but we don't want to show it
      width: 0;
      padding: 0;
      border: 0;
      font-size: 0;
      overflow-x: hidden;
    }
    // prevent weird vertical displacement of map relative to toggle button
    font-size: 0;
    line-height: 0;
  }
  &.closed {
    .olMap, .ol-overviewmap-map {
      width: 0 !important;
      opacity: 0;
      border: 0;
    }
  }
  .anchored-element-wrap-rt  & .toggleOverview {
    top: 0;
    left: -2.25em;
  }
  .anchored-element-wrap-lt & .toggleOverview {
    top: 0;
    right: -2.25em;
  }
  .anchored-element-wrap-rb & .toggleOverview {
    bottom: 0;
    left: -2.25em;
  }
  .anchored-element-wrap-lb & .toggleOverview {
    bottom: 0;
    right: -2.25em;
  }
  .anchored-element-wrap-lb &, .anchored-element-wrap-rb & {
    vertical-align: bottom;
  }
}

.olControlOverviewMapExtentRectangle, .ol-overviewmap-box {
  overflow: hidden;
  cursor: move;
  border: 2px solid $firstColor;
}

.olControlOverviewMapRectReplacement {
  cursor: move;
}
