/* 29n.voto — hoja de estilos común
   Concepto: interfaz amable de estilo shadcn/ui (neutros zinc, tarjetas con borde suave, radios generosos)
   con un único acento propio del tema: el sepia de la papeleta del Senado. El color de partido solo aparece en los datos. */
@font-face { font-family: "Geist"; src: url("fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
:root {
  --bg: #ffffff;
  --fg: #09090b;
  --card: #ffffff;
  --muted: #f4f4f5;
  --muted-fg: #6b6b74;
  --border: #e4e4e7;
  --primary: #18181b;
  --primary-fg: #fafafa;
  --ring: #a1a1aa;
  --sepia: #a8743f;
  --sepia-ink: #8c5c2c; /* sepia para texto: contraste suficiente sobre blanco y sobre --sepia-soft */
  --sepia-soft: #fbf5ee;
  --sepia-line: #ecd9c3;
  --info: #2563eb;
  --good: #15803d;
  --live: #dc2626;
  /* Mapa del cambio (escala de dos colores): sube / baja; validados con el validador de paletas (claro y oscuro) */
  --chg-up: #b0661f;
  --chg-down: #3a6db5;
  --shadow: 0 1px 2px rgba(9, 9, 11, 0.05), 0 1px 3px rgba(9, 9, 11, 0.04);
  --shadow-lg: 0 10px 30px -12px rgba(9, 9, 11, 0.18);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b; --fg: #fafafa; --card: #0f0f12; --muted: #18181b; --muted-fg: #a1a1aa;
    --border: #27272a; --primary: #fafafa; --primary-fg: #18181b; --ring: #52525b;
    --sepia: #d9a873; --sepia-ink: #d9a873; --sepia-soft: #1d1710; --sepia-line: #3d2f20; --info: #60a5fa; --good: #4ade80; --live: #f87171;
    --chg-up: #c27a32; --chg-down: #5b8bd6;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-lg: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #09090b; --fg: #fafafa; --card: #0f0f12; --muted: #18181b; --muted-fg: #a1a1aa;
  --border: #27272a; --primary: #fafafa; --primary-fg: #18181b; --ring: #52525b;
  --sepia: #d9a873; --sepia-ink: #d9a873; --sepia-soft: #1d1710; --sepia-line: #3d2f20; --info: #60a5fa; --good: #4ade80; --live: #f87171;
    --chg-up: #c27a32; --chg-down: #5b8bd6;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-lg: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

/* Cambio de página suave (transiciones entre documentos, en los navegadores que las admiten): el contenido se
   funde y la cabecera se queda en su sitio */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .site-header { view-transition-name: cabecera; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
  ::view-transition-group(cabecera) { animation-duration: .22s; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
html.i18n-pending body { visibility: hidden; }
.site-header:empty { min-height: 93px; }
.site:empty { min-height: 240px; }
.wrap {
  max-width: 1080px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
a { color: var(--fg); font-weight: 500; text-decoration: underline; text-decoration-color: var(--ring); text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--fg); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--bg); padding: 6px 10px; z-index: 40; }

/* ---------- Cabecera fija ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding-block: 12px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); flex: none; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: var(--primary-fg);
  display: grid; place-items: center; font-weight: 700; font-size: 14px; letter-spacing: -0.02em; position: relative;
}
.brand .mark::after { content: ""; position: absolute; left: 7px; right: 7px; bottom: 5px; height: 2px; border-radius: 2px; background: var(--sepia); }
.brand .word { font-weight: 650; font-size: 17px; letter-spacing: -0.02em; }
.brand .word span { color: var(--muted-fg); font-weight: 500; }
.mainnav { min-width: 0; }
.mainnav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.mainnav ul::-webkit-scrollbar { display: none; }
/* Si el menú no cabe: difuminado en el lado (o los dos) donde quedan más páginas (app.js pone fade-l / fade-r) */
.mainnav ul.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
.mainnav ul.fade-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px); mask-image: linear-gradient(90deg, transparent, #000 36px); }
.mainnav ul.fade-l.fade-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
.mainnav a {
  display: block; padding: 6px 10px; border-radius: 8px; white-space: nowrap;
  font-size: 14px; font-weight: 500; color: var(--muted-fg); text-decoration: none; transition: color .15s, background .15s;
}
.mainnav a:hover { color: var(--fg); background: var(--muted); }
.mainnav a[aria-current="page"] { color: var(--fg); background: var(--muted); }
.header-cta { flex: none; }
.langs { display: inline-flex; flex: none; padding: 2px; border: 1px solid var(--border); border-radius: 9px; background: var(--muted); }
.langs a { font-size: 12px; font-weight: 600; text-decoration: none; color: var(--muted-fg); padding: 4px 7px; border-radius: 7px; line-height: 1.2; }
.langs a:hover { color: var(--fg); }
.langs a[aria-current="true"] { background: var(--card); color: var(--fg); box-shadow: var(--shadow); }
.mainnav { order: 3; flex-basis: 100%; margin-inline: -10px; padding-bottom: 6px; }
/* Botón de tema (automático, claro, oscuro), junto a los idiomas */
.tema-btn { flex: none; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 9px; background: var(--muted); color: var(--muted-fg); cursor: pointer; }
.tema-btn:hover { color: var(--fg); }
.tema-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.tema-btn svg { width: 15px; height: 15px; }
.site-header .wrap > .langs { margin-left: auto; }
.site-header .brand { margin-right: 0; }
@media (max-width: 640px) { .site-header .header-cta { display: none; } .site-header .wrap { column-gap: 8px; } }
@media (max-width: 380px) { .langs a { padding: 4px 5px; } .brand .word { font-size: 16px; } .brand { gap: 8px; } }
/* Móviles muy estrechos (320 px): solo la marca, para que idiomas y tema quepan en la misma línea */
@media (max-width: 345px) { .brand .word { display: none; } }

/* ---------- Botones e insignias ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px; font-size: 14px; font-weight: 550;
  text-decoration: none; border: 1px solid transparent; transition: background .15s, border-color .15s, transform .15s;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 88%, var(--bg)); }
.btn-outline { background: var(--card); color: var(--fg); border-color: var(--border); box-shadow: var(--shadow); }
.btn-outline:hover { background: var(--muted); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sepia); }
.badge, .kicker {
  display: inline-flex; align-items: center; gap: 6px; width: max-content; max-width: 100%;
  font-size: 12.5px; font-weight: 550; line-height: 1; padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card); color: var(--fg); margin: 0;
}
.kicker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sepia); flex: none; }
.badge.sepia { background: var(--sepia-soft); border-color: var(--sepia-line); color: var(--sepia-ink); }
.badge.info { color: var(--info); }

/* ---------- Cabecera de página ---------- */
.page-head { padding-block: 48px 28px; display: grid; gap: 14px; justify-items: start; }
h1 {
  font-weight: 700; font-size: clamp(32px, 5vw, 48px); line-height: 1.05; letter-spacing: -0.035em;
  margin: 0; text-wrap: balance; max-width: 22ch;
}
.standfirst { font-size: clamp(17px, 2vw, 19px); line-height: 1.55; color: var(--muted-fg); margin: 0; max-width: 60ch; }
/* Mapa en el móvil: sin la entradilla y con menos aire, para que el mapa se vea nada más cargar */
@media (max-width: 620px) {
  [data-page="mapa"] .page-head { padding-block: 22px 14px; gap: 8px; }
  [data-page="mapa"] .standfirst { display: none; }
}
.meta { font-size: 13.5px; color: var(--muted-fg); margin: 0; }
.meta a { color: var(--muted-fg); }
h2 { font-weight: 650; font-size: clamp(22px, 2.6vw, 28px); line-height: 1.2; letter-spacing: -0.025em; margin: 0 0 8px; text-wrap: balance; }
h3 { font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.prose { max-width: 68ch; }
.prose ul, .prose ol { padding-left: 20px; margin: 0 0 14px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--muted-fg); }
.muted { color: var(--muted-fg); }
.small { font-size: 13.5px; }
.num { font-variant-numeric: tabular-nums; }

section.block { padding-block: 40px 4px; }

/* ---------- Pestañas (Cómo votar: en tu colegio, por correo, desde el extranjero) ---------- */
.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 4px 0 8px; }
.tabs a { display: grid; gap: 3px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); color: var(--fg); text-decoration: none; box-shadow: var(--shadow); transition: border-color .15s, background .15s; }
.tabs a:hover { border-color: var(--ring); }
.tabs a b { font-size: 15.5px; font-weight: 650; letter-spacing: -0.01em; }
.tabs a span { font-size: 13px; color: var(--muted-fg); }
.tabs a[aria-current] { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.tabs a[aria-current] span { color: inherit; opacity: .75; }
@media (max-width: 620px) {
  .tabs { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .tabs a { grid-template-columns: auto 1fr; align-items: baseline; gap: 10px; padding: 10px 14px; }
  .tabs a span { text-align: right; }
}
.tab-panel[hidden] { display: none; }
.tab-head { padding-top: 28px; display: grid; gap: 10px; }
.tab-head .tab-h { font-size: clamp(24px, 3.2vw, 32px); max-width: 30ch; margin: 0; }
.tab-head .lead { font-size: 17px; line-height: 1.55; color: var(--muted-fg); margin: 0; max-width: 64ch; }
/* Sin JavaScript se ven las tres guías seguidas: cada una, separada por una línea */
html:not(.con-pestanas) .tab-panel + .tab-panel { border-top: 1px solid var(--border); margin-top: 40px; }
.intro { color: var(--muted-fg); max-width: 66ch; margin: 0 0 22px; }

/* ---------- Rejillas ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lead-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .lead-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.grid-2 > *, .grid-3 > *, .lead-grid > * { min-width: 0; }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px;
}
.card > :last-child { margin-bottom: 0; }
.grid-3 > div, .grid-2 > .card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.grid-3 > div > :last-child, .grid-2 > .card > :last-child { margin-bottom: 0; }
.grid-2 > figure { margin: 0; }

/* ---------- Portada: héroe ---------- */
.hero { padding-block: 56px 16px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: center; }
@media (max-width: 860px) { .hero { grid-template-columns: minmax(0, 1fr); padding-top: 36px; } }
.hero-copy { display: grid; gap: 18px; justify-items: start; }
.hero-copy h1 { font-size: clamp(36px, 5.6vw, 56px); max-width: 15ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.countdown-card {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 22px;
}
.countdown-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 16px 16px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.6), transparent 60%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.6), transparent 60%);
}
.countdown-card > * { position: relative; }
.cd-label { font-size: 13px; color: var(--muted-fg); margin: 0; }
.cd-big { font-size: 64px; font-weight: 700; letter-spacing: -0.05em; line-height: 1; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.cd-sub { font-size: 14px; color: var(--muted-fg); margin: 0 0 18px; }
.next-dates { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.next-dates li { display: flex; gap: 14px; align-items: baseline; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.next-dates li:last-child { border-bottom: 0; padding-bottom: 0; }
.next-dates .d { font-family: var(--mono); font-size: 12.5px; color: var(--muted-fg); min-width: 54px; font-variant-numeric: tabular-nums; }

/* ---------- Ficha de datos ---------- */
aside.facts { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
aside.facts h2 { font-size: 14px; font-weight: 600; letter-spacing: 0; margin: 0 0 4px; }
.facts dl { margin: 0; }
.facts .row { display: flex; justify-content: space-between; gap: 16px; padding-block: 9px; border-bottom: 1px solid var(--border); font-size: 14px; }
.facts .row:last-child { border-bottom: 0; }
.facts dt { color: var(--muted-fg); }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.src { font-size: 12.5px; color: var(--muted-fg); margin: 10px 0 0; }
.src a { color: var(--muted-fg); }

/* ---------- Portada: tarjetas de guía ---------- */
.index-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .index-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 580px) { .index-list { grid-template-columns: minmax(0, 1fr); } }
.index-list a {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; color: var(--fg); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.index-list a:hover { border-color: var(--ring); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .index-list a:hover { transform: none; } }
.index-list .icon {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px;
  background: var(--muted); color: var(--fg); border: 1px solid var(--border);
}
.index-list .icon svg { width: 20px; height: 20px; }
.index-list .when { font-size: 12.5px; font-weight: 550; color: var(--sepia-ink); }
.index-list h3 { margin: 0; }
.index-list p { color: var(--muted-fg); font-size: 14px; margin: 2px 0 0; flex: 1; }
.index-list .go { font-size: 13.5px; font-weight: 550; margin-top: 14px; display: inline-flex; align-items: center; gap: 6px; }
.index-list .go svg { width: 15px; height: 15px; transition: transform .15s; }
.index-list a:hover .go svg { transform: translateX(3px); }

/* ---------- Papeletas ---------- */
.ballots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 620px) { .ballots { grid-template-columns: minmax(0, 1fr); } }
.ballot { border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.ballot.senado { background: var(--sepia-soft); border-color: var(--sepia-line); }
.ballot header { padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: 13.5px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.ballot header .muted, .ballot.senado header span + span { font-size: 12.5px; font-weight: 500; }
.ballot.senado header { border-bottom-color: var(--sepia-line); color: var(--sepia-ink); }
.ballot .body { padding: 18px; }
.ballot .n { font-size: 56px; font-weight: 700; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.ballot .what { font-weight: 550; margin: 4px 0 12px; }
.ballot ul { list-style: none; margin: 0; padding: 0; font-size: 14px; color: var(--muted-fg); display: grid; gap: 4px; }
.ballot ul li::before { content: "✓"; color: var(--sepia); margin-right: 8px; font-weight: 700; }

/* ---------- Pasos ---------- */
ol.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 12px; }
ol.steps > li {
  counter-increment: s; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px;
}
ol.steps > li::before {
  content: counter(s); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 650; font-size: 15px; background: var(--primary); color: var(--primary-fg);
}
ol.steps h3 { margin-top: 6px; }
ol.steps p { color: var(--muted-fg); max-width: 66ch; margin-bottom: 8px; }
ol.steps p:last-child { margin-bottom: 0; }
ol.steps p strong { color: var(--fg); font-weight: 600; }

/* ---------- Avisos ---------- */
.note {
  display: block; border: 1px solid var(--sepia-line); background: var(--sepia-soft);
  border-radius: var(--radius-sm); padding: 14px 16px 14px 44px; margin: 16px 0; max-width: 76ch; position: relative;
}
.note::before {
  content: "!"; position: absolute; left: 14px; top: 14px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--sepia); color: var(--bg);
}
.note p:last-child { margin-bottom: 0; }
.note strong { font-weight: 600; }
.note.plain { border-color: var(--border); background: var(--card); box-shadow: var(--shadow); padding: 20px 22px; margin: 0; max-width: none; }
.note.plain::before { content: none; }
.note.plain p { color: var(--muted-fg); }
.note.plain p strong { color: var(--fg); }

/* ---------- Tablas ---------- */
.table-scroll + p { margin-top: 10px; }
.table-scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-size: 13.5px; font-weight: 550; padding: 14px 16px 4px; }
thead th { text-align: left; font-size: 13px; font-weight: 550; color: var(--muted-fg); border-bottom: 1px solid var(--border); padding: 12px 16px; vertical-align: bottom; background: color-mix(in srgb, var(--muted) 55%, var(--card)); }
tbody td, tbody th { border-bottom: 1px solid var(--border); padding: 12px 16px; vertical-align: top; text-align: left; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody th { font-weight: 550; }
tbody tr:hover td, tbody tr:hover th { background: color-mix(in srgb, var(--muted) 45%, transparent); }
td.r, th.r { text-align: right; white-space: nowrap; }
tr.total td { font-weight: 650; border-top: 1px solid var(--border); }
tr.key td, tr.key th { background: var(--sepia-soft); }
.party { display: inline-flex; align-items: center; gap: 10px; font-weight: 550; }
.party i { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* ---------- Calendario ---------- */
.timeline { list-style: none; margin: 0; padding: 8px 22px 16px; position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.timeline::before { content: ""; position: absolute; left: 133px; top: 70px; bottom: 28px; width: 1px; background: var(--border); }
.timeline li { display: grid; grid-template-columns: 96px 30px minmax(0, 1fr); align-items: start; padding-block: 11px; }
.timeline .d { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; font-size: 14px; line-height: 1.3; }
.timeline .d span { display: block; font-weight: 400; color: var(--muted-fg); font-size: 12.5px; }
.timeline .dot { width: 13px; height: 13px; border-radius: 50%; background: var(--card); border: 2px solid var(--ring); margin: 3px 0 0 9px; position: relative; z-index: 1; }
/* Hitos pasados: en gris, sin bajar el contraste por debajo de lo legible */
.timeline li.past, .timeline li.past h3, .timeline li.past p, .timeline li.past .d { color: var(--muted-fg); }
.timeline li.past .dot { background: var(--ring); }
.timeline li.today .dot { background: var(--sepia); border-color: var(--sepia); box-shadow: 0 0 0 4px var(--sepia-soft); }
.timeline .now-badge { margin-left: 8px; font-size: 11.5px; font-weight: 600; color: var(--sepia-ink); background: var(--sepia-soft); border: 1px solid var(--sepia-line); padding: 2px 8px; border-radius: 999px; vertical-align: 2px; }
.timeline li.big .dot { width: 17px; height: 17px; margin-left: 7px; background: var(--primary); border-color: var(--primary); }
.timeline .t h3 { font-size: 15.5px; margin: 0 0 2px; }
.timeline .t p { margin: 0; color: var(--muted-fg); font-size: 14px; max-width: 62ch; }
.timeline .tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; margin-left: 6px; border-radius: 999px; vertical-align: 2px; border: 1px solid var(--border); background: var(--muted); }
.timeline .tag.postal { color: var(--info); }
.timeline .tag.ext { color: var(--sepia-ink); background: var(--sepia-soft); border-color: var(--sepia-line); }
.timeline .month { display: block; position: relative; z-index: 1; font-weight: 650; font-size: 18px; letter-spacing: -0.02em; padding: 22px 0 6px; background: var(--card); }
.timeline .month:first-child { padding-top: 14px; }
@media (max-width: 520px) {
  .timeline { padding-inline: 14px; }
  .timeline::before { left: 105px; }
  .timeline li { grid-template-columns: 70px 30px minmax(0, 1fr); }
  .timeline .d { font-size: 13px; }
}

/* ---------- Figuras ---------- */
figure { margin: 0; }
figure svg { display: block; width: 100%; height: auto; }
figcaption { font-size: 13px; color: var(--muted-fg); margin-top: 10px; }
.figure-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }

/* ---------- Preguntas frecuentes (acordeón) ---------- */
.faq { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0 20px; max-width: 820px; }
details { border-bottom: 1px solid var(--border); padding-block: 16px; }
details:last-child { border-bottom: 0; }
summary { cursor: pointer; font-weight: 550; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ""; width: 8px; height: 8px; border-right: 1.5px solid var(--muted-fg); border-bottom: 1.5px solid var(--muted-fg);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; flex: none;
}
details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
summary:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--ring); }
details > div { padding-top: 10px; color: var(--muted-fg); }
details > div p:last-child { margin-bottom: 0; }

/* ---------- Recuento ---------- */
.status-bar {
  display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center;
  padding: 16px 20px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  font-size: 14px;
}
.status-bar .state { font-weight: 600; display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 999px; background: var(--muted); }
.status-bar .state i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-fg); }
.status-bar .state.live i { background: var(--live); animation: pulse 1.6s ease-in-out infinite; }
.status-bar .state.final i { background: var(--good); }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .status-bar .state.live i { animation: none; } }
.status-bar > span:not(.state) { color: var(--muted-fg); }
.status-bar b { color: var(--fg); font-variant-numeric: tabular-nums; font-weight: 600; }
.meter { height: 6px; background: var(--muted); border-radius: 999px; margin: 12px 0 8px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--primary); width: 0; border-radius: 999px; transition: width .6s ease; }
@media (prefers-reduced-motion: reduce) { .meter span { transition: none; } }
.seatbar { display: flex; height: 30px; border-radius: 8px; overflow: hidden; position: relative; margin: 14px 0 6px; background: var(--muted); }
.seatbar span { height: 100%; }
.seatbar span + span { box-shadow: inset 1px 0 0 var(--card); }
.seatbar .maj { position: absolute; left: 50.29%; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--fg); opacity: .8; }
.seatbar-legend { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted-fg); }

