/* papeleta.es — lo propio de esta web, encima de style.css
   style.css es el mismo de 29n.voto, sin cambios (cópialo tal cual cuando cambie allí): así las dos webs comparten
   componentes, tipografía, neutros, radios y sombras. Aquí solo van:
   1. El acento de papeleta.es. 29n.voto usa el sepia de la papeleta del Senado; papeleta.es, el azul de la tinta con
      la que se marca. Los componentes de style.css leen el acento de las variables --sepia*, así que basta con
      cambiarlas aquí (el nombre se queda por compatibilidad).
   2. Los componentes que solo tiene esta web: pactómetro, estado de cada sección, enlace a 29n.voto, sondeos. */
:root {
  --sepia: #4f46e5;
  --sepia-ink: #4338ca;
  --sepia-soft: #f1f1fe;
  --sepia-line: #d9dafb;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --sepia: #8f8cf5; --sepia-ink: #a5a3f8; --sepia-soft: #16162b; --sepia-line: #2c2b55; }
}
:root[data-theme="dark"] { --sepia: #8f8cf5; --sepia-ink: #a5a3f8; --sepia-soft: #16162b; --sepia-line: #2c2b55; }

/* ---------- Estado de cada sección (portada) ---------- */
.estado, .index-list .when.estado { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 550; color: var(--muted-fg); }
.estado::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ring); flex: none; }
.estado.listo, .index-list .when.estado.listo { color: var(--good); }
.estado.listo::before { background: var(--good); }

