/* ─── AFP.NET.PE — Design system v2 ─── */
/* Tema claro + Plus Jakarta Sans / DM Sans / DM Mono */

/* ── Tokens — light-first ── */
:root {
  --bg:      #f5f7fc;
  --bg2:     #eef1f8;
  --card:    #ffffff;
  --card2:   #f0f4fb;
  --line:    #d6dced;
  --line2:   #c4cbdf;
  --txt:     #0b1221;
  --mut:     #3a4d6e;
  --dim:     #6474a0;
  --accent:  #1648c8;   /* azul institucional — reemplaza verde neón */
  --on-accent: #ffffff; /* texto sobre fondos de acento (botones) */
  --accent2: #3b6de8;
  --blue-lt: #dce7ff;
  --hab:     #1648c8;
  --int:     #0a8a5c;
  --pri:     #c47a00;
  --pro:     #c41a1a;
  --prom:    #6474a0;
  --warn:    #c47a00;
  --sh-sm:   0 1px 4px rgba(15,24,41,.07), 0 0 0 1px rgba(15,24,41,.04);
  --sh-md:   0 4px 16px rgba(15,24,41,.09), 0 0 0 1px rgba(15,24,41,.04);
  --sh-lg:   0 8px 32px rgba(15,24,41,.12), 0 0 0 1px rgba(15,24,41,.05);
  --f-display: 'Fraunces', 'Plus Jakarta Sans', serif;
  --f-body:    'DM Sans', system-ui, sans-serif;
  --f-mono:    'DM Mono', 'Courier New', monospace;
}

/* ── Tokens — dark mode ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1120; --bg2: #131826; --card: #182035; --card2: #1e2940;
    --line: #243050; --line2: #2e3d62;
    --txt: #e8edf8; --mut: #8a99c0; --dim: #5a6a90;
    --accent: #5b8fff; --accent2: #7aa8ff; --on-accent: #0d1120;
    --blue-lt: #1a2a4a;
    --hab: #5b8fff; --int: #2ec48a; --pri: #f0aa30; --pro: #f06060;
    --sh-sm: 0 1px 4px rgba(0,0,0,.3); --sh-md: 0 4px 16px rgba(0,0,0,.35);
    --sh-lg: 0 8px 32px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1120; --bg2: #131826; --card: #182035; --card2: #1e2940;
  --line: #243050; --line2: #2e3d62;
  --txt: #e8edf8; --mut: #8a99c0; --dim: #5a6a90;
  --accent: #5b8fff; --accent2: #7aa8ff; --on-accent: #0d1120;
  --blue-lt: #1a2a4a;
  --hab: #5b8fff; --int: #2ec48a; --pri: #f0aa30; --pro: #f06060;
  --sh-sm: 0 1px 4px rgba(0,0,0,.3); --sh-md: 0 4px 16px rgba(0,0,0,.35);
  --sh-lg: 0 8px 32px rgba(0,0,0,.4);
  color-scheme: dark;
}

/* ── Reset + base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--txt);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  overflow-x: hidden;
}
.wrap { max-width: 1140px; margin: 0 auto; padding-inline: 16px; }
h1, h2, h3, h4 {
  font-family: var(--f-display);
  line-height: 1.2;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: rgba(245,247,252,.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  margin: 0 -16px;
  padding: 0 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .topbar { background: rgba(13,17,32,.9); }
}
:root[data-theme="dark"] .topbar { background: rgba(13,17,32,.9); }

.topbar-in {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; max-width: 1140px; margin: 0 auto;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-display); font-size: 19px; font-weight: 800;
  letter-spacing: -.02em; color: var(--txt); text-decoration: none;
}
.brand img { height: 28px; width: auto; display: block; flex-shrink: 0; }
.brand b { color: var(--accent); font-weight: 800; }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  color: var(--mut); text-decoration: none; font-size: 13.5px; font-weight: 500;
  padding: 7px 12px; border-radius: 8px; transition: .15s;
}
.nav-links a:hover { color: var(--txt); background: var(--card2); }
.burger {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: 10px; width: 42px; height: 42px;
  cursor: pointer; padding: 0; position: relative; flex-shrink: 0;
}
.burger span {
  position: absolute; left: 11px; right: 11px; height: 2px;
  background: var(--txt); border-radius: 2px; transition: .25s; transform-origin: center;
}
.burger span:nth-child(1) { top: 14px; }
.burger span:nth-child(2) { top: 20px; }
.burger span:nth-child(3) { top: 26px; }
.burger.open span:nth-child(1) { top: 20px; transform: rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { top: 20px; transform: rotate(-45deg); }
@media (max-width: 980px) {
  .burger { display: block; }
  .nav-links {
    position: fixed; inset: 60px 0 auto 0; flex-direction: column; gap: 2px;
    background: var(--card); border-bottom: 1px solid var(--line);
    padding: 14px 16px 20px; align-items: stretch;
    transform: translateY(-130%); transition: transform .3s ease; z-index: 49;
    box-shadow: var(--sh-md);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 14px 16px; font-size: 16px; border-bottom: 1px solid var(--line); }
  .nav-links a:last-child { border-bottom: none; }
}

/* ── Header ── */
header { padding: 48px 0 36px; position: relative; }
section { scroll-margin-top: 76px; margin: 0 0 52px; }
#evol-sec { scroll-margin-top: 76px; }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--blue-lt); color: var(--accent);
  border: 1px solid var(--accent);
  padding: 5px 14px; border-radius: 100px;
  font-size: 12.5px; font-weight: 600; margin-bottom: 22px;
}
.badge .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
header h1 {
  font-size: clamp(30px, 5.5vw, 56px);
  font-weight: 800; max-width: 20ch; margin-bottom: 16px;
}
header h1 em { font-style: italic; color: var(--accent); }
header p.lead {
  font-size: clamp(15px, 2vw, 18px); color: var(--mut);
  max-width: 60ch; line-height: 1.65;
}
.src { margin-top: 20px; font-size: 13px; color: var(--dim); display: flex; gap: 18px; flex-wrap: wrap; }
.src b { color: var(--txt); font-weight: 600; }