/* ---------- Pie ---------- */
footer.site { margin-top: 64px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--muted) 40%, var(--bg)); padding-block: 36px 28px; font-size: 14px; color: var(--muted-fg); }
footer.site .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
@media (max-width: 720px) { footer.site .cols { grid-template-columns: minmax(0, 1fr); } }
footer.site h4, footer.site .foot-h { font-size: 13.5px; font-weight: 600; color: var(--fg); margin: 0 0 10px; }
footer.site ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
footer.site a { color: var(--muted-fg); text-decoration: none; font-weight: 400; }
footer.site a:hover { color: var(--fg); }
footer.site .legal { border-top: 1px solid var(--border); margin-top: 28px; padding-top: 18px; font-size: 13px; }
.sel { user-select: all; font-family: var(--mono); font-size: 13.5px; }

.link-card { display: block; color: var(--fg); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.link-card:hover { border-color: var(--ring); box-shadow: var(--shadow-lg); }
.link-card h3::after { content: " →"; color: var(--muted-fg); }
[id] { scroll-margin-top: 110px; }
.legal-doc h2 { font-size: 19px; margin-top: 28px; }
.legal-doc h2:first-child { margin-top: 0; }

/* ---------- Mapa ---------- */
.map-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.seg { display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--muted); }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; white-space: nowrap; font: inherit; font-size: 13.5px; font-weight: 550; color: var(--muted-fg); background: none; border: 0; padding: 6px 12px; border-radius: 7px; cursor: pointer; }
@media (max-width: 420px) { .seg button { padding: 6px 9px; font-size: 13px; } }
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--fg); box-shadow: var(--shadow); }
.select { font: inherit; font-size: 14px; color: var(--fg); background: var(--card); border: 1px solid var(--border); border-radius: 10px; height: 38px; padding: 0 12px; box-shadow: var(--shadow); }
.select:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }

.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .map-layout { grid-template-columns: minmax(0, 1fr); } }
.map-card { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; }

/* Lienzo del mapa. --u = unidades del mapa por píxel de pantalla (lo fija mapa.js al cambiar el zoom):
   los grosores de línea se calculan con él para que se vean igual a cualquier zoom. */
.mapa { --u: 1; position: relative; overflow: hidden; aspect-ratio: 1000 / 875; display: grid; place-items: center; border-radius: 8px; touch-action: pan-y; cursor: grab; }
.mapa.is-zoomed { touch-action: none; }
.mapa.is-dragging { cursor: grabbing; }
.mapa-svg { display: block; width: 100%; height: auto; transform-origin: 0 0; user-select: none; -webkit-user-select: none; }
.mapa.is-moving .mapa-svg { will-change: transform; }
.mapa-over { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; will-change: transform; }
.mapa-dim { fill: var(--card); }
.mapa-mun path { stroke: var(--card); stroke-width: calc(var(--u) * 0.35px); cursor: pointer; }
.mapa-prov path { fill: none; stroke: color-mix(in srgb, var(--fg) 45%, transparent); stroke-width: calc(var(--u) * 0.6px); pointer-events: none; }
.mapa-ccaa path { fill: none; stroke: color-mix(in srgb, var(--fg) 80%, transparent); stroke-width: calc(var(--u) * 1px); pointer-events: none; }
.mapa-canarias { fill: none; stroke: var(--border); stroke-width: calc(var(--u) * 1px); }
.mapa-sel path { fill: none; pointer-events: none; stroke-linejoin: round; stroke: var(--fg); }
.mapa-sel .hover { stroke-width: calc(var(--u) * 1.5px); }
.mapa-sel .prov { stroke-width: calc(var(--u) * 1.5px); }
.mapa-sel .active { stroke-width: calc(var(--u) * 2.5px); }
.mapa.is-deep .mapa-ccaa { display: none; }
.mapa.is-deep .mapa-prov path { stroke: color-mix(in srgb, var(--fg) 75%, transparent); stroke-width: calc(var(--u) * 1.2px); }
.mapa.is-deep .mapa-mun path { stroke-width: calc(var(--u) * 0.6px); }

/* Controles sobre el mapa: zoom abajo a la izquierda (en el mar, sin tapar tierra), "Toda España" arriba a la derecha */
.map-stage { position: relative; }
.map-zoom { position: absolute; bottom: 10px; left: 10px; display: grid; gap: 6px; z-index: 2; }
.map-reset { position: absolute; top: 10px; right: 10px; z-index: 2; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 9px; }
.btn-icon svg { width: 16px; height: 16px; }
/* Instrucciones de gesto (centro, claras) */
.map-hint {
  position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); z-index: 3; pointer-events: none;
  background: color-mix(in srgb, var(--card) 94%, transparent); color: var(--fg); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  font-size: 13.5px; font-weight: 500; padding: 8px 14px; border-radius: 999px; opacity: 0; transition: opacity .2s, transform .2s; text-align: center; max-width: 80%;
}
.map-hint.show { opacity: 1; }
/* Avisos (abajo a la derecha, oscuros, con icono) */
.map-hint.abajo {
  /* Abajo a la derecha; como mucho, hasta los botones de zoom (abajo a la izquierda) */
  top: auto; left: auto; right: 12px; bottom: 12px; transform: translateY(6px); max-width: calc(100% - 68px);
  display: flex; align-items: center; gap: 9px; text-align: left; font-size: 13px; line-height: 1.35; border-radius: 12px; padding: 9px 13px 9px 11px;
  background: rgba(24, 24, 27, .94); color: #fafafa; border: 0; box-shadow: 0 10px 28px -8px rgba(0, 0, 0, .45);
}
.map-hint.abajo.show { transform: none; }
.map-hint.abajo svg { width: 17px; height: 17px; flex: none; color: #d9a873; }
.map-tip {
  position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; display: grid; gap: 3px; min-width: 170px; max-width: 240px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 10px 12px; font-size: 13px;
}
.map-tip[hidden] { display: none; }
.map-tip .row { display: flex; justify-content: space-between; gap: 12px; }
.map-tip .party { font-weight: 500; gap: 7px; }
.map-tip .party i { width: 8px; height: 8px; }

/* Leyenda: en el móvil se recorta a dos líneas con un "Ver todos" */
.map-legend { padding: 10px 4px 2px; border-top: 1px solid var(--border); margin-top: 8px; }
.map-legend p { margin: 6px 0 0; }

.legend-more { display: none; font: inherit; font-size: 13px; font-weight: 550; color: var(--fg); background: none; border: 0; padding: 4px 0 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--ring); text-underline-offset: 4px; }

.scale { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted-fg); }
.scale b { color: var(--fg); font-weight: 600; font-size: 13.5px; }
.scale i { height: 10px; flex: 1; max-width: 260px; border-radius: 999px; border: 1px solid var(--border); }

/* Móvil: el mapa ocupa todo el ancho de la pantalla */
@media (max-width: 620px) {
  .map-card { margin-inline: calc(-1 * max(20px, env(safe-area-inset-left, 0px))); border-radius: 0; border-inline: 0; padding: 0 0 10px; box-shadow: none; }
  .map-card .map-legend { margin-top: 0; }
  .map-globe { top: 6px; left: 8px; }
  .mapa { border-radius: 0; }
  .map-legend { padding-inline: 16px; }
  .map-zoom { bottom: 6px; left: 8px; }
  .map-zoom .btn-icon { width: 30px; height: 30px; }
  .map-reset { top: 6px; right: 8px; }
}

