/* =============================================
   MANUAL DE IA APLICADA — DESIGN SYSTEM
   Clean, light, didactic — single accent family
   ============================================= */

:root {
  /* Palette: warm light, high readability */
  --bg-primary: #faf9f6;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f7f6f2;
  --bg-card-solid: #f5f4f0;

  /* Borders */
  --border: rgba(15, 23, 42, 0.09);
  --border-hover: rgba(15, 23, 42, 0.18);
  --border-accent: rgba(37, 99, 235, 0.35);

  /* Accents — one hue family, used consistently */
  --blue: #2563eb;
  --blue-light: #3b82f6;
  --cyan: #2563eb;       /* unified with blue: no rainbow of accents */
  --cyan-light: #3b82f6;
  --emerald: #10b981;
  --emerald-light: #34d399;
  --emerald-text: #047857;
  --amber: #f59e0b;
  --amber-text: #92400e;
  --rose: #f43f5e;
  --rose-text: #be123c;
  --blue-text: #1d4ed8;

  /* Text */
  --text-primary: #111827;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  /* Geometry */
  --sidebar-w: 320px;
  --header-h: 60px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Typography */
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Blocks — kept distinct, they mark different sections (not decoration) */
  --block1: #2563eb;
  --block2: #10b981;
  --block3: #8b5cf6;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body.theme-obsidian {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  letter-spacing: -0.01em;
}

/* ── PROGRESS BAR ── */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  width: 0%;
  z-index: 1000;
  transition: width 0.1s linear;
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 2px; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-badge-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  font-size: 18px;
}

.logo-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.logo-sub {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--blue-text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 1px;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.lang-toggle {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.lang-toggle:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
}

/* ── SEARCH BOX ── */
.search-box {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  font-size: 12px;
  opacity: 0.5;
}

.search-box input {
  width: 100%;
  padding: 9px 12px 9px 30px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 12px;
  outline: none;
  transition: all 0.2s;
}

.search-box input:focus {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: #ffffff;
}

/* ── AUTHOR ── */
.sidebar-author {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.015);
  flex-shrink: 0;
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.author-info { overflow: hidden; }

.author-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.author-role {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
}

.author-link {
  font-size: 11px;
  color: var(--blue-text);
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  margin-top: 2px;
  transition: color 0.15s;
}
.author-link:hover { color: var(--blue); }

/* ── NAVIGATION ── */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.nav-section:last-child { border-bottom: none; }

.nav-section-label {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 8px 20px 4px;
}

.nav-block-1 { color: var(--block1); }
.nav-block-2 { color: var(--block2); }
.nav-block-3 { color: var(--block3); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
  border-left: 2px solid transparent;
  cursor: pointer;
  position: relative;
  font-weight: 500;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(15, 23, 42, 0.03);
}

.nav-item.active {
  color: var(--blue-text);
  background: rgba(37, 99, 235, 0.07);
  border-left-color: var(--blue);
  font-weight: 600;
}

.nav-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.15s;
  flex-shrink: 0;
}

.nav-item.active .nav-dot {
  background: var(--blue);
}

.nav-quiz-link {
  color: var(--emerald-text) !important;
  font-weight: 700 !important;
}

.nav-item.nav-soon {
  opacity: 0.5;
  cursor: default;
}

.soon-badge {
  margin-left: auto;
  font-size: 9px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ── SIDEBAR FOOTER ── */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.02);
  flex-shrink: 0;
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.progress-label-row strong { color: var(--text-primary); }

.progress-track {
  height: 5px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.25s ease;
}

/* ── MOBILE HEADER ── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 99;
}

.menu-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
}

.mobile-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.mobile-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  background: var(--blue);
  color: white;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

/* ── HERO ── */
.hero-section {
  position: relative;
  padding: 80px 64px 60px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  background: radial-gradient(circle at 10% 0%, rgba(37, 99, 235, 0.05) 0%, transparent 55%);
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--blue-text);
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.2);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 24px;
}

.tag-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.hero-title {
  font-size: clamp(28px, 3.8vw, 44px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 20px;
  max-width: 880px;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 760px;
  line-height: 1.75;
  margin-bottom: 36px;
}

/* ── HERO METRICS GRID ── */
.hero-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 36px;
  max-width: 900px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all 0.2s;
}

.metric-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.metric-val {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  line-height: 1.35;
}