/* ---------- Enlace a 29n.voto ---------- */
.hermana {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 22px; color: var(--fg); text-decoration: none; transition: border-color .15s, box-shadow .15s;
}
.hermana:hover { border-color: var(--ring); box-shadow: var(--shadow-lg); }
.hermana .mark29 {
  width: 44px; height: 44px; border-radius: 11px; background: var(--primary); color: var(--primary-fg);
  display: grid; place-items: center; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; position: relative;
}
.hermana .mark29::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 7px; height: 3px; border-radius: 2px; background: #a8743f; }
.hermana h2, .hermana h3 { margin: 0 0 2px; font-size: 17px; letter-spacing: -0.01em; }
.hermana p { margin: 0; color: var(--muted-fg); font-size: 14px; }
.hermana .go { font-size: 13.5px; font-weight: 550; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.hermana .go svg { width: 15px; height: 15px; transition: transform .15s; }
.hermana:hover .go svg { transform: translateX(3px); }
@media (max-width: 620px) { .hermana { grid-template-columns: auto minmax(0, 1fr); } .hermana .go { grid-column: 2; } }

/* ---------- Tarjeta de la portada: el Congreso de hoy ---------- */
.portada-hemi { padding: 18px 20px 16px; }
.portada-hemi .cd-label { display: flex; justify-content: space-between; gap: 10px; }
.portada-hemi .hemi-camara { margin: 6px auto 0; }
.portada-hemi .hemi-ley { justify-content: center; }

/* ---------- Pactómetro ---------- */
.pm-bases { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.pm-bases button {
  display: grid; gap: 1px; text-align: left; font: inherit; color: var(--fg); cursor: pointer;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 9px 14px; transition: border-color .15s, background .15s;
}
.pm-bases button b { font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
.pm-bases button span { font-size: 12.5px; color: var(--muted-fg); }
.pm-bases button:hover:not(:disabled) { border-color: var(--ring); }
.pm-bases button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.pm-bases button[aria-pressed="true"] span { color: inherit; opacity: .75; }
.pm-bases button:disabled { cursor: default; box-shadow: none; background: transparent; border-style: dashed; }
.pm-bases button:disabled b { color: var(--muted-fg); }
@media (max-width: 620px) {
  .pm-bases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .pm-bases button { padding: 8px 10px; }
  .pm-bases button b { font-size: 13px; }
  .pm-bases button span { font-size: 11.5px; line-height: 1.3; }
}

.pm-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .pm-grid { grid-template-columns: minmax(0, 1fr); } }
.pm-res { position: sticky; top: 104px; }
@media (max-width: 900px) { .pm-res { position: static; } }
.pm-res .hemi-camara { margin: 4px auto 0; }
.pm-cifras { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0 14px; }
.pm-cifras div { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; text-align: center; }
.pm-cifras b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.pm-cifras span { font-size: 12.5px; color: var(--muted-fg); }
.pm-veredicto { margin: 0 0 12px; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; text-align: center; text-wrap: balance; }
.pm-votaciones { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.pm-votaciones li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.pm-votaciones li:last-child { border-bottom: 0; padding-bottom: 0; }
.pm-votaciones .req { grid-column: 1; color: var(--muted-fg); font-size: 13px; }
.pm-votaciones .res { grid-row: 1 / 3; grid-column: 2; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; padding: 4px 10px; border-radius: 999px; background: var(--muted); color: var(--muted-fg); }
.pm-votaciones .res.ok { color: var(--good); background: color-mix(in srgb, var(--good) 12%, var(--card)); }
.pm-votaciones .res i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.pm-cab { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-bottom: 10px; }
.pm-cab h2 { font-size: 17px; margin: 0; letter-spacing: -0.01em; }
.pm-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.pm-presets button, .pm-acciones button {
  font: inherit; font-size: 12.5px; font-weight: 550; color: var(--fg); cursor: pointer;
  background: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px;
}
.pm-presets button:hover, .pm-acciones button:hover { border-color: var(--ring); }
.pm-presets button small { font-weight: 450; color: var(--muted-fg); margin-left: 4px; }
.pm-acciones { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 14px; }
.pm-acciones button { background: var(--card); }

.pm-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pm-fila {
  --c: var(--ring);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 8px 8px 8px 10px; border-radius: var(--radius-sm); background: var(--card);
  box-shadow: inset 0 0 0 1px var(--border); transition: background .15s, box-shadow .15s;
}
/* Elegido: degradado suave de su color y contorno uniforme de su color (sin bordes laterales) */
.pm-fila[data-voto="si"] { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 16%, var(--card)), var(--card) 75%); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 75%, transparent); }
.pm-fila[data-voto="abs"] { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 7%, var(--card)), var(--card) 75%); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 35%, transparent); }
.pm-logo {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: var(--c); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: -0.03em; line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.pm-logo.claro { color: #18181b; }
.pm-logo.l4 { font-size: 8.5px; letter-spacing: -0.06em; }
.pm-n { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pm-n b { font-size: 14.5px; font-weight: 600; }
.pm-n span { font-size: 12.5px; color: var(--muted-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Control de tres opciones: Sí · Abst. · No */
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: 9px; background: var(--muted); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted-fg); padding: 4px 9px; border-radius: 7px; line-height: 1.3; cursor: pointer; transition: background .15s, color .15s; }
.seg input:checked + span { background: var(--card); color: var(--fg); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 1px; }
.seg label:hover input:not(:checked) + span { color: var(--fg); }
@media (max-width: 380px) { .seg span { padding: 4px 7px; } .pm-fila { gap: 8px; } }

/* Hemiciclo del pactómetro: síes en su color, abstenciones a medias, noes apagados */
.hemi-svg .asiento.abst { opacity: .42; }
.hemi-svg .asiento { transition: opacity .2s; }

.pm-aviso { margin: 10px 0 0; text-align: center; }
.pm-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); opacity: 0; z-index: 50; background: var(--primary); color: var(--primary-fg); font-size: 13.5px; font-weight: 550; padding: 8px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); transition: opacity .2s, transform .2s; pointer-events: none; }
.pm-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Secciones en preparación ---------- */
.prep { display: grid; gap: 10px; justify-items: start; }
.temas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .temas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.temas > div { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.temas .icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px; background: var(--muted); border: 1px solid var(--border); }
.temas .icon svg { width: 18px; height: 18px; }
.temas h3 { margin: 0 0 4px; font-size: 15.5px; }
.temas p { margin: 0; font-size: 13.5px; color: var(--muted-fg); }

