:root {
  --si: #2e9d4f; --no: #d64545; --ab: #f0b429; --nv: #cfd4da; --div: #8e6bbf; --aus: #e9ecef;
  --fg: #1f2328; --muted: #5f6b76; --line: #e3e6ea; --bg: #ffffff; --soft: #f6f8fa; --accent: #0b5cad;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--fg); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header.top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; padding: .7rem 1.25rem; border-bottom: 1px solid var(--line); background: var(--soft); }
header.top .logo { font-weight: 700; font-size: 1.15rem; color: var(--fg); }
header.top nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
header.top nav a { color: var(--fg); }
header.top select { margin-left: auto; }
main { max-width: 1180px; margin: 0 auto; padding: 1rem 1.25rem 3rem; }
footer { border-top: 1px solid var(--line); padding: 1rem 1.25rem; color: var(--muted); font-size: .85rem; text-align: center; }
h1 { font-size: 1.45rem; line-height: 1.3; margin: .4rem 0 .6rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 .6rem; padding-bottom: .25rem; border-bottom: 1px solid var(--line); }
h3 { font-size: 1rem; margin: 1.2rem 0 .4rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.crumbs { font-size: .85rem; color: var(--muted); }
.note { background: #fff8e1; border: 1px solid #f3e0a0; padding: .6rem .8rem; border-radius: 6px; font-size: .9rem; }
.info { background: var(--soft); border: 1px solid var(--line); padding: .6rem .8rem; border-radius: 6px; font-size: .9rem; }

table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--soft); font-weight: 600; white-space: nowrap; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.sortable th { cursor: pointer; }
table.sortable th.asc::after { content: " ▲"; font-size: .7em; }
table.sortable th.desc::after { content: " ▼"; font-size: .7em; }
.scroll { overflow-x: auto; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: 1rem 0; }
.kpi { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; }
.kpi b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: .8rem; }

.barra { display: flex; height: 14px; border-radius: 3px; overflow: hidden; background: var(--aus); min-width: 120px; }
.barra.grande { height: 26px; }
.barra span { display: block; height: 100%; }
.b-si { background: var(--si); } .b-no { background: var(--no); } .b-abstencion { background: var(--ab); }
.b-no_vota { background: var(--nv); } .b-dividido { background: var(--div); } .b-ausente { background: var(--aus); }
.leyenda { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .8rem; color: var(--muted); margin: .3rem 0; }
.leyenda i { display: inline-block; width: .8em; height: .8em; border-radius: 2px; margin-right: .3em; vertical-align: -1px; }

.badge { display: inline-block; padding: .05rem .45rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; color: #fff; background: #777; }
.pos-si, .res-aprobada { background: var(--si); }
.pos-no, .res-rechazada { background: var(--no); }
.pos-abstencion { background: var(--ab); color: #3a2a00; }
.pos-dividido { background: var(--div); }
.pos-ausente, .pos-no_vota { background: var(--nv); color: #333; }
.res-empate { background: #6c757d; }
.chip { display: inline-block; width: .75em; height: .75em; border-radius: 50%; margin-right: .35em; vertical-align: 0; }
.grupo-tag { white-space: nowrap; }

.votacion-item { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.votacion-item .t { font-weight: 500; }
.mini-pos { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .3rem; }
.mini-pos span { font-size: .72rem; padding: .02rem .35rem; border-radius: 3px; border-left: 4px solid #999; background: var(--soft); }
.mini-pos span.p-si { background: #e3f4e8; } .mini-pos span.p-no { background: #fbe4e4; }
.mini-pos span.p-abstencion { background: #fdf3d7; } .mini-pos span.p-dividido { background: #eee5f7; }

.hemiciclo { max-width: 620px; margin: .5rem auto; }
.hemiciclo svg { width: 100%; height: auto; display: block; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; }
.toolbar input[type=search] { min-width: 240px; padding: .3rem .5rem; }
.toolbar select, .toolbar button { padding: .25rem .4rem; }
.pager { display: flex; gap: .5rem; align-items: center; margin: .6rem 0; }

.heat td { text-align: center; font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 0 2rem; }
dl.ficha { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; margin: .5rem 0; }
dl.ficha dt { color: var(--muted); }
dl.ficha dd { margin: 0; }
details summary { cursor: pointer; }
@media (max-width: 640px) { .hide-sm { display: none; } }
.que-se-vota { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: .7rem .9rem; margin: 1rem 0; background: #fbfcfe; }
.que-se-vota .propuesta { font-size: 1.05rem; margin: .4rem 0 .6rem; }
.que-se-vota .sino > div { margin: .2rem 0; }
blockquote { margin: .4rem 0; padding: .4rem .8rem; border-left: 3px solid var(--line); color: #333; background: var(--soft); white-space: pre-line; font-size: .9rem; }
blockquote.texto-oficial { max-height: 22rem; overflow-y: auto; }
.prop-tabla td.p { min-width: 260px; }
.prop-tabla td.c, .prop-tabla th.c { text-align: center; padding: .25rem .2rem; white-space: nowrap; }
.cel { display: inline-block; min-width: 1.6rem; padding: .05rem .25rem; border-radius: 3px; font-size: .72rem; font-weight: 700; color: #fff; }
.cel.si { background: var(--si); } .cel.no { background: var(--no); } .cel.abstencion { background: var(--ab); color: #3a2a00; }
.cel.dividido { background: var(--div); } .cel.ausente { background: var(--nv); color: #333; }
.prop-tabla tr.autor-propio td.p { font-style: italic; }
.posturas td.c { min-width: 4.2rem; }
.mini-balance .barra { min-width: 3.5rem; height: 9px; }
.mini-balance .small { color: var(--muted); font-variant-numeric: tabular-nums; }
.posturas-colectivo td.p { min-width: 260px; }