.metric-lbl {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── HERO BUTTONS ── */
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--blue);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-accent {
  background: rgba(16, 185, 129, 0.08);
  color: var(--emerald-text);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-accent:hover {
  background: rgba(16, 185, 129, 0.14);
  border-color: var(--emerald);
}

/* ── CHAPTERS ── */
.chapter {
  padding: 56px 64px;
  border-bottom: 1px solid var(--border);
  max-width: 920px;
}

.chapter-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.chapter-tag {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.read-time {
  font-size: 12px;
  color: var(--text-muted);
}

.intro-tag { background: rgba(15, 23, 42, 0.06); color: var(--text-secondary); }
.block1-tag { background: rgba(37, 99, 235, 0.1); color: var(--blue-text); }
.quiz-tag { background: rgba(16, 185, 129, 0.1); color: var(--emerald-text); }

.chapter-title {
  font-size: clamp(22px, 2.8vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 14px;
  line-height: 1.3;
}

.chapter-lead {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.chapter-body h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 36px 0 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.chapter-body h3:first-child { border-top: none; margin-top: 0; }

.chapter-body p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 18px;
  line-height: 1.8;
}

.chapter-body strong { color: var(--text-primary); }

/* ── PULL QUOTE ── */
.pull-quote {
  border-left: 3px solid var(--blue);
  padding: 18px 24px;
  margin: 0 0 28px;
  font-size: 16px;
  font-style: italic;
  color: var(--text-secondary);
  background: rgba(37, 99, 235, 0.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ── LAB BADGES ── */
.lab-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  margin: 16px 0 24px;
  font-size: 13px;
  color: var(--text-secondary);
}

.lab-badge code {
  font-family: var(--font-mono);
  background: rgba(15, 23, 42, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--blue-text);
}

/* ── TECH LINKS ── */
.tech-link {
  color: var(--blue-text);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed rgba(37, 99, 235, 0.35);
  transition: all 0.15s;
}

.tech-link:hover {
  color: var(--blue);
  border-bottom-style: solid;
  border-bottom-color: var(--blue);
}

/* ── INTERACTIVE VALUE TOGGLE CARDS ── */
.interactive-toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 28px 0;
}

.toggle-card {
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1px solid;
}

.card-positive {
  background: rgba(16, 185, 129, 0.045);
  border-color: rgba(16, 185, 129, 0.25);
}

.card-negative {
  background: rgba(244, 63, 94, 0.045);
  border-color: rgba(244, 63, 94, 0.25);
}

.toggle-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.toggle-card-header h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  color: var(--text-primary);
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-list li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  position: relative;
  padding-left: 16px;
}

.feature-list li::before {
  content: '▪';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.card-positive .feature-list li::before { color: var(--emerald); }
.card-negative .feature-list li::before { color: var(--rose); }

/* ── GLOSSARY GRID (INTERACTIVE CARDS) ── */
.glossary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.interactive-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.interactive-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.glossary-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--blue-text);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.glossary-term {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.glossary-def {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 14px;
}

.card-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  transition: color 0.15s;
}
.card-link:hover { color: var(--blue-text); }

/* ── INTERACTIVE PIPELINE ── */
.interactive-pipeline {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin: 24px 0;
}

.pipeline-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: all 0.2s;
}

.pipeline-step:hover {
  border-color: var(--blue-light);
  transform: translateY(-2px);
}

.pipeline-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 6px;
}

.pipeline-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.pipeline-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.pipeline-arrow {
  color: var(--text-muted);
  font-weight: 800;
  font-size: 14px;
}

/* ── INTERACTIVE 3-WAY MATCHING SIMULATOR ── */
.interactive-simulator {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 28px 0;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.sim-header {
  padding: 16px 20px;
  background: rgba(37, 99, 235, 0.06);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sim-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sim-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sim-tab {
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.sim-tab:hover {
  background: rgba(15, 23, 42, 0.07);
  color: var(--text-primary);
}

.sim-tab.active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.sim-body { padding: 24px; }

.sim-panel { display: none; }
.sim-panel.active { display: block; animation: fadeIn 0.2s ease-in; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.doc-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.doc-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.badge-blue { background: rgba(37, 99, 235, 0.12); color: var(--blue-text); }
.badge-orange { background: rgba(245, 158, 11, 0.15); color: var(--amber-text); }
.badge-red { background: rgba(244, 63, 94, 0.15); color: var(--rose-text); }

.doc-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

.doc-row {
  display: flex;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.doc-row span { color: var(--text-muted); }
.text-warning { color: var(--amber-text) !important; }
.text-danger { color: var(--rose-text) !important; }

/* ── XRAI PREVIEW ── */
.xrai-analysis-box {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.xrai-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.xrai-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--emerald-text);
  letter-spacing: 0.05em;
}

.xrai-confidence {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--blue-text);
}

.xrai-heatmap-preview {
  background: #ffffff;
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.heatmap-highlight {
  border-left: 3px solid var(--rose);
  padding-left: 12px;
}

.highlight-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--rose-text);
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.highlight-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--rose-text);
}

.sim-verdict {
  background: rgba(16, 185, 129, 0.07);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 13px;
  color: var(--emerald-text);
}

.sim-verdict p { margin: 4px 0 0 !important; color: #065f46; }

/* ── EPSILON CALCULATOR ── */
.epsilon-calculator {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 24px 0;
}

.calc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.calc-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.epsilon-display {
  display: flex;
  align-items: center;
  gap: 8px;
}

.epsilon-val {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  color: var(--blue-text);
}

.custom-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(15, 23, 42, 0.1);
  outline: none;
  -webkit-appearance: none;
  margin-bottom: 24px;
}

.custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

.calc-results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.calc-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.calc-card-lbl {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.calc-card-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.text-success { color: var(--emerald-text) !important; }
.text-primary-light { color: var(--blue-text) !important; }

/* ── SAIF CARDS GRID ── */
.saif-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.saif-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.2s;
}

.saif-card:hover {
  border-color: var(--blue-light);
  transform: translateY(-2px);
}

.saif-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: var(--blue-text);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.saif-card h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.saif-card p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* ── INTERACTIVE QUIZ ENGINE ── */
.quiz-section {
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.05) 0%, transparent 60%);
  border-bottom: 1px solid var(--border);
}

