.glossary-term {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, currentColor 48%, transparent);
  cursor: help;
}

button.glossary-term {
  appearance: none;
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  font: inherit;
  line-height: inherit;
  text-align: inherit;
  vertical-align: baseline;
}

.glossary-term:hover,
.glossary-term:focus-visible {
  text-decoration-style: solid;
  text-decoration-color: currentColor;
}

button.glossary-term:focus-visible {
  outline: 0.12rem solid currentColor;
  outline-offset: 0.12rem;
  border-radius: 0.12rem;
}

.glossary-term[aria-busy="true"] {
  cursor: progress;
  text-decoration-style: dashed;
  text-decoration-color: currentColor;
}

.glossary-inline-dialog {
  position: fixed;
  inset: auto;
  top: var(--glossary-inline-top, 20vh);
  left: var(--glossary-inline-left, 1rem);
  width: min(25rem, calc(100vw - 1.5rem));
  max-height: min(26rem, calc(100vh - 1.5rem));
  margin: 0;
  padding: 0.9rem 1rem 1rem;
  overflow: auto;
  border: 1px solid color-mix(
    in srgb,
    var(--md-primary-fg-color, #3f51b5) 30%,
    transparent
  );
  border-radius: 0.75rem;
  color: var(--md-default-fg-color, CanvasText);
  background: var(--md-default-bg-color, Canvas);
  background: color-mix(
    in srgb,
    var(--md-primary-fg-color, #3f51b5) 14%,
    var(--md-default-bg-color, Canvas)
  );
  box-shadow: 0 0.8rem 2.2rem rgba(0, 0, 0, 0.2);
  z-index: 50;
}

.glossary-inline-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.glossary-inline-dialog__eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.62;
}

.glossary-inline-dialog h2 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.35;
}

.glossary-inline-dialog__close {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: inherit;
  background: color-mix(in srgb, currentColor 8%, transparent);
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.glossary-inline-dialog__close:focus-visible {
  outline: 0.14rem solid currentColor;
  outline-offset: 0.12rem;
}

.glossary-inline-dialog__definition {
  margin: 0.8rem 0 0.65rem;
  font-size: 0.9rem;
  line-height: 1.65;
}

.glossary-inline-dialog__meta,
.glossary-inline-dialog__freshness {
  margin: 0;
  font-size: 0.76rem;
  opacity: 0.68;
}

.glossary-inline-dialog__freshness:not([hidden]) {
  margin-top: 0.45rem;
  font-weight: 650;
}

.glossary-inline-dialog__actions {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
}

@media (max-width: 700px) {
  .glossary-inline-dialog {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: min(58vh, 28rem);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0.9rem 0.9rem 0 0;
    padding: 1rem max(0.85rem, env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom)) max(0.85rem, env(safe-area-inset-left));
  }
}

@media (prefers-reduced-motion: reduce) {
  .glossary-term,
  .glossary-inline-dialog {
    scroll-behavior: auto;
  }
}
