.customer-merge {
  display: inline-block;
  position: relative;
}

.customer-merge .customer-merge__tooltip {
  display: none;
  background-color: #404040;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 10px;
  position: absolute;
  z-index: 2; /* Must be > 1 to beat the SVG */
  font-size: 13px;
  cursor: none;
  min-width: fit-content;
  width: max-content;
}

.customer-merge svg {
  position: relative; /* Must be positioned for z-index to work */
  z-index: 1; /* A very low number */
}

.customer-merge.top-left .customer-merge__tooltip {
  max-width: 160px;
  word-break: break-all;
  text-align: left;
  top: 100%;
  left: 0;
}

.customer-merge.top-right .customer-merge__tooltip {
  max-width: 160px;
  word-break: break-all;
  text-align: left;
  top: 100%;
  right: 0;
}

.customer-merge.right .customer-merge__tooltip {
  max-width: 160px;
  word-break: break-all;
  text-align: left;
  top: -5px;
  right: 100%;
}

.customer-merge.left .customer-merge__tooltip {
  max-width: 160px;
  word-break: break-all;
  text-align: left;
  top: -5px;
  left: 100%;
}

.customer-merge span.customer-merge__tooltip {
  max-width: 190px;
  top: 140%;
  left: 0;
  font-size: 12px;
}

button.customer-merge .customer-merge__tooltip {
  max-width: 220px;
  bottom: 110%;
  right: calc(100% - 105px);
}

.customer-merge .customer-merge__tooltip::after {
  content: '';
  position: absolute;
  border-width: 7px;
  border-style: solid;
}

.customer-merge.top-right .customer-merge__tooltip::after {
  right: 5%;
  bottom: 100%;
  border-color: transparent transparent #404040 transparent;
}

.customer-merge.right .customer-merge__tooltip::after {
  bottom: calc(100% - 25px);
  left: 100%;
  border-color: transparent transparent transparent #404040;
}

.customer-merge.left .customer-merge__tooltip::after {
  bottom: calc(100% - 25px);
  right: 100%;
  border-color: transparent #404040 transparent transparent;
}

.customer-merge.top-left .customer-merge__tooltip::after {
  left: 5%;
  bottom: 100%;
  border-color: transparent transparent #404040 transparent;
}

.customer-merge span.customer-merge__tooltip::after {
  left: 5%;
  bottom: 100%;
  border-color: transparent transparent #404040 transparent;
}

button.customer-merge .customer-merge__tooltip::after {
  top: 100%;
  right: calc(100% - 175px);
  border-color: #404040 transparent transparent transparent;
}

.customer-merge:hover .customer-merge__tooltip {
  display: block;
}
