/* ============================================================
 * Glossary — index + term page styles.
 * Index ported from page mockups/glossary-mockup-final.html,
 * term page from glossary-term-mockup-final.html. Header/footer rules
 * dropped — those come from the theme. Everything is scoped under
 * .gf-glossary so it can't leak into / be overridden by theme CSS.
 * `.hero` collides with the theme (35 rules) → renamed `.gl-hero`.
 * Sticky/scroll offsets are driven by --header-h:70px (the theme's
 * fixed header, body > header) + --alpha-h:44px — NOT the mockup's
 * 64px header. Change --header-h here if the theme header height changes.
 * Index search is live (term lookup); the mockup's curated AI-answer
 * panel is intentionally omitted.
 * ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

.gf-glossary {
  --accent: #5b5ef4;
  --accent-dark: #4a4de0;
  --accent-light: #ededfe;
  --accent-2: #a78bfa;
  --bg-page: #f4f5f7;
  --surface: #ffffff;
  --border: #e8eaed;
  --border-soft: #f0f1f4;
  --text-primary: #15171c;
  --text-secondary: #5b6472;
  --text-muted: #9ca3af;
  --radius-sm: 4px;
  --radius-md: 4px;
  --radius-lg: 4px;
  --radius-xl: 20px;
  --alpha-h: 44px;
  --header-h: 70px; /* theme's FIXED header (body > header) — overlaps the viewport top */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.gf-glossary *, .gf-glossary *::before, .gf-glossary *::after { box-sizing: border-box; margin: 0; padding: 0; }
.gf-glossary a { color: inherit; }

/* Isolation from the theme's global cascade (#15, #17): the theme ships a global
   `* { font-size: 1.6rem }` (public/css/styles.min.css) that matches every
   element directly and so SHRINKS inline elements in headings/text to 16px,
   beating the value inherited from the parent. Force inline elements to take
   their size from their own container. Mirrors the article fix (#11), scoped to
   the glossary. Elements with an explicit glossary size keep it (higher
   specificity wins), so this only restores the un-sized ones (e.g. .accent span
   in the H1, the <a> links in the breadcrumb). List ALL text-bearing inline tags
   — missing `a` (#15) left the breadcrumb links at 16px (#17). */
.gf-glossary span,
.gf-glossary a,
.gf-glossary strong,
.gf-glossary b,
.gf-glossary em,
.gf-glossary i,
.gf-glossary mark,
.gf-glossary small,
.gf-glossary sub,
.gf-glossary sup {
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

/* ─────────────────────────  HERO  ───────────────────────── */
.gf-glossary .gl-hero {
  background: linear-gradient(135deg, #0a0a14 0%, #141428 55%, #0a0a14 100%);
  border-bottom: 1px solid #1c1c30;
  /* top = header clearance + the mockup's 78px breathing room. The theme header
     is FIXED (overlaps), so the raw 78px from the mockup (whose header is sticky)
     would leave only ~8px below the menu. (#14) */
  padding: calc(var(--header-h) + 78px) 48px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.gf-glossary .gl-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.8;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 80% 90% at 50% 0%, #000 40%, transparent 85%);
  mask-image: radial-gradient(ellipse 80% 90% at 50% 0%, #000 40%, transparent 85%);
}
.gf-glossary .gl-hero::after {
  content: '';
  position: absolute;
  top: -160px; left: 50%;
  transform: translateX(-50%);
  width: 920px; height: 520px;
  background: radial-gradient(ellipse at center, rgba(91,94,244,0.22) 0%, transparent 68%);
  pointer-events: none;
}
.gf-glossary .hero-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }

.gf-glossary .hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(91,94,244,0.15);
  color: #a5a8fc;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 5px 13px;
  border-radius: 100px;
  margin-bottom: 24px;
  border: 1px solid rgba(91,94,244,0.28);
}
.gf-glossary .hero-eyebrow .dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: gl-pulse-dot 2s ease-in-out infinite;
}
@keyframes gl-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.65); }
}