.map-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-height: 200px; }
.map-panel h2 { font-size: 20px; margin: 0; }
/* Botón % / Nº: pequeño, centrado sobre la línea de arriba de los datos de participación */
.facts-wrap { position: relative; display: flow-root; }
.facts-wrap .ver-tot { position: absolute; left: 50%; top: 5px; transform: translateX(-50%); z-index: 1; padding: 1px; border-radius: 7px; box-shadow: 0 0 0 4px var(--card); }
.facts-wrap .ver-tot button { min-width: 24px; padding: 0 6px; font-size: 10.5px; line-height: 1.6; text-align: center; border-radius: 5px; }
.facts-wrap .facts-mini { padding-top: 16px; }
.map-panel > p { margin: 2px 0 0; }
.facts-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; margin: 14px 0; padding: 12px 0; border-block: 1px solid var(--border); }
/* Sin huecos: con 4 datos (Senado, voto exterior), en dos columnas; con 3, 5 o 6, en tres */
.facts-mini:not(:has(.w2, .span2)):has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Panel ancho (tableta, móvil girado): todos en una fila si caben */
.map-panel { container-type: inline-size; }
@container (min-width: 560px) {
  .facts-mini:not(:has(.w2, .span2)):has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .facts-mini:not(:has(.w2, .span2)):has(> :nth-child(6):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.facts-mini dt { font-size: 12.5px; color: var(--muted-fg); }
.facts-mini dd { margin: 0; font-weight: 600; font-size: 15px; }
.bars { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 10px; font-size: 14px; }
.bars .party { font-weight: 550; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .seats { text-align: right; font-weight: 650; }
.bars .bar { grid-column: 1 / -1; height: 6px; background: var(--muted); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.bars .bar span { display: block; height: 100%; border-radius: 999px; }
.bars .votes { grid-column: 1 / -2; font-size: 12px; margin-top: 2px; }
.bars .votes-d { grid-column: -2 / -1; font-size: 12px; margin-top: 2px; text-align: right; white-space: nowrap; }
.bars .seats small { font-size: 11px; font-weight: 600; margin-left: 1px; }
.others-more { justify-self: end; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--fg); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.bars li > b small { font-size: 11.5px; font-weight: 500; color: var(--muted-fg); }
.bars li > b small.delta { font-weight: 650; }
.bars .votes-d b { font-weight: 650; color: var(--fg); }
/* La diferencia con la elección anterior, debajo del dato (en tres columnas no cabe al lado) */
.facts-mini dd .dd { display: block; font-size: 12px; font-weight: 550; line-height: 1.3; }
.facts-mini dd .dd .delta:not(.up):not(.down) { color: var(--muted-fg); }
.bars .others .party i { background: var(--ring); }

/* Secciones censales y Senado */
.mapa-secc path { stroke: var(--card); stroke-width: calc(var(--u) * 0.5px); cursor: pointer; }
.map-panel.is-loading { opacity: .6; transition: opacity .2s; }
.panel-actions { display: grid; gap: 8px; justify-items: start; margin-top: 4px; }
.panel-actions p { margin: 0; }
.link-back { font: inherit; font-size: 13px; font-weight: 550; color: var(--muted-fg); background: none; border: 0; padding: 0; margin-bottom: 10px; cursor: pointer; }
.link-back:hover { color: var(--fg); }
.circ-h { font-size: 14.5px; margin: 16px 0 6px; }
.cands { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 2px; }
.cands li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 16px; gap: 8px; align-items: baseline; font-size: 13.5px; padding: 5px 0; border-bottom: 1px dashed var(--border); color: var(--muted-fg); }
.cands li:last-child { border-bottom: 0; }
.cands li.is-elected { color: var(--fg); }
.cands li.is-elected .party { font-weight: 600; }
.cands .party { gap: 8px; min-width: 0; font-weight: 450; align-items: baseline; }
.cands .party i { transform: translateY(1px); }
.cands .elected { color: var(--good); font-weight: 700; }
.mapa-sel .secsel { stroke-width: calc(var(--u) * 2px); stroke-dasharray: none; }
.mapa-lab { pointer-events: none; }
.mapa-lab text { font-family: var(--font); font-weight: 600; font-size: calc(var(--u) * 10.5px); fill: var(--fg); text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke: color-mix(in srgb, var(--card) 85%, transparent); stroke-width: calc(var(--u) * 3px); stroke-linejoin: round; font-variant-numeric: tabular-nums; }
.lista { margin-top: 14px; }
.lista-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 0 0 6px; font-size: 14px; }
.lista-h .party { font-weight: 650; }
.cands li { grid-template-columns: minmax(0, 1fr) auto auto 16px; }
.cands .nom { min-width: 0; }
.mas-listas { border: 0; padding: 10px 0 0; }
.mas-listas summary { font-size: 13.5px; color: var(--fg); }
.senado-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 24px; }
.senado-grid .ccaa { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.senado-grid h3 { font-size: 13.5px; margin: 0 0 6px; }
.senado-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.senado-grid li { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--muted-fg); }
.senado-grid .circ { padding-top: 1px; }
.senado-grid .dots { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; min-width: 0; max-width: 70%; }
.senado-wrap { position: relative; margin-bottom: 24px; }
/* Composición: botón de vista y hemiciclos por comunidad */
.comp-vista { margin: 0 0 14px; }
.hemi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 12px; }
.hemi-ca { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px 10px; min-width: 0; }
.hemi-ca h3 { display: flex; align-items: center; font-size: 13.5px; margin: 0 0 6px; }
.hemi-ca h3 > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hemi-ca svg { display: block; width: 100%; height: auto; max-width: 240px; margin: 0 auto; }
.hemi-ca path { stroke: var(--card); stroke-width: 1.5; stroke-linejoin: round; cursor: pointer; transition: opacity .15s; }
.hemi-ca path.apagado { opacity: .3; }
.hemi-ca text { fill: var(--fg); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hemi-ley { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 12.5px; color: var(--muted-fg); }
.hemi-ley li { display: flex; }
.hemi-ley button { display: inline-flex; align-items: center; gap: 5px; font: inherit; color: inherit; background: none; border: 0; padding: 1px 3px; margin: 0 -3px; border-radius: 4px; cursor: pointer; }
.hemi-ley button:hover, .hemi-ley button:focus-visible { background: var(--muted); color: var(--fg); }
.sen-pop:has(.hemi-nombres) { max-width: 300px; }
.sen-pop:has(.hemi-nombres.largo) { max-width: min(460px, calc(100vw - 24px)); }
.hemi-nombres { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 2px; font-size: 12.5px; }
.hemi-nombres.largo { display: block; columns: 2; column-gap: 22px; }
.hemi-nombres.largo li { break-inside: avoid; margin-bottom: 2px; }
.hemi-nombres li::marker { color: var(--muted-fg); font-size: 11px; }
.hemi-nombres .muted { font-size: 11.5px; }
.comp-vista button { display: inline-flex; align-items: center; justify-content: center; padding: 5px 10px; }
.comp-vista svg { width: 18px; height: 18px; display: block; }
.hemi-ley i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
/* Recuento: hemiciclo de cada cámara (assets/hemiciclo.js) */
.camara-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin: 0 0 18px; }
.camara-head .comp-vista { margin: 0; }
.camara-sel button { padding-inline: 16px; }
.hemi-camara { position: relative; margin: 18px auto 4px; max-width: 760px; }
.hemi-svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: manipulation; }
.hemi-svg .asiento { cursor: pointer; transition: opacity .15s; }
.hemi-svg .asiento.apagado { opacity: .16; }
.hemi-svg circle.libre, .hemi-svg .libre rect:first-child { fill: var(--border); cursor: default; }
.hemi-svg .respaldo { fill: rgba(0, 0, 0, .24); pointer-events: none; }
.hemi-svg .hemi-suelo { fill: var(--muted); stroke: var(--border); stroke-width: 1; }
.hemi-svg .hemi-pupitre { fill: none; stroke: var(--muted-fg); stroke-opacity: .32; stroke-linecap: round; }
.hemi-svg .hemi-mesa { fill: var(--card); stroke: var(--fg); stroke-opacity: .35; stroke-width: 1.2; }
.hemi-svg .hemi-tribuna { fill: var(--muted-fg); opacity: .45; }
.hemi-svg .hemi-mayoria { stroke: var(--fg); stroke-width: 1.4; stroke-dasharray: 4 4; opacity: .5; }
.hemi-svg .hemi-num { fill: var(--fg); font-size: 38px; font-weight: 700; text-anchor: middle; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.hemi-svg .hemi-sub { fill: var(--muted-fg); font-size: 12.5px; font-weight: 550; text-anchor: middle; }
.hemi-svg.es-plano .hemi-num { font-size: 32px; }
.hemi-svg.es-plano .hemi-sub { font-size: 11.5px; }
.hemi-pop { pointer-events: none; }
.hemi-pop b { font-weight: 600; }
.hemi-ley-lg { justify-content: center; gap: 4px 14px; margin: 4px 0 0; font-size: 13.5px; }
.hemi-ley-lg i { width: 10px; height: 10px; border-radius: 3px; }
.hemi-ley button[aria-pressed="true"] { background: var(--muted); color: var(--fg); box-shadow: inset 0 0 0 1px var(--border); }
.hemi-ley .libre span { display: inline-flex; align-items: center; gap: 5px; }
.hemi-ley .libre i { background: var(--border); }
.skel-hemi { display: block; width: 100%; aspect-ratio: 420 / 218; border-radius: 999px 999px 14px 14px; }
@media (max-width: 560px) {
  .hemi-camara { margin-top: 12px; }
  .hemi-ley-lg { font-size: 12.5px; gap: 2px 10px; }
}

.hemi-ley b { color: var(--fg); font-weight: 600; }
@media (max-width: 560px) {
  .hemi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hemi-ca { padding: 10px 10px 8px; }
  .hemi-ca h3 { font-size: 12.5px; }
  .hemi-ley { font-size: 11.5px; gap: 2px 8px; }
  .hemi-nombres.largo { columns: 1; }
}
.senado-wrap .senado-grid { margin-bottom: 0; }
.senado-grid .dots button { width: 14px; height: 14px; border-radius: 50%; display: block; border: 0; padding: 0; cursor: pointer; box-shadow: 0 0 0 1.5px var(--card); }
.senado-grid .dots button:hover, .senado-grid .dots button:focus-visible { box-shadow: 0 0 0 1.5px var(--card), 0 0 0 3px var(--fg); outline: none; }
@media (pointer: coarse) { .senado-grid .dots { gap: 6px; } .senado-grid .dots button { width: 20px; height: 20px; } }
.sen-pop {
  position: absolute; left: 0; top: 0; z-index: 5; display: grid; gap: 3px; max-width: 260px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 10px 12px; font-size: 13px;
}
.sen-pop[hidden] { display: none; }
.sen-pop .party { gap: 7px; font-weight: 550; }
.sen-pop .party i { width: 8px; height: 8px; }

/* Móvil: botón flotante entre el mapa y su detalle */
.map-fab {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 25;
  font: inherit; font-size: 14.5px; font-weight: 600; color: var(--primary-fg); background: var(--primary);
  border: 0; border-radius: 999px; padding: 11px 20px; box-shadow: 0 8px 24px -6px rgba(0, 0, 0, .35); cursor: pointer;
}
.map-fab[hidden] { display: none; }
/* Entrada y salida con transición; el texto se funde al cambiar entre "Ver resultados" y "Volver al mapa" */
.map-fab { opacity: 0; transform: translate(-50%, 18px) scale(.96); pointer-events: none; transition: opacity .25s ease, transform .3s cubic-bezier(.2, .8, .2, 1), background-color .2s; }
.map-fab.on { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.map-fab.on:active { transform: translate(-50%, 0) scale(.97); }
.map-fab span { display: inline-flex; align-items: center; gap: 6px; transition: opacity .14s ease, transform .14s ease; }
.map-fab.cambia span { opacity: 0; transform: translateY(4px); }
.map-fab b { font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .map-fab, .map-fab span { transition: none; } }
@media (min-width: 901px) { .map-fab { display: none; } }
.facts-mini .span2 { grid-column: 1 / -1; }
.facts-mini .w2 { grid-column: span 2; }
.facts-mini .avances { display: flex; flex-wrap: wrap; gap: 4px 14px; font-weight: 400; font-size: 13.5px; color: var(--muted-fg); }
.facts-mini .avances b { color: var(--fg); font-weight: 600; }
.dips { margin: 2px 0 0; padding-left: 22px; font-size: 13.5px; display: grid; gap: 2px; }
.dips li::marker { color: var(--muted-fg); font-variant-numeric: tabular-nums; }

/* Barra de herramientas del mapa en dos filas, y fichas que se desplazan en horizontal */
.map-tools { display: grid; gap: 10px; }
.tools-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.chips-scroll { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 4px; margin-inline: -2px; mask-image: linear-gradient(90deg, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll[hidden] { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 13.5px; font-weight: 550; color: var(--fg); background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.chip i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.chip:hover { border-color: var(--ring); }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.chip[aria-pressed="true"] i { box-shadow: 0 0 0 1.5px var(--primary-fg); }
@media (max-width: 620px) { .chips-scroll { margin-inline: -20px; padding-inline: 20px; } }

/* Miga de pan del panel */
.miga { display: flex; flex-wrap: wrap; gap: 2px 6px; font-size: 12.5px; color: var(--muted-fg); margin-bottom: 10px; }
.miga a { color: var(--muted-fg); font-weight: 500; text-decoration: none; }
.miga a:hover { color: var(--fg); text-decoration: underline; }
.miga [aria-current] { color: var(--fg); font-weight: 550; }
.miga .sep { color: var(--ring); }

/* Diferencia con la elección anterior */
.delta { font-weight: 600; }
.delta.up { color: var(--good); }
.delta.down { color: var(--live); }

/* Provincias de una comunidad, con sus escaños */
.prov-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.prov-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; font-size: 13.5px; }
.prov-list a { font-weight: 550; }
.prov-list .dots { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; max-width: 65%; }
.prov-list .dots i, .prov-list .dots button { width: 11px; height: 11px; border-radius: 50%; display: block; border: 0; padding: 0; cursor: pointer; box-shadow: 0 0 0 1.5px var(--card); }
.prov-list .dots button:hover, .prov-list .dots button:focus-visible { box-shadow: 0 0 0 1.5px var(--card), 0 0 0 3px var(--fg); outline: none; }
@media (pointer: coarse) { .prov-list .dots { gap: 5px; } .prov-list .dots button { width: 16px; height: 16px; } }
.map-layout { position: relative; }

/* Leyenda con histograma */
.scale-wrap { display: grid; gap: 4px; }
.scale-wrap > b { font-size: 13.5px; font-weight: 600; }
.hist { display: flex; align-items: flex-end; gap: 1px; height: 28px; max-width: 330px; margin-left: 46px; }
.hist span { flex: 1; border-radius: 2px 2px 0 0; }
.map-legend .chips-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; line-height: 20px; }
.map-legend .chips-legend .party { gap: 7px; }
@media (max-width: 620px) {
  .map-legend .chips-legend.is-long { max-height: 46px; overflow: hidden; position: relative; }
  .map-legend .chips-legend.is-long::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 22px; background: linear-gradient(to bottom, transparent, var(--card)); pointer-events: none; }
  .map-legend .chips-legend.is-long.open { max-height: none; }
  .map-legend .chips-legend.is-long.open::after { display: none; }
  .map-legend .chips-legend.is-long + .legend-more { display: inline-block; }
}

/* Zona ancha bajo el mapa y el panel: contexto, gráfico de dispersión y listas largas */
.map-extra { display: grid; gap: 16px; margin-top: 16px; }
.map-extra[hidden] { display: none; }
.x-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.x-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; margin-bottom: 12px; }
.x-head h3 { font-size: 16px; margin: 0; }
.x-head p { margin: 0; }
.x-cols { columns: 230px; column-gap: 28px; }
.x-cols > * { break-inside: avoid; }
.x-cols .lista:first-child, .x-cols > div > .circ-h:first-child { margin-top: 0; }
.x-cols-wide { columns: 300px; }
@media (max-width: 620px) { .x-card { padding: 16px; } }

/* Contexto: una franja por indicador, con la distribución, la mediana y el valor */
/* Tarjeta de contexto plegable (fuera del modo Contexto): solo el título hasta que se toca */
.ctx-card .x-head, .sc-card.plegable .x-head { margin-bottom: 0; }
.sc-card .sc-zona { margin: 0 0 10px; }
.ctx-card .x-head h3, .sc-card.plegable .x-head h3 { flex: 1; }
.ctx-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .28s ease; }
.ctx-body > div { overflow: hidden; min-height: 0; }
.ctx-src { margin: 4px 0 12px; }
.x-card.plegable:not(.open) .ctx-body { grid-template-rows: 0fr; }
.x-card.plegable:not(.open) { padding-block: 12px; }
.x-card.plegable.open .ctx-body > div { padding-top: 10px; }
.ctx-toggle { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; width: 100%; font: inherit; color: inherit; border-radius: 6px; }
.ctx-toggle:focus-visible { outline: 2px solid var(--ring); outline-offset: 4px; }
.ctx-toggle .chev { width: 18px; height: 18px; margin-left: auto; flex: none; color: var(--muted-fg); transition: transform .28s ease; }
.x-card.open .ctx-toggle .chev { transform: rotate(180deg); }
.x-card.plegable { transition: padding .28s ease; }
@media (prefers-reduced-motion: reduce) { .ctx-body, .ctx-toggle .chev, .x-card.plegable { transition: none; } }
.ctx-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px 28px; }
.ctx-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; align-items: baseline; font-size: 13.5px; }
.ctx-k { color: var(--muted-fg); }
.ctx-list b { font-size: 15px; }
.ctx-strip { grid-column: 1 / -1; width: 100%; height: auto; display: block; margin-top: 4px; overflow: visible; }
.ctx-hist rect { fill: color-mix(in srgb, var(--muted-fg) 32%, var(--card)); }
.ctx-base { stroke: var(--border); stroke-width: 1; }
.ctx-medl { stroke: var(--muted-fg); stroke-width: 1.5; stroke-dasharray: 2 2; }
.ctx-pt { fill: var(--sepia); stroke: var(--card); stroke-width: 2; }
.ctx-esc { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--muted-fg); margin-top: 1px; }
.ctx-sub { grid-column: 1 / -1; font-size: 12.5px; margin-top: 4px; color: var(--fg); }

/* Gráfico de dispersión */
.sc-body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 760px) { .sc-body { grid-template-columns: minmax(0, 1fr); } }
.sc-plot { position: relative; }
.sc-side p { margin: 0 0 10px; }
.sc-r { font-size: 15px; }
.scatter { width: 100%; height: auto; display: block; overflow: visible; touch-action: manipulation; }
.scatter .ejes text, .scatter .sc-tx { font-size: 11px; fill: var(--muted-fg); font-family: var(--font); }
.scatter .sc-tx { font-size: 12px; font-weight: 600; fill: var(--fg); }
.scatter .ejes line { stroke: var(--border); stroke-width: 1; }
.scatter .sc-pts circle { fill: var(--sc); fill-opacity: .5; stroke: var(--card); stroke-width: 1; cursor: pointer; }
.scatter .sc-pts circle.is-sel { fill-opacity: 1; stroke: var(--fg); stroke-width: 2.5; }
.scatter .sc-pts circle.is-hover { fill-opacity: 1; stroke: var(--fg); stroke-width: 2; }
.scatter .sc-trend { stroke: var(--fg); stroke-width: 2; stroke-dasharray: 6 4; opacity: .75; pointer-events: none; }
.sc-tip {
  position: absolute; left: 0; top: 0; z-index: 5; display: grid; gap: 2px; min-width: 170px; max-width: 240px; pointer-events: auto; cursor: pointer;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 9px 12px; font-size: 13px;
}
.sc-tip[hidden] { display: none; }
.sc-tip .sc-open { font-weight: 600; margin-top: 3px; }
@media (hover: hover) and (pointer: fine) { .sc-tip { pointer-events: none; } .sc-tip .sc-open { display: none; } }

/* Etiqueta de las filas de fichas */
.chips-lab { flex: none; align-self: center; font-size: 12.5px; font-weight: 550; color: var(--muted-fg); padding-right: 2px; }
.chip i.chip-turnout { background: var(--sepia); }

/* Escritorio: el mapa se queda a la vista mientras se lee el detalle */
@media (min-width: 901px) {
  .map-layout { grid-template-columns: minmax(0, 1fr) 360px; }
  .map-card { position: sticky; top: 76px; z-index: 1; }
}
.seg-sm button { font-size: 12.5px; padding: 4px 10px; }
.sc-scope { flex-basis: 100%; margin: 0 0 12px; }

/* Modo Contexto: leyenda y valor en grande */
.leg-ine { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 260px); gap: 12px 24px; align-items: center; }
.leg-big { display: grid; gap: 1px; text-align: right; padding-left: 20px; border-left: 1px solid var(--border); min-height: 72px; align-content: center; }
.leg-big:empty { border-left: 0; }
.lb-k { font-size: 12.5px; color: var(--muted-fg); }
.lb-v { font-size: 30px; line-height: 1.15; font-weight: 650; letter-spacing: -.01em; color: var(--sepia-ink); }
.lb-n { font-size: 14px; font-weight: 600; }
.lb-p { font-size: 12px; color: var(--muted-fg); }
@media (max-width: 620px) {
  .leg-ine { grid-template-columns: minmax(0, 1fr); }
  .leg-big { text-align: left; padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--border); min-height: 0; }
  .lb-v { font-size: 26px; }
}
.sc-party { margin: 0 0 12px; }

