/* VOTE CR · hoja de estilos
   Identidad: azul marino institucional con la franja de la bandera, tipografía editorial (Fraunces)
   para titulares e IBM Plex Sans para el texto y las cifras. Fondo claro.
   Escala de categorías: divergente azul ↔ rojo con gris neutro al centro (validada para daltonismo:
   ΔE adyacente ≥ 8,7 en deuteranopía). El color siempre va acompañado del nombre de la categoría. */

:root {
  color-scheme: light;
  --paper: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #ecf0f6;
  --surface-3: #e2e8f1;
  --ink: #0b1a31;
  --ink-2: #3f4d66;
  --muted: #5e6b83;
  --line: #dce2eb;
  --line-2: #c3cddb;
  --navy: #042956;
  --red: #bb1126;
  --link: #1e56a6;
  --focus: #2a78d6;
  --mast-muted: #b9c6dd;
  --flag-blue: #002b7f;
  --flag-red: #ce1126;

  /* Categorías (escala divergente) */
  --c-sob: #184f95;
  --c-bue: #3987e5;
  --c-reg: #898781;
  --c-def: #e34948;
  --c-cri: #9a0116;
  --t-sob: #cde2fb;
  --t-bue: #cde2fb;
  --t-reg: #e1e0d9;
  --t-def: #fad6d2;
  --t-cri: #fad6d2;

  /* Gráficos */
  --serie: #2a78d6;
  --pista: #cde2fb;
  --rejilla: #e1e6ee;
  --eje: #c3cddb;
  --pres: #184f95;
  --just: #6da7ec;
  --inj: #d03b3b;
  --bien: #006300;
  --bien-fondo: #e6f2e6;

  --sombra: 0 1px 2px rgba(11, 26, 49, .05), 0 8px 24px rgba(11, 26, 49, .07);
  --radio: 14px;
  --f-display: "Fraunces", Georgia, "Times New Roman", serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--f-body);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 650; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h3, h4 { font-family: var(--f-body); font-weight: 650; letter-spacing: 0; }
p { margin: 0 0 1em; }
code { font-family: var(--f-mono); font-size: .92em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }

.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 20px; }
@media (max-width: 480px) { .wrap { padding-inline: 16px; } }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.saltar { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--surface); color: var(--ink); padding: 10px 14px; border-radius: 8px; box-shadow: var(--sombra); }
.saltar:focus { top: 12px; }
.k { font: 600 12px/1.3 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.eyebrow { font: 600 13px/1.3 var(--f-body); letter-spacing: .06em; text-transform: uppercase; color: var(--red); margin: 0 0 10px; }
.fino { font-size: 14px; color: var(--muted); }
.lede { font-size: 19px; line-height: 1.5; color: var(--ink-2); max-width: 60ch; }
.sigla { display: inline-block; font: 600 11px/1 var(--f-mono); letter-spacing: .04em; padding: 4px 6px; border-radius: 5px; background: var(--surface-2); color: var(--ink-2); margin-right: 8px; vertical-align: 1px; }
.cat { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--ink); white-space: nowrap; }
.punto { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c-reg); flex: none; }
.punto.c-sob { background: var(--c-sob); } .punto.c-bue { background: var(--c-bue); } .punto.c-reg { background: var(--c-reg); }
.punto.c-def { background: var(--c-def); } .punto.c-cri { background: var(--c-cri); }

