@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --navy: #001e5a;
  --navy2: #00205d;
  --blue: #0047cc;
  --blue2: #1557e0;
  --sky: #4d8bf5;
  --sky2: #7aaeff;
  --accent: #f0a500;
  --danger: #e03535;
  --success: #1a9c5b;
  --warn: #d97706;

  --surface: #f8fafc;
  --surface2: #f1f5f9;
  --border: #e2e8f0;
  --border2: #cbd5e1;
  --text: #0f172a;
  --text2: #334155;
  --text3: #64748b;
  --white: #ffffff;

  --sidebar-w: 268px;

  --s-sm: 0 1px 4px rgba(0,0,0,.05);
  --s-md: 0 4px 16px rgba(0,0,0,.07);
  --s-lg: 0 8px 32px rgba(0,0,0,.09);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;

  --grad: linear-gradient(135deg, var(--navy) 0%, #003399 60%, #0052cc 100%);
  --grad-text: linear-gradient(90deg, #fff 0%, var(--sky2) 100%);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--surface);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── GLOBAL PROGRESS BAR ── */
#global-bar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: 3px; z-index: 999;
  background: linear-gradient(90deg, var(--blue), var(--sky2), var(--accent));
  transform-origin: left;
  transition: width .4s ease;
}

/* ── SIDEBAR ── */
#sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 900;
  box-shadow: var(--s-md);
  overflow: hidden;
  transition: transform .3s ease;
}

.sb-top {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sb-logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: 17px; color: var(--white);
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0,71,204,.3);
}

.sb-course { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 13px; color: var(--navy); line-height: 1.3; }
.sb-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }

.sb-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.sb-nav::-webkit-scrollbar { width: 3px; }
.sb-nav::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.sb-section { padding: 8px 16px 4px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); }

.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; cursor: pointer;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
  position: relative;
}
.sb-item:hover { background: var(--surface); color: var(--blue); }
.sb-item.active {
  background: #eff3ff; border-left-color: var(--blue);
  color: var(--blue);
}
.sb-item.done .sb-num::after {
  content: '✓'; position: absolute; right: 16px;
  font-size: 10px; color: var(--success);
}
.sb-num {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--surface2); display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: var(--text3); flex-shrink: 0;
  transition: background .15s, color .15s;
}
.sb-item.active .sb-num { background: var(--blue); color: #fff; }
.sb-icon { font-size: 14px; flex-shrink: 0; }
.sb-label { font-size: 12.5px; font-weight: 500; }

.sb-foot {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sb-prog-label { font-size: 11px; color: var(--text3); margin-bottom: 6px; display: flex; justify-content: space-between; }
.sb-prog-track { height: 5px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.sb-prog-fill { height: 100%; background: var(--grad); border-radius: 4px; transition: width .4s ease; }

/* ── HAMBURGER ── */
#hamburger {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 1000;
  width: 40px; height: 40px; border-radius: var(--r-sm);
  background: var(--white); border: 1px solid var(--border);
  cursor: pointer; align-items: center; justify-content: center;
  box-shadow: var(--s-md);
  flex-direction: column; gap: 5px; padding: 10px;
}
#hamburger span { display: block; width: 100%; height: 2px; background: var(--navy); border-radius: 2px; transition: .3s; }
#overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 850; }

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

/* ── PAGE ── */
.page { display: none; flex-direction: column; min-height: 100vh; animation: fadeIn .35s ease; }
.page.active { display: flex; }

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

/* ── HERO ── */
.hero {
  background: var(--grad);
  padding: 48px 52px 40px;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -80px; right: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(77,139,245,.2) 0%, transparent 70%);
  pointer-events: none;
}

.hero-bread { font-size: 11.5px; color: rgba(255,255,255,.55); margin-bottom: 12px; letter-spacing: .04em; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px; padding: 4px 14px; margin-bottom: 16px;
  font-size: 12px; color: rgba(255,255,255,.8); backdrop-filter: blur(8px);
}
.hero-title {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: clamp(26px, 3.5vw, 36px); line-height: 1.15;
  background: var(--grad-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}
.hero-sub { font-size: 15px; color: rgba(255,255,255,.65); max-width: 560px; line-height: 1.6; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.chip {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px; padding: 4px 12px;
  font-size: 11.5px; color: rgba(255,255,255,.85);
}

/* ── BODY ── */
.body { padding: 44px 52px; max-width: 980px; flex: 1; }

.sec-title {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 18px; color: var(--navy);
  margin-bottom: 6px;
}
.sec-title::before { content: ''; width: 4px; height: 18px; background: var(--blue); border-radius: 2px; flex-shrink: 0; }
.sec-sub { font-size: 14px; color: var(--text3); margin-bottom: 24px; margin-left: 14px; }

.divider { border: none; border-top: 1px solid var(--border); margin: 36px 0; }

/* ── INFO GRID ── */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.info-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 20px; box-shadow: var(--s-sm);
  border-top: 3px solid var(--blue);
  transition: transform .2s, box-shadow .2s;
}
.info-card:hover { transform: translateY(-3px); box-shadow: var(--s-md); }
.info-card-ico { font-size: 24px; margin-bottom: 8px; }
.info-card-val { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 26px; color: var(--navy); }
.info-card-lbl { font-size: 12.5px; color: var(--text3); margin-top: 2px; }

/* ── TOPIC MAP ── */
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 32px; }
.topic-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 20px; cursor: pointer; box-shadow: var(--s-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
  position: relative; overflow: hidden;
}
.topic-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad);
}
.topic-card:hover { transform: translateY(-4px); box-shadow: var(--s-lg); border-color: var(--sky); }
.topic-num { font-size: 11px; font-weight: 600; color: var(--sky); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; }
.topic-icon { font-size: 28px; margin-bottom: 8px; }
.topic-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 13.5px; color: var(--navy); line-height: 1.35; margin-bottom: 4px; }
.topic-desc { font-size: 11.5px; color: var(--text3); line-height: 1.5; }

