:root {
  --fondo: #F6F6F3; --tarjeta: #FFFFFF; --tinta: #16181D; --tinta2: #3A3F48; --gris: #5B606A; --gris2: #9A9EA6;
  --linea: #E3E4E0; --linea2: #D5D7D2; --suave: #F0F0EC; --suave2: #EEEEE9; --campo: #FAFAF8; --activo: #EEF2F9;
  --favor: #1D5FBF; --favor-bg: #E6EEFA; --favor-fg: #174C99;
  --contra: #D2601A; --contra-bg: #FBEFE5; --contra-fg: #9A4510;
  --abst: #8A8F98; --abst-bg: #F0F0EC; --abst-fg: #3A3F48;
  --ausente: #B9BCC2; --enlace: #174C99;
  --titulos: 'Space Grotesk', Inter, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); color: var(--tinta); font-family: Inter, system-ui, sans-serif; font-size: 16px; line-height: 1.45; }
a { color: var(--enlace); } a:hover { color: #0F3670; }
h1, h2, h3 { font-family: var(--titulos); margin: 0; line-height: 1.15; }
h1 { font-size: clamp(28px, 5vw, 40px); } h2 { font-size: 24px; } h3 { font-size: 16px; }
p { margin: 0; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Cabecera ---------- */
.cabecera { background: var(--tarjeta); border-bottom: 1px solid var(--linea); }
.cabecera .ancho { padding-top: 16px; padding-bottom: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tinta); }
.marca span { font-family: var(--titulos); font-weight: 700; font-size: 20px; }
.menu { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.menu a { padding: 10px 12px; border-radius: 8px; color: var(--tinta2); text-decoration: none; }
.menu a[aria-current] { background: var(--activo); color: var(--enlace); font-weight: 600; }
.buscador { display: flex; align-items: center; gap: 8px; border: 1px solid var(--linea2); border-radius: 10px; padding: 0 12px; height: 44px; background: var(--campo); flex: 0 1 260px; min-width: 180px; }
.buscador input { border: 0; background: transparent; font: inherit; font-size: 14px; outline: none; width: 100%; color: var(--tinta); }
.buscador:focus-within { border-color: var(--favor); box-shadow: 0 0 0 3px var(--favor-bg); }

.ancho { max-width: 1180px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
main.ancho { padding-top: 36px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 40px; }
@media (max-width: 640px) {
  .ancho { padding-left: 16px; padding-right: 16px; }
  main.ancho { padding-top: 24px; gap: 28px; }
  .buscador { flex: 1 1 100%; }
  .menu a { padding: 8px 10px; }
}

/* ---------- Bloques genéricos ---------- */
.seccion { display: flex; flex-direction: column; gap: 18px; }
.caja { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (max-width: 640px) { .caja { padding: 20px; border-radius: 14px; } }
.fila { display: flex; flex-wrap: wrap; gap: 32px; }
.fila > .principal { flex: 999 1 560px; min-width: 0; }
.fila > .lateral { flex: 1 1 320px; min-width: 0; }
.bajada { font-size: 15px; color: var(--gris); margin-top: 6px; }
.antetitulo { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gris); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--gris); }
.migas { font-size: 14px; color: var(--gris); display: flex; flex-wrap: wrap; gap: 6px; }
.aviso-demo { background: #FFF6D6; border: 1px solid #E9D48A; color: #5E4A00; border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.vacio { color: var(--gris); font-size: 15px; padding: 12px 0; }

.etiqueta { display: inline-block; font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--suave); color: var(--tinta2); }
.etiqueta.chica { font-size: 12px; padding: 4px 8px; border-radius: 6px; }
.etiqueta.tema { font-weight: 500; }
.v-A { background: var(--favor-bg); color: var(--favor-fg); }
.v-N { background: var(--contra-bg); color: var(--contra-fg); }
.v-B { background: var(--abst-bg); color: var(--abst-fg); }
.v-U { background: var(--fondo); color: var(--gris); border: 1px dashed var(--ausente); }
.v-P { background: var(--suave2); color: var(--tinta); }

.boton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; font: inherit; font-weight: 600; padding: 11px 17px; border-radius: 10px; border: 1px solid var(--linea2); background: var(--tarjeta); color: var(--tinta); text-decoration: none; cursor: pointer; }
.boton.oscuro { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.boton:hover { border-color: var(--tinta2); color: var(--tinta); } .boton.oscuro:hover { background: #2A2D35; color: #fff; }
.botones { display: flex; flex-wrap: wrap; gap: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 8px 12px; min-height: 40px; border-radius: 999px; border: 1px solid var(--linea2); background: var(--tarjeta); color: var(--tinta); display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.chip[aria-pressed="true"], .chip[aria-current] { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.chip .punto { width: 10px; height: 10px; border-radius: 50%; }
.campo { display: flex; align-items: center; gap: 8px; border: 1px solid var(--linea2); border-radius: 10px; padding: 0 12px; height: 44px; background: var(--campo); max-width: 420px; width: 100%; flex: none; }
.controles .campo { flex: 1 1 260px; width: auto; }
.campo input, .campo select { border: 0; background: transparent; font: inherit; font-size: 15px; outline: none; width: 100%; color: var(--tinta); }
select.selector { font: inherit; font-size: 14px; height: 44px; border: 1px solid var(--linea2); border-radius: 10px; padding: 0 10px; background: var(--campo); color: var(--tinta); }
.controles { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Números grandes ---------- */
.cifras { display: flex; flex-wrap: wrap; gap: 12px; }
.cifra { flex: 1 1 120px; border-radius: 12px; padding: 14px 16px; background: var(--suave); }
.cifra b { display: block; font-family: var(--titulos); font-size: 32px; line-height: 1.1; }
.cifra span { font-size: 14px; font-weight: 600; }
.cifra.A { background: var(--favor-bg); color: var(--favor-fg); }
.cifra.N { background: var(--contra-bg); color: var(--contra-fg); }
.cifra.B { background: var(--abst-bg); color: var(--abst-fg); }
.cifra.U { background: var(--tarjeta); border: 1px dashed var(--ausente); color: var(--gris); padding: 13px 15px; }
.cifra.neutra { background: var(--tarjeta); border: 1px solid var(--linea); color: var(--tinta); }
.cifra.neutra span { color: var(--gris); font-weight: 500; }

/* ---------- Barras ---------- */
.barra { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: var(--suave); }
.barra.fina { height: 10px; border-radius: 5px; } .barra.mini { height: 8px; border-radius: 4px; } .barra.micro { height: 6px; border-radius: 3px; }
.barra i { display: block; min-width: 0; }
.barra .A { background: var(--favor); } .barra .N { background: var(--contra); } .barra .B { background: var(--abst); }
.barra .U { background: repeating-linear-gradient(45deg, var(--linea) 0 4px, var(--fondo) 4px 8px); }
.leyenda { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; color: var(--tinta2); }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.leyenda .A { background: var(--favor); } .leyenda .N { background: var(--contra); } .leyenda .B { background: var(--abst); }
.leyenda .U { border: 1px dashed var(--abst); width: 10px; height: 10px; } .leyenda .P { background: var(--tinta); }

.lista-bloques { display: flex; flex-direction: column; gap: 14px; }
.fila-bloque { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.fila-bloque .nombre { flex: 0 0 200px; display: flex; flex-direction: column; min-width: 0; }
.fila-bloque .nombre a, .fila-bloque .nombre b { font-weight: 600; font-size: 15px; color: var(--tinta); text-decoration: none; }
.fila-bloque .nombre small { font-size: 13px; color: var(--gris); }
.fila-bloque .barra { flex: 1 1 260px; }
@media (max-width: 640px) { .fila-bloque .nombre { flex-basis: 100%; } }

/* ---------- Tarjeta destacada ---------- */
.destacada { flex-direction: row; flex-wrap: wrap; gap: 40px; padding: 32px; }
.destacada > .texto { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.destacada > figure { flex: 1 1 340px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.destacada figcaption { font-size: 14px; font-weight: 600; color: var(--tinta2); }
.en-simple { font-size: 18px; line-height: 1.55; color: var(--tinta2); }
.en-simple strong { color: var(--tinta); }
.grilla-bancas { display: grid; grid-template-columns: repeat(19, minmax(0, 1fr)); gap: 4px; }
.grilla-bancas i { aspect-ratio: 1; border-radius: 3px; }
.grilla-bancas .A { background: var(--favor); } .grilla-bancas .N { background: var(--contra); } .grilla-bancas .B { background: var(--abst); }
.grilla-bancas .U { border: 1px dashed var(--abst); } .grilla-bancas .P { background: var(--tinta); }
@media (max-width: 640px) { .destacada { padding: 20px; gap: 28px; } .en-simple { font-size: 17px; } }

/* ---------- Personas ---------- */
.personas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.persona { display: flex; align-items: center; gap: 12px; }
.persona > a, .persona > span.cuerpo { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; text-decoration: none; color: var(--tinta); }
.persona b { font-weight: 600; font-size: 15px; }
.persona small { font-size: 13px; color: var(--gris); }
.avatar { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; background: var(--suave2); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: var(--tinta2); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Listas de votaciones ---------- */
.partes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.partes li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--suave2); }
.partes .hora { flex: 0 0 52px; font-size: 13px; color: var(--gris); }
.partes .tit { flex: 1 1 260px; font-weight: 500; font-size: 15px; color: var(--tinta); text-decoration: none; }
.partes .barra { flex: 0 0 200px; }
.partes .cuenta { flex: 0 0 84px; font-size: 14px; color: var(--tinta2); }
.partes .etiqueta { flex: 0 0 104px; text-align: center; }
@media (max-width: 640px) { .partes .barra { flex: 1 1 120px; } .partes .hora { flex-basis: auto; } }

.tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tarjeta { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--tinta); }
.tarjeta:hover { border-color: var(--linea2); box-shadow: 0 2px 10px rgba(22,24,29,.06); color: var(--tinta); }
.tarjeta .res { font-size: 12px; font-weight: 700; color: var(--favor-fg); } .tarjeta .res.N { color: var(--contra-fg); }
.tarjeta .tit { font-weight: 600; font-size: 16px; line-height: 1.35; }
.tarjeta small { font-size: 13px; color: var(--gris); }
.tarjeta .arriba { display: flex; justify-content: space-between; gap: 8px; align-items: center; }

/* ---------- Tablas ---------- */
.tabla-scroll { overflow-x: auto; }
table.tabla { width: 100%; border-collapse: collapse; font-size: 15px; }
.tabla th { text-align: left; font-size: 13px; color: var(--gris); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--linea); white-space: nowrap; }
.tabla td { padding: 10px; border-bottom: 1px solid var(--suave2); vertical-align: middle; }
.tabla td a { color: var(--tinta); text-decoration: none; font-weight: 500; } .tabla td a:hover { color: var(--enlace); text-decoration: underline; }
.tabla .der { text-align: right; }
.marca-distinto { font-size: 12px; font-weight: 600; color: var(--contra-fg); white-space: nowrap; }

/* ---------- Detalle de votación ---------- */
.hemiciclo { width: 100%; max-width: 940px; margin: 0 auto; display: block; }
.hemiciclo .banca { cursor: pointer; transition: transform .45s ease, opacity .15s; }
.hemiciclo .banca:hover circle, .hemiciclo .banca:focus circle { stroke-width: 5; }
.hemiciclo .banca:focus { outline: none; }
.hemiciclo text { font: 700 8px Inter, sans-serif; fill: var(--tinta2); pointer-events: none; }
.marcador { font-family: var(--titulos); font-weight: 700; }
.ficha { align-items: center; text-align: center; gap: 12px; padding: 24px; }
.ficha .foto { width: 112px; height: 112px; border-radius: 50%; background: var(--suave2); border: 5px solid var(--ausente); display: flex; align-items: center; justify-content: center; font-family: var(--titulos); font-size: 34px; font-weight: 700; color: var(--gris); overflow: hidden; }
.ficha .foto img { width: 100%; height: 100%; object-fit: cover; }
.ficha h2 { font-size: 22px; }
.ficha .nota { font-size: 14px; color: var(--tinta2); }
.boton-bloque { font: inherit; cursor: pointer; text-align: left; border: 0; border-radius: 8px; padding: 6px 8px; background: transparent; display: flex; flex-direction: column; gap: 5px; width: 100%; color: var(--tinta); }
.boton-bloque[aria-pressed="true"] { background: var(--activo); }
.boton-bloque:hover { background: var(--fondo); }
.boton-bloque > span:first-child { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.lista-votos { columns: 3 220px; column-gap: 24px; font-size: 14px; list-style: none; padding: 0; margin: 0; }
.lista-votos li { break-inside: avoid; padding: 4px 0; display: flex; gap: 8px; align-items: baseline; }
.lista-votos li i { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.lista-votos li a { color: var(--tinta); text-decoration: none; } .lista-votos li a:hover { text-decoration: underline; }
.lista-votos small { color: var(--gris); }

/* ---------- Estadísticas ---------- */
.ranking { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: r; }
.ranking li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 4px 12px; counter-increment: r; }
.ranking li::before { content: counter(r); font-size: 13px; color: var(--gris); font-weight: 600; }
.ranking .barra { grid-column: 2 / 4; }
.ranking a { color: var(--tinta); text-decoration: none; font-weight: 600; font-size: 15px; } .ranking a:hover { text-decoration: underline; }
.ranking small { display: block; color: var(--gris); font-size: 13px; font-weight: 400; }
.ranking li > span.num { white-space: nowrap; font-size: 14px; }
.matriz { border-collapse: separate; border-spacing: 3px; font-size: 13px; }
.matriz th { font-weight: 600; color: var(--tinta2); padding: 4px 6px; text-align: right; }
.matriz thead th { text-align: center; vertical-align: bottom; max-width: 90px; }
.matriz td { width: 64px; height: 44px; text-align: center; border-radius: 6px; font-weight: 700; }
.explicacion { font-size: 14px; color: var(--gris); }

/* ---------- Pie ---------- */
.pie { border-top: 1px solid var(--linea); background: var(--tarjeta); }
.pie .ancho { padding-top: 24px; padding-bottom: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--gris); }

/* ---------- Tu provincia ---------- */
.leyes-prov { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.leyes-prov li { display: flex; flex-direction: column; gap: 8px; padding: 16px 0; border-top: 1px solid var(--suave2); }
.leyes-prov .arriba { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.leyes-prov .tit { font-weight: 600; font-size: 16px; color: var(--tinta); text-decoration: none; flex: 1 1 260px; }
.leyes-prov .tit:hover { text-decoration: underline; }
.leyes-prov .chips a { text-decoration: none; }

/* ---------- Compartir ---------- */
.compartir { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.compartir-tit { font-size: 13px; font-weight: 600; color: var(--gris); margin-right: 2px; }
.boton-red { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--linea2);
  background: var(--tarjeta); color: var(--tinta2); font: inherit; font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer; }
.boton-red:hover { border-color: var(--tinta2); color: var(--tinta); }
.boton-red.whatsapp:hover { color: #128C4A; border-color: #128C4A; }
.boton-red:focus-visible { outline: 3px solid var(--favor-bg); outline-offset: 1px; }
@media (max-width: 640px) { .boton-red span { display: none; } .boton-red { width: 40px; height: 40px; justify-content: center; padding: 0; } .boton-red[data-accion="nativo"] span { display: inline; } .boton-red[data-accion="nativo"] { width: auto; padding: 0 14px; } }

/* Ficha de diputado: tabla de votos con marcado corto (la página pesa mucho menos) */
.votos-dip .fe { font-variant-numeric: tabular-nums; white-space: nowrap; }
.votos-dip small { display: block; color: var(--gris); font-size: 13px; }
.votos-dip i { display: inline-block; font-style: normal; font-weight: 700; font-size: 12px; padding: 4px 8px; border-radius: 6px; }
.votos-dip b { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--contra-fg); white-space: nowrap; }

/* Abanico de la sección Diputados */
.abanico .banca text { font-size: 9px; }
.abanico .banca:focus-visible circle { stroke-width: 6; }
#ab-bloques .chip { font-size: 13px; }

/* Comparar diputados */
.comp-elegir { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: start; }
.comp-vs { align-self: center; font-family: var(--titulos); font-weight: 700; color: var(--gris); }
.comp-lado { padding: 16px; gap: 12px; }
.comp-persona { display: flex; gap: 12px; align-items: center; min-height: 56px; }
.comp-persona .foto { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 50%; background: var(--suave2); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--gris); overflow: hidden; }
.comp-persona .foto img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 700px) { .comp-elegir { grid-template-columns: 1fr; } .comp-vs { justify-self: center; } }

/* Recibir novedades */
.campo-copiar { display: flex; gap: 8px; margin-top: 8px; }
.campo-copiar input { flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--linea2); border-radius: 8px; background: var(--fondo); color: var(--tinta); }
.pasos { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.comp-lado .campo { width: 100%; max-width: none; }
