/* ---- glossary ---- */
.gl-hero { background: var(--white); border-bottom: 1px solid var(--line); }
.gl-hero .lead { max-width: 720px; }

.gl-search { display: flex; flex-direction: column; gap: 6px; max-width: 620px; }
.gl-label { font-weight: 600; font-size: 15px; }
.gl-search-row { display: flex; gap: 8px; }
.gl-search input {
  flex: 1 1 auto; min-width: 0; font: inherit; font-size: 17px; padding: 10px 14px;
  border: 1px solid #7B8C97; border-radius: 10px; background: var(--white); color: var(--ink);
}
.gl-search input:focus { outline: 3px solid var(--tint); border-color: var(--accent); }

.gl-units { display: flex; flex-wrap: wrap; gap: 8px; }
.gl-units a {
  display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--ground); color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500;
}
.gl-units a:hover { border-color: var(--accent); color: var(--accent); }
.gl-units a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--white); }

.gl-az { display: flex; flex-wrap: wrap; gap: 4px; font-family: var(--mono); font-size: 15px; }
.gl-az a, .gl-az span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px;
  border-radius: 8px; text-decoration: none;
}
.gl-az a { color: var(--accent); background: var(--tint); font-weight: 600; }
.gl-az a:hover { background: var(--accent); color: var(--white); }
.gl-az span { color: #9AA7B0; }

.gl-group { scroll-margin-top: 16px; margin-bottom: 36px; }
.gl-group h2 {
  font-size: 28px; padding-bottom: 8px; margin-bottom: 16px; border-bottom: 2px solid var(--line); color: var(--accent);
}
.gl-grid {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.gl-card {
  position: relative; background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
.gl-card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(14, 27, 42, .07); }
.gl-card h3 { font-size: 19px; }
.gl-card h3 a { color: var(--ink); text-decoration: none; }
.gl-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
.gl-card h3 a:focus-visible { outline: none; }
.gl-card:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.gl-card p { font-size: 15.5px; color: var(--text); line-height: 1.5; overflow-wrap: anywhere; }
.gl-card .katex { font-size: 1.02em; }
.gl-tag { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-top: auto; }
.gl-empty { padding: 24px; background: var(--white); border: 1px dashed var(--line); border-radius: 14px; }
.gl-card[hidden], .gl-group[hidden], .gl-empty[hidden] { display: none; }

/* term page */
.gl-crumbs a { color: var(--muted); }
.gl-term h1 { font-size: clamp(34px, 5vw, 52px); overflow-wrap: anywhere; }
.gl-answer {
  font-size: 20px; line-height: 1.5; color: var(--ink); background: var(--tint);
  border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0; padding: 16px 20px;
}
.gl-answer-label {
  display: block; font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-dark); margin-bottom: 4px;
}
.gl-h2 { font-size: 24px; }
.gl-body p { margin: 0 0 14px; color: var(--text); }
.gl-body p:last-child { margin-bottom: 0; }
.gl-body .katex-display { overflow-x: auto; overflow-y: hidden; padding: 6px 0; margin: 10px 0; }
.gl-where { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.gl-where ul { margin: 12px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.gl-grid-tight { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.gl-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.gl-chips a {
  display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--white); text-decoration: none; font-size: 15px;
}
.gl-chips a:hover { border-color: var(--accent); }

@media (max-width: 520px) {
  .gl-answer { font-size: 18px; padding: 14px 16px; }
  .gl-card { padding: 16px; }
  .gl-az a, .gl-az span { min-width: 30px; height: 32px; }
}

/* ---- fuller guides for searched terms (glossary/extras.py) ---- */
.gl-guide-split { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
.gl-figure { margin: 0; display: grid; gap: 6px; justify-items: center; }
.gl-figure svg { max-width: 100%; height: auto; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.gl-steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; line-height: 1.5; }
.gl-calc { padding: 12px 16px; border-radius: 12px; background: var(--tint); font-size: 17px; }
.gl-table-wrap { overflow-x: auto; }
.gl-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.gl-table th, .gl-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.gl-table th { font-size: 14px; color: var(--muted); font-weight: 600; }
.gl-q { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--white); }
.gl-q summary { cursor: pointer; line-height: 1.5; }
.gl-q p { margin: 10px 0 0; }
@media (max-width: 700px) { .gl-guide-split { grid-template-columns: 1fr; } }
