/* ============================================================
   RC / ICS — Deck interno red comercial Dextro
   Estilos. Paleta y tipografía alineadas con
   Informe_Rehabilitacion_Cardiaca_ICS.html (teal + Inter).
   - Partes A y B: estética presentable (clara).
   - Parte C: estética "modo interno / solo Dextro" (oscura).
   ============================================================ */

:root {
  /* --- Paleta presentable (A y B) --- */
  --primary: #2c7873;
  --primary-light: #3a9e97;
  --primary-dark: #1f5b57;
  --primary-pale: rgba(44, 120, 115, .10);
  --ink: #1a2e2d;
  --ink-soft: #4a6968;
  --outline: #b0cece;
  --surface-0: #ffffff;
  --surface-low: #f4f8f8;
  --surface-mid: #e8f0f0;
  --bg: #f0f5f5;

  /* --- Acentos de dato --- */
  --danger: #b3261e;        /* escenarios de coste (rojo) */
  --danger-soft: #f7d7d4;
  --save: #1a6640;          /* ahorro (verde) */
  --save-soft: #d1f0e0;
  --warn: #7a5a00;
  --warn-soft: #fff3cd;

  /* --- Niveles de evidencia --- */
  --n1: #155e45;
  --n2: #2c7873;
  --n3: #b07b1e;
  --n4: #7a8a89;

  /* --- Paleta MODO INTERNO (Parte C) --- */
  --c-bg: #0e1716;
  --c-bg-2: #13211f;
  --c-surface: #182a28;
  --c-surface-2: #1f3633;
  --c-ink: #e8f2f0;
  --c-ink-soft: #9fb5b1;
  --c-outline: #2f4a47;
  --c-accent: #e0a458;        /* ámbar: avisa "interno" */
  --c-accent-soft: rgba(224, 164, 88, .14);

  --r: 12px;
  --shadow: 0 4px 20px rgba(44, 120, 115, .12);
  --shadow-lg: 0 12px 40px rgba(20, 40, 38, .18);
  --font: 'Inter', system-ui, sans-serif;
  --maxw: 1080px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============================================================
   NAV SUPERIOR (anclas)
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--surface-mid);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  z-index: 1000;
  transition: background .3s, border-color .3s, color .3s;
}
.nav-brand {
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: 1.05rem;
  color: var(--primary);
  white-space: nowrap;
}
.nav-brand small {
  display: block;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.nav-links {
  display: flex;
  gap: 2px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: .8rem;
  font-weight: 600;
  padding: 7px 11px;
  border-radius: 7px;
  white-space: nowrap;
  transition: all .15s;
}
.nav-links a:hover { color: var(--primary); background: var(--primary-pale); }
.nav-links a.active { color: #fff; background: var(--primary); }
.nav-links a.sep { opacity: .4; pointer-events: none; padding: 7px 2px; }

/* Cuando estamos en la zona C, el nav se oscurece */
.nav.is-internal {
  background: rgba(14, 23, 22, .92);
  border-bottom-color: var(--c-outline);
}
.nav.is-internal .nav-brand { color: var(--c-accent); }
.nav.is-internal .nav-brand small { color: var(--c-ink-soft); }
.nav.is-internal .nav-links a { color: var(--c-ink-soft); }
.nav.is-internal .nav-links a:hover { color: var(--c-accent); background: var(--c-accent-soft); }
.nav.is-internal .nav-links a.active { color: var(--c-bg); background: var(--c-accent); }

/* ============================================================
   ESTRUCTURA DE SECCIONES
   ============================================================ */
.section {
  padding: 96px 22px;
  position: relative;
  scroll-margin-top: 64px;
}
.section-inner { max-width: var(--maxw); margin: 0 auto; width: 100%; }

.kicker {
  display: inline-block;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 18px;
  padding: 4px 12px;
  border: 1px solid var(--outline);
  border-radius: 20px;
  background: var(--surface-0);
}

h1.headline {
  font-size: clamp(2rem, 5.2vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -.025em;
  font-weight: 800;
  color: var(--ink);
  max-width: 17ch;
}
h2.headline {
  font-size: clamp(1.7rem, 4.2vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  font-weight: 800;
  color: var(--ink);
  max-width: 20ch;
}
.lead {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 60ch;
  margin-top: 22px;
}
.body-text {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 64ch;
  margin-top: 18px;
}
.closing {
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  font-weight: 700;
  color: var(--primary-dark);
  max-width: 40ch;
  line-height: 1.3;
  letter-spacing: -.015em;
  margin-top: 40px;
  padding-left: 22px;
  border-left: 4px solid var(--primary);
}

/* Alternancia sutil de fondos en A/B */
.section.alt { background: var(--surface-0); }
.section.hero-section {
  background: linear-gradient(160deg, #ffffff 0%, var(--surface-mid) 100%);
}

/* Separadores de parte — banda de fondo de color, distinta del cuerpo.
   Solo rótulo "PARTE A / B / C · uso interno" (sin subtítulos). */
.part-divider {
  padding: 22px;
  text-align: center;
}
.part-divider span {
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.part-divider.pd-a { background: var(--primary); }
.part-divider.pd-a span { color: #fff; }
.part-divider.pd-b { background: var(--primary-dark); }
.part-divider.pd-b span { color: #cfeae7; }
.part-divider.pd-c { background: var(--c-bg); border-top: 2px solid var(--c-accent); border-bottom: 2px solid var(--c-accent); }
.part-divider.pd-c span { color: var(--c-accent); }

/* ============================================================
   HERO
   ============================================================ */
.hero-section { padding-top: 150px; }
.hero-eyebrow {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary);
}
.hero-section h1.headline { margin-top: 16px; max-width: 22ch; }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 40px;
  font-size: .85rem;
  color: var(--ink-soft);
}
.hero-meta b { color: var(--ink); }

/* ============================================================
   NÚMEROS GRANDES / STAT CARDS
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 44px;
}
.stat {
  background: var(--surface-0);
  border: 1px solid var(--surface-mid);
  border-radius: var(--r);
  padding: 26px 24px;
  box-shadow: var(--shadow);
  position: relative;
}
.stat .num {
  font-size: clamp(2.2rem, 4.4vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat .label {
  margin-top: 12px;
  font-size: .96rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

/* Bloques numerados (Sección 2) */
.block-list { margin-top: 40px; display: grid; gap: 18px; }
.block {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 18px;
  background: var(--surface-0);
  border: 1px solid var(--surface-mid);
  border-radius: var(--r);
  padding: 24px;
  box-shadow: var(--shadow);
}
.block .n {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem;
}
.block h3 { font-size: 1.12rem; color: var(--ink); margin-bottom: 6px; }
.block p { color: var(--ink-soft); font-size: 1rem; }

/* Pares de coste (Sección 3) */
.cost-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 36px;
}
.cost-card {
  border-radius: var(--r);
  padding: 24px;
  border: 1px solid var(--surface-mid);
  background: var(--surface-0);
  box-shadow: var(--shadow);
}
.cost-card.big-cost {
  background: linear-gradient(140deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-color: transparent;
}
.cost-card .ctag { font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: .8; }
.cost-card .cval { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; margin-top: 10px; line-height: 1; }
.cost-card .cnote { margin-top: 10px; font-size: .92rem; opacity: .9; }

.anchor-note {
  margin-top: 36px;
  background: var(--surface-low);
  border-left: 4px solid var(--primary-light);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 20px 24px;
}
.anchor-note h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); margin-bottom: 8px; }
.anchor-note p { color: var(--ink-soft); }

/* Perfil del campeón (Sección 4) */
.profile-list { margin-top: 34px; display: grid; gap: 12px; max-width: 60ch; }
.profile-item {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface-0); border: 1px solid var(--surface-mid);
  border-radius: var(--r); padding: 18px 20px;
}
.profile-item .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); margin-top: 8px; flex-shrink: 0; }
.profile-item p { color: var(--ink); }

/* Sellos de rigor (Sección 7) */
.seal-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.seal {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-0); border: 1.5px solid var(--outline);
  border-radius: 30px; padding: 9px 18px;
  font-weight: 700; font-size: .9rem; color: var(--primary-dark);
}
.seal .mk { font-weight: 800; color: var(--primary); }

