:root {
  --papel: #eef1ee;
  --superficie: #ffffff;
  --tinta: #172033;
  --tenue: #586274;
  --linea: #cfd6d1;
  --valle: #17784e;
  --llano: #c98e0c;
  --punta: #b42318;
  --foco: #2b59c3;

  --fuente: 'Archivo', system-ui, sans-serif;
  --medida: 68ch;
  --radio: 6px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --papel: #10161f;
    --superficie: #18202b;
    --tinta: #e6ebe7;
    --tenue: #9aa5b5;
    --linea: #2b3644;
    --valle: #3fb882;
    --llano: #e6b23a;
    --punta: #ef6a5c;
    --foco: #8fb0ff;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--fuente);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 3px solid var(--foco);
  outline-offset: 3px;
  border-radius: 2px;
}

.envoltorio {
  width: min(100% - 32px, 960px);
  margin-inline: auto;
}

/* Cabecera */
.cabecera {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--linea);
}
.marca {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-stretch: 125%;
  font-weight: 800;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.logo { width: 2.1rem; height: 2.1rem; flex: none; }
.logo .b1 { fill: var(--valle); }
.logo .b2 { fill: var(--llano); }
.logo .b3 { fill: var(--punta); }
.logo .bolsillo { fill: var(--tinta); }
.logo .costura { fill: none; stroke: var(--papel); stroke-width: 1.8; stroke-dasharray: 3 2.6; stroke-linejoin: round; opacity: 0.85; }
@media (prefers-reduced-motion: no-preference) {
  .marca:hover .b1, .marca:hover .b2, .marca:hover .b3 { transform: translateY(-3px); }
  .logo rect { transition: transform 200ms cubic-bezier(.2,.7,.2,1); }
  .logo .b2 { transition-delay: 40ms; }
  .logo .b3 { transition-delay: 80ms; }
}
.cabecera { align-items: center; }
.nav { display: flex; gap: 1.25rem; font-size: 0.95rem; }
.nav a { text-decoration: none; color: var(--tenue); }
.nav a[aria-current='page'] { color: var(--tinta); font-weight: 600; text-decoration: underline; text-underline-offset: 6px; }

/* Tipografía */
h1, h2, h3 { line-height: 1.1; margin: 0; }
.titular {
  font-stretch: 118%;
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 3.75rem);
  letter-spacing: -0.03em;
  max-width: 18ch;
  text-wrap: balance;
}
h2 { font-stretch: 112%; font-weight: 700; font-size: 1.5rem; letter-spacing: -0.01em; }
.entradilla { color: var(--tenue); max-width: var(--medida); font-size: 1.15rem; margin: 1rem 0 0; }
.nota { color: var(--tenue); font-size: 0.9rem; max-width: var(--medida); }

main { padding-block: 2.5rem 4rem; }
section + section { margin-top: 3.5rem; }