/* ── Controls ── */
.controls {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start;
  margin: 8px 0 28px; padding: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--sh-sm);
  flex-direction: column;
}
@media (min-width: 600px) {
  .controls { flex-direction: row; align-items: flex-end; padding: 20px 24px; gap: 20px; }
}
.ctrl { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ctrl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ctrl label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--dim); font-weight: 700;
}
.hz-hint { display: none; }
.tooltip-wrap { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.tooltip-wrap .tip-icon {
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--bg2); border: 1px solid var(--line);
  color: var(--dim); font-size: 10px; font-family: var(--f-mono);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: default; flex-shrink: 0; line-height: 1; transition: .15s; font-style: normal;
}
.tooltip-wrap:hover .tip-icon,
.tooltip-wrap:focus-within .tip-icon { color: var(--accent); border-color: var(--accent); }
.tooltip-wrap .tip-box {
  position: absolute; bottom: calc(100% + 8px); left: 0; width: 240px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 12.5px; color: var(--txt); line-height: 1.55;
  pointer-events: none; opacity: 0; transform: translateY(4px); transition: .18s; z-index: 99;
  font-family: var(--f-body); text-transform: none; letter-spacing: 0; font-weight: 400;
  box-shadow: var(--sh-md);
}
.tooltip-wrap:hover .tip-box,
.tooltip-wrap:focus-within .tip-box { opacity: 1; transform: translateY(0); }
.tooltip-wrap .tip-box b { color: var(--accent); }

