




:root {

  --ed-rojo: #D0021B;
  --ed-negro: #1a1a1a;
  --ed-amarillo: #ECDC19;
  --ed-azul: #4A90E2;

  --ed-azul-principal: #005695;


  --ed-gris-900: #333333;
  --ed-gris-700: #4a4a4a;
  --ed-gris-500: #939393;
  --ed-gris-300: #c5c5c5;
  --ed-gris-200: #dedede;
  --ed-gris-100: #eaeaea;


  --ed-texto: #1a1a1a;
  --ed-texto-suave: #4a4a4a;


  --ed-radio: 4px;


  --ed-fuente: 'Encode Sans', 'Helvetica Neue', Arial, sans-serif;
  --ed-fuente-titulo: 'Sanomat-Bold', Georgia, 'Times New Roman', serif;
}


.ed-rectos { --ed-radio: 0px; }




.ed-chart,
.ed-chart *,
.ed-chart *::before,
.ed-chart *::after {
  box-sizing: border-box;
}

.ed-chart {
  font-family: var(--ed-fuente);
  color: var(--ed-texto);
  line-height: 1.4;
  margin: 24px 0;

  text-align: left;

  clear: left;
}



.ed-titulo {
  font-family: var(--ed-fuente);
  font-weight: 700;
  color: var(--ed-negro);
  font-size: 22px;
  line-height: 1.2;
  margin: 0 0 4px;
}

.ed-titulo.ed-display,
.ed-display .ed-titulo {
  font-family: var(--ed-fuente-titulo);
}
.ed-subtitulo {
  font-family: var(--ed-fuente);
  color: var(--ed-texto-suave);
  font-size: 14px;
  margin: 0 0 16px;
}
.ed-fuente {
  font-family: var(--ed-fuente);
  color: var(--ed-gris-500);
  font-size: 12px;
  margin-top: 8px;
}




.ed-chart .ed-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}



.ed-chart .ed-svg text { font-family: var(--ed-fuente); }
.ed-chart .ed-eje text { font-size: 14px; fill: var(--ed-gris-500); }
.ed-chart .ed-eje path { stroke-width: 0; }
.ed-chart .ed-eje line { stroke: var(--ed-gris-500); stroke-width: 1; }
.ed-chart .ed-eje-grid line { stroke: var(--ed-gris-300); stroke-width: 0.5; stroke-dasharray: 3; }


.ed-chart .ed-halo {
  stroke: #fff;
  stroke-width: 3px;
  stroke-opacity: 0.9;
  paint-order: stroke;
}


.ed-chart .ed-highlight-layer rect,
.ed-chart .ed-highlight-layer circle,
.ed-chart .ed-highlight-layer path {
  fill: none;
  stroke: var(--ed-negro);
  stroke-width: 2px;
}





