/*
 * wiki.css — Poly-Sim Academy & Wiki unified design system
 * Version 2.0 | 2026-05-03
 *
 * Design philosophy:
 *   - Editorial / long-read style. Prose comes first.
 *   - Content column capped at 680 px — comfortable on any screen.
 *   - Two-column (article + sidebar) on ≥860 px, single-col on mobile.
 *   - Three AdSense slot placeholders per article, clearly separated.
 *   - Zero colourful pill clutter. ONE accent colour per track.
 *   - Components: subtle, whitespace-heavy, never fight the text.
 *
 * Track body classes → accent colour:
 *   .track-crypto   → amber  #d97706
 *   .track-finance  → blue   #2563eb
 *   .track-trading  → violet #7c3aed
 *   .track-defi     → teal   #0d9488
 *   .track-wiki     → sky    #0284c7 (default)
 */

/* ─────────────────────────────────────────────────
   1. RESET & BASE
───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  /* ── Mobile zoom fix: prevent any overflowing element from
     widening the viewport and forcing the browser to zoom out ── */
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #fff;
  color: #1a1a2e;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  /* ── Prevent horizontal overflow from forcing page-level zoom ── */
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ─────────────────────────────────────────────────
   2. COLOUR TOKENS
───────────────────────────────────────────────── */
:root {
  --accent:      #0284c7;
  --accent-mid:  rgba(2, 132, 199, .12);
  --accent-line: rgba(2, 132, 199, .30);
  --text:        #1e293b;
  --text-muted:  #64748b;
  --text-xmuted: #94a3b8;
  --border:      #e2e8f0;
  --surface:     #f8fafc;
  --surface-2:   #f1f5f9;
}
body.track-crypto  { --accent:#d97706; --accent-mid:rgba(217,119,6,.10); --accent-line:rgba(217,119,6,.30); }
body.track-finance { --accent:#2563eb; --accent-mid:rgba(37,99,235,.10); --accent-line:rgba(37,99,235,.30); }
body.track-trading { --accent:#7c3aed; --accent-mid:rgba(124,58,237,.10); --accent-line:rgba(124,58,237,.30); }
body.track-defi    { --accent:#0d9488; --accent-mid:rgba(13,148,136,.10); --accent-line:rgba(13,148,136,.30); }

/* ─────────────────────────────────────────────────
   3. PAGE LAYOUT — two-col grid
───────────────────────────────────────────────── */
.wiki-layout {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px 96px;
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 48px;
  align-items: start;
  /* ── Prevent grid from overflowing on narrow viewports ── */
  box-sizing: border-box;
  overflow: hidden;
}
@media (max-width: 860px) {
  .wiki-layout {
    grid-template-columns: 1fr;
    padding: 32px 18px 72px;
    gap: 0;
  }
  .wiki-sidebar { display: none; }
}

/* ─────────────────────────────────────────────────
   4. ARTICLE HEADER (wiki pages — dark bar at top)
───────────────────────────────────────────────── */
.wiki-art-header {
  background: #0f172a;
  padding: 40px 24px 36px;
  border-bottom: 1px solid #1e293b;
}
.wiki-art-header-inner {
  max-width: 760px;
  margin: 0 auto;
}
.wiki-art-breadcrumb {
  font-size: 12px;
  color: #475569;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 18px;
  letter-spacing: .02em;
}
.wiki-art-breadcrumb a { color: #64748b; text-decoration: none; }
.wiki-art-breadcrumb a:hover { color: #94a3b8; }
.wiki-art-breadcrumb span { margin: 0 6px; }

.wiki-art-header h1 {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 800;
  color: #f1f5f9;
  line-height: 1.18;
  margin-bottom: 14px;
  letter-spacing: -.025em;
}
.wiki-art-desc {
  font-size: 16px;
  color: #94a3b8;
  line-height: 1.65;
  max-width: 600px;
  margin-bottom: 16px;
}
.wiki-art-meta {
  font-size: 12px;
  color: #475569;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .02em;
}

/* ─────────────────────────────────────────────────
   5. LEARN ARTICLE HEADER (light, single-column)
   Used with .art-wrap layout
───────────────────────────────────────────────── */
.art-header {
  padding: 40px 0 0;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
}
.art-breadcrumb {
  font-size: 12px;
  color: var(--text-xmuted);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 16px;
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.art-breadcrumb a { color: var(--text-xmuted); text-decoration: none; }
.art-breadcrumb a:hover { color: var(--accent); }

/* Track label — replaces .art-tag pill. Simple, not colourful. */
.art-track {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 10px;
  display: block;
}

.art-title {
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -.025em;
}
.art-meta {
  font-size: 12px;
  color: var(--text-xmuted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .02em;
  display: flex; gap: 16px; flex-wrap: wrap;
}

/* Legacy .art-tag (pill) — keep visible but understated */
.art-tag {
  display: none; /* hidden in v2 — replaced by .art-track */
}

/* ─────────────────────────────────────────────────
   6. CONTENT COLUMN — single-column wrapper
───────────────────────────────────────────────── */
.art-wrap {
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px 96px;
  box-sizing: border-box;
  overflow-x: hidden;
}
@media (max-width: 640px) { .art-wrap { padding: 0 16px 72px; } }

/* ─────────────────────────────────────────────────
   7. ARTICLE TYPOGRAPHY
───────────────────────────────────────────────── */
.wiki-article h2,
.art-wrap h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -.015em;
  line-height: 1.25;
}
.wiki-article h2:first-child,
.art-wrap h2:first-child { margin-top: 0; }

.wiki-article h3,
.art-wrap h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 12px;
  line-height: 1.3;
}
.wiki-article h4,
.art-wrap h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin: 24px 0 8px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.wiki-article p,
.art-wrap p {
  color: #334155;
  margin-bottom: 20px;
  line-height: 1.8;
  font-size: 16px;
}
.wiki-article ul,
.wiki-article ol,
.art-wrap ul,
.art-wrap ol {
  color: #334155;
  padding-left: 24px;
  margin-bottom: 20px;
}
.wiki-article li,
.art-wrap li { margin-bottom: 8px; line-height: 1.7; font-size: 16px; }
.wiki-article strong, .art-wrap strong { color: var(--text); }
.wiki-article a { color: var(--accent); }
.wiki-article a:hover { text-decoration: underline; opacity: 1; }
.wiki-article code,
.art-wrap code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--surface-2);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ── Pre/code blocks: scroll internally, never overflow page ── */
pre {
  overflow-x: auto;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Any element with fixed width that could overflow on mobile ── */
.wiki-article *,
.art-wrap *,
.wiki-body *,
.wiki-layout * {
  max-width: 100%;
  box-sizing: border-box;
}

/* breadcrumb inside wiki-layout article */
.wiki-breadcrumb {
  font-size: 12px; color: var(--text-xmuted);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 32px;
}
.wiki-breadcrumb a { color: var(--text-xmuted); text-decoration: none; }
.wiki-breadcrumb a:hover { color: var(--accent); }

/* ─────────────────────────────────────────────────
   8. LEAD PARAGRAPH
   ONE subtle accent line — not a coloured box
───────────────────────────────────────────────── */
.art-lead {
  font-size: 18px;
  color: #334155;
  line-height: 1.75;
  margin-bottom: 36px;
  padding-left: 20px;
  border-left: 3px solid var(--accent);
}

/* ─────────────────────────────────────────────────
   9. TABLE OF CONTENTS (inline)
───────────────────────────────────────────────── */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 36px;
}
.toc-title, .toc h4 {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-xmuted);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 14px;
}
.toc ol, .toc ul { padding-left: 18px; margin-bottom: 0; }
.toc li { font-size: 14px; color: var(--text-muted); margin-bottom: 6px; line-height: 1.5; }
.toc a  { color: var(--text-muted); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

/* ─────────────────────────────────────────────────
   10. CALLOUT — ONE neutral style, two tonal variants
   Keep it quiet. No coloured backgrounds fighting text.
───────────────────────────────────────────────── */
.wiki-callout,
.callout {
  border-left: 3px solid var(--border);
  padding: 16px 20px;
  margin: 28px 0;
  font-size: 15px;
  color: #334155;
  line-height: 1.7;
  background: var(--surface);
  border-radius: 0 8px 8px 0;
}
.wiki-callout strong, .callout strong { color: var(--text); }
.wiki-callout a, .callout a { color: var(--accent); }
.callout-title {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 8px;
}

/* accent variant (tip) */
.wiki-callout.tip, .callout.tip {
  border-left-color: var(--accent);
  background: var(--accent-mid);
}
/* warning variant */
.wiki-callout.warn, .callout.warn {
  border-left-color: #d97706;
  background: #fffbeb;
  color: #78350f;
}
.wiki-callout.warn strong { color: #92400e; }

/* Green / amber / red — legacy classes kept for compatibility */
.wiki-callout.green { border-left-color: #16a34a; background: #f0fdf4; color: #14532d; }
.wiki-callout.amber { border-left-color: #d97706; background: #fffbeb; color: #78350f; }
/* .red deprecated — renders same as .warn to avoid alarming red backgrounds */
.wiki-callout.red   { border-left-color: #d97706; background: #fffbeb; color: #78350f; }

/* .callout-warn — alias used in older learn/ articles */
.callout-warn {
  border-left: 3px solid #d97706;
  background: #fffbeb;
  padding: 16px 20px;
  margin: 28px 0;
  font-size: 15px;
  color: #78350f;
  line-height: 1.7;
  border-radius: 0 8px 8px 0;
}
.callout-warn strong { color: #92400e; }
.callout-warn-title {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: #d97706; font-family: 'JetBrains Mono', monospace;
  margin-bottom: 8px;
}

/* ─────────────────────────────────────────────────
   11. STAT ROW — small data highlights
───────────────────────────────────────────────── */
.wiki-stats-row,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin: 28px 0;
}
.wiki-stat-card,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 14px;
  text-align: center;
}
.wiki-stat-val,
.stat-card-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.1;
  display: block;
}
.wiki-stat-lbl,
.stat-card-label {
  font-size: 11px;
  color: var(--text-xmuted);
  margin-top: 6px;
  line-height: 1.4;
  display: block;
}

/* ─────────────────────────────────────────────────
   12. TABLES
───────────────────────────────────────────────── */
.wiki-table,
.compare-table,
.kelly-table,
.conv-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
  overflow-x: auto;
  display: block;
}
.wiki-table th,
.compare-table th,
.kelly-table th,
.conv-table th {
  background: var(--surface-2);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  font-size: 12px;
  white-space: nowrap;
}
.wiki-table td,
.compare-table td,
.kelly-table td,
.conv-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--surface-2);
  color: #334155;
  vertical-align: top;
}
.wiki-table tr:last-child td,
.compare-table tr:last-child td,
.kelly-table tr:last-child td,
.conv-table tr:last-child td { border-bottom: none; }
.wiki-table tbody tr:hover td,
.compare-table tbody tr:hover td { background: var(--surface); }
/* value colours */
.wiki-table .pos { color: #15803d; }
.wiki-table .neg { color: #b91c1c; }
.wiki-table .mid { color: #92400e; }

/* ─────────────────────────────────────────────────
   13. FORMULA / CODE BLOCK
───────────────────────────────────────────────── */
.formula-box {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 20px 22px;
  margin: 24px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #334155;
  line-height: 1.9;
  overflow-x: auto;
}
.formula-box .formula-label {
  font-size: 10px; color: var(--text-xmuted);
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 10px; display: block;
}
.formula-box .formula-main {
  font-size: 18px; font-weight: 700;
  color: var(--text); display: block; margin-bottom: 8px;
}
.formula-box .formula-vars {
  font-size: 12px; color: var(--text-muted);
  line-height: 1.9; display: block;
}

/* ─────────────────────────────────────────────────
   14. INDICATOR / FEATURE CARDS (trading pages)
───────────────────────────────────────────────── */
.indicator-card {
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  margin-bottom: 14px;
  background: var(--surface);
  border-radius: 0 8px 8px 0;
}
.indicator-name {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700; font-size: 13px;
  color: var(--accent); margin-bottom: 6px;
}
.indicator-desc { font-size: 14px; color: #475569; line-height: 1.65; }

/* ─────────────────────────────────────────────────
   15. DeFi CARDS
───────────────────────────────────────────────── */
.defi-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 12px;
  display: flex; gap: 16px; align-items: flex-start;
  background: #fff;
}
.defi-icon { font-size: 24px; flex-shrink: 0; margin-top: 2px; }
.defi-name { font-weight: 700; font-size: 14px; color: var(--accent); margin-bottom: 4px; }
.defi-desc { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* ─────────────────────────────────────────────────
   16. STRATEGY CARDS
───────────────────────────────────────────────── */
.wiki-strategy-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 24px;
  margin-bottom: 16px;
  background: #fff;
}
.wiki-strategy-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px;
  display: block;
}
.wiki-strategy-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.wiki-strategy-body { font-size: 14px; color: #334155; line-height: 1.7; }
.wiki-strategy-body p { margin-bottom: 10px; }
.wiki-strategy-body ul { padding-left: 18px; }
.wiki-strategy-body li { margin-bottom: 5px; }

/* signal labels (inline, minimal) */
.wiki-signal-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.wiki-signal {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  padding: 3px 8px; border-radius: 5px;
  border: 1px solid var(--border); color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 4px;
}
.wiki-signal.green { color: #15803d; border-color: #bbf7d0; background: #f0fdf4; }
.wiki-signal.amber { color: #a16207; border-color: #fde68a; background: #fffbeb; }
.wiki-signal.red   { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }

/* ─────────────────────────────────────────────────
   17. PLATFORM CARDS
───────────────────────────────────────────────── */
.platform-card {
  border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 20px; margin-bottom: 14px;
  background: #fff;
}
.platform-card-name { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.platform-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 5px; margin-right: 4px; margin-bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
}
.platform-badge.green { background: #dcfce7; color: #15803d; }
.platform-badge.blue  { background: #dbeafe; color: #1d4ed8; }
.platform-badge.amber { background: #fef9c3; color: #a16207; }

/* ─────────────────────────────────────────────────
   18. RESOLUTION STEPS (.wiki-step)
   Numbered process steps — clean, no decorative borders
───────────────────────────────────────────────── */
.wiki-step {
  display: flex; gap: 16px; align-items: flex-start;
  margin-bottom: 16px;
  padding: 16px 18px;
  background: var(--surface);
  border-radius: 8px;
}
.wiki-step-num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.wiki-step-body h4 {
  font-size: 14px; font-weight: 700; color: var(--text);
  margin-bottom: 4px; text-transform: none; letter-spacing: 0;
}
.wiki-step-body p { font-size: 14px; color: var(--text-muted); margin: 0; line-height: 1.6; }

/* ─────────────────────────────────────────────────
   19. CTA STRIP — ONE style, used sparingly
   Dark background, clean button. No emoji overload.
───────────────────────────────────────────────── */
.art-cta,
.wiki-cta {
  background: #0f172a;
  border-radius: 12px;
  padding: 24px 28px;
  margin: 40px 0;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.art-cta-icon { font-size: 32px; flex-shrink: 0; }
.art-cta-body,
.art-cta-text { flex: 1; min-width: 160px; }
.art-cta-title,
.wiki-cta h3 {
  font-size: 15px; font-weight: 700; color: #f1f5f9;
  margin-bottom: 4px; line-height: 1.35;
}
.art-cta-desc,
.wiki-cta p {
  font-size: 13px; color: #94a3b8; line-height: 1.5; margin: 0 0 14px;
}
.art-cta-btn,
.wiki-cta a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; border-radius: 8px;
  background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 700; text-decoration: none;
  transition: opacity .18s; flex-shrink: 0;
  white-space: nowrap;
}
.art-cta-btn:hover,
.wiki-cta a:hover { opacity: .85; text-decoration: none; }
@media (max-width: 560px) {
  .art-cta, .wiki-cta { flex-direction: column; align-items: flex-start; }
}

/* ─────────────────────────────────────────────────
   20. SPONSOR NOTE
───────────────────────────────────────────────── */
.wiki-sponsor-note {
  border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 18px;
  font-size: 13px; color: var(--text-muted); line-height: 1.6;
  margin: 20px 0;
  background: var(--surface);
}
.wiki-sponsor-note a { color: var(--accent); font-weight: 600; }

/* ─────────────────────────────────────────────────
   21. RELATED ARTICLES GRID
───────────────────────────────────────────────── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px; margin-top: 10px;
}
.related-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
  text-decoration: none; color: inherit;
  transition: border-color .15s;
}
.related-card:hover { border-color: var(--accent); text-decoration: none; }
.related-card .rt { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.related-card .rs { font-size: 11px; color: var(--text-xmuted); }

/* ─────────────────────────────────────────────────
   22. PREV / NEXT NAV BUTTONS
───────────────────────────────────────────────── */
.wiki-nav-row,
.art-nav {
  display: flex; gap: 12px; margin-top: 48px;
  padding-top: 28px; border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.wiki-nav-btn,
.art-nav-btn {
  flex: 1; min-width: 160px; max-width: 300px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 18px;
  text-decoration: none; transition: border-color .18s;
  color: inherit;
}
.wiki-nav-btn:hover,
.art-nav-btn:hover { border-color: var(--accent); text-decoration: none; }
.wiki-nav-lbl {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-xmuted);
  font-family: 'JetBrains Mono', monospace; margin-bottom: 4px;
}
.wiki-nav-ttl { font-size: 13px; font-weight: 600; color: var(--text); }
/* For learn pages — simple text buttons */
.art-nav-btn {
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  padding: 10px 16px; min-width: 0; max-width: 100%; flex: 0 0 auto;
  text-align: center;
}
.art-nav-btn:hover { color: var(--accent); }

/* ─────────────────────────────────────────────────
   23. SIDEBAR
───────────────────────────────────────────────── */
.wiki-sidebar {
  position: sticky; top: 24px;
  display: flex; flex-direction: column; gap: 16px;
}

/* TOC block */
.wiki-toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 20px;
}
.wiki-toc-title {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-xmuted);
  font-family: 'JetBrains Mono', monospace; margin-bottom: 14px;
}
.wiki-toc a {
  display: block; font-size: 13px; color: var(--text-muted);
  padding: 5px 0; border-bottom: 1px solid var(--surface-2);
  text-decoration: none; transition: color .15s;
  line-height: 1.4;
}
.wiki-toc a:last-child { border-bottom: none; }
.wiki-toc a:hover { color: var(--accent); }

/* Related block */
.wiki-related {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px;
}
.wiki-related-title {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-xmuted);
  font-family: 'JetBrains Mono', monospace; margin-bottom: 12px;
}
.wiki-related a {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-muted);
  padding: 6px 0; border-bottom: 1px solid var(--surface-2);
  text-decoration: none; transition: color .15s;
}
.wiki-related a:last-child { border-bottom: none; }
.wiki-related a:hover { color: var(--text); }

/* Sidebar ad slot */
.wiki-sidebar-ad {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; min-height: 100px;
}

/* ─────────────────────────────────────────────────
   24. ADSENSE SLOTS — 3 per article
   slot-1: below lead paragraph (top-of-article)
   slot-2: mid-article
   slot-3: above nav (end-of-article)
───────────────────────────────────────────────── */
.ad-slot {
  margin: 36px 0;
  text-align: center;
  min-height: 100px;
  overflow: hidden;
}
.ad-slot ins { display: block; }
/* Visual separator so ads feel intentional, not injected */
.ad-slot::before {
  content: '';
  display: block;
  height: 1px;
  background: var(--border);
  margin-bottom: 24px;
}
.ad-slot::after {
  content: '';
  display: block;
  height: 1px;
  background: var(--border);
  margin-top: 24px;
}

/* ─────────────────────────────────────────────────
   25. PRICE BAR COMPONENT
───────────────────────────────────────────────── */
.wiki-price-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 20px; margin: 24px 0;
}
.wiki-price-bar-title {
  font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-xmuted);
  font-family: 'JetBrains Mono', monospace; margin-bottom: 12px;
}
.wiki-bar-track { height: 8px; background: #fee2e2; border-radius: 5px; overflow: hidden; margin-bottom: 8px; }
.wiki-bar-fill  { height: 100%; border-radius: 5px; background: var(--accent); transition: width .5s ease; }
.wiki-bar-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-xmuted); font-family: 'JetBrains Mono', monospace; }

/* ─────────────────────────────────────────────────
   26. ORDER BOOK (polymarket-liquidity pages)
───────────────────────────────────────────────── */
.orderbook {
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; margin: 24px 0; font-size: 13px;
}
.ob-title {
  padding: 12px 16px; background: var(--surface-2);
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.ob-header {
  display: flex; justify-content: space-between;
  padding: 8px 16px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-xmuted); font-family: 'JetBrains Mono', monospace;
  border-bottom: 1px solid var(--border);
}
.ob-row {
  display: flex; justify-content: space-between;
  align-items: center; padding: 6px 16px;
  position: relative; font-family: 'JetBrains Mono', monospace;
  border-bottom: 1px solid var(--surface-2);
}
.ob-row:last-child { border-bottom: none; }
.ob-row.ask { color: #b91c1c; }
.ob-row.bid { color: #15803d; }
.ob-bar {
  position: absolute; inset: 0; right: auto;
  opacity: .08; pointer-events: none;
}
.ob-row.ask .ob-bar { background: #ef4444; }
.ob-row.bid .ob-bar { background: #22c55e; }

/* ─────────────────────────────────────────────────
   27. SPREAD CALCULATOR
───────────────────────────────────────────────── */
.spread-calc {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 22px 24px; margin: 24px 0;
}
.calc-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px;
}
@media (max-width: 480px) { .calc-grid { grid-template-columns: 1fr; } }
.calc-field label {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); font-family: 'JetBrains Mono', monospace; margin-bottom: 6px;
}
.calc-field input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 14px; background: #fff;
  font-family: 'JetBrains Mono', monospace; transition: border-color .15s;
}
.calc-field input:focus { outline: none; border-color: var(--accent); }
.calc-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: 10px; }
.calc-result-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px; text-align: center;
}
.calc-result-card.good .crv { color: #15803d; }
.calc-result-card.ok   .crv { color: #a16207; }
.calc-result-card.bad  .crv { color: #b91c1c; }
.crv { font-size: 20px; font-weight: 800; font-family: 'JetBrains Mono', monospace; }
.crl { font-size: 11px; color: var(--text-xmuted); margin-top: 4px; }

/* ─────────────────────────────────────────────────
   28. KELLY CALCULATOR
───────────────────────────────────────────────── */
.kelly-calc {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 22px 24px; margin: 24px 0;
}
.kelly-calc h4 {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-xmuted);
  font-family: 'JetBrains Mono', monospace; margin-bottom: 16px;
}
.kelly-result-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px; text-align: center;
}
.kelly-result-card .krv { font-size: 22px; font-weight: 800; font-family: 'JetBrains Mono', monospace; color: var(--accent); }
.kelly-result-card.bad  .krv { color: #b91c1c; }
.kelly-result-card.ok   .krv { color: #a16207; }
.kelly-result-card.good .krv { color: #15803d; }

/* ─────────────────────────────────────────────────
   29. BANKROLL SIMULATOR
───────────────────────────────────────────────── */
.sim-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 22px 24px; margin: 24px 0;
}
.sim-controls {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr));
  gap: 14px; margin-bottom: 16px;
}
.sim-btn {
  background: var(--accent); color: #fff; border: none;
  padding: 10px 18px; border-radius: 8px; font-size: 13px;
  font-weight: 700; cursor: pointer; transition: opacity .18s;
}
.sim-btn:hover { opacity: .85; }

/* ─────────────────────────────────────────────────
   30. CHART CONTAINER
───────────────────────────────────────────────── */
.chart-wrap {
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 20px; margin: 24px 0;
}
.chart-title {
  font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px;
}
.chart-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.chart-wrap canvas { max-height: 260px; }

/* ─────────────────────────────────────────────────
   31. TIMELINE
───────────────────────────────────────────────── */
.wiki-timeline { position: relative; padding-left: 28px; margin: 24px 0; }
.wiki-timeline::before {
  content: '';
  position: absolute; left: 8px; top: 4px; bottom: 4px;
  width: 2px; background: var(--border);
}
.wiki-tl-item { position: relative; margin-bottom: 20px; }
.wiki-tl-dot {
  position: absolute; left: -24px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--accent-line);
}
.wiki-tl-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--accent);
  font-family: 'JetBrains Mono', monospace; margin-bottom: 4px;
}
.wiki-tl-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.wiki-tl-desc  { font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.wiki-tl-time  { font-size: 11px; color: var(--text-xmuted); font-family: 'JetBrains Mono', monospace; margin-top: 4px; }

/* ─────────────────────────────────────────────────
   32. EDGE-CASE / BIAS CARDS
───────────────────────────────────────────────── */
.wiki-edge-grid,
.wiki-bias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px; margin: 20px 0;
}
.wiki-edge-card,
.wiki-bias-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px;
}
.wiki-edge-icon,
.wiki-bias-name { font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 6px; }
.wiki-edge-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.wiki-edge-desc,
.wiki-bias-desc { font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.wiki-edge-outcome,
.wiki-bias-impact {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 5px; margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
}
.wiki-bias-impact.high { background: #fef2f2; color: #b91c1c; }
.wiki-bias-impact.med  { background: #fffbeb; color: #a16207; }
.wiki-edge-outcome.yes { background: #dcfce7; color: #15803d; }
.wiki-edge-outcome.no  { background: #fee2e2; color: #b91c1c; }
.wiki-edge-outcome.na  { background: var(--surface-2); color: var(--text-muted); }

/* ─────────────────────────────────────────────────
   33. COMPARE GRID (binary vs predict)
───────────────────────────────────────────────── */
.compare-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px; margin: 20px 0;
}
@media (max-width: 540px) { .compare-grid { grid-template-columns: 1fr; } }
.compare-grid .cg-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 18px;
}
.compare-grid .cg-card.binary { border-top: 3px solid #ef4444; }
.compare-grid .cg-card.predict { border-top: 3px solid #22c55e; }
.cg-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 10px; }

/* ─────────────────────────────────────────────────
   34. AI REMARK BOX
   Injected by article-enhancements.js — keep subtle.
   Only ONE box shows at a time (JS handles this).
───────────────────────────────────────────────── */
#ai-remark[hidden] { display: none !important; }
.ai-remark-box {
  border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 18px;
  font-size: 14px; color: var(--text-muted); line-height: 1.7;
  margin: 0 0 28px;
  background: var(--surface);
}
.ai-remark-box strong { color: var(--text); }
/* Suppress any additional AI boxes beyond the first */
.ai-remark-box ~ .ai-remark-box { display: none; }
.ps-why-box ~ .ps-why-box { display: none; }
.ps-tldr-box ~ .ps-tldr-box { display: none; }

/* ─────────────────────────────────────────────────
   35. HERO ADJUSTMENT
   nav-footer.js injects .ps-hero — keep compatible
───────────────────────────────────────────────── */
/* When a hero is present, the art-wrap starts below it */
.ps-hero + .art-wrap  { padding-top: 32px; }
.ps-hero + .wiki-layout { padding-top: 32px; }

/* ─────────────────────────────────────────────────
   36. WIKI INDEX / CATEGORY PAGE COMPONENTS
───────────────────────────────────────────────── */
/* Hero section for index pages */
.cat-hero {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 56px 24px 44px; text-align: center;
  position: relative; overflow: hidden;
}
.cat-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 100% at 50% -20%, var(--accent-mid) 0%, transparent 65%);
  pointer-events: none;
}
.cat-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
  font-family: 'JetBrains Mono', monospace; margin-bottom: 12px;
  position: relative;
}
.cat-title {
  font-size: clamp(28px, 5vw, 44px); font-weight: 800;
  color: var(--text); line-height: 1.12; letter-spacing: -.025em;
  margin-bottom: 14px; position: relative;
}
.cat-sub {
  font-size: 16px; color: var(--text-muted);
  max-width: 520px; margin: 0 auto; line-height: 1.65;
  position: relative;
}
/* REMOVE chip/pill row — was the main clutter source */
.cat-chips { display: none; }
.cat-chip  { display: none; }

/* Main content width */
.cat-main {
  max-width: 1000px; margin: 0 auto; padding: 48px 24px 80px;
}
@media (max-width: 640px) { .cat-main { padding: 32px 16px 64px; } }

/* Progress bar */
.progress-bar { margin: 24px 0; }
.progress-track {
  height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; margin-bottom: 6px;
}
.progress-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width .6s ease; }
.progress-label { font-size: 11px; color: var(--text-xmuted); font-family: 'JetBrains Mono', monospace; }

/* Section label */
.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-xmuted); font-family: 'JetBrains Mono', monospace;
  margin-bottom: 16px; margin-top: 40px;
}
.section-label:first-child { margin-top: 0; }