.seg {
  display: flex; flex-wrap: wrap;
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: 10px; padding: 3px; gap: 2px;
}
.seg button {
  background: none; border: none; color: var(--mut);
  font-family: var(--f-body); font-size: 13px; font-weight: 500;
  padding: 8px 13px; border-radius: 8px; cursor: pointer; transition: .15s;
  flex: 1; min-width: fit-content; white-space: nowrap;
}
.seg button:hover { color: var(--txt); background: var(--card); }
.seg button.on {
  background: var(--accent); color: #fff; font-weight: 600;
  box-shadow: 0 1px 4px rgba(22,72,200,.25);
}
.seg.alt button.on { background: var(--accent2); color: #fff; }
.fondo-pick { width: 100%; flex-basis: 100%; }
.fondos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.fondo-btn {
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: 11px; padding: 10px 12px; cursor: pointer; transition: .15s; text-align: left;
  min-width: 0; overflow: hidden;
}
.fondo-btn:hover { border-color: var(--accent2); }
.fondo-btn.on { border-color: var(--accent); background: var(--blue-lt); }
.fondo-btn .ft { font-weight: 600; font-size: 14px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fondo-btn .fd { font-size: 11px; color: var(--dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fondo-btn.on .ft { color: var(--accent); }

/* ── Section header ── */
.sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.sec-head h2 { font-size: clamp(20px, 3vw, 28px); font-weight: 700; }
.sec-num { font-family: var(--f-mono); font-size: 13px; color: var(--accent); font-weight: 500; }
.sec-sub { color: var(--mut); font-size: 15px; margin-bottom: 22px; max-width: 65ch; line-height: 1.6; }

/* ── Cards ── */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 20px;
}
@media (min-width: 640px) { .cards { grid-template-columns: repeat(4, 1fr); gap: 12px; } }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; position: relative; overflow: hidden;
  transition: box-shadow .18s, transform .18s;
  box-shadow: var(--sh-sm); min-width: 0;
}
@media (min-width: 480px) { .card { padding: 18px; } }
.card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.card .afp-name {
  font-weight: 700; font-size: 14px; display: flex; align-items: center;
  gap: 8px; margin-bottom: 12px;
}
.card .swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.card .val {
  font-family: var(--f-display);
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 800; line-height: 1; color: var(--txt);
}
.card .val .pct { font-size: 20px; color: var(--mut); font-weight: 600; }
.card .sub { font-size: 12px; color: var(--dim); margin-top: 8px; font-weight: 500; }
.card.winner {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--sh-md);
}
.card.winner::after {
  content: '★ Mayor'; position: absolute; top: 10px; right: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: .05em;
  color: var(--accent); background: var(--blue-lt); padding: 3px 8px; border-radius: 6px;
}
.card .val.neg { color: var(--pro); }

/* ── Chart ── */
.chart-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px; box-shadow: var(--sh-sm);
}
@media (min-width: 480px) { .chart-card { padding: 22px; border-radius: 16px; } }
.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 300px; }
@media (min-width: 480px) {
  .chart-box { height: 340px; }
  .chart-box.tall { height: 400px; }
}

