/* family typefaces (CONVENTIONS.md, chosen by Víctor 2026-11-16): Source Serif 4 for titles, Inter for text and data;
   variable woff2, latin subset, weights 400 to 600, self-hosted (OFL, vendor/fonts/; source of truth chassis/fonts/) */
@font-face { font-family: "Inter"; src: url("../vendor/fonts/inter-latin-var.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("../vendor/fonts/sourceserif4-latin-var.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
:root {
  color-scheme: light;
  --bg: #fcfcfb;
  --surface: #ffffff;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #8a8984;
  --line: #e4e3df;
  --accent: #1d4ed8;
  --nodata: #ecebe7;
  --border-map: rgba(255, 255, 255, .35);
  --texto: 920px;   /* reading width of running text */
  /* the type scale: every font size in the atlas is one of these (charts included) */
  --t-xs: 12px;    /* notes, chart axes and labels, legends, tooltips, small badges */
  --t-s: 13px;     /* tables, chips, controls, index links */
  --t-m: 15px;     /* body text, paragraphs, subtitles */
  --t-l: 17px;     /* h3, .h4 and other subsection headings */
  --t-xl: 22px;    /* h2 */
  --t-xxl: 28px;   /* h1 */
  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-title: "Source Serif 4", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #161615; --surface: #1f1f1d; --ink: #f5f5f3; --ink-2: #c3c2b7; --ink-3: #8f8e86;
    --line: #34332f; --accent: #7aa2ff; --nodata: #2a2a27; --border-map: rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #161615; --surface: #1f1f1d; --ink: #f5f5f3; --ink-2: #c3c2b7; --ink-3: #8f8e86;
  --line: #34332f; --accent: #7aa2ff; --nodata: #2a2a27; --border-map: rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: var(--t-m)/1.45 var(--font-text);
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); }
.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0;
  background: var(--bg); z-index: 5;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
nav.sections { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
nav.sections a { color: var(--ink-2); text-decoration: none; padding: 2px 0; border-bottom: 2px solid transparent; }
nav.sections a.on { color: var(--ink); border-bottom-color: var(--ink); }

/* family identity bar (personal_projects/LLM.md section 2) */
#navbar {
  display: flex; align-items: center; gap: 6px; background: #1f1d1a; color: #d9d2c6;
  font-size: var(--t-xs); padding: 5px 16px; white-space: nowrap; overflow: hidden;
}
#navbar a { color: #d9d2c6; text-decoration: none; }
#navbar a:hover { color: #fff; }
#navbar .wordmark { font-weight: 600; }
#navbar .nav-sep { color: #8a7f72; }
#navbar .build {
  margin-left: auto; color: #8a7f72; font-size: 6.5px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
main { max-width: 2400px; margin: 0 auto; padding: 10px 24px; }   /* the whole screen up to 2400px (Víctor, 2026-11-16: "todo el ancho en mi 24 pulgadas"); was 1560 */
footer { color: var(--ink-3); font-size: var(--t-xs); padding: 16px 16px; text-align: center; }
h1, h2, h3 { font-family: var(--font-title); }
h1 { font-size: var(--t-xxl); font-weight: 600; margin: 4px 0 6px; letter-spacing: -.01em; }
h2 { font-size: var(--t-xl); font-weight: 600; margin: 22px 0 6px; letter-spacing: -.01em; }
h2 .muted { font-size: var(--t-m); letter-spacing: 0; }
h3 { font-size: var(--t-l); color: var(--ink); font-weight: 600; margin: 12px 0 4px; }   /* bold, not capitals (Víctor, 2026-11-14) */
.sub { color: var(--ink-2); margin: 0 0 8px; }
.loading { color: var(--ink-3); }
/* compact rhythm (Víctor, 2026-11-17: "cuantos menos huecos menos"): paragraphs closer together everywhere */
main p { margin: 0 0 .55em; }
/* one reading width for running text, so it all ends on the same vertical line; charts, tables and chips keep the
   whole column (Víctor, 2026-11-15) */
main p:not(.linea), main .sub, main .note, .metodo p, .arena-cap { max-width: var(--texto); }
.tag-exp { display: inline-block; vertical-align: middle; font-size: var(--t-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #9a5b00; background: #fff4e0; border: 1px solid #f0d6a8; border-radius: 4px; padding: 1px 6px; margin-left: 6px; }
:root[data-theme="dark"] .tag-exp { color: #f0c27a; background: #3a2a10; border-color: #6b4e1e; }

.controls { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 6px 0 8px; }
.controls label { color: var(--ink-2); font-size: var(--t-s); display: flex; gap: 6px; align-items: center; }
select, input[type=search], input[type=text] {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 5px 10px;
}
input[type=range] { accent-color: var(--ink); }
/* button groups as pills (Víctor, 2026-11-21: "más redondeados"): a soft track, each button a pill, the chosen one filled */
.seg {
  display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
  background: color-mix(in srgb, var(--line) 35%, var(--surface));
}
.seg button {
  font: inherit; font-size: var(--t-s); border: 0; border-radius: 999px; background: transparent; color: var(--ink-2);
  padding: 4px 12px; cursor: pointer; transition: background .15s, color .15s;
}
.seg button:hover:not(.on) { background: var(--surface); color: var(--ink); }
.seg button.on { background: var(--ink); color: var(--bg); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.seg button:focus-visible { outline: 2px solid var(--ink-3); outline-offset: 1px; }
/* groups that wrap onto two lines: a rounded box rather than a pill */
.pv-mapa .seg, .mv-controls .seg, .vt-ctl .seg, .vt-noche .seg { border-radius: 16px; }

.timeline { display: flex; align-items: center; gap: 10px; width: 100%; }
.timeline input { flex: 1; }
.timeline .lbl { min-width: 170px; font-weight: 600; }
.play { font: inherit; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 4px 12px; cursor: pointer; }

.mapwrap { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.mapwrap svg { width: 100%; height: auto; display: block; cursor: grab; touch-action: none; }
.mapwrap svg:active { cursor: grabbing; }
.mapwrap path.m, .mapwrap path.prov { vector-effect: non-scaling-stroke; }
.zoombtns { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 4px; }
.zoombtns button {
  width: 40px; height: 40px; font: inherit; font-size: var(--t-l); line-height: 1; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 6px;
}
.zoombtns button:hover { border-color: var(--ink-3); }
.mapwrap path.m { stroke: var(--border-map); stroke-width: .15; }
.mapwrap path.m:hover { stroke: var(--ink); stroke-width: 1; }
.mapwrap path.prov { fill: none; stroke: var(--ink-3); stroke-width: .5; pointer-events: none; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--t-xs); color: var(--ink-2); margin: 8px 0; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
/* Provincias: provinces coloured by seats in play; a static map, so the page scrolls over it on phones */
.pvmap { max-width: 760px; }
.pvmap svg { cursor: default; touch-action: auto; }
.pvmap path.pv { stroke: var(--surface); stroke-width: .8; vector-effect: non-scaling-stroke; cursor: pointer; }
.pvmap path.pv-hl { fill: none; stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.pv-legend { margin: 0; padding: 0 12px 10px; }
.pv-sw-hatch { background: repeating-linear-gradient(45deg, var(--nodata) 0 2px, color-mix(in srgb, var(--ink-3) 45%, var(--nodata)) 2px 3px); border: 1px solid var(--line); }
.pv-mapa .controls { margin-top: 0; }
.pv-mapa .seg { -webkit-mask-image: none; mask-image: none; }   /* the toggles wrap on phones (below), so no fade */
.pv-mapa select { max-width: 100%; }
.pv-nota { max-width: 760px; }
.pv-leg-mv { display: grid; grid-template-columns: auto repeat(4, minmax(38px, auto)); gap: 3px 6px; align-items: center; }
.pv-leg-mv > .muted { grid-column: 1 / -1; }
.pv-leg-mv .pv-leg-h { text-align: center; }
.pv-leg-mv .sw { width: 100%; height: 12px; margin: 0; }
@media (max-width: 640px) {
  .pv-mapa .seg button { padding: 5px 8px; }
  /* on screens narrower than the three modes, they wrap instead of hiding one off the edge */
  .pv-mapa .seg { flex-wrap: wrap; overflow: visible; }
  .pv-mapa .seg button { flex: 1 1 auto; }
}
.pv-leg-mv .pv-leg-h { white-space: nowrap; }
.pv-nota[hidden] { display: none; }
#s-decide, #s-tuya { scroll-margin-top: 96px; }   /* below the sticky top bar, which wraps to two rows on phones */
@media (max-width: 1099px) { #s-decide, #s-tuya { scroll-margin-top: 128px; } }   /* and below the sticky index row */
.ramp { display: flex; align-items: center; gap: 6px; font-size: var(--t-xs); color: var(--ink-2); }
.ramp .bar { width: 180px; height: 10px; border-radius: 2px; }

.tip {
  position: fixed; pointer-events: none; z-index: 20; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: var(--t-xs);
  box-shadow: 0 4px 16px rgba(0,0,0,.12); min-width: 180px; max-width: 260px;
  text-decoration: underline dotted var(--ink-3); text-underline-offset: 3px; cursor: help;   /* for span.tip too (data-tip, main.js) */
}
.tip b { font-size: var(--t-s); }
.tip .row { display: flex; justify-content: space-between; gap: 12px; }
.tip .muted { color: var(--ink-3); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.stats { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 8px 0 4px; }
.stat .v { font-size: var(--t-xl); font-weight: 700; }
.stat .k { font-size: var(--t-xs); color: var(--ink-2); }

table { border-collapse: collapse; width: 100%; font-size: var(--t-s); }
th, td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-2); font-weight: 600; font-size: var(--t-s); border-bottom: 2px solid var(--ink-2); background: var(--surface); vertical-align: bottom; cursor: pointer; user-select: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.hbar { height: 8px; border-radius: 0 4px 4px 0; display: block; }

.search { position: relative; max-width: 420px; }
.search input { width: 100%; padding: 8px 10px; font-size: var(--t-l); }
.sugg { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; z-index: 10; max-height: 320px; overflow: auto; }
.sugg a { display: block; padding: 6px 10px; color: var(--ink); text-decoration: none; }
.sugg a:hover, .sugg a.sel { background: var(--line); }
.sugg small { color: var(--ink-3); }

.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
/* every chart text is --t-xs (this beats d3's font-size attributes); the rare larger label carries .t-m */
svg text { font-size: var(--t-xs); }
svg text.t-m { font-size: var(--t-m); }
small, sup, sub { font-size: var(--t-xs); }
.chart .axis text { fill: var(--ink-3); }
.chart .axis line, .chart .axis path { stroke: var(--line); }
.chart .grid line { stroke: var(--line); }

.seats { display: flex; height: 34px; border-radius: 4px; overflow: hidden; gap: 2px; position: relative; }
.seats div { height: 100%; }
.majority { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); left: 50%; }
.sliders { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 24px; }
.sliders label { display: grid; grid-template-columns: 150px 1fr 48px; align-items: center; gap: 8px; font-size: var(--t-s); }
.note { font-size: var(--t-xs); color: var(--ink-3); }

.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: var(--t-s); color: var(--ink-2); font-weight: 600; margin-top: 2px; }
.eyebrow + h1 { margin-top: 2px; }
.brand img { border-radius: 50%; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); text-decoration: none; }
.tile:hover { border-color: var(--ink-3); }
.tile span { color: var(--ink-2); font-size: var(--t-s); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seatrows { display: flex; flex-direction: column; gap: 5px; }
.sr { display: flex; align-items: center; gap: 8px; font-size: var(--t-xs); }
.sl { color: var(--ink-2); flex: none; }
.scrollx { overflow-x: auto; }
table.heat td, table.heat th { padding: 3px 5px; font-size: var(--t-xs); white-space: nowrap; }
table.heat td.up { color: #1d4ed8; font-weight: 600; }
table.heat td.down { color: #c2410c; font-weight: 600; }

.h3 { font-size: var(--t-l); margin: 0 0 8px; color: var(--ink-2); font-weight: 600; }
.range { position: relative; height: 10px; background: var(--line); border-radius: 5px; }
.range span { position: absolute; top: 0; bottom: 0; border-radius: 5px; opacity: .85; }
.range i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }

table.cal tr.past td { color: var(--ink-3); }

.pm { position: relative; height: 10px; }
.pm span { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.pm i { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--ink-3); }

.electos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 24px; }
.electos .eh { margin-bottom: 4px; }
.electos ol { margin: 0; padding-left: 20px; font-size: var(--t-s); color: var(--ink-2); }

/* phone (family breakpoint 640px): controls become one row that scrolls sideways, with a fade */
@media (max-width: 640px) {
  .top { padding: 8px 16px; gap: 6px; }
  nav.sections, .seg, .chips {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
            mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  nav.sections::-webkit-scrollbar, .seg::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
  nav.sections a, .seg button, .chip { white-space: nowrap; flex: none; }
  .seg button { min-height: 36px; }
  .controls { gap: 8px; }
  h2 { margin-top: 20px; }
  .timeline .lbl { min-width: 0; font-size: var(--t-s); }
  .sliders label { grid-template-columns: 110px 1fr 40px; }
}

/* polls vs result (Generales) */
.pvr td { vertical-align: middle; }
.pvr-track { position: relative; height: 18px; }
.pvr-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.pvr-range { position: absolute; top: 5px; height: 8px; border-radius: 4px; opacity: 0.3; }
.pvr-dot { position: absolute; top: 4px; width: 10px; height: 10px; border-radius: 50%; margin-left: -5px; border: 1.5px solid var(--surface); }
.pvr-cis { position: absolute; top: 4px; width: 9px; height: 9px; margin-left: -4.5px; transform: rotate(45deg); border: 1.5px solid; background: var(--surface); }
.pvr-real { position: absolute; top: 0; height: 18px; width: 3px; margin-left: -1.5px; background: var(--ink); border-radius: 1px; }

#ck-casa { max-width: 100%; }

/* poll chart: zoom, overview and pollster chips */
.overview { margin-top: 2px; }
.overview .brush .selection { fill: var(--ink-3); fill-opacity: 0.18; stroke: var(--ink-3); }
details.casas { font-size: var(--t-s); }
/* one and two buttons beside the zoom of the poll chart: no fade on phones */
#solo-media, .seg:has(> #solo-media), #modo, #fecha-modo { -webkit-mask-image: none; mask-image: none; overflow: visible; }
/* the date pinned on the poll chart (encuestas.js, drawPin) */
.pin-media { margin: 8px 0 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: var(--t-s); }
.pin-media .pin-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.pin-media .pin-x { border: 0; background: none; font-size: 20px; line-height: 1; padding: 0 4px; cursor: pointer; color: var(--ink-2); }
.pin-media .pin-rows { display: flex; flex-wrap: wrap; gap: 4px 16px; }
details.casas summary { cursor: pointer; padding: 4px 0; }
.casas-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.casas-act button { font: inherit; font-size: var(--t-xs); padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: var(--t-xs); cursor: pointer; user-select: none; }
.chips label input { display: none; }
.chips label.off { opacity: 0.45; text-decoration: line-through; }
label.casas-x { display: block; margin-top: 8px; font-size: var(--t-xs); color: var(--ink-2); }

footer .flinks { margin: 0 0 6px; }
footer .flinks a { color: var(--ink-2); }
.seg[hidden], .controls [hidden] { display: none; }
.sr.muted-row .sl { font-style: italic; color: var(--ink-2); }

.multiples { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 12px; }
.mult svg { width: 100%; height: auto; display: block; overflow: visible; }   /* end labels with a leader may pass the edge by a pixel or two */

/* 29N: long page with a sticky index on wide screens */
.layout { display: block; }
.toc { display: none; }
.toc nav { padding-top: 2px; }
@media (min-width: 1100px) {
  .layout { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 32px; align-items: start; }
  .toc { display: block; position: sticky; top: 72px; padding-top: 6px; }
  .toc nav { display: flex; flex-direction: column; gap: 0; border-left: 2px solid var(--line); }
  .toc a { color: var(--ink-2); text-decoration: none; font-size: var(--t-s); padding: 4px 10px; margin-left: -2px; border-left: 2px solid transparent; }
  .toc a.on { color: var(--ink); border-left-color: var(--ink); font-weight: 600; }
}
.content section { scroll-margin-top: 72px; }
.content > section { margin-bottom: 16px; }
.content > section > h2:first-child { margin-top: 0; }
ol.steps { padding-left: 20px; font-size: var(--t-m); color: var(--ink-2); }
ol.steps li { margin: 6px 0; }
td.ok { color: #1d7a74; font-weight: 600; }
.metodo p { font-size: var(--t-m); color: var(--ink-2); }
.metodo p b { color: var(--ink); }
th.sorted::after { content: " ↕"; color: var(--ink-3); }
th.sorted[data-dir="asc"]::after { content: " ↑"; }
th.sorted[data-dir="desc"]::after { content: " ↓"; }

/* 29N index: column on wide screens (see .layout/.toc above), sticky row on phones */
/* subsections tight under their section; "sub" is also the page subtitle's class: undo its margin and width */
.toc a.sub { padding: 1px 10px 1px 22px; font-size: var(--t-xs); line-height: 1.35; margin: 0 0 0 -2px; max-width: none; }
.toc-row a.sub { margin-bottom: 0; max-width: none; }
.toc-row { display: none; }
@media (max-width: 1099px) {
  .toc-row { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; position: sticky; top: 50px; z-index: 5;
    background: var(--bg); padding: 4px 0; margin: 4px 0; border-bottom: 1px solid var(--line); }
  .toc-row a { display: inline-flex; align-items: center; height: 27px; box-sizing: border-box; margin: 0; line-height: 1; }
  .toc-row a.sub { border-color: transparent; padding: 4px 2px; margin-left: -4px; color: var(--ink-3); }
  .toc-row a.sub::before { content: "› "; }
  .toc-row a.sub.on { background: none; color: var(--ink); font-weight: 600; }
  .toc-row::-webkit-scrollbar { display: none; }
  .toc-row a { white-space: nowrap; flex: none; font-size: var(--t-xs); color: var(--ink-2); text-decoration: none; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; }
  .toc-row a.on { color: var(--bg); background: var(--ink); border-color: var(--ink); }
}
.h4 { font-size: var(--t-l); font-weight: 600; margin: 4px 0 2px; }
.sumas { font-size: var(--t-m); color: var(--ink-2); margin: 8px 0 4px; }
.sumas b { color: var(--ink); }

/* folded method notes: the fold button of personal_projects.html (box, label left, big + / − right) */
details.metodo-box { margin: 12px 0 4px; }
details.metodo-box > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: var(--t-m); font-weight: 600; color: var(--ink); background: var(--surface); }
details.metodo-box > summary::after { content: "＋"; margin-left: auto; font-size: var(--t-xl); line-height: 1; color: var(--accent, #1d7a74); font-weight: 400; }
details.metodo-box[open] > summary::after { content: "−"; }
details.metodo-box > summary::-webkit-details-marker { display: none; }
details.metodo-box[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
details.metodo-box[open] > .metodo, details.metodo-box[open] > p { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; padding: 8px 12px; margin: 0; }

/* 29N: seat sums by group, parties as chips you can move */
.linea { font-size: var(--t-m); margin: 6px 0 4px; }
.linea b { font-weight: 600; }
.bloques { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 2px; }
@media (max-width: 640px) { .bloques { grid-template-columns: 1fr; } }
.bloque { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 64px; transition: background .12s; }
.bq-h { font-size: var(--t-m); margin-bottom: 6px; }
.bq-p { font-size: var(--t-xs); color: var(--ink-2); margin: -2px 0 6px; }
.bq-chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* chips: a dot, a name and a figure in one small rounded box (vote shares, seat groups) */
.chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; margin: 0 6px 6px 0; font-size: var(--t-s); background: var(--surface); color: var(--ink-2); text-decoration: none; }
.chip b { font-weight: 600; }
.bq-chips .chip { font-size: var(--t-s); margin: 0; padding: 3px 9px; }
.chip.drag { cursor: grab; touch-action: none; user-select: none; }
.chip.dragging { opacity: .35; }
.chip.ghost { position: fixed; z-index: 50; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.18); cursor: grabbing; margin: 0; }
.bloque.over { background: color-mix(in srgb, var(--accent, #1d7a74) 10%, var(--surface)); border-color: var(--accent, #1d7a74); }
/* groups: left in red, right in blue, the rest in grey (after .over, which they override) */
.bloque[data-g="izquierda"] { border-color: #e3061340; background: #e306130a; }
.bloque[data-g="derecha"] { border-color: #1d84ce40; background: #1d84ce0a; }
.bloque[data-g="otros"] { border-color: #8a898440; background: #8a89840a; }
.bloque[data-g="izquierda"] .bq-h b { color: #c8102e; }
.bloque[data-g="derecha"] .bq-h b { color: #1d6fb0; }
.bloque[data-g="otros"] .bq-h b { color: var(--ink-2); }
/* each group box carries a hatched band in the colour of its part of the "Por bloques" bar, so box and bar match */
.bloque { position: relative; overflow: hidden; padding-top: 14px; }
.bloque::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; }
.bloque[data-g="izquierda"]::before { background: repeating-linear-gradient(45deg, #e30613 0 5px, color-mix(in srgb, #e30613 35%, white) 5px 10px); }
.bloque[data-g="derecha"]::before { background: repeating-linear-gradient(45deg, #1d84ce 0 5px, color-mix(in srgb, #1d84ce 35%, white) 5px 10px); }
.bloque[data-g="otros"]::before { background: repeating-linear-gradient(45deg, #9b9a93 0 5px, color-mix(in srgb, #9b9a93 35%, white) 5px 10px); }

/* ranges per party (resultados.js, rangos): band = 90% of the simulations, dot = central estimate */
.rangos { display: grid; gap: 7px; margin: 10px 0 14px; }   /* full block width, like the "juego" box and the charts (it was 980px: the box above was wider) */
.rg-fila { display: grid; grid-template-columns: 130px 1fr 120px; align-items: center; gap: 12px; font-size: var(--t-m); }
.rg-nom { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rg-pista { position: relative; height: 16px; }
.rg-pista::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.rg-franja { position: absolute; top: 4px; height: 8px; border-radius: 4px; opacity: .3; }
.rg-punto { position: absolute; top: 2px; width: 12px; height: 12px; border-radius: 50%; transform: translateX(-50%); box-shadow: 0 0 0 2px var(--bg); }
.rg-media { position: absolute; top: -3px; width: 2px; height: 22px; background: var(--ink); transform: translateX(-50%); z-index: 2; }   /* drawn over the dot: they are often almost at the same value */
.rg-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rg-num .muted { font-size: var(--t-xs); color: var(--ink-3); }
@media (max-width: 600px) { .rg-fila { grid-template-columns: 84px 1fr 92px; gap: 8px; font-size: var(--t-s); } }

/* "::: juego" in textos/*.md: an interactive box, set apart from the reading boxes by its tinted background */
.juego { position: relative; background: color-mix(in srgb, #f2b705 9%, var(--bg)); border: 1px solid color-mix(in srgb, #f2b705 45%, var(--line));
  border-radius: 10px; padding: 14px 16px 10px; margin: 14px 0; }
.juego .h4 { font-size: var(--t-l); font-weight: 700; margin: 0 0 10px; }
.juego-tag { position: absolute; top: 12px; right: 14px; font-size: var(--t-xs); letter-spacing: .06em; text-transform: uppercase; font-weight: 600;
  color: #8a6400; background: color-mix(in srgb, #f2b705 22%, var(--bg)); border-radius: 999px; padding: 2px 8px; }
.juego .legend { margin-bottom: 6px; }
.bq-barra { margin: 6px 0 2px; }
/* in the game box the two bars sit together; the party colours are in the chips below */
.juego #proj .legend { display: none; }
.juego #proj .seatrows { margin-bottom: 4px; }

/* D'Hondt tab: sand jars on a canvas, and the quotient table */
.arena { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 0 4px; }
.arena canvas { display: block; }
.arena-ctl { margin-top: 10px; }
.arena-ctl .play:disabled { opacity: .4; cursor: default; }
.arena-cap { min-height: 3em; }
table.quot td.won sup { font-size: var(--t-xs); color: var(--ink-2); margin-left: 2px; }
table.quot td.cur { outline: 2px solid var(--ink); outline-offset: -2px; font-weight: 600; }
table.quot td.next { outline: 2px dashed #c2410c; outline-offset: -2px; }
table.quot tr.out td { color: var(--ink-3); }
table.quot td.muted { font-style: italic; }
td.up { color: #1d4ed8; font-weight: 600; }
td.down { color: #c2410c; font-weight: 600; }
#ejemplos .chip { cursor: pointer; margin: 0; font: inherit; font-size: var(--t-s); color: var(--ink-2); }
#ejemplos .chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
table.quot td:first-child { white-space: nowrap; }
/* D'Hondt tab: turns, price, wasted votes, three steps, last seats */
.tn-chart svg, .pr-chart svg, #esc svg, .pt-hemi svg { width: 100%; height: auto; display: block; }
.tn-chart, .pr-chart { background: var(--surface); border: 1px solid var(--line); border-radius: 8px 8px 0 0; padding: 6px 0 0; }
.tn-seatwrap { background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; padding: 8px 10px 10px; }
.tn-seats { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.tn-seats i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line); box-sizing: border-box; transition: background .25s; }
.tn-seats i.on { border-color: transparent; }
.pr-chart + .tn-seatwrap .tn-seats i.on { background: var(--ink); }
.tn-seats i.extra { background: #c2410c; border-color: transparent; }
.pr-range { flex: 1 1 220px; }
.pr-range input { flex: 1; }
.pr-cap.ok b { color: #1d7a74; }
.sv { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.sv-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px; align-items: start; }
.sv-l { font-size: var(--t-s); line-height: 1.3; }
.sv-l span { display: block; font-size: var(--t-xs); color: var(--ink-3); margin-left: 15px; }
.sv-d { display: flex; flex-wrap: wrap; gap: 2px; padding-top: 3px; }
.sv-d i { width: 7px; height: 7px; border-radius: 50%; }
.sv-d i.no { background: var(--nodata); box-shadow: inset 0 0 0 1px var(--ink-3); }
@media (max-width: 640px) { .sv-row { grid-template-columns: 1fr; gap: 3px; } }
.pt-hemi { max-width: 620px; margin: 4px auto 0; }
.legend .up { color: #1d4ed8; } .legend .down { color: #c2410c; }
.ai { display: flex; flex-direction: column; }
.ai-row { display: grid; grid-template-columns: 150px 120px minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: var(--t-s); }
.ai-row:hover { background: var(--surface); }
.ai-n small { color: var(--ink-3); }
.ai-bar { height: 10px; background: var(--nodata); border-radius: 5px; overflow: hidden; }
.ai-bar i { display: block; height: 100%; background: #c2410c; }
.ai-t { color: var(--ink-2); }
.ai-t b { color: var(--ink); font-weight: 600; }
@media (max-width: 640px) { .ai-row { grid-template-columns: 1fr 90px; } .ai-t { grid-column: 1 / -1; } }

/* table of polls: rows of one study share a colour */
table.te td { vertical-align: top; }
table.te tr.te-b0 td { background: color-mix(in srgb, var(--ink) 4%, var(--surface)); }
table.te tr.te-b1 td { background: color-mix(in srgb, var(--ink) 8%, var(--surface)); }
.te-nw { white-space: nowrap; }
.te-de, .te-x { color: var(--ink-2); }
.te-more { font: inherit; font-size: var(--t-s); padding: 4px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); cursor: pointer; }
.te-q { width: 100%; max-width: 520px; padding: 8px 12px; font: inherit; font-size: var(--t-m); border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }   /* search box */
.te-q:focus { outline: 2px solid var(--accent, #1d7a74); outline-offset: 1px; }

/* Tu provincia: one square per seat, filled by its probability */
.pv-nw { white-space: nowrap; }
table.pv-grid td, table.pv-grid th { padding: 3px 2px; border-bottom: 0; text-align: center; }
table.pv-grid td:first-child, table.pv-grid th:first-child { text-align: left; padding-right: 10px; }
.pv-c { width: 26px; height: 26px; margin: 0 auto; background: var(--nodata); border-radius: 3px; position: relative; overflow: hidden; }
.pv-c span { position: absolute; left: 0; right: 0; bottom: 0; }
.pv-p { font-size: var(--t-xs); color: var(--ink-2); height: 15px; line-height: 15px; }
/* the chosen province's name under the "Tu provincia" heading; its parts as small headings */
h3.pv-nombre { font-size: var(--t-l); font-weight: 600; margin: 10px 0 6px; }
#pv .h4 { font-size: var(--t-l); font-weight: 700; margin: 18px 0 6px; }

/* ==== Senado (#senado, src/senado.js) · begin ==== */
.sn-cab { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin: 8px 0 14px; }
.sn-cab .sn-sec { align-self: stretch; }
.sn-camara a { font-size: var(--t-s); padding: 5px 14px; text-decoration: none; color: var(--ink-2); background: var(--surface); }
.sn-camara a.on { background: var(--ink); color: var(--bg); }
.sn-sec { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.sn-sec h2.sn-h { margin: 0; }
.sn-grid { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 1.55fr) minmax(220px, .75fr); gap: 16px; align-items: start; }
.sn-grid > .card { min-width: 0; }
.sn-grid h3 { margin-top: 2px; }
.sn-titular { font-family: var(--font-title); font-size: var(--t-xxl); line-height: 1.15; font-weight: 600; margin: 2px 0 6px; }
.sn-izq .sub { margin-bottom: 6px; }
.sn-izq .linea { margin: 6px 0 4px; }
.sn-hemi svg { width: 100%; height: auto; display: block; }
.sn-hemi-leg { margin: 4px 0 8px; }
.legend .sn-sw-des { background: color-mix(in srgb, var(--ink-3) 35%, var(--surface)); border: 1px solid var(--ink-3); }
.legend .sn-sw-empate { background: var(--surface); border: 1px solid var(--ink-3); }
table.sn-t { width: 100%; }
table.sn-t td.muted { color: var(--ink-3); }
.sn-ver { margin: 6px 0 2px; font-size: var(--t-s); }
.sn-fuente { color: var(--ink-3); }
.sn-mapa svg { cursor: grab; touch-action: pan-y; }
.sn-mapa .zoombtns { top: auto; bottom: 10px; }
.sn-mapa path.sn-c { stroke: var(--surface); stroke-width: .7; vector-effect: non-scaling-stroke; cursor: pointer; transition: opacity .2s; }
.sn-mapa path.sn-c.sn-off { opacity: .25; }
.sn-mapa .pv-hl { fill: none; stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.sn-mapa .sn-pill-t { font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none; }
.sn-cl { display: flex; flex-direction: column; }
.sn-cr { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font: inherit; font-size: var(--t-s); text-align: left; color: var(--ink);
  background: none; border: 0; border-bottom: 1px solid var(--line); padding: 7px 4px; cursor: pointer; }
.sn-cr:hover, .sn-cr.on { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.sn-cr.on .sn-cn { font-weight: 700; }
.sn-cv { white-space: nowrap; color: var(--ink-2); }
.sn-cv b { color: var(--ink); }
.sn-cv small { color: var(--ink-3); }
.sn-cb { grid-column: 1 / -1; display: flex; height: 4px; border-radius: 2px; overflow: hidden; background: var(--nodata); }
.sn-cb i { display: block; }
.sn-coal { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 8px; }
.sn-co { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 8px; padding: 10px 12px; font-size: var(--t-s); }
.sn-co-h { font-size: var(--t-m); margin-bottom: 2px; }
.sn-co-s, .sn-co-d { color: var(--ink-2); }
.sn-co-m { color: var(--ink-2); }
.sn-co-w { margin-top: 6px; }
.sn-co-w .muted { color: var(--ink-3); }
@media (max-width: 1199px) {
  .sn-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
  .sn-der { grid-column: 1 / -1; }
  .sn-cl { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); column-gap: 16px; }
}
@media (max-width: 760px) {
  .sn-grid { grid-template-columns: minmax(0, 1fr); }
  .sn-titular { font-size: var(--t-xl); }
}
.sn .seg { -webkit-mask-image: none; mask-image: none; overflow: visible; }
/* ==== Senado · end ==== */
/* ==== Portada 2 (2026-11-16): "¿Quién llega a 176?", atajos, hemiciclo, mapa del más votado · start ==== */
.q176 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 6px 0 4px; }
@media (max-width: 760px) { .q176 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.q176.q176-3, .tb-izq .q176.q176-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* "¿Quién es la fuerza más votada?" */
/* card colours (Víctor, 2026-11-17): one party, a plain tint of its colour; a bloc, the same tint hatched, as in the bars */
/* the party colours of the site (meta.json: PP #1d84ce, PSOE #e30613, Vox #4f9e17), stronger than before (Víctor, 2026-11-17) */
.q176-c.q176-der { background: color-mix(in srgb, #1d84ce 20%, var(--surface)); border-color: color-mix(in srgb, #1d84ce 60%, var(--surface)); }
.q176-c.q176-izq { background: color-mix(in srgb, #e30613 17%, var(--surface)); border-color: color-mix(in srgb, #e30613 55%, var(--surface)); }
.q176-c.q176-vox { background: color-mix(in srgb, #4f9e17 20%, var(--surface)); border-color: color-mix(in srgb, #4f9e17 60%, var(--surface)); }
.q176-c.q176-der.q176-bloque { background: repeating-linear-gradient(45deg, color-mix(in srgb, #1d84ce 26%, var(--surface)) 0 6px, color-mix(in srgb, #1d84ce 10%, var(--surface)) 6px 12px); }
.q176-c.q176-izq.q176-bloque { background: repeating-linear-gradient(45deg, color-mix(in srgb, #e30613 22%, var(--surface)) 0 6px, color-mix(in srgb, #e30613 8%, var(--surface)) 6px 12px); }
.q176-c { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: default; }
.q176-c:hover { border-color: var(--ink-3); }
.q176-n { font-family: var(--font-title); font-weight: 600; font-size: 30px; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--ink); }
.q176-d { font-size: var(--t-s); color: var(--ink-2); }
.q176-t { font-size: 14px; color: var(--ink); margin-top: 4px; line-height: 1.3; }   /* a bit larger than --t-s (Víctor, 2026-11-17) */
.atajos { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.atajos button { font: inherit; font-size: var(--t-s); color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; min-height: 32px; cursor: pointer; }
.atajos button:hover:not(:disabled) { border-color: var(--ink-3); color: var(--ink); }
.atajos button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.atajos button:disabled { opacity: .45; cursor: default; }
.hemi { max-width: 520px; margin: 0 auto 6px; }
.hemi-svg { display: block; width: 100%; height: auto; }
.hemi-svg circle { cursor: pointer; transition: opacity .15s; }
.hemi-svg circle.hemi-on { stroke: var(--ink); stroke-width: .008; }
.hemi-176 { stroke: var(--ink-2); stroke-width: .006; stroke-dasharray: .02 .015; }
.hemi-176t { font-size: .075px; fill: var(--ink-2); font-weight: 600; }
.hemi-foco .note { margin: 2px 0; text-align: center; max-width: none; }
.mvmap { max-width: 760px; }
.mvmap .mv-labs text { font-weight: 600; pointer-events: none; font-variant-numeric: tabular-nums;
  fill: #1a1a18; stroke: rgba(255, 255, 255, .8); stroke-width: .3em; paint-order: stroke; stroke-linejoin: round; }   /* a label can span two fills: dark text with a light halo reads on all of them */
.mv-legend { max-width: 760px; }
.mv-anio { -webkit-mask-image: none; mask-image: none; overflow: visible; }   /* two buttons: no fade on phones */
/* ==== Portada 2 · end ==== */
/* ==== Cabecera Congreso | Senado y Error por casa (2026-11-16) · start ==== */
nav.camara { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; flex: none; }
nav.camara a { font-size: var(--t-s); padding: 3px 12px; color: var(--ink-2); text-decoration: none; background: var(--surface); white-space: nowrap; }
nav.camara a + a { border-left: 1px solid var(--line); }
nav.camara a.on { background: var(--ink); color: var(--bg); font-weight: 600; }
nav.camara a:not(.on):hover { color: var(--ink); }
@media (max-width: 640px) {
  .top .brand { flex: 1 1 auto; min-width: 0; }
  nav.camara { margin-left: auto; }
  nav.camara a { padding: 7px 12px; }   /* finger-sized */
  .top nav.sections { flex: 1 1 100%; }
}
.ec-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 4px 0 8px; }
.ec-sel { font-size: var(--t-s); color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.ec-sel select { max-width: 220px; }
.ec .card { margin: 10px 0; }
.ec .card > div > p:first-child { margin-top: 0; }
.ec .ec-zero { fill: var(--ink-3); font-size: 11px; }
.ec .ec-lab { stroke: var(--surface); stroke-width: 3px; paint-order: stroke; stroke-linejoin: round; }   /* a halo where a label crosses a line */
.ec .ec-b-bar { fill: color-mix(in srgb, var(--ink-3) 55%, var(--surface)); }
.ec .ec-b-lab { fill: var(--ink-2); font-size: 12px; }
.ec .ec-b-val { fill: var(--ink-3); font-size: 11px; }
.ec .ec-bar:hover .ec-b-bar { fill: var(--ink-3); }
.ec .ec-bar.on .ec-b-bar { fill: var(--ink); }
.ec .ec-bar.on .ec-b-lab { fill: var(--ink); font-weight: 700; }
.ec .ec-ring { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink-2); margin-right: 5px; vertical-align: -1px; }
.ec .legend .muted { color: var(--ink-3); }
.ec-mult { margin-top: 6px; }
.ec-m { border: 1px solid transparent; border-radius: 6px; padding: 4px; }
.ec-m.on { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, transparent); }
.ec #ec-tipo { -webkit-mask-image: none; mask-image: none; overflow: visible; }   /* three buttons: no fade on phones */
/* ==== Cabecera Congreso | Senado y Error por casa · end ==== */
/* ==== Portada: tablero en escritorio y ancho común (2026-11-16) · start ==== */
/* The front page (inicio.js adds .layout.portada; .tablero from 1200px with a model, see tablero() there).
   Widths: blocks (boxes, charts, ranges, tables) take the whole content column; running text stops at --texto;
   both start at the same left edge. */
/* the index is the same left column as on the other pages (Víctor, 2026-11-16: the pill row "ni se parece a un índice");
   at 1200px the content column is about 950px, at 1440px about 1190px */
.tb-grid { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1.7fr) minmax(240px, 1fr); gap: 14px; align-items: start; margin: 8px 0 14px; }
.tb-grid[data-cols="2"] { grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr); }
.tb-grid[data-cols="1"] { grid-template-columns: minmax(0, 1fr); }
.tb-col { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.tb-col > h3:first-child, .tb-mapa > h3:first-child { margin-top: 0; }
.tb-col p, .tb-col .note, .tb-col .sub { max-width: none; }   /* a card is narrower than --texto */
.res-desc { margin: 0 0 6px; }   /* same look as the "Últimos datos utilizados" note: one style for both (Víctor, 2026-11-17) */
.tb-izq .linea { font-family: var(--font-title); font-size: var(--t-l); line-height: 1.3; margin: 0 0 8px; }
.tb-izq .controls { margin: 8px 0 4px; }
.tb-izq #modelo-sel { width: 100%; }
.tb-izq .q176 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tb-izq .q176-c { padding: 8px 10px; }
.tb-izq .q176-c:not(.q176-der):not(.q176-izq):not(.q176-vox) { background: var(--bg); }   /* only uncoloured cards: party and bloc colours show in the tablero too (Víctor's notes 5 and 6, 2026-11-16) */
.tb-izq .q176-n { font-size: clamp(18px, 1.6vw, 24px); white-space: nowrap; }
@media (max-width: 1359px) { .tb-izq .q176 { grid-template-columns: minmax(0, 1fr); } .tb-izq .q176-n { font-size: 22px; } }   /* a 1200px window: one card per row, so "menos de 1" fits */
.tb-centro .mvmap, .tb-centro .mv-legend { max-width: none; }
.tb-der .rangos { gap: 6px; margin-bottom: 4px; }
.tb-der .rg-fila { grid-template-columns: 74px 1fr 82px; gap: 8px; font-size: var(--t-s); }
/* "Forma tu mayoría" in two columns (tablero() in inicio.js): groups and bars left, the hemicycle right, kept in view */
.jg-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); gap: 24px; align-items: start; }
.jg-izq { min-width: 0; }
.jg-izq > .atajos:first-child { margin-top: 0; }
.jg-der { position: sticky; top: 72px; min-width: 0; }
.jg-der .hemi { margin: 0 auto; }
.jg-der .hemi-foco .note { max-width: none; }
/* related blocks side by side from a 1360px window (parejas() in inicio.js); each column's text fits its column */
.par { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; margin: 10px 0 14px; }
.par > div { min-width: 0; }
.par > div > :first-child { margin-top: 0; }
.par p, .par .sub, .par .note { max-width: none; }
.par-voto { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.par-voto .rg-fila { grid-template-columns: 120px 1fr 112px; gap: 10px; }
.par-secciones { margin: 0 0 28px; }
.par-secciones section { margin: 0; }
.par-secciones section > h2:first-child { margin-top: 0; }
/* the folded methodology of the model, once open: its paragraphs in two columns instead of one at reading width beside an empty band */
@media (min-width: 1360px) {
  .layout.portada.tablero section > details.metodo-box[open] > .metodo { columns: 2; column-gap: 32px; }
  .layout.portada.tablero section > details.metodo-box[open] > .metodo p { max-width: none; break-inside: avoid; margin-top: 0; }
}
.par-cal { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.par-cal .tiles { grid-template-columns: 1fr; gap: 10px; }
/* a pressed shortcut keeps its light text under the pointer (the hover rule turned it dark on dark) */
.atajos button.on:hover:not(:disabled) { color: var(--bg); }
/* tablets and phones: the frequency cards keep "menos de 1" on one line, the figure shrinking with the card */
@media (max-width: 1199px) { .q176-n { white-space: nowrap; font-size: clamp(20px, 3.2vw, 30px); } }
@media (max-width: 760px) { .q176-n { font-size: clamp(19px, 5.6vw, 30px); } }
/* ==== Portada: tablero · end ==== */
/* ==== Mapa de la portada: etiquetas, bloques y ficha (2026-11-16, masvotado.js) · start ==== */
/* the three nested controls: year, then party or bloc, then votes or seats; each level smaller and indented under its
   parent, joined to it by a thin elbow line */
.mv-controls { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 4px 0 10px; }
.mv-controls .seg { -webkit-mask-image: none; mask-image: none; overflow: visible; flex-wrap: wrap; }
.mv-nivel { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-left: 22px; }
.mv-nivel::before { content: ""; position: absolute; left: 9px; top: -6px; width: 9px; height: 19px;
  border-left: 1px solid var(--ink-3); border-bottom: 1px solid var(--ink-3); border-bottom-left-radius: 4px; }
.mv-n2 .seg button { font-size: var(--t-s); padding: 4px 10px; }
.mv-n3 .seg button { font-size: var(--t-xs); padding: 3px 9px; }
.mv-leg-emp { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.mv-leg-emp .sw { width: 22px; height: 12px; }
.mv-modo { -webkit-mask-image: none; mask-image: none; overflow: visible; }
.mv-caja { position: relative; }
.mv-lista { max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }   /* "Lista": the map as a table */
.mv-ltab { width: 100%; font-size: var(--t-s); }
.mv-ltab td { vertical-align: top; }
.mv-ltab .mv-l-cifra { white-space: nowrap; }
.mv-ltab .mv-l-cifra .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.mv-ltab .mv-l-det p { margin: 0 0 3px; }
.mv-ltab .mv-l-det .nota, .mv-ltab .mv-l-det small { color: var(--muted); }
.mvmap svg { width: 100%; height: auto; }
.mvmap .mv-leads polyline { fill: none; stroke: var(--ink-3); stroke-width: .75; }
.mvmap .mv-leads circle { fill: var(--ink); }
.mvmap .mv-pill { cursor: pointer; }
.mvmap .mv-pill rect { fill: var(--surface); stroke: var(--line); stroke-width: 1; opacity: .94; }
.mvmap .mv-pill text { fill: var(--ink); stroke: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.mvmap .mv-pill:hover rect, .mvmap .mv-pill:focus-visible rect { stroke: var(--ink); }
.mvmap .mv-pill:focus { outline: none; }
.mvmap path.mv-sel { stroke-width: 2.2; }
.mv-ficha { position: absolute; z-index: 20; width: min(460px, calc(100% - 8px)); background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, .16); padding: 12px 12px 10px; font-size: var(--t-s); }
.mv-ficha[hidden] { display: none; }
.mvp-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.mvp-n { font-family: var(--font-title); font-weight: 600; font-size: var(--t-l); line-height: 1.2; }
.mvp-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; color: var(--ink-2); }
.mvp-cc { border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-size: var(--t-xs); background: var(--bg); }
.mvp-x { font: inherit; font-size: 20px; line-height: 1; width: 30px; height: 30px; flex: none; cursor: pointer; color: var(--ink-2);
  background: none; border: 1px solid var(--line); border-radius: 6px; }
.mvp-x:hover { color: var(--ink); border-color: var(--ink-3); }
.mvp-t { overflow-x: auto; margin: 10px 0 6px; }
.mvp-t table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.mvp-t th { font-weight: 400; color: var(--ink-3); font-size: var(--t-xs); text-align: left; padding: 2px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mvp-t td { padding: 4px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mvp-t .num { text-align: right; }
.mvp-p { display: inline-flex; align-items: center; gap: 6px; }
.mvp-ini, .mvp-foto { width: 22px; height: 22px; border-radius: 50%; flex: none; }
.mvp-ini { display: inline-grid; place-items: center; color: #fff; font-size: 9px; font-weight: 600; letter-spacing: .02em; }
.mvp-ini-o { background: var(--nodata); }
.mvp-foto { object-fit: cover; border: 2px solid; box-sizing: border-box; }
.mvp-esc { cursor: help; }
/* seats as a small chip in the party's colour (Su Momento's card); zero in grey (2026-11-17) */
.mvp-chip { display: inline-block; min-width: 1.6em; padding: 1px 5px; border-radius: 5px; text-align: center; font-weight: 600;
  color: var(--ink); background: color-mix(in srgb, var(--c) 22%, var(--surface)); box-sizing: border-box; }
.mvp-cero { color: var(--ink-3); padding-right: 5px; }
/* zoom on the open province: the labels and their leader lines fade out while zoomed */
.mvmap .mv-labs, .mvmap .mv-leads { transition: opacity .25s; }
.mvmap svg.mv-zoom .mv-labs, .mvmap svg.mv-zoom .mv-leads { opacity: 0; pointer-events: none; }
.mvmap { overflow: hidden; }
.mvp-pie { color: var(--ink-2); font-size: var(--t-xs); }
.mvp-pie p { margin: 2px 0; max-width: none; }
.mvp-pie a { display: inline-block; margin-top: 4px; font-size: var(--t-s); font-weight: 600; }
.mvp-cred { margin-top: 6px; }
.mvp-cred summary { cursor: pointer; color: var(--ink-3); }
.mvp-cred div { margin: 2px 0; }
.mv-ficha { container-type: inline-size; }
@container (max-width: 440px) {   /* a narrow card (phone, the tablero's centre column at 1200 px): the six columns still fit */
  .mvp-t table { font-size: var(--t-xs); }
  .mvp-t td, .mvp-t th { padding: 3px 2px; }
  .mvp-p { gap: 4px; }
  .mvp-ini, .mvp-foto { width: 18px; height: 18px; font-size: 8px; }
}
.mv-ficha.mv-hoja { position: fixed; left: 8px; right: 8px; bottom: 8px; top: auto; width: auto; max-height: 72vh; overflow-y: auto; z-index: 60; }
.mvmap path.mv-cambio { fill: none; stroke: var(--ink); stroke-width: 1.8; vector-effect: non-scaling-stroke; pointer-events: none; }
.mv-leg-cambio { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.mv-leg-cambio > .muted { flex-basis: 100%; }
.mv-sw-cambio { outline: 1.5px solid var(--ink); outline-offset: -1px; }
/* ==== Mapa de la portada: etiquetas, bloques y ficha · end ==== */
/* ==== Provincias: ficha de provincia (2026-11-16, provincia_ficha.js) · start ==== */
.pf-migas { font-size: var(--t-s); color: var(--ink-2); margin: 6px 0 0; }
.pf-migas a { color: var(--ink-2); }
#pv h3.pv-nombre { font-family: var(--font-title); font-size: var(--t-xxl); font-weight: 600; margin: 2px 0 8px; line-height: 1.15; }
.pf-cifras { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0 0 12px; padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pf-cifras div { min-width: 0; }
.pf-cifras dt { font-size: var(--t-xs); color: var(--ink-2); }
.pf-cifras dd { margin: 0; font-size: var(--t-m); font-weight: 600; font-variant-numeric: tabular-nums; }
.pf-cifras small { font-weight: 400; color: var(--ink-2); font-size: var(--t-xs); }
.pf-vista { margin: 0 0 10px; -webkit-mask-image: none; mask-image: none; overflow: visible; }
#pv .h4 { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 22px; }
/* results per list: name, bar, figures */
.pf-filas { max-width: 760px; margin: 6px 0 4px; }
.pf-fila { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr) 60px 84px; gap: 4px 12px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: var(--t-s); font-variant-numeric: tabular-nums; }
.pf-filas23 .pf-fila { grid-template-columns: minmax(110px, 170px) minmax(0, 1fr) 60px 80px 56px; }
.pf-fila.pf-cab { font-size: var(--t-xs); color: var(--ink-2); border-bottom: 1px solid var(--line); padding: 0 0 2px; }
.pf-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pf-barra { position: relative; height: 14px; background: var(--nodata); border-radius: 2px; }
.pf-barra span { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 2px; }
.pf-rango { opacity: .28; }
.pf-barra:has(.rg-pista) { background: none; height: 16px; }
.pf-barra .rg-pista span { bottom: auto; }
.pf-barra .rg-pista .rg-punto { border-radius: 50%; }
.pf-barra .rg-pista .rg-franja { border-radius: 4px; }
.pf-esc { font-weight: 600; }
.pf-esc small { font-weight: 400; color: var(--ink-2); font-size: var(--t-xs); }
.pf-fila[data-tip] { cursor: default; }
@media (max-width: 560px) {
  .pf-fila { grid-template-columns: minmax(0, 1fr) 54px 62px; gap: 4px 8px; }
  .pf-filas23 .pf-fila { grid-template-columns: minmax(0, 1fr) 46px 72px 54px; }
  .pf-barra { grid-column: 1 / -1; grid-row: 2; height: 10px; }
  .pf-fila.pf-cab .pf-barra, .pf-fila.pf-cab > div:nth-child(2) { display: none; }
}
/* the province map moved into the card; the selected province outlined */
.pf-mapa-hueco { margin: 14px 0 0; }
.pvmap path.pf-sel { fill: none; stroke: var(--ink); stroke-width: 2.5; vector-effect: non-scaling-stroke; pointer-events: none; }
/* electors per seat: one dot per province on a line */
.pf-tira { position: relative; height: 34px; margin: 14px 8px 0; max-width: 744px; }
.pf-tira::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.pf-tira-p { position: absolute; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: var(--ink-3); opacity: .55; }
.pf-tira-p:hover, .pf-tira-p:focus { opacity: 1; outline: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--ink); }
.pf-tira-p.on { background: var(--accent); opacity: 1; width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px; z-index: 1; }
.pf-tira-media { position: absolute; top: 4px; bottom: 4px; width: 2px; margin-left: -1px; background: var(--ink); }
.pf-tira-ejes { display: flex; justify-content: space-between; max-width: 760px; font-size: var(--t-xs); color: var(--ink-2); }
/* last seat: the usual fights */
.pf-lista-aire { margin: 4px 0 8px; padding-left: 18px; font-size: var(--t-m); }
.pf-lista-aire li { margin: 2px 0; }
/* heads of list */
.pf-cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 18px; margin: 6px 0; }
.pf-cand { display: flex; gap: 10px; align-items: center; font-size: var(--t-s); min-width: 0; }
.pf-ini { flex: none; width: 34px; height: 34px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-size: var(--t-xs); font-weight: 600; letter-spacing: .02em; }
.pf-lista { color: var(--ink-2); font-size: var(--t-xs); }
/* D'Hondt quotients: won seats tinted, the last seat boxed, the next in the queue dashed */
table.pf-dh td.gana { background: color-mix(in srgb, var(--c) 22%, transparent); }
table.pf-dh td.ultimo { outline: 2px solid var(--ink); outline-offset: -2px; font-weight: 600; }
table.pf-dh td.cola { outline: 2px dashed var(--ink-2); outline-offset: -2px; }
.pf-sube { color: #15803d; }
.pf-baja { color: #b91c1c; }
:root[data-theme="dark"] .pf-sube { color: #4ade80; }
:root[data-theme="dark"] .pf-baja { color: #f87171; }
/* municipalities */
.pf-munis-ctl input { width: 100%; max-width: 360px; padding: 7px 10px; font: inherit; font-size: var(--t-s); border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
table.pf-mun { max-width: 760px; }
.pf-mas[hidden] { display: none; }
.pf-btn { font: inherit; font-size: var(--t-s); padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); cursor: pointer; }
table.pf-dh, table.pf-ev { width: auto; min-width: min(100%, 520px); }
table.pf-ev { max-width: 760px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pf-sube { color: #4ade80; } :root:not([data-theme="light"]) .pf-baja { color: #f87171; } }
/* ==== Provincias: ficha de provincia · end ==== */

/* the horizontal index row of narrow screens is gone (Víctor, 2026-11-17: "en horizontal es horrible"); the left index of
   wide screens stays */
.toc-row { display: none !important; }
/* ==== Idioma ES · EN (2026-11-15) · start ==== */
/* the language buttons, in the identity bar before the build stamp (PRACTICES 2.5: two-letter codes in the top bar) */
#navbar nav.lang { display: inline-flex; gap: 2px; margin-left: auto; flex: none; }
#navbar nav.lang + .build { margin-left: 6px; }
#navbar nav.lang a { color: #8a7f72; padding: 0 4px; letter-spacing: .04em; }
#navbar nav.lang a.on { color: #fff; font-weight: 600; }
#navbar nav.lang a:not(.on):hover { color: #fff; }
.lang-note { margin: 12px 16px 0; }
.top a.lang-m { display: none; }
@media (max-width: 520px) {
  /* a phone's identity bar has no room for the codes beside the build stamp: the other language goes beside the title,
     at its right, as a small pill (Víctor, 2026-11-17; before, first in the row of tabs) */
  #navbar nav.lang { display: none; }
  #navbar nav.lang + .build { margin-left: auto; }
  .top a.lang-m { display: inline-block; margin-left: auto; font-size: var(--t-xs); letter-spacing: .04em; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; color: var(--ink-2); text-decoration: none; }
}
/* ==== Idioma · end ==== */
/* ==== Móvil: Congreso | Senado junto al título, menú deslizable, jerarquía de títulos (2026-11-15) · start ==== */
/* the chamber toggle moved from the top bar to the forecast's heading (main.js); on other pages it is hidden */
nav.camara[hidden] { display: none; }
h2.h-camara { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
h2.h-camara nav.camara { margin-left: auto; font-family: Inter, system-ui, sans-serif; letter-spacing: 0; }
h2.h-camara nav.camara a { padding: 5px 14px; }
/* the row of tabs: a wrapper carries the fades and the arrows (main.js), so they stay put while the row scrolls */
.nav-wrap { position: relative; min-width: 0; flex: 1 1 auto; }
.nav-mas { display: none; }
@media (max-width: 640px) {
  .top .nav-wrap { flex: 1 1 100%; }
  .nav-wrap nav.sections { -webkit-mask-image: none; mask-image: none; scroll-behavior: smooth; }
  .nav-wrap.mas-der nav.sections { -webkit-mask-image: linear-gradient(90deg, #000 78%, transparent 96%); mask-image: linear-gradient(90deg, #000 78%, transparent 96%); }
  .nav-wrap.mas-izq nav.sections { -webkit-mask-image: linear-gradient(90deg, transparent 4%, #000 22%); mask-image: linear-gradient(90deg, transparent 4%, #000 22%); }
  .nav-wrap.mas-der.mas-izq nav.sections { -webkit-mask-image: linear-gradient(90deg, transparent 4%, #000 22%, #000 78%, transparent 96%); mask-image: linear-gradient(90deg, transparent 4%, #000 22%, #000 78%, transparent 96%); }
  .nav-mas { position: absolute; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 18px; line-height: 1; padding: 0 0 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,.15); cursor: pointer; }
  .nav-mas.der { right: -4px; }
  .nav-mas.izq { left: -4px; }
  .nav-wrap.mas-der .nav-mas.der, .nav-wrap.mas-izq .nav-mas.izq { display: block; }
}
/* headings: three visible steps (h2 22px, h3 19px, the card titles 15px), so "Resumen" reads above "¿Quién llega a 176?" */
main h3 { font-size: 19px; }
.res-q176 .h4, .juego .h4 { font-size: 15px; }
/* ==== Móvil · end ==== */
/* "Cada encuestadora comparada consigo misma", below the poll chart (inicio.js, 2026-11-15) */
.cc { margin: 8px 0 4px; }
.cc .cc-tabla { margin: 6px 0; padding: 6px 12px; }
.cc .cc-tabla summary { cursor: pointer; font-size: var(--t-s); font-weight: 600; }
.cc .cc-tabla table { font-size: var(--t-s); margin-top: 6px; }

/* the card's 90% seat range, written under its title (2026-11-16) */
.q176-r { font-size: var(--t-s, 13px); color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }

/* front-page title on a phone: two lines at most (Víctor's note, 2026-11-16) */
@media (max-width: 640px) { .portada .content > h1 { font-size: 20px; line-height: 1.2; } }
/* "Fija los escaños de" (note 8, 2026-11-16): the control under the seat ranges, the faint unconditioned band, the fixed party */
.cond { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0 4px; font-size: var(--t-s); }
.cond-l { display: inline-flex; align-items: center; gap: 6px; }
.cond-v { flex: 1 1 160px; min-width: 120px; max-width: 320px; accent-color: var(--ink-2); }
.cond-n { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 6em; }
.cond-x { font-size: var(--t-xs); padding: 2px 8px; }
.cond-nota { flex-basis: 100%; }
.rg-franja.rg-base { background: var(--ink-3); opacity: 0.18; }
.rg-fila.rg-fijo .rg-nom { font-weight: 700; }
/* the blackout notice (textos/portada.md, aviso_veda), 24 to 29 November */
.aviso-veda { border: 1px solid color-mix(in srgb, #d9822b 45%, var(--surface)); background: color-mix(in srgb, #d9822b 10%, var(--surface));
  border-radius: 8px; padding: 10px 14px; margin: 4px 0 14px; font-size: var(--t-s); line-height: 1.45; }
.aviso-veda p { margin: 0; }
/* "Los 350 escaños, uno a uno" (src/parlamento.js): solid = almost sure, light = likely, ring = in play */
.pl-orden { margin: 4px 0 6px; }
.pl-wrap { max-width: 760px; }
.pl-svg { width: 100%; height: auto; display: block; }
.pl-d { cursor: pointer; stroke-width: 0.006; }
.pl-d.pl-seguro { fill: var(--c); stroke: var(--c); }
.pl-d.pl-probable { fill: color-mix(in srgb, var(--c) 45%, var(--surface)); stroke: var(--c); }
.pl-d.pl-juego { fill: var(--surface); stroke: var(--c); stroke-width: 0.009; }
.pl-d.pl-on { stroke: var(--ink); stroke-width: 0.014; }
.pl-sw { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; border: 1.5px solid var(--ink-2); }
.pl-sw.pl-seguro { background: var(--ink-2); }
.pl-sw.pl-probable { background: color-mix(in srgb, var(--ink-2) 40%, var(--surface)); }
.pl-sw.pl-juego { background: var(--surface); }
/* "Tu voto" (src/voto.js) */
.vt-ctl { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 6px 0 12px; }
.vt-l { display: inline-flex; align-items: center; gap: 8px; }
.vt-ctl .seg { -webkit-mask-image: none; mask-image: none; overflow: visible; flex-wrap: wrap; }
.vt-resp { padding: 12px 14px; }
.vt-resp > p:first-child { font-size: 17px; line-height: 1.45; margin-top: 0; }
.vt-tab td, .vt-todas td { vertical-align: top; }
.vt-todas tr.vt-sel td { background: color-mix(in srgb, var(--ink-3) 10%, var(--surface)); font-weight: 600; }
/* a long select inside the controls (Encuestas históricas, "Elección") never pushes the page wider than a phone (2026-11-17) */
.controls label { min-width: 0; max-width: 100%; }
.controls select { min-width: 0; max-width: 100%; }
/* the expected seats, a fixed tick on the slider of "Fija los escaños de" (2026-11-17) */
.cond-pista { position: relative; flex: 1 1 160px; min-width: 120px; max-width: 320px; display: inline-flex; align-items: center; }
.cond-pista .cond-v { flex: 1 1 auto; width: 100%; max-width: none; min-width: 0; margin: 0; }
.cond-esp { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; pointer-events: none; opacity: .75; }
/* "¿Quién llega a 176?" and "fuerza más votada" (Víctor, 2026-11-17): a party's card in its colour in full with black text; a
   bloc's card striped, soft, so its small text stays clean */
.q176-c.q176-der:not(.q176-bloque) { background: #1d84ce; border-color: #1d84ce; }
.q176-c.q176-izq:not(.q176-bloque) { background: #e30613; border-color: #e30613; }
.q176-c.q176-vox { background: #4f9e17; border-color: #4f9e17; }
.q176-c:is(.q176-der, .q176-izq, .q176-vox):not(.q176-bloque) :is(.q176-n, .q176-t, .q176-r) { color: #000; }
.q176-c.q176-der.q176-bloque { background: repeating-linear-gradient(45deg, color-mix(in srgb, #1d84ce 30%, var(--surface)) 0 6px, color-mix(in srgb, #1d84ce 12%, var(--surface)) 6px 12px); border-color: #1d84ce; }
.q176-c.q176-izq.q176-bloque { background: repeating-linear-gradient(45deg, color-mix(in srgb, #e30613 26%, var(--surface)) 0 6px, color-mix(in srgb, #e30613 10%, var(--surface)) 6px 12px); border-color: #e30613; }
.vt-lineas { margin: 10px 0 0; padding-left: 18px; font-size: var(--t-s); line-height: 1.5; }
.vt-lineas li { margin: 3px 0; }
.vt-noche { display: flex; flex-direction: column; gap: 4px; }
.vt-noche .seg { -webkit-mask-image: none; mask-image: none; overflow: visible; flex-wrap: wrap; }

/* Opciones de escaño por partido and Juega a simular la noche (src/opciones.js) */
.op-filas { display: grid; gap: 5px; margin: 10px 0 6px; max-width: 760px; }
.op-fila { display: grid; grid-template-columns: 7.5em 1fr auto; align-items: center; gap: 8px; font-size: 0.9rem; }
.op-nom { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-barra { display: flex; height: 16px; }
.op-seg { height: 100%; cursor: pointer; box-sizing: border-box; border: 1.5px solid var(--c); }
.op-seg + .op-seg { border-left-width: 0; }
.op-seguro { background: var(--c); }
.op-probable { background: color-mix(in srgb, var(--c) 45%, var(--surface)); }
.op-juego { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 30%, var(--surface)) 0 3px, var(--surface) 3px 6px); }
.op-n { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; font-size: 0.85rem; }
.op-n b { font-weight: 600; color: var(--ink); }
.sm { padding: 12px 14px; }
.sm-bot { margin-bottom: 10px; flex-wrap: wrap; }
.sm-fila { margin: 10px 0 4px; }
.sm-cab { font-size: 0.9rem; margin-bottom: 5px; }
.sm-tag { border-color: var(--c) !important; }
.sm-tag.pl-seguro { background: var(--c); }
.sm-tag.pl-probable { background: color-mix(in srgb, var(--c) 45%, var(--surface)); }
.sm-cuadros { display: flex; flex-wrap: wrap; gap: 2px; min-height: 10px; }
.sm-q { width: 9px; height: 9px; box-sizing: border-box; border: 1px solid var(--ink-2); background: var(--surface); }
.sm-q.sm-si { background: var(--c); border-color: var(--c); }
.sm-cuenta { font-size: 0.85rem; color: var(--ink-2); margin-top: 4px; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .op-fila { grid-template-columns: 6em 1fr auto; } }

/* joint view of the Modelo histograms (src/conjunta.js) */
.cj-ctl { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.cj-svg { width: 100%; max-width: 700px; height: auto; display: block; }
.cj-eje { font-size: 12px; fill: var(--ink-2); }
.cj-3d { display: block; max-width: 100%; cursor: grab; touch-action: none; }
.cj-3d:active { cursor: grabbing; }
.cj-nota { max-width: 700px; }

/* ==== "¿Quién llega a 176?" and "fuerza más votada", compact (Víctor, 2026-11-18: "ocupa muchísimo; algo mucho más pequeño y
   discreto") · start ====
   One thin row per card instead of a coloured box: a small swatch (solid for a party, hatched for a bloc), the label and the
   expected seats on the left, the frequency on the right. The !important lines beat the earlier, more specific card rules
   (the box colours of 2026-11-17 and the tablero's), which stay above for the record. */
.q176, .tb-izq .q176 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 2px 0 4px; max-width: 460px; }
.q176.q176-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 14px; }
.tb-izq .q176.q176-3 { grid-template-columns: minmax(0, 1fr); }   /* the narrow left card: one row each */
.tb-izq .q176.q176-3 .q176-c { border-bottom: 1px solid var(--line) !important; } .tb-izq .q176.q176-3 .q176-c:last-child { border-bottom: 0 !important; }
.q176 .q176-c { display: grid; grid-template-columns: 11px minmax(0, 1fr) auto; grid-template-areas: "sw t n" "sw r n";
  column-gap: 9px; align-items: center; padding: 5px 0 !important; background: none !important; border: 0 !important;
  border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; }
.q176 .q176-c:last-child { border-bottom: 0 !important; }
.q176 .q176-c::before { content: ""; grid-area: sw; width: 11px; height: 11px; border-radius: 2px; background: var(--sw, var(--ink-3)); }
.q176 .q176-der { --sw: #1d84ce; } .q176 .q176-izq { --sw: #e30613; } .q176 .q176-vox { --sw: #4f9e17; }
.q176 .q176-bloque::before { background: repeating-linear-gradient(45deg, var(--sw) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 1px var(--sw); }
.q176 .q176-c .q176-n { grid-area: n; font-family: inherit; font-size: 15px !important; font-weight: 700; color: var(--ink) !important; white-space: nowrap; text-align: right; }
.q176 .q176-c .q176-t { grid-area: t; margin: 0; font-size: 13px; line-height: 1.3; color: var(--ink) !important; }
.q176 .q176-c .q176-r { grid-area: r; margin: 0; font-size: 12px; line-height: 1.25; color: var(--muted) !important; }
.q176.q176-3 .q176-c { grid-template-areas: "sw t n"; border-bottom: 0 !important; }
/* ==== compact 176 · end ==== */
/* "Cómo vamos, día a día" (src/dia.js, 2026-11-18) */
.dia { margin: 14px 0 6px; }
.tablero .dia { max-width: 900px; margin: 18px 0 10px; }
.dia-ctl { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 4px 0 6px; }
.dia-ctl .seg button { padding: 4px 9px; font-size: var(--t-s); }
.dia-frase p { margin: 2px 0 4px; font-size: 14px; }
.dia-chart svg { display: block; width: 100%; height: auto; }
.dia-176 { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 4 3; }
.dia-176-t, .dia-lab { font-size: 12px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.dia-nota p { margin-top: 2px; }
/* ==== "Provincia a provincia" (src/mosaico.js, 2026-11-18) · start ==== */
.mz-ctl { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 6px 0 8px; }
.mz-ctl .seg button { padding: 4px 9px; font-size: var(--t-s); line-height: 1.15; }
.mz-c button small { display: block; font-size: 11px; opacity: .75; font-variant-numeric: tabular-nums; }
.mz-wrap { position: relative; max-width: 620px; }
.mz-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; align-items: start; }
.mz-t { font: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 2px 2px 3px; cursor: pointer; min-width: 0; text-align: left; }
.mz-t:hover { border-color: var(--ink-3); }
.mz-t.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.mz-ab { display: block; font-size: 9px; line-height: 1.2; color: var(--ink-2); font-weight: 600; text-align: center; }
.mz-qs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; }
.mz-q { display: block; aspect-ratio: 1; border-radius: 1px; background: var(--c); }
.mz-q.op-probable { background: color-mix(in srgb, var(--c) 45%, var(--surface)); }
.mz-q.op-juego { background: repeating-linear-gradient(135deg, var(--c) 0 1px, var(--surface) 1px 2.5px); box-shadow: inset 0 0 0 0.5px var(--c); }
.mz-otra { font: inherit; font-size: var(--t-s); color: var(--ink-2); background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline; }
.mz-ficha { margin-top: 10px; max-width: 620px; }
.mz-cab { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 8px; font-size: var(--t-s); }
.mz-cab select { max-width: 100%; }
.mz-tabs { margin-bottom: 8px; }
.mz-tabs button { padding: 4px 10px; font-size: var(--t-s); }
.mz-tab { width: 100%; font-size: var(--t-s); }
.mz-tab td { vertical-align: middle; }
.mz-mini { display: inline-flex; flex-wrap: wrap; gap: 1px; max-width: 70px; vertical-align: middle; }
.mz-mini .mz-q { width: 8px; height: 8px; }
.mz-filas { display: grid; gap: 10px; margin: 6px 0; }
.mz-fila { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; font-size: var(--t-s); }
.mz-pista { position: relative; height: 22px; margin: 12px 8px 0 0; }
.mz-pista > i { position: absolute; top: 0; bottom: 0; background: var(--c); }
.mz-caja { position: absolute; top: -1px; bottom: -1px; border: 1.5px solid var(--ink-2); border-radius: 2px; box-sizing: border-box; }
.mz-med { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; background: var(--ink); border-radius: 1px; }
.mz-et { position: absolute; top: -14px; transform: translateX(-50%); font-size: 10px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mz-leg { font-size: 12px; }
.mz-sw-g { display: inline-block; width: 22px; height: 9px; margin-right: 4px; vertical-align: -1px; background: linear-gradient(to right, color-mix(in srgb, var(--ink-2) 10%, transparent), var(--ink-2)); }
.mz-sw-m { display: inline-block; width: 3px; height: 12px; margin-right: 4px; vertical-align: -2px; background: var(--ink); }
.mz-sw-c { display: inline-block; width: 16px; height: 9px; margin-right: 4px; vertical-align: -1px; border: 1.5px solid var(--ink-2); border-radius: 2px; }
@media (max-width: 480px) { .mz-grid { gap: 2px; } .mz-ab { font-size: 8px; } .mz-fila { grid-template-columns: 80px 1fr; } }
/* ==== Provincia a provincia · end ==== */
/* the shade under each range: darker where more simulations fall, a thin box with 9 in 10 (resultados.js densEscanos, 2026-11-18) */
.rg-d { position: absolute; top: 3px; height: 10px; }
.rg-caja { position: absolute; top: 2px; height: 12px; border: 1px solid var(--ink-3); border-radius: 3px; box-sizing: border-box; }
.rg-enc { position: absolute; top: -3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--ink-3); opacity: .55; }   /* one poll of the last month (2026-11-18) */