/* ---------- Sondeos ---------- */
.veda { border-color: var(--sepia-line); }
.sondeos-vacio { text-align: center; padding: 36px 22px; }
.sondeos-vacio p { color: var(--muted-fg); max-width: 56ch; margin-inline: auto; }
.so-h { margin-top: 32px; }
.so-media-cab { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 0 0 12px; }
.so-media-cab b { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.so-media-cab span { font-size: 13px; }
.so-barras { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.so-barras li { display: grid; grid-template-columns: 150px minmax(0, 1fr) 64px 190px; gap: 12px; align-items: center; font-size: 14px; }
.so-barras .party i { background: var(--c); }
.so-barra { height: 10px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.so-barra span { display: block; height: 100%; border-radius: 999px; background: var(--c); }
.so-barras b { text-align: right; font-weight: 650; }
@media (max-width: 720px) {
  .so-barras li { grid-template-columns: 110px minmax(0, 1fr) 58px; row-gap: 0; }
  .so-rango { grid-column: 1 / -1; padding-left: 20px; font-size: 12px; }
}
.so-tabla caption { padding-bottom: 10px; }
.so-tabla th, .so-tabla td { white-space: nowrap; }
.so-tabla tbody th { position: sticky; left: 0; background: var(--card); z-index: 1; }
.so-tabla tr.so-en-media th, .so-tabla tr.so-en-media td { background: var(--sepia-soft); }

/* ---------- Programas: quién lo ha publicado ---------- */
.prog-estado tbody th { min-width: 180px; }
.prog-estado td:nth-child(2) { max-width: 220px; color: var(--muted-fg); }
.prog-estado td:last-child { white-space: nowrap; }
.so-nota { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; margin-left: 4px; vertical-align: 1px; font-size: 10px; font-weight: 700; font-style: italic; color: var(--muted-fg); border: 1px solid var(--border); cursor: help; }
@media (max-width: 620px) {
  .so-tabla tbody th { white-space: normal; min-width: 0; max-width: 128px; font-size: 13.5px; }
  .so-tabla td, .so-tabla thead th { padding: 10px 12px; font-size: 13.5px; }
}

/* ---------- Sondeos: evolución ---------- */
.so-media { margin-top: 16px; }
.so-evol-cab h3 { margin: 0 0 2px; font-size: 17px; letter-spacing: -0.01em; }
.so-evol-cab p { margin: 0 0 10px; }
.so-ley { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.so-ley button { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12.5px; font-weight: 550; color: var(--muted-fg); background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px 3px 8px; cursor: pointer; }
.so-ley button i { width: 12px; height: 2px; border-radius: 2px; background: var(--c); opacity: .35; }
.so-ley button[aria-pressed="true"] { color: var(--fg); border-color: color-mix(in srgb, var(--c) 60%, var(--border)); background: linear-gradient(90deg, color-mix(in srgb, var(--c) 10%, var(--card)), var(--card)); }
.so-ley button[aria-pressed="true"] i { opacity: 1; }
.so-evol-fig { position: relative; }
.so-evol-svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.so-grid { stroke: var(--border); stroke-width: 1; }
.so-eje { fill: var(--muted-fg); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.so-punto { fill: var(--c); fill-opacity: .4; stroke: var(--card); stroke-width: 1; }
.so-linea { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.so-guia { fill: none; stroke: var(--ring); stroke-width: 1; }
.so-fin { fill: var(--muted-fg); font-size: 12px; font-weight: 550; }
.so-fin-v { fill: var(--fg); font-weight: 650; font-variant-numeric: tabular-nums; }
.so-cursor { stroke: var(--fg); stroke-width: 1; opacity: .35; pointer-events: none; }
.so-capa { fill: transparent; cursor: crosshair; outline: none; }
.so-capa:focus-visible { stroke: var(--ring); stroke-width: 2; }
.so-tip { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; min-width: 130px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 8px 10px; font-size: 12.5px; }
.so-tip p { display: flex; align-items: center; gap: 7px; margin: 0; line-height: 1.6; }
.so-tip .so-tip-f { color: var(--muted-fg); margin-bottom: 2px; }
.so-tip i { width: 12px; height: 2px; border-radius: 2px; background: var(--c); flex: none; }
.so-tip b { font-weight: 650; font-variant-numeric: tabular-nums; min-width: 44px; }
.so-tip span { color: var(--muted-fg); }
/* Oscuro: los colores de partido más oscuros (Podemos, UPN…) se aclaran un poco para que se vean sobre el fondo */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .so-linea, :root:not([data-theme="light"]) .so-punto { --c2: color-mix(in srgb, var(--c) 78%, #fff); stroke: var(--c2); } :root:not([data-theme="light"]) .so-punto { fill: var(--c2); stroke: var(--card); } }
:root[data-theme="dark"] .so-linea, :root[data-theme="dark"] .so-punto { --c2: color-mix(in srgb, var(--c) 78%, #fff); stroke: var(--c2); }
:root[data-theme="dark"] .so-punto { fill: var(--c2); stroke: var(--card); }