/* ── Tabla ── */
.tbl-wrap {
  overflow-x: auto; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); box-shadow: var(--sh-sm);
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; }
th, td { padding: 12px 14px; text-align: right; }
th:first-child, td:first-child {
  text-align: left; position: sticky; left: 0; background: var(--card); z-index: 1; min-width: 90px;
}
thead th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--dim); font-weight: 700;
  border-bottom: 1px solid var(--line); background: var(--bg2); white-space: nowrap;
}
thead th:first-child { background: var(--bg2); }
tbody tr { border-bottom: 1px solid var(--line); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover td { background: var(--card2); }
tbody tr:hover td:first-child { background: var(--card2); }
td.afp-cell { font-weight: 700; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
td .swatch { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
td.num { font-family: var(--f-mono); font-size: 13px; white-space: nowrap; }
td.best { color: var(--accent); font-weight: 700; }
td.na { color: var(--dim); }
.prom-row td { color: var(--mut); font-style: italic; background: var(--bg2) !important; }

/* ── Perfil ── */
.profile {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px; box-shadow: var(--sh-sm);
}
.age-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 8px; }
.age-btn {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; cursor: pointer; transition: .15s; flex: 1; min-width: 120px;
}
.age-btn:hover { border-color: var(--accent2); }
.age-btn.on { border-color: var(--accent); background: var(--blue-lt); }
.age-btn .a { font-weight: 700; font-size: 15px; color: var(--txt); }
.age-btn .b { font-size: 12.5px; color: var(--mut); margin-top: 3px; }
.age-btn.on .a { color: var(--accent); }
.result {
  margin-top: 20px; padding: 20px; background: var(--card2);
  border: 1px solid var(--accent); border-radius: 14px; display: none;
}
.result.show { display: block; animation: fade .4s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.result .r-fund {
  font-size: 12px; color: var(--accent); text-transform: uppercase;
  letter-spacing: .08em; font-weight: 700;
}
.result .r-main { font-family: var(--f-display); font-size: 24px; margin: 8px 0; font-weight: 700; }
.result .r-main b { color: var(--accent); }
.result .r-detail { color: var(--mut); font-size: 14px; }

/* ── FAQ ── */
.faq-grid { display: flex; flex-direction: column; gap: 8px; }
.faq-cat {
  font-family: var(--f-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--dim); margin: 18px 0 4px; font-weight: 500;
}
.faq-cat:first-child { margin-top: 0; }
.faq-item {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; transition: border-color .18s;
  box-shadow: var(--sh-sm);
}
.faq-item.open { border-color: var(--accent); }
.faq-q {
  width: 100%; background: none; border: none; color: var(--txt);
  font-family: var(--f-body); font-size: 15px; font-weight: 500;
  text-align: left; padding: 16px 20px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; line-height: 1.4; transition: color .15s;
}
.faq-q:hover { color: var(--accent); }
.faq-ico { flex-shrink: 0; width: 22px; height: 22px; position: relative; transition: transform .25s; }
.faq-item.open .faq-ico { transform: rotate(45deg); }
.faq-ico::before, .faq-ico::after { content: ''; position: absolute; background: var(--mut); border-radius: 2px; }
.faq-ico::before { top: 10px; left: 3px; right: 3px; height: 2px; }
.faq-ico::after { left: 10px; top: 3px; bottom: 3px; width: 2px; }
.faq-item.open .faq-ico::before,
.faq-item.open .faq-ico::after { background: var(--accent); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a-inner { padding: 0 20px 18px; color: var(--mut); font-size: 14.5px; line-height: 1.7; }
.faq-a-inner p { margin-bottom: 10px; }
.faq-a-inner p:last-child { margin-bottom: 0; }
.faq-a-inner b { color: var(--txt); font-weight: 600; }
.faq-a-inner .hl { color: var(--accent); font-weight: 600; }
.faq-a-inner .ex {
  background: var(--bg2); border-left: 2px solid var(--accent2);
  border-radius: 0 8px 8px 0; padding: 11px 15px; margin: 10px 0; font-size: 13.5px;
}
.faq-a-inner .caveat { font-style: italic; color: var(--dim); font-size: 13px; margin-top: 8px; }

/* ── AFP fichas ── */
.afp-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (min-width: 680px) { .afp-grid { grid-template-columns: repeat(4, 1fr); } }
.afp-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; position: relative;
  overflow: hidden; transition: box-shadow .18s, transform .18s;
  box-shadow: var(--sh-sm); min-width: 0;
}
@media (min-width: 480px) { .afp-card { padding: 20px; border-radius: 16px; } }
.afp-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.afp-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 4px; background: var(--ac);
}
.afp-card h3 {
  font-size: clamp(15px, 3.5vw, 20px); font-weight: 700;
  margin-bottom: 2px; display: flex; align-items: center; gap: 8px;
}
.afp-card h3 .dot { width: 12px; height: 12px; border-radius: 3px; background: var(--ac); flex-shrink: 0; }
.afp-card .since { font-size: 11.5px; color: var(--dim); margin-bottom: 14px; }
.afp-rows { display: flex; flex-direction: column; gap: 0; margin-bottom: 14px; }
.afp-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--line);
}
.afp-row:last-child { border-bottom: none; padding-bottom: 0; }
.afp-row .fname { color: var(--mut); font-size: 12px; }
.afp-row .fval { font-family: var(--f-mono); font-size: 13px; font-weight: 500; color: var(--txt); white-space: nowrap; }
.afp-row .fval.na { color: var(--dim); }
.afp-row.lead .fval { color: var(--ac); font-weight: 700; }
.afp-row.lead .fname::after { content: ' ★'; color: var(--ac); font-size: 10px; }
.afp-card .afp-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--mut); text-decoration: none; transition: .15s;
}
.afp-card .afp-link:hover { color: var(--ac); }
.afp-card .afp-link::after { content: '↗'; font-size: 11px; }