/* Articles grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.article-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 20px;
  text-decoration: none; color: inherit;
  transition: border-color .18s;
  display: block;
}
.article-card:hover { border-color: var(--accent); text-decoration: none; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-icon { font-size: 20px; }
/* difficulty — subtle text, no coloured badges */
.card-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; font-family: 'JetBrains Mono', monospace;
  color: var(--text-xmuted);
}
.card-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; line-height: 1.3; }
.card-desc  { font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.card-meta  { font-size: 11px; color: var(--text-xmuted); margin-top: 10px; font-family: 'JetBrains Mono', monospace; }
.card-arrow { font-size: 14px; color: var(--text-xmuted); margin-top: 10px; }
/* Legacy coloured badges — kept for HTML compatibility, made subtle */
.card-badge.beginner     { color: #15803d; }
.card-badge.intermediate { color: #a16207; }
.card-badge.advanced     { color: #b91c1c; }

/* Back link */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted); text-decoration: none;
  margin-bottom: 32px;
}
.back-link:hover { color: var(--accent); text-decoration: none; }

/* Related tracks grid */
.related-tracks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px; margin-top: 12px;
}
.track-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px;
  text-decoration: none; color: inherit;
  transition: border-color .18s;
  display: flex; align-items: center; gap: 12px;
}
.track-card:hover { border-color: var(--accent); text-decoration: none; }
.track-icon  { font-size: 22px; }
.track-name  { font-size: 14px; font-weight: 700; color: var(--text); }
.track-count { font-size: 12px; color: var(--text-xmuted); }

