.glossary-term {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.14em;
  cursor: pointer;
}

.glossary-term:hover,
.glossary-term:focus-visible {
  color: inherit;
}

.glossary-term:focus-visible {
  outline: 2px solid var(--bs-primary, #0d6efd);
  outline-offset: 2px;
  border-radius: 4px;
}

.glossary-article__tooltip {
  position: fixed;
  z-index: 1075;
  max-width: min(320px, 90vw);
  pointer-events: none;
  border: 1px solid var(--bs-border-color, rgba(0, 0, 0, 0.14));
  border-radius: .7rem;
  background: var(--bs-body-bg, #fff);
  box-shadow: 0 .75rem 1.8rem rgba(0, 0, 0, .16);
  padding: .6rem .7rem;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity .12s ease, transform .12s ease;
}

.glossary-article__tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.glossary-article__tooltip-title {
  display: block;
  font-size: .86rem;
  font-weight: 700;
  margin-bottom: .2rem;
}

.glossary-article__tooltip-body {
  display: block;
  font-size: .82rem;
  line-height: 1.35;
  color: var(--bs-secondary-color, #6b7280);
}

@media (hover: none), (pointer: coarse) {
  .glossary-article__tooltip {
    display: none !important;
  }
}

.glossary-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3005;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.glossary-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.glossary-modal {
  width: min(680px, 96vw);
  max-height: 85vh;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.24);
  background: #efe6d6;
  color: #2f2a24;
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition: transform 0.24s ease, opacity 0.24s ease;
}

.glossary-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.glossary-modal-backdrop.is-open .glossary-modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.glossary-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.9rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.09);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.12)),
    repeating-linear-gradient(
      to bottom,
      rgba(104, 88, 69, 0.06) 0,
      rgba(104, 88, 69, 0.06) 1px,
      transparent 1px,
      transparent 24px
    );
}

.glossary-modal__header-note {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.glossary-modal__eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .11em;
  font-weight: 700;
  opacity: 0.78;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  padding: 0.14rem 0.5rem;
  background: rgba(255, 255, 255, 0.4);
}

.glossary-modal__title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  text-wrap: balance;
}

.glossary-modal__crumbs {
  display: none;
  align-items: center;
  gap: .38rem;
  flex-wrap: wrap;
  padding: .5rem 1rem .58rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.38);
}

.glossary-modal__crumbs.is-visible {
  display: flex;
}

.glossary-modal__crumb {
  border: 0;
  background: none;
  color: inherit;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: .84rem;
  line-height: 1.2;
  cursor: pointer;
  opacity: .78;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.glossary-modal__crumb:hover,
.glossary-modal__crumb:focus-visible {
  opacity: 1;
}

.glossary-modal__crumb--current {
  cursor: default;
  text-decoration: none;
  opacity: 1;
  font-weight: 700;
}

.glossary-modal__crumb-sep {
  opacity: .55;
  font-size: .8rem;
}

.glossary-modal__close {
  border: 0;
  background: transparent;
  color: inherit;
  line-height: 1;
  font-size: 1.35rem;
  padding: 0.2rem 0.3rem;
  border-radius: 6px;
  cursor: pointer;
}

.glossary-modal__close:hover,
.glossary-modal__close:focus-visible {
  background: rgba(0, 0, 0, 0.08);
}

.glossary-modal__body {
  padding: 1rem;
  overflow: auto;
  max-height: calc(85vh - 124px);
  text-align: justify;
  line-height: 1.72;
}

.glossary-modal__body p {
  margin: 0 0 .8rem 0;
}

.glossary-modal__body p:last-child {
  margin-bottom: 0;
}

.glossary-modal__synonyms {
  display: none;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
  padding: 0 1rem .72rem;
  font-size: .92rem;
  line-height: 1.5;
}

.glossary-modal__synonyms.is-visible {
  display: flex;
}

.glossary-modal__synonyms-label {
  font-weight: 700;
  margin-right: .35rem;
}

.glossary-modal-synonym {
  border: 0;
  background: none;
  color: inherit;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: .88;
  transition: opacity .16s ease;
}

.glossary-modal-synonym:hover,
.glossary-modal-synonym:focus-visible {
  opacity: 1;
}

.glossary-modal__synonyms-sep {
  opacity: .65;
}

.glossary-modal-term {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  font-weight: 650;
  opacity: .95;
  transition: color .16s ease, opacity .16s ease;
}

.glossary-modal-term:hover,
.glossary-modal-term:focus-visible {
  opacity: 1;
}

.glossary-modal.is-switching .glossary-modal__body,
.glossary-modal.is-switching .glossary-modal__title {
  opacity: .42;
  transform: translateY(2px);
  transition: opacity .13s ease, transform .13s ease;
}

.glossary-modal__footer {
  display: flex;
  gap: .6rem;
  align-items: center;
  justify-content: flex-start;
  padding: .86rem 1rem 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.09);
}

.glossary-modal__action {
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: rgba(255, 255, 255, 0.68);
  color: inherit;
  border-radius: 999px;
  padding: .45rem .82rem;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.glossary-modal__action:hover,
.glossary-modal__action:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.22);
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.12);
}

.glossary-modal__icon {
  width: 1.32rem;
  height: 1.32rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  flex: 0 0 1.32rem;
}

.glossary-modal__icon svg {
  width: .94rem;
  height: .94rem;
}

.glossary-modal__toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 10px);
  background: rgba(22, 101, 52, 0.95);
  color: #fff;
  border-radius: 999px;
  padding: .45rem .8rem;
  font-size: .83rem;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}

.glossary-modal__toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.glossary-modal__toast.is-error {
  background: rgba(185, 28, 28, 0.95);
}

html[data-bs-theme="dark"] .glossary-modal {
  background: #484c52;
  color: #f2f4f7;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.55);
}

html[data-bs-theme="dark"] .glossary-modal__header {
  border-bottom-color: rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.06) 0,
      rgba(255, 255, 255, 0.06) 1px,
      transparent 1px,
      transparent 24px
    );
}

html[data-bs-theme="dark"] .glossary-modal__crumbs {
  border-bottom-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.04);
}

html[data-bs-theme="dark"] .glossary-modal-synonym {
  color: #f2f4f7;
}

html[data-bs-theme="dark"] .glossary-modal__eyebrow {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.08);
}

html[data-bs-theme="dark"] .glossary-modal__footer {
  border-top-color: rgba(255, 255, 255, 0.14);
}

html[data-bs-theme="dark"] .glossary-modal__action {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

html[data-bs-theme="dark"] .glossary-modal__action:hover,
html[data-bs-theme="dark"] .glossary-modal__action:focus-visible {
  background: rgba(255, 255, 255, 0.17);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.38);
}

html[data-bs-theme="dark"] .glossary-modal__icon {
  background: rgba(255, 255, 255, 0.14);
}

html[data-bs-theme="dark"] .glossary-modal-term {
  color: #fff;
}

html[data-bs-theme="dark"] .glossary-modal__close:hover,
html[data-bs-theme="dark"] .glossary-modal__close:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}