/* ── Comisiones ── */
.com-cols { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 16px; }
@media (min-width: 600px) { .com-cols { grid-template-columns: 1fr 1fr; } }
.com-col {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px; position: relative; box-shadow: var(--sh-sm);
}
.com-col .com-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.com-col h3 { font-size: 17px; font-weight: 700; }
.com-col .com-tag {
  font-family: var(--f-mono); font-size: 11px; color: var(--accent2);
  border: 1px solid var(--accent2); border-radius: 6px; padding: 2px 8px; white-space: nowrap;
}
.com-col .com-desc { font-size: 13px; color: var(--mut); margin-bottom: 16px; line-height: 1.5; }
.com-bars { display: flex; flex-direction: column; gap: 12px; }
.com-bar { display: grid; grid-template-columns: 72px 1fr 50px; align-items: center; gap: 8px; min-width: 0; }
.com-bar .cb-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; }
.com-bar .cb-name .sw { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.com-bar .cb-track { height: 9px; background: var(--bg2); border-radius: 5px; overflow: hidden; }
.com-bar .cb-fill { height: 100%; border-radius: 5px; transition: width .5s ease; }
.com-bar .cb-val { font-family: var(--f-mono); font-size: 13px; text-align: right; font-weight: 500; }
.com-bar.low .cb-val { color: var(--accent); font-weight: 700; }
.com-bar.low .cb-name::after { content: ' ↓'; color: var(--accent); font-size: 11px; }
.com-bar.prom { opacity: .65; font-style: italic; }
.com-note {
  background: var(--blue-lt); border: 1px solid var(--line);
  border-left: 3px solid var(--accent2); border-radius: 0 14px 14px 0; padding: 16px 20px;
}
.com-note h4 { font-size: 14px; margin-bottom: 8px; color: var(--txt); font-weight: 700; }
.com-note p { font-size: 13.5px; color: var(--mut); line-height: 1.6; margin-bottom: 6px; }
.com-note p:last-child { margin-bottom: 0; }
.com-note b { color: var(--txt); }

/* ── Desglose descuento ── */
.com-extra { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 16px; }
@media (min-width: 600px) { .com-extra { grid-template-columns: 1fr 1fr; } }
.breakdown {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px; box-shadow: var(--sh-sm);
}
.breakdown h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.breakdown .bd-sub { font-size: 12.5px; color: var(--dim); margin-bottom: 16px; }
.bd-stack {
  display: flex; height: 40px; border-radius: 9px; overflow: hidden;
  margin-bottom: 14px; border: 1px solid var(--line);
}
.bd-seg {
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; transition: .3s;
}
.bd-legend { display: flex; flex-direction: column; gap: 9px; }
.bd-leg-row { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; }
.bd-leg-row .l { display: flex; align-items: center; gap: 8px; color: var(--mut); }
.bd-leg-row .l .sw { width: 11px; height: 11px; border-radius: 3px; }
.bd-leg-row .v { font-family: var(--f-mono); font-weight: 600; color: var(--txt); }
.bd-total {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 15px; font-weight: 600;
}
.bd-total .tv { font-family: var(--f-display); font-size: 22px; color: var(--accent); font-weight: 800; }
.bd-pick {
  display: inline-flex; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 9px; padding: 3px; gap: 2px; margin-bottom: 16px;
}
.bd-pick button {
  background: none; border: none; color: var(--mut); font-family: var(--f-body);
  font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 7px; cursor: pointer; transition: .15s;
}
.bd-pick button.on { background: var(--accent); color: #fff; font-weight: 600; }
.sys-facts {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px; box-shadow: var(--sh-sm);
}
.sys-facts h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.sys-fact {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line);
}
.sys-fact:last-child { border-bottom: none; }
.sys-fact .sf-l { font-size: 13.5px; color: var(--mut); max-width: 62%; }
.sys-fact .sf-v { font-family: var(--f-mono); font-size: 15px; font-weight: 600; color: var(--txt); white-space: nowrap; }

/* ── Ranking ── */
.comp-label {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: 100px; padding: 5px 13px; font-size: 11.5px; color: var(--dim);
  margin-bottom: 16px; font-family: var(--f-mono); letter-spacing: .05em; text-transform: uppercase;
}
.comp-label::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--dim); flex-shrink: 0;
}
.rank-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
@media (min-width: 600px) { .rank-grid { grid-template-columns: 1fr 1fr; } }
.rank-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px; box-shadow: var(--sh-sm); min-width: 0;
}
.rank-card h4 {
  font-size: 11px; font-weight: 700; color: var(--dim);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px;
}
.rank-rows { display: flex; flex-direction: column; gap: 10px; }
.rank-row {
  display: grid; grid-template-columns: 22px 80px 1fr 64px;
  align-items: center; gap: 8px; font-size: 13px; min-width: 0;
}
.rank-pos { font-family: var(--f-mono); font-size: 12px; color: var(--dim); font-weight: 500; }
.rank-pos.p1 { color: var(--accent); font-weight: 700; }
.rank-pos.p2 { color: var(--mut); }
.rank-afp { display: flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; overflow: hidden; }
.rank-afp .sw { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.rank-bar-wrap { height: 8px; background: var(--bg2); border-radius: 4px; overflow: hidden; min-width: 0; }
.rank-bar { height: 100%; border-radius: 4px; opacity: .7; }
.rank-val { font-family: var(--f-mono); font-size: 12px; color: var(--mut); text-align: right; white-space: nowrap; }
.rank-note {
  background: var(--bg2); border: 1px solid var(--line);
  border-left: 2px solid var(--dim); border-radius: 0 10px 10px 0;
  padding: 12px 16px; font-size: 13px; color: var(--dim); line-height: 1.55; margin-top: 4px;
}
.rank-note b { color: var(--mut); }
.rank-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.rank-tab {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 9px;
  padding: 7px 14px; font-size: 13px; font-weight: 500; color: var(--mut); cursor: pointer; transition: .15s;
}
.rank-tab:hover { color: var(--txt); }
.rank-tab.on { background: var(--card); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ── Notas / Footer ── */
.notes {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px 22px; margin-top: 8px; box-shadow: var(--sh-sm);
}
.notes h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--dim); margin-bottom: 12px; font-weight: 700;
}
.notes ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.notes li { font-size: 13px; color: var(--mut); padding-left: 18px; position: relative; }
.notes li::before {
  content: ''; position: absolute; left: 0; top: 8px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent2);
}
.disc { font-size: 12px; color: var(--dim); margin-top: 14px; font-style: italic; }
footer {
  padding: 44px 0 56px; color: var(--dim); font-size: 13px;
  border-top: 1px solid var(--line); margin-top: 20px;
}
.foot-cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 28px; margin-bottom: 32px; text-align: left;
}
.foot-col h5 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--txt); margin-bottom: 14px; font-weight: 700;
}
.foot-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.foot-col a {
  color: var(--mut); text-decoration: none; font-size: 13.5px;
  transition: .15s; display: inline-flex; align-items: center; gap: 6px;
}
.foot-col a:hover { color: var(--accent); }
.foot-col a::after { content: '↗'; font-size: 11px; opacity: .5; }
.foot-bottom {
  border-top: 1px solid var(--line); padding-top: 22px; text-align: center; line-height: 1.7;
}
.foot-bottom a { color: var(--mut); }
footer a { color: var(--mut); }

