.glossary-intro {
  display: grid;
  width: min(760px, 100%);
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  margin: 22px 0 0;
  padding: 13px 14px;
  color: #526477;
  background: #eef2f6;
  border: 1px solid #d2dae5;
  border-radius: 7px;
  font-family: "Onest Variable", "Segoe UI Variable Text", sans-serif;
  font-size: 13px;
  line-height: 1.48;
  text-wrap: pretty;
}

.glossary-intro > span:first-child {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: #ffffff;
  background: #173f6b;
  border-radius: 50%;
  font: 800 12px/1 "JetBrains Mono Variable", "Cascadia Mono", monospace;
}

.glossary-intro strong {
  color: #111b29;
}

.term-trigger {
  position: relative;
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
  gap: .22em;
  margin: 0;
  padding: 0 .05em;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: 1px dotted color-mix(in srgb, currentColor 58%, transparent);
  border-radius: 2px;
  font: inherit;
  line-height: inherit;
  text-align: inherit;
  vertical-align: baseline;
  cursor: help;
  transition: color .16s ease, border-color .16s ease, background-color .16s ease;
}

.term-trigger::after {
  display: inline-grid;
  width: 1.25em;
  height: 1.25em;
  flex: 0 0 auto;
  place-items: center;
  align-self: center;
  color: #ffffff;
  background: #173f6b;
  border-radius: 50%;
  content: "?";
  font-family: "JetBrains Mono Variable", "Cascadia Mono", monospace;
  font-size: .62em;
  font-weight: 800;
  line-height: 1;
  transform: translateY(-.05em);
}

.term-trigger:hover {
  color: #173f6b;
  background: color-mix(in srgb, #e8f0fb 74%, transparent);
  border-bottom-color: #173f6b;
}

.term-trigger:focus-visible {
  color: #173f6b;
  background: #e8f0fb;
  border-bottom-color: transparent;
  outline: 3px solid #285d86;
  outline-offset: 3px;
}

.term-dialog {
  width: min(620px, calc(100% - 32px));
  max-width: none;
  max-height: min(760px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow: visible;
  color: #111b29;
  background: transparent;
  border: 0;
  color-scheme: light;
}

.term-dialog::backdrop {
  background: rgba(14, 25, 41, .38);
}

.term-dialog-card {
  display: grid;
  max-height: min(760px, calc(100dvh - 32px));
  overflow: auto;
  overscroll-behavior: contain;
  color: #111b29;
  background: #ffffff;
  border: 1px solid #9dabb9;
  border-radius: 12px;
  box-shadow: 0 28px 80px rgba(14, 25, 41, .2);
}

.term-dialog-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  padding: 28px 28px 22px;
  background: #f4f6f8;
  border-bottom: 1px solid #d2dae5;
}

.term-dialog-heading {
  min-width: 0;
}

.term-dialog-eyebrow {
  margin: 0 0 8px;
  color: #173f6b;
  font: 760 11px/1.35 "JetBrains Mono Variable", "Cascadia Mono", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.term-dialog-title {
  margin: 0;
  color: #111b29;
  font-family: "Onest Variable", "Segoe UI Variable Display", sans-serif;
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 670;
  line-height: 1.08;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.term-dialog-close {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  color: #526477;
  background: #ffffff;
  border: 1px solid #d2dae5;
  border-radius: 6px;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.term-dialog-close:hover {
  color: #111b29;
  background: #eef2f6;
  border-color: #9dabb9;
}

.term-dialog-close:active {
  transform: scale(.96);
}

.term-dialog-close:focus-visible,
.term-dialog-link:focus-visible {
  outline: 3px solid #285d86;
  outline-offset: 3px;
}

.term-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.term-dialog-simple {
  margin: 0;
  padding: 28px 28px 0;
  color: #111b29;
  font-family: "Onest Variable", "Segoe UI Variable Text", sans-serif;
  font-size: clamp(17px, 2.6vw, 20px);
  line-height: 1.58;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.term-dialog-example {
  display: grid;
  gap: 8px;
  margin: 24px 28px 28px;
  padding: 18px 18px 19px;
  background: #eef2f6;
  border-left: 3px solid #173f6b;
  border-radius: 0 7px 7px 0;
}

.term-dialog-example-label {
  color: #173f6b;
  font: 760 10px/1.35 "JetBrains Mono Variable", "Cascadia Mono", monospace;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.term-dialog-example p {
  margin: 0;
  color: #526477;
  font-family: "Onest Variable", "Segoe UI Variable Text", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.term-dialog-gap {
  margin: -12px 28px 28px;
  padding: 16px 18px;
  color: #84272d;
  background: #fff1f1;
  border-left: 3px solid #a23b3f;
  border-radius: 0 7px 7px 0;
  font-family: "Onest Variable", "Segoe UI Variable Text", sans-serif;
  font-size: 14px;
  font-weight: 720;
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.term-dialog-gap[hidden] {
  display: none;
}

.term-dialog-foot {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 28px;
  border-top: 1px solid #d2dae5;
}

.term-dialog-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  background: #173f6b;
  border: 1px solid #173f6b;
  border-radius: 5px;
  padding: 0 15px;
  font-family: "Onest Variable", "Segoe UI Variable Text", sans-serif;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.term-dialog-link:hover {
  background: #0e1929;
  border-color: #0e1929;
}

.term-dialog-link:active {
  transform: translateY(1px);
}

.term-dialog-hint {
  color: #687b90;
  font: 650 10px/1.4 "JetBrains Mono Variable", "Cascadia Mono", monospace;
}

.term-dialog[open] .term-dialog-card {
  animation: term-dialog-enter .2s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes term-dialog-enter {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: none; }
}

@media (hover: none), (pointer: coarse) {
  .term-trigger {
    min-height: 0;
  }

  .term-trigger::before {
    position: absolute;
    inset: -10px -5px;
    content: "";
  }
}

@media (max-width: 640px) {
  .term-dialog {
    width: 100%;
    max-height: 86dvh;
    margin: auto 0 0;
  }

  .term-dialog-card {
    max-height: 86dvh;
    padding-bottom: env(safe-area-inset-bottom);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 16px 16px 0 0;
  }

  .term-dialog-head {
    padding: 22px 20px 18px;
  }

  .term-dialog-simple {
    padding: 22px 20px 0;
  }

  .term-dialog-example {
    margin: 20px;
  }

  .term-dialog-gap {
    margin: -4px 20px 20px;
  }

  .term-dialog-foot {
    align-items: stretch;
    flex-direction: column;
    padding: 14px 20px 20px;
  }

  .term-dialog-link {
    justify-content: center;
  }

  .term-dialog-hint {
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .term-trigger,
  .term-dialog-close,
  .term-dialog-link {
    transition-duration: .01ms;
  }

  .term-dialog[open] .term-dialog-card {
    animation: none;
  }
}
