.glossary-term {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted rgba(128, 128, 128, 0.5);
  position: relative;
  cursor: help;
}

.glossary-term:hover {
  border-bottom-color: rgba(128, 128, 128, 0.9);
}

/* Tooltip — lives on document.body to escape overflow containers */
.glossary-tip {
  display: none;
  position: fixed;
  background: #2d2d2d;
  color: #e8e8e8;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.82em;
  font-style: normal;
  font-weight: normal;
  line-height: 1.45;
  max-width: 320px;
  min-width: 180px;
  width: max-content;
  white-space: normal;
  z-index: 10000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  text-align: left;
}

/* Arrow */
.glossary-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: var(--arrow-left, 50%);
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #2d2d2d;
}

/* Arrow when tooltip flips below the term */
.glossary-tip.tip-below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: #2d2d2d;
}