/* ══ Páginas internas (a-que-afp-pertenezco, consulta-cuspp y las que se creen) ══
   Estructura: <div class="wrap"> topbar + <main class="page"> crumbs + article </main> + footer </div>
   Usan los mismos tokens, topbar y footer que la home. Todo va bajo .page para no chocar con la home.
   Al cambiar este archivo, subir el número de ?v= en el <link> de las páginas .html. */
.nav-links a.current { color: var(--accent); }
.page { max-width: 820px; margin: 0 auto; padding-bottom: 24px; }
.page .crumbs { font-size: 13px; color: var(--dim); margin: 32px 0 14px; }
.page .crumbs a { color: var(--mut); text-decoration: none; }
.page .crumbs a:hover { color: var(--accent); }
.page .crumbs span { margin: 0 6px; }
.page h1 { font-size: clamp(30px, 5vw, 44px); font-weight: 700; margin-bottom: 14px; }
.page h2 { font-size: clamp(22px, 3vw, 28px); font-weight: 700; margin: 42px 0 14px; }
.page h3 { font-size: 18px; font-weight: 600; margin: 22px 0 8px; }
.page .lead { font-size: 18px; color: var(--mut); margin-bottom: 28px; max-width: 60ch; }
.page p { margin-bottom: 14px; }
.page p.muted { color: var(--mut); font-size: 15px; }
.page strong { font-weight: 600; }
.page p a, .page .cta-note a {
  color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; transition: .15s;
}
.page p a:hover, .page .cta-note a:hover { border-color: var(--accent); }

