.glossary-term {
  cursor: pointer;
  position: relative;
  display: inline;
  padding: 0.04em 0.22em;
  border-radius: 0;
  color: #1e40af;
  background: rgba(30, 64, 175, 0.1);
  border-bottom: 2px dotted rgba(30, 64, 175, 0.7);
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.glossary-term:hover,
.glossary-term:focus-visible {
  color: #1d3593;
  background: rgba(30, 64, 175, 0.18);
  border-bottom-color: rgba(29, 53, 147, 0.9);
}

.glossary-term--open {
  color: #132770;
  background: rgba(30, 64, 175, 0.24);
  border-bottom-style: solid;
  border-bottom-color: rgba(19, 39, 112, 0.95);
}

a .glossary-term,
a .glossary-term:hover,
a .glossary-term:focus-visible,
a .glossary-term--open {
  color: inherit;
  background: transparent;
  border-bottom: none;
  padding: 0;
}

.glossary-tooltip {
  position: fixed;
  z-index: 30;
  max-width: min(320px, calc(100vw - 1rem));
  background: #111;
  color: #fff;
  border-radius: 0;
  padding: 0.55rem 0.7rem;
  line-height: 1.35;
  font-size: 0.9rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.glossary-tooltip[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .glossary-tooltip {
    max-width: calc(100vw - 1rem);
    font-size: 0.875rem;
  }
}