/* Botones y controles */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 15px/1.2 var(--f-body); text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn svg { width: 16px; height: 16px; }
.btn-pri { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-pri:hover { background: #0a3a76; border-color: #0a3a76; }
.btn-sec { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 4px 6px; color: var(--link); font: 600 13px/1 var(--f-body); cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.ext { display: inline-flex; align-items: center; gap: 4px; }
.ext svg { width: 13px; height: 13px; flex: none; }

/* Cabecera */
.mast { background: var(--navy); color: #fff; }
.mast-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; padding-block: 10px; }
.marca img { width: 150px; height: auto; }
.mast-nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.mast-nav a { color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; padding: 10px 12px; border-radius: 8px; }
.mast-nav a:hover { background: rgba(255, 255, 255, .12); }
.mast-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--flag-red); border-radius: 8px 8px 0 0; }
.mast-nav .corto { display: none; }
@media (max-width: 560px) {
  .marca img { width: 118px; }
  .mast-nav a { padding: 8px 9px; font-size: 14px; }
  .mast-nav .largo { display: none; } .mast-nav .corto { display: inline; }
}
.bandera { height: 8px; background: linear-gradient(to bottom, var(--flag-blue) 0 16.66%, #fff 16.66% 33.33%, var(--flag-red) 33.33% 66.66%, #fff 66.66% 83.33%, var(--flag-blue) 83.33%); }

/* Portada */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; padding-block: 48px 40px; }
.hero h1 { font-size: clamp(36px, 5.4vw, 60px); font-weight: 700; margin-bottom: 18px; }
.hero-datos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 26px 0; }
.hero-datos div { border-left: 3px solid var(--navy); padding: 2px 0 2px 12px; }
.hero-datos dt { font-size: 13px; color: var(--muted); font-weight: 600; }
.hero-datos dd { margin: 2px 0 0; font-weight: 650; font-size: 17px; }
.hero-datos small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); margin-top: 2px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 900px) { .hero-in { grid-template-columns: 1fr; padding-block: 32px; gap: 28px; } }
@media (max-width: 600px) { .hero-datos { grid-template-columns: 1fr; } .lede { font-size: 17px; } }