/* Barra fija del mapa: elección, cámara y, al bajar, dónde se está */
.map-bar {
  position: sticky; top: var(--hdr, 0px); z-index: 15;
  padding: 8px 0 14px; margin: -8px 0 0; isolation: isolate;
}
/* Siempre una sola fila, igual fija o no, que se desplaza en horizontal si no cabe; todos los elementos con la misma altura */
.map-bar-in { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 8px 10px; }
.map-bar .map-bar-in {
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -4px; padding: 2px 4px;
}
/* Difuminado solo en el lado donde queda algo oculto */
.map-bar .map-bar-in.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.map-bar .map-bar-in.fade-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px); mask-image: linear-gradient(90deg, transparent, #000 28px); }
.map-bar .map-bar-in.fade-l.fade-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.map-bar .map-bar-in::-webkit-scrollbar { display: none; }
.map-bar .map-cmp { align-items: center; }
.map-bar .map-where { box-shadow: none; padding-block: 0; }
.map-bar-in > * { flex: none; }
/* Fondo a todo el ancho de la ventana (solo cuando está fija). El ancho lo pone mapa.js (--ancho-util): 100vw incluye
   la barra de desplazamiento clásica (Windows, Mac con «mostrar siempre») y haría que la página se moviera de lado.
   Un tinte que se desvanece hacia abajo y un desenfoque
   progresivo hecho con cuatro capas, cada una más desenfocada y limitada a una franja más alta */
.map-bar-bg { position: absolute; z-index: -1; top: 0; bottom: -22px; left: 50%; width: var(--ancho-util, 100vw); transform: translateX(-50%); pointer-events: none; opacity: 0; transition: opacity .2s; }
.map-bar.is-stuck .map-bar-bg { opacity: 1; }
.map-bar-bg::before { content: ""; position: absolute; inset: 0; background: var(--bg);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.9) 0%, rgba(0,0,0,.85) 55%, rgba(0,0,0,.5) 72%, rgba(0,0,0,.18) 88%, transparent 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9) 0%, rgba(0,0,0,.85) 55%, rgba(0,0,0,.5) 72%, rgba(0,0,0,.18) 88%, transparent 100%); }
.map-bar-bg i { position: absolute; inset: 0; }
.map-bar-bg i:nth-child(1) { -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 82%, transparent 100%); mask-image: linear-gradient(to bottom, #000 0%, #000 82%, transparent 100%); }
.map-bar-bg i:nth-child(2) { -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 66%, transparent 86%); mask-image: linear-gradient(to bottom, #000 0%, #000 66%, transparent 86%); }
.map-bar-bg i:nth-child(3) { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 52%, transparent 72%); mask-image: linear-gradient(to bottom, #000 0%, #000 52%, transparent 72%); }
.map-bar-bg i:nth-child(4) { -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 60%); mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 60%); }
.map-cmp { display: inline-flex; align-items: center; gap: 6px; }
.map-cmp:empty { display: none; }
@media (max-width: 620px) {
  .map-cmp .chips-lab { display: none; }
  .map-cmp .seg::before { content: "vs"; align-self: center; font-size: 12px; color: var(--muted-fg); padding: 0 4px 0 6px; }
}
.map-bar-sentinel { height: 1px; }
.map-tools { margin-bottom: 14px; }
.seg-multi { display: inline-flex; align-items: center; gap: 2px; }
.seg-multi.is-open { background: var(--card); border-radius: 7px; box-shadow: var(--shadow); padding-right: 3px; }
.seg-multi.is-open > button[aria-pressed="true"] { box-shadow: none; }
.seg-sub { display: inline-flex; gap: 2px; padding: 2px; border-radius: 6px; background: var(--muted); }
.seg .seg-sub button { padding: 3px 8px; font-size: 12.5px; border-radius: 5px; }
.map-where {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; flex: 0 1 auto;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--fg); background: var(--card);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; box-shadow: var(--shadow); cursor: pointer;
}
.map-where[hidden] { display: none; }
.map-where svg { width: 15px; height: 15px; flex: none; color: var(--sepia); }
.map-where span { white-space: nowrap; }
/* La píldora es también el buscador: al tocarla crece (transición de ancho) y muestra el campo */
.map-where { position: relative; overflow: hidden; transition: width .28s cubic-bezier(.2, .7, .2, 1), border-color .2s; }
.map-where-btn { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; min-height: 100%; }
.map-where-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 4px; border-radius: 999px; }
.map-where-btn .lupa { width: 13px; height: 13px; color: var(--muted-fg); margin-left: 2px; }
.map-where .lupa-in, .map-where input { display: none; }
.map-where.buscando { border-color: var(--ring); cursor: text; }
.map-where.buscando .map-where-btn { display: none; }
.map-where.buscando .lupa-in { display: block; color: var(--muted-fg); }
.map-where.buscando input {
  display: block; flex: 1; min-width: 0; height: 100%; min-height: 26px; border: 0; background: transparent; outline: none; padding: 0;
  font: inherit; font-weight: 500; color: var(--fg); font-size: 16px; /* 16 px: el iPhone no amplía la página al escribir */
}
.map-where input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.map-where.buscando input::placeholder { color: var(--muted-fg); font-weight: 400; }
@media (min-width: 621px) { .map-where.buscando input { font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { .map-where { transition: none; } }
@media (min-width: 621px) { .map-where { margin-left: auto; } }
.map-where .sep { color: var(--ring); margin: 0 5px; }
@media (max-width: 620px) { .map-where { font-size: 12.5px; padding: 5px 10px; } }

/* Comparar con */
.cmp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: -2px 0 12px; }

/* Buscador con sugerencias propias */
.map-sugg {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; list-style: none; margin: 0; padding: 4px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 360px; overflow-y: auto;
}
.map-sugg[hidden] { display: none; }
.map-sugg li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 7px 9px; border-radius: 8px; cursor: pointer; }
.map-sugg li[aria-selected="true"], .map-sugg li:hover { background: var(--muted); }
.map-sugg .ic { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--sepia-soft); color: var(--sepia); }
.map-sugg .ic svg { width: 14px; height: 14px; }
.map-sugg .nm { font-size: 14px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-sugg .nm mark { background: none; color: inherit; text-decoration: underline; text-decoration-color: var(--sepia); text-underline-offset: 2px; }
.map-sugg .sub { grid-column: 2; font-size: 12px; color: var(--muted-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-sugg .tp { grid-row: 1 / span 2; grid-column: 3; font-size: 11.5px; color: var(--muted-fg); text-align: right; }
.map-sugg .none { display: block; font-size: 13.5px; color: var(--muted-fg); cursor: default; }
.map-sugg .none:hover { background: none; }
@media (max-width: 620px) {
}
.scatter .sc-halo { fill: var(--sc); fill-opacity: 1; stroke: var(--fg); stroke-width: 2; pointer-events: none; }

/* Notas del panel tras un icono de información */
.notas { position: relative; margin-top: 4px; }
.info-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12.5px; color: var(--muted-fg); background: none; border: 0; padding: 4px 0; cursor: pointer; }
.info-btn svg { width: 16px; height: 16px; }
.info-btn:hover, .notas.open .info-btn { color: var(--fg); }
.info-pop {
  display: none; position: absolute; left: 0; right: 0; bottom: calc(100% + 4px); z-index: 6;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 10px 12px;
  font-size: 12.5px; color: var(--muted-fg); max-height: 320px; overflow-y: auto;
}
.info-pop p { margin: 0 0 6px; }
.info-pop p:last-child { margin: 0; }
.notas.open .info-pop { display: block; }
@media (hover: hover) { .notas:hover .info-pop { display: block; } }

/* Ventana del desglose de "Otros" */
.map-dialog { border: 1px solid var(--border); border-radius: var(--radius); padding: 0; width: min(520px, calc(100vw - 32px)); max-height: min(80vh, 720px); background: var(--card); color: var(--fg); box-shadow: var(--shadow-lg); }
/* Entrada y salida con transición (mapa.js pone la clase «abierto»); el fondo se oscurece y se difumina un poco */
.map-dialog { opacity: 0; transform: translateY(10px) scale(.98); transition: opacity .2s ease, transform .22s cubic-bezier(.2, .8, .2, 1); }
.map-dialog.abierto { opacity: 1; transform: none; }
.map-dialog::backdrop { background: rgba(0, 0, 0, 0); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); transition: background .2s ease, backdrop-filter .2s ease, -webkit-backdrop-filter .2s ease; }
.map-dialog.abierto::backdrop { background: rgba(0, 0, 0, .28); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
@media (prefers-reduced-motion: reduce) { .map-dialog, .map-dialog::backdrop { transition: none; } }
.map-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.dlg-in { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 12px 20px; border-bottom: 1px solid var(--border); flex: none; }
.dlg-body { overflow-y: auto; padding: 14px 20px 20px; min-height: 0; }
.dlg-head h2 { font-size: 17px; margin: 0; }
.ctx-d { font-size: 11.5px; font-weight: 600; color: var(--muted-fg); margin-left: 2px; white-space: nowrap; }
@media (max-width: 620px) {
}

/* Banderas */
.flag { height: 18px; width: auto; border-radius: 3px; box-shadow: 0 0 0 1px var(--border); vertical-align: -2px; margin-right: 9px; }
.map-panel h2 .flag { height: 20px; }
.flag-sm { height: 12px; border-radius: 2px; margin-right: 7px; vertical-align: -1px; }
.map-sugg .ic-flag { background: none; }
.map-sugg .flag-ic { width: 22px; height: 22px; object-fit: cover; object-position: center; border-radius: 6px; box-shadow: 0 0 0 1px var(--border); display: block; }
.map-sugg .flag-ic.flag-ph { background: var(--muted); }

/* Voto exterior */
.map-globe { position: absolute; top: 10px; left: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; }
.map-globe svg { width: 16px; height: 16px; color: var(--sepia); }
.map-globe[aria-pressed="true"] { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.map-globe[aria-pressed="true"] svg { color: var(--primary-fg); }
.map-globe[hidden] { display: none; }
.h-globe { display: inline-flex; vertical-align: -3px; margin-right: 8px; color: var(--sepia); }
.h-globe svg { width: 20px; height: 20px; }
.cera-mini { border-top: 1px solid var(--border); padding-top: 10px; margin: 4px 0 8px; font-size: 13.5px; }
.cera-mini p { margin: 0; }
.cera-mini .h-globe svg { width: 16px; height: 16px; }
.cera-mini .h-globe { margin-right: 6px; }
.cera-p { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px !important; align-items: baseline; }
.cera-p a { margin-left: auto; font-size: 12.5px; font-weight: 600; }
.cera-p .party { gap: 6px; }
.cera-tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cera-tabla th, .cera-tabla td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.cera-tabla thead th { font-size: 12px; color: var(--muted-fg); font-weight: 550; }
.cera-tabla tbody th { font-weight: 550; }
.cera-tabla .num { text-align: right; }
.cera-tabla .party { gap: 6px; }
.x-card .table-scroll { border: 0; box-shadow: none; background: none; border-radius: 0; }

.flag-ph { display: inline-block; width: 27px; height: 18px; background: var(--muted); border-radius: 3px; box-shadow: 0 0 0 1px var(--border); vertical-align: -3px; }
.map-panel h2 .flag-ph { width: 30px; height: 20px; }
.flag-sm.flag-ph { width: 18px; height: 12px; vertical-align: -1px; }
/* Tabla del voto exterior: cabecera con fondo y esquinas redondeadas */
.cera-tabla thead th { background: var(--muted); border-bottom: 0; }
.cera-tabla thead th:first-child { border-radius: 8px 0 0 8px; }
.cera-tabla thead th:last-child { border-radius: 0 8px 8px 0; }
.cera-tabla tbody tr:last-child th, .cera-tabla tbody tr:last-child td { border-bottom: 0; }
.cera-tabla tbody tr:hover { background: color-mix(in srgb, var(--muted) 50%, transparent); }
.cera-paises { margin: 6px 0 0 !important; color: var(--muted-fg); }
/* Mapamundi del voto exterior */
.mundo-body { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(200px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 760px) { .mundo-body { grid-template-columns: minmax(0, 1fr); } }
.mundo-plot { position: relative; }
.mundo { width: 100%; height: auto; display: block; }
.mundo path, .mundo circle { stroke: var(--card); stroke-width: .5; cursor: pointer; }
.mundo circle { stroke: var(--fg); stroke-width: .6; }
.mundo .on { stroke: var(--fg); stroke-width: 1.4; }
.mundo-tip { pointer-events: none; }
.mundo-leyenda { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; }
.mundo-esc { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted-fg); }
.mundo-esc span { display: inline-flex; align-items: center; gap: 5px; }
.mundo-esc i { width: 12px; height: 12px; border-radius: 3px; }
.mundo-top { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: n; }
.mundo-top li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; font-size: 13.5px; }
.mundo-top .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mundo-top .bar { grid-column: 1 / -1; height: 5px; background: var(--muted); border-radius: 999px; overflow: hidden; margin-top: 3px; }
.mundo-top .bar span { display: block; height: 100%; background: var(--sepia); border-radius: 999px; }
.map-cmp .seg button:disabled { cursor: default; color: var(--muted-fg); }
/* Píldora de zona: nunca se encoge (la barra se desplaza en horizontal si no cabe); en el móvil, la primera */
.map-bar .map-where { flex: none; min-width: auto; max-width: none; }
@media (max-width: 620px) { .map-bar .map-where { order: -1; } }
/* Senado: contorno de cada circunscripción insular */
.mapa-circ { pointer-events: none; }
/* Igual que los límites de provincia; el nombre, pequeño y discreto, solo al acercarse */
.mapa-circ path { fill: none; stroke: color-mix(in srgb, var(--fg) 45%, transparent); stroke-width: calc(var(--u) * 0.6px); stroke-linejoin: round; }
.mapa-circ text { font-family: var(--font); font-weight: 600; font-size: calc(var(--u) * 7.5px); letter-spacing: .02em; fill: var(--muted-fg); text-anchor: middle; paint-order: stroke; stroke: var(--card); stroke-width: calc(var(--u) * 2.2px); stroke-linejoin: round; }
.mapa:not(.is-zoomed) .mapa-circ text { display: none; }
/* Texto solo para lectores de pantalla */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* Calendario: «Ahora», filtros y añadir al calendario (assets/calendario.js) */
.cal-now { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 22px 16px; margin-bottom: 14px; }
.cal-now-h { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-now-h h2 { margin: 0; font-size: 20px; }
.cal-now-h p { margin: 0; }
.cal-now-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin-bottom: 14px; }
@media (max-width: 620px) { .cal-now-grid { grid-template-columns: minmax(0, 1fr); } }
.cal-now-grid h3 { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-fg); margin: 0 0 6px; }
.cal-now-grid p { margin: 0; }
.cal-item { display: grid; gap: 2px; padding: 9px 12px; margin-bottom: 6px; border-radius: 10px; background: var(--muted); color: var(--fg); text-decoration: none; border: 1px solid transparent; }
.cal-item:hover { border-color: var(--ring); }
.cal-item b { font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.cal-when { font-size: 12.5px; color: var(--sepia-ink); font-weight: 550; }
.cal-bar { height: 8px; border-radius: 999px; background: var(--muted); overflow: hidden; margin-bottom: 6px; }
.cal-bar i { display: block; height: 100%; background: var(--sepia); border-radius: inherit; }
.cal-now > .small { margin: 0; }
.cal-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 12px; }
.cal-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--muted-fg); cursor: pointer; }
.cal-check input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
.cal-ics-all { margin-left: auto; gap: 7px; }
.cal-ics-all svg, .cal-add svg { width: 15px; height: 15px; flex: none; }
@media (max-width: 620px) { .cal-ics-all { margin-left: 0; } }
.cal-add { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; font-weight: 550; color: var(--muted-fg); cursor: pointer; border-radius: 6px; padding: 2px 4px 2px 0; }
.cal-add:hover { color: var(--fg); }
.cal-add:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.timeline li[hidden] { display: none; }
.timeline li.flash .t { animation: cal-flash 1.6s ease-out; border-radius: 8px; }
@keyframes cal-flash { 0%, 30% { background: var(--sepia-soft); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .timeline li.flash .t { animation: none; } }
.timeline .month-h { font: inherit; letter-spacing: inherit; line-height: inherit; color: inherit; margin: 0; text-wrap: initial; }
.mapa:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
/* Modos del mapa: arriba, en la misma tarjeta. Primera fila: qué se pinta (a lo ancho) y cómo (territorio o personas);
   debajo, lo que depende del modo (hora, candidatura o indicador). La leyenda queda debajo del mapa. */
.map-modes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 0 0 10px; margin: 0 0 10px; border-bottom: 1px solid var(--border); }
.map-modes [hidden] { display: none !important; }
.map-modes-top { display: flex; gap: 8px; align-items: stretch; }
.seg-modos { flex: 1 1 auto; display: flex; }
.seg-modos button { flex: 1 1 auto; text-align: center; padding-inline: 8px; }
.seg-vista { flex: none; }
.seg-vista button { display: inline-flex; align-items: center; gap: 6px; }
.seg-vista svg { width: 15px; height: 15px; flex: none; }
/* Móvil: los modos a todo el ancho y, debajo, territorio o personas */
@media (max-width: 620px) {
  .map-modes { padding: 10px 16px 10px; margin: 0; }
  .map-modes-top { flex-wrap: wrap; gap: 8px; }
  .seg-modos, .seg-vista { flex: 1 1 100%; display: flex; }
  .seg-vista button { flex: 1 1 50%; justify-content: center; }
  .seg-modos button { padding-inline: 4px; }
}
/* Vista «Personas»: círculos por municipio encima del territorio en gris */
.mapa-bur circle { stroke: var(--card); stroke-width: calc(var(--u) * 0.35px); fill-opacity: .92; cursor: pointer; }
.mapa-bur circle.sel { fill-opacity: 1; }
/* En «Personas», sin el mosaico de secciones censales (se ven en la vista Territorio) */
.mapa.con-burbujas .mapa-secc, .mapa.con-burbujas .mapa-lab { display: none; }
.mapa.con-burbujas .mapa-mun path { stroke: color-mix(in srgb, var(--card) 70%, transparent); cursor: default; }
.leg-personas { max-width: 62ch; }
.seg-full { display: flex; width: 100%; }
.seg-full button { flex: 1 1 auto; text-align: center; padding-inline: 6px; }
/* Mapa del cambio: «Resultado | Cambio desde…», pasos de un ganador a otro y equivalencias en la leyenda */
.seg-cambio button { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.seg-cambio svg { width: 14px; height: 14px; flex: none; }
.mapa-fle { pointer-events: none; }
.mapa-fle path { pointer-events: visiblePainted; cursor: pointer; }
.mapa-fle path:hover { filter: brightness(1.15); }
.mapa-fle path { stroke-linejoin: round; paint-order: stroke fill; }
.leg-fle { display: flex; align-items: flex-start; gap: 8px; max-width: 70ch; }
.leg-fle-ej { display: inline-flex; gap: 2px; flex: none; }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.seg button:disabled:hover { color: var(--muted-fg); }
.map-legend .chips-legend .paso { gap: 5px; }
.map-legend .pasos .extra { display: none; }
.map-legend .pasos.open .extra { display: inline-flex; }
.map-legend .legend-more.ver { display: inline-block; }
.map-legend .paso .flecha { color: var(--muted-fg); }
.map-legend .scale small { font-size: 12px; }
.leg-eq { margin-top: 6px; }
.bars-h { margin: 14px 0 8px; font-size: 12.5px; font-weight: 600; color: var(--muted-fg); letter-spacing: .01em; }
.bars-h:first-child { margin-top: 4px; }
.map-bloques { display: flex; gap: 8px; align-items: center; }
.map-bloques[hidden] { display: none; }
.map-bloques .chips-scroll { flex: 1 1 auto; min-width: 0; }
.blq-ajustar { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.blq-ajustar svg { width: 15px; height: 15px; }
.blq-punto { width: 7px; height: 7px; border-radius: 50%; background: var(--sepia); }
/* Ventana de ajustes */
.map-ajustes { width: min(600px, calc(100vw - 32px)); max-height: min(86vh, 820px); }
.dlg-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); }
.dlg-foot p { margin: 0; }
.dlg-acc { display: flex; gap: 8px; flex: none; }
.aj-cuerpo { margin-top: 12px; }
.aj-cuerpo > .seg { margin-bottom: 8px; }
.aj-crit { margin: 8px 0 10px; }
.aj-lista { list-style: none; margin: 0; padding: 0; display: grid; }
.aj-lista li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "p s" "m s"; column-gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: center; }
.aj-lista li .party { grid-area: p; gap: 8px; font-size: 14px; }
.aj-lista li .aj-meta { grid-area: m; }
.aj-lista li select { grid-area: s; font: inherit; font-size: 13.5px; color: var(--fg); background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; max-width: 220px; }
.aj-lista li.cambiado .party::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sepia); }
.aj-eq { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.aj-eq li { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.aj-sub { font-weight: 600; font-size: 14px; margin: 16px 0 8px; }
.aj-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.aj-col { display: grid; gap: 2px; align-content: start; max-height: 260px; overflow-y: auto; padding-right: 4px; }
.aj-col-h { font-size: 12.5px; font-weight: 600; color: var(--muted-fg); margin: 0 0 4px; }
.aj-col label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 3px 0; cursor: pointer; }
.aj-col label i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.aj-aviso { color: var(--live); margin: 8px 0 0; }
[data-aj-anadir] { margin-top: 10px; }
.aj-link { font-size: inherit; padding: 0; }
@media (max-width: 620px) { .dlg-foot { flex-direction: column; align-items: stretch; } .dlg-acc { justify-content: flex-end; } }
.leg-eq summary { cursor: pointer; width: fit-content; text-decoration: underline; text-decoration-color: var(--ring); text-underline-offset: 3px; }
.leg-eq p, .leg-eq ul { margin: 6px 0 0; }
.leg-eq ul { padding-left: 18px; display: grid; gap: 2px; }

.sc-ine { margin: 0 0 8px; }
/* Fichas del gráfico de dispersión: alineadas con el título; en móvil llegan hasta el borde de la tarjeta al desplazarse */
.sc-card .chips-scroll { margin-inline: -2px; padding-inline: 2px; }
@media (max-width: 620px) { .sc-card .chips-scroll { margin-inline: -16px; padding-inline: 16px; } }
@media (max-width: 380px) { .seg-full button, .seg-modos button { font-size: 12.5px; padding-inline: 3px; } }
/* Cinco modos en el móvil: en dos filas si no caben */
@media (max-width: 520px) {
  .seg-modos { flex-wrap: wrap; row-gap: 2px; }
  .seg-modos button { flex: 1 1 28%; }
  .seg-cambio button { font-size: 12.5px; padding-inline: 6px; gap: 4px; }
}

/* Portada: acceso al mapa electoral, con una imagen del mapa */
.promo-mapa { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: 24px; padding: 28px 32px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); color: inherit; text-decoration: none; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.promo-mapa:hover { border-color: var(--ring); box-shadow: var(--shadow-lg); }
.promo-mapa .promo-txt { display: grid; gap: 12px; justify-items: start; }
.promo-mapa h2 { margin: 0; }
.promo-mapa p { margin: 0; }
.promo-mapa .go { font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; }
.promo-mapa .go svg { width: 16px; height: 16px; transition: transform .15s; }
.promo-mapa:hover .go svg { transform: translateX(3px); }
.promo-img { width: 100%; height: auto; display: block; margin: -12px -12px -12px 0; }
@media (max-width: 760px) { .promo-mapa { grid-template-columns: minmax(0, 1fr); padding: 22px 20px 16px; } .promo-img { margin: 0; } }
/* ---------- Candidaturas: explorador de listas ---------- */
section.block.cand-app { padding-top: 4px; }
.cand-aviso { margin: 0 0 14px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); font-size: 14px; color: var(--muted-fg); }
.cand-aviso p { margin: 0; }
.cand-aviso.demo { border-color: var(--sepia-line); background: var(--sepia-soft); color: var(--sepia-ink); }
.cand-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px;
  position: sticky; top: var(--hdr, 0px); z-index: 15; padding: 8px 0 10px; margin-top: -8px; isolation: isolate; }