.quiz-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}

.quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.2s;
}

.quiz-card:hover { border-color: var(--border-hover); }

.quiz-q-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 12px;
}

.quiz-num {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--emerald-text);
}

.quiz-topic {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.quiz-question {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  line-height: 1.5;
  transition: all 0.15s;
}

.quiz-option:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.opt-letter {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  color: var(--text-primary);
}

.quiz-option.selected-correct {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: var(--emerald) !important;
  color: #065f46 !important;
}

.quiz-option.selected-correct .opt-letter {
  background: var(--emerald);
  color: white;
}

.quiz-option.selected-wrong {
  background: rgba(244, 63, 94, 0.12) !important;
  border-color: var(--rose) !important;
  color: #9f1239 !important;
}

.quiz-option.selected-wrong .opt-letter {
  background: var(--rose);
  color: white;
}

.quiz-feedback {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
  display: none;
}

.quiz-feedback.show { display: block; animation: fadeIn 0.2s ease-in; }

.feedback-correct {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #065f46;
}

.feedback-wrong {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #9f1239;
}

/* ── SCORE BANNER ── */
.quiz-score-banner {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(16, 185, 129, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 12px;
}

.score-icon { font-size: 32px; }

.score-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.score-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── FOOTER ── */
.site-footer {
  padding: 48px 64px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.footer-inner { max-width: 700px; }

.footer-brand {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.footer-text {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.6;
}

.footer-text a {
  color: var(--blue-text);
  text-decoration: none;
}

.footer-links {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--blue); }

/* ── RESPONSIVE BREAKPOINTS ── */
@media (max-width: 1024px) {
  .hero-section,
  .chapter,
  .site-footer,
  .block-header { padding-left: 40px; padding-right: 40px; }

  .hero-metrics-grid { grid-template-columns: 1fr 1fr; }
  .interactive-pipeline { grid-template-columns: 1fr; }
  .pipeline-arrow { display: none; }
  .calc-results-grid { grid-template-columns: 1fr 1fr; }
  .saif-cards-grid { grid-template-columns: 1fr; }
  .glossary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15);
  }

  .sidebar.open { transform: translateX(0); }

  .sidebar-toggle { display: block; }
  .mobile-header { display: flex; }

  .main-content {
    margin-left: 0;
    padding-top: var(--header-h);
  }

  .hero-section,
  .chapter,
  .site-footer,
  .block-header { padding: 32px 20px; }

  .hero-metrics-grid { grid-template-columns: 1fr; }
  .interactive-toggle-grid { grid-template-columns: 1fr; }
  .calc-results-grid { grid-template-columns: 1fr; }
}

/* ── OVERLAY ── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 99;
  backdrop-filter: blur(2px);
}

.overlay.show { display: block; }

/* ── BLOCK HEADERS ── */
.block-header {
  padding: 80px 64px 40px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.04) 0%, transparent 100%);
  position: relative;
}

.block-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue-light), transparent);
  opacity: 0.4;
}

.block-header-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--blue-text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.block-header-title {
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.block-header-desc {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 700px;
  line-height: 1.6;
}

/* ── LINKEDIN SHARE BUTTON ── */
.share-actions {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: flex-end;
}

.btn-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(10, 102, 194, 0.06);
  color: #0a66c2;
  border: 1px solid rgba(10, 102, 194, 0.25);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-linkedin:hover {
  background: rgba(10, 102, 194, 0.12);
  border-color: rgba(10, 102, 194, 0.5);
  color: #0a66c2;
  transform: translateY(-1px);
}

.btn-linkedin svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
