/* Optional explanation cards share the page's typography.
   These are text controls; primary actions remain in theme/assets/buttons.css. */
.term-explain {
  display: inline;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: inherit;
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.term-explain:hover,
.term-explain[aria-expanded="true"] { text-decoration-style: solid; }
.term-explain:focus-visible,
.term-close:focus-visible,
.term-source:focus-visible {
  outline: 2px solid var(--brand, #2264c4);
  outline-offset: 4px;
}
.term-panel {
  position: fixed;
  z-index: 1000;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  margin: 0;
  padding: 20px;
  border: 1px solid #bdc9d0;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 18px #142c471a;
  color: var(--ink, #142c47);
  font: 15px/1.65 var(--font, sans-serif);
  letter-spacing: normal;
  overflow-wrap: anywhere;
}
.term-panel[hidden] { display: none; }
.term-panel:focus { outline: none; }
.term-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-top: -9px;
  margin-bottom: 10px;
}
.term-panel-heading strong {
  padding-top: 9px;
  font-size: 17px;
  font-weight: 750;
  line-height: 1.5;
}
.term-panel #fpc-term-definition {
  margin: 0 0 12px;
  color: var(--ink, #142c47);
  font-size: 15px;
  line-height: 1.65;
}
.term-panel .term-panel-source {
  margin: 0;
  color: var(--muted, #536473);
  font-size: 13px;
  line-height: 1.6;
}
.term-source { color: inherit; }
.term-close {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  padding: 9px 0;
  border: 0;
  background: transparent;
  color: var(--muted, #536473);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.term-close:hover { color: var(--ink, #142c47); }
@media (max-width: 600px) {
  .term-panel {
    inset: auto 16px max(16px, env(safe-area-inset-bottom));
    width: auto;
  }
  .term-panel-heading { gap: 12px; }
}
@media print {
  .term-explain { text-decoration: none; }
  .term-panel { display: none; }
}