.hemi { margin: 0; }
.hemi-graf { position: relative; }
.hemi svg { width: 100%; height: auto; display: block; overflow: visible; }
.hemi .asiento { fill: var(--c-reg); stroke: var(--surface); stroke-width: 2; cursor: pointer; transition: opacity .15s, transform .15s; transform-box: fill-box; transform-origin: center; }
.hemi .asiento.c-sob { fill: var(--c-sob); } .hemi .asiento.c-bue { fill: var(--c-bue); } .hemi .asiento.c-reg { fill: var(--c-reg); }
.hemi .asiento.c-def { fill: var(--c-def); } .hemi .asiento.c-cri { fill: var(--c-cri); }
.hemi a:hover .asiento, .hemi .asiento.activo { stroke: var(--ink); stroke-width: 2.5; }
.hemi .asiento.atenuado { opacity: .16; }
.hemi .llave { fill: none; stroke: var(--line-2); stroke-width: 1.5; }
.hemi-lbl { font: 600 13px var(--f-body); fill: var(--ink-2); }
.hemi-lbl .n { font-weight: 400; fill: var(--muted); }
.hemi-centro { font: 600 54px var(--f-body); fill: var(--ink); }
.hemi-sub { font: 500 15px var(--f-body); fill: var(--muted); }
.hemi figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }
.tip { position: absolute; z-index: 5; transform: translate(-50%, calc(-100% - 12px)); background: var(--ink); color: #fff; border-radius: 10px; padding: 8px 10px; display: flex; gap: 10px; align-items: center; pointer-events: none; box-shadow: var(--sombra); width: max-content; max-width: 260px; }
.tip img { width: 40px; height: 50px; border-radius: 6px; object-fit: cover; background: #23324d; }
.tip b { display: block; font-size: 14px; line-height: 1.25; }
.tip span { display: block; font-size: 12.5px; color: #cfd8e6; }
.tip .sc { color: #fff; font-weight: 600; margin-top: 2px; }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ley-cat { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font: 500 14px var(--f-body); color: var(--ink); cursor: pointer; }
.ley-cat b { font-weight: 600; color: var(--muted); }
.ley-cat[aria-pressed="true"] { border-color: var(--ink); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--ink); }
.ley-cat[disabled] { cursor: default; }
.ver-tabla { margin-top: 10px; font-size: 14px; }
.ver-tabla summary { cursor: pointer; color: var(--link); font-weight: 600; }

.aviso { padding-block: 28px; border-bottom: 1px solid var(--line); }
.aviso-rejilla { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.aviso-rejilla p:last-child { margin: 0; color: var(--ink-2); font-size: 15px; }
@media (max-width: 800px) { .aviso-rejilla { grid-template-columns: 1fr; gap: 16px; } }
.aviso-nota, .alerta, .nota, .verif, .aviso-dinero { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: 15px; margin: 16px 0; }
.aviso-nota svg, .alerta svg, .nota svg, .verif svg, .aviso-dinero svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--navy); }
.alerta { background: #fff4e0; color: #5b3b00; }
.alerta svg { color: #8a5a00; }
.verif.ok { background: var(--bien-fondo); color: #12361a; }
.verif.ok svg { color: var(--bien); }
.verif.no { background: #fde8e7; color: #5c1010; }

/* Secciones */
.sec { padding-block: 48px; }
.sec-alt { background: var(--surface); border-top: 1px solid var(--line); }
.sec-cab { margin-bottom: 22px; }
.sec-cab h2 { font-size: clamp(28px, 3.6vw, 40px); }
.sec-lede { color: var(--ink-2); max-width: 70ch; }

/* Herramientas del ranking */
.herramientas { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); padding: 16px; box-shadow: var(--sombra); margin-bottom: 20px; position: sticky; top: 0; z-index: 10; }
.herr-fila { display: grid; grid-template-columns: minmax(200px, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 960px) { .herr-fila { grid-template-columns: 1fr 1fr; } .herr-fila .crece { grid-column: 1 / -1; } }
@media (max-width: 520px) { .herr-fila { grid-template-columns: 1fr; } .herramientas { position: static; } }
.campo { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); min-width: 0; }
.input, .select { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); font: 400 16px/1.2 var(--f-body); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%233f4d66' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 34px; }
.input:disabled, .select:disabled { background-color: var(--surface-2); }
.herr-pie { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.herr-acc { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.conteo { margin: 0; font-weight: 600; color: var(--ink-2); font-size: 15px; }
.segmentado { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; background: var(--surface-2); }
.segmentado button { min-height: 34px; padding: 6px 14px; border: 0; border-radius: 7px; background: transparent; font: 600 14px var(--f-body); color: var(--ink-2); cursor: pointer; }
.segmentado button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(11, 26, 49, .15); }
.estado-js { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.estado-js.error { color: #8a1010; font-weight: 600; }
.herramientas:not(.cargando) .estado-js:not(.error) { display: none; }

/* Tarjetas */
.dip { scroll-margin-top: 200px; }
@media (max-width: 520px) { .dip { scroll-margin-top: 16px; } }
.rejilla { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.dip-art { position: relative; height: 100%; display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); padding: 16px; box-shadow: var(--sombra); transition: border-color .15s, transform .15s, box-shadow .15s; }
.dip-art:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: 0 2px 4px rgba(11, 26, 49, .06), 0 14px 32px rgba(11, 26, 49, .1); }
.dip-art:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.dip-cab { display: grid; grid-template-columns: auto 72px minmax(0, 1fr); gap: 12px; align-items: start; }
.puesto { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; min-width: 40px; height: 40px; padding: 0 7px; border-radius: 10px; background: var(--navy); color: #fff; font: 700 17px/1 var(--f-body); position: relative; }
.puesto .emp { font-weight: 600; margin-left: 1px; color: var(--mast-muted); }
.puesto.pend { background: var(--surface-3); color: var(--muted); }
.foto { position: relative; display: block; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.foto-ini { position: absolute; inset: 0; display: grid; place-items: center; font: 600 22px var(--f-body); color: var(--muted); letter-spacing: .02em; }
.foto-pend { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 10.5px; color: var(--muted); display: none; }
.foto.sin-foto img { display: none; }
.foto.sin-foto .foto-pend { display: block; }
.dip-nombre { font-size: 18px; line-height: 1.25; margin: 0 0 4px; }
.dip-nombre a { color: var(--ink); text-decoration: none; }
.dip-nombre a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radio); }
.dip-nombre a:hover { text-decoration: underline; }
.dip-nombre a:focus-visible { outline: none; }
.dip-meta { font-size: 13.5px; color: var(--muted); margin: 0; }
.dip-punt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.dip-punt p { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.dip-total { font-size: 14px; color: var(--ink-2); }
.dip-total b { font-size: 26px; font-weight: 650; color: var(--ink); line-height: 1.05; }
.dip-vista { margin-left: auto !important; font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-align: right; }
.anillo { flex: none; }
.anillo .pista { stroke: var(--t-reg); }
.anillo .valor { stroke: var(--c-reg); }
.anillo text { font-family: var(--f-body); font-weight: 650; fill: var(--ink); }
.anillo.c-sob .pista { stroke: var(--t-sob); } .anillo.c-sob .valor { stroke: var(--c-sob); }
.anillo.c-bue .pista { stroke: var(--t-bue); } .anillo.c-bue .valor { stroke: var(--c-bue); }
.anillo.c-def .pista { stroke: var(--t-def); } .anillo.c-def .valor { stroke: var(--c-def); }
.anillo.c-cri .pista { stroke: var(--t-cri); } .anillo.c-cri .valor { stroke: var(--c-cri); }
.dip-res { font-size: 14.5px; color: var(--ink-2); margin: 0; }
.dip-ind { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: auto 0 0; border-top: 1px solid var(--line); padding-top: 12px; }
.dip-ind dt { font-size: 12px; color: var(--muted); line-height: 1.3; }
.dip-ind dd { margin: 3px 0 0; font-weight: 650; font-size: 15.5px; }
.dip-ind small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.dip-mas { margin: 0; display: inline-flex; align-items: center; gap: 6px; color: var(--link); font-weight: 600; font-size: 14.5px; }
.dip-mas svg { width: 15px; height: 15px; }

/* Tabla del ranking */
.tabla-env { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radio); background: var(--surface); }
.tabla-rank, .tabla-datos, .tabla-mini { width: 100%; border-collapse: collapse; font-size: 15px; }
.tabla-rank caption, .tabla-datos caption { text-align: left; padding: 12px 14px; font-size: 14px; color: var(--muted); }
.tabla-rank th, .tabla-rank td, .tabla-datos th, .tabla-datos td, .tabla-mini th, .tabla-mini td { padding: 10px 12px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tabla-rank thead th, .tabla-datos thead th, .tabla-mini thead th { background: var(--surface-2); font-size: 13px; color: var(--ink-2); white-space: nowrap; border-top: 0; }
.tabla-rank thead button { background: none; border: 0; padding: 4px 0; font: 600 13px var(--f-body); color: inherit; cursor: pointer; display: inline-flex; gap: 3px; align-items: baseline; }
.tabla-rank thead button small { font-weight: 400; color: var(--muted); }
.tabla-rank th[aria-sort] button { color: var(--ink); text-decoration: underline; text-underline-offset: .25em; }
.tabla-rank th[aria-sort="descending"] button::after { content: "↓"; }
.tabla-rank th[aria-sort="ascending"] button::after { content: "↑"; }
.tabla-rank tbody th { font-weight: 600; min-width: 220px; }
.tabla-rank tbody th a { color: var(--ink); text-decoration: none; }
.tabla-rank tbody th a:hover { text-decoration: underline; }
.tabla-rank tbody tr:hover { background: #f7f9fc; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla-rank .puesto { min-width: 34px; height: 30px; font-size: 14px; border-radius: 8px; }
.tabla-rank .total b { font-size: 16px; }
.tabla-rank .de { color: var(--muted); font-size: 12.5px; }
.tabla-rank .na { color: var(--muted); font-size: 13px; }
.tabla-rank td.puesto-c { white-space: normal; text-align: left !important; min-width: 92px; max-width: 130px; }
.t-vista { display: block; font-size: 11.5px; line-height: 1.3; color: var(--muted); margin-top: 3px; }
.tabla-mini { font-size: 13.5px; }
.tabla-mini th, .tabla-mini td { padding: 6px 8px; }

.vacio { text-align: center; padding: 40px 16px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radio); }

/* Componentes en portada */
.comp-rejilla { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: 20fr 30fr 25fr 25fr; gap: 12px; }
@media (max-width: 900px) { .comp-rejilla { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .comp-rejilla { grid-template-columns: 1fr; } }
.comp { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radio); padding: 16px; border-top: 4px solid var(--navy); }
.comp-pts { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.comp-pts b { font-size: 30px; color: var(--ink); font-weight: 650; margin-right: 4px; }
.comp h3 { font-size: 17px; }
.comp p:last-child { margin: 0; font-size: 14.5px; color: var(--ink-2); }

/* Pie */
.pie { background: var(--surface); border-top: 1px solid var(--line); padding-block: 36px; margin-top: 0; }
.pie-in { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 28px; font-size: 14.5px; color: var(--ink-2); }
@media (max-width: 800px) { .pie-in { grid-template-columns: 1fr; } }
.pie-logo { width: 150px; height: auto; margin-bottom: 12px; }
.pie-enlaces, .contacto { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }

/* Perfil */
.migas { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding-block: 16px; font-size: 14.5px; }
.migas .volver { font-weight: 600; }
.migas-puesto { color: var(--muted); font-weight: 600; }
.migas-pag { display: flex; gap: 14px; }
.migas-pag .deshab { color: var(--line-2); }
.perfil-cab { display: grid; grid-template-columns: 220px minmax(0, 1fr) minmax(280px, 360px); gap: 28px; align-items: start; padding-bottom: 28px; }
@media (max-width: 1080px) { .perfil-cab { grid-template-columns: 200px minmax(0, 1fr); } .perfil-punt { grid-column: 1 / -1; } }
@media (max-width: 640px) { .perfil-cab { grid-template-columns: 1fr; } .perfil-foto { max-width: 220px; } }
.foto-grande { border-radius: var(--radio); box-shadow: var(--sombra); }
.foto-grande .foto-ini { font-size: 48px; }
.credito { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.perfil-id h1 { font-size: clamp(32px, 4.4vw, 48px); margin-bottom: 8px; }
.cargo { font-weight: 600; color: var(--ink-2); font-size: 17px; }
.presentacion { color: var(--ink-2); }
.resumen { font-size: 15.5px; border-left: 3px solid var(--line-2); padding-left: 12px; color: var(--ink-2); }
.acciones { display: flex; flex-wrap: wrap; gap: 10px; }
.perfil-punt { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); padding: 18px; box-shadow: var(--sombra); }
.punt-fila { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.punt-num { margin: 0 0 4px; font-size: 16px; color: var(--ink-2); }
.punt-num b { font-size: 40px; font-weight: 650; color: var(--ink); line-height: 1; margin-right: 2px; }
.punt-puesto { margin: 6px 0 0; font-size: 14px; color: var(--muted); font-weight: 600; }
.punt-nota { font-size: 13px; color: var(--muted); margin: 12px 0 8px; }
.punt-enlace { font-weight: 600; font-size: 14.5px; }
.cbarras { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.cbar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 14px; }
.cbar-lbl { color: var(--ink-2); }
.cbar-val { color: var(--muted); font-variant-numeric: tabular-nums; }
.cbar-val b { color: var(--ink); font-weight: 650; }
.medidor { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--pista); overflow: hidden; }
.medidor i { display: block; height: 100%; border-radius: 999px; background: var(--serie); }
.medidor.medidor-na { background: var(--surface-3); }
.nota-comp { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }

.perfil-cuerpo { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 32px; padding-bottom: 48px; }
@media (max-width: 900px) { .perfil-cuerpo { grid-template-columns: 1fr; } .toc { position: static !important; } }
.toc { position: sticky; top: 16px; align-self: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); padding: 14px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 14.5px; }
.toc a:hover { background: var(--surface-2); }
.toc a.activo { background: var(--surface-2); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--navy); }
@media (max-width: 900px) { .toc ol { display: flex; flex-wrap: wrap; gap: 6px; } .toc a { border: 1px solid var(--line); } }
.perfil-main { min-width: 0; }
.p-sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); padding: 24px; margin-bottom: 20px; box-shadow: var(--sombra); scroll-margin-top: 16px; }
@media (max-width: 520px) { .p-sec { padding: 18px 16px; } }
.p-sec > h2 { font-size: clamp(24px, 3vw, 30px); }
.sec-sub { color: var(--muted); margin-top: -4px; }
.h-sub { font-size: 18px; margin: 26px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.s60 { display: grid; gap: 0; margin: 0; }
.s60 div { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.s60 div:first-child { border-top: 0; }
.s60 dt { font-weight: 600; color: var(--ink-2); }
.s60 dd { margin: 0; }
@media (max-width: 640px) { .s60 div { grid-template-columns: 1fr; gap: 2px; } }

.calc-rejilla { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 1000px) { .calc-rejilla { grid-template-columns: 1fr; } }
.calc { width: 100%; border-collapse: collapse; font-size: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.calc caption { text-align: left; font-weight: 650; font-size: 15px; padding: 0 0 8px; }
.calc th, .calc td { padding: 8px 10px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.calc tbody th { width: 34%; font-weight: 600; color: var(--ink-2); }
.calc tfoot th, .calc tfoot td { background: var(--surface-2); font-weight: 600; }
.calc tfoot td:not(.num) { font-weight: 400; color: var(--muted); font-size: 13px; }
.suma { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-variant-numeric: tabular-nums; background: var(--paper); border-radius: 10px; padding: 12px 14px; margin: 16px 0; }
.suma .k { margin: 0 8px 0 0; }

.leyenda-a { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; color: var(--ink-2); }
.leyenda-a li, .a-cifras li { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
.sw.pres { background: var(--pres); } .sw.just { background: var(--just); } .sw.inj { background: var(--inj); }
.a-lista { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.a-fila { border-top: 1px solid var(--line); padding-top: 14px; }
.a-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.a-cab h3 { font-size: 16.5px; margin: 0; }
.a-pct { font-size: 22px; font-weight: 650; }
.a-desc { display: block; font-size: 14px; color: var(--muted); margin: 2px 0 8px; }
.apilada { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; margin: 6px 0 8px; }
.apilada .seg { display: block; min-width: 3px; height: 100%; }
.apilada .pres { background: var(--pres); } .apilada .just { background: var(--just); } .apilada .inj { background: var(--inj); }
.a-cifras { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }
.a-tot { color: var(--muted); }
.a-texto { font-size: 13.5px; color: var(--muted); margin: 0; }

.resumen-proy { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; margin-bottom: 8px; }
.cifra { margin: 0; font-size: 17px; }
.cifra b { font-size: 30px; font-weight: 650; margin-right: 4px; }
.chips-estado { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips-estado li { background: var(--surface-2); border-radius: 999px; padding: 5px 11px; font-size: 14px; }
.proyectos { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 14px; }
.proy { border: 1px solid var(--line); border-radius: 12px; padding: 16px; scroll-margin-top: 16px; }
.proy:target { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(42, 120, 214, .2); }
.proy-cab { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }
.exp { font: 600 13px var(--f-mono); color: var(--ink); }
.estado { font-weight: 600; color: var(--ink-2); }
.estado.off { color: #8a1010; }
.proy h3 { font-size: 17px; margin-bottom: 10px; }
.etapas { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; counter-reset: etapa; }
.etapas li { position: relative; font-size: 12px; color: var(--muted); padding-top: 12px; line-height: 1.25; }
.etapas li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; border-radius: 3px; background: var(--surface-3); }
.etapas li.hecho::before { background: var(--serie); }
.etapas li.actual { color: var(--ink); font-weight: 650; }
@media (max-width: 520px) { .etapas li span { display: none; } .etapas li.actual span { display: inline; white-space: nowrap; } }
.nota-etapa { font-size: 13.5px; color: var(--ink-2); background: var(--paper); border-radius: 8px; padding: 8px 10px; }
.proy-pie { font-size: 13.5px; color: var(--muted); margin: 0; }

.tally { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; background: var(--paper); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.tally p { margin: 0; }
.tally b { font-size: 20px; }
.tally-puntos { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.tally-puntos i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--bien); }
.tally-puntos i.si { background: var(--bien); }
.tally-puntos i.no { border-color: var(--muted); }
.evals { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ev { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 560px) { .ev { grid-template-columns: 1fr; } }
.ev h3 { font-size: 16px; margin-bottom: 4px; }
.ev p { margin: 0 0 6px; color: var(--ink-2); }
.insignia { display: inline-flex; align-items: center; gap: 6px; align-self: start; padding: 5px 10px; border-radius: 999px; font-size: 13.5px; font-weight: 650; white-space: nowrap; width: max-content; }
.insignia svg { width: 14px; height: 14px; }
.insignia.cumplido { background: var(--bien-fondo); color: var(--bien); }
.insignia.sin-accion { background: var(--surface-2); color: var(--ink-2); }
.ev-via { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ev-via li { font-size: 12.5px; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 9px; color: var(--ink-2); }
.ev-exp { font: 500 13px var(--f-mono); color: var(--muted); }
.nota-eval { background: var(--paper); border-radius: 12px; padding: 14px 16px; }
.nota-eval p { margin: 0; }
.lista-simple { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; }
.lista-num { padding-left: 22px; display: grid; gap: 10px; }
.meses { list-style: none; padding: 0; margin: 10px 0 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.meses li { font-size: 13.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; }
.meses .ok, .leyenda-meses .ok::before { background: var(--surface-2); color: var(--ink); }
.meses .falta { background: #fff; color: #8a1010; border: 1px dashed #d8a0a0; }
.leyenda-meses { font-size: 12.5px; color: var(--muted); display: flex; gap: 14px; }
.leyenda-meses span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--surface-3); }
.leyenda-meses .falta::before { background: #fff; border: 1px dashed #d8a0a0; }
.decls { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 12px; }
.decl { border-left: 3px solid var(--line-2); padding: 2px 0 2px 14px; }
.decl-cab { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; margin-bottom: 4px; }
.decl-cab h3, .decl-cab h4 { font-size: 15.5px; margin: 0; }
.decl p { margin: 0 0 6px; color: var(--ink-2); }
.tipo { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); }
.tipo.voto { background: #fff4e0; color: #6b4500; }
.tipo.pos { background: #eef0fb; color: #33307a; }
.tipo.prom { background: var(--bien-fondo); color: var(--bien); }
.tipo.acc { background: #e7f0fb; color: #184f95; }
.fechas { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.fechas li { font-size: 12.5px; color: var(--muted); background: var(--paper); border-radius: 6px; padding: 2px 8px; }
.tipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; margin: 0 0 8px; }
.tipos div { background: var(--paper); border-radius: 10px; padding: 10px 12px; }
.tipos dd { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); }

.aviso-dinero { background: #f1f4f9; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
@media (max-width: 900px) { .tiles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .tiles { grid-template-columns: 1fr; } }
.tiles div { background: var(--paper); border-radius: 12px; padding: 12px 14px; }
.tiles dt { font-size: 13px; color: var(--muted); font-weight: 600; }
.tiles dd { margin: 4px 0 0; font-size: 22px; font-weight: 650; }
.tiles small { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.fgraf { margin: 8px 0; }
.fgraf-t { font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.fgraf svg { width: 100%; max-width: 640px; height: auto; display: block; }
.fgraf .barra { fill: var(--serie); }
.fgraf .golpe { fill: transparent; cursor: default; }
.fgraf .golpe:hover + text, .fgraf .golpe:focus + text { font-weight: 700; }
.fgraf .golpe:focus-visible { outline: none; stroke: var(--focus); stroke-width: 2; }
.fgraf .rejilla { stroke: var(--rejilla); stroke-width: 1; }
.fgraf .base { stroke: var(--eje); stroke-width: 1; }
.fgraf .eje, .fgraf .mes { font: 12px var(--f-body); fill: var(--muted); font-variant-numeric: tabular-nums; }
.fgraf .valor { font: 600 12.5px var(--f-body); fill: var(--ink); font-variant-numeric: tabular-nums; }
.tabla-texto { font-size: 14px; color: var(--ink-2); }
.tabla-datos tbody tr:nth-child(even) { background: #fafbfd; }
.tabla-datos tfoot th, .tabla-datos tfoot td { background: var(--surface-2); font-weight: 600; }

.paginador { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
@media (max-width: 560px) { .paginador { grid-template-columns: 1fr; } }
.paginador a { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radio); background: var(--surface); text-decoration: none; color: var(--ink); }
.paginador a:hover { border-color: var(--line-2); background: #fafbfd; }
.paginador .nx { flex-direction: row-reverse; text-align: right; }
.paginador .pag-foto { width: 44px; flex: none; border-radius: 8px; }
.paginador .pag-foto .foto-ini { font-size: 14px; }
.paginador .k { display: block; margin-bottom: 2px; }
.volver-pie { text-align: center; margin-top: 20px; }

/* Documentos: metodología, directorio, 404 */
.doc { padding-block: 36px 56px; max-width: 980px; }
.doc-cab h1 { font-size: clamp(34px, 5vw, 52px); }
.doc section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); padding: 24px; margin-bottom: 18px; scroll-margin-top: 16px; }
@media (max-width: 520px) { .doc section { padding: 18px 16px; } }
.doc h2 { font-size: clamp(24px, 3vw, 30px); }
.toc-doc ol { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.toc-doc a { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; font-size: 14px; }
.regla { border: 0 !important; padding: 0 !important; margin: 0 0 14px !important; }
.regla h3 { font-size: 16.5px; margin-bottom: 4px; }
.escala { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 700px) { .escala { grid-template-columns: 1fr; } }
.escala li { background: var(--paper); border-radius: 10px; padding: 12px; display: grid; gap: 4px; border-top: 4px solid var(--c-reg); }
.escala li.c-sob { border-top-color: var(--c-sob); } .escala li.c-bue { border-top-color: var(--c-bue); }
.escala li.c-def { border-top-color: var(--c-def); } .escala li.c-cri { border-top-color: var(--c-cri); }
.escala .punto { display: none; }
.escala span { font-size: 14px; color: var(--ink-2); }
.escala .n { color: var(--muted); font-size: 13px; }
.cifra-grande { font-size: 18px; }
.cifra-grande b { font-size: 34px; font-weight: 650; margin-right: 4px; }
.letras { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.letras a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-weight: 650; text-decoration: none; }
.dir-lista { list-style: none; padding: 0; margin: 0; display: grid; }
.dir-lista li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.dir-lista li:first-child { border-top: 0; }
.dir-lista .dir-puesto { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.dir-punt { display: inline-flex; gap: 8px; align-items: center; font-weight: 650; }
.error-404 { text-align: left; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14.5px; box-shadow: var(--sombra); z-index: 60; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .dip-art:hover { transform: none; }
}
@media print {
  .mast-nav, .herramientas, .toc, .paginador, .acciones, .hemi, .leyenda, .toast { display: none !important; }
  body { background: #fff; }
  .p-sec, .dip-art, .doc section { box-shadow: none; break-inside: avoid; }
}

/* Comprometidos con Costa Rica */
.cmp .doc-cab .fino { max-width: 70ch; }
.cmp-privacidad p { margin: 0 0 6px; }
.cmp-privacidad p:last-child { margin: 0; }
.doc .cmp-registro { background: transparent; border: 0; padding: 0; }
.cmp-registro h2, .cmp-registro .sec-lede { margin-top: 10px; text-align: center; margin-inline: auto; }
.cmp-registro .cmp-tarjeta { max-width: 680px; margin: 16px auto 0; padding: 28px 28px 24px; }
@media (max-width: 520px) { .cmp-registro .cmp-tarjeta { padding: 22px 18px 20px; } }
.cmp-tarjeta { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); box-shadow: var(--sombra); padding: 24px 22px 20px; border-top: 5px solid var(--navy); min-width: 0; }
.cmp-tarjeta h3 { font-family: var(--f-display); font-size: 24px; font-weight: 650; margin: 0 0 4px; }
.cmp-sub { margin: 0 0 16px; color: var(--ink-2); font-size: 15px; }
.cmp-form { display: grid; gap: 12px; }
.cmp-fila { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 420px) { .cmp-fila { grid-template-columns: 1fr; } }
.cmp-campo { min-width: 0; }
.cmp-form .campo { font-size: 14px; }
.cmp-form .input[aria-invalid="true"] { border-color: #b3261e; box-shadow: inset 0 0 0 1px #b3261e; }
.cmp-check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 15px; line-height: 1.45; color: var(--ink); cursor: pointer; }
.cmp-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--navy); cursor: pointer; }
.cmp-check input[aria-invalid="true"] { outline: 2px solid #b3261e; outline-offset: 1px; }
.cmp-error { margin: 4px 0 0; color: #8a1010; font-size: 13.5px; font-weight: 600; }
.cmp-trampa { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cmp-enviar { justify-content: center; width: 100%; margin-top: 4px; }
.cmp-ayuda { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
.cmp-estado { margin: 0; font-size: 15px; font-weight: 600; min-height: 1.4em; }
.cmp-estado:empty { display: none; }
.cmp-estado.ok { color: var(--bien); }
.cmp-estado.error { color: #8a1010; }
.cmp-estado.info { color: var(--navy); }
.enviando .cmp-enviar { cursor: progress; }
.doc .cmp-contador { margin-top: 26px; text-align: center; background: var(--navy); color: #fff; border: 0; padding: 32px 24px; position: relative; overflow: hidden; }
.cmp-contador::after { content: ""; position: absolute; inset: auto 0 0 0; height: 6px; background: linear-gradient(to bottom, var(--flag-blue) 0 16.66%, #fff 16.66% 33.33%, var(--flag-red) 33.33% 66.66%, #fff 66.66% 83.33%, var(--flag-blue) 83.33%); }
.cmp-cifra { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cmp-cifra-txt { font-size: 18px; font-weight: 600; color: var(--mast-muted); }
.cmp-cifra b { font: 700 clamp(52px, 9vw, 84px)/1 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cmp-cifra.sin-dato b { color: var(--mast-muted); }
.cmp-contador .fino { color: var(--mast-muted); margin: 10px auto 0; max-width: 62ch; }
.cmp-contador .cmp-cifra-estado { margin-top: 8px; font-size: 13px; }
mark.pendiente { background: #fff4e0; color: #5b3b00; padding: 1px 5px; border-radius: 4px; font-weight: 600; }