/* Portada: lista de secciones */
.secciones { list-style: none; padding: 0; margin: 3rem 0 0; border-top: 2px solid var(--tinta); }
.secciones li { border-bottom: 1px solid var(--linea); }
.secciones a, .secciones .pendiente {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.25rem 1.25rem;
  padding: 1.5rem 0;
  text-decoration: none;
}
.secciones .icono { grid-row: 1 / span 2; width: 3rem; height: 3rem; padding: 0.7rem; border-radius: 14px; fill: #fff; }
.icono.luz { background: var(--llano); fill: #1a1405; }
.icono.gasolina { background: var(--punta); }
.icono.hipoteca { background: var(--valle); }
.icono.ipc { background: var(--tinta); fill: var(--papel); }
.secciones h2 { grid-column: 2; }
.secciones a:hover h2 { text-decoration: underline; text-underline-offset: 5px; }
.secciones p { grid-column: 2; margin: 0; color: var(--tenue); max-width: 60ch; }
.secciones .dato {
  grid-column: 2;
  grid-row: 1 / span 2;
  text-align: right;
  font-stretch: 112%;
  font-weight: 700;
  font-size: 1.75rem;
}
.secciones .dato small { display: block; font-size: 0.8rem; font-weight: 400; color: var(--tenue); font-stretch: 100%; }
.secciones .pendiente { opacity: 0.6; }
.secciones .pendiente .dato { font-size: 1rem; font-weight: 500; }

/* Luz: respuesta principal */
.ahora {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin-top: 1.5rem;
  color: var(--tenue);
}
.ahora strong { color: var(--tinta); font-size: 1.25rem; }
.chapa {
  display: inline-block;
  padding: 0.1em 0.55em;
  border-radius: var(--radio);
  font-weight: 600;
  font-size: 0.85em;
  color: #fff;
}
.chapa.barata { background: var(--valle); }
.chapa.media { background: var(--llano); color: #1a1405; }
.chapa.cara { background: var(--punta); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .chapa.barata,
  :root:not([data-theme='light']) .chapa.cara { color: #10161f; }
}

/* Selector de día */
.pestanas { display: inline-flex; border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; margin-top: 1rem; }
.pestanas button {
  font: inherit;
  padding: 0.45rem 1rem;
  border: 0;
  background: transparent;
  color: var(--tenue);
  cursor: pointer;
}
.pestanas button[aria-pressed='true'] { background: var(--tinta); color: var(--papel); font-weight: 600; }
.pestanas button:disabled { cursor: not-allowed; opacity: 0.45; }

/* Gráfico de 24 horas */
.grafico {
  display: grid;
  grid-template-columns: repeat(var(--n, 24), 1fr);
  align-items: end;
  gap: 3px;
  height: clamp(180px, 34vw, 300px);
  margin-top: 1.5rem;
  padding-bottom: 1.75rem;
  position: relative;
}
.barra {
  position: relative;
  height: var(--alto);
  min-height: 4px;
  border-radius: 3px 3px 0 0;
  background: var(--color);
}
.barra.barata { --color: var(--valle); }
.barra.media { --color: var(--llano); }
.barra.cara { --color: var(--punta); }
.barra.pasada { opacity: 0.35; }
.barra.actual { outline: 2px solid var(--tinta); outline-offset: 2px; }
.barra.elegida { box-shadow: inset 0 0 0 3px var(--superficie); }
.barra span {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  color: var(--tenue);
}
.barra:not(:nth-child(3n + 1)) span { visibility: hidden; }
@media (min-width: 720px) {
  .barra:not(:nth-child(3n + 1)) span { visibility: visible; }
  .barra:not(:nth-child(2n + 1)) span { visibility: hidden; }
}
.leyenda { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: 0.9rem; color: var(--tenue); margin-top: 0.5rem; }
.leyenda i { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 2px; margin-right: 0.35em; vertical-align: -0.05em; }

/* Planificador */
.planificador {
  background: var(--superficie);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: clamp(1.25rem, 3vw, 2rem);
}
.duraciones { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 1.25rem; border: 0; padding: 0; }
.duraciones legend { margin-bottom: 0.5rem; color: var(--tenue); }
.duraciones label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--linea);
  border-radius: 999px;
  cursor: pointer;
}
.duraciones label:has(input:checked) { border-color: var(--tinta); background: var(--tinta); color: var(--superficie); }
.duraciones input { accent-color: var(--valle); }
.resultado { font-size: 1.35rem; font-weight: 600; font-stretch: 108%; line-height: 1.3; margin: 0; max-width: 32ch; }
.resultado + p { margin: 0.5rem 0 0; color: var(--tenue); }

/* Tabla */
details { margin-top: 1.5rem; }
summary { cursor: pointer; color: var(--tenue); }
table { border-collapse: collapse; margin-top: 1rem; width: min(100%, 420px); }
th, td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--linea); }
td:last-child, th:last-child { text-align: right; }

.aviso { border-left: 4px solid var(--llano); padding: 0.75rem 1rem; background: var(--superficie); max-width: var(--medida); }

.pie {
  border-top: 1px solid var(--linea);
  padding-block: 1.5rem 2.5rem;
  color: var(--tenue);
  font-size: 0.9rem;
}
.pie p { margin: 0.25rem 0; max-width: var(--medida); }

@media (prefers-reduced-motion: no-preference) {
  .grafico.listo .barra { animation: crecer 600ms cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 18ms); transform-origin: bottom; }
  @keyframes crecer { from { transform: scaleY(0); } }
}