/* ── TABS ── */
.tabs { margin-bottom: 28px; }
.tab-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.tab-btn {
  padding: 8px 18px; border-radius: var(--r-sm) var(--r-sm) 0 0;
  border: 1px solid var(--border); border-bottom: none;
  background: var(--surface2); color: var(--text2);
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: .15s; position: relative; bottom: -1px;
}
.tab-btn.active { background: var(--white); border-color: var(--border); color: var(--blue); font-weight: 600; }
.tab-btn:hover:not(.active) { background: var(--white); color: var(--navy); }
.tab-panel { display: none; animation: fadeIn .2s ease; }
.tab-panel.active { display: block; }

/* ── CARDS GRID ── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 20px; box-shadow: var(--s-sm);
  border-top: 3px solid;
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--s-md); }
.card-ico { font-size: 22px; margin-bottom: 10px; }
.card-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 14px; color: var(--navy); margin-bottom: 6px; }
.card-desc { font-size: 13px; color: var(--text2); line-height: 1.6; }
.card-tag { display: inline-block; background: var(--surface2); border-radius: 20px; padding: 2px 10px; font-size: 11px; color: var(--text3); margin-top: 10px; }

/* ── ACCORDION ── */
.acc-item { border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 8px; overflow: hidden; }
.acc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; cursor: pointer; background: var(--white);
  font-weight: 600; font-size: 13.5px; color: var(--text);
  transition: background .15s;
  gap: 12px;
}
.acc-head:hover { background: var(--surface); }
.acc-head.open { background: #eff3ff; color: var(--blue); }
.acc-chevron { font-size: 12px; transition: transform .25s; flex-shrink: 0; }
.acc-head.open .acc-chevron { transform: rotate(180deg); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.acc-body.open { max-height: 900px; }
.acc-inner { padding: 14px 18px 16px; background: #f7f9ff; font-size: 13.5px; color: var(--text2); line-height: 1.7; border-top: 1px solid var(--border); }

/* ── EJERCICIOS ── */
.ej-item { border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 12px; overflow: hidden; background: var(--white); }
.ej-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; cursor: pointer;
  transition: background .15s;
  gap: 12px;
}
.ej-head:hover { background: var(--surface); }
.ej-head.open { background: #eff3ff; }
.ej-title { font-weight: 600; font-size: 13.5px; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.ej-badge { background: var(--blue); color: #fff; border-radius: 20px; padding: 2px 10px; font-size: 10px; font-weight: 600; }
.ej-badge.analisis { background: var(--warn); }
.ej-badge.diseno { background: var(--success); }
.ej-badge.evaluacion { background: #7c3aed; }
.ej-chevron { font-size: 12px; transition: transform .25s; color: var(--text3); }
.ej-head.open .ej-chevron { transform: rotate(180deg); }
.ej-body { max-height: 0; overflow: hidden; transition: max-height .4s ease; }
.ej-body.open { max-height: 2000px; }
.ej-inner { padding: 18px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--text2); line-height: 1.7; }
.ej-context { background: #f7f9ff; border-left: 3px solid var(--sky); padding: 12px 14px; border-radius: 0 var(--r-sm) var(--r-sm) 0; margin-bottom: 14px; }
.ej-context strong { color: var(--navy); display: block; margin-bottom: 4px; }
.ej-questions { margin-bottom: 14px; }
.ej-questions li { margin-bottom: 6px; }
.sol-btn {
  background: none; border: 1.5px solid var(--blue); color: var(--blue);
  border-radius: var(--r-sm); padding: 8px 16px; cursor: pointer; font-size: 13px; font-weight: 500;
  transition: .15s;
}
.sol-btn:hover { background: var(--blue); color: #fff; }
.sol-panel { display: none; margin-top: 12px; background: #f0fff4; border: 1px solid #a7f3d0; border-radius: var(--r-sm); padding: 14px; }
.sol-panel.show { display: block; }
.sol-panel strong { color: var(--success); display: block; margin-bottom: 6px; }

/* ── FAQ ── */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 4px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text);
  gap: 12px;
}
.faq-q:hover { color: var(--blue); }
.faq-icon { font-size: 18px; color: var(--blue); transition: transform .25s; flex-shrink: 0; }
.faq-q.open .faq-icon { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .35s ease; font-size: 13.5px; color: var(--text2); line-height: 1.7; }
.faq-a.open { max-height: 500px; padding-bottom: 14px; }

/* ── TABLES ── */
.tbl-wrap { overflow-x: auto; margin-bottom: 24px; border-radius: var(--r-md); box-shadow: var(--s-sm); }
table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--white); }
thead th { background: var(--navy); color: #fff; padding: 12px 16px; text-align: left; font-weight: 600; font-size: 12.5px; letter-spacing: .03em; }
thead th:first-child { border-radius: var(--r-sm) 0 0 0; }
thead th:last-child { border-radius: 0 var(--r-sm) 0 0; }
tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; }
tbody tr:hover { background: var(--surface); }
tbody tr:nth-child(even) { background: #f9fbff; }
tbody tr:nth-child(even):hover { background: var(--surface2); }
td { padding: 11px 16px; color: var(--text2); line-height: 1.5; vertical-align: top; }
td:first-child { font-weight: 600; color: var(--navy); }
td .tag-ok { display: inline-block; background: #dcfce7; color: #166534; border-radius: 20px; padding: 1px 10px; font-size: 11px; }
td .tag-no { display: inline-block; background: #fee2e2; color: #991b1b; border-radius: 20px; padding: 1px 10px; font-size: 11px; }
td .tag-par { display: inline-block; background: #fef9c3; color: #854d0e; border-radius: 20px; padding: 1px 10px; font-size: 11px; }

/* ── CALLOUTS ── */
.info-box, .warn-box, .success-box, .danger-box, .navy-box {
  border-radius: var(--r-md); padding: 14px 18px; margin-bottom: 18px;
  font-size: 13.5px; line-height: 1.7; border-left: 3.5px solid;
}
.info-box    { background: #eff6ff; border-color: var(--sky); color: #1e3a5f; }
.warn-box    { background: #fffbeb; border-color: var(--warn); color: #78350f; }
.success-box { background: #f0fdf4; border-color: var(--success); color: #14532d; }
.danger-box  { background: #fff1f2; border-color: var(--danger); color: #881337; }
.navy-box    { background: #eef2ff; border-color: var(--navy); color: var(--navy); }

/* ── FLOW WRAP ── */
.flow-wrap { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 0; margin-bottom: 28px; }
.flow-step { display: flex; flex-direction: column; align-items: center; text-align: center; flex: 1; min-width: 100px; }
.flow-circle {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 18px; color: #fff;
  box-shadow: 0 4px 12px rgba(0,71,204,.3); margin-bottom: 10px;
}
.flow-name { font-weight: 600; font-size: 12.5px; color: var(--navy); margin-bottom: 4px; }
.flow-desc { font-size: 11.5px; color: var(--text3); line-height: 1.5; max-width: 100px; }
.flow-arrow { display: flex; align-items: center; margin-top: 22px; color: var(--border2); font-size: 20px; flex-shrink: 0; padding: 0 4px; }

/* ── HEURISTIC GRID ── */
.heuristic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 24px; }
.heuristic-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 16px; box-shadow: var(--s-sm);
}
.h-num { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--sky); margin-bottom: 6px; font-weight: 600; }
.h-title { font-weight: 700; font-size: 13.5px; color: var(--navy); margin-bottom: 6px; }
.h-desc { font-size: 12.5px; color: var(--text2); line-height: 1.6; }
.h-example { font-size: 11.5px; color: var(--text3); margin-top: 8px; font-style: italic; }

/* ── SIMULADORES ── */
.sim-box { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-md); padding: 24px; box-shadow: var(--s-sm); margin-bottom: 20px; }
.sim-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 16px; color: var(--navy); margin-bottom: 8px; }
.sim-desc { font-size: 13px; color: var(--text3); margin-bottom: 20px; }
.sim-form { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.sim-field { display: flex; flex-direction: column; gap: 4px; min-width: 180px; flex: 1; }
.sim-label { font-size: 12px; font-weight: 600; color: var(--text2); }
.sim-select, .sim-input {
  padding: 9px 12px; border: 1px solid var(--border2); border-radius: var(--r-sm);
  font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--text);
  background: var(--white); outline: none; transition: border-color .15s;
}
.sim-select:focus, .sim-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,71,204,.08); }
.sim-btn {
  background: var(--grad); color: #fff; border: none; border-radius: var(--r-sm);
  padding: 10px 22px; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: opacity .15s, transform .15s;
}
.sim-btn:hover { opacity: .9; transform: translateY(-1px); }
.sim-result {
  background: #eff3ff; border: 1px solid #c7d7fd; border-radius: var(--r-md);
  padding: 16px; display: none; animation: fadeIn .3s ease;
}
.sim-result.show { display: block; }
.sim-result-title { font-weight: 700; color: var(--navy); margin-bottom: 8px; font-size: 14px; }
.sim-result p { font-size: 13.5px; color: var(--text2); line-height: 1.7; }

/* ── DARK PATTERN DEMO ── */
.dp-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.dp-panel { border-radius: var(--r-md); padding: 18px; }
.dp-good { background: #f0fdf4; border: 2px solid #86efac; }
.dp-bad  { background: #fff1f2; border: 2px solid #fca5a5; }
.dp-panel-title { font-weight: 700; font-size: 13px; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.dp-good .dp-panel-title { color: var(--success); }
.dp-bad  .dp-panel-title { color: var(--danger); }
.mock-btn { padding: 8px 16px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 600; cursor: default; display: inline-block; margin-top: 8px; }
.mock-btn-primary { background: var(--blue); color: #fff; }
.mock-btn-ghost { background: transparent; border: 1.5px solid var(--border2); color: var(--text3); }
.mock-btn-danger { background: var(--danger); color: #fff; }
.mock-text { font-size: 12.5px; color: var(--text2); line-height: 1.6; margin-bottom: 8px; }
.mock-tiny { font-size: 10px; color: var(--text3); }
.mock-hidden { color: var(--surface); }

/* ── SEVERITY BADGE ── */
.sev { display: inline-block; border-radius: 20px; padding: 2px 10px; font-size: 11px; font-weight: 600; }
.sev-alto { background: #fee2e2; color: #991b1b; }
.sev-medio { background: #fef9c3; color: #854d0e; }
.sev-bajo { background: #dcfce7; color: #166534; }

/* ── FIDELITY BAR ── */
.fid-bar { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-md); padding: 20px; margin-bottom: 20px; }
.fid-bar-track { height: 12px; background: linear-gradient(90deg, #e2e8f0, var(--sky), var(--blue)); border-radius: 8px; margin: 12px 0; position: relative; }
.fid-marker { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 18px; height: 18px; border-radius: 50%; background: var(--white); border: 3px solid var(--blue); box-shadow: var(--s-sm); cursor: default; }
.fid-marker::after { content: attr(data-label); position: absolute; top: 22px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 10.5px; color: var(--text3); font-weight: 500; }
.fid-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text3); margin-top: 20px; }

/* ── QUIZ ── */
.quiz-wrap { max-width: 720px; }
.quiz-prog-bar { height: 6px; background: var(--surface2); border-radius: 4px; margin-bottom: 24px; overflow: hidden; }
.quiz-prog-fill { height: 100%; background: var(--grad); border-radius: 4px; transition: width .4s ease; }
.quiz-counter { font-size: 12.5px; color: var(--text3); text-align: right; margin-bottom: 16px; font-family: 'JetBrains Mono', monospace; }
.quiz-q { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 18px; color: var(--navy); line-height: 1.4; margin-bottom: 24px; }
.quiz-opts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.quiz-opt {
  padding: 14px 18px; border: 1.5px solid var(--border); border-radius: var(--r-sm);
  background: var(--white); cursor: pointer; font-size: 14px; color: var(--text);
  text-align: left; transition: border-color .15s, background .15s, transform .1s;
  font-family: 'DM Sans', sans-serif;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--blue); background: #f0f4ff; transform: translateX(4px); }
.quiz-opt.correct { border-color: var(--success); background: #f0fdf4; color: #14532d; font-weight: 600; }
.quiz-opt.wrong   { border-color: var(--danger);  background: #fff1f2; color: #881337; }
.quiz-feedback { background: #eff3ff; border: 1px solid #c7d7fd; border-radius: var(--r-md); padding: 14px 18px; font-size: 13.5px; color: var(--text2); line-height: 1.7; margin-bottom: 20px; display: none; animation: fadeIn .3s ease; }
.quiz-feedback.show { display: block; }
.quiz-next { background: var(--grad); color: #fff; border: none; border-radius: var(--r-sm); padding: 11px 28px; font-size: 14px; font-weight: 600; cursor: pointer; display: none; transition: opacity .15s; }
.quiz-next.show { display: inline-flex; align-items: center; gap: 8px; }
.quiz-next:hover { opacity: .9; }
.result-box { text-align: center; padding: 40px 20px; }
.result-score { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 72px; color: var(--navy); line-height: 1; }
.result-label { font-size: 18px; color: var(--text2); margin: 8px 0 24px; }
.result-bar-track { height: 12px; background: var(--surface2); border-radius: 8px; max-width: 360px; margin: 0 auto 20px; overflow: hidden; }
.result-bar-fill { height: 100%; border-radius: 8px; transition: width 1s ease; }
.result-msg { font-size: 15px; color: var(--text2); margin-bottom: 28px; }
.result-retry { background: var(--grad); color: #fff; border: none; border-radius: var(--r-sm); padding: 12px 30px; font-size: 15px; font-weight: 600; cursor: pointer; }

/* ── FOOTER NAV ── */
.pg-footer {
  border-top: 1px solid var(--border);
  padding: 20px 52px; display: flex; align-items: center; justify-content: space-between;
  background: var(--white); gap: 12px;
}
.nav-btn {
  padding: 9px 20px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: .15s; display: flex; align-items: center; gap: 6px;
  font-family: 'DM Sans', sans-serif;
}
.nav-btn-outline { border: 1.5px solid var(--border2); background: var(--white); color: var(--text2); }
.nav-btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.nav-btn-fill { border: none; background: var(--grad); color: #fff; }
.nav-btn-fill:hover { opacity: .9; }
.nav-pos { font-size: 13px; color: var(--text3); font-family: 'JetBrains Mono', monospace; }

/* ── MATURITY TIMELINE ── */
.maturity-tl { display: flex; flex-direction: column; gap: 0; margin-bottom: 24px; }
.mt-item { display: flex; gap: 16px; }
.mt-line { display: flex; flex-direction: column; align-items: center; }
.mt-dot { width: 36px; height: 36px; border-radius: 50%; background: var(--grad); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; }
.mt-connector { width: 2px; flex: 1; background: var(--border2); margin: 4px 0; min-height: 24px; }
.mt-content { padding-bottom: 20px; flex: 1; }
.mt-level { font-size: 10.5px; font-weight: 600; color: var(--sky); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.mt-name { font-weight: 700; font-size: 14px; color: var(--navy); margin-bottom: 4px; }
.mt-desc { font-size: 12.5px; color: var(--text2); line-height: 1.6; }

/* ── ERROR MATRIX ── */
.error-matrix { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }
.err-card { border-radius: var(--r-md); padding: 18px; border: 1px solid; }
.err-card.slip   { background: #fffbeb; border-color: #fcd34d; }
.err-card.lapse  { background: #fff1f2; border-color: #fca5a5; }
.err-card.rule   { background: #eff6ff; border-color: #93c5fd; }
.err-card.know   { background: #faf5ff; border-color: #c4b5fd; }
.err-card-type { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; }
.err-card.slip .err-card-type { color: #d97706; }
.err-card.lapse .err-card-type { color: #dc2626; }
.err-card.rule .err-card-type { color: #2563eb; }
.err-card.know .err-card-type { color: #7c3aed; }
.err-card-name { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 14.5px; color: var(--navy); margin-bottom: 6px; }
.err-card-def { font-size: 12.5px; color: var(--text2); line-height: 1.6; margin-bottom: 8px; }
.err-card-ex { font-size: 11.5px; font-style: italic; color: var(--text3); }

/* ── PORQUES ── */
.porques-chain { display: flex; flex-direction: column; gap: 0; }
.pq-item { display: flex; gap: 12px; }
.pq-line { display: flex; flex-direction: column; align-items: center; }
.pq-num { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pq-connector { width: 2px; flex: 1; background: var(--border2); min-height: 16px; margin: 3px 0; }
.pq-q { font-size: 12px; color: var(--text3); font-style: italic; margin-bottom: 3px; }
.pq-a { font-size: 13.5px; color: var(--text); font-weight: 500; padding-bottom: 16px; }
.pq-root { background: #fee2e2; border: 1px solid #fca5a5; border-radius: var(--r-sm); padding: 10px 14px; font-size: 13px; color: #991b1b; font-weight: 600; margin-top: 8px; margin-bottom: 16px; }

/* ── COMPETITION RADAR (visual bars) ── */
.radar-wrap { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.radar-row { display: flex; align-items: center; gap: 12px; }
.radar-label { font-size: 12.5px; font-weight: 600; color: var(--text2); min-width: 130px; }
.radar-bar-track { flex: 1; height: 8px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.radar-bar-fill { height: 100%; border-radius: 4px; }
.radar-val { font-size: 11.5px; color: var(--text3); min-width: 30px; text-align: right; font-family: 'JetBrains Mono', monospace; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  #global-bar { left: 0; }
  #content { margin-left: 0; }
  #hamburger { display: flex; }
  #overlay.show { display: block; }
  .topic-grid { grid-template-columns: 1fr 1fr; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .error-matrix { grid-template-columns: 1fr; }
  .dp-compare { grid-template-columns: 1fr; }
  .body { padding: 28px 24px; }
  .hero { padding: 32px 24px 28px; }
  .pg-footer { padding: 16px 24px; }
}

@media (max-width: 640px) {
  .topic-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 22px; }
  .flow-wrap { gap: 0; }
  .flow-arrow { display: none; }
  .quiz-q { font-size: 15px; }
  .pg-footer { flex-wrap: wrap; }
  .nav-pos { width: 100%; text-align: center; order: -1; }
}
