/* ══════════════════════════════════════════════════════════════
   CDREGM Web App — Shared Stylesheet
   Design system carried over from web/webapp_outline.html
   ══════════════════════════════════════════════════════════════ */

:root {
  --c-color: #2563eb;
  --d-color: #16a34a;
  --r-color: #dc2626;
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #263047;
  --border: #334155;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #f59e0b;
  --accent2: #7c3aed;
  --serif: 'Georgia', 'Times New Roman', serif;
  --sans: 'Segoe UI', system-ui, sans-serif;
  --mono: 'Courier New', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.7;
}

a { color: inherit; }

/* ── SITE HEADER (logos + wordmark, all pages) ── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header .logo-slot {
  height: 32px;
  width: auto;
  max-width: 110px;
  border-radius: 4px;
  flex-shrink: 0;
  object-fit: contain;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 2px 4px;
}
.site-header .wordmark-group { display: flex; flex-direction: column; line-height: 1.2; }
.site-header .wordmark-group a { text-decoration: none; }
.site-header .wordmark {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--text);
}
.site-header .wordmark .c { color: #93c5fd; }
.site-header .wordmark .d { color: #86efac; }
.site-header .wordmark .r { color: #fca5a5; }
.site-header .wordmark-sub {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.site-header .spacer { flex: 1; }
.site-header .header-link {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 2rem;
  white-space: nowrap;
}
.site-header .header-link:hover { color: var(--accent); border-color: var(--accent); }
.nav-toggle {
  display: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
}

/* ── HERO (landing page) ── */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  border-bottom: 2px solid var(--accent);
  padding: 4rem 2rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(37,99,235,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(220,38,38,0.10) 0%, transparent 60%);
}
.hero-badge {
  display: inline-block;
  background: rgba(245,158,11,0.15);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.3rem 1rem;
  border-radius: 2rem;
  margin-bottom: 1.5rem;
  position: relative;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  position: relative;
}
.hero h1 span.c { color: var(--c-color); }
.hero h1 span.d { color: var(--d-color); }
.hero h1 span.r { color: var(--r-color); }
.hero-sub {
  font-family: var(--serif);
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  position: relative;
}
.hero-authors { font-size: 0.85rem; color: var(--text-muted); position: relative; }
.hero-authors strong { color: var(--text); }

.logo-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  margin-bottom: 2rem;
  position: relative;
  flex-wrap: wrap;
}
.logo-row img { height: 68px; width: auto; max-width: 220px; object-fit: contain; }
.logo-row .logo-caption { font-size: 0.68rem; color: var(--text-muted); margin-top: 0.35rem; text-align: center; }
.logo-row .logo-item { display: flex; flex-direction: column; align-items: center; }