.ed-switch {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid #cecece; border-radius: var(--ed-radio);
  padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: #888;
  font-family: var(--ed-fuente); cursor: pointer; user-select: none;
  transition: color 0.15s, border-color 0.15s;
}
.ed-switch:hover { border-color: #bbb; }
.ed-switch:has(input:checked) { color: var(--ed-negro); border-color: var(--ed-azul-principal); }
.ed-switch input {
  appearance: none; -webkit-appearance: none;
  position: relative; flex: none; margin: 0; cursor: pointer;
  width: 30px; height: 17px; border-radius: 9px; background: #cfcfcf; transition: background 0.2s;
}
.ed-switch input::before {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: transform 0.2s;
}
.ed-switch input:checked { background: var(--ed-azul-principal); }
.ed-switch input:checked::before { transform: translateX(13px); }




.ed-dropdown { position: relative; display: inline-block; font-family: var(--ed-fuente); }
.ed-dropdown-trigger {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: #fff; border: 1px solid #cecece; border-radius: var(--ed-radio);
  padding: 6px 11px; font-size: 13px; color: var(--ed-negro);
}
.ed-dropdown-trigger:hover { border-color: #bbb; }
.ed-dropdown-lbl { color: #888; font-weight: 600; }
.ed-dropdown-cur { font-weight: 700; }
.ed-dropdown-caret { color: #888; transition: transform 0.15s; }
.ed-dropdown.abierto .ed-dropdown-caret { transform: rotate(180deg); }
.ed-dropdown-menu {
  display: none; position: absolute; left: 0; top: calc(100% + 5px); z-index: 1000; min-width: 210px;
  list-style: none; margin: 0; padding: 4px 0; background: #fff; border: 1px solid #ececec; border-radius: var(--ed-radio);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); text-align: left;
}
.ed-dropdown.abierto .ed-dropdown-menu { display: block; }
.ed-dropdown-menu li { padding: 7px 13px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; border-bottom: 1px solid #eee; }
.ed-dropdown-menu li:last-child { border-bottom: none; }
.ed-dropdown-menu li:hover, .ed-dropdown-menu li.sel { background: var(--ed-gris-100); }
.ed-dropdown-menu .ed-dropdown-n { font-weight: 600; color: var(--ed-negro); font-size: 13.5px; }
.ed-dropdown-menu .ed-dropdown-d { color: #999; font-size: 12px; }




.chart-mapa-votantes { container-type: inline-size; }


.chart-mapa-votantes .mapa-votantes { position: relative; height: 700px; background: #000; overflow: hidden; }
.chart-mapa-votantes .mapa { position: absolute; inset: 0; }


.chart-mapa-votantes .panel {
  position: absolute; left: 10px; z-index: 1;
  background: rgba(0, 0, 0, 0.6); color: #fff; padding: 10px 12px; border-radius: 5px;
  font-size: 13px; width: 260px;
}
.chart-mapa-votantes .panel-arriba { top: 10px; }
.chart-mapa-votantes .panel-abajo { bottom: 30px; }
.chart-mapa-votantes .subtitulo { font-size: 12px; margin-top: 6px; }
.chart-mapa-votantes .panel-abajo .subtitulo { margin-top: 0; }


.chart-mapa-votantes .maplibregl-ctrl.maplibregl-ctrl-attrib,
.chart-mapa-votantes .maplibregl-ctrl-attrib.maplibregl-compact { background-color: rgba(0, 0, 0, 0.6); color: #fff; }
.chart-mapa-votantes .maplibregl-ctrl-attrib a { color: #fff; }
.chart-mapa-votantes .maplibregl-ctrl-attrib-button,
.chart-mapa-votantes .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button {
  background-color: transparent; -webkit-tap-highlight-color: transparent;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");
}
.chart-mapa-votantes .maplibregl-ctrl-attrib-button:focus { box-shadow: none; }
.chart-mapa-votantes .maplibregl-ctrl-attrib-button:focus-visible { box-shadow: 0 0 0 2px #fff; }


.chart-mapa-votantes .geocoder { margin-bottom: 8px; }
.chart-mapa-votantes .geocoder .mapboxgl-ctrl-geocoder { width: 100%; max-width: none; min-width: 0; font-family: var(--ed-fuente); box-shadow: none; }
.chart-mapa-votantes .geocoder .mapboxgl-ctrl-geocoder--input { font-size: 13px; font-family: var(--ed-fuente); height: 34px; }
.chart-mapa-votantes .geocoder .mapboxgl-ctrl-geocoder--icon-search { top: 8px; }


.chart-mapa-votantes .navegacion-eleccion { display: flex; gap: 4px; }
.chart-mapa-votantes .navegacion-eleccion button,
.chart-mapa-votantes .selector {
  font-family: var(--ed-fuente); font-weight: 700; cursor: pointer;
  background: rgba(0, 0, 0, 0.6); color: #fff; border: 2px solid #EEEDED; border-radius: 0;
}
.chart-mapa-votantes .navegacion-eleccion button { font-size: 14px; padding: 0 8px; }

.chart-mapa-votantes .navegacion-eleccion button:hover,
.chart-mapa-votantes .navegacion-eleccion button:focus,
.chart-mapa-votantes .navegacion-eleccion button:active {
  background: rgba(0, 0, 0, 0.6); color: #fff; border-color: #EEEDED; box-shadow: none; outline: none;
  transform: none; text-decoration: none; opacity: 1;
}
.chart-mapa-votantes .navegacion-eleccion button { -webkit-tap-highlight-color: transparent; }

@media (hover: hover) {
  .chart-mapa-votantes .navegacion-eleccion button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.15); }
}
.chart-mapa-votantes .selector:focus { outline: none; box-shadow: none; }

.chart-mapa-votantes .navegacion-eleccion button:focus-visible,
.chart-mapa-votantes .selector:focus-visible { outline: 2px solid #fff; outline-offset: -5px; border-radius: 0; }
.chart-mapa-votantes .navegacion-eleccion button:disabled { color: rgba(255, 255, 255, 0.3); cursor: default; }
.chart-mapa-votantes .selector { width: 100%; font-size: 13px; padding: 4px 6px; }

@supports (-webkit-touch-callout: none) {
  .chart-mapa-votantes .geocoder .mapboxgl-ctrl-geocoder--input { font-size: 16px; }
}


.chart-mapa-votantes .leyenda { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 8px 0; }
.chart-mapa-votantes .leyenda span { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.chart-mapa-votantes .leyenda i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }


.chart-mapa-votantes .ed-switch {
  background: transparent; border-color: rgba(255, 255, 255, 0.25); font-weight: 400;
  color: rgba(255, 255, 255, 0.5); transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.chart-mapa-votantes .ed-switch:hover { border-color: rgba(255, 255, 255, 0.6); }
.chart-mapa-votantes .ed-switch:has(input:checked) { color: #fff; font-weight: 700; border-color: #fff; background: rgba(255, 255, 255, 0.15); }
.chart-mapa-votantes .ed-switch input { background: #333; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.chart-mapa-votantes .ed-switch input::before { background: #888; box-shadow: none; transition: transform 0.2s, background 0.2s; }
.chart-mapa-votantes .ed-switch input:checked { background: #fff; box-shadow: none; }
.chart-mapa-votantes .ed-switch input:checked::before { background: #141414; }


.chart-mapa-votantes .cargando {
  position: absolute; inset: 0; z-index: 3; display: none; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.35); pointer-events: none;
}
.chart-mapa-votantes .cargando.activo { display: flex; }
.chart-mapa-votantes .cargando div {
  width: 40px; height: 40px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff; animation: ed-spin 0.8s linear infinite;
}
@keyframes ed-spin { to { transform: rotate(360deg); } }



.chart-mapa-votantes .tooltip-votos { width: 300px; max-width: 300px; z-index: 2; pointer-events: none; color: #fff; font-family: var(--ed-fuente); }
.chart-mapa-votantes .tooltip-votos .maplibregl-popup-content {
  background: #141414; border-radius: 0; border: 1px solid rgba(255, 255, 255, 0.3); box-shadow: none;
}
.chart-mapa-votantes .tooltip-votos .maplibregl-popup-tip { display: none; }
.chart-mapa-votantes .tooltip-votos h3 {
  font-size: 14px; margin: 0 0 10px; font-weight: 700; border-bottom: 0.5px solid #c5c5c5;
}
.chart-mapa-votantes .tooltip-votos h3 span { font-size: 12px; font-weight: 400; }

.chart-mapa-votantes .barra { display: flex; font-size: 12px; line-height: 15px; }
.chart-mapa-votantes .barra div {
  display: flex; justify-content: center; align-items: center; height: 15px; font-weight: 600;
}
.chart-mapa-votantes .tooltip-votos .barra { margin: 10px 0; }

.chart-mapa-votantes .minimapa-barra { min-height: 29px; }
.chart-mapa-votantes .minimapa-barra .barra div { height: 12px; }
.chart-mapa-votantes .barra-etiquetas { display: flex; margin-top: 3px; font-size: 11px; line-height: 14px; color: var(--ed-negro); }
.chart-mapa-votantes .barra-etiquetas span { overflow: hidden; white-space: nowrap; padding-right: 4px; box-sizing: border-box; }
.chart-mapa-votantes .barra-etiquetas b { font-weight: 700; }
.chart-mapa-votantes .tooltip-votos table { width: 100%; border-collapse: collapse; font-size: 12px; }
.chart-mapa-votantes .tooltip-votos th { text-align: left; }
.chart-mapa-votantes .tooltip-votos tr { height: 20px; }
.chart-mapa-votantes .tooltip-votos td { border-bottom: 1px solid rgba(255, 255, 255, 0.25); }
.chart-mapa-votantes .tooltip-votos .numero { text-align: right; }
.chart-mapa-votantes .tooltip-votos .pct { font-weight: 700; }

.chart-mapa-votantes .tooltip-votos .punto {
  display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.chart-mapa-votantes .tooltip-votos .abstencion,
.chart-mapa-votantes .tooltip-votos .sin-datos { font-size: 12px; margin-top: 8px; }


@keyframes mv-tooltip-sube { from { bottom: -500px; } to { bottom: 20px; } }
.chart-mapa-votantes .tooltip-votos.tooltip-movil {
  position: fixed; top: auto; bottom: 20px; left: 15px; right: 15px; margin: 0 auto;
  width: auto; max-width: 600px !important; transform: none !important; z-index: 999; pointer-events: auto;
  animation: mv-tooltip-sube 0.3s ease-out; transition: bottom 0.25s ease-in;
}
.chart-mapa-votantes .tooltip-votos.tooltip-movil.tooltip-saliendo { bottom: -500px; }
.chart-mapa-votantes .tooltip-movil .maplibregl-popup-content { width: 100%; box-sizing: border-box; max-height: 60vh; overflow-y: auto; }

.chart-mapa-votantes .tooltip-cerrar,
.chart-mapa-votantes .cerrar-pantalla-completa {
  width: 32px; height: 32px; padding: 0; display: flex; justify-content: center; align-items: center; cursor: pointer;
  background: #000; color: #fff; border: 1px solid #fff; border-radius: 50%;
  font-family: var(--ed-fuente); font-size: 24px; line-height: 1;
  -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent; outline: none;
}
.chart-mapa-votantes .tooltip-cerrar:focus-visible,
.chart-mapa-votantes .cerrar-pantalla-completa:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.chart-mapa-votantes .tooltip-cerrar { position: absolute; top: 0; right: 0; margin: 6px; z-index: 1; }
.chart-mapa-votantes .tooltip-cerrar + h3 { padding-right: 40px; }





.chart-mapa-votantes .minimapas-controles { position: relative; z-index: 3; margin-bottom: 12px; }

.chart-mapa-votantes .minimapas-buscador { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.chart-mapa-votantes .minimapas-controles .geocoder { flex: 1 1 260px; max-width: 420px; min-height: 36px; margin: 0; }
.chart-mapa-votantes .minimapas-exportar {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; cursor: pointer;
  font-family: var(--ed-fuente); font-size: 13px; font-weight: 600; white-space: nowrap;
  background: #fff; color: var(--ed-negro); border: 1px solid #cecece; border-radius: var(--ed-radio);
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: border-color 0.15s;
}
.chart-mapa-votantes .minimapas-exportar:hover:not(:disabled) { border-color: var(--ed-negro); }
.chart-mapa-votantes .minimapas-exportar:disabled { cursor: progress; color: var(--ed-gris-500); }
.chart-mapa-votantes .minimapas-ciudades { display: flex; flex-wrap: wrap; gap: 6px; }
.chart-mapa-votantes .minimapas-ciudades button {
  font-family: var(--ed-fuente); font-size: 12px; line-height: 1; padding: 6px 12px; cursor: pointer; white-space: nowrap;
  background: #fff; color: var(--ed-negro); border: 1px solid #cecece; border-radius: 999px;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.chart-mapa-votantes .minimapas-ciudades button:hover { border-color: var(--ed-negro); }
.chart-mapa-votantes .minimapas-ciudades button.activo { background: var(--ed-negro); color: #fff; border-color: var(--ed-negro); font-weight: 600; }

.chart-mapa-votantes .minimapas-controles .mapboxgl-ctrl-geocoder { border: 1px solid #cecece; border-radius: var(--ed-radio); }

.chart-mapa-votantes .minimapas {
  display: flex; gap: 15px; width: 100%;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.chart-mapa-votantes .minimapas::-webkit-scrollbar { display: none; }
.chart-mapa-votantes .minimapa-item { flex: 0 0 calc((100% - 30px) / 3); min-width: 0; scroll-snap-align: start; }

.chart-mapa-votantes .minimapas-nav { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 12px; }
.chart-mapa-votantes .minimapas-flecha {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; cursor: pointer;
  background: #fff; color: var(--ed-negro); border: 1px solid #cecece; border-radius: 50%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: border-color 0.15s, opacity 0.15s;
}
.chart-mapa-votantes .minimapas-flecha:hover:not(:disabled) { border-color: var(--ed-negro); }
.chart-mapa-votantes .minimapas-flecha:disabled { opacity: 0.3; cursor: default; }
.chart-mapa-votantes .minimapas-puntos { display: flex; align-items: center; }

.chart-mapa-votantes .minimapas-punto {
  width: 20px; height: 24px; padding: 0; border: none; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.chart-mapa-votantes .minimapas-punto::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: #cecece; transition: background 0.15s;
}
.chart-mapa-votantes .minimapas-punto.activo::before { background: var(--ed-negro); }
.chart-mapa-votantes .minimapa { position: relative; aspect-ratio: 1; background: #000; overflow: hidden; border: 1px solid #666; }

.chart-mapa-votantes img.mapa { width: 100%; height: 100%; display: block; }

.chart-mapa-votantes.captura { display: flex; flex-wrap: wrap; gap: 15px; }
.chart-mapa-votantes.captura .minimapa-item { flex: none; }
.chart-mapa-votantes .minimapa-anio {
  position: absolute; top: 6px; left: 6px; z-index: 1; padding: 1px 5px;
  background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 13px; font-weight: 700;
}

.chart-mapa-votantes .minimapa-spinner {
  display: none; position: absolute; top: 50%; left: 50%; z-index: 1; margin: -12px 0 0 -12px;
  width: 24px; height: 24px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff; animation: ed-spin 0.8s linear infinite;
}
.chart-mapa-votantes .cargando-celda .minimapa-spinner { display: block; }


@container (max-width: 800px) {
  .chart-mapa-votantes .minimapa-item { flex-basis: calc((100% - 15px) / 2); }
}


.chart-mapa-votantes .capa-pantalla-completa,
.chart-mapa-votantes .cerrar-pantalla-completa { display: none; }
.mapa-votantes-sin-scroll, .mapa-votantes-sin-scroll body { overflow: hidden; }


@container (max-width: 600px) {
  .chart-mapa-votantes .mapa-votantes { height: 600px; }

  .chart-mapa-votantes .capa-pantalla-completa { display: block; position: absolute; inset: 0; z-index: 1; }
  .chart-mapa-votantes .pantalla-completa {
    position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; z-index: 9999;
  }
  .chart-mapa-votantes .pantalla-completa .capa-pantalla-completa { display: none; }
  .chart-mapa-votantes .pantalla-completa .cerrar-pantalla-completa {
    display: flex; position: absolute; z-index: 2;

    top: calc(21px + env(safe-area-inset-top)); right: 10px;
  }

  .chart-mapa-votantes .pantalla-completa .panel-arriba {
    top: calc(10px + env(safe-area-inset-top)); left: 10px; transform: none; width: auto; right: 52px; max-width: none;
  }
  .chart-mapa-votantes .panel { left: 50%; transform: translateX(-50%); width: calc(100% - 20px); max-width: 360px; text-align: center; }

  .chart-mapa-votantes .panel .geocoder { text-align: left; }

  .chart-mapa-votantes .panel-abajo { width: max-content; min-width: 240px; max-width: calc(100% - 20px); }

  .chart-mapa-votantes .panel-abajo .navegacion-eleccion { width: 240px; max-width: 100%; margin: 8px auto 0; }
  .chart-mapa-votantes .panel-abajo .navegacion-eleccion .selector { flex: 1; }
  .chart-mapa-votantes .panel-abajo .navegacion-eleccion button { min-width: 40px; min-height: 36px; }

  .chart-mapa-votantes .navegacion-eleccion button,
  .chart-mapa-votantes .selector { border-width: 1px; }
  .chart-mapa-votantes .panel-arriba .geocoder:last-child { margin-bottom: 0; }

  .chart-mapa-votantes .pantalla-completa .panel-abajo { bottom: calc(30px + env(safe-area-inset-bottom)); }
  .chart-mapa-votantes .leyenda,
  .chart-mapa-votantes .navegacion-eleccion { justify-content: center; }
  .chart-mapa-votantes .minimapa-item { flex-basis: 100%; }
  .chart-mapa-votantes .minimapas-controles .geocoder { max-width: none; flex-basis: 100%; }
  .chart-mapa-votantes .minimapas-ciudades { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .chart-mapa-votantes .minimapas-ciudades::-webkit-scrollbar { display: none; }
}