/* Gasolina: buscador y filtros */
.buscador, .filtros {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin-top: 1.75rem;
}
.filtros { gap: 1rem 2rem; margin-top: 1.25rem; }
.filtros .duraciones { margin: 0; }
.o { color: var(--tenue); padding-bottom: 0.6rem; }
.campo { display: grid; gap: 0.3rem; font-size: 0.9rem; color: var(--tenue); }
.campo input, .campo select {
  font: inherit;
  font-size: 1rem;
  color: var(--tinta);
  background: var(--superficie);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: 0.55rem 0.75rem;
  min-width: 9rem;
}
.campo input { width: 8rem; min-width: 0; letter-spacing: 0.08em; }
.boton {
  font: inherit;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radio);
  border: 1px solid var(--tinta);
  background: var(--tinta);
  color: var(--papel);
  cursor: pointer;
}
.boton.secundario { background: transparent; color: var(--tinta); }
.boton:disabled { opacity: 0.45; cursor: not-allowed; }
.aviso { margin-top: 1.25rem; }

/* Gasolina: mapa y lista */
.mapa {
  height: clamp(260px, 45vw, 420px);
  border-radius: var(--radio);
  border: 1px solid var(--linea);
  background: var(--superficie);
  z-index: 0;
}
.estaciones { list-style: none; padding: 0; margin: 1.5rem 0 0; border-top: 2px solid var(--tinta); }
.estacion {
  display: grid;
  grid-template-columns: 6.5rem 1fr auto;
  gap: 0.25rem 1.25rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--linea);
}
.estacion h3 { font-size: 1.05rem; font-weight: 700; }
.estacion p { margin: 0.15rem 0 0; color: var(--tenue); font-size: 0.95rem; }
.estacion .meta { display: flex; flex-wrap: wrap; gap: 0 1rem; font-size: 0.85rem; }
.precio {
  font-stretch: 112%;
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
  border-left: 5px solid var(--color);
  padding-left: 0.6rem;
}
.precio small { display: block; font-size: 0.75rem; font-weight: 400; color: var(--tenue); margin-top: 0.2rem; font-stretch: 100%; }
.precio.barata { --color: var(--valle); }
.precio.media { --color: var(--llano); }
.precio.cara { --color: var(--punta); }
.llegar { font-size: 0.9rem; white-space: nowrap; }
@media (max-width: 560px) {
  .estacion { grid-template-columns: 5.5rem 1fr; }
  .llegar { grid-column: 2; }
}

/* Hipoteca */
.formulario h2 { margin-bottom: 1.25rem; }
.campos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1rem 1.5rem;
}
.campos .campo input, .campos .campo select { width: 100%; min-width: 0; letter-spacing: normal; }
.con-unidad { position: relative; display: block; }
.con-unidad input { padding-right: 3.5rem; font-variant-numeric: tabular-nums; }
.con-unidad b {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 400;
  color: var(--tenue);
  pointer-events: none;
}
.formulario .nota { margin: 1rem 0 0; }
table.escenarios { width: min(100%, 560px); }
.escenarios small { color: var(--tenue); }
.escenarios tr.actual td { font-weight: 700; }
.historia { margin: 1.25rem 0 0; }
.historia svg { width: 100%; height: clamp(200px, 32vw, 300px); display: block; overflow: visible; }
.historia .rejilla { stroke: var(--linea); stroke-width: 1; vector-effect: non-scaling-stroke; }
.historia .cero { stroke: var(--tenue); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.historia .linea { fill: none; stroke: var(--tinta); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.historia .eje { fill: var(--tenue); font-size: 12px; font-family: var(--fuente); }
.historia .punto-ahora { fill: var(--punta); stroke: var(--papel); stroke-width: 2; vector-effect: non-scaling-stroke; }
.historia .punto-revision { fill: var(--superficie); stroke: var(--tinta); stroke-width: 2; vector-effect: non-scaling-stroke; }
.clave { display: inline-block; width: 0.75em; height: 0.75em; border-radius: 50%; margin: 0 0.35em 0 0.75em; vertical-align: -0.05em; }
.clave:first-child { margin-left: 0; }
.ahora-clave { background: var(--punta); }
.revision-clave { background: var(--superficie); border: 2px solid var(--tinta); }

/* Luz: interruptor de impuestos y costes por aparato */
.interruptor { display: inline-flex; align-items: center; gap: 0.6rem; margin-top: 1rem; cursor: pointer; color: var(--tenue); }
.interruptor input {
  appearance: none;
  width: 2.6rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--linea);
  position: relative;
  cursor: pointer;
  flex: none;
  transition: background 150ms;
}
.interruptor input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(1.5rem - 6px);
  height: calc(1.5rem - 6px);
  border-radius: 50%;
  background: var(--superficie);
  transition: transform 150ms;
}
.interruptor input:checked { background: var(--valle); }
.interruptor input:checked::after { transform: translateX(1.1rem); }
@media (prefers-reduced-motion: reduce) { .interruptor input, .interruptor input::after { transition: none; } }
table.costes { width: min(100%, 640px); }
.costes th[scope='row'] { font-weight: 600; }
.costes small { display: block; font-weight: 400; color: var(--tenue); font-size: 0.82rem; }
.costes td:nth-child(3) { font-weight: 700; }
.filtros .interruptor { margin-top: 0; padding-bottom: 0.45rem; }
.estado { font-weight: 600; }
.estado.abierta { color: var(--valle); }
.estado.cerrada { color: var(--punta); }

