/* Capa visual del atlas: mapa, cifras y ranking. */
.atlas-app .dashboard { gap: .8rem; padding: .8rem; }
.atlas-app .mapa-panel {
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto;
  padding: .85rem .95rem .55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    radial-gradient(circle at 12% 0, rgba(18, 60, 105, .05), transparent 30%),
    var(--surface);
  box-shadow: 0 12px 34px rgba(18, 38, 63, .08);
}
.atlas-app .mapa-panel__cabecera h1 {
  font-size: clamp(1.8rem, 2.2vw, 2.35rem);
  letter-spacing: -.055em;
  line-height: .92;
}
.atlas-app .mapa-ayuda { max-width: 64ch; font-size: .72rem; line-height: 1.45; }
.atlas-app .eyebrow { color: var(--accent); font-weight: 700; }
.atlas-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; margin: .15rem 0 .05rem; }
.atlas-kpi {
  min-width: 0; position: relative; padding: .5rem .58rem .45rem;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 5px; background: linear-gradient(180deg, var(--surface), var(--surface-3));
  overflow: hidden;
}
.atlas-kpi::after {
  content: ""; position: absolute; width: 42px; height: 42px; right: -18px; top: -18px;
  border: 1px solid currentColor; border-radius: 50%; opacity: .12;
}
.atlas-kpi span { display: block; font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); opacity: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atlas-kpi strong { display: block; margin: .1rem 0 .05rem; font-family: var(--display, Georgia, serif); font-size: clamp(.96rem, 1.25vw, 1.16rem); font-weight: 600; line-height: 1.05; letter-spacing: -.03em; white-space: normal; overflow: visible; }
.atlas-kpi small { display: block; font-family: var(--mono); font-size: .7rem; color: var(--muted); opacity: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atlas-kpi--brecha { border-left-color: var(--no); }
.atlas-kpi--alta { border-left-color: var(--green); }
.atlas-kpi--baja { border-left-color: var(--gold); }
.atlas-kpi--brecha strong { color: var(--no); }
.atlas-kpi--alta strong { color: var(--green); }
.atlas-kpi--baja strong { color: var(--gold); }
.atlas-app .mapa-svg-caja {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: radial-gradient(ellipse at 52% 46%, #ffffff 0, #f6faf7 58%, #edf4f0 100%);
  overflow: hidden;
}
.atlas-app .region {
  transition: fill .38s ease, filter .18s ease, stroke-width .18s ease;
  vector-effect: non-scaling-stroke;
}
.atlas-app .region:hover { filter: brightness(1.05) saturate(1.14) drop-shadow(0 3px 4px rgba(18,38,63,.16)); }
.atlas-app .region.is-activa { stroke: var(--ink); stroke-width: 3; filter: drop-shadow(0 4px 7px rgba(18,38,63,.24)); }
.atlas-app .mapa-tooltip {
  min-width: 150px; padding: .45rem .6rem;
  border: 0; border-radius: 6px;
  background: var(--ink); color: #fff;
  box-shadow: 0 8px 20px rgba(18,38,63,.22);
}
.atlas-app .mapa-tooltip b { color: #fff; font-size: .72rem; }
.atlas-app .mapa-tooltip span { color: #dce8f4; font-family: var(--mono); font-size: .68rem; }
.atlas-app .mapa-pie { gap: .8rem; }
.atlas-app .leyenda { font-size: .65rem; }
.atlas-app .panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 34px rgba(18, 38, 63, .07);
  overflow: hidden;
}
.atlas-app .panel-nav { border-bottom: 1px solid var(--line); background: var(--surface); }
.atlas-app .pestana { border-color: var(--line); }
.atlas-app .pestana.is-activo { background: var(--accent); color: #fff; }
.atlas-app .pestana.is-activo small { color: #dbe8f6; }
.atlas-app .panel__cuerpo { padding: .8rem; }
.atlas-app .espana-kpi strong { font-size: 2.6rem; color: var(--accent); }
.atlas-app .tendencia__linea { stroke: var(--accent); }
.atlas-app .tendencia__area { fill: rgba(18, 60, 105, .10); }
.atlas-app .gob-banda { border-radius: 4px; overflow: hidden; }
.atlas-app .play { background: var(--accent); color: #fff; border-color: var(--accent); }
.atlas-app .gobierno.is-activo { outline: 2px solid var(--accent); outline-offset: -2px; }
.atlas-rank { margin-top: .7rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.atlas-rank__cab { display: flex; justify-content: space-between; align-items: baseline; gap: .4rem; }
.atlas-rank__cab span { font-family: var(--mono); font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.atlas-rank__cab small { color: var(--faint); font-family: var(--mono); font-size: .7rem; }
.atlas-rank ol { list-style: none; margin: .35rem 0 0; padding: 0; display: grid; gap: .08rem; }
.atlas-rank button {
  display: grid; grid-template-columns: 1.1rem minmax(0, 1fr) auto;
  grid-template-areas: "pos nombre valor" "pos pista pista";
  grid-template-rows: auto 3px; gap: .05rem .35rem;
  width: 100%; padding: .25rem .25rem .28rem;
  border: 0; border-radius: 3px; background: transparent;
  color: var(--ink); text-align: left; cursor: pointer;
}
.atlas-rank button:hover, .atlas-rank button:focus-visible { background: var(--accent-soft); }
.atlas-rank button.is-activo { background: var(--accent-soft); box-shadow: inset 2px 0 var(--accent); }
.atlas-rank__pos { grid-area: pos; color: var(--faint); font-family: var(--mono); font-size: .7rem; line-height: 1.2; }
.atlas-rank__nombre { grid-area: nombre; font-size: .7rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atlas-rank b { grid-area: valor; align-self: center; font-family: var(--mono); font-size: .7rem; white-space: nowrap; }
.atlas-rank__pista { grid-area: pista; display: block; height: 3px; background: var(--surface-2); overflow: hidden; }
.atlas-rank__pista i { display: block; width: var(--w); height: 100%; background: var(--accent); }
.atlas-rank button:nth-child(-n+3) .atlas-rank__pista i { background: var(--green); }
.atlas-rank button:nth-last-child(-n+3) .atlas-rank__pista i { background: var(--gold); }
.atlas-rank[hidden], .atlas-kpis[hidden] { display: none !important; }
@media (max-width: 1100px) {
  .atlas-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .atlas-app .mapa-panel { grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto; }
}
@media (max-width: 900px) {
  .atlas-app .mapa-panel { min-height: 0; }
  .atlas-app .mapa-panel__cabecera h1 { font-size: clamp(1.8rem, 7vw, 2.4rem); }
  .atlas-rank ol { max-height: 24rem; overflow: auto; padding-right: .2rem; }
}
@media (max-width: 620px) {
  .atlas-app .dashboard { padding: .45rem; }
  .atlas-app .mapa-panel { padding: .55rem; border-radius: 7px; }
  .atlas-kpi { padding: .42rem .48rem; }
  .atlas-kpi strong { font-size: 1.12rem; }
  .atlas-kpi span, .atlas-kpi small { font-size: .7rem; }
}

@media (max-width: 620px) { .atlas-app .mapa-etiqueta { display: none; } .atlas-app .atlas-kpi strong { font-size: 1rem; } }
.atlas-app .pestana:nth-child(5) { grid-column: 1 / -1; border-top: 1px solid var(--line); }

@media (min-width: 901px) {
  .atlas-app { height: calc(100dvh - 135px); max-height: calc(100dvh - 135px); min-height: 620px; overflow: hidden; }
  .atlas-app .dashboard { min-height: 0; }
  .atlas-app .mapa-panel { min-height: 0; overflow: hidden; }
  .atlas-app .mapa-svg-caja { min-height: 0; }
}
.atlas-rank__vacio { margin: 0; padding: .6rem .2rem; color: var(--muted); font-size: .7rem; line-height: 1.45; }

.atlas-ayuda { margin: .2rem 0 .5rem; }
.atlas-ayuda summary { cursor: pointer; color: var(--muted); font-family: var(--mono); font-size: .7rem; font-weight: 700; letter-spacing: .04em; }
.atlas-ayuda[open] summary { margin-bottom: .25rem; }
.atlas-ayuda .mapa-ayuda { margin: .25rem 0 0; }

@media (min-width: 901px) {
  .pagina--atlas .pie { display: none; }
  .pagina--atlas .progreso { display: none; }
}