.cdr-pills { display: flex; justify-content: center; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; position: relative; }
.pill { padding: 0.5rem 1.5rem; border-radius: 2rem; font-weight: 700; font-size: 0.9rem; letter-spacing: 0.05em; }
.pill-c { background: rgba(37,99,235,0.2); border: 1.5px solid var(--c-color); color: #93c5fd; }
.pill-d { background: rgba(22,163,74,0.2); border: 1.5px solid var(--d-color); color: #86efac; }
.pill-r { background: rgba(220,38,38,0.2); border: 1.5px solid var(--r-color); color: #fca5a5; }

/* ── META BANNER ── */
.meta-banner {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.meta-item strong { color: var(--text); }

/* ── LAYOUT ── */
.layout {
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  align-items: start;
}

/* ── SIDEBAR ── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 2rem 1rem;
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  overflow-y: auto;
}
.sidebar h3 {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-left: 0.5rem;
}
.nav-item {
  display: block;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.83rem;
  margin-bottom: 2px;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--surface2); color: var(--text); border-left-color: var(--accent); }
.nav-item.active { background: var(--surface2); color: var(--text); border-left-color: var(--accent); font-weight: 600; }
.nav-item .num { display: inline-block; width: 1.4rem; font-size: 0.72rem; color: var(--accent); font-weight: 700; }
.nav-group { margin-bottom: 1.5rem; }
.sidebar-pdf { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.pdf-tag {
  display: block;
  padding: 0.35rem 0.5rem;
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  border-radius: 4px;
  border-left: 3px solid;
  background: rgba(255,255,255,0.03);
}
.pdf-tag.p1 { border-color: #f59e0b; }
.pdf-tag.p2 { border-color: #7c3aed; }
.pdf-tag.p3 { border-color: #0ea5e9; }
.pdf-tag.p4 { border-color: #10b981; }
.pdf-tag.p5 { border-color: #6366f1; }

/* ── MAIN ── */
main { padding: 2.5rem 3rem; min-width: 0; }

/* ── INTRO ── */
.intro-card {
  background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(124,58,237,0.08));
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 12px;
  padding: 1.75rem 2rem;
  margin-bottom: 3rem;
}
.intro-card h2 { font-family: var(--serif); font-size: 1.3rem; margin-bottom: 0.75rem; color: var(--accent); }
.intro-card p { color: var(--text-muted); font-size: 0.93rem; line-height: 1.8; }

/* ── SECTION ── */
.section { margin-bottom: 3rem; scroll-margin-top: 5rem; }
.section-header {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.section-num {
  flex-shrink: 0;
  width: 2.8rem;
  height: 2.8rem;
  background: var(--surface2);
  border: 2px solid var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  font-family: var(--mono);
}
.section-title-wrap h1, .section-title-wrap h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.3;
}
.section-title-wrap .subtitle { font-style: italic; color: var(--text-muted); font-size: 0.9rem; margin-top: 0.2rem; }

/* ── LEARNING OBJECTIVES ── */
.learning-obj {
  background: rgba(22,163,74,0.07);
  border-left: 3px solid var(--d-color);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
}
.learning-obj h4 { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: #86efac; margin-bottom: 0.5rem; }
.learning-obj ul { padding-left: 1.2rem; color: var(--text-muted); }
.learning-obj li { margin-bottom: 0.3rem; }

/* ── CONTENT BLOCKS ── */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.content-block { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; margin-bottom: 1rem; }
.content-block h4 { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 0.6rem; text-transform: uppercase; }
.content-block p, .content-block ul, .content-block table { font-size: 0.88rem; color: var(--text-muted); line-height: 1.7; }
.content-block p + p { margin-top: 0.6rem; }
.content-block ul { padding-left: 1.1rem; }
.content-block li { margin-bottom: 0.3rem; }
.block-describe h4 { color: #93c5fd; }
.block-teach h4 { color: #86efac; }
.block-interact h4 { color: #f59e0b; }
.block-visual h4 { color: #c084fc; }

.eq-table { border-collapse: collapse; }
.eq-table th, .eq-table td { border: 1px solid var(--border); padding: 0.5rem 0.65rem; text-align: left; vertical-align: top; }
.eq-table th { background: var(--surface2); color: var(--text); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── SOURCE CITATION ── */
.sources { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.src { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.6rem; border-radius: 4px; font-size: 0.72rem; font-family: var(--mono); font-weight: 600; border: 1px solid; }
.src.p1 { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.4); color: #fcd34d; }
.src.p2 { background: rgba(124,58,237,0.1); border-color: rgba(124,58,237,0.4); color: #c4b5fd; }
.src.p3 { background: rgba(14,165,233,0.1); border-color: rgba(14,165,233,0.4); color: #7dd3fc; }
.src.p4 { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.4); color: #6ee7b7; }
.src.p5 { background: rgba(99,102,241,0.1); border-color: rgba(99,102,241,0.4); color: #a5b4fc; }
.src::before { content: '›'; font-size: 0.75rem; }

.source-bar, .section-sources {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.source-bar .label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); flex-shrink: 0; padding-top: 0.15rem; }

/* ── EQUATION BOX ── */
.equation-box {
  background: var(--surface2);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
  font-family: var(--mono);
  overflow-x: auto;
}
.equation-box .eq-label { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem; font-family: var(--sans); }
.equation-box .eq { font-size: 1rem; color: #fde68a; line-height: 1.8; }
.equation-box .eq-note { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.5rem; font-family: var(--sans); }

/* ── STAT ROW ── */
.stat-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0; }
.stat-chip { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 1rem; text-align: center; min-width: 110px; }
.stat-chip .val { font-size: 1.5rem; font-weight: 700; font-family: var(--mono); }
.stat-chip .lbl { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem; }
.stat-chip.c-stat .val { color: #93c5fd; }
.stat-chip.d-stat .val { color: #86efac; }
.stat-chip.r-stat .val { color: #fca5a5; }
.stat-chip.n-stat .val { color: var(--text-muted); }
.stat-chip.acc-stat .val { color: var(--accent); }

/* ── TIMELINE ── */
.timeline { position: relative; padding-left: 2rem; margin: 1.5rem 0; }
.timeline::before { content: ''; position: absolute; left: 0.4rem; top: 0; bottom: 0; width: 2px; background: linear-gradient(to bottom, var(--accent), var(--accent2)); }
.tl-item { position: relative; margin-bottom: 1.25rem; padding-left: 0.5rem; }
.tl-item::before { content: ''; position: absolute; left: -1.7rem; top: 0.45rem; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.tl-item .tl-year { font-family: var(--mono); font-size: 0.78rem; color: var(--accent); font-weight: 700; }
.tl-item .tl-theory { font-weight: 600; font-size: 0.9rem; }
.tl-item .tl-desc { font-size: 0.83rem; color: var(--text-muted); }

/* ── DEFINITION GRID ── */
.def-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.def-card { border: 1.5px solid var(--border); border-radius: 10px; padding: 1.1rem; position: relative; overflow: hidden; }
.def-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; }
.def-card.cap::before { background: var(--c-color); }
.def-card.dem::before { background: var(--d-color); }
.def-card.rol::before { background: var(--r-color); }
.def-card.gdp::before { background: var(--accent); }
.def-card.entr::before { background: var(--accent2); }
.def-card .term { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.4rem; }
.def-card.cap .term { color: #93c5fd; }
.def-card.dem .term { color: #86efac; }
.def-card.rol .term { color: #fca5a5; }
.def-card.gdp .term { color: #fde68a; }
.def-card.entr .term { color: #c4b5fd; }
.def-card .symbol { font-family: var(--mono); font-size: 2rem; font-weight: 700; opacity: 0.15; position: absolute; top: 0.5rem; right: 0.75rem; }
.def-card .definition { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

/* ── TABLE PREVIEW ── */
.table-preview { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: auto; margin: 1.25rem 0; }
.table-preview table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.table-preview th { background: var(--surface2); padding: 0.5rem 0.75rem; text-align: left; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); cursor: pointer; user-select: none; white-space: nowrap; }
.table-preview th:hover { color: var(--accent); }
.table-preview th .sort-arrow { opacity: 0.5; font-size: 0.65rem; margin-left: 0.25rem; }
.table-preview td { padding: 0.45rem 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.04); color: var(--text-muted); }
.table-preview tr:hover td { background: var(--surface2); color: var(--text); }
.table-preview .high { color: #86efac; font-weight: 600; }
.table-preview .low { color: #fca5a5; }
.table-preview .mid { color: #fde68a; }

/* ── CASE STUDY ── */
.case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.case-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; font-size: 0.85rem; transition: opacity 0.15s, transform 0.15s; }
.case-card.hidden-by-filter { display: none; }
.case-card .country { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.3rem; }
.case-card .verdict { display: inline-block; font-size: 0.68rem; padding: 0.15rem 0.5rem; border-radius: 3px; font-weight: 700; margin-bottom: 0.5rem; }
.verdict-high { background: rgba(22,163,74,0.2); color: #86efac; }
.verdict-low { background: rgba(220,38,38,0.2); color: #fca5a5; }
.verdict-mid { background: rgba(245,158,11,0.2); color: #fde68a; }
.case-card .note { color: var(--text-muted); font-size: 0.82rem; line-height: 1.6; }

.filter-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1rem 0; }
.filter-btn { background: var(--surface2); border: 1px solid var(--border); color: var(--text-muted); font-size: 0.78rem; padding: 0.4rem 0.9rem; border-radius: 2rem; cursor: pointer; transition: all 0.15s; }
.filter-btn:hover { color: var(--text); }
.filter-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(245,158,11,0.1); }

/* ── INTERACTIVE CALLOUT ── */
.interactive {
  background: linear-gradient(135deg, rgba(245,158,11,0.07), rgba(124,58,237,0.07));
  border: 1px dashed rgba(245,158,11,0.4);
  border-radius: 10px;
  padding: 1.25rem;
  margin: 1.25rem 0;
}
.interactive h4 { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.6rem; }
.interactive ul { padding-left: 1.1rem; font-size: 0.87rem; color: var(--text-muted); }
.interactive li { margin-bottom: 0.4rem; }

/* ── LIVE WIDGET (functional calculators/simulators) ── */
.widget {
  background: var(--surface);
  border: 1px solid rgba(124,58,237,0.35);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
}
.widget h4 { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #c4b5fd; margin-bottom: 0.9rem; display: flex; align-items: center; gap: 0.5rem; }
.widget h4::before { content: '⚙'; }
.widget-badge { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; background: rgba(124,58,237,0.2); color: #c4b5fd; padding: 0.15rem 0.5rem; border-radius: 2rem; }
.widget-row { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-end; margin-bottom: 1rem; }
.widget-field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 130px; flex: 1; }
.widget-field label { font-size: 0.75rem; color: var(--text-muted); display: flex; justify-content: space-between; }
.widget-field label .field-val { color: var(--accent); font-family: var(--mono); font-weight: 700; }
.widget-field input[type="range"] { width: 100%; accent-color: var(--accent); }
.widget-field select, .widget-field input[type="text"], .widget-field input[type="number"] {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  width: 100%;
}
.widget-output {
  background: var(--surface2);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.widget-output .out-item { text-align: center; }
.widget-output .out-val { font-family: var(--mono); font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.widget-output .out-lbl { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.15rem; }
.widget-note { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.9rem; line-height: 1.6; }

.chart-container { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; margin: 1.25rem 0; position: relative; height: 340px; }
.chart-container.short { height: 260px; }

/* ── QUIZ WIDGET ── */
.quiz-item { border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.1rem; margin-bottom: 0.9rem; background: var(--surface2); }
.quiz-item .q-text { font-size: 0.88rem; margin-bottom: 0.7rem; }
.quiz-options { display: flex; flex-direction: column; gap: 0.4rem; }
.quiz-option {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.83rem;
  cursor: pointer;
  transition: all 0.15s;
}
.quiz-option:hover { border-color: var(--accent); color: var(--text); }
.quiz-option.correct { border-color: var(--d-color); background: rgba(22,163,74,0.15); color: #86efac; }
.quiz-option.incorrect { border-color: var(--r-color); background: rgba(220,38,38,0.15); color: #fca5a5; }
.quiz-feedback { font-size: 0.8rem; margin-top: 0.6rem; color: var(--text-muted); min-height: 1.2em; }

/* ── POLL WIDGET ── */
.poll-options { display: flex; flex-direction: column; gap: 0.5rem; }
.poll-option { position: relative; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--surface); cursor: pointer; }
.poll-option .poll-fill { position: absolute; inset: 0; background: rgba(245,158,11,0.18); width: 0%; transition: width 0.4s ease; }
.poll-option .poll-label { position: relative; display: flex; justify-content: space-between; padding: 0.55rem 0.85rem; font-size: 0.83rem; }
.poll-option .poll-pct { font-family: var(--mono); color: var(--accent); }
.poll-total { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem; }

/* ── FIGURE PLACEHOLDER ── */
.figure-placeholder { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 2rem; text-align: center; margin: 1rem 0; color: var(--text-muted); font-size: 0.85rem; }
.figure-placeholder .fig-icon { font-size: 2.5rem; margin-bottom: 0.5rem; display: block; opacity: 0.5; }
.figure-placeholder .fig-title { font-weight: 600; color: var(--text); margin-bottom: 0.25rem; }
.figure-placeholder .fig-caption { font-size: 0.78rem; font-style: italic; }
.figure-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 1.25rem 0; }

/* ── FINDING BOX ── */
.finding {
  background: rgba(245,158,11,0.06);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  border-radius: 0 8px 8px 0;
  margin: 1.25rem 0;
  font-size: 0.9rem;
  font-family: var(--serif);
  font-style: italic;
  color: #e2e8f0;
  line-height: 1.7;
}
.finding .find-label { font-family: var(--sans); font-style: normal; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.4rem; }

/* ── MODULE (PEDAGOGICAL) ── */
.module { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin: 1.25rem 0; }
.module-header { background: var(--surface2); padding: 0.75rem 1.25rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.module-body { padding: 1.25rem; }
.module-body ul { padding-left: 1.1rem; font-size: 0.87rem; color: var(--text-muted); }
.module-body li { margin-bottom: 0.5rem; }
.module-body li strong { color: var(--text); }

/* ── SEPARATOR ── */
.sep { height: 1px; background: linear-gradient(to right, transparent, var(--border), transparent); margin: 3rem 0; }

/* ── PAGER (prev/next section) ── */
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; }
.pager-link {
  flex: 1;
  max-width: 48%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  text-decoration: none;
  transition: border-color 0.15s;
}
.pager-link:hover { border-color: var(--accent); }
.pager-link.next { text-align: right; margin-left: auto; }
.pager-dir { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.25rem; }
.pager-title { font-family: var(--serif); font-size: 1rem; color: var(--text); }

/* ── LANDING PAGE: TOC GRID ── */
.toc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin: 1.5rem 0 3rem; }
.toc-card {
  display: flex;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.toc-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.toc-num { font-family: var(--mono); font-size: 0.75rem; color: var(--accent); font-weight: 700; flex-shrink: 0; width: 1.8rem; }
.toc-card h3 { font-family: var(--serif); font-size: 1.05rem; font-weight: 400; color: var(--text); margin-bottom: 0.3rem; }
.toc-card p { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }

/* ── FOOTER ── */
footer { background: var(--surface); border-top: 1px solid var(--border); padding: 2rem 3rem; font-size: 0.82rem; color: var(--text-muted); }
footer h3 { font-family: var(--serif); font-weight: 400; font-size: 1rem; margin-bottom: 1rem; color: var(--text); }
.pdf-ref { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 0.5rem; font-size: 0.8rem; border-left: 4px solid; color: var(--text-muted); }
.pdf-ref.p1 { border-left-color: #f59e0b; }
.pdf-ref.p2 { border-left-color: #7c3aed; }
.pdf-ref.p3 { border-left-color: #0ea5e9; }
.pdf-ref.p4 { border-left-color: #10b981; }
.pdf-ref.p5 { border-left-color: #6366f1; }
.pdf-ref strong { color: var(--text); }

.footer-credit-bar {
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.famu-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.82rem;
  border: 1px solid rgba(245,158,11,0.4);
  padding: 0.4rem 0.9rem;
  border-radius: 2rem;
  background: rgba(245,158,11,0.08);
}
.famu-link:hover { background: rgba(245,158,11,0.16); }
.famu-link .arrow { transition: transform 0.15s; }
.famu-link:hover .arrow { transform: translateX(2px); }
.placeholder-tag {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(220,38,38,0.15);
  color: #fca5a5;
  border: 1px solid rgba(220,38,38,0.4);
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  margin-left: 0.4rem;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 58px;
    width: 260px;
    height: calc(100vh - 58px);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 50;
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  .sidebar.open { transform: translateX(0); }
  .nav-toggle { display: inline-flex; align-items: center; gap: 0.4rem; }
  main { padding: 1.5rem; }
  footer { padding: 1.5rem; }
}