/* Portada: titular y recibo del día */
.portada {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 2.5rem 3.5rem;
  align-items: center;
}
@media (max-width: 760px) { .portada { grid-template-columns: 1fr; } }
.recibo {
  --borde: 10px;
  margin: 0;
  background: var(--superficie);
  color: var(--tinta);
  padding: 1.5rem 1.5rem calc(1.25rem + var(--borde));
  font-stretch: 80%;
  box-shadow: 0 1px 0 var(--linea), 0 18px 40px -24px rgb(23 32 51 / 0.45);
  transform: rotate(-1.5deg);
  max-width: 400px;
  justify-self: center;
  width: 100%;
  /* borde inferior dentado, como un tique */
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--borde)) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--borde)) 100%;
}
.recibo figcaption { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding-bottom: 0.9rem; border-bottom: 2px dashed var(--linea); }
.recibo figcaption strong { font-size: 1.15rem; font-weight: 800; }
.recibo figcaption span { color: var(--tenue); font-size: 0.9rem; }
.recibo dl { margin: 0.6rem 0 0; }
.recibo dl div { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.45rem 0; }
.recibo dt { color: var(--tenue); white-space: nowrap; }
.recibo dl div::after { content: none; }
.recibo dt::after { content: ''; }
.recibo dd { margin: 0 0 0 auto; font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.recibo dl div { background: linear-gradient(to right, var(--linea) 50%, transparent 0) 0 calc(100% - 0.7rem) / 6px 1px repeat-x; }
.recibo dt, .recibo dd { background: var(--superficie); position: relative; }
.recibo dt { padding-right: 0.4rem; }
.recibo dd { padding-left: 0.4rem; }
.recibo-pie { margin: 0.9rem 0 0; padding-top: 0.9rem; border-top: 2px dashed var(--linea); text-align: center; color: var(--tenue); font-size: 0.85rem; }
@media (prefers-reduced-motion: no-preference) {
  .recibo { animation: imprimir 700ms cubic-bezier(.2,.7,.2,1) both; }
  @keyframes imprimir { from { transform: rotate(-1.5deg) translateY(-14px); opacity: 0; } }
}

/* Página de texto (fuentes) */
.texto section { max-width: var(--medida); }
.texto section + section { margin-top: 2.25rem; }
.texto h2 { margin-bottom: 0.5rem; }
.texto p { margin: 0.6rem 0 0; }

/* Luz: por qué está cara o barata */
.subtitulo { font-size: 1.1rem; font-weight: 700; margin: 2rem 0 0; }
.mezcla { display: flex; height: 2.25rem; border-radius: var(--radio); overflow: hidden; margin-top: 1.25rem; gap: 2px; }
.mezcla .seg { display: block; flex-grow: 0; flex-shrink: 0; }
.seg.solar { background: #e2b33a; }
.seg.eolica { background: #2f9e8f; }
.seg.hidraulica { background: #3d74c4; }
.seg.otrasRenovables { background: #8bbf5b; }
.seg.nuclear { background: #8c6bbf; }
.seg.gas { background: #c45c3c; }
.seg.otras { background: #8a8f98; }
.mezcla-leyenda { list-style: none; padding: 0; margin: 0.75rem 0 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; color: var(--tenue); font-size: 0.92rem; }
.mezcla-leyenda strong { color: var(--tinta); }
.mezcla-leyenda i { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 2px; margin-right: 0.4em; vertical-align: -0.05em; }
.efecto { margin-top: 1.75rem; }
.efecto-titulo { margin: 0; color: var(--tenue); }
.efecto-pareja { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin-top: 0.75rem; }
.efecto-dato { background: var(--superficie); border: 1px solid var(--linea); border-left: 6px solid var(--c); border-radius: var(--radio); padding: 1rem 1.25rem; color: var(--tenue); }
.efecto-dato.verde { --c: var(--valle); }
.efecto-dato.rojo { --c: var(--punta); }
.efecto-precio { display: block; font-stretch: 112%; font-weight: 800; font-size: 1.75rem; color: var(--tinta); line-height: 1.15; }
.grafico.dias { height: clamp(150px, 26vw, 220px); }
.grafico.dias .barra span { white-space: nowrap; }
.grafico.dias .barra:not(:nth-child(3n + 1)) span,
.grafico.dias .barra span { visibility: visible; }

/* Gasolina: tendencia */
.tendencia { background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); padding: clamp(1.25rem, 3vw, 2rem); }
.tendencia .resultado { margin-top: 0.75rem; max-width: 46ch; }
.tendencia .resultado + p { margin: 0.5rem 0 0; color: var(--tenue); }
.chispa { width: 100%; height: 90px; margin-top: 1rem; display: block; }
.chispa .linea { fill: none; stroke: var(--tinta); stroke-width: 2; stroke-linejoin: round; }
.chispa .punto { fill: var(--punta); stroke: var(--superficie); stroke-width: 2; }

/* Hipoteca: amortización anticipada */
.campo-amortizar { max-width: 16rem; margin-top: 1rem; }
.opciones-amortizar { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.opcion { background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); padding: 1.25rem; }
.opcion.recomendada { border: 2px solid var(--valle); }
.opcion h3 { font-size: 1rem; color: var(--tenue); font-weight: 600; }
.opcion-dato { font-stretch: 112%; font-weight: 800; font-size: 1.6rem; margin: 0.35rem 0 0; line-height: 1.15; }
.opcion p:last-child { color: var(--tenue); margin: 0.5rem 0 0; }
.historia .tramo { fill: var(--llano); opacity: 0.14; }
.cabecera { flex-wrap: wrap; row-gap: 0.75rem; }
@media (max-width: 480px) { .nav { gap: 0.9rem; font-size: 0.9rem; } }
.formulario .resultado { margin-top: 1.25rem; }
.pendiente-dato { display: inline-block; min-width: 3.2ch; color: var(--tenue); }
.formulario .resultado { min-height: 2.6em; }
.formulario .resultado + p { min-height: 3em; }

/* Huecos reservados mientras llegan los datos: así la página no salta al cargar */
.reservado { visibility: hidden; }
main { min-height: calc(100vh - 5rem); min-height: calc(100svh - 5rem); }

/* Apoyo en GitHub Sponsors */
.pie .apoyo { margin: 0 0 0.9rem; }
.apoyo a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--linea);
  border-radius: 999px;
  background: var(--superficie);
  color: var(--tinta);
  font-weight: 600;
  text-decoration: none;
}
.apoyo a:hover { border-color: var(--punta); }
.apoyo svg { width: 1rem; height: 1rem; fill: #bf3989; flex: none; }

/* Selector de idioma */
.idiomas {
  display: inline-flex;
  border: 1px solid var(--linea);
  border-radius: 999px;
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.idiomas > * { padding: 0.2rem 0.6rem; text-decoration: none; line-height: 1.4; }
.idiomas [aria-current] { background: var(--tinta); color: var(--papel); }
.idiomas a { color: var(--tenue); }
.idiomas a:hover { color: var(--tinta); }
.cabecera { gap: 0.75rem 1.25rem; }
.cabecera .nav { margin-left: auto; }
@media (max-width: 640px) {
  /* En el móvil: logo y selector de idioma arriba, secciones debajo */
  .marca { margin-right: auto; }
  .idiomas { order: 2; }
  .cabecera .nav { order: 3; flex-basis: 100%; margin-left: 0; justify-content: space-between; }
}

/* Iconos de sección en el menú */
.nav a { display: inline-flex; align-items: center; gap: 0.4rem; }
.icono-nav { width: 1.25rem; height: 1.25rem; flex: none; padding: 0.22rem; border-radius: 6px; fill: #fff; }
.icono-nav.luz { background: var(--llano); fill: #1a1405; }
.icono-nav.gasolina { background: var(--punta); }
.icono-nav.hipoteca { background: var(--valle); }
.icono-nav.ipc { background: var(--tinta); fill: var(--papel); }
@media (max-width: 640px) {
  /* En el móvil, el icono encima del nombre para que quepan las cuatro secciones */
  .nav a { flex-direction: column; gap: 0.2rem; font-size: 0.8rem; }
  .icono-nav { width: 1.6rem; height: 1.6rem; padding: 0.3rem; border-radius: 8px; }
}
