#H_GDVAP {
    --hd-rojo: #cc0000; --hd-rojo-suave: #b94040; --hd-activo: #1a1a1a; --hd-gris: #6f6f6f; --hd-gris-claro: #9a9a9a; --hd-raya: #e3e3e3;
    --hd-nom: 7.5rem;
    display: block; margin: 0; padding: 0; border: 0; background: #fff; color: #000; text-align: left;
    font-family: Roboto, Arial, sans-serif; font-size: 1rem; font-weight: 400; line-height: 1.375;
  }
  #H_GDVAP, #H_GDVAP *, #H_GDVAP *::before, #H_GDVAP *::after { box-sizing: border-box; }
  /* Por si la web anfitriona trae estilos para estas etiquetas: aquí heredan los del gráfico */
  #H_GDVAP :is(p, ol, li, div, span, label, strong) { margin: 0; padding: 0; border: 0; list-style: none; font-family: inherit; font-size: inherit; font-weight: inherit; font-style: normal; line-height: inherit; color: inherit; text-transform: none; letter-spacing: normal; text-decoration: none; background: none; }
  #H_GDVAP [hidden] { display: none !important; }
  #H_GDVAP :focus-visible { outline: 2px solid var(--hd-rojo); outline-offset: 2px; }

  #H_GDVAP .hd-titulo { margin: 0 0 4px; font-family: Merriweather, Georgia, serif; font-size: 1.375rem; font-weight: 700; line-height: 1.3; color: #000; text-wrap: balance; }
  #H_GDVAP .hd-subtitulo { margin: 0 0 16px; color: var(--hd-gris); text-wrap: balance; }

  /* Pestañas (por provincia / por partido) y desplegables */
  #H_GDVAP .hd-pestanas { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; border-bottom: 1px solid #dcdcdc; }
  #H_GDVAP .hd-pestanas button {
    margin: 0 0 -1px; padding: 6px 10px; cursor: pointer; font-family: Roboto, Arial, sans-serif; font-size: 1rem; font-weight: 700; line-height: 1.375;
    color: #000; background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; box-shadow: none; text-transform: none; letter-spacing: normal;
  }
  #H_GDVAP .hd-pestanas button:hover { border-bottom-color: #b5b5b5; }
  #H_GDVAP .hd-pestanas button[aria-pressed="true"] { border-bottom-color: var(--hd-activo); }
  #H_GDVAP .hd-panel { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; margin: 0 0 16px; }
  #H_GDVAP .hd-campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-weight: 700; }
  #H_GDVAP .hd-select {
    -webkit-appearance: none; appearance: none; width: 14rem; max-width: 100%; margin: 0; min-width: 0; min-height: 2.5rem; padding: 6px 36px 6px 10px; cursor: pointer;
    font-family: Roboto, Arial, sans-serif; font-size: 1rem; font-weight: 400; line-height: 1.375; color: #000; border: 1px solid #000; border-radius: 0; box-shadow: none; text-transform: none; letter-spacing: normal;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpolyline points='1,1.5 6,6.5 11,1.5' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center;
  }
  #H_GDVAP .hd-select:hover { border-color: var(--hd-rojo); }

  /* Ficha de lo que se ve: la provincia (con su silueta) o el partido (con su resumen) */
  #H_GDVAP .hd-ficha { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
  #H_GDVAP .hd-ficha .hd-silueta { width: 3rem; height: 3rem; }
  #H_GDVAP .hd-ficha-nombre { display: block; font-size: 1.125rem; font-weight: 700; line-height: 1.375rem; }
  #H_GDVAP .hd-ficha-extra { display: block; line-height: 1.375rem; color: var(--hd-gris); }
  #H_GDVAP .hd-ficha-partido { padding-left: 10px; border-left: 4px solid var(--c, #9a9a9a); }

  /* Tabla de tres columnas, como las de EpData: votos de 2026, votos de 2023 y diferencia, cada una con su
     barra y su cifra (dentro de la barra si cabe; si no, detrás). Las pérdidas, en barra hueca */
  #H_GDVAP .hd-escrutado { margin: 0 0 8px; color: var(--hd-gris); }
  #H_GDVAP .hd-escrutado strong { font-weight: 700; color: var(--hd-rojo-suave); }
  #H_GDVAP .hd-tabla { overflow: hidden; overflow: clip; }
  #H_GDVAP .hd-cabecera, #H_GDVAP .hd-fila {
    display: grid; column-gap: 10px;
    grid-template-columns: var(--hd-nom) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr);   /* la diferencia, más ancha: sale del centro */
    grid-template-areas: "nom c1 c2 c3";
  }
  #H_GDVAP.hd-v-partido { --hd-nom: 11rem; }
  #H_GDVAP .hd-cabecera { align-items: end; padding: 0 0 6px; border-bottom: 1px solid #000; line-height: 1.25; color: var(--hd-gris); }
  #H_GDVAP .hd-cab1 { grid-area: c1; }
  #H_GDVAP .hd-cab2 { grid-area: c2; }
  #H_GDVAP .hd-cab3 { grid-area: c3; text-align: center; }
  #H_GDVAP .hd-fila { border-bottom: 1px solid var(--hd-raya); }
  #H_GDVAP .hd-nombre { grid-area: nom; align-self: center; min-width: 0; margin: 10px 0; font-weight: 700; line-height: 1.25rem; overflow-wrap: anywhere; }
  #H_GDVAP .hd-lugar { grid-area: nom; align-self: center; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 0; }
  #H_GDVAP .hd-silueta { flex: none; display: block; width: 2rem; height: 2rem; overflow: visible; }
  #H_GDVAP .hd-silueta path { fill: #c4c4c4; stroke: none; }
  #H_GDVAP .hd-lugar-textos { display: flex; flex-direction: column; min-width: 0; }
  #H_GDVAP .hd-lugar-nombre { font-weight: 700; line-height: 1.375rem; }
  #H_GDVAP .hd-lugar-ccaa { line-height: 1.25rem; color: var(--hd-gris-claro); }
  /* Todas las provincias de una comunidad: un bloque por provincia, con su nombre y su silueta */
  #H_GDVAP .hd-bloque { display: flex; align-items: center; gap: 10px; padding: 20px 0 6px; border-bottom: 1px solid #000; }
  #H_GDVAP .hd-bloque:first-child { padding-top: 12px; }
  #H_GDVAP .hd-bloque-nombre { font-size: 1.125rem; font-weight: 700; line-height: 1.375rem; }
  #H_GDVAP .hd-celda { position: relative; align-self: center; min-width: 0; height: 1.75rem; margin: 9px 0; }
  #H_GDVAP .hd-c1 { grid-area: c1; }
  #H_GDVAP .hd-c2 { grid-area: c2; }
  #H_GDVAP .hd-c3 { grid-area: c3; }
  #H_GDVAP .hd-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--c, #9a9a9a); transition: width .7s cubic-bezier(.22, .8, .24, 1); }
  #H_GDVAP .hd-bar.hd-minimo { min-width: 2px; }
  /* Cada columna sale de una raya negra (la base de sus barras). En la diferencia, la raya va en el centro y marca el 0: lo que se gana,
     a la derecha, y lo que se pierde, a la izquierda, en gris; la cifra, por fuera de la barra */
  #H_GDVAP .hd-celda::before { content: ''; position: absolute; z-index: 1; top: 0; bottom: 0; left: 0; width: 2px; background: #000; }
  #H_GDVAP .hd-c3::before { left: 50%; margin-left: -1px; }
  #H_GDVAP .hd-c3 .hd-bar { left: 50%; background: #9a9a9a; }
  #H_GDVAP .hd-c3 .hd-bar.hd-neg { left: auto; right: 50%; }
  /* Partidos que en la elección anterior fueron dentro de una coalición («Parte de Sumar en 2023…»): el texto ocupa 2023 y diferencia */
  #H_GDVAP .hd-fila.hd-parte .hd-c2 { grid-column: c2-start / c3-end; height: auto; min-height: 1.75rem; display: flex; align-items: center; padding-left: 8px; }
  #H_GDVAP .hd-fila.hd-parte .hd-c2 .hd-num { position: static; transform: none; white-space: normal; }
  #H_GDVAP .hd-fila.hd-parte .hd-c2 .hd-bar, #H_GDVAP .hd-fila.hd-parte .hd-c3 { display: none; }
  #H_GDVAP .hd-num { position: absolute; top: 50%; left: 6px; transform: translateY(-50%); white-space: nowrap; line-height: 1.25; font-variant-numeric: tabular-nums; transition: opacity .25s ease; }
  #H_GDVAP .hd-num.hd-dentro { font-weight: 700; }
  #H_GDVAP .hd-num.hd-fuera { font-weight: 400; color: #000; }
  #H_GDVAP .hd-num.hd-nada { font-weight: 400; color: var(--hd-gris); }
  /* Las cifras se apagan mientras sus barras cambian de tamaño y vuelven al acabar */
  #H_GDVAP:not(.hd-visto) .hd-num, #H_GDVAP .hd-moviendo .hd-num { opacity: 0; transition: opacity .12s ease; }
  #H_GDVAP .hd-vacio { margin: 16px 0 0; color: var(--hd-gris); }
  #H_GDVAP .hd-aviso { margin: 10px 0 0; padding-left: 10px; border-left: 3px solid var(--hd-rojo); color: var(--hd-rojo); }
  /* Pie: la hora de actualización como nota y, en otra línea, la fuente */
  #H_GDVAP .hd-pie { margin: 14px 0 0; padding-top: 8px; border-top: 1px solid #dcdcdc; text-align: right; color: var(--hd-gris); }
  #H_GDVAP .hd-oculto { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

  /* Estrecho (menos de 400 px de ancho del gráfico; la clase la pone el script): el nombre encima de sus tres columnas */
  #H_GDVAP.hd-estrecho .hd-titulo { font-size: 1.25rem; }
  #H_GDVAP.hd-estrecho .hd-campo { flex: 1 1 100%; }
  #H_GDVAP.hd-estrecho .hd-select { width: 100%; }
  #H_GDVAP.hd-estrecho .hd-cabecera { column-gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "c1 c2 c3"; }
  #H_GDVAP.hd-estrecho .hd-fila { column-gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "nom nom nom" "c1 c2 c3"; }
  #H_GDVAP.hd-estrecho .hd-nombre { margin: 8px 0 0; }
  #H_GDVAP.hd-estrecho .hd-lugar { padding: 8px 0 0; }
  #H_GDVAP.hd-estrecho .hd-lugar-textos { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
  #H_GDVAP.hd-estrecho .hd-celda { height: 2.375rem; margin: 4px 0 10px; }
  #H_GDVAP.hd-estrecho .hd-bar { top: auto; height: 10px; }
  #H_GDVAP.hd-estrecho .hd-celda::before { top: auto; height: 14px; }
  #H_GDVAP.hd-estrecho .hd-num { top: 0; transform: none; }

  @media (prefers-reduced-motion: reduce) {
    #H_GDVAP .hd-bar, #H_GDVAP .hd-num { transition: none !important; }
  }