/* ============================================================
   BADGES DE EVIDENCIA (N1–N4)
   ============================================================ */
.ev {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .04em;
  border-radius: 5px;
  padding: 2px 6px;
  color: #fff;
  margin-left: 6px;
  white-space: nowrap;
  cursor: default;
}
.ev.n1 { background: var(--n1); }
.ev.n2 { background: var(--n2); }
.ev.n3 { background: var(--n3); }
.ev.n4 { background: var(--n4); }
.ev.mix { background: linear-gradient(90deg, var(--n1), var(--n2)); }
.ev.mix23 { background: linear-gradient(90deg, var(--n2), var(--n3)); }

/* Placeholder visible [PENDIENTE] / [POR CONFIRMAR] */
.ph {
  display: inline-block;
  font-weight: 700;
  font-size: .85em;
  letter-spacing: .02em;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px dashed #d8b84a;
  border-radius: 5px;
  padding: 1px 8px;
}

/* ============================================================
   "VER FUENTES" (desplegable)
   ============================================================ */
.sources { margin-top: 40px; max-width: 760px; }
.sources-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent;
  border: 1.5px solid var(--outline);
  border-radius: 8px;
  padding: 9px 16px;
  font-family: var(--font);
  font-size: .82rem; font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s;
}
.sources-btn:hover { border-color: var(--primary); color: var(--primary); }
.sources-btn .chev { transition: transform .2s; font-size: .7rem; }
.sources-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.sources-panel {
  display: none;
  margin-top: 12px;
  border: 1px solid var(--surface-mid);
  border-radius: var(--r);
  background: var(--surface-low);
  padding: 18px 22px;
}
.sources-panel.open { display: block; }
.sources-panel h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); margin-bottom: 12px; }
.src-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 14px;
  padding: 9px 0;
  border-top: 1px solid var(--surface-mid);
  align-items: start;
  font-size: .9rem;
}
.src-item:first-of-type { border-top: none; }
.src-item .src-claim { color: var(--ink); font-weight: 600; }
.src-item .src-attr { color: var(--ink-soft); font-size: .85rem; margin-top: 2px; }
.src-attr a, .stat cite a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.src-attr a:hover, .stat cite a:hover { color: var(--primary-dark); }
.src-attr .nolink { font-style: italic; opacity: .8; }
/* Enlaces dentro de los paneles de la Parte C (oscura) */
.internal .src-attr a { color: var(--c-accent); }
.internal .src-attr a:hover { color: #f1c489; }

/* ============================================================
   MATRIZ DE ZONAS (Sección 5)
   ============================================================ */
.matrix-wrap {
  margin-top: 36px;
  border: 1px solid var(--surface-mid);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--surface-0);
}
.matrix-tools {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--surface-mid);
  background: var(--surface-low);
}
.matrix-tools label { font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.matrix-tools select, .matrix-tools input {
  font-family: var(--font); font-size: .85rem;
  border: 1.5px solid var(--outline); border-radius: 7px;
  padding: 6px 10px; color: var(--ink); background: #fff;
}
.matrix-tools .mstat { margin-left: auto; font-size: .8rem; color: var(--ink-soft); }
.matrix-scroller { overflow-x: auto; }
table.matrix { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 760px; }
table.matrix thead th {
  position: sticky; top: 0;
  background: var(--primary); color: #fff;
  padding: 12px 14px; text-align: left;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap; user-select: none;
}
table.matrix thead th:hover { background: var(--primary-light); }
table.matrix thead th.asc::after { content: ' ↑'; }
table.matrix thead th.desc::after { content: ' ↓'; }
table.matrix tbody td { padding: 11px 14px; border-bottom: 1px solid var(--surface-mid); vertical-align: top; }
table.matrix tbody tr:hover { background: var(--primary-pale); }
table.matrix .num { text-align: right; font-variant-numeric: tabular-nums; }
table.matrix .zone-name { font-weight: 600; color: var(--ink); }
table.matrix .zone-region { font-size: .76rem; color: var(--ink-soft); }
.pill { display: inline-block; border-radius: 20px; padding: 2px 10px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.pill-si { background: var(--save-soft); color: var(--save); }
.pill-no { background: #e7eeed; color: var(--ink-soft); }
.pill-prob { background: #fbeccd; color: var(--n3); }
.pill-pend { background: var(--warn-soft); color: var(--warn); border: 1px dashed #d8b84a; }
.rc-note { font-size: .72rem; color: var(--ink-soft); margin-top: 3px; }
table.matrix tbody tr.sel { background: var(--primary-pale); box-shadow: inset 3px 0 0 var(--primary); }

/* ============================================================
   INDICADORES / PILOTO (Sección 6)
   ============================================================ */
.kpi-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.kpi {
  flex: 1 1 200px;
  background: var(--surface-0); border: 1px solid var(--surface-mid);
  border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); text-align: center;
}
.kpi .kpi-name { font-size: 1.15rem; font-weight: 800; color: var(--primary); text-transform: capitalize; }
.kpi .kpi-sub { font-size: .85rem; color: var(--ink-soft); margin-top: 6px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 30px; }
.two-col .col h4 { color: var(--primary); font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.two-col .col p { color: var(--ink-soft); }

/* ============================================================
   PARTE C — MODO INTERNO (oscuro)
   ============================================================ */
.internal { background: var(--c-bg); color: var(--c-ink); }
.internal .kicker {
  color: var(--c-accent);
  border-color: var(--c-outline);
  background: var(--c-surface);
}
.internal h1.headline, .internal h2.headline { color: var(--c-ink); }
.internal .lead, .internal .body-text { color: var(--c-ink-soft); }
.internal .closing { color: var(--c-accent); border-left-color: var(--c-accent); }
.internal.section.alt { background: var(--c-bg-2); }

/* Sello fijo "USO INTERNO" en cada sección C */
.internal-stamp {
  position: sticky;
  top: 60px;
  z-index: 50;
  margin: -96px -22px 40px;
  padding: 9px 22px;
  background: var(--c-accent);
  color: #2a1c06;
  font-weight: 800;
  font-size: .76rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.internal-stamp::before { content: '⚠'; font-size: .95rem; }

.internal .sources-btn { border-color: var(--c-outline); color: var(--c-ink-soft); }
.internal .sources-btn:hover { border-color: var(--c-accent); color: var(--c-accent); }
.internal .sources-panel { background: var(--c-surface); border-color: var(--c-outline); }
.internal .sources-panel h4 { color: var(--c-ink); }
.internal .src-item { border-color: var(--c-outline); }
.internal .src-item .src-claim { color: var(--c-ink); }
.internal .src-item .src-attr { color: var(--c-ink-soft); }
.internal .ev.n4 { background: #56706c; }

/* ============================================================
   SIMULADOR AIP (Sección 8)
   ============================================================ */
.sim {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 26px;
  align-items: start;
}
.sim-inputs {
  background: var(--c-surface);
  border: 1px solid var(--c-outline);
  border-radius: var(--r);
  padding: 22px;
}
.sim-inputs h3, .sim-results h3 {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--c-accent); margin-bottom: 16px;
}
.field { margin-bottom: 15px; }
.field label {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: .82rem; color: var(--c-ink-soft); margin-bottom: 5px;
}
.field .fl-name { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.field input[type="number"] {
  width: 100%;
  background: var(--c-bg-2);
  border: 1.5px solid var(--c-outline);
  border-radius: 7px;
  padding: 9px 11px;
  color: var(--c-ink);
  font-family: var(--font);
  font-size: .95rem;
  font-variant-numeric: tabular-nums;
}
.field input[type="number"]:focus { outline: none; border-color: var(--c-accent); }
.field .unit { font-size: .74rem; color: var(--c-ink-soft); opacity: .75; }
.field.capex-opex input { border-color: var(--c-accent); border-style: dashed; }

.sim-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.preset-btn {
  font-family: var(--font); font-size: .76rem; font-weight: 700;
  background: var(--c-bg-2); color: var(--c-ink-soft);
  border: 1.5px solid var(--c-outline); border-radius: 20px;
  padding: 6px 13px; cursor: pointer; transition: all .15s;
}
.preset-btn:hover, .preset-btn.active { border-color: var(--c-accent); color: var(--c-accent); }

.sim-results { background: var(--c-surface); border: 1px solid var(--c-outline); border-radius: var(--r); padding: 22px; }
.result-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.result-card {
  background: var(--c-bg-2);
  border: 1px solid var(--c-outline);
  border-radius: var(--r);
  padding: 22px;
  text-align: center;
}
.result-card .rc-label { font-size: .8rem; color: var(--c-ink-soft); letter-spacing: .04em; }
.result-card .rc-val {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 800; letter-spacing: -.02em; margin: 8px 0 4px;
  font-variant-numeric: tabular-nums;
}
.result-card .rc-tag { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.result-card.is-cost { border-color: var(--danger); }
.result-card.is-cost .rc-val { color: #ff6b5e; }
.result-card.is-cost .rc-tag { color: #ff6b5e; }
.result-card.is-save .rc-val { color: #4fd99b; }
.result-card.is-save .rc-tag { color: #4fd99b; }

.sim-breakdown { margin-top: 18px; font-size: .85rem; }
.sim-breakdown table { width: 100%; border-collapse: collapse; }
.sim-breakdown td { padding: 6px 0; border-bottom: 1px solid var(--c-outline); color: var(--c-ink-soft); }
.sim-breakdown td.v { text-align: right; color: var(--c-ink); font-variant-numeric: tabular-nums; font-weight: 600; }

/* Tabla de escenarios precalculados (validación) */
.scen-table-wrap { margin-top: 26px; overflow-x: auto; }
table.scen { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 600px; }
table.scen th, table.scen td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--c-outline); }
table.scen thead th { color: var(--c-accent); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
table.scen td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
table.scen .cost { color: #ff6b5e; }
table.scen .save { color: #4fd99b; }
table.scen .ok { color: #4fd99b; font-weight: 700; }
table.scen .bad { color: #ff6b5e; font-weight: 700; }
.validation-flag {
  margin-top: 14px; padding: 10px 14px; border-radius: 8px;
  font-size: .85rem; font-weight: 600; display: inline-flex; gap: 8px; align-items: center;
}
.validation-flag.pass { background: rgba(79, 217, 155, .12); color: #4fd99b; border: 1px solid rgba(79,217,155,.4); }
.validation-flag.fail { background: rgba(255, 107, 94, .12); color: #ff6b5e; border: 1px solid rgba(255,107,94,.4); }

.honest-note {
  margin-top: 22px;
  background: var(--c-accent-soft);
  border-left: 4px solid var(--c-accent);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 18px 20px;
  color: var(--c-ink);
}
.honest-note strong { color: var(--c-accent); }

/* Playbook (Sección 10) */
.playbook-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 34px; }
.pb-card {
  background: var(--c-surface); border: 1px solid var(--c-outline);
  border-radius: var(--r); padding: 24px;
}
.pb-card.lines { border-color: var(--danger); }
.pb-card h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 16px; }
.pb-card.tasks h3 { color: var(--c-accent); }
.pb-card.lines h3 { color: #ff6b5e; }
.pb-card ul { list-style: none; display: grid; gap: 14px; }
.pb-card li { padding-left: 26px; position: relative; color: var(--c-ink-soft); }
.pb-card li strong { color: var(--c-ink); }
.pb-card.tasks li::before { content: '→'; position: absolute; left: 0; color: var(--c-accent); font-weight: 800; }
.pb-card.lines li::before { content: '✕'; position: absolute; left: 0; color: #ff6b5e; font-weight: 800; }

/* ============================================================
   FOOTER + DEPLOY
   ============================================================ */
.footer {
  background: var(--c-bg);
  color: var(--c-ink-soft);
  padding: 70px 22px 50px;
  border-top: 1px solid var(--c-outline);
}
.footer-inner { max-width: var(--maxw); margin: 0 auto; }
.footer h3 { color: var(--c-accent); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 18px; }
.deploy-steps { display: grid; gap: 12px; counter-reset: step; max-width: 760px; }
.deploy-steps li { list-style: none; padding-left: 38px; position: relative; line-height: 1.6; }
.deploy-steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--c-accent); color: var(--c-bg);
  font-weight: 800; font-size: .82rem;
  display: flex; align-items: center; justify-content: center;
}
.footer code {
  background: var(--c-surface); border: 1px solid var(--c-outline);
  border-radius: 5px; padding: 1px 7px; font-size: .85em; color: var(--c-accent);
  font-family: 'SF Mono', Menlo, Consolas, monospace;
}
.footer-meta { font-size: .82rem; }

/* ============================================================
   TOOLTIP DE NIVELES DE EVIDENCIA (N1–N4)
   ============================================================ */
.ev-tooltip {
  position: fixed;
  z-index: 4000;
  max-width: 320px;
  background: var(--ink);
  color: #e9f3f2;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: .78rem;
  line-height: 1.5;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s;
}
.ev-tooltip.open { opacity: 1; }
.ev-tooltip p { margin: 2px 0; color: #9fb5b1; }
.ev-tooltip p.ev-tip-title { color: #fff; font-weight: 700; margin-bottom: 6px; }
.ev-tooltip p.on { color: var(--c-accent); font-weight: 700; }

/* ============================================================
   CITAS DE FUENTE INLINE (Sección 1)
   ============================================================ */
.stat cite {
  display: block;
  margin-top: 10px;
  font-style: normal;
  font-size: .76rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--surface-mid);
  padding-top: 8px;
}
.stat cite::before { content: '↳ '; opacity: .5; }

/* ============================================================
   FLIP CARD (Sección 3 — tercera card)
   ============================================================ */
.cost-card.flip { background: transparent; border: none; box-shadow: none; padding: 0; perspective: 1200px; }
.flip-inner {
  position: relative;
  width: 100%;
  min-height: 142px;
  height: 100%;
  transition: transform .6s;
  transform-style: preserve-3d;
}
.cost-card.flip:hover .flip-inner,
.cost-card.flip:focus-within .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--r);
  padding: 24px;
}
.flip-front {
  background: linear-gradient(140deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
}
.flip-front .flip-hint { position: absolute; bottom: 14px; right: 16px; font-size: .7rem; opacity: .8; }
.flip-back {
  background: var(--ink);
  color: #e9f3f2;
  transform: rotateY(180deg);
  font-size: .82rem;
  line-height: 1.55;
  overflow: auto;
}
.flip-back b { color: #fff; }
.flip-back .fb-sub { color: #9fb5b1; margin-top: 6px; display: block; }

/* ============================================================
   MAPA + TABLA SINCRONIZADOS (Sección 5)
   ============================================================ */
/* Breakout: esta parte se sale del margen (más ancha que el cuerpo) para
   que tabla y mapa sean legibles. Centrado respecto al viewport sin transform. */
.zone-split {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
  margin-top: 36px;
  align-items: start;
  width: min(96vw, 1560px);
  margin-left: calc((100% - min(96vw, 1560px)) / 2);
}
#zone-map {
  height: 620px;
  border-radius: var(--r);
  border: 1px solid var(--surface-mid);
  box-shadow: var(--shadow);
  z-index: 0;
}
.zone-split .matrix-wrap { margin-top: 0; }
.zone-split .matrix-scroller { max-height: 620px; overflow-y: auto; }
/* Con más ancho, la tabla ya no necesita scroll horizontal */
.zone-split table.matrix { min-width: 0; font-size: .9rem; }
.zone-split table.matrix thead th { padding: 12px 16px; }
.zone-split table.matrix tbody td { padding: 13px 16px; }
.zone-split table.matrix .zone-name { font-size: .96rem; }
.map-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: .8rem; color: var(--ink-soft); }
.map-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.map-legend .dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1.5px solid #fff; box-shadow: 0 0 0 1px var(--outline); }
.map-legend .dot.confirmada { background: #2c7873; }
.map-legend .dot.probable { background: #b07b1e; }
.map-legend .dot.porconfirmar { background: #9aa9a7; }
.leaflet-popup-content { font-family: var(--font); font-size: .82rem; line-height: 1.5; }

/* ============================================================
   HILO DE 6 PASOS (Sección 7)
   ============================================================ */
.thread { margin-top: 36px; display: grid; gap: 16px; counter-reset: step; max-width: 72ch; }
.thread-step {
  display: grid; grid-template-columns: 44px 1fr; gap: 18px;
  background: var(--surface-0); border: 1px solid var(--surface-mid);
  border-radius: var(--r); padding: 22px 24px; box-shadow: var(--shadow);
}
.thread-step .ts-n {
  counter-increment: step; width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary-pale); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem;
}
.thread-step .ts-n::before { content: counter(step); }
.thread-step h3 { font-size: 1.08rem; color: var(--ink); margin-bottom: 5px; }
.thread-step p { color: var(--ink-soft); font-size: 1rem; }

/* ============================================================
   INTRO AIP (Sección 8)
   ============================================================ */
.aip-intro {
  margin-top: 26px;
  background: var(--c-surface);
  border: 1px solid var(--c-outline);
  border-left: 4px solid var(--c-accent);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 22px 24px;
}
.aip-intro h3 { color: var(--c-accent); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.aip-intro p { color: var(--c-ink-soft); }
.aip-intro strong { color: var(--c-ink); }

/* ============================================================
   SIMULADOR v2 — RESULTADOS ARRIBA + GRUPOS (ACORDEÓN)
   ============================================================ */
.sim-results-top { margin-top: 28px; }
.sim-results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sim-results-head h3 { margin-bottom: 0; }
.sim-reset {
  font-family: var(--font); font-size: .78rem; font-weight: 700;
  background: var(--c-bg-2); color: var(--c-ink-soft);
  border: 1.5px solid var(--c-outline); border-radius: 20px;
  padding: 7px 14px; cursor: pointer; transition: all .15s;
}
.sim-reset:hover { border-color: var(--c-accent); color: var(--c-accent); }

/* Layout: inputs a la izquierda; a la derecha, KPIs fijos arriba + tabla/gráficas.
   Breakout para ensanchar la sección y aprovechar el espacio.
   KPIs sticky → ves el impacto al editar cualquier parámetro sin hacer scroll. */
.sim-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "inputs kpis" "inputs analysis";
  gap: 22px;
  align-items: start;
  margin-top: 24px;
  width: min(96vw, 1440px);
  margin-left: calc((100% - min(96vw, 1440px)) / 2);
}
.sim-inputs-col { grid-area: inputs; min-width: 0; }
.sim-analysis-col { grid-area: analysis; min-width: 0; }
.sim-results-top {
  grid-area: kpis;
  position: sticky;
  top: 72px;
  z-index: 20;
  margin-top: 0;
  box-shadow: var(--shadow-lg);
}
.sim-results-top .rc-val { white-space: nowrap; }   /* evita que el "€" salte de línea */

.sim-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 0; align-items: start; }
.sim-group {
  background: var(--c-surface); border: 1px solid var(--c-outline);
  border-radius: var(--r); overflow: hidden;
}
.sim-group.span-2 { grid-column: 1 / -1; }
.sim-group.group-pending { border-color: var(--c-accent); }
.sim-group-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: transparent; border: none; cursor: pointer;
  padding: 16px 20px; font-family: var(--font); text-align: left;
}
.sg-title { font-size: .98rem; font-weight: 700; color: var(--c-ink); display: flex; align-items: center; gap: 10px; }
.sg-title em { font-style: normal; font-weight: 500; font-size: .82rem; color: var(--c-ink-soft); }
.sg-n {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--c-accent-soft); color: var(--c-accent);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .84rem;
}
.group-pending .sg-n { background: var(--c-accent); color: var(--c-bg); }
.sg-chev { color: var(--c-ink-soft); transition: transform .2s; font-size: .8rem; }
.sim-group.open .sg-chev { transform: rotate(180deg); }
/* Colapso: el cuerpo solo se muestra cuando el grupo está abierto */
.sim-group-body { display: none; padding: 4px 20px 20px; }
.sim-group.open .sim-group-body { display: grid; gap: 14px; }
.sim-group-body.cols-2 { grid-template-columns: 1fr 1fr; }
.sim-group-body .field { margin-bottom: 0; }

/* Campos pendientes (CAPEX/OPEX) resaltados */
.field-pending input { border-color: var(--c-accent); border-style: dashed; background: var(--c-accent-soft); }

/* Grupo 1 — conmutador de modo (manual / selector de zonas) */
.terr-mode { display: inline-flex; gap: 4px; background: var(--c-bg-2); border: 1px solid var(--c-outline); border-radius: 9px; padding: 3px; margin-bottom: 4px; }
.terr-tab {
  font-family: var(--font); font-size: .82rem; font-weight: 700;
  background: transparent; color: var(--c-ink-soft);
  border: none; border-radius: 7px; padding: 7px 14px; cursor: pointer; transition: all .15s;
}
.terr-tab.active { background: var(--c-accent); color: var(--c-bg); }
.terr-tab:not(.active):hover { color: var(--c-accent); }
.terr-panel[hidden] { display: none; }

/* Modo B — selector múltiple de AIS */
.terr-sum { font-weight: 800; color: var(--c-accent); font-variant-numeric: tabular-nums; }
.ais-select {
  max-height: 240px; overflow-y: auto;
  border: 1.5px solid var(--c-outline); border-radius: 9px; background: var(--c-bg-2);
  padding: 4px;
}
.ais-opt {
  display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: .86rem; color: var(--c-ink);
}
.ais-opt:hover { background: var(--c-surface-2); }
.ais-opt input { width: 15px; height: 15px; accent-color: var(--c-accent); cursor: pointer; }
.ais-opt-pop { font-variant-numeric: tabular-nums; color: var(--c-ink-soft); font-size: .82rem; }
.ais-picked { margin-top: 8px; font-size: .8rem; color: var(--c-ink-soft); line-height: 1.45; }

/* Deslizador RRR destacado */
.field-slider .slider-out {
  font-weight: 800; font-size: 1.05rem; color: var(--c-accent);
  font-variant-numeric: tabular-nums;
}
input[type="range"]#sim-rrr {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 6px; margin: 8px 0 4px;
  background: var(--c-bg-2); border: 1px solid var(--c-outline); cursor: pointer;
}
input[type="range"]#sim-rrr::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--c-accent); border: 3px solid var(--c-surface); box-shadow: 0 0 0 1px var(--c-accent);
  cursor: pointer;
}
input[type="range"]#sim-rrr::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--c-accent); border: 3px solid var(--c-surface); cursor: pointer;
}
.slider-scale { display: flex; justify-content: space-between; font-size: .72rem; color: var(--c-ink-soft); font-variant-numeric: tabular-nums; }

/* Toggle de coste de episodio */
.ep-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toggle-opt {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--c-bg-2); border: 1.5px solid var(--c-outline); border-radius: 9px;
  padding: 10px; cursor: pointer; font-family: var(--font); color: var(--c-ink-soft); transition: all .15s;
}
.toggle-opt b { font-size: .8rem; color: var(--c-ink); }
.toggle-opt span { font-size: .9rem; font-variant-numeric: tabular-nums; }
.toggle-opt small { font-size: .68rem; color: var(--c-ink-soft); line-height: 1.2; }
.toggle-opt:hover { border-color: var(--c-accent); }
.toggle-opt.active { border-color: var(--c-accent); background: var(--c-accent-soft); }
.toggle-opt.active b, .toggle-opt.active span { color: var(--c-accent); }

/* Selector de modalidad de RC (3 opciones) */
.mod-toggle { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mod-pct { margin-top: 12px; }
.mod-pct[hidden] { display: none; }
.mod-pct label { display: flex; justify-content: space-between; gap: 8px; font-size: .82rem; color: var(--c-ink-soft); margin-bottom: 5px; }
.mod-pct input { width: 100%; background: var(--c-bg-2); border: 1.5px solid var(--c-outline); border-radius: 7px; padding: 9px 11px; color: var(--c-ink); font-family: var(--font); font-size: .95rem; font-variant-numeric: tabular-nums; }
.mod-pct input:focus { outline: none; border-color: var(--c-accent); }

/* Icono de info (i) por parámetro */
.info {
  width: 16px; height: 16px; flex-shrink: 0;
  border-radius: 50%; border: 1.5px solid var(--c-ink-soft);
  background: transparent; color: var(--c-ink-soft);
  font-size: 10px; font-weight: 800; font-family: var(--font); font-style: italic;
  line-height: 1; cursor: help; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  vertical-align: middle; transition: all .15s;
}
.info:hover, .info:focus { border-color: var(--c-accent); color: var(--c-accent); outline: none; }
.info-tooltip {
  position: fixed; z-index: 4000; max-width: 300px;
  background: var(--ink); color: #e9f3f2;
  border: 1px solid var(--c-outline); border-radius: 10px;
  padding: 11px 13px; font-size: .8rem; line-height: 1.5;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .12s;
}
.info-tooltip.open { opacity: 1; }

/* Título y nota de la tabla de escenarios */
.scen-title { margin-top: 40px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--c-accent); }
.scen-foot { margin-top: 8px; margin-bottom: 14px; font-size: .8rem; color: var(--c-ink-soft); line-height: 1.5; }
.scen-foot strong { color: var(--c-ink); }

/* Tabla de escenarios dinámica: cabecera agrupada RECH / OPP */
table.scen-dyn thead th { text-align: center; }
table.scen-dyn thead tr:first-child th { border-bottom: 1px solid var(--c-outline); }
table.scen-dyn tbody td:first-child { font-weight: 600; color: var(--c-ink); }
table.scen-dyn tbody td:nth-child(2) { color: var(--c-ink-soft); }
table.scen-dyn td.num { text-align: right; }

/* Selector de horizonte (break-even) */
.be-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: .85rem; color: var(--c-ink-soft); }
.be-controls label { font-weight: 600; }
.be-controls select { font-family: var(--font); font-size: .9rem; background: var(--c-bg-2); color: var(--c-ink); border: 1.5px solid var(--c-outline); border-radius: 7px; padding: 6px 10px; cursor: pointer; }
.be-controls select:focus { outline: none; border-color: var(--c-accent); }

/* Nota honesta bajo el break-even */
.chart-honest { margin-top: 12px; font-size: .8rem; line-height: 1.55; color: var(--c-ink-soft); border-left: 3px solid var(--c-accent); padding-left: 12px; }

/* Eje X (título "Año") en SVG */
.chart-svg .ch-axtitle { fill: var(--c-ink-soft); font: 700 10px var(--font); letter-spacing: .04em; }

/* Desplegable destacado "Cómo leer estos números" */
.readme-block { margin-top: 16px; }
.readme-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--c-accent-soft); border: 1.5px solid var(--c-accent); border-radius: 9px;
  padding: 12px 16px; font-family: var(--font); font-size: .92rem; font-weight: 800;
  color: var(--c-accent); cursor: pointer; transition: background .15s;
}
.readme-btn:hover { background: rgba(224, 164, 88, .22); }
.readme-btn .chev { margin-left: auto; transition: transform .2s; }
.readme-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.readme-panel { border-color: var(--c-accent) !important; }
.readme-panel p { color: var(--c-ink-soft); margin-bottom: 10px; line-height: 1.6; }
.readme-panel p strong { color: var(--c-ink); }
.readme-list { margin: 4px 0 12px; padding-left: 20px; display: grid; gap: 8px; }
.readme-list li { color: var(--c-ink-soft); line-height: 1.55; }
.readme-list li strong { color: var(--c-accent); }

/* ── Panel de gráficas ── */
.charts-block { margin-top: 16px; }
.charts-panel { padding: 16px 18px; }
.charts-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.chart-tabs { display: inline-flex; gap: 4px; background: var(--c-bg-2); border: 1px solid var(--c-outline); border-radius: 9px; padding: 3px; }
.chart-tab {
  font-family: var(--font); font-size: .8rem; font-weight: 700;
  background: transparent; color: var(--c-ink-soft);
  border: none; border-radius: 7px; padding: 7px 13px; cursor: pointer; transition: all .15s;
}
.chart-tab.active { background: var(--c-accent); color: var(--c-bg); }
.chart-tab:not(.active):hover { color: var(--c-accent); }
.chart-view[hidden] { display: none; }
.chart-host { width: 100%; }
.chart-svg { width: 100%; height: auto; display: block; background: var(--c-bg-2); border: 1px solid var(--c-outline); border-radius: 10px; }
.chart-svg .ch-grid { stroke: var(--c-outline); stroke-width: 1; opacity: .4; }
.chart-svg .ch-zero { stroke: var(--c-ink-soft); stroke-width: 1.4; stroke-dasharray: 4 4; opacity: .8; }
.chart-svg .ch-marker { stroke: var(--c-accent); stroke-width: 1.6; stroke-dasharray: 3 3; }
.chart-svg .ch-ylab { fill: var(--c-ink-soft); font: 600 11px var(--font); text-anchor: end; }
.chart-svg .ch-xlab { fill: var(--c-ink-soft); font: 600 11px var(--font); }
.chart-svg .ch-zlab { fill: var(--c-ink-soft); font: 700 10px var(--font); opacity: .85; }
.chart-svg .ch-zlab.save { fill: #4fd99b; }
.chart-svg .ch-mlab { fill: var(--c-accent); font: 700 10px var(--font); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: .82rem; color: var(--c-ink-soft); }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend .ln { width: 18px; height: 3px; border-radius: 2px; display: inline-block; }
.chart-caption { margin-top: 10px; font-size: .8rem; color: var(--c-ink-soft); line-height: 1.5; }

/* "Cómo se calcula" — fórmula legible */
.calc-steps { margin: 0 0 6px 0; padding-left: 22px; display: grid; gap: 8px; }
.calc-steps li { color: var(--c-ink-soft); font-size: .9rem; line-height: 1.5; }
.calc-note { color: var(--c-ink); font-weight: 600; font-size: .85rem; margin-top: 8px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sim-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "kpis" "inputs" "analysis";
    gap: 14px;
    width: auto;
    margin-left: 0;
  }
  .sim-results-top { top: 60px; }
  .sim-groups { grid-template-columns: 1fr; }
  .sim-group-body.cols-2 { grid-template-columns: 1fr; }
  .sim { grid-template-columns: 1fr; }
  .two-col, .playbook-cols { grid-template-columns: 1fr; }
  .zone-split { grid-template-columns: 1fr; }
  #zone-map { height: 380px; }
  .thread-step { grid-template-columns: 36px 1fr; gap: 14px; }
}
@media (max-width: 640px) {
  .section { padding: 64px 18px; }
  .hero-section { padding-top: 110px; }
  .nav-brand small { display: none; }
  .result-cards { grid-template-columns: 1fr; }
  .src-item { grid-template-columns: 50px 1fr; }
  .internal-stamp { margin: -64px -18px 30px; letter-spacing: .06em; font-size: .68rem; }
}

/* ───────── Logo Dextro en cabecera/pie (E6) y enlaces a mapa/vista ───────── */
.nav-brand { display: flex; align-items: center; gap: 9px; }
.nav-logo { height: 24px; width: auto; display: block; flex-shrink: 0; }
.footer-inner-logo { display: flex; gap: 18px; align-items: flex-start; }
.footer-logo { height: 36px; width: auto; opacity: .92; flex-shrink: 0; }
@media (max-width: 760px) { .footer-inner-logo { flex-direction: column; gap: 12px; } }

/* ════════════════════════════════════════════════════════════════════
   SECCIÓN MAPA DE EQUIDAD (E1, integrado · presentable). Scoped .equity-section
   ════════════════════════════════════════════════════════════════════ */
.equity-section .eq-controls { display: flex; flex-wrap: wrap; gap: 18px 30px; align-items: flex-end; margin: 22px 0 16px; padding: 15px 17px; background: var(--surface-0); border: 1px solid var(--outline); border-radius: var(--r); box-shadow: var(--shadow); }
.equity-section .eq-group { display: flex; flex-direction: column; gap: 8px; }
.equity-section .eq-label { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 6px; }
.equity-section .eq-zoom { margin-left: auto; flex-direction: row; align-items: center; gap: 8px; }
.equity-section .eq-seg { display: inline-flex; border: 1.5px solid var(--outline); border-radius: 22px; overflow: hidden; }
.equity-section .eq-seg-opt { font-family: var(--font); font-size: .8rem; font-weight: 600; padding: 8px 14px; border: 1.5px solid var(--outline); border-radius: 22px; background: var(--surface-low); color: var(--ink-soft); cursor: pointer; transition: .15s; }
.equity-section .eq-seg .eq-seg-opt { border: none; border-radius: 0; }
.equity-section .eq-seg-opt:hover { color: var(--primary); }
.equity-section .eq-seg-opt.active { background: var(--primary); color: #fff; }
.equity-section .eq-zoom .eq-seg-opt { border-radius: 20px; }
.equity-section .eq-chk { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--ink); cursor: pointer; }
.equity-section .eq-chk input { width: 15px; height: 15px; accent-color: var(--primary); }

.equity-section .eq-shell { position: relative; }
.equity-section #equity-map { height: 580px; border-radius: var(--r); border: 1px solid var(--outline); box-shadow: var(--shadow); background: #dce7e7; z-index: 1; }
.equity-section .aga-pop h5 { font-size: .95rem; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.equity-section .aga-pop .row { display: flex; justify-content: space-between; gap: 18px; padding: 2px 0; }
.equity-section .aga-pop .row .k { color: var(--ink-soft); }
.equity-section .aga-pop .row .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.equity-section .aga-pop .dev-up { color: var(--danger); }
.equity-section .aga-pop .dev-dn { color: var(--save); }
.equity-section .aga-pop .unit-line { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--outline); font-size: .8rem; }
.equity-section .aga-pop .unit-yes { color: var(--save); font-weight: 700; }
.equity-section .aga-pop .unit-no { color: var(--warn); font-weight: 700; }

.equity-section .eq-legend { position: absolute; bottom: 16px; left: 16px; z-index: 500; background: rgba(255,255,255,.96); border: 1px solid var(--outline); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow); max-width: 290px; backdrop-filter: blur(2px); }
.equity-section .eql-title { font-size: .77rem; font-weight: 800; color: var(--ink); margin-bottom: 9px; line-height: 1.3; }
.equity-section .eql-scale { display: flex; flex-direction: column; gap: 2px; }
.equity-section .eql-row { display: flex; align-items: center; gap: 8px; font-size: .75rem; color: var(--ink-soft); background: none; border: 1px solid transparent; border-radius: 5px; padding: 2px 5px; cursor: pointer; text-align: left; font-family: var(--font); width: 100%; transition: .12s; }
.equity-section .eql-row:hover { border-color: var(--outline); }
.equity-section .eql-row.off { opacity: .32; }
.equity-section .eql-row.off .sw { filter: grayscale(.7); }
.equity-section .eql-row .sw { width: 22px; height: 13px; border-radius: 3px; border: 1px solid rgba(0,0,0,.12); flex-shrink: 0; }
.equity-section .eql-media { margin-top: 7px; font-size: .72rem; color: var(--ink-soft); }
.equity-section .eql-media b { color: var(--ink); }
.equity-section .eql-hint { margin-top: 4px; font-size: .68rem; color: var(--ink-soft); opacity: .85; font-style: italic; }
.equity-section .eql-sep { height: 1px; background: var(--outline); margin: 10px 0 8px; }
.equity-section .eql-mk-row { display: flex; align-items: center; gap: 8px; font-size: .76rem; color: var(--ink); background: none; border: 1px solid transparent; border-radius: 5px; padding: 3px 5px; cursor: pointer; font-family: var(--font); width: 100%; text-align: left; }
.equity-section .eql-mk-row:hover { border-color: var(--outline); }
.equity-section .eql-mk-row.off { opacity: .35; }
.equity-section .eql-mk-row .muted { color: var(--ink-soft); }
.equity-section .mk { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.equity-section .mk-conf { background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--primary-dark); }
.equity-section .mk-prob { background: #fff; border: 2px dashed var(--warn); }
.equity-section .eql-brecha { margin-top: 8px; font-size: .7rem; color: var(--ink-soft); line-height: 1.4; }

.equity-section .eq-callouts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.equity-section .eq-callout { padding: 16px 18px; border-radius: var(--r); border: 1px solid var(--outline); background: var(--surface-0); border-left-width: 4px; }
.equity-section .eq-callout h4 { font-size: .94rem; font-weight: 800; margin-bottom: 6px; }
.equity-section .eq-callout p { font-size: .88rem; line-height: 1.55; color: var(--ink-soft); }
.equity-section .eq-callout.star { border-left-color: var(--danger); }
.equity-section .eq-callout.star h4 { color: var(--danger); }
.equity-section .eq-callout.note { border-left-color: var(--primary); }
.equity-section .eq-callout.note h4 { color: var(--primary); }

@media (max-width: 760px) {
  .equity-section #equity-map { height: 440px; }
  .equity-section .eq-callouts { grid-template-columns: 1fr; }
  .equity-section .eq-zoom { margin-left: 0; }
}

/* ───────── Sección mapa fusionada: capa hospitales, zonas prioritarias, tabla por AGA ───────── */
.hosp-pin { background: none; border: none; }
.equity-section .eql-hosp { display: flex; align-items: center; gap: 5px; font-size: .74rem; color: var(--ink); margin-top: 7px; }
.equity-section .eql-hosp .hsq { width: 9px; height: 9px; transform: rotate(45deg); border: 1px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); display: inline-block; }
.equity-section .eql-hosp .muted, .equity-section .eql-markers .muted { color: var(--ink-soft); }
.equity-section .eql-prio-note { margin-top: 8px; font-size: .72rem; color: var(--ink); background: rgba(179,38,30,.06); border-left: 3px solid var(--danger); padding: 6px 8px; border-radius: 4px; line-height: 1.4; }
.equity-section .eql-scale.locked { opacity: .45; pointer-events: none; }
.equity-section .aga-pop .prio-tag { color: var(--danger); font-weight: 700; font-size: .76rem; margin-bottom: 6px; }
.equity-section .aga-pop .g { color: var(--ink-soft); font-size: .78rem; }
.equity-section .aga-pop .unit-line b { color: var(--ink); }

.equity-section .eq-table-wrap { margin-top: 26px; }
.equity-section .eq-table-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.equity-section .eq-table-head h4 { font-size: .98rem; font-weight: 800; color: var(--ink); margin-right: auto; }
.equity-section .eq-table-stat { font-size: .8rem; color: var(--ink-soft); }
.equity-section .eq-table-scroll { max-height: 440px; overflow: auto; border: 1px solid var(--outline); border-radius: var(--r); box-shadow: var(--shadow); }
.equity-section table.eq-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.equity-section .eq-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-mid); text-align: left; padding: 10px 12px; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); border-bottom: 1px solid var(--outline); }
.equity-section .eq-table th.num, .equity-section .eq-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.equity-section .eq-table tbody td { padding: 9px 12px; border-bottom: 1px solid var(--surface-mid); vertical-align: top; }
.equity-section .eq-table tbody tr { cursor: pointer; }
.equity-section .eq-table tbody tr:hover { background: var(--primary-pale); }
.equity-section .eq-table tbody tr.sel { background: var(--primary-pale); box-shadow: inset 3px 0 0 var(--primary); }
.equity-section .eq-table tbody tr.is-prio td:first-child { font-weight: 700; color: var(--ink); }
.equity-section .eq-table td small { font-size: .72rem; }
.equity-section .prio-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-right: 6px; vertical-align: middle; }
.equity-section .tb-pill { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 12px; white-space: nowrap; display: inline-block; }
.equity-section .tb-pill.ok { background: var(--save-soft); color: var(--save); }
.equity-section .tb-pill.prob { background: var(--warn-soft); color: var(--warn); }
.equity-section .tb-pill.sin { background: #f1e0de; color: #b3261e; }
.equity-section .tb-gestor { color: var(--ink); font-size: .8rem; line-height: 1.4; }
.equity-section .tb-gestor .g { color: var(--ink-soft); }
.equity-section .eq-table-foot { font-size: .74rem; color: var(--ink-soft); margin-top: 8px; line-height: 1.45; }
.equity-section .dev-up { color: var(--danger); font-weight: 700; }
.equity-section .dev-dn { color: var(--save); font-weight: 700; }

@media (max-width: 760px) {
  .equity-section .eq-table-scroll { max-height: 360px; }
  .equity-section table.eq-table { font-size: .78rem; }
}

/* ───────── Mapa y tabla lado a lado ───────── */
.equity-section .eq-split { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 18px; align-items: start; margin-top: 6px; }
.equity-section .eq-split .eq-shell { position: relative; }
.equity-section .eq-split #equity-map { height: 560px; }
.equity-section .eq-split .eq-table-wrap { margin-top: 0; }
.equity-section .eq-split .eq-table-head { margin-bottom: 8px; gap: 12px; }
.equity-section .eq-split .eq-table-head h4 { font-size: .92rem; }
.equity-section .eq-split .eq-table-scroll { max-height: 516px; }
.equity-section .eq-table-foot { margin-top: 12px; }
@media (max-width: 900px) {
  .equity-section .eq-split { grid-template-columns: 1fr; }
  .equity-section .eq-split #equity-map { height: 440px; }
  .equity-section .eq-split .eq-table-scroll { max-height: 420px; }
}

/* ───────── Sección mapa: romper el margen de 1080px para que mapa+tabla respiren ───────── */
.equity-section .section-inner { max-width: min(1400px, 95vw); }
/* el texto de cabecera se mantiene legible aunque la sección sea ancha */
.equity-section > .section-inner > .kicker,
.equity-section > .section-inner > .headline,
.equity-section > .section-inner > .body-text { max-width: 72ch; }
.equity-section .eq-split { grid-template-columns: 1.5fr 1fr; gap: 22px; }
.equity-section .eq-split #equity-map { height: 620px; }
.equity-section .eq-split .eq-table-scroll { max-height: 576px; }
.equity-section .eq-table-head h4 { font-size: .98rem; }
@media (max-width: 980px) {
  .equity-section .eq-split { grid-template-columns: 1fr; }
  .equity-section .eq-split #equity-map { height: 460px; }
  .equity-section .eq-split .eq-table-scroll { max-height: 430px; }
}