.cand-tools.is-stuck .map-bar-bg { opacity: 1; }
.cand-tools-sentinel { height: 1px; }
/* Misma altura para los tres controles (cámara, zona, buscador): 38 px */
.cand-tools .seg { height: 38px; box-sizing: border-box; align-items: stretch; }
.cand-tools .seg button { padding-block: 0; display: inline-flex; align-items: center; }
.cand-res-caja .cand-res ul { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); column-gap: 8px; }
/* Selector de zona propio (candidaturas.js): botón y, al abrirlo, buscador con la lista */
.cand-zona { position: relative; min-width: 0; }
.cand-zona-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; max-width: 100%; padding: 0 12px; font: inherit; font-size: 14px; font-weight: 600; color: var(--fg);
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s; }
.cand-zona-btn:hover, .cand-zona-btn[aria-expanded="true"] { border-color: var(--ring); }
.cand-zona-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.cand-zona-btn svg { width: 15px; height: 15px; flex: none; color: var(--sepia); }
.cand-zona-btn .chev { color: var(--muted-fg); margin-left: 2px; transition: transform .2s ease; }
.cand-zona-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
#cand-zona-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cand-zona-pop { position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; width: min(360px, calc(100vw - 32px)); background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; opacity: 0; transform: translateY(-4px); transition: opacity .16s ease, transform .18s ease; }
.cand-zona-pop.on { opacity: 1; transform: none; }
.cand-zona-pop[hidden] { display: none; }
.cand-zona-q { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.cand-zona-q svg { width: 15px; height: 15px; flex: none; color: var(--muted-fg); }
.cand-zona-q input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 16px; color: var(--fg); padding: 0; }
@media (min-width: 621px) { .cand-zona-q input { font-size: 14px; } }
.cand-zona-q input::placeholder { color: var(--muted-fg); }
.cand-zona-q input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.cand-zona-list { list-style: none; margin: 0; padding: 4px; max-height: min(380px, 55vh); overflow-y: auto; overscroll-behavior: contain; }
.cand-zona-list li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.cand-zona-list li.nv0 { font-weight: 600; }
.cand-zona-list li.nv1 { padding-left: 26px; }
.cand-zona-list li.nv2 { padding-left: 44px; }
.cand-zona-list li.act { background: var(--muted); }
.cand-zona-list li[aria-selected="true"] { box-shadow: inset 0 0 0 1px var(--ring); }
.cand-zona-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cand-zona-list .nm mark { background: none; color: inherit; text-decoration: underline; text-decoration-color: var(--sepia); text-underline-offset: 2px; }
.cand-zona-list .tp { font-size: 12px; color: var(--muted-fg); font-weight: 400; }
.cand-zona-list .none { display: block; color: var(--muted-fg); cursor: default; }
.cand-zona-list .flag-ic { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; box-shadow: 0 0 0 1px var(--border); display: block; }
.cand-zona-list .flag-ph { background: var(--muted); }
.cand-zona-list .flag-es { background: linear-gradient(#c60b1e 25%, #ffc400 25% 75%, #c60b1e 75%); }
.cand-zona-list li.nv1 .flag-ic, .cand-zona-list li.nv2 .flag-ic { width: 18px; height: 18px; margin-left: 2px; border-radius: 5px; }
/* Islas: un punto, no una bandera */
.cand-zona-list li .flag-ic.flag-isla { width: 10px; height: 10px; margin: 0 6px; border-radius: 50%; background: var(--sepia-line); box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .cand-zona-pop, .cand-zona-btn .chev { transition: none; } }
.cand-buscar { position: relative; flex: 1 1 240px; max-width: 380px; margin-left: auto; }
.cand-buscar > svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted-fg); pointer-events: none; }
.cand-buscar input { width: 100%; font: inherit; font-size: 16px; color: var(--fg); background: var(--card); border: 1px solid var(--border); border-radius: 10px; height: 38px; padding: 0 12px 0 34px; box-shadow: var(--shadow); }
@media (min-width: 621px) { .cand-buscar input { font-size: 14px; } }
/* Móvil: la lista ocupa todo el ancho de la fila de herramientas, justo debajo del botón (candidaturas.js pone el top) */
@media (max-width: 620px) {
  .cand-buscar { margin-left: 0; max-width: none; flex-basis: 100%; }
  /* Fija, solo cámara y zona: el buscador ocuparía media pantalla */
  .cand-tools.is-stuck .cand-buscar:not(:focus-within) { display: none; }
  .cand-zona { flex: 1; position: static; }
  .cand-zona-btn { width: 100%; }
  .cand-zona-btn .chev { margin-left: auto; }
  .cand-zona-pop { left: 0; right: 0; width: auto; }
}
.cand-layout { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .cand-layout { grid-template-columns: minmax(0, 1fr); } }
.cand-mapa-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; position: sticky; top: calc(var(--hdr, 92px) + 70px); }
@media (max-width: 900px) {
  .cand-mapa-card { position: static; }
  /* Con una zona elegida, primero sus listas y después el mapa */
  .cand-layout.con-zona .cand-listas { order: -1; }
}
.cand-mapa { position: relative; }
.cand-svg { display: block; width: 100%; height: auto; max-width: 560px; margin: 0 auto; }
@media (max-width: 900px) { .cand-svg { max-width: 380px; } }
.cand-svg [data-p] { fill: var(--muted); stroke: var(--card); stroke-width: 1.2; cursor: pointer; transition: fill .15s, opacity .15s; }
.cand-svg [data-p]:hover { fill: var(--sepia-line); }
.cand-svg [data-p].off { opacity: .35; }
.cand-svg [data-p].sel, .cand-svg [data-c].sel { fill: var(--sepia); }
.cand-svg [data-c] { fill: var(--muted); stroke: var(--card); stroke-width: .8; cursor: pointer; transition: fill .15s, opacity .15s; }
.cand-svg [data-c]:hover { fill: var(--sepia-line); }
.cand-svg [data-c].off { opacity: .35; }
.cand-svg .cand-islas { display: none; }
.cand-svg.sen .cand-islas { display: inline; }
.cand-svg .cand-hit [data-c] { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; }
.cand-svg.sen [data-p].tapada { fill: none; stroke: none; pointer-events: none; }
.cand-svg .cand-ccaa path { fill: none; stroke: var(--ring); stroke-width: 1; pointer-events: none; }
.cand-svg .cand-selp path { fill: none; stroke: var(--fg); stroke-width: 2.4; stroke-linejoin: round; pointer-events: none; }
.cand-svg .cand-canarias { fill: none; stroke: var(--border); stroke-width: 1.2; }
.cand-tip { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; background: var(--fg); color: var(--bg); font-size: 12.5px; font-weight: 550; padding: 5px 9px; border-radius: 7px; white-space: nowrap; }
.cand-partidos { border-top: 1px solid var(--border); margin-top: 8px; padding: 10px 4px 2px; }
.cand-partidos > p { margin: 0 0 8px; }
.cand-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cand-chips .chip { font-size: 13px; padding: 5px 10px; }
.cand-chips .chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.cand-chips .chip[aria-pressed="true"] .muted { color: inherit; opacity: .7; }
.cand-chips .chip-more { color: var(--muted-fg); }
.cand-partidos > .cand-chips-nota { margin: 10px 0 0; }
.cand-resumen, .cand-cab { margin-bottom: 14px; }
.cand-todas { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 8px 10px; }
.cand-todas h3 { margin: 0 10px 8px; font-size: 15px; }
.cand-todas ul { list-style: none; margin: 0; padding: 0; display: grid; }
.cand-todas button { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.cand-todas button:hover { background: var(--muted); }
.cand-todas button:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
/* Elegida: degradado de su color y contorno de su color (sin bordes laterales) */
.cand-todas button[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 12%, var(--card)); box-shadow: inset 0 0 0 1px var(--c); }
@supports (background: color-mix(in srgb, red 10%, white)) {
  .cand-todas button[aria-pressed="true"] { background: linear-gradient(200deg, color-mix(in srgb, var(--c) 16%, var(--card)), var(--card) 90%); }
}
.cand-todas i { width: 10px; height: 10px; border-radius: 3px; margin-top: 5px; }
.cand-todas .ct-n { display: grid; gap: 1px; min-width: 0; }
.cand-todas .ct-n b { font-weight: 600; font-size: 14.5px; }
.cand-todas .ct-d { font-weight: 600; font-size: 14px; }
.cand-todas > p { margin: 8px 10px 0; }
.cand-resumen h2, .cand-cab h2 { margin: 0 0 4px; }
.cand-resumen p, .cand-cab p { margin: 0 0 6px; }
.cand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }
.cand-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 12px 14px; min-width: 0; }
@supports (background: color-mix(in srgb, red 10%, white)) {
  /* Degradado desde la esquina de arriba a la derecha, un poco inclinado */
  .cand-card { background: linear-gradient(200deg, color-mix(in srgb, var(--c, var(--ring)) 15%, var(--card)), var(--card) 110px); }
}
/* Candidatura elegida: contorno uniforme de su color */
.cand-card.is-on { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), var(--shadow); }
.cand-card.inadmitida .cand-ol { text-decoration: line-through; text-decoration-color: var(--muted-fg); }
.cand-x { margin: 0 0 8px; font-size: 12.5px; line-height: 1.4; color: var(--sepia-ink); background: var(--sepia-soft); border-radius: 6px; padding: 6px 8px; }
.cand-card header { display: grid; gap: 2px; margin-bottom: 8px; }
.cand-card .party { font-size: 15px; gap: 8px; }
.cand-nom { line-height: 1.35; }
.cand-ol { margin: 0; padding-left: 26px; font-size: 13.5px; line-height: 1.5; }
.cand-ol li::marker { color: var(--muted-fg); font-variant-numeric: tabular-nums; }
.cand-ol mark, .cand-res mark { background: var(--sepia-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.cand-sup { margin-top: 8px; padding-block: 4px 0; border-bottom: 0; font-size: 13px; }
.cand-sup summary { cursor: pointer; color: var(--muted-fg); font-weight: 550; }
.cand-sup .cand-ol { margin-top: 6px; color: var(--muted-fg); }
.cand-isla { font-size: 15px; margin: 4px 0 8px; }
.cand-migas { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; margin-bottom: 4px; color: var(--muted-fg); }
.cand-migas a { color: var(--muted-fg); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.cand-migas a:hover { color: var(--fg); }
.cand-provs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.cand-provs a { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); box-shadow: var(--shadow); color: var(--fg); text-decoration: none; }
.cand-provs a:hover { border-color: var(--ring); }
.cand-provs b { font-weight: 600; }
.cand-provs span { font-size: 13px; color: var(--muted-fg); }
.cand-res { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 10px 12px; margin-bottom: 16px; }
.cand-res > p { margin: 2px 4px 8px; }
.cand-res ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 420px; overflow-y: auto; }
.cand-res button { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 7px 8px; border-radius: 8px; }
.cand-res button:hover, .cand-res button:focus-visible { background: var(--muted); }
.cand-res button .muted { grid-column: 1 / -1; }
.cand-res b { font-weight: 600; font-size: 14px; }
.cand-res .party { font-size: 13px; gap: 6px; }
.cand-ol.corta:not(.corta5):not(.corta4) li:nth-child(n+11) { display: none; }
.cand-ol.corta.corta5 li:nth-child(n+6), .cand-ol.corta.corta4 li:nth-child(n+5) { display: none; }
/* Vista de una candidatura en toda España */
.cand-partido-h { display: flex; align-items: center; gap: 10px; }
.cand-partido-h i { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.cand-volver { all: unset; cursor: pointer; color: var(--muted-fg); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.cand-volver:hover { color: var(--fg); }
.cand-volver:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
.cand-zona-t a { color: inherit; text-decoration: none; }
.cand-zona-t a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cand-todos { all: unset; cursor: pointer; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--fg); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ring); }
.cand-todos:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
/* En el móvil, con una provincia elegida, primero sus listas y después el mapa */

/* Aviso de versión nueva (app.js): abajo, centrado, por encima de todo */
.aviso-version { position: fixed; left: 50%; width: max-content; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40; display: flex; align-items: center; gap: 12px;
  max-width: calc(100vw - 32px); padding: 8px 8px 8px 16px; border-radius: 999px; background: var(--primary); color: var(--primary-fg); font-size: 14px; font-weight: 550;
  box-shadow: 0 10px 28px -8px rgba(0, 0, 0, .45); opacity: 0; transform: translate(-50%, 16px); transition: opacity .25s ease, transform .3s cubic-bezier(.2, .8, .2, 1); }
.aviso-version.on { opacity: 1; transform: translate(-50%, 0); }
.aviso-version .btn { background: var(--primary-fg); color: var(--primary); border: 0; }
/* Móvil: de lado a lado (sin el centrado, que lo dejaba estrecho y partido en muchas líneas) */
@media (max-width: 620px) {
  .aviso-version { left: 12px; right: 12px; width: auto; max-width: none; justify-content: space-between; border-radius: 14px; padding: 8px 8px 8px 14px; font-size: 13.5px; line-height: 1.35; transform: translateY(16px); }
  .aviso-version.on { transform: none; }
  .aviso-version .btn { flex: none; }
}
@media (prefers-reduced-motion: reduce) { .aviso-version { transition: none; } }

/* ---------- Esqueletos mientras carga ----------
   Bloques grises con un brillo que pasa; el contenido real los sustituye al pintarse.
   Sin animación si se piden menos movimientos. */
:root { --skel: color-mix(in srgb, var(--muted) 45%, var(--border)); --skel-hi: var(--muted); }
.skel {
  display: block; border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--skel) 0%, var(--skel) 35%, var(--skel-hi) 50%, var(--skel) 65%, var(--skel) 100%) 0 0 / 300% 100%;
  animation: skel 1.5s ease-in-out infinite;
}
@keyframes skel { from { background-position: 100% 0; } to { background-position: 0 0; } }
.skel-pill { display: inline-block; height: 32px; border-radius: 999px; vertical-align: middle; }
.skel-txt { display: inline-block; height: 12px; border-radius: 6px; vertical-align: middle; }
.skel-linea { height: 12px; border-radius: 6px; margin-bottom: 10px; }
.skel-titulo { height: 26px; margin-bottom: 18px; }
.skel-fila { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.skel-caja { height: 54px; }
.skel-barra { height: 16px; border-radius: 6px; margin-bottom: 12px; }
.skel-panel { padding: 4px 0; }
.skel-mapa { position: absolute; inset: 0; border-radius: inherit; }
.skel-tarjeta { height: 124px; border-radius: var(--radius-sm); }
.skel-lista { height: 150px; border-radius: var(--radius); margin-bottom: 12px; }
.skel-cand-mapa { width: 100%; aspect-ratio: 1000 / 875; border-radius: 8px; }
.skel-sc { height: 260px; }
.sc-esqueleto > div { padding-top: 12px; }
.cand-chips .skel-pill { margin: 0 6px 6px 0; }
.seg .skel-pill { height: 30px; }
.map-cmp .skel-pill { height: 38px; }

/* Datos que se están bajando: el mapa con un barrido por encima, el botón elegido brillando y lo que va
   a cambiar, atenuado */
.mapa::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--card) 55%, transparent) 50%, transparent 70%) 0 0 / 300% 100%;
}
.mapa.cargando::after { opacity: 1; animation: skel 1.3s ease-in-out infinite; }
.map-bar .pendiente {
  background-image: linear-gradient(90deg, transparent 35%, color-mix(in srgb, var(--fg) 10%, transparent) 50%, transparent 65%);
  background-size: 300% 100%; animation: skel 1.3s ease-in-out infinite;
}
.map-panel, .senado-wrap { transition: opacity .2s; }
.mapa-app.cargando-datos .map-panel, .mapa-app.cargando-datos .senado-wrap { opacity: .55; }
/* La primera vez que aparece el contenido, sin golpe */
@keyframes aparece { from { opacity: 0; } to { opacity: 1; } }
.mapa-app.recien .map-panel, .mapa-app.recien .mapa > svg { animation: aparece .35s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .skel, .mapa.cargando::after, .map-bar .pendiente { animation: none; }
  .mapa-app.recien .map-panel, .mapa-app.recien .mapa > svg { animation: none; }
}

/* ---------- Blog ---------- */
/* Artículo: una columna de lectura; la portada y las tablas, algo más anchas */
.post { max-width: 760px; }
.post-head { padding-bottom: 22px; }
.post-head h1 { max-width: 24ch; font-size: clamp(30px, 4.4vw, 44px); }
.post-head .standfirst { max-width: 62ch; }
.migas { margin: 0; font-size: 14px; }
.migas a { color: var(--muted-fg); text-decoration: none; font-weight: 550; }
.migas a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.post-cover { margin: 0 0 28px; max-width: 820px; }
.post-cover img, .post-card-img img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--muted); }
.post-toc { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px; margin: 0 0 28px; }
.post-toc h2 { font-size: 13.5px; font-weight: 600; letter-spacing: 0; color: var(--muted-fg); margin: 0 0 8px; }
.post-toc ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 15px; }
.post-toc li::marker { color: var(--muted-fg); font-size: 13px; }
.post-toc a { color: var(--fg); text-decoration: none; }
.post-toc a:hover { text-decoration: underline; text-underline-offset: 3px; }
.post-body { max-width: none; font-size: 16.5px; line-height: 1.65; }
.post-body > h2 { margin: 40px 0 12px; }
.post-body > h3 { margin: 26px 0 8px; font-size: 18px; }
.post-body > p, .post-body > ul, .post-body > ol { max-width: 68ch; }
.post-body > .table-scroll, .post-body > .steps, .post-body > .faq, .post-body > .note { margin: 18px 0 22px; }
.post-body .table-scroll table { font-size: 14.5px; line-height: 1.45; }
.post-body .steps h3 { font-size: 16.5px; }
.post-body .steps p { font-size: 15.5px; }
.post-body .faq { max-width: none; }
.post-body h2.fuentes + ul { font-size: 14.5px; color: var(--muted-fg); }
.post-body h2.fuentes + ul a { color: var(--muted-fg); }
.post-error { margin: 32px 0 0; padding-top: 16px; border-top: 1px solid var(--border); }

