/* Glossary page — agenticgovernance.digital */

.glossary-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

.glossary-header {
  border-bottom: 2px solid var(--border-color, #e2e8f0);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.glossary-header h1 {
  font-size: 1.75rem;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary, #1e293b);
}

.glossary-header .subtitle {
  font-size: 1rem;
  color: var(--text-secondary, #475569);
  margin: 0 0 0.5rem 0;
}

.glossary-header .meta {
  font-size: 0.85rem;
  color: var(--text-secondary, #64748b);
  margin: 0.5rem 0;
}

.glossary-header .audience-note,
.glossary-header .translation-note {
  font-size: 0.85rem;
  color: var(--text-secondary, #64748b);
  margin: 0.4rem 0;
  line-height: 1.5;
}

.machine-key {
  display: inline-block;
  margin-left: 0.4rem;
  font-style: italic;
}

.mi-machine-note {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  padding: 0.05rem 0.35rem;
  border-radius: 0.25rem;
  vertical-align: middle;
}

.glossary-filter {
  position: sticky;
  top: 60px;
  background: var(--bg-primary, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  z-index: 10;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.filter-input {
  flex: 1 1 320px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 0.375rem;
  font-size: 0.95rem;
  background: var(--bg-primary, #ffffff);
}

.filter-input:focus {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: 1px;
}

.filter-stats {
  font-size: 0.85rem;
  color: var(--text-secondary, #64748b);
  white-space: nowrap;
}

.search-cat-banner {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 0.4rem;
  padding: 0.6rem 0.85rem;
  margin: -0.5rem 0 1.25rem 0;
  font-size: 0.88rem;
  color: #78350f;
  line-height: 1.5;
}

.search-cat-banner[hidden] {
  display: none;
}

.search-cat-banner .banner-clear {
  color: #b45309;
  font-weight: 600;
  text-decoration: underline;
  margin-left: 0.2rem;
}

.search-cat-banner .banner-clear:hover {
  color: #92400e;
}

.glossary-toc {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}

.glossary-toc .toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.glossary-toc h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary, #64748b);
  margin: 0;
}

.glossary-toc .toc-help {
  font-size: 0.78rem;
  color: var(--text-secondary, #64748b);
  margin: 0 0 0.6rem 0;
  font-style: italic;
}

.glossary-toc .toc-clear {
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 0.3rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 600;
}

.glossary-toc .toc-clear:hover {
  background: #1d4ed8;
}

.glossary-toc .toc-clear[hidden] {
  display: none;
}

.glossary-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.4rem;
}

.glossary-toc a {
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: 0.25rem;
  color: var(--text-primary, #1e293b);
  text-decoration: none;
  font-size: 0.9rem;
}

.glossary-toc a:hover {
  background: var(--bg-tertiary, #e2e8f0);
}

.glossary-toc a.active {
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
}

.glossary-toc a.active .toc-count {
  color: rgba(255, 255, 255, 0.85);
}

.toc-count {
  color: var(--text-secondary, #64748b);
  font-size: 0.8rem;
  margin-left: 0.25rem;
}

.category-section {
  margin-bottom: 2.5rem;
  scroll-margin-top: 100px;
}

.category-heading {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 1.25rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  padding-bottom: 0.5rem;
  margin: 0 0 1rem 0;
  color: var(--text-primary, #1e293b);
  flex-wrap: wrap;
}

.category-heading .label-mi {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary, #475569);
  font-style: italic;
}

.category-heading .entry-count {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-secondary, #64748b);
}

.glossary-entry {
  background: var(--card-bg, #ffffff);
  border-left: 3px solid var(--border-accent, #cbd5e1);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 0 0.25rem 0.25rem 0;
  scroll-margin-top: 80px;
}

.glossary-entry:target {
  border-left-color: #2563eb;
  border-left-width: 5px;
  background: #dbeafe;
  box-shadow: 0 0 0 2px #2563eb, 0 4px 12px rgba(37, 99, 235, 0.2);
  animation: glossary-target-flash 1.4s ease-out;
}

@keyframes glossary-target-flash {
  0% {
    background: #fef3c7;
    box-shadow: 0 0 0 4px #f59e0b, 0 4px 12px rgba(245, 158, 11, 0.4);
  }
  100% {
    background: #dbeafe;
    box-shadow: 0 0 0 2px #2563eb, 0 4px 12px rgba(37, 99, 235, 0.2);
  }
}

.glossary-entry .term {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.4rem 0;
  color: var(--text-primary, #1e293b);
  line-height: 1.3;
}

.glossary-entry .term-mi {
  font-weight: 500;
  color: var(--text-secondary, #475569);
  font-style: italic;
  font-size: 0.95rem;
}

.glossary-entry .def {
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0.4rem 0;
  color: var(--text-primary, #334155);
}

.glossary-entry .def-mi {
  background: rgba(15, 118, 110, 0.04);
  border-left: 2px solid rgba(15, 118, 110, 0.3);
  padding: 0.4rem 0.65rem;
  border-radius: 0 0.25rem 0.25rem 0;
  margin-top: 0.35rem;
}

.glossary-entry .def-mi-machine {
  border-left-color: rgba(217, 119, 6, 0.5);
  background: rgba(254, 243, 199, 0.3);
}

.glossary-entry .def-mi-pending {
  font-style: italic;
  color: var(--text-secondary, #64748b);
  font-size: 0.85rem;
  background: rgba(100, 116, 139, 0.04);
  border-left-color: rgba(100, 116, 139, 0.3);
}

.glossary-entry .see-also,
.glossary-entry .source-cite,
.glossary-entry .citations {
  font-size: 0.82rem;
  color: var(--text-secondary, #64748b);
  margin: 0.35rem 0 0 0;
}

.glossary-entry .citations {
  border-top: 1px dashed var(--border-color, #e2e8f0);
  padding-top: 0.45rem;
  margin-top: 0.55rem;
  line-height: 1.7;
}

.glossary-entry .citations .label {
  display: inline-block;
  margin-right: 0.4rem;
}

.cite {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  text-decoration: none;
  background: #f1f5f9;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  font-size: 0.78rem;
  margin: 0.15rem 0;
  transition: background 0.12s ease, color 0.12s ease;
}

.cite:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.cite-primary {
  background: #dbeafe;
  border-color: #93c5fd;
  font-weight: 700;
  color: #1e40af;
}

.cite-applied {
  background: #f8fafc;
  border-color: #cbd5e1;
  font-weight: 500;
}

.cite-mentioned {
  background: #ffffff;
  color: #64748b;
  font-weight: 400;
}

.cite-section {
  font-weight: 600;
  margin-left: 0.15rem;
  opacity: 0.85;
}

.citations-legacy .legacy-text {
  font-style: italic;
}

.glossary-entry .see-also a {
  color: var(--accent, #2563eb);
  text-decoration: none;
}

.glossary-entry .see-also a:hover {
  text-decoration: underline;
}

.glossary-entry .label {
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.72rem;
  margin-right: 0.25rem;
}

.glossary-entry[hidden] {
  display: none !important;
}

.category-section[data-empty="true"] {
  display: none;
}

/* ===== Update-provenance badge ===== */

.updated-badge {
  font-size: 0.78rem;
  color: var(--text-secondary, #64748b);
  font-style: italic;
  margin: 0.4rem 0 0 0;
  padding: 0.25rem 0.6rem;
  background: #f8fafc;
  border-left: 2px solid #cbd5e1;
  border-radius: 0 0.25rem 0.25rem 0;
  display: inline-block;
}

.updated-badge.updated-feedback {
  background: #dbeafe;
  border-left-color: #2563eb;
  color: #1e40af;
  font-style: normal;
  font-weight: 500;
}

/* ===== Engagement: per-entry feedback ===== */

.entry-feedback {
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-color, #e2e8f0);
  font-size: 0.82rem;
  color: var(--text-secondary, #64748b);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.entry-feedback .fb-prompt {
  margin-right: 0.2rem;
}

.entry-feedback .fb-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 0.3rem;
  padding: 0.15rem 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background 0.12s ease, transform 0.12s ease;
}

.entry-feedback .fb-btn:hover:not(:disabled) {
  background: #e2e8f0;
  transform: scale(1.1);
}

.entry-feedback .fb-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.entry-feedback .fb-down.active {
  background: #fee2e2;
  border-color: #f87171;
}

.entry-feedback .fb-thanks {
  color: #15803d;
  font-weight: 600;
}

.entry-feedback .fb-counts {
  color: var(--text-secondary, #64748b);
  font-size: 0.78rem;
}

.entry-feedback .fb-reason {
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.entry-feedback .fb-reason-label {
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  font-size: 0.82rem;
}

.entry-feedback .fb-reason-text {
  width: 100%;
  font-family: inherit;
  padding: 0.4rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.3rem;
  font-size: 0.85rem;
  resize: vertical;
}

.entry-feedback .fb-honey {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.entry-feedback .fb-reason-actions {
  display: flex;
  gap: 0.4rem;
}

.entry-feedback .fb-submit,
.entry-feedback .fb-cancel,
.entry-feedback .fb-cancel {
  padding: 0.3rem 0.7rem;
  border-radius: 0.3rem;
  font-size: 0.82rem;
  cursor: pointer;
  border: 1px solid transparent;
}

.entry-feedback .fb-submit {
  background: #2563eb;
  color: #ffffff;
}

.entry-feedback .fb-submit:hover {
  background: #1d4ed8;
}

.entry-feedback .fb-cancel {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

.entry-feedback .fb-cancel:hover {
  background: #e2e8f0;
}

/* ===== Suggest-a-term CTA + modal ===== */

.glossary-header .header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.suggest-cta {
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.suggest-cta:hover {
  background: #1d4ed8;
}

/* On mobile the header CTA wraps awkwardly; hide it. The floating
 * "Ask the Glossary" widget (loaded on every page) provides the
 * suggest-a-term entry point via its "Don't see what you need?" link. */
@media (max-width: 640px) {
  .suggest-cta {
    display: none;
  }
}

.suggest-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.suggest-modal[hidden] { display: none; }

.suggest-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.suggest-modal-panel {
  position: relative;
  background: #ffffff;
  border-radius: 0.5rem;
  padding: 1.5rem;
  max-width: 540px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.suggest-modal-panel h2 {
  margin: 0 0 0.4rem 0;
  font-size: 1.25rem;
}

.suggest-modal-help {
  font-size: 0.88rem;
  color: var(--text-secondary, #475569);
  margin: 0 0 1rem 0;
}

.suggest-modal-panel form label {
  display: block;
  font-weight: 600;
  margin: 0.6rem 0 0.25rem 0;
  font-size: 0.85rem;
  color: var(--text-primary, #1e293b);
}

.suggest-modal-panel form input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.3rem;
  font-size: 0.92rem;
}

.suggest-modal-panel form input:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

.suggest-honey {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.suggest-dedup-hint {
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  background: #fef3c7;
  border-radius: 0.3rem;
  font-size: 0.85rem;
  color: #78350f;
}

.suggest-dedup-hint a {
  color: #b45309;
  font-weight: 600;
  text-decoration: underline;
  margin-right: 0.3rem;
}

.suggest-modal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.suggest-submit,
.suggest-cancel {
  padding: 0.5rem 1rem;
  border-radius: 0.3rem;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}

.suggest-submit {
  background: #2563eb;
  color: #ffffff;
}

.suggest-submit:hover {
  background: #1d4ed8;
}

.suggest-cancel {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

.suggest-cancel:hover {
  background: #e2e8f0;
}

.suggest-status {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #dcfce7;
  color: #15803d;
  border-radius: 0.3rem;
  font-size: 0.88rem;
}

.back-to-top {
  text-align: center;
  margin-top: 2rem;
}

.back-to-top a {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary, #f1f5f9);
  color: var(--text-primary, #1e293b);
  text-decoration: none;
  border-radius: 0.375rem;
  font-size: 0.85rem;
}

.back-to-top a:hover {
  background: var(--bg-tertiary, #e2e8f0);
}

@media (max-width: 600px) {
  .glossary-toc ol {
    grid-template-columns: 1fr;
  }
  .category-heading {
    font-size: 1.1rem;
  }
}

/* Research Guide section — destination of the "Research Guide" hero CTA */
.research-guide {
  margin: 2rem 0;
  padding: 1.5rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
}

.research-guide h2 {
  margin-top: 0;
}

.research-guide .rg-intro {
  color: #4b5563;
}

.research-guide .rg-route {
  margin-top: 1.5rem;
}

.research-guide .rg-route h3 {
  margin-bottom: 0.5rem;
}

/* Scroll-margin for hero anchors.
 * - .research-guide (#guide): 70px clears the 65px sticky navbar; no other
 *   sticky obstacle above this section in DOM.
 * - #categories: 140px clears navbar AND .glossary-filter (sticky top:60px,
 *   pins at Y=60-127). The search bar stays sticky-visible at top — useful
 *   for filtering. Categories chips render cleanly below it from Y≈160+. */
.research-guide {
  scroll-margin-top: 70px;
}
#categories {
  scroll-margin-top: 140px;
}

/* Flash-of-page-top elimination — Firefox/legacy fallback for browsers
 * that don't support <link rel="expect" blocking="render">.
 *
 * On a URL with #fragment, html:has(:target) matches at parse time —
 * BEFORE first paint. Body is hidden until JS adds .scroll-ready, which
 * happens after target.scrollIntoView() completes (see
 * public/js/glossary-anchor-jump.js). Result: body never paints at the
 * page-top; first visible content is at the anchor target.
 *
 * :has() is baseline (Chromium 105+, Safari 15.4+, Firefox 121+).
 * Trade-off: ~50-200ms blank screen on hash URLs (acceptable — operator's
 * complaint was the flash, not perceived load time). Non-hash URLs are
 * unaffected (no :target match → rule doesn't apply → body always
 * visible, scroll-ready class still added by JS as a no-op).
 */
html:has(:target) body { visibility: hidden; }
html.scroll-ready body { visibility: visible; }

/* Collapsed page-top metadata. Hides verbose paragraphs (subtitle, meta,
 * audience note, translation note) by default — when collapsed, the
 * page-top shows only the H1 + Suggest button + this disclosure. Reduces
 * what flashes during anchor-jump load on browsers without rel=expect
 * support. Also makes the page feel less heavy on first load. */
.header-details {
  margin: 0.5rem 0 0 0;
}
.header-details > summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary, #64748b);
  padding: 0.2rem 0;
  user-select: none;
  list-style: revert;
}
.header-details > summary:hover {
  color: var(--text-primary, #1e293b);
}
.header-details[open] > summary {
  margin-bottom: 0.4rem;
}

/* =========================================================================
   Concertina + Rider icons + Compact/Reading toggle
   Plan ref: PLAN_GLOSSARY_CONCERTINA_20260509 (Track 1 + Track 3)
   ========================================================================= */

/* Filtered-out (rider filter from glossary-concertina.js) — composes with
 * [hidden] from search/category in glossary.js. */
.glossary-entry.filtered-out { display: none; }

/* Compact mode: collapse entry body, leave only term (with riders) visible.
 * Body class glossary-mode-compact applied by JS based on localStorage. */
body.glossary-mode-compact .glossary-entry {
  padding-block: 0.5rem;
  cursor: pointer;
}
body.glossary-mode-compact .glossary-entry > :not(.term) {
  display: none;
}
body.glossary-mode-compact .glossary-entry.expanded > * {
  display: revert;
}
body.glossary-mode-compact .glossary-entry.search-match > * {
  display: revert;
}

/* Caret (right-arrow when collapsed, down-arrow when expanded) */
body.glossary-mode-compact .glossary-entry .term::after {
  content: " \25B8";
  display: inline-block;
  font-size: 0.85em;
  color: #6b7280;
  margin-left: 0.4rem;
  transition: transform 0.15s;
}
body.glossary-mode-compact .glossary-entry.expanded .term::after,
body.glossary-mode-compact .glossary-entry.search-match .term::after {
  content: " \25BE";
}

/* Riders — small chips on the right of the term */
.entry-riders {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-left: 0.6rem;
  vertical-align: middle;
}
.entry-rider {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 0.25rem;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #4b5563;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s, box-shadow 0.1s, background 0.1s;
  min-height: 22px;
  line-height: 1.2;
}
.entry-rider:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  transform: translateY(-1px);
}
.entry-rider:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}
.entry-rider.active {
  background: #3b82f6;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

/* Per-category accent tint when not active */
.entry-rider[data-rider-cat="architecture"]    { background: #eff6ff; color: #1e3a8a; border-color: #bfdbfe; }
.entry-rider[data-rider-cat="governance"]      { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.entry-rider[data-rider-cat="te-ao-maori"]     { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.entry-rider[data-rider-cat="ai-cognition"]    { background: #f5f3ff; color: #5b21b6; border-color: #ddd6fe; }
.entry-rider[data-rider-cat="ai-stack"]        { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.entry-rider[data-rider-cat="identity-access"] { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.entry-rider[data-rider-cat="security"]        { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.entry-rider[data-rider-cat="infrastructure"]  { background: #f0fdfa; color: #115e59; border-color: #99f6e4; }
.entry-rider[data-rider-cat="operating-discipline"] { background: #fefce8; color: #854d0e; border-color: #fef08a; }
.entry-rider[data-rider-cat="community"]       { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.entry-rider[data-rider-type="mi"]             { background: #ecfdf5; color: #065f46; border-color: #6ee7b7; font-weight: 600; }
.entry-rider[data-rider-type="length"]         { background: #fef3c7; color: #92400e; border-color: #fcd34d; }

/* Compact/Reading mode toggle (in glossary-filter area) */
.glossary-mode-toggle {
  display: inline-flex;
  margin-left: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  overflow: hidden;
  align-self: center;
}
.glossary-mode-toggle button {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  background: #ffffff;
  color: #374151;
  border: none;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.glossary-mode-toggle button + button {
  border-left: 1px solid #d1d5db;
}
.glossary-mode-toggle button:hover {
  background: #f9fafb;
}
.glossary-mode-toggle button[aria-pressed="true"] {
  background: #3b82f6;
  color: #ffffff;
}

/* Active-filter chip row (shown below glossary-filter when filters active) */
.glossary-rider-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0.25rem;
}
.glossary-rider-chips:empty { display: none; }
.glossary-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 500;
  background: #e0e7ff;
  border: 1px solid #c7d2fe;
  border-radius: 1rem;
  color: #3730a3;
}
.glossary-chip .chip-remove {
  cursor: pointer;
  color: #4338ca;
  font-weight: 700;
  background: transparent;
  border: 0;
  padding: 0 0.1rem;
  margin: 0;
  font-size: 1rem;
  line-height: 1;
}
.glossary-chip .chip-remove:hover {
  color: #1e1b4b;
}
.glossary-chip-clear {
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  background: transparent;
  border: 1px dashed #9ca3af;
  border-radius: 1rem;
  color: #4b5563;
  cursor: pointer;
}
.glossary-chip-clear:hover {
  background: #f3f4f6;
  color: #1f2937;
}

/* Mobile tap targets — riders need to remain >= 28px high in compact mode */
@media (max-width: 640px) {
  .entry-rider { min-height: 28px; padding: 0.2rem 0.55rem; font-size: 0.75rem; }
  .glossary-mode-toggle button { padding: 0.5rem 0.85rem; font-size: 0.85rem; }
}