.gf-glossary .gl-hero h1 {
  font-size: 53px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -2px;
  line-height: 1.08;
  margin-bottom: 16px;
}
.gf-glossary .gl-hero h1 .accent { color: #8b8ef8; }
.gf-glossary .hero-desc {
  font-size: 16.5px;
  color: #8b92a5;
  max-width: 490px;
  margin: 0 auto 40px;
  line-height: 1.6;
  font-weight: 400;
}

/* ─────────────  PROMPT WINDOW — the star  ───────────── */
.gf-glossary .prompt-shell {
  max-width: 660px;
  margin: 0 auto;
  position: relative;
  z-index: 5;
  text-align: left;
}
/* Свечение убрано намеренно: в фокусе — только лёгкий scale (.prompt-shell.focused
   .prompt-box ниже), без glow/blur/анимированного градиента и ring-теней. */

.gf-glossary .prompt-box {
  position: relative;
  z-index: 1;
  background: rgba(20,20,32,0.66);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transform-origin: center;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.18s ease;
  overflow: hidden;
  cursor: text;
}
.gf-glossary .prompt-shell.focused .prompt-box {
  border-color: rgba(139,142,248,0.5);
  box-shadow: 0 10px 34px rgba(0,0,0,0.45);
  transform: scale(1.012);
}

.gf-glossary .prompt-input-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 64px 16px 18px;
  position: relative;
  min-height: 64px;
}
.gf-glossary .prompt-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  box-shadow: 0 2px 8px rgba(91,94,244,0.3);
}
.gf-glossary .prompt-avatar svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.gf-glossary .prompt-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #f3f3ff;
  line-height: 1.55;
  resize: none;
  min-height: 28px;
  max-height: 132px;
  overflow-y: auto;
  display: block;
  width: 100%;
  padding: 4px 0 0;
  letter-spacing: -0.01em;
}
.gf-glossary .prompt-input::placeholder { color: #8b8ea5; }
.gf-glossary .prompt-input::-webkit-scrollbar { width: 4px; }
.gf-glossary .prompt-input::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.gf-glossary .prompt-send {
  position: absolute;
  right: 13px;
  bottom: 13px;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent) 0%, #7c75f7 100%);
  border: none;
  border-radius: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s;
  box-shadow: 0 2px 8px rgba(91,94,244,0.35);
  flex-shrink: 0;
  opacity: 0.55;
}
.gf-glossary .prompt-send.ready { opacity: 1; }
.gf-glossary .prompt-send:hover { transform: scale(1.06) translateY(-1px); box-shadow: 0 4px 16px rgba(91,94,244,0.45); }
.gf-glossary .prompt-send:active { transform: scale(0.95); }
.gf-glossary .prompt-send svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }

