.tooltip {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: max-content;
  max-width: 250px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px 12px;
  position: absolute;
  z-index: 10000;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  font-size: 0.85rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

/* Position below when hitting top boundary */
.tooltip .tooltiptext.tooltiptext--bottom {
  bottom: auto;
  top: 125%;
}

.tooltip .tooltiptext::after {
  content: "";
  position: absolute;
  top: 100%;
  left: var(--arrow-left, 50%);
  margin-left: var(--arrow-margin, -5px);
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.tooltip .tooltiptext.tooltiptext--bottom::after {
  top: auto;
  bottom: 100%;
  border-color: transparent transparent #333 transparent;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

.tooltip {
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-thickness: 1px;
}