/* ─────────────────────────────────────────────────
   37. CTA STRIP (end-of-page full-width)
───────────────────────────────────────────────── */
.wiki-cta-strip {
  background: #0f172a;
  border-radius: 12px; padding: 28px 32px;
  margin: 40px 0;
  display: flex; align-items: center;
  justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.wiki-cta-strip p { color: #94a3b8; font-size: 14px; line-height: 1.6; margin: 0; }
.wiki-cta-strip strong { color: #f1f5f9; }
.wiki-cta-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff;
  padding: 10px 22px; border-radius: 8px;
  font-size: 13px; font-weight: 700; text-decoration: none;
  white-space: nowrap; transition: opacity .18s; flex-shrink: 0;
}
.wiki-cta-btn:hover { opacity: .85; text-decoration: none; }

/* ─────────────────────────────────────────────────
   37b. WIKI CTA BLOCK (Phase 2 pages)
   (.wiki-cta-block, .wiki-related list, .formula-block, .wiki-faq)
───────────────────────────────────────────────── */
.wiki-cta-block {
  margin: 48px 0 0;
  padding: 28px 32px;
  background: linear-gradient(135deg, rgba(31,111,235,.08) 0%, rgba(56,139,253,.04) 100%);
  border: 1px solid rgba(31,111,235,.22);
  border-radius: 12px;
  text-align: center;
}
.wiki-cta-block h3 {
  font-size: 1.1rem; font-weight: 700; color: var(--text);
  margin: 0 0 8px;
}
.wiki-cta-block p {
  font-size: .93rem; color: var(--text-muted); line-height: 1.65;
  margin: 0 0 18px; max-width: 520px; margin-left: auto; margin-right: auto;
}

/* formula / code callout blocks */
.formula-block {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.1);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 18px 0;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: .9rem;
  color: var(--text);
  line-height: 1.7;
}
.formula-block strong { color: #79c0ff; }
.formula-block ul { margin: 10px 0 0 18px; padding: 0; }
.formula-block li { font-size: .88rem; color: var(--text-muted); margin-bottom: 3px; }

/* FAQ accordion */
.wiki-faq { margin-top: 40px; }
.wiki-faq h2 { margin-bottom: 16px; }
.wiki-faq details {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 0;
}
.wiki-faq details:last-child { border-bottom: 1px solid rgba(255,255,255,.07); }
.wiki-faq summary {
  cursor: pointer;
  padding: 14px 4px;
  font-size: .97rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
}
.wiki-faq summary::-webkit-details-marker { display: none; }
.wiki-faq summary::after {
  content: '+';
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform .2s;
}
.wiki-faq details[open] summary::after {
  content: '−';
}
.wiki-faq details p {
  font-size: .92rem;
  color: var(--text-muted);
  line-height: 1.7;
  padding: 0 4px 16px;
  margin: 0;
}

/* wiki-related simple list (Phase 2 pages) */
.wiki-related { margin-top: 40px; }
.wiki-related h3 {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.wiki-related ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.wiki-related li a {
  font-size: .93rem;
  color: var(--accent-light, #79c0ff);
  text-decoration: none;
  transition: color .15s;
}
.wiki-related li a:hover { color: var(--text); }

/* wiki disclaimer box */
.wiki-disclaimer {
  background: rgba(240,136,62,.06);
  border-left: 3px solid #f0883e;
  padding: 12px 16px;
  border-radius: 4px;
  font-size: .88rem;
  color: var(--text-muted);
  margin-top: 16px;
  line-height: 1.6;
}

/* ─────────────────────────────────────────────────
   38. LEARN HUB INDEX PAGE COMPONENTS
   (.learn-body, .learn-card, etc.)
───────────────────────────────────────────────── */

/* Hub page header (replaces ps-hero on learn/index.html) */
.hub-header {
  max-width: 1020px; margin: 0 auto; padding: 56px 24px 0;
}
.hub-header .art-breadcrumb { margin-bottom: 16px; }
.hub-title {
  font-size: clamp(26px, 4vw, 38px); font-weight: 800;
  color: var(--text); letter-spacing: -.02em; line-height: 1.15;
  margin: 0 0 12px;
}
.hub-lead {
  font-size: 16px; color: var(--text-muted); line-height: 1.65;
  max-width: 620px; margin: 0;
}

.learn-body {
  max-width: 1020px; margin: 0 auto; padding: 48px 24px 80px;
}
.learn-sec-title {
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-xmuted);
  font-family: 'JetBrains Mono', monospace; margin-bottom: 16px;
}
/* Navigation pills on learn index — simplified */
.learn-cat-nav {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px;
}
.learn-cat-pill {
  padding: 7px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); color: var(--text-muted);
  background: #fff; cursor: pointer; text-decoration: none;
  transition: border-color .15s, color .15s;
}
.learn-cat-pill:hover,
.learn-cat-pill.active {
  border-color: var(--accent); color: var(--accent); text-decoration: none;
}

/* Track banner */
.learn-cat-banner {
  border-radius: 12px; padding: 24px 28px; margin-bottom: 28px;
  background: var(--surface); border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.learn-cat-banner-eyebrow {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--accent);
  font-family: 'JetBrains Mono', monospace; margin-bottom: 8px;
}
.learn-cat-banner-title {
  font-size: 22px; font-weight: 800; color: var(--text);
  margin-bottom: 8px; letter-spacing: -.015em;
}
.learn-cat-banner-desc {
  font-size: 14px; color: var(--text-muted); line-height: 1.6;
}
.learn-cat-banner-count {
  font-size: 72px; font-weight: 900; color: var(--border);
  position: absolute; right: 20px; bottom: -10px;
  font-family: 'JetBrains Mono', monospace; line-height: 1;
  pointer-events: none; user-select: none;
}

/* Article grid */
.learn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}
.learn-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 20px;
  text-decoration: none; color: inherit;
  transition: border-color .18s;
  display: block;
}
.learn-card:hover { border-color: var(--accent); text-decoration: none; }