.gf-glossary .prompt-divider { height: 1px; background: rgba(255,255,255,0.10); display: none; }
.gf-glossary .prompt-results {
  display: none;
  padding: 6px;
  max-height: 312px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
  text-align: left;
}
.gf-glossary .prompt-results::-webkit-scrollbar { width: 5px; }
.gf-glossary .prompt-results::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
.gf-glossary .results-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8b8ea5;
  padding: 7px 10px 5px;
}
.gf-glossary .result-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s;
}
.gf-glossary .result-item:hover,
.gf-glossary .result-item.selected { background: rgba(255,255,255,0.06); }
.gf-glossary .result-item.selected .result-name { color: #b9bbfc; }
.gf-glossary .result-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}
.gf-glossary .result-item.selected .result-icon { background: rgba(91,94,244,0.28); border-color: rgba(91,94,244,0.45); }
.gf-glossary .result-body { flex: 1; min-width: 0; }
.gf-glossary .result-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #f3f3ff;
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.3;
}
.gf-glossary .result-en { font-size: 11px; font-weight: 400; color: #8b8ea5; }
.gf-glossary .result-snippet {
  font-size: 12px;
  color: #aab0c0;
  margin-top: 2px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gf-glossary .result-tag {
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 100px;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}
.gf-glossary .prompt-no-results {
  display: none;
  padding: 22px 16px;
  text-align: center;
  font-size: 13px;
  color: #8b8ea5;
}
.gf-glossary .prompt-foot {
  display: none;
  padding: 8px 16px;
  border-top: 1px solid rgba(255,255,255,0.10);
  align-items: center;
  gap: 16px;
}
.gf-glossary .prompt-foot-hint { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: #8b8ea5; }
.gf-glossary .prompt-foot-hint kbd {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10.5px;
  font-family: inherit;
  color: #d7d9e6;
}
.gf-glossary mark { background: rgba(139,142,248,0.28); color: #c7c9fc; border-radius: 2px; padding: 0 1px; }

.gf-glossary .prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}
.gf-glossary .prompt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 500;
  color: #c4c9d8;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  animation: gl-chip-in 0.4s ease both;
}
.gf-glossary .prompt-chip:nth-child(1) { animation-delay: 0.05s; }
.gf-glossary .prompt-chip:nth-child(2) { animation-delay: 0.11s; }
.gf-glossary .prompt-chip:nth-child(3) { animation-delay: 0.17s; }
.gf-glossary .prompt-chip:nth-child(4) { animation-delay: 0.23s; }
.gf-glossary .prompt-chip:nth-child(5) { animation-delay: 0.29s; }
.gf-glossary .prompt-chip:nth-child(6) { animation-delay: 0.35s; }
@keyframes gl-chip-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.gf-glossary .prompt-chip:hover {
  background: rgba(91,94,244,0.22);
  border-color: rgba(139,142,248,0.5);
  color: #d7d8fc;
  transform: translateY(-1px);
}
.gf-glossary .prompt-chip .chip-icon { font-size: 13px; opacity: 0.85; }

/* ─────────────────────────  ALPHA NAV  ───────────────────────── */
.gf-glossary .alpha-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 48px;
  display: flex;
  align-items: center;
  gap: 1px;
  overflow-x: auto;
  /* Pinned via GSAP ScrollTrigger in archive-glossary_term.php, NOT native sticky:
     the theme's ScrollSmoother (transform + overflow:hidden wrapper) defeats
     position:sticky. position:relative keeps z-index active so the pinned ribbon
     sits above the scrolling content. */
  position: relative;
  z-index: 100;
  scrollbar-width: none;
  height: var(--alpha-h);
}
.gf-glossary .alpha-nav::-webkit-scrollbar { display: none; }
.gf-glossary .alpha-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.12s;
  flex-shrink: 0;
}
.gf-glossary .alpha-nav a:hover { background: var(--accent-light); color: var(--accent); }
.gf-glossary .alpha-nav a.active { background: var(--accent); color: #fff; }
.gf-glossary .alpha-nav a.disabled { color: #d1d5db; cursor: default; pointer-events: none; }

/* ─────────────────────────  MAIN  ───────────────────────── */
.gf-glossary .main-wrap { max-width: 1140px; margin: 0 auto; padding: 44px 24px 100px; }

/* ── Filters ── */
.gf-glossary .filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 44px; align-items: center; }
.gf-glossary .filters-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
}
.gf-glossary .filter-btn {
  padding: 7px 15px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.gf-glossary .filter-btn:hover { color: var(--accent); border-color: rgba(91,94,244,0.4); background: var(--accent-light); }
.gf-glossary .filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 10px rgba(91,94,244,0.22); }
.gf-glossary .filter-btn .fbdot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.gf-glossary .filter-btn.active .fbdot { background: rgba(255,255,255,0.6) !important; }

/* ── Page layout ── */
.gf-glossary .page-layout { display: grid; grid-template-columns: 1fr 258px; gap: 36px; align-items: start; }