/* Tarjetas de artículo (portada del blog, «Sigue leyendo» y la portada de la web) */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 580px) { .post-grid { grid-template-columns: minmax(0, 1fr); } }
.post-card > a {
  display: grid; grid-template-rows: auto 1fr; height: 100%; color: var(--fg); text-decoration: none;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.post-card > a:hover { border-color: var(--ring); box-shadow: var(--shadow-lg); }
.post-card > a:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.post-card-img img { border: 0; border-radius: 0; border-bottom: 1px solid var(--border); }
.post-card-txt { padding: 14px 16px 16px; display: flex; flex-direction: column; }
.post-card-txt h2, .post-card-txt h3 { font-size: 16.5px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.3; margin: 0 0 6px; }
.post-card-txt p { font-size: 14.5px; color: var(--muted-fg); margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-txt .meta { margin: auto 0 0; font-size: 13px; display: block; }
.post-card > a:hover h2, .post-card > a:hover h3 { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ring); }
/* Portada del blog: el más reciente, grande */
.blog-lista { display: grid; gap: 16px; padding-bottom: 8px; }
.post-card-grande > a { grid-template-rows: none; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.post-card-grande .post-card-img img { border-bottom: 0; border-right: 1px solid var(--border); height: 100%; object-fit: cover; }
.post-card-grande .post-card-txt { padding: 24px 26px; justify-content: center; }
.post-card-grande h2 { font-size: clamp(20px, 2.4vw, 26px); letter-spacing: -0.02em; margin-bottom: 10px; }
.post-card-grande .post-card-txt p { font-size: 15.5px; -webkit-line-clamp: 4; }
@media (max-width: 760px) {
  .post-card-grande > a { grid-template-columns: minmax(0, 1fr); }
  .post-card-grande .post-card-img img { border-right: 0; border-bottom: 1px solid var(--border); height: auto; }
  .post-card-grande .post-card-txt { padding: 14px 16px 16px; }
}
.post-mas { padding-bottom: 8px; }
.blog-todos { margin: 16px 0 0; font-weight: 550; }

/* ============ Recuento en directo a pantalla completa (directo.html, assets/directo.js) ============ */
.dx-body { overflow: hidden; }
.dx-body::before { display: none; }
.dx {
  --dx-panel: 420px; --dx-tabs: 50px;
  height: 100vh; height: 100dvh; display: grid; gap: 0 22px;
  grid-template-columns: minmax(0, 1fr) var(--dx-panel);
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  padding: env(safe-area-inset-top, 0) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
}
.dx-top { grid-column: 1 / -1; grid-row: 1; display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.dx-top .brand .mark { width: 30px; height: 30px; font-size: 13px; }
.dx-word { font-size: 16px; }
.dx-ensayo { font-size: 12px; font-weight: 600; color: var(--sepia-ink); background: var(--sepia-soft); border: 1px solid var(--sepia-line); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.dx-hueco { flex: 1; }

/* Marcador: alturas fijas, para que el mapa no cambie de tamaño cuando llegan datos */
.dx-marcador { grid-column: 1; grid-row: 2; padding: 14px 0 4px; min-width: 0; }
.dx-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dx-escrutado { font-size: 14px; color: var(--muted-fg); white-space: nowrap; }
.dx-escrutado b { font-size: 22px; font-weight: 700; color: var(--good); letter-spacing: -0.02em; }
.dx-meter { height: 5px; border-radius: 3px; background: var(--muted); margin: 8px 0 0; overflow: hidden; }
.dx-meter span { display: block; height: 100%; width: 0; background: var(--good); border-radius: 3px; transition: width .4s ease; }
.dx-meter-sm { margin: 4px 0 14px; height: 4px; }
.dx-titular { font-size: clamp(19px, 2.2vw, 26px); line-height: 1.25; height: 1.25em; max-width: none; margin: 12px 0 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-wrap: nowrap; }
.dx-titular b { font-weight: 700; }
.dx-tit-p { padding: 0 1px; }
.dx-barra { position: relative; display: flex; height: 20px; border-radius: 7px; background: var(--muted); }
.dx-barra span { height: 100%; transition: width .4s ease; }
.dx-barra span:first-child { border-radius: 7px 0 0 7px; }
.dx-barra span + span { box-shadow: inset 1px 0 0 var(--bg); }
.dx-maj { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 2px dashed var(--fg); opacity: .65; }
.dx-maj-t { position: absolute; top: calc(100% + 4px); transform: translateX(-50%); left: 50.29%; font-style: normal; font-size: 11.5px; color: var(--muted-fg); white-space: nowrap; }
.dx-chips { list-style: none; margin: 24px 0 0; padding: 0; display: flex; gap: 16px; font-size: 13.5px; height: 22px; overflow-x: auto; overflow-y: hidden; white-space: nowrap; scrollbar-width: none; }
.dx-chips::-webkit-scrollbar { display: none; }
.dx-chips li { flex: none; }
.dx-chips .party { gap: 6px; }
.dx-chips .party i { width: 9px; height: 9px; }
.dx-chips b { font-weight: 700; }
.dx-estim { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; margin: 6px 0 0; padding: 0 4px 0 10px; font-size: 13px; color: var(--fg);
  background: linear-gradient(90deg, var(--muted), transparent); border: 1px solid var(--border); border-radius: 9px; }
.dx-estim.dx-oculto { visibility: hidden; }
.dx-estim-in { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.dx-estim-in::-webkit-scrollbar { display: none; }
.dx-estim-p { flex: none; }
.dx-estim-ver { flex: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--fg); background: var(--card); border: 1px solid var(--border); border-radius: 7px; padding: 3px 8px; cursor: pointer; }

/* Mapa */
.dx-main { grid-column: 1; grid-row: 3; position: relative; min-height: 0; display: flex; flex-direction: column; }
.dx-vistas { position: absolute; top: 8px; right: 0; z-index: 3; display: flex; gap: 6px; align-items: center; }
.dx-modos[hidden] { display: none; }
.dx-cuadro { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.dx-flechas { pointer-events: none; }
.dx-flechas path { pointer-events: visiblePainted; cursor: pointer; }
.dx-flechas path:hover { filter: brightness(1.15); }
.dx-flechas path { stroke-linejoin: round; paint-order: stroke fill; }
/* Bloques y Cambio: la leyenda puede ocupar dos líneas */
.dx-ley.dx-ley-modo { height: auto; max-height: 52px; white-space: normal; flex-wrap: wrap; line-height: 1.35; text-align: center; }
.dx-subir { position: absolute; top: 8px; left: 0; z-index: 3; display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 13px; font-weight: 600; color: var(--fg);
  background: var(--card); border: 1px solid var(--border); border-radius: 9px; padding: 5px 10px 5px 6px; cursor: pointer; box-shadow: var(--shadow); }
.dx-subir[hidden] { display: none; }
.dx-subir svg { width: 16px; height: 16px; }
.dx-mapa { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.dx-mapa[hidden], .dx-hemi[hidden] { display: none; }
.dx-skel-mapa { position: absolute; inset: 10% 15%; border-radius: 24px; }
.dx-svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.dx-svg.dx-arrastrando { cursor: grabbing; }
.dx-svg.dx-arrastrando .dx-zonas path { cursor: grabbing; }
.dx-pulsos { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.dx-zonas path { fill: var(--muted); stroke: var(--bg); stroke-width: 1.1; vector-effect: non-scaling-stroke; stroke-linejoin: round; cursor: pointer; transition: fill .35s ease, opacity .3s ease; }
.dx-zonas path:hover { stroke: var(--fg); stroke-width: 1.6; }
.dx-zonas path.dx-sin { fill: var(--muted); }
.dx-zonas path.dx-tapada { fill: var(--muted); opacity: .35; pointer-events: none; }
.dx-zonas path.dx-sel { stroke: var(--fg); stroke-width: 2.4; }
.dx-zoom .dx-zonas:not(.dx-munis) path { opacity: .28; }
.dx-zoom .dx-zonas:not(.dx-munis) path.dx-sel { opacity: 1; fill-opacity: 0; }
.dx-munis path { stroke-width: .6; }
.dx-munis path.dx-parcial { fill-opacity: .6; }
.dx-munis path.dx-sel { stroke-width: 2.2; fill-opacity: .25; }
.dx-mini { fill: var(--muted); stroke: var(--bg); stroke-width: 2; vector-effect: non-scaling-stroke; cursor: pointer; }
.dx-zoom .dx-mini { opacity: .3; }
.dx-canarias { fill: none; stroke: var(--border); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.dx-pop { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 5; }
.dx-hemi { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; }
.dx-hemi .hemi-camara { width: 100%; max-width: 820px; }
.dx-ley { display: flex; align-items: center; gap: 2px 14px; margin: 4px 0 6px; font-size: 12.5px; height: 20px; overflow: hidden; white-space: nowrap; justify-content: center; }
.dx-ley[hidden] { display: none; }
.dx-ley .party { gap: 6px; font-weight: 550; flex: none; }
.dx-ley .party i { width: 9px; height: 9px; }
.dx-ley .muted { overflow: hidden; text-overflow: ellipsis; }
.dx-toast { position: absolute; bottom: 34px; left: 50%; z-index: 6; transform: translate(-50%, 8px); opacity: 0; transition: opacity .25s ease, transform .25s ease;
  display: flex; align-items: baseline; gap: 10px; width: max-content; max-width: min(calc(100% - 24px), 520px); padding: 10px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 14px; }
.dx-toast.visible { opacity: 1; transform: translate(-50%, 0); }
.dx-toast.imp3 { border-color: var(--fg); }
.dx-av-h { flex: none; font-size: 12px; font-weight: 700; color: var(--muted-fg); }

/* Tiempo */
.dx-tiempo { grid-column: 1; grid-row: 4; display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin: 4px 0 6px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.dx-play { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--fg); color: var(--bg); display: grid; place-items: center; cursor: pointer; }
.dx-play svg { width: 18px; height: 18px; }
.dx-play .i-play, .dx-play.pausado .i-pausa { display: none; }
.dx-play.pausado .i-play { display: inline; }
.dx-hora { font-size: 18px; font-weight: 700; min-width: 3.2em; }
.dx-pista { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.dx-slider { width: 100%; accent-color: var(--fg); }
.dx-hitos { position: absolute; left: 8px; right: 8px; top: -9px; height: 0; pointer-events: none; }
.dx-hito { position: absolute; top: -3px; width: 10px; height: 10px; margin-left: -5px; padding: 0; border-radius: 50%; border: 2px solid var(--card); background: var(--sepia); cursor: pointer; pointer-events: auto; }
.dx-final { flex: none; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted-fg); background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.dx-final i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-fg); }
.dx-final.activo { color: var(--fg); }
.dx-final.activo i { background: var(--good); }
.dx-nota { grid-column: 1; grid-row: 5; margin: 0 0 10px; font-size: 12px; color: var(--muted-fg); line-height: 1.45; }
.dx-nota p { margin: 0; }

/* Columna derecha: pestañas y paneles */
.dx-tabs { grid-column: 2; grid-row: 2; align-self: start; z-index: 4; display: flex; gap: 2px; margin-top: 12px; padding: 3px; border: 1px solid var(--border); border-radius: 12px; background: var(--muted); }
.dx-tabs button { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted-fg); background: none; border: 0; border-radius: 9px; padding: 7px 4px; cursor: pointer; }
.dx-tabs button svg { width: 17px; height: 17px; flex: none; }
.dx-tabs button[aria-current="page"] { background: var(--card); color: var(--fg); box-shadow: var(--shadow); }
.dx-solo-movil { display: none !important; }
.dx-insignia { position: absolute; top: -6px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #dc2626; color: #fff; font-size: 10.5px; line-height: 16px; text-align: center; }
.dx-insignia[hidden] { display: none; }
.dx-hoja, .dx-pagina { grid-column: 2; grid-row: 2 / 6; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: calc(var(--dx-tabs) + 26px) 2px 24px 2px; }
.dx-hoja { display: none; }
.dx-en-detalle .dx-hoja { display: block; }
.dx-pagina[hidden] { display: none; }
.dx-pagina > h2 { font-size: 22px; margin: 0 0 12px; }
.dx-hoja-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dx-asa { display: none; }
.dx-det-titulo { display: flex; align-items: center; gap: 4px; min-width: 0; }
.dx-det-titulo h2 { font-size: 22px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-flecha, .dx-cerrar { flex: none; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--muted); color: var(--fg); cursor: pointer; }
.dx-flecha { border-color: transparent; background: none; }
.dx-flecha[hidden], .dx-cerrar[hidden] { display: none; }
.dx-flecha svg, .dx-cerrar svg { width: 16px; height: 16px; }
.dx-sub { margin: 4px 0 8px; font-size: 14px; }
.dx-miga { margin: 0 0 2px; }
.dx-miga button { font: inherit; font-size: 13px; color: var(--muted-fg); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.dx-h3 { font-size: 15px; margin: 20px 0 8px; }
.dx-tabla { font-size: 13.5px; }
.dx-tabla td, .dx-tabla th { padding: 7px 10px; }
.dx-asientos { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; }
.dx-asientos i { width: 16px; height: 16px; border-radius: 4px; }
.dx-ultimo { font-size: 13.5px; padding: 10px 12px; border-radius: 10px; background: linear-gradient(90deg, var(--muted), transparent); border: 1px solid var(--border); margin: 0 0 14px; }
.dx-cands { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; gap: 4px; }
.dx-cands li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 2px 10px; padding: 7px 10px; border-radius: 10px; border: 1px solid transparent; font-size: 13.5px; }
.dx-cands li.electo { border-color: var(--border); background: linear-gradient(90deg, var(--muted), transparent); }
.dx-cands .party { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.dx-cands .party i { display: inline-block; margin-right: 7px; vertical-align: 1px; }
.dx-cand-barra { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: var(--muted); overflow: hidden; }
.dx-cand-barra span { display: block; height: 100%; opacity: .8; }
.dx-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.dx-lista button { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 2px 12px; font: inherit; font-size: 13.5px; color: var(--fg); text-align: left;
  background: none; border: 1px solid transparent; border-radius: 9px; padding: 7px 8px; cursor: pointer; }
.dx-lista button:hover { background: var(--muted); }
.dx-lista-simple button { grid-template-columns: minmax(0, 1fr) auto; }
.dx-l-n { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-l-e { font-size: 12.5px; }
.dx-l-p { font-size: 12.5px; white-space: nowrap; }
.dx-l-p .party { gap: 5px; }
.dx-l-p .party i { width: 8px; height: 8px; }
.dx-l-b { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: var(--muted); overflow: hidden; }
.dx-l-b span { display: block; height: 100%; background: var(--good); }
.dx-mas { margin-top: 10px; }
.dx-buscar { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 42px; border: 1px solid var(--border); border-radius: 11px; background: var(--card); margin: 0 0 6px; }
.dx-buscar svg { width: 18px; height: 18px; color: var(--muted-fg); flex: none; }
.dx-buscar input { flex: 1; min-width: 0; font: inherit; font-size: 15px; color: var(--fg); background: none; border: 0; outline: none; }
.dx-carta { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin: 0 0 14px; background: var(--card); }
.dx-carta h3 { font-size: 16px; margin: 0 0 4px; }
.dx-grande { font-size: 30px; font-weight: 700; margin: 4px 0 0; letter-spacing: -0.02em; }
.dx-estim-lista { list-style: none; margin: 12px 0 6px; padding: 0; display: grid; gap: 8px; }
.dx-estim-lista li { display: grid; grid-template-columns: minmax(0, 1fr) auto 56px; align-items: center; gap: 3px 10px; font-size: 13.5px; }
.dx-estim-lista .party { gap: 6px; font-weight: 550; }
.dx-estim-lista b { font-size: 16px; }
.dx-estim-lista .small { text-align: right; }
.dx-horq { grid-column: 1 / -1; position: relative; height: 8px; border-radius: 4px; background: var(--muted); }
.dx-horq-r { position: absolute; top: 0; bottom: 0; border-radius: 4px; opacity: .35; }
.dx-horq-p { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1.5px; border-radius: 2px; }
.dx-graf-h { margin: 12px 0 4px; }
.dx-graf { display: block; width: 100%; height: auto; }
.dx-graf-l { stroke: var(--border); stroke-width: 1; }
.dx-graf-t { fill: var(--muted-fg); font-size: 10px; }
.dx-ca { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.dx-ca-cab { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; margin-bottom: 3px; }
.dx-ca-barra { display: flex; height: 18px; border-radius: 5px; overflow: hidden; background: var(--muted); font-size: 10.5px; font-weight: 700; color: #fff; }
.dx-ca-barra span { display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); min-width: 2px; }
.dx-ca-barra span + span { box-shadow: inset 1px 0 0 var(--card); }
.dx-ca-barra .libre { background: var(--muted); }
.dx-avisos { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dx-avisos li > button { width: 100%; display: flex; align-items: baseline; gap: 10px; font: inherit; font-size: 14px; color: var(--fg); text-align: left; background: none; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; cursor: pointer; }
.dx-avisos li.imp3 > button { background: linear-gradient(90deg, var(--muted), transparent); border-color: var(--fg); }
.dx-avisos li.imp1 > button { font-size: 13px; color: var(--muted-fg); }

/* Móvil y tableta: mapa arriba, pestañas abajo; el detalle en una hoja que sube y las demás pestañas a pantalla completa */
@media (max-width: 959px) {
  .dx { display: flex; flex-direction: column; padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .dx-top { padding: 8px 0; }
  .dx-top .langs a { padding: 4px 5px; }
  .dx-marcador { padding: 10px 0 2px; }
  .dx-escrutado b { font-size: 19px; }
  .dx-titular { font-size: 18px; margin: 8px 0 8px; }
  .dx-barra { height: 15px; }
  .dx-chips { margin-top: 22px; font-size: 12.5px; gap: 12px; }
  .dx-estim { height: 28px; font-size: 12.5px; }
  .dx-main { flex: 1; }
  .dx-vistas { top: 4px; }
  .dx-subir { top: 4px; }
  .dx-toast { bottom: 30px; font-size: 13px; }
  .dx-tiempo { margin: 2px 0 4px; padding: 6px 10px; gap: 8px; }
  .dx-play { width: 32px; height: 32px; }
  .dx-hora { font-size: 16px; }
  .dx-nota { display: none; }
  .dx-solo-movil { display: flex !important; }
  .dx-solo-escritorio { display: none !important; }
  .dx-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--border); border-radius: 0; background: var(--card); }
  .dx-tabs button { flex-direction: column; gap: 2px; font-size: 11px; padding: 5px 2px; }
  .dx-tabs button svg { width: 21px; height: 21px; }
  .dx-tabs button[aria-current="page"] { background: none; box-shadow: none; color: var(--fg); }
  .dx-insignia { right: calc(50% - 22px); }
  .dx-pagina { position: fixed; z-index: 20; left: 0; right: 0; top: 0; bottom: calc(60px + env(safe-area-inset-bottom)); padding: calc(16px + env(safe-area-inset-top)) 16px 24px; background: var(--bg); }
  .dx-hoja { position: fixed; z-index: 25; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); height: 52dvh; display: none; padding: 0 16px 20px;
    border: 1px solid var(--border); border-bottom: 0; border-radius: 18px 18px 0 0; background: var(--card); box-shadow: 0 -12px 30px -14px rgba(0, 0, 0, .4); transition: height .28s ease, transform .2s ease; }
  .dx-con-hoja:not(.dx-en-pagina) .dx-hoja { display: block; }
  .dx-hoja-grande .dx-hoja { height: calc(100dvh - 120px); }
  .dx-hoja-cab { position: sticky; top: 0; z-index: 2; background: var(--card); padding: 18px 0 8px; touch-action: none; }
  .dx-asa { display: block; position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 80px; height: 18px; padding: 0; border: 0; background: none; cursor: pointer; }
  .dx-asa-raya { display: block; width: 40px; height: 5px; margin: 7px auto 0; border-radius: 3px; background: var(--border); }
  .dx-det-titulo h2 { font-size: 20px; }
}
@media (max-width: 420px) { .dx-ensayo { display: none; } }
@media (prefers-reduced-motion: reduce) { .dx-meter span, .dx-barra span, .dx-zonas path, .dx-hoja, .dx-toast { transition: none; } }

/* Logos de partido y fotos de candidatos de prueba, anillos, avisos con icono, pactos en el hemiciclo */
.dx-logo { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 6px; font-size: 8.5px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; text-transform: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.dx-logo::after { content: attr(data-t); }
.dx-logo.l4 { font-size: 7px; letter-spacing: -0.06em; }
.dx-marca { gap: 7px; }
.dx-chips .dx-logo { width: 18px; height: 18px; font-size: 7.5px; border-radius: 5px; }
.dx-estim .dx-logo, .dx-ley .dx-logo { width: 17px; height: 17px; font-size: 7px; border-radius: 5px; }
.dx-avatar { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; font-size: 11px; font-weight: 700; color: var(--fg);
  background: color-mix(in srgb, var(--c) 18%, var(--card)); box-shadow: inset 0 0 0 2px var(--c); }
.dx-cand-n { display: flex; align-items: center; gap: 9px; min-width: 0; font-weight: 550; }
.dx-cand-n > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-anillo { position: relative; display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; }
.dx-anillo svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.dx-anillo-f { fill: none; stroke: var(--muted); stroke-width: 3.4; }
.dx-anillo-v { fill: none; stroke-width: 3.4; stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.dx-anillo b { position: relative; font-size: 10.5px; font-weight: 700; }
.dx-anillo b i { font-style: normal; font-size: 6.5px; font-weight: 600; color: var(--muted-fg); margin-left: 0.5px; vertical-align: 3px; }
.dx-anillo .dx-anillo-ok { position: static; display: block; width: 16px; height: 16px; transform: none; color: var(--good); }
.dx-anillo-sm { width: 36px; height: 36px; }
.dx-anillo-lg { width: 84px; height: 84px; }
.dx-anillo-lg .dx-anillo-f, .dx-anillo-lg .dx-anillo-v { stroke-width: 2.6; }
.dx-anillo-lg b { font-size: 19px; letter-spacing: -0.02em; }
.dx-anillo-lg b small { font-size: 11px; font-weight: 600; color: var(--muted-fg); }
.dx-resumen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 4px; padding: 14px 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.dx-resumen > div { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12px; color: var(--muted-fg); font-weight: 550; }
.dx-lista button { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 12px; row-gap: 4px; padding: 8px; }
.dx-lista button > .dx-anillo { grid-row: 1 / 3; }
.dx-l-n { display: flex; flex-direction: column; line-height: 1.25; }
.dx-l-n small { font-size: 11.5px; font-weight: 500; }
.dx-l-p { display: inline-flex; align-items: center; gap: 6px; justify-self: end; }
.dx-l-p b { font-size: 13.5px; }
.dx-l-duelo { grid-column: 2 / 4; display: flex; height: 4px; border-radius: 2px; overflow: hidden; background: var(--muted); }
.dx-l-duelo span:first-child { flex: none; }
.dx-l-duelo span:last-child:not(:first-child) { flex: 1; opacity: .75; }
.dx-lista-simple button { grid-template-columns: minmax(0, 1fr) auto; }
.dx-lista-simple .dx-l-n { flex-direction: row; align-items: center; gap: 8px; }
.dx-av-ico { position: relative; flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; }
.dx-av-ico .dx-logo { width: 28px; height: 28px; font-size: 9.5px; border-radius: 8px; }
.dx-av-mini { position: absolute; right: -5px; bottom: -5px; width: 16px; height: 16px; padding: 2px; border-radius: 50%; background: var(--card); color: var(--fg); box-shadow: 0 0 0 1px var(--border); }
.dx-av-gen { border-radius: 8px; background: var(--muted); color: var(--fg); }
.dx-av-gen svg { width: 18px; height: 18px; }
.dx-av-t { flex: 1; min-width: 0; }
.dx-avisos li > button { align-items: center; gap: 12px; }
.dx-toast { align-items: center; }
.dx-vel { flex: none; min-width: 34px; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--fg); background: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 3px 6px; cursor: pointer; }
.dx-hemi { display: grid; grid-template-rows: 30px minmax(0, 1fr) auto; gap: 6px; padding-top: 44px; }
.dx-hemi .hemi-camara { min-height: 0; margin: 0 auto; width: 100%; max-width: 820px; display: flex; align-items: center; justify-content: center; }
.dx-hemi .hemi-svg { width: 100%; height: 100%; max-height: 100%; }
.dx-pacto-logos { display: inline-flex; align-items: center; gap: 4px; }
.dx-pacto-res { margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13.5px; white-space: nowrap; overflow: hidden; }
.dx-pacto-res .dx-logo { width: 20px; height: 20px; font-size: 8px; }
.dx-ok { color: var(--good); font-weight: 700; }
.dx-orden-cab { display: flex; align-items: flex-start; gap: 8px; }
.dx-orden { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; height: 74px; overflow-y: auto; align-content: flex-start; touch-action: none; }
.dx-orden li { position: relative; }
.dx-orden li.antes::before { content: ""; position: absolute; left: -5px; top: 2px; bottom: 2px; width: 3px; border-radius: 2px; background: var(--fg); }
.dx-orden li.cogido { z-index: 5; opacity: .9; }
.dx-orden li.cogido button { box-shadow: var(--shadow-lg); cursor: grabbing; }
.dx-orden button { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 600; color: var(--fg); background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 4px 9px 4px 4px; cursor: grab; user-select: none; -webkit-user-select: none; }
.dx-orden button .dx-logo { width: 22px; height: 22px; }
.dx-orden button[aria-pressed="true"] { border-color: var(--fg); background: linear-gradient(90deg, var(--muted), var(--card)); }
.dx-orden-reset { flex: none; font: inherit; font-size: 12px; color: var(--muted-fg); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 2px; }
@media (max-width: 959px) {
  .dx-hemi { grid-template-rows: 26px minmax(0, 1fr) auto; padding-top: 40px; }
  .dx-orden { height: 106px; justify-content: flex-start; }
  .dx-pacto-logos { display: none; }
  .dx-pacto-res { font-size: 12.5px; }
  .dx-orden button { font-size: 12px; padding: 3px 7px 3px 3px; }
  .dx-anillo-lg { width: 72px; height: 72px; }
  .dx-anillo-lg b { font-size: 16px; }
}

/* Votos por escrutar, zoom del mapa, cursor del gráfico, avances de participación y auditoría */
.dx-escrutado { text-align: right; }
.dx-faltan { display: block; height: 15px; font-size: 12px; line-height: 15px; font-weight: 500; }
.dx-faltan:empty::before { content: "\00a0"; }
.dx-zoom-ctl { position: absolute; right: 0; bottom: 34px; z-index: 3; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.dx-zoom-ctl button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; background: none; color: var(--fg); cursor: pointer; }
.dx-zoom-ctl button + button { border-top: 1px solid var(--border); }
.dx-zoom-ctl button:hover { background: var(--muted); }
.dx-zoom-ctl svg { width: 17px; height: 17px; }
.dx-au-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 600; color: var(--fg); background: var(--card); border: 1px solid var(--border); border-radius: 9px; padding: 5px 10px 5px 8px; cursor: pointer; }
.dx-au-btn svg { width: 17px; height: 17px; flex: none; }
.dx-au-btn[aria-pressed="true"] { border-color: var(--fg); background: linear-gradient(90deg, var(--muted), var(--card)); }
.dx-graf-caja { position: relative; }
.dx-graf-zona { fill: transparent; cursor: crosshair; touch-action: pan-y; }
.dx-graf-cursor line { stroke: var(--fg); stroke-width: 1.2; stroke-dasharray: 3 3; }
.dx-graf-cursor circle { stroke: var(--card); stroke-width: 1.5; }
.dx-graf-info { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-height: 28px; margin-top: 6px; font-size: 13px; }
.dx-graf-info > .muted { flex-basis: 100%; font-size: 12px; }
.dx-graf-v { display: inline-flex; align-items: center; gap: 5px; }
.dx-graf-v .dx-logo { width: 18px; height: 18px; font-size: 7.5px; border-radius: 5px; }
.dx-graf-v b { font-size: 14px; }
.dx-avances { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.dx-avances li { display: grid; grid-template-columns: 44px minmax(0, 1fr) 54px 46px; align-items: center; gap: 10px; font-size: 13.5px; }
.dx-avances li > b, .dx-avances li > span:last-child { text-align: right; }
.dx-av-cab { font-size: 11.5px; }
.dx-av-hora { font-weight: 600; }
.dx-av-barra { position: relative; height: 10px; border-radius: 5px; background: var(--muted); }
.dx-av-barra span { display: block; height: 100%; border-radius: 5px; background: var(--good); transition: width .4s ease; }
.dx-av-barra i { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 2px solid var(--fg); opacity: .55; }
.dx-av-prov { margin: 4px 0 10px; }
.dx-au { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 14px 16px; margin: 0 0 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.dx-au h3 { font-size: 15.5px; margin: 3px 0 4px; }
.dx-au p { margin: 0 0 6px; font-size: 14px; line-height: 1.5; }
.dx-au p:last-child { margin-bottom: 0; }
.dx-au-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--muted); color: var(--muted-fg); }
.dx-au-ico svg { width: 18px; height: 18px; }
.dx-au-ico.ok { background: color-mix(in srgb, var(--good) 16%, var(--card)); color: var(--good); }
.dx-au-dif { padding: 6px 10px; border-radius: 9px; background: linear-gradient(90deg, var(--muted), transparent); }
.dx-au-cera { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.dx-au-cera > span { white-space: nowrap; }
.dx-au-cera .dx-logo { width: 18px; height: 18px; font-size: 7.5px; border-radius: 5px; margin-right: 5px; vertical-align: -4px; }
@media (max-width: 959px) {
  .dx-faltan { font-size: 11px; }
  .dx-zoom-ctl { bottom: 26px; }
  .dx-zoom-ctl button { width: 32px; height: 32px; }
  .dx-au-btn { padding: 5px 7px; }
  .dx-au-btn span { display: none; }
  .dx-avances li { grid-template-columns: 40px minmax(0, 1fr) 50px 42px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .dx-av-barra span { transition: none; } }
.dx-pulsos { filter: blur(2px); }
.dx-graf-ir { font: inherit; font-size: 12px; font-weight: 600; color: var(--fg); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Buscador «¿Me ha tocado mesa?» (blog) */
.buscador-mesa { margin: 18px 0 26px; padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(135deg, var(--muted), var(--card) 60%); box-shadow: var(--shadow); }
.bm-label { display: block; font-weight: 650; font-size: 15px; margin: 0 0 8px; }
.bm-campo { position: relative; }
.bm-campo > svg { position: absolute; left: 12px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted-fg); pointer-events: none; }
.bm-campo input { width: 100%; font: inherit; font-size: 16px; color: var(--fg); background: var(--card); border: 1px solid var(--border); border-radius: 10px; height: 44px; padding: 0 12px 0 38px; }
.bm-campo input:focus { outline: 2px solid var(--fg); outline-offset: 1px; }
.bm-lista { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.bm-lista:empty { display: none; }
.bm-lista button { width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font: inherit; font-size: 15px; text-align: left; color: var(--fg); background: var(--card); border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; cursor: pointer; }
.bm-lista button:hover, .bm-lista button:focus-visible { border-color: var(--fg); }
.bm-lista button span { font-size: 13px; color: var(--muted-fg); white-space: nowrap; }
.bm-vacio { font-size: 14px; color: var(--muted-fg); padding: 6px 2px; }
.bm-ficha:empty { display: none; }
.bm-ficha { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.bm-ficha h3 { font-size: 18px; margin: 0 0 6px; }
.bm-ficha h3 .muted { font-weight: 500; font-size: 15px; }
.bm-ficha p { margin: 0 0 8px; }
.post-body .bm-acciones { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.bm-acciones .btn { text-decoration: none; }
.post-body .bm-lista { padding: 0; margin: 8px 0 0; }
.post-body .bm-lista li { margin: 0; padding: 0; }
.post-body .bm-lista li::before { content: none; }

/* Listas escritas en el HTML por functions/candidaturas (las ven los buscadores; candidaturas.js las sustituye) */
.cand-ssr h2 { font-size: 20px; margin: 0 0 4px; }
.cand-ssr-ls { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.cand-ssr-l { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--card); }
.cand-ssr-l h3 { font-size: 15px; margin: 0 0 6px; }
.cand-ssr-l ol { margin: 0 0 6px; padding-left: 22px; font-size: 14px; }
.cand-ssr-provs { columns: 2; padding-left: 18px; font-size: 14px; }
@media (max-width: 620px) { .cand-aviso { padding: 8px 12px; font-size: 13px; margin-bottom: 10px; } }

/* Widgets: configurador (widgets.html) */
.wg-tipos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.wg-tipos button { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; row-gap: 2px; align-items: center; text-align: left; font: inherit; color: var(--fg); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; box-shadow: var(--shadow); }
.wg-tipos button svg { grid-row: 1 / 3; width: 26px; height: 26px; color: var(--sepia); }
.wg-tipos button b { font-size: 14.5px; }
.wg-tipos button span { font-size: 12.5px; color: var(--muted-fg); line-height: 1.35; }
.wg-tipos button[aria-checked="true"] { border-color: var(--fg); background: linear-gradient(135deg, var(--sepia-soft), var(--card) 70%); }
.wg-tipos button:disabled { cursor: default; opacity: .55; box-shadow: none; }
.wg-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 20px; align-items: start; }
.wg-opciones { position: sticky; top: calc(var(--hdr, 92px) + 12px); display: grid; gap: 16px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.wg-campo { display: grid; gap: 7px; margin: 0; padding: 0; border: 0; min-width: 0; }
.wg-campo > label, .wg-l { font-size: 13px; font-weight: 600; padding: 0; }
.wg-campo select { width: 100%; font: inherit; font-size: 15px; color: var(--fg); background: var(--card); border: 1px solid var(--border); border-radius: 10px; height: 40px; padding: 0 10px; }
.wg-campo select:disabled { opacity: .6; }
.wg-campo .seg { width: 100%; }
.wg-campo .seg button { flex: 1; padding-inline: 6px; }
.wg-nota { margin: 0; }
.wg-checks { gap: 8px; }
.wg-checks label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.wg-checks input { width: 16px; height: 16px; accent-color: var(--fg); margin: 0; }
.wg-derecha { display: grid; gap: 16px; min-width: 0; }
.wg-vista { border: 1px solid var(--border); border-radius: var(--radius); background: repeating-conic-gradient(var(--muted) 0 25%, transparent 0 50%) 0 0 / 18px 18px; padding: 14px; }
.wg-vista-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted-fg); }
.wg-marco-vista { display: flex; justify-content: center; }
.wg-marco-vista iframe { display: block; width: 100%; max-width: 760px; height: 640px; border: 0; transition: width .25s ease; background: transparent; }
.wg-codigo { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.wg-codigo-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.wg-codigo-cab label { font-weight: 600; }
.wg-codigo textarea { width: 100%; font: 12.5px/1.5 var(--mono); color: var(--fg); background: var(--muted); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; resize: vertical; }
.wg-codigo p { margin: 8px 0 0; }
@media (max-width: 960px) { .wg-layout { grid-template-columns: minmax(0, 1fr); } .wg-opciones { position: static; } .wg-tipos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .wg-tipos button span { display: none; } .wg-vista { padding: 8px; } }
@media (prefers-reduced-motion: reduce) { .wg-marco-vista iframe { transition: none; } }
.wg-h { font-size: 17px; margin: 0 0 6px; letter-spacing: -0.01em; }
.wg-opciones [hidden] { display: none !important; }
.wg-campo input[type="text"] { width: 100%; font: inherit; font-size: 15px; color: var(--fg); background: var(--card); border: 1px solid var(--border); border-radius: 10px; height: 40px; padding: 0 10px; }
.wg-tipos button:not(:disabled):hover { border-color: var(--muted-fg); }

/* Recuento en directo, escritorio ancho: el mapa ocupa toda la pantalla, de fondo, y encima flotan dos paneles
   (izquierda: marcador, resultados y nota del ensayo; derecha: detalle, explorar, avisos y auditoría) y la barra de
   tiempo entre los dos, como en seuimposto. Por debajo de 1180 px sigue la rejilla de siempre: los envoltorios
   .dx-izq y .dx-der no generan caja (display: contents) y sus hijos se colocan como antes. */
.dx-izq, .dx-der { display: contents; }
@media (min-width: 1180px) {
  .dx {
    --dx-izq: clamp(330px, 24vw, 390px); --dx-der: clamp(390px, 28vw, 440px); --dx-top-h: 56px; --dx-m: 16px;
    --dx-vidrio: color-mix(in srgb, var(--card) 93%, transparent);
    display: block; position: relative; padding: 0;
  }
  .dx-top { position: absolute; z-index: 12; top: 0; left: 0; right: 0; height: var(--dx-top-h); padding: 0 20px; border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
  .dx-main { position: absolute; inset: 0; z-index: 0; }
  .dx-izq, .dx-der { display: flex; flex-direction: column; position: absolute; z-index: 10; top: calc(var(--dx-top-h) + var(--dx-m)); bottom: var(--dx-m);
    background: var(--dx-vidrio); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
  .dx-izq { left: var(--dx-m); width: var(--dx-izq); }
  .dx-der { right: var(--dx-m); width: var(--dx-der); }
  /* Panel izquierdo */
  .dx-marcador { flex: none; padding: 16px 18px 12px; border-bottom: 1px solid var(--border); }
  /* En el panel, el titular puede ocupar dos líneas (alto fijo: el panel no salta al cambiar el texto) */
  .dx-izq .dx-titular { font-size: 20px; line-height: 1.25; height: 2.5em; white-space: normal; text-wrap: balance; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .dx-izq .dx-fila { flex-wrap: wrap; row-gap: 8px; }
  .dx-izq .dx-camara button { padding: 5px 10px; font-size: 13.5px; }
  .dx-izq .dx-escrutado b { font-size: 20px; }
  .dx-izq .dx-escrutado { margin-left: auto; }
  .dx-izq .dx-pagina { flex: 1; min-height: 0; padding: 16px 18px 20px; }
  .dx-izq .dx-pagina > h2 { font-size: 18px; }
  .dx-nota { flex: none; margin: 0; padding: 10px 18px 12px; border-top: 1px solid var(--border); font-size: 11.5px; }
  /* Panel derecho: la pestaña Resultados ya está a la izquierda */
  .dx-tab-res { display: none !important; }
  .dx-der .dx-tabs { flex: none; align-self: stretch; margin: 12px 12px 0; }
  .dx-der .dx-tabla td, .dx-der .dx-tabla th { padding: 7px 8px; }
  .dx-der .dx-hoja, .dx-der .dx-pagina { flex: 1; min-height: 0; padding: 16px 18px 20px; }
  /* Barra de tiempo, controles del mapa y avisos flotantes: en el hueco entre los dos paneles */
  .dx-tiempo { position: absolute; z-index: 10; left: calc(var(--dx-izq) + var(--dx-m) * 2); right: calc(var(--dx-der) + var(--dx-m) * 2); bottom: var(--dx-m); margin: 0;
    background: var(--dx-vidrio); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--shadow-lg); }
  .dx-vistas { top: calc(var(--dx-top-h) + var(--dx-m)); right: calc(var(--dx-der) + var(--dx-m) * 2); }
  .dx-subir { top: calc(var(--dx-top-h) + var(--dx-m)); left: calc(var(--dx-izq) + var(--dx-m) * 2); }
  .dx-zoom-ctl { right: calc(var(--dx-der) + var(--dx-m) * 2); bottom: calc(var(--dx-m) + 84px); }
  .dx-toast { left: calc(var(--dx-izq) + var(--dx-m) * 2 + (100% - var(--dx-izq) - var(--dx-der) - var(--dx-m) * 4) / 2); bottom: calc(var(--dx-m) + 84px); max-width: min(520px, calc(100% - var(--dx-izq) - var(--dx-der) - var(--dx-m) * 6)); }
  .dx-ley { position: absolute; z-index: 3; left: calc(var(--dx-izq) + var(--dx-m) * 2); right: calc(var(--dx-der) + var(--dx-m) * 2); bottom: calc(var(--dx-m) + 66px); margin: 0; }
  .dx-hemi { padding: calc(var(--dx-top-h) + var(--dx-m) + 48px) calc(var(--dx-der) + var(--dx-m) * 3) 100px calc(var(--dx-izq) + var(--dx-m) * 3); }
  .dx-hemi { grid-template-rows: auto minmax(0, 1fr) auto; }
  .dx-pacto-res { white-space: normal; flex-wrap: wrap; text-align: center; min-height: 30px; }
}

/* Favoritos del recuento: estrella junto al nombre de la zona, botón en la cabecera con su número y lista */
.dx-estrella { flex: none; margin-left: auto; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--muted); color: var(--fg); cursor: pointer; }
.dx-estrella[hidden] { display: none; }
.dx-estrella svg { width: 17px; height: 17px; }
.dx-estrella[aria-pressed="true"] { color: #d99a0b; border-color: color-mix(in srgb, #d99a0b 45%, var(--border)); background: color-mix(in srgb, #d99a0b 12%, var(--card)); }
.dx-estrella[aria-pressed="true"] svg { fill: currentColor; }
@media (prefers-reduced-motion: no-preference) { .dx-estrella[aria-pressed="true"] svg { animation: dx-estrella .32s ease; } }
@keyframes dx-estrella { 40% { transform: scale(1.3); } }
.dx-fav-btn { position: relative; }
.dx-fav-btn svg { color: #d99a0b; }
.dx-fav-n { min-width: 18px; height: 18px; padding: 0 5px; margin-left: 1px; border-radius: 9px; background: var(--fg); color: var(--bg); font-size: 11px; line-height: 18px; text-align: center; }
.dx-fav-n[hidden] { display: none; }
.dx-favs .dx-fav { display: flex; align-items: center; gap: 4px; }
.dx-favs .dx-fav > button:first-child { flex: 1; min-width: 0; width: auto; }
.dx-lista .dx-fav-quitar, .dx-fav-quitar { flex: none; width: 32px; height: 32px; min-width: 0; grid-template-columns: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted-fg); cursor: pointer; }
.dx-fav-quitar:hover { background: var(--muted); color: var(--fg); }
.dx-fav-quitar svg { width: 15px; height: 15px; }
@media (max-width: 959px) {
  .dx-fav-btn .dx-fav-n { position: absolute; top: -6px; right: -6px; height: 16px; min-width: 16px; line-height: 16px; padding: 0 4px; font-size: 10px; margin: 0; }
}
/* En el móvil, el botón de favoritos se queda en el icono, pero su nombre sigue ahí para los lectores de pantalla */
@media (max-width: 959px) { .dx-fav-btn span[data-i18n] { display: block; position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; } }

/* Selector de idioma compacto (assets/app.js, selectorIdioma): botón «🌐 ES ▾» y lista desplegable propia */
.langs-dd { position: relative; flex: none; display: inline-flex; }
.site-header .wrap > .langs-dd { margin-left: auto; }
.langs-btn { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 8px 0 9px; font: inherit; font-size: 12.5px; font-weight: 650; color: var(--fg);
  background: var(--muted); border: 1px solid var(--border); border-radius: 9px; cursor: pointer; }
.langs-btn:hover { border-color: var(--muted-fg); }
.langs-btn svg { width: 16px; height: 16px; flex: none; color: var(--muted-fg); }
.langs-btn .langs-chev { width: 14px; height: 14px; transition: transform .18s ease; }
.langs-dd.abierto .langs-chev { transform: rotate(180deg); }
.langs-dd .langs-menu { position: absolute; z-index: 60; top: calc(100% + 6px); right: 0; display: none; flex-direction: column; gap: 1px; min-width: 168px; padding: 5px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); }
.langs-dd.abierto .langs-menu { display: flex; }
@media (prefers-reduced-motion: no-preference) { .langs-dd.abierto .langs-menu { animation: langs-abre .14s ease-out; } }
@keyframes langs-abre { from { opacity: 0; transform: translateY(-4px); } }
.langs-dd .langs-menu a { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 10px; border-radius: 8px; font-size: 14px; font-weight: 550; color: var(--fg); box-shadow: none; background: none; }
.langs-dd .langs-menu a b { font-size: 11px; font-weight: 700; color: var(--muted-fg); letter-spacing: .02em; }
.langs-dd .langs-menu a:hover, .langs-dd .langs-menu a:focus-visible { background: var(--muted); outline: none; }
.langs-dd .langs-menu a[aria-current="true"] { background: var(--sepia-soft); color: var(--sepia-ink); box-shadow: none; }
.langs-dd .langs-menu a[aria-current="true"] b { color: var(--sepia-ink); }
@media (prefers-reduced-motion: reduce) { .langs-btn .langs-chev { transition: none; } }

/* Recuento en el móvil: la cabecera (favoritos, auditoría, idioma y tema) se queda arriba también en las demás pestañas */
@media (max-width: 959px) {
  .dx-top { height: 52px; padding: 0; }
  .dx-pagina { top: calc(52px + env(safe-area-inset-top, 0px)); padding-top: 14px; border-top: 1px solid var(--border); }
}

/* Comunidades en el recuento: filas y cabeceras que abren la comunidad; en el mapa, sus provincias se ven enteras */
.dx-ca-ir { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0; padding: 4px 6px; margin: 0 -6px; border-radius: 9px; }
button.dx-ca-ir { cursor: pointer; width: calc(100% + 12px); }
button.dx-ca-ir:hover { background: var(--muted); }
.dx-h3-btn { font: inherit; color: inherit; background: none; border: 0; padding: 2px 6px; margin: 0 -6px; border-radius: 8px; cursor: pointer; }
.dx-h3-btn:hover { background: var(--muted); }
.dx-h3-btn span { color: var(--muted-fg); }
.dx-zoom .dx-zonas:not(.dx-munis) path.dx-en-ca { opacity: 1; }
.dx-miga button + .muted { margin: 0 4px; }
.dx-tab-tit { display: none; }

/* Móvil: el nombre de la pestaña en la cabecera; con una zona abierta, el marcador se queda en una línea y la hoja,
   más baja (y se puede bajar a «mini» para ver el mapa casi entero) */
@media (max-width: 959px) {
  .dx-en-pagina .dx-top .brand .dx-word, .dx-en-pagina .dx-ensayo { display: none; }
  .dx-en-pagina .dx-tab-tit { display: block; flex: 1; min-width: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dx-en-pagina .dx-hueco { display: none; }
  .dx-pagina > h2 { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .dx-con-hoja:not(.dx-en-pagina) .dx-titular { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .dx-con-hoja:not(.dx-en-pagina) .dx-barra, .dx-con-hoja:not(.dx-en-pagina) .dx-camara,
  .dx-con-hoja:not(.dx-en-pagina) .dx-estim, .dx-con-hoja:not(.dx-en-pagina) .dx-ley { display: none; }
  .dx-con-hoja:not(.dx-en-pagina) .dx-marcador { padding-bottom: 6px; }
  .dx-hoja { height: 42dvh; }
  .dx-hoja-mini .dx-hoja { height: 150px; }
  .dx-hoja-mini .dx-hoja-cuerpo { overflow: hidden; }
}
@media (max-width: 959px) { .dx-hoja-mini .dx-hoja-cuerpo { -webkit-mask-image: linear-gradient(#000 40%, transparent 85%); mask-image: linear-gradient(#000 40%, transparent 85%); } }

/* Recuento, 31 oct (tarde) */
/* Móvil con una zona abierta: en lugar de Congreso/Senado, el recuento y los escaños de cada partido en una línea */
@media (max-width: 959px) {
  .dx-con-hoja:not(.dx-en-pagina) .dx-fila { justify-content: flex-start; }
  .dx-con-hoja:not(.dx-en-pagina) .dx-escrutado { display: flex; align-items: baseline; gap: 6px; text-align: left; }
  .dx-con-hoja:not(.dx-en-pagina) .dx-escrutado b { font-size: 17px; }
  .dx-con-hoja:not(.dx-en-pagina) .dx-faltan { display: inline; margin-left: 4px; }
  .dx-con-hoja:not(.dx-en-pagina) .dx-meter { margin-top: 6px; }
  .dx-con-hoja:not(.dx-en-pagina) .dx-chips { margin-top: 8px; }
  /* El mapa, de lado a lado de la pantalla; sus controles, a 12 px del borde */
  .dx-main { margin-left: calc(-1 * max(20px, env(safe-area-inset-left, 0px))); margin-right: calc(-1 * max(20px, env(safe-area-inset-right, 0px))); }
  .dx-subir { left: 12px; }
  .dx-vistas { right: 12px; }
  .dx-zoom-ctl { right: 12px; }
  .dx-ley { padding: 0 20px; }
  .dx-hemi { padding-left: 16px; padding-right: 16px; }
}

/* Barra de tiempo con las mismas proporciones que el resto: pista fina, mando pequeño y esquinas como los paneles */
.dx-tiempo { border-radius: 16px; gap: 12px; }
.dx-play { width: 34px; height: 34px; }
.dx-play svg { width: 16px; height: 16px; }
.dx-hora { font-size: 16px; min-width: 3em; }
.dx-slider { -webkit-appearance: none; appearance: none; height: 22px; margin: 0; background: transparent; cursor: pointer; }
.dx-slider::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--fg) var(--v, 0%), var(--border) var(--v, 0%)); }
.dx-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: var(--card); border: 2px solid var(--fg); box-shadow: var(--shadow); }
.dx-slider::-moz-range-track { height: 4px; border-radius: 2px; background: var(--border); }
.dx-slider::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--fg); }
.dx-slider::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--fg); }
.dx-slider:focus-visible { outline: none; }
.dx-slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--fg) 22%, transparent); }
.dx-hitos { top: -7px; }
.dx-hito { width: 8px; height: 8px; margin-left: -4px; border-width: 1.5px; }
.dx-vel { height: 26px; border-radius: 7px; }
@media (min-width: 1180px) { .dx-tiempo { border-radius: 18px; padding: 10px 16px; } }
@media (max-width: 959px) { .dx-tiempo { border-radius: 14px; padding: 6px 12px 6px 6px; } .dx-play { width: 32px; height: 32px; } .dx-hora { font-size: 15px; } }

/* Estimación final: los escaños estimados en una barra, con la línea de la mayoría absoluta */
.dx-estim { gap: 10px; padding: 0 4px 0 10px; background: var(--card); }
.dx-estim-et { flex: none; font-size: 12px; font-weight: 600; color: var(--muted-fg); white-space: nowrap; }
.dx-estim-barra { position: relative; flex: 1; min-width: 0; display: flex; height: 18px; border-radius: 5px; background: var(--muted); }
.dx-estim-barra > span { display: flex; align-items: center; justify-content: center; gap: 3px; min-width: 2px; padding: 0 3px; overflow: hidden; white-space: nowrap; font-size: 10.5px; font-weight: 600; }
.dx-estim-barra > span:first-child { border-radius: 5px 0 0 5px; }
.dx-estim-barra > span + span { box-shadow: inset 1px 0 0 var(--card); }
.dx-estim-barra b { font-weight: 800; }
.dx-estim-maj { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 2px dashed var(--fg); opacity: .7; }
@media (max-width: 959px) { .dx-estim-et { font-size: 11.5px; } .dx-estim-barra { height: 16px; } }

/* Avisos flotantes del recuento: arriba del mapa (debajo de sus botones), en lugar de abajo */
.dx-toast { top: 50px; bottom: auto; transform: translate(-50%, -8px); }
.dx-toast.visible { transform: translate(-50%, 0); }
@media (max-width: 959px) { .dx-toast { top: 46px; bottom: auto; } }
@media (min-width: 1180px) { .dx-toast { top: calc(var(--dx-top-h) + var(--dx-m) + 46px); bottom: auto; } }

/* Comunidad elegida en el mapa: un solo contorno marcado alrededor de toda la comunidad; dentro, las provincias con su
   borde fino de siempre y sin el realce al pasar el ratón (se confundía con una provincia elegida) */
.dx-ca-contorno { fill: none; stroke: var(--fg); stroke-width: 2.2; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.dx-en-comunidad .dx-zonas path.dx-en-ca:hover { stroke: var(--bg); stroke-width: 1.1; filter: brightness(.94); }

/* Resultados: estimación con titular, gráfico de evolución y reparto */
.dx-estim-carta h3 { font-size: 13px; font-weight: 600; color: var(--muted-fg); margin: 0 0 6px; }
.dx-estim-tit { margin: 0; font-size: 19px; line-height: 1.3; font-weight: 650; letter-spacing: -0.01em; text-wrap: balance; }
.dx-estim-tit b { font-weight: 800; }
.dx-estim-subt { margin: 6px 0 4px; font-size: 13px; }
.dx-graf-maj { stroke: var(--fg); stroke-width: 1; stroke-dasharray: 3 3; opacity: .55; }
.dx-h4 { font-size: 14px; margin: 18px 0 2px; }
.dx-estim-lista li { grid-template-columns: minmax(0, 1fr) auto auto; }
.dx-estim-lista .small { white-space: nowrap; min-width: 4.6em; text-align: right; }
.dx-horq-maj { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 1.5px dashed var(--fg); opacity: .45; }
.dx-estim-nota { margin: 14px 0 0; }
@media (max-width: 420px) { .dx-estim-tit { font-size: 17.5px; } .dx-estim-lista li { gap: 3px 8px; } }

/* Aviso de cookies (assets/cookies.js): tarjeta abajo a la izquierda; aceptar y rechazar con el mismo peso */
.cookies { position: fixed; z-index: 80; left: 16px; bottom: 16px; width: min(400px, calc(100vw - 32px)); padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--card); color: var(--fg); box-shadow: var(--shadow-lg); font-size: 13.5px; line-height: 1.5; }
.cookies[hidden] { display: none; }
.cookies p { margin: 0; }
.cookies a { color: var(--fg); text-underline-offset: 2px; }
.cookies-botones { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.cookies-botones .btn { min-width: 96px; justify-content: center; }
@media (prefers-reduced-motion: no-preference) { .cookies { animation: cookies-sube .25s ease-out; } }
@keyframes cookies-sube { from { opacity: 0; transform: translateY(8px); } }
/* En el recuento en el móvil, por encima de la barra de pestañas */
@media (max-width: 959px) { .dx-body .cookies { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); } }
.pie-cookies { font: inherit; color: var(--muted-fg); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.pie-cookies:hover { color: var(--fg); }