/* Tarjeta de acción (botón principal) */
.page .cta-card {
  background: linear-gradient(135deg, var(--blue-lt), var(--card) 70%);
  border: 1px solid var(--accent2); border-radius: 18px; padding: 28px; margin: 28px 0;
  text-align: center; box-shadow: var(--sh-md);
}
.page .cta-card h3 { font-size: 20px; margin: 0 0 8px; }
.page .cta-card p { color: var(--mut); font-size: 14.5px; margin-bottom: 18px; }
.page .cta-btn {
  display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--on-accent);
  font-weight: 600; text-decoration: none; padding: 13px 24px; border-radius: 11px; font-size: 15px; transition: .15s;
}
.page .cta-btn:hover { background: var(--accent2); }
.page .cta-btn::after { content: '↗'; }
.page .cta-note { margin-top: 14px; font-size: 12.5px; color: var(--mut); }
.page .cta-bridge { text-align: center; font-size: 15px; color: var(--mut); margin: -14px 0 28px; }
.page .cta-bridge a { font-weight: 600; color: var(--accent); text-decoration: none; }
.page .cta-card#consulta { margin: 18px 0 32px; padding: 26px 24px; }
.page .cta-card#consulta .cta-btn { font-size: 16.5px; padding: 15px 28px; }
.page .cta-card .mini-grid { margin: 18px 0 6px; text-align: left; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* Pasos numerados */
.page .steps { counter-reset: s; margin: 18px 0; }
.page .step {
  display: grid; grid-template-columns: 42px 1fr; gap: 16px; padding: 20px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; counter-increment: s; box-shadow: var(--sh-sm);
}
.page .step::before { content: counter(s); font-family: var(--f-display); font-size: 26px; font-weight: 700; color: var(--accent); line-height: 1; }
.page .step h3 { font-size: 16px; margin: 0 0 6px; }
.page .step p { margin: 0; font-size: 14.5px; color: var(--mut); }

/* Mini tarjetas de las AFP (colores = tokens de la home) */
.page .mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 18px 0; }
.page .mini-afp {
  display: block; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--ac);
  border-radius: 12px; padding: 16px; text-decoration: none; transition: .15s; box-shadow: var(--sh-sm);
}
.page .mini-afp:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.page .mini-afp .n { font-weight: 600; color: var(--txt); font-size: 15px; margin-bottom: 4px; }
.page .mini-afp .l { font-size: 12px; color: var(--mut); }
.page .mini-afp .l::after { content: ' ↗'; opacity: .6; }

/* Aviso / respuesta rápida */
.page .callout {
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 0 14px 14px 0; padding: 18px 22px; margin: 18px 0; box-shadow: var(--sh-sm);
}
.page .callout h3 {
  font-family: var(--f-body); font-size: 13px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent); margin: 0 0 10px; font-weight: 700;
}
.page .callout p { font-size: 14.5px; color: var(--mut); margin-bottom: 8px; }
.page .callout p:last-child { margin-bottom: 0; }
.page .callout.answer { margin: 0 0 22px; }
.page .callout.answer p { color: var(--txt); font-size: 15.5px; }

/* Tarjeta de enlace interno */
.page .next-card {
  display: flex; align-items: center; gap: 18px; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 24px; margin-top: 32px; text-decoration: none; transition: .18s; box-shadow: var(--sh-sm);
}
.page .next-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--sh-md); }
.page .next-card .nc-l { flex: 1; }
.page .next-card .nc-tag { font-family: var(--f-mono); font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.page .next-card h3 { color: var(--txt); font-size: 18px; margin: 0 0 4px; }
.page .next-card p { font-size: 13.5px; color: var(--mut); margin: 0; }
.page .next-card .nc-arrow { font-size: 24px; color: var(--accent); flex-shrink: 0; }

@media (max-width: 600px) {
  .page .crumbs { margin: 18px 0 10px; }
  .page h1 { margin-bottom: 10px; }
  .page .lead { font-size: 16px; margin-bottom: 16px; }
  .page .cta-card#consulta { margin: 14px 0 26px; padding: 22px 16px; }
  .page .cta-card#consulta .cta-btn { display: flex; justify-content: center; width: 100%; }
}

/* ── Responsive extras ── */
@media (max-width: 600px) {
  header { padding: 36px 0 24px; }
  .chart-box { height: 240px; }
  .chart-box.tall { height: 280px; }
}