/* ── Letter sections ── */
.gf-glossary .letter-section { margin-bottom: 52px; scroll-margin-top: calc(var(--header-h) + var(--alpha-h) + 16px); }
.gf-glossary .letter-section.is-hidden { display: none; }
.gf-glossary .letter-anchor { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.gf-glossary .letter-badge {
  width: 40px;
  height: 40px;
  background: #5b5ef4;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}
.gf-glossary .letter-count { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.gf-glossary .letter-line { flex: 1; height: 1px; background: var(--border-soft); }

/* ── Term grid ── */
.gf-glossary .term-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.gf-glossary .term-card {
  background: #fff;
  border-radius: 4px;
  padding: 16px 18px;
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.gf-glossary .term-card.is-hidden { display: none; }
.gf-glossary .term-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.2s;
}
.gf-glossary .term-card:hover { box-shadow: 0 4px 20px rgba(91,94,244,0.09); transform: translateY(-1px); }
.gf-glossary .term-card:hover::before { background: #5b5ef4; }
.gf-glossary .term-card:hover .term-name { color: var(--accent); }
.gf-glossary .term-card.highlight { box-shadow: 0 0 0 2px rgba(91,94,244,0.55); background: #fafbff; }
.gf-glossary .term-card.highlight::before { background: #5b5ef4; }
.gf-glossary .term-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.gf-glossary .term-name { font-size: 14px; font-weight: 600; color: var(--text-primary); line-height: 1.3; transition: color 0.15s; letter-spacing: -0.01em; }
.gf-glossary .term-en { font-size: 11px; color: var(--text-muted); margin-top: 2px; font-weight: 400; }
.gf-glossary .term-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 100px;
  flex-shrink: 0;
  white-space: nowrap;
  letter-spacing: 0.1px;
}
.gf-glossary .term-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; }

/* category tag colors (shared index + term) */
.gf-glossary .tag-personalization { background: #ede9fe; color: #6d28d9; }
.gf-glossary .tag-analytics       { background: #dbeafe; color: #1d4ed8; }
.gf-glossary .tag-ai              { background: #d1fae5; color: #065f46; }
.gf-glossary .tag-recommendations { background: #fef3c7; color: #92400e; }
.gf-glossary .tag-ab              { background: #fee2e2; color: #991b1b; }
.gf-glossary .tag-metrics         { background: #e0f2fe; color: #075985; }
.gf-glossary .tag-cdp             { background: #fce7f3; color: #9d174d; }
.gf-glossary .tag-marketing       { background: #f3f4f6; color: #374151; }
.gf-glossary .tag-agentic         { background: #cffafe; color: #0e7490; }
.gf-glossary .tag-dev             { background: #e0e7ff; color: #3730a3; }
.gf-glossary .tag-gamification    { background: #ffedd5; color: #9a3412; }
.gf-glossary .tag-mobile          { background: #ecfccb; color: #3f6212; }
.gf-glossary .tag-seo             { background: #f5d0fe; color: #86198f; }
.gf-glossary .tag-tech            { background: #e2e8f0; color: #334155; }

/* No-results state for main list */
.gf-glossary .list-empty { display: none; padding: 48px 20px; text-align: center; color: var(--text-muted); font-size: 14px; }
.gf-glossary .list-empty.visible { display: block; }

/* ── Sidebar ── */
.gf-glossary .gl-sidebar { position: sticky; top: calc(var(--header-h) + var(--alpha-h) + 24px); }
.gf-glossary .gl-sidebar-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.gf-glossary .gl-sidebar-card h3 {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.gf-glossary .gl-sidebar-terms { list-style: none; padding: 0; }
.gf-glossary .gl-sidebar-terms li { padding: 6px 0; border-bottom: 1px solid var(--border-soft); }
.gf-glossary .gl-sidebar-terms li:last-child { border-bottom: none; }
.gf-glossary .gl-sidebar-terms a {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: gap 0.15s, color 0.15s;
}
.gf-glossary .gl-sidebar-terms a::before {
  content: '';
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.4;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.gf-glossary .gl-sidebar-terms a:hover { gap: 9px; color: var(--accent-dark); }
.gf-glossary .gl-sidebar-terms a:hover::before { opacity: 1; }

.gf-glossary .cat-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border-soft); }
.gf-glossary .cat-row:last-child { border-bottom: none; }
.gf-glossary .cat-name { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.gf-glossary .cat-count {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--bg-page);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.gf-glossary .gl-sidebar-cta {
  background: linear-gradient(135deg, var(--accent) 0%, #7c75f7 100%);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.gf-glossary .gl-sidebar-cta::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.gf-glossary .gl-sidebar-cta h3 { font-size: 14px; font-weight: 700; margin-bottom: 8px; color: #fff; text-transform: none; letter-spacing: -0.01em; position: relative; }
.gf-glossary .gl-sidebar-cta p { font-size: 12.5px; color: rgba(255,255,255,0.82); margin-bottom: 16px; line-height: 1.55; position: relative; }
.gf-glossary .gl-sidebar-cta a {
  background: #fff;
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}
.gf-glossary .gl-sidebar-cta a:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,0.18); }

/* ════════════ TERM PAGE ════════════ */

/* ─── BREADCRUMB ─── */
.gf-glossary .gl-breadcrumb {
  background: #fff;
  /* breadcrumb is the FIRST block on the term page → clear the theme's fixed
     header (#16, same class of bug as #14 on the index hero). top = header + 12px air. */
  padding: calc(var(--header-h) + 12px) 48px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #9ca3af;
}
.gf-glossary .gl-breadcrumb a { color: #6b7280; text-decoration: none; transition: color 0.15s; }
.gf-glossary .gl-breadcrumb a:hover { color: #5b5ef4; }
.gf-glossary .gl-breadcrumb .bc-sep { color: #d1d5db; }
.gf-glossary .gl-breadcrumb .bc-current { color: #1a1d23; font-weight: 500; }

/* ─── LAYOUT ─── */
.gf-glossary .gl-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 272px;
  gap: 40px;
  align-items: start;
}

/* ─── ARTICLE HEAD ─── */
.gf-glossary .content-head { margin-bottom: 28px; }
.gf-glossary .term-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.gf-glossary .gl-layout h1 {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -1px;
  color: #1a1d23;
  line-height: 1.15;
  margin-bottom: 8px;
}
.gf-glossary .term-subtitle { font-size: 15px; color: #9ca3af; margin-bottom: 0; }

/* ─── DEFINITION BOX ─── */
.gf-glossary .definition-box {
  background: linear-gradient(135deg, #f0f0ff 0%, #e9e9ff 100%);
  border-radius: 4px;
  padding: 24px 28px;
  margin-bottom: 36px;
}
.gf-glossary .definition-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #5b5ef4;
  margin-bottom: 10px;
}
.gf-glossary .definition-text { font-size: 17px; font-weight: 500; color: #1a1d23; line-height: 1.65; }

/* ─── ARTICLE BODY (rendered from MD) ─── */
.gf-glossary .article-body h2 { font-size: 21px; font-weight: 700; color: #1a1d23; margin: 36px 0 12px; letter-spacing: -0.3px; scroll-margin-top: calc(var(--header-h) + 24px); }
.gf-glossary .article-body h3 { font-size: 16px; font-weight: 600; color: #1a1d23; margin: 24px 0 8px; }
.gf-glossary .article-body p { font-size: 16px; color: #374151; margin-bottom: 16px; line-height: 1.75; }
.gf-glossary .article-body a { color: #5b5ef4; text-decoration: underline; }
.gf-glossary .article-body strong { font-weight: 700; color: #1a1d23; }
.gf-glossary .article-body ul, .gf-glossary .article-body ol { margin: 0 0 16px 22px; }
.gf-glossary .article-body li { font-size: 16px; color: #374151; line-height: 1.7; margin-bottom: 6px; }
.gf-glossary .article-body code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  background: #eef0f4;
  padding: 1px 6px;
  border-radius: 3px;
  color: #1a1d23;
}
.gf-glossary .article-body pre,
.gf-glossary .formula-block {
  background: #1a1d23;
  border-radius: 4px;
  padding: 20px 24px;
  margin: 20px 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  color: #a5b4fc;
  overflow-x: auto;
}
.gf-glossary .article-body pre code { background: none; padding: 0; color: inherit; }
.gf-glossary .formula-block .comment { color: #4b5563; }

/* ─── METRICS BAND ─── */
.gf-glossary .metrics-band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 24px 0; }
.gf-glossary .metric-item { background: #fff; border-radius: 4px; padding: 16px; text-align: center; }
.gf-glossary .metric-num { font-size: 26px; font-weight: 700; color: #5b5ef4; letter-spacing: -0.5px; }
.gf-glossary .metric-label { font-size: 12px; color: #9ca3af; margin-top: 4px; line-height: 1.4; }

/* ─── CALLOUTS ─── */
.gf-glossary .callout {
  border-radius: 4px;
  padding: 14px 18px;
  margin: 20px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
}
.gf-glossary .callout-info { background: #eff6ff; color: #1e40af; }
.gf-glossary .callout-tip { background: #f0fdf4; color: #166534; }
.gf-glossary .callout-warn { background: #fffbeb; color: #92400e; }
.gf-glossary .callout-icon { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.gf-glossary .callout p { margin: 0; line-height: 1.6; font-size: 15px; }

/* ─── COMPARE TABLE (MD tables) ─── */
.gf-glossary .article-body table,
.gf-glossary .compare-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px; }
.gf-glossary .article-body th,
.gf-glossary .compare-table th {
  background: #f4f5f7;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: #374151;
  font-size: 13px;
  border-bottom: 2px solid #e4e6ea;
}
.gf-glossary .article-body td,
.gf-glossary .compare-table td { padding: 10px 14px; vertical-align: top; color: #374151; border-bottom: 1px solid #f0f0f3; }
.gf-glossary .article-body tr:last-child td,
.gf-glossary .compare-table tr:last-child td { border-bottom: none; }
.gf-glossary .yes { color: #16a34a; font-weight: 600; }
.gf-glossary .no { color: #dc2626; }

/* ─── GF SECTION (How Gravity Field uses it) ─── */
.gf-glossary .gf-section { background: #0d0d1a; border-radius: 4px; padding: 28px 32px; margin: 36px 0; color: #fff; }
.gf-glossary .gf-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6b7bff;
  margin-bottom: 8px;
}
.gf-glossary .gf-section h3 { font-size: 19px; font-weight: 700; margin-bottom: 10px; color: #fff; letter-spacing: -0.3px; }
.gf-glossary .gf-section > p { font-size: 15px; color: #8b92a5; margin-bottom: 18px; line-height: 1.6; }
.gf-glossary .gf-features { display: flex; flex-direction: column; gap: 9px; margin-bottom: 22px; }
.gf-glossary .gf-feature { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: #c4c9d8; line-height: 1.5; }
.gf-glossary .gf-feature .icon { color: #6b7bff; font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.gf-glossary .gf-cta {
  background: #5b5ef4;
  color: #fff;
  padding: 10px 20px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  display: inline-block;
  transition: background 0.15s;
}
.gf-glossary .gf-cta:hover { background: #4f46e5; }

/* FAQ accordion (term page) */
.gf-glossary .gl-faq { margin: 36px 0; }
.gf-glossary .gl-faq h2 { font-size: 22px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.3px; margin-bottom: 16px; }
.gf-glossary .gl-faq-item { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); margin-bottom: 10px; overflow: hidden; }
.gf-glossary .gl-faq-item summary { list-style: none; cursor: pointer; position: relative; padding: 15px 46px 15px 18px; font-size: 15px; font-weight: 600; color: var(--text-primary); }
.gf-glossary .gl-faq-item summary::-webkit-details-marker { display: none; }
.gf-glossary .gl-faq-item summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 20px; font-weight: 400; line-height: 1; color: var(--text-muted); }
.gf-glossary .gl-faq-item[open] summary { color: var(--accent); }
.gf-glossary .gl-faq-item[open] summary::after { content: "\2212"; color: var(--accent); }
.gf-glossary .gl-faq-a { padding: 0 18px 16px; font-size: 14.5px; line-height: 1.65; color: var(--text-secondary); }

/* ─── RELATED TERMS ─── */
.gf-glossary .related-section { margin-top: 48px; padding-top: 36px; border-top: 1px solid #e8eaed; }
.gf-glossary .related-section h2 { font-size: 18px; font-weight: 700; margin-bottom: 16px; letter-spacing: -0.3px; }
.gf-glossary .related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.gf-glossary .related-card { background: #fff; border-radius: 4px; padding: 14px 16px; text-decoration: none; display: block; transition: background 0.15s; }
.gf-glossary .related-card:hover { background: #f0f0ff; }
.gf-glossary .related-card .name { font-size: 14px; font-weight: 600; color: #1a1d23; margin-bottom: 3px; }
.gf-glossary .related-card .desc { font-size: 12px; color: #9ca3af; line-height: 1.4; }

/* ─── TERM SIDEBAR ─── */
.gf-glossary .gl-term-sidebar { position: sticky; top: calc(var(--header-h) + 20px); }
.gf-glossary .gl-card { background: #fff; border-radius: 4px; padding: 18px; margin-bottom: 10px; }
.gf-glossary .gl-card h3 { font-size: 13px; font-weight: 600; color: #1a1d23; margin-bottom: 14px; }
.gf-glossary .meta-info { display: flex; flex-direction: column; gap: 10px; }
.gf-glossary .meta-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.gf-glossary .meta-label { color: #9ca3af; min-width: 80px; flex-shrink: 0; }
.gf-glossary .meta-value { color: #374151; font-weight: 500; }
.gf-glossary .meta-tag { font-size: 11px; padding: 2px 8px; border-radius: 100px; font-weight: 500; }
.gf-glossary .toc-list { list-style: none; padding: 0; margin: 0; }
.gf-glossary .toc-list li { margin-bottom: 2px; }
.gf-glossary .toc-list a {
  font-size: 13px;
  color: #6b7280;
  text-decoration: none;
  padding: 5px 10px;
  border-left: 2px solid #e8eaed;
  display: block;
  transition: all 0.15s;
  border-radius: 0 4px 4px 0;
}
.gf-glossary .toc-list a:hover { color: #5b5ef4; border-left-color: #5b5ef4; background: #f5f5ff; }
.gf-glossary .toc-list a.active { color: #5b5ef4; border-left-color: #5b5ef4; }
.gf-glossary .sidebar-term-list { list-style: none; padding: 0; margin: 0; }
.gf-glossary .sidebar-term-list li { padding: 6px 0; border-bottom: 1px solid #f3f4f6; }
.gf-glossary .sidebar-term-list li:last-child { border-bottom: none; }
.gf-glossary .sidebar-term-list a { font-size: 13px; color: #5b5ef4; text-decoration: none; }
.gf-glossary .sidebar-term-list a:hover { text-decoration: underline; }
.gf-glossary .sidebar-term-list .back-link { color: #9ca3af; }

/* ─────────────────────────  RESPONSIVE  ───────────────────────── */
@media (max-width: 960px) {
  .gf-glossary .page-layout { grid-template-columns: 1fr; }
  .gf-glossary .gl-sidebar { display: none; }
  .gf-glossary .gl-hero h1 { font-size: 36px; letter-spacing: -1.2px; }
  .gf-glossary .main-wrap { padding: 30px 16px 64px; }
  .gf-glossary .alpha-nav { padding: 0 16px; }
  .gf-glossary .gl-hero { padding: calc(var(--header-h) + 52px) 18px 44px; }
  .gf-glossary .prompt-shell { max-width: 100%; }
  .gf-glossary .prompt-chips { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; scrollbar-width: none; }
  .gf-glossary .prompt-chips::-webkit-scrollbar { display: none; }
  .gf-glossary .gl-layout { grid-template-columns: 1fr; }
  .gf-glossary .gl-term-sidebar { display: none; }
  .gf-glossary .gl-layout h1 { font-size: 28px; }
  .gf-glossary .gl-breadcrumb { padding: calc(var(--header-h) + 10px) 20px 10px; }
  .gf-glossary .metrics-band { grid-template-columns: repeat(2, 1fr); }
  .gf-glossary .related-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .gf-glossary .gl-hero h1 { font-size: 29px; }
  .gf-glossary .prompt-input { font-size: 15px; }
}