/* Featured card */
.learn-featured {
  grid-column: 1 / -1;
  border-radius: 12px; padding: 24px 28px;
  background: #fff; border: 1px solid var(--border);
  display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center;
}
@media (max-width: 640px) {
  .learn-featured { grid-template-columns: 1fr; }
  .learn-featured-emoji { display: none; }
}

/* Stats bar */
.learn-stats { display: flex; gap: 20px; flex-wrap: wrap; margin: 24px 0; }
.learn-stat  { font-size: 13px; color: var(--text-muted); }
.learn-stat strong { color: var(--text); }

/* Ledger CTA */
.ledger-cta {
  background: #0f172a; border-radius: 12px; padding: 24px 28px;
  margin: 32px 0; text-align: center;
}
.ledger-cta h3 { color: #f1f5f9; font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.ledger-cta p  { color: #94a3b8; font-size: 13px; margin-bottom: 16px; }
.ledger-cta a  {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 9px 22px; border-radius: 8px; font-size: 13px;
  font-weight: 700; text-decoration: none; transition: opacity .18s;
}
.ledger-cta a:hover { opacity: .85; }

/* ─────────────────────────────────────────────────
   38a. WIKI-BODY layout — older wiki articles use
   .wiki-body instead of .wiki-layout
   Render it as a clean centred single column
───────────────────────────────────────────────── */
.wiki-body {
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px 96px;
  box-sizing: border-box;
  overflow-x: hidden;
}
@media (max-width: 640px) { .wiki-body { padding: 32px 16px 72px; } }

/* headings / prose inside wiki-body */
.wiki-body h2 {
  font-size: 22px; font-weight: 800;
  color: var(--text); margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -.015em; line-height: 1.25;
}
.wiki-body h2:first-child { margin-top: 0; }
.wiki-body h3 { font-size: 17px; font-weight: 700; color: var(--text); margin: 32px 0 12px; }
.wiki-body h4 { font-size: 13px; font-weight: 700; color: var(--text-muted); margin: 24px 0 8px; text-transform: uppercase; letter-spacing: .06em; }
.wiki-body p  { color: #334155; margin-bottom: 20px; line-height: 1.8; font-size: 16px; }
.wiki-body ul, .wiki-body ol { color: #334155; padding-left: 24px; margin-bottom: 20px; }
.wiki-body li { margin-bottom: 8px; line-height: 1.7; font-size: 16px; }
.wiki-body strong { color: var(--text); }
.wiki-body a { color: var(--accent); }
.wiki-body a:hover { text-decoration: underline; }
.wiki-body code { font-family: 'JetBrains Mono', monospace; font-size: 13px; background: var(--surface-2); border-radius: 4px; padding: 1px 5px; color: var(--text); }

/* .wiki-tip — used in older wiki articles */
.wiki-tip {
  border-left: 3px solid var(--accent);
  background: var(--accent-mid);
  padding: 16px 20px; margin: 28px 0;
  font-size: 15px; color: #334155; line-height: 1.7;
  border-radius: 0 8px 8px 0;
}
.wiki-tip p { margin: 0; color: #334155; }
.wiki-tip strong { color: var(--text); }
.wiki-tip a { color: var(--accent); }

/* .wiki-callout-warn — used in strategy pages */
.wiki-callout-warn {
  border-left: 3px solid #d97706;
  background: #fffbeb;
  padding: 16px 20px; margin: 28px 0;
  font-size: 15px; color: #78350f; line-height: 1.7;
  border-radius: 0 8px 8px 0;
}
.wiki-callout-warn strong { color: #92400e; }

/* ─────────────────────────────────────────────────
   38b. ALIASES — legacy class names used in existing HTML
───────────────────────────────────────────────── */
/* .wiki-formula → formula-box */
.wiki-formula {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 20px 22px;
  margin: 24px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #334155;
  line-height: 1.9;
  overflow-x: auto;
}
.wiki-formula .f-label,
.wiki-formula span.f-label {
  font-size: 10px; color: var(--text-xmuted);
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 10px; display: block;
}
.wiki-formula .f-main,
.wiki-formula span.f-main {
  font-size: 17px; font-weight: 700;
  color: var(--text); display: block; margin-bottom: 8px;
}
.wiki-formula .f-note,
.wiki-formula span.f-note {
  font-size: 12px; color: var(--text-muted);
  line-height: 1.7; display: block;
}

/* .art-cta-text → same as .art-cta-body */
.art-cta-text {
  flex: 1; min-width: 160px;
}
.art-cta-text .art-cta-title {
  font-size: 15px; font-weight: 700; color: #f1f5f9;
  margin-bottom: 4px; line-height: 1.35;
}
.art-cta-text .art-cta-desc {
  font-size: 13px; color: #94a3b8; line-height: 1.5; margin: 0;
}

/* ps-hero compatibility — hide redundant injected hero on learn pages */
/* The art-header now serves as the page header; hide the hero */
.ps-hero { display: none !important; }

/* ─────────────────────────────────────────────────
   39. MISC UTILITY
───────────────────────────────────────────────── */
/* New badge */
.new-badge {
  display: inline-block; font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  background: #dcfce7; color: #15803d;
  font-family: 'JetBrains Mono', monospace; vertical-align: middle;
  letter-spacing: .06em;
}

/* Inline example block */
.wiki-example {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 20px; margin: 20px 0;
}
.wiki-example-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--accent);
  font-family: 'JetBrains Mono', monospace; margin-bottom: 10px;
}
.wiki-example p { font-size: 14px; color: #334155; margin-bottom: 6px; }
.wiki-example strong { color: var(--text); }

/* ─────────────────────────────────────────────────
   39b. MISSING COMPONENT ALIASES
   Classes used in existing HTML files
───────────────────────────────────────────────── */

/* .wiki-warn — warning callout (tax, arb, wallet pages) */
.wiki-warn {
  border-left: 3px solid #d97706;
  background: #fffbeb;
  padding: 14px 18px;
  margin: 24px 0;
  font-size: 14px;
  color: #78350f;
  line-height: 1.7;
  border-radius: 0 8px 8px 0;
}
.wiki-warn p { margin: 0; color: #78350f; }
.wiki-warn strong { color: #92400e; }

/* .wiki-danger — high-risk warning (leverage page) */
.wiki-danger {
  border-left: 3px solid #dc2626;
  background: #fef2f2;
  padding: 14px 18px;
  margin: 24px 0;
  font-size: 14px;
  color: #7f1d1d;
  line-height: 1.7;
  border-radius: 0 8px 8px 0;
}
.wiki-danger p { margin: 0; color: #7f1d1d; }
.wiki-danger strong { color: #991b1b; }

/* .manip-card — manipulation tactic cards */
.manip-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
  background: #fff;
}
.manip-card h4 {
  font-size: 14px; font-weight: 700;
  color: var(--text); margin-bottom: 8px;
  text-transform: none; letter-spacing: 0;
}
.manip-card p { font-size: 14px; color: #334155; margin: 0; line-height: 1.65; }

/* .wallet-grid / .wallet-card — hot/cold wallet comparison */
.wallet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px; margin: 20px 0;
}
@media (max-width: 540px) { .wallet-grid { grid-template-columns: 1fr; } }
.wallet-card {
  border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 20px;
  background: #fff;
}
.wallet-card.hot  { border-top: 3px solid #ef4444; }
.wallet-card.cold { border-top: 3px solid #0284c7; }
.wallet-card h4 {
  font-size: 14px; font-weight: 700;
  color: var(--text); margin-bottom: 10px;
  text-transform: none; letter-spacing: 0;
}
.wallet-card ul { padding-left: 18px; margin: 0; }
.wallet-card li { font-size: 13px; color: #334155; margin-bottom: 5px; line-height: 1.55; }

/* .compare-card — binary vs predict cards */
.compare-card {
  border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 20px;
  background: #fff; margin-bottom: 12px;
}
.compare-card.binary  { border-top: 3px solid #ef4444; }
.compare-card.predict { border-top: 3px solid #22c55e; }
.compare-card-header {
  font-size: 14px; font-weight: 700;
  color: var(--text); margin-bottom: 12px;
}
.compare-card ul { padding-left: 18px; margin: 0; }
.compare-card li { font-size: 13px; color: #334155; margin-bottom: 6px; line-height: 1.55; }

/* ─────────────────────────────────────────────────
   40a. QUICK SUMMARY BOX
   ⚡ "Quick Summary" at the top of every article.
   Serves AI/SGE extraction + scannability.
───────────────────────────────────────────────── */
.quick-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 18px 22px;
  margin: 0 0 36px;
}
/* ── Quick-summary title: suppress ⚡ emoji, keep clean label ── */
.qs-title {
  font-size: 11px; font-weight: 700; letter-spacing: .10em;
  text-transform: uppercase; color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 12px;
  /* Hide emoji glyph, show only the text after it */
  font-style: normal;
}
/* Override the ⚡ character visually by hiding it with font-size 0 on first char */
.qs-title::first-letter {
  font-size: 0;
  visibility: hidden;
  margin-right: -0.15em;
}
.quick-summary ul {
  padding-left: 0; margin: 0; list-style: none;
}
.quick-summary li {
  font-size: 14px; color: #334155; line-height: 1.65;
  margin-bottom: 7px; padding-left: 0;
  display: flex; gap: 8px; align-items: baseline;
}
.quick-summary li:last-child { margin-bottom: 0; }
.quick-summary li strong { color: var(--text); min-width: 100px; flex-shrink: 0; }
@media (max-width: 480px) {
  .quick-summary li { flex-direction: column; gap: 2px; }
  .quick-summary li strong { min-width: 0; }
}

/* ─────────────────────────────────────────────────
   40b. AI TRENDING CRYPTO SECTION
   Weekly-refreshed section injected into articles.
   Loaded dynamically from Cloudflare Worker KV.
───────────────────────────────────────────────── */
.ai-trending-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  margin: 36px 0;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.ai-trending-section::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), #818cf8);
}
.ai-trending-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.ai-trending-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #16a34a; box-shadow: 0 0 6px #16a34a;
  animation: ps-live-glow 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes ps-live-glow { 0%,100%{opacity:1} 50%{opacity:.4} }
.ai-trending-title {
  font-size: 16px; font-weight: 700; color: var(--text);
  margin-bottom: 10px; line-height: 1.3;
}
.ai-trending-body {
  font-size: 15px; color: #334155; line-height: 1.8;
  margin-bottom: 10px;
}
.ai-trending-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.ai-trending-footer {
  font-size: 11px; color: var(--text-xmuted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 8px;
}
.ai-trending-skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--surface-2) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: ai-skeleton-shimmer 1.4s infinite;
  border-radius: 6px; height: 14px; margin-bottom: 8px;
}
@keyframes ai-skeleton-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ─────────────────────────────────────────────────
   40c. CONTENT WIDTH FIX — boxes on wide screens
   Prevent stat-grid, related-grid, compare-table
   from spreading too wide on large desktops.
───────────────────────────────────────────────── */
.art-wrap .stat-grid,
.wiki-body .stat-grid {
  max-width: 640px;
}
.art-wrap .wiki-stats-row,
.wiki-body .wiki-stats-row {
  max-width: 640px;
}
/* related-grid: constrain card width for readability */
.art-wrap .related-grid,
.wiki-body .related-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 240px));
}
/* compare-table: keep readable column widths */
.art-wrap .compare-table,
.wiki-body .compare-table,
.art-wrap .wiki-table,
.wiki-body .wiki-table {
  max-width: 100%;
  font-size: 14px;
}
/* sidebar tools panel */
.sidebar-tools {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px;
}
.sidebar-tools-title {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-xmuted);
  font-family: 'JetBrains Mono', monospace; margin-bottom: 12px;
}
.sidebar-tool-link {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-muted);
  padding: 7px 0; border-bottom: 1px solid var(--surface-2);
  text-decoration: none; transition: color .15s;
}
.sidebar-tool-link:last-child { border-bottom: none; }
.sidebar-tool-link:hover { color: var(--accent); text-decoration: none; }
.sidebar-tool-icon {
  width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
  background: var(--accent-mid);
}

/* content-with-sidebar layout for learn articles */
.content-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 40px;
  align-items: start;
  max-width: 960px;
  margin: 0 auto;
}
@media (max-width: 860px) {
  .content-with-sidebar {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .content-with-sidebar aside.wiki-sidebar { display: none; }
}

/* ─────────────────────────────────────────────────
   40. RESPONSIVE — mobile tweaks
───────────────────────────────────────────────── */
@media (max-width: 480px) {
  .wiki-stats-row,
  .stat-grid     { grid-template-columns: 1fr 1fr; }
  .related-grid  { grid-template-columns: 1fr; }
  .wiki-nav-row,
  .art-nav       { flex-direction: column; }
  .wiki-nav-btn,
  .art-nav-btn   { max-width: 100%; flex: none; }
  .learn-cat-banner-count { display: none; }
  .art-lead { font-size: 16px; }
  .art-title, .wiki-art-header h1 { letter-spacing: -.02em; }
  .articles-grid { grid-template-columns: 1fr; }
  .wiki-cta-strip { flex-direction: column; }
}
