/* Primero movil. Contraste AA. Sin fuentes externas.
   En el movil la navegacion va abajo, como en una app; desde 56rem va arriba
   y la busqueda se parte en dos columnas (filtros a la izquierda, lista a la derecha). */
:root {
  --ancho: 72rem;                  /* ancho maximo del contenido ancho; crece en pantallas grandes */
  --fondo: #f3f6f9; --superficie: #ffffff; --texto: #14212b; --suave: #4d5b68; --linea: #dbe3ea;
  --primario: #0b4f6c; --primario-2: #087e8b; --sobre-primario: #ffffff;
  --acento: #0a5f80; --acento-fondo: #e3f1f6; --arena: #f4a259; --arena-fondo: #fdf0e3;
  --aviso: #fff4d6; --aviso-borde: #8a6100;
  --barra: #087e8b; --barra-fondo: #dfe8ee; --foco: #b35900;
  --fallo: #a4000f; --fallo-fondo: #fde7e9;
  --t-medio: #e0f2ef; --t-medio-txt: #135e55; --t-superior: #e6eefb; --t-superior-txt: #1d4a8f;
  --t-espec: #f3e9fb; --t-espec-txt: #5f2c86; --t-grado: #fdeede; --t-grado-txt: #8a4a0c;
  --sombra: 0 1px 2px rgba(16, 38, 56, .06), 0 4px 14px rgba(16, 38, 56, .07);
  --radio: 14px; --alto-pestanas: 4.25rem;
}
@media (prefers-color-scheme: dark) {
  :root { --fondo: #0e1419; --superficie: #172029; --texto: #e8eef3; --suave: #a9b7c3; --linea: #2b3844;
    --primario: #10394d; --primario-2: #0d5a64; --sobre-primario: #eaf6fa;
    --acento: #7fd0e6; --acento-fondo: #183442; --arena: #f4a259; --arena-fondo: #3a2a1a;
    --aviso: #2e2614; --aviso-borde: #e0b450;
    --barra: #4fc0cf; --barra-fondo: #2a3743; --foco: #ffb066;
    --fallo: #ff8a95; --fallo-fondo: #3a1a1e;
    --t-medio: #173a36; --t-medio-txt: #8fe0d3; --t-superior: #1b2d48; --t-superior-txt: #a9c6f5;
    --t-espec: #2f2240; --t-espec-txt: #d6b5f2; --t-grado: #3b2a17; --t-grado-txt: #f5c48f;
    --sombra: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fondo); color: var(--texto);
  font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(var(--alto-pestanas) + env(safe-area-inset-bottom)); }
a { color: var(--acento); }
a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--foco); outline-offset: 2px; }
.saltar { position: absolute; left: -999px; }
.saltar:focus { left: 1rem; top: 1rem; background: var(--superficie); padding: .5rem; z-index: 30; }
.visualmente-oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Barra superior y pestanas */
.barra-app { position: sticky; top: 0; z-index: 20; color: var(--sobre-primario);
  background: linear-gradient(120deg, var(--primario), var(--primario-2));
  padding-top: env(safe-area-inset-top); box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.barra-dentro { max-width: var(--ancho); margin: 0 auto; padding: .55rem 1rem; display: flex; align-items: center; gap: 1rem; }
.marca { display: flex; align-items: center; gap: .55rem; color: inherit; text-decoration: none;
  font-weight: 750; font-size: 1.15rem; letter-spacing: -.01em; margin-right: auto; }
.marca img { border-radius: 8px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
.barra-app a:focus-visible { outline-color: var(--arena); }
.boton-instalar { display: inline-flex; align-items: center; gap: .35rem; color: var(--primario);
  background: var(--sobre-primario); border-radius: 999px; padding: .4rem .8rem; font-weight: 650;
  font-size: .9rem; text-decoration: none; white-space: nowrap; }
.boton-instalar svg { width: 1.1rem; height: 1.1rem; }
.en-app .boton-instalar { display: none; }
.pestanas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--superficie);
  border-top: 1px solid var(--linea); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 12px rgba(0, 0, 0, .06); }
.pestanas ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.pestanas a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
  min-height: var(--alto-pestanas); padding: .35rem .2rem; color: var(--suave); text-decoration: none;
  font-size: .72rem; font-weight: 600; text-align: center; line-height: 1.15; }
.pestanas svg { width: 1.45rem; height: 1.45rem; }
.pestanas a[aria-current] { color: var(--acento); }
.pestanas a[aria-current] svg { background: var(--acento-fondo); border-radius: 999px; padding: .15rem .9rem; width: 3.2rem; box-sizing: content-box; height: 1.45rem; margin: 0 -.9rem; }

/* Pagina */
main { max-width: 52rem; margin: 0 auto; padding: 0 1rem; }
main.pagina-ancha { max-width: var(--ancho); }
h1 { font-size: 1.55rem; line-height: 1.2; margin: 1.25rem 0 .5rem; letter-spacing: -.015em; }
h2 { font-size: 1.2rem; margin: 1.75rem 0 .6rem; letter-spacing: -.01em; }
h3 { font-size: 1.05rem; margin: 1.25rem 0 .25rem; }
.entradilla { color: var(--suave); font-size: 1.05rem; margin-top: 0; }
.ayuda, .fuente, .nota { color: var(--suave); font-size: .9rem; }
.fuente { display: block; }
.miga { font-size: .9rem; margin-top: 1rem; }
.miga a { text-decoration: none; font-weight: 600; }
.aviso { background: var(--aviso); border-left: 4px solid var(--aviso-borde); padding: .65rem .85rem;
  margin: 1rem 0; border-radius: 0 10px 10px 0; font-size: .95rem; }
.panel { background: var(--superficie); border-radius: var(--radio); box-shadow: var(--sombra); padding: 1.1rem; }
.portada { padding: .25rem 0 .5rem; }

/* Buscador */
.filtros { margin-bottom: 1rem; }
.campo { margin: 0 0 1.25rem; border: 0; padding: 0; min-width: 0; }
.campo:last-child { margin-bottom: 0; }
.campo > label, legend { display: flex; align-items: center; gap: .5rem; font-weight: 650; margin-bottom: .5rem; padding: 0; }
.num { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; flex: none; border-radius: 999px;
  background: var(--primario-2); color: #fff; font-size: .85rem; font-weight: 700; }
.caja-busqueda { position: relative; }
.caja-busqueda svg { position: absolute; left: .75rem; top: 50%; width: 1.25rem; height: 1.25rem; transform: translateY(-50%); color: var(--suave); pointer-events: none; }
.caja-busqueda #municipio { padding-left: 2.6rem; }
.sugerencias { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .25rem; list-style: none;
  max-height: 16rem; overflow-y: auto; background: var(--superficie); border: 1.5px solid var(--primario-2);
  border-radius: 10px; box-shadow: var(--sombra); }
.sugerencias li { padding: .55rem .7rem; border-radius: 7px; cursor: pointer; }
.sugerencias li[aria-selected=true], .sugerencias li:hover { background: var(--acento-fondo); color: var(--acento); }
.sugerencias mark { background: none; color: inherit; font-weight: 700; }
#municipio, #q, select, input[type=number] { width: 100%; font: inherit; padding: .7rem .8rem; min-height: 2.9rem;
  border: 1.5px solid var(--linea); border-radius: 10px; background: var(--fondo); color: var(--texto); }
#municipio:focus, #q:focus, select:focus, input[type=number]:focus { border-color: var(--primario-2); }
input[type=number] { width: 5.2rem; text-align: center; }
.opciones-tarjeta { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
.opcion-tarjeta { position: relative; }
.opcion-tarjeta input, .chip-opcion input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opcion-tarjeta label { display: flex; flex-direction: column; gap: .1rem; height: 100%; padding: .6rem .55rem;
  border: 1.5px solid var(--linea); border-radius: 12px; cursor: pointer; background: var(--fondo); }
.opcion-tarjeta strong { font-size: .95rem; }
.opcion-tarjeta span { font-size: .78rem; color: var(--suave); line-height: 1.25; }
.opcion-tarjeta input:checked + label { border-color: var(--primario-2); background: var(--acento-fondo);
  box-shadow: inset 0 0 0 1px var(--primario-2); }
.opcion-tarjeta input:focus-visible + label, .chip-opcion input:focus-visible + label,
.interruptor input:focus-visible + label::before { outline: 3px solid var(--foco); outline-offset: 2px; }
.km-fila { display: flex; align-items: center; gap: .6rem; margin-top: .75rem; }
.km-fila[hidden] { display: none; }
.km-fila label { font-size: .9rem; color: var(--suave); white-space: nowrap; }
.km-fila input[type=range] { flex: 1; min-width: 0; accent-color: var(--primario-2); height: 2rem; }
.interruptor { position: relative; display: flex; align-items: center; min-height: 2.75rem; margin-top: .5rem; }
.interruptor input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.interruptor label { display: flex; align-items: center; gap: .65rem; cursor: pointer; font-size: .95rem; }
.interruptor label::before { content: ""; flex: none; width: 2.6rem; height: 1.5rem; border-radius: 999px;
  background: var(--barra-fondo); box-shadow: inset 0 0 0 1.5px var(--linea);
  background-image: radial-gradient(circle at .75rem 50%, #fff .55rem, transparent .6rem); transition: background-color .15s; }
.interruptor input:checked + label::before { background-color: var(--primario-2);
  background-image: radial-gradient(circle at 1.85rem 50%, #fff .55rem, transparent .6rem); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip-opcion { position: relative; }
.chip-opcion label { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.5rem; padding: .35rem .85rem;
  border-radius: 999px; border: 1.5px solid var(--linea); cursor: pointer; font-size: .88rem; font-weight: 600;
  color: var(--suave); background: var(--fondo); }
.chip-opcion label::before { content: ""; width: .55rem; height: .55rem; border-radius: 999px; border: 1.5px solid currentColor; }
.chip-opcion input:checked + label { border-color: transparent; }
.chip-opcion input:checked + label::before { background: currentColor; }
.tipo-fp_medio, .chip-opcion input:checked + .tipo-fp_medio { background: var(--t-medio); color: var(--t-medio-txt); }
.tipo-fp_superior, .chip-opcion input:checked + .tipo-fp_superior { background: var(--t-superior); color: var(--t-superior-txt); }
.tipo-fp_especializacion, .chip-opcion input:checked + .tipo-fp_especializacion { background: var(--t-espec); color: var(--t-espec-txt); }
.tipo-grado, .chip-opcion input:checked + .tipo-grado { background: var(--t-grado); color: var(--t-grado-txt); }
.chip-opcion input:not(:checked) + label { background: var(--fondo); color: var(--suave); }

/* Resultado */
.vacio { text-align: center; padding: 2rem 1rem; color: var(--suave); }
.vacio[hidden] { display: none; }
.vacio svg { width: 8rem; height: 6rem; fill: var(--primario-2); stroke: none; opacity: .85; }
.vacio svg .claro { fill: var(--barra-fondo); }
.vacio svg .sol { fill: var(--arena); }
.vacio p { margin: .3rem 0; }
#resultado h2 { margin-top: .5rem; }
.resumen { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-wrap: wrap; gap: .45rem; }
.resumen li { background: var(--superficie); box-shadow: var(--sombra); border-radius: 999px; padding: .3rem .8rem; font-size: .88rem; color: var(--suave); }
.resumen b { color: var(--texto); font-size: 1rem; }
.lista { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.tarjeta, .estudio { position: relative; display: grid; grid-template-columns: auto 1fr; gap: .8rem;
  background: var(--superficie); border-radius: var(--radio); box-shadow: var(--sombra); padding: .95rem;
  transition: transform .12s, box-shadow .12s; }
.tarjeta:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(16, 38, 56, .08), 0 10px 24px rgba(16, 38, 56, .1); }
.lista-aparte .tarjeta { grid-template-columns: 1fr; }
.tarjeta-cuerpo { min-width: 0; }
.pos { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px;
  background: linear-gradient(135deg, var(--primario), var(--primario-2)); color: #fff; font-weight: 750; font-size: 1.05rem; }
.tarjeta-cab { display: flex; align-items: flex-start; gap: .6rem; }
.nombre { font-weight: 680; color: var(--texto); text-decoration: none; line-height: 1.3; margin-right: auto; }
.nombre::after { content: ""; position: absolute; inset: 0; border-radius: var(--radio); }
.nombre:hover { color: var(--acento); }
.nombre:focus-visible { outline: none; }
.nombre:focus-visible::after { outline: 3px solid var(--foco); outline-offset: 2px; }
.nota-total { flex: none; font-weight: 750; font-size: .95rem; color: var(--primario-2); background: var(--acento-fondo);
  border-radius: 8px; padding: .1rem .45rem; }
.etiquetas { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin: .4rem 0 .2rem; }
.chip { display: inline-block; border-radius: 999px; padding: .1rem .6rem; font-size: .76rem; font-weight: 650; }
.familia, .tipo { color: var(--suave); font-size: .82rem; }
.medidores { display: grid; gap: .25rem; margin: .55rem 0 .25rem; }
.medidor { display: grid; grid-template-columns: 5.6rem 1fr 4.6rem; align-items: center; gap: .5rem; font-size: .8rem; }
.medidor-nombre { color: var(--suave); }
.medidor-valor { color: var(--suave); text-align: right; font-variant-numeric: tabular-nums; }
.barra { display: block; height: .45rem; background: var(--barra-fondo); border-radius: 999px; overflow: hidden; }
.barra > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primario-2), var(--barra)); border-radius: 999px; }
.centro { display: flex; align-items: flex-start; gap: .3rem; font-size: .85rem; color: var(--suave); margin: .4rem 0 0; }
.centro::before { content: ""; flex: none; width: .9rem; height: .9rem; margin-top: .2rem; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); background: var(--arena); }
.motivo { font-size: .88rem; margin: .4rem 0 0; color: var(--suave); }
.tarjeta .aviso { position: relative; z-index: 1; margin: .5rem 0 0; font-size: .85rem; }
.contador { font-weight: 600; }
.desplegable { background: var(--superficie); border-radius: var(--radio); box-shadow: var(--sombra); margin-top: 1rem; }
.desplegable summary { display: flex; align-items: center; gap: .5rem; padding: .9rem 1rem; cursor: pointer; font-weight: 650; list-style: none; }
.desplegable summary::-webkit-details-marker { display: none; }
.desplegable summary::after { content: ""; width: .55rem; height: .55rem; border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-left: .25rem; transition: transform .15s; }
.desplegable[open] summary::after { transform: rotate(-135deg); }
.desplegable summary span { margin-right: auto; }
.cuenta { background: var(--barra-fondo); border-radius: 999px; padding: 0 .55rem; font-size: .85rem; }
.desplegable > :not(summary) { margin-left: 1rem; margin-right: 1rem; }
.desplegable > ul { padding-bottom: 1rem; }
.desplegable .tarjeta { box-shadow: none; border: 1px solid var(--linea); }

/* Ficha de estudio */
.cabecera-ficha { background: linear-gradient(120deg, var(--primario), var(--primario-2)); color: #fff;
  border-radius: var(--radio); padding: 1.1rem; margin: 1rem 0; box-shadow: var(--sombra); }
.cabecera-ficha h1 { margin: .1rem 0 .4rem; }
.cabecera-ficha .entradilla { color: rgba(255, 255, 255, .88); margin: 0; font-size: .95rem; }
.cabecera-ficha a { color: #fff; }
.cifras { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin: 1rem 0; }
.cifra { background: var(--superficie); border-radius: var(--radio); box-shadow: var(--sombra); padding: .8rem .9rem; }
.cifra-dest { grid-column: 1 / -1; display: flex; align-items: center; gap: .9rem; }
.cifra:last-child { grid-column: 1 / -1; }
.cifra-dest .pos { width: 3.4rem; height: 3.4rem; font-size: 1.35rem; border-radius: 16px; }
.cifra-titulo { font-size: .8rem; color: var(--suave); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.cifra-valor { font-size: 1.5rem; font-weight: 750; line-height: 1.2; }
.cifra-valor small { font-size: .9rem; font-weight: 600; color: var(--suave); }
.cifra .barra { margin-top: .45rem; }
.cifra p { margin: .2rem 0 0; font-size: .82rem; color: var(--suave); }
.seccion { background: var(--superficie); border-radius: var(--radio); box-shadow: var(--sombra); padding: .2rem 1.1rem 1rem; margin: 1rem 0; }
.seccion > h2 { margin-top: 1rem; }
.puesto { font-weight: 650; font-size: 1.05rem; }
.piezas { padding-left: 1.1rem; }
.piezas li { margin-bottom: .4rem; }
.datos dt { font-weight: 650; margin-top: .75rem; }
.datos dd { margin: .15rem 0 0; }
.tabla-envoltura { overflow-x: auto; margin: .5rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
caption { text-align: left; color: var(--suave); padding-bottom: .25rem; }
th, td { text-align: left; padding: .5rem .55rem; border-bottom: 1px solid var(--linea); vertical-align: top; }
thead th { border-bottom: 2px solid var(--suave); font-size: .82rem; color: var(--suave); }
td.dist { font-weight: 650; white-space: nowrap; }
@media (max-width: 40rem) {
  table.apilada, .apilada tbody, .apilada tr, .apilada th, .apilada td { display: block; }
  .apilada thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .apilada tr { border: 1px solid var(--linea); border-radius: 12px; padding: .55rem .75rem; margin-bottom: .55rem; }
  .apilada th, .apilada td { border: 0; padding: .1rem 0; }
  .apilada tbody th { font-size: .95rem; margin-bottom: .2rem; }
  .apilada td[data-etiqueta]::before { content: attr(data-etiqueta) ": "; color: var(--suave); }
  .apilada td:empty { display: none; }
}

/* Ocupaciones */
.islas ul { list-style: none; padding: .2rem 0 .4rem; margin: .5rem 0; display: flex; gap: .45rem; overflow-x: auto; scrollbar-width: thin; }
.islas a { display: inline-block; white-space: nowrap; padding: .45rem .9rem; border-radius: 999px; text-decoration: none;
  background: var(--superficie); box-shadow: var(--sombra); color: var(--texto); font-weight: 600; font-size: .9rem; }
.islas a[aria-current] { background: var(--primario-2); color: #fff; }
.grupo { background: var(--superficie); border-radius: var(--radio); box-shadow: var(--sombra); padding: .2rem 1rem .8rem; margin: .7rem 0; }
.cinco { padding-left: 1.2rem; }
.cinco li { margin-bottom: .35rem; }

/* Instalar */
.pasos-instalar { display: grid; gap: .8rem; }
.pasos-instalar .seccion { margin: 0; }
.pasos-instalar ol { padding-left: 1.2rem; margin: .3rem 0 0; }
.boton { display: inline-flex; align-items: center; gap: .45rem; font: inherit; font-weight: 650; cursor: pointer;
  border: 0; border-radius: 999px; padding: .75rem 1.3rem; background: var(--primario-2); color: #fff; text-decoration: none; }
.boton svg { width: 1.2rem; height: 1.2rem; }
.boton[hidden] { display: none; }
.instalada { color: var(--t-medio-txt); background: var(--t-medio); border-radius: 10px; padding: .6rem .8rem; }

.pie { max-width: var(--ancho); margin: 3rem auto 0; padding: 1rem 1rem 2rem; border-top: 1px solid var(--linea);
  color: var(--suave); font-size: .88rem; }
.fallo { background: var(--fallo-fondo); }
.texto-fallo { color: var(--fallo); }
.aviso-fallo { background: var(--fallo-fondo); border-left-color: var(--fallo); }

@media (max-width: 23rem) {
  .opciones-tarjeta { grid-template-columns: 1fr; }
  .medidor { grid-template-columns: 4.8rem 1fr 4.2rem; }
}
@media (min-width: 40rem) {
  .cifras { grid-template-columns: repeat(4, 1fr); }
  .cifra:last-child { grid-column: auto; }
  .cifra-dest { grid-column: span 1; flex-direction: column; align-items: flex-start; gap: .4rem; }
}
@media (min-width: 56rem) {
  body { padding-bottom: 0; }
  h1 { font-size: 2rem; }
  .pestanas { position: static; background: none; border: 0; box-shadow: none; padding: 0; }
  .pestanas ul { display: flex; gap: .2rem; }
  .pestanas a { flex-direction: row; min-height: 0; padding: .45rem .75rem; border-radius: 999px;
    color: rgba(255, 255, 255, .85); font-size: .92rem; gap: .4rem; }
  .pestanas svg { width: 1.1rem; height: 1.1rem; }
  .pestanas a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
  .pestanas a[aria-current] { background: rgba(255, 255, 255, .18); color: #fff; }
  .pestanas a[aria-current] svg { background: none; padding: 0; margin: 0; width: 1.1rem; height: 1.1rem; }
  .portada { max-width: 46rem; }
  .buscar-rejilla { display: grid; grid-template-columns: 23rem 1fr; gap: 1.5rem; align-items: start; }
  .filtros { position: sticky; top: 5rem; max-height: calc(100vh - 6rem); overflow-y: auto; }
  .vacio { padding-top: 5rem; }
  .cifra-dest { flex-direction: row; align-items: center; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.ir-resultado { position: fixed; left: 50%; transform: translateX(-50%); z-index: 15;
  bottom: calc(var(--alto-pestanas) + env(safe-area-inset-bottom) + .75rem);
  display: inline-flex; align-items: center; gap: .4rem; padding: .7rem 1.2rem; border-radius: 999px;
  background: var(--primario-2); color: #fff; font-weight: 650; text-decoration: none;
  box-shadow: 0 6px 20px rgba(8, 60, 80, .35); }
.ir-resultado svg { width: 1.1rem; height: 1.1rem; }
.ir-resultado[hidden] { display: none; }
@media (min-width: 56rem) { .ir-resultado { display: none; } }
/* Selector de idioma (N6) */
.pie .idiomas ul { list-style: none; padding: 0; margin: 0 0 .8rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.pie .idiomas a { display: inline-block; padding: .35rem .75rem; border-radius: 999px; text-decoration: none;
  background: var(--superficie); box-shadow: var(--sombra); color: var(--texto); font-weight: 600; }
.pie .idiomas a[aria-current] { background: var(--primario-2); color: #fff; }
.aviso-idioma { margin-top: .8rem; }

/* Municipio: campo principal, grande y separado de la comunidad */
#municipio { font-size: 1.15rem; min-height: 3.4rem; }
.sugerencias li { font-size: 1.1rem; padding: .75rem .9rem; }
.sugerencias li small { display: block; font-size: .8rem; color: var(--suave); }
.etiqueta-com { display: block; margin: 1rem 0 .35rem; font-size: .9rem; color: var(--suave); font-weight: 600; }
#comunidad { font-size: 1rem; }
.caja-busqueda + .etiqueta-com { margin-top: 1rem; }
.paso > label[for=municipio] { font-size: 1.25rem; }

/* N11 · Mi lista, comparador, acciones de la ficha y vista rápida */
.pestanas ul { grid-template-columns: repeat(5, 1fr); }
.pestanas a { position: relative; }
.insignia { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 .35rem; border-radius: 999px;
  background: var(--arena); color: #3a2200; font-size: .72rem; font-weight: 800; line-height: 1; }
.insignia[hidden] { display: none; }
.pestanas .insignia { position: absolute; top: .3rem; left: calc(50% + .45rem); }
@media (min-width: 56rem) { .pestanas .insignia { position: static; } }

.guardar { display: inline-flex; align-items: center; gap: .4rem; font: inherit; font-weight: 650; font-size: .9rem; cursor: pointer;
  min-height: 2.4rem; padding: .35rem .9rem; border-radius: 999px; text-decoration: none;
  background: var(--superficie); color: var(--acento); border: 1.5px solid var(--linea); }
.guardar svg { width: 1.1rem; height: 1.1rem; }
.guardar:hover { border-color: var(--primario-2); }
.guardar[aria-pressed=true], .guardar.guardado { background: var(--acento-fondo); border-color: var(--primario-2); color: var(--acento); }
.guardar[aria-pressed=true] svg, .guardar.guardado svg { fill: currentColor; }
.tarjeta .guardar { position: relative; z-index: 2; flex: none; min-height: 2.4rem; width: 2.4rem; padding: 0; justify-content: center; }
.acciones-ficha { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.cabecera-ficha .guardar { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .45); }
.cabecera-ficha .guardar:hover { background: rgba(255, 255, 255, .24); }
.cabecera-ficha .guardar[aria-pressed=true] { background: #fff; color: var(--primario); border-color: #fff; }
.toast { position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); max-width: calc(100% - 2rem);
  bottom: calc(var(--alto-pestanas) + env(safe-area-inset-bottom) + 1rem); background: var(--texto); color: var(--fondo);
  padding: .7rem 1.1rem; border-radius: 12px; font-weight: 600; box-shadow: var(--sombra); }
.toast[hidden] { display: none; }
@media (min-width: 56rem) { .toast { bottom: 1.5rem; } }
.pista { margin: -.2rem 0 .8rem; padding: .6rem .8rem; border-radius: 10px; background: var(--acento-fondo); color: var(--acento); font-weight: 600; }
.pista[hidden] { display: none; }
.vacio svg path { fill: none; stroke: var(--primario-2); }
.boton.secundario { background: var(--superficie); color: var(--acento); border: 1.5px solid var(--primario-2); }

.comparador { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 34rem; background: var(--superficie);
  border-radius: var(--radio); box-shadow: var(--sombra); overflow: hidden; }
.comparador th, .comparador td { padding: .7rem .8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--linea); }
.comparador thead th { font-size: 1rem; line-height: 1.3; min-width: 11rem; background: var(--superficie); }
.comparador thead th a { color: var(--texto); font-weight: 700; text-decoration: none; display: block; margin-bottom: .35rem; }
.comparador thead th a:hover { color: var(--acento); }
.comparador tbody th { position: sticky; left: 0; background: var(--superficie); font-size: .85rem; color: var(--suave);
  text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.comparador td.mejor { color: var(--t-medio-txt); background: var(--t-medio); font-weight: 750; }
.comparador thead th { vertical-align: top; border-bottom: 2px solid var(--linea); }
.comparador thead th > span { display: block; }
.comp-tipo { width: fit-content; margin-bottom: .45rem; padding: .12rem .55rem; border-radius: 999px; background: var(--acento-fondo);
  color: var(--acento); font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.comp-zona { margin: .1rem 0 .55rem; font-size: .82rem; font-weight: 500; color: var(--suave); }
.comparador .quitar { font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; background: none; border: 1px solid var(--linea);
  border-radius: 999px; padding: .2rem .65rem; color: var(--suave); }
.comparador .quitar:hover { color: var(--fallo); border-color: var(--fallo); }
.comparador tbody tr:nth-child(even) th, .comparador tbody tr:nth-child(even) td:not(.mejor) { background: color-mix(in srgb, var(--linea) 22%, var(--superficie)); }
.comparador tbody td { font-size: 1.02rem; font-weight: 650; }
.comparador thead td.vacia { padding: 0; width: 8rem; border-bottom: 2px solid var(--linea); }
.comparador .fila-quitar th, .comparador .fila-quitar td { background: var(--superficie) !important; padding-top: .5rem; padding-bottom: .6rem; }
.barra-lista { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin: 0 0 .9rem; }
.contador-lista { margin: 0; font-weight: 650; color: var(--suave); }
.acciones-lista { display: flex; flex-wrap: wrap; gap: .5rem; }
.acciones-lista .boton[hidden] { display: none; }
.boton.secundario.peligro { color: var(--fallo); border-color: var(--fallo); }
.boton.secundario.peligro:hover { background: color-mix(in srgb, var(--fallo) 10%, var(--superficie)); }
.comparador tr:last-child th, .comparador tr:last-child td { border-bottom: 0; }
.resumen[hidden] { display: none; }
@media (max-width: 40rem) {
  .comparador { min-width: 0; font-size: .9rem; }
  .comparador th, .comparador td { padding: .55rem .5rem; }
  .comparador thead th { min-width: 8.2rem; font-size: .92rem; }
  .comparador tbody th { width: 5.6rem; max-width: 5.6rem; white-space: normal; font-size: .68rem; letter-spacing: 0; }
}

/* Mi lista en movil: tarjetas en vez de tabla */
.comp-tarjetas { display: none; }
@media (max-width: 40rem) {
  .tabla-envoltura:has(.comparador) { display: none; }
  .comp-tarjetas { display: grid; gap: .9rem; }
  .comp-tarjeta { background: var(--superficie); border-radius: var(--radio); box-shadow: var(--sombra); padding: 1rem; }
  .comp-tarjeta .comp-tipo { display: block; }
  .comp-nombre { display: block; color: var(--texto); font-weight: 750; font-size: 1.1rem; line-height: 1.3; text-decoration: none; }
  .comp-tarjeta .comp-zona { display: block; margin: .15rem 0 .7rem; }
  .comp-datos { margin: 0; display: grid; gap: .45rem; }
  .comp-datos > div { padding: .5rem .65rem; border-radius: 10px; background: color-mix(in srgb, var(--linea) 25%, var(--superficie)); }
  .comp-datos > div.mejor { background: var(--t-medio); color: var(--t-medio-txt); }
  .comp-datos dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--suave); }
  .comp-datos > div.mejor dt { color: inherit; }
  .comp-datos dd { margin: .1rem 0 0; font-size: 1.05rem; font-weight: 700; }
  .comp-tarjeta .quitar { margin-top: .8rem; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; background: none;
    border: 1px solid var(--linea); border-radius: 999px; padding: .35rem .9rem; color: var(--suave); }
}

/* N13c: barras de comparacion en Mi lista y filtro de salario */
.mini-barra { display: block; height: 6px; margin-top: .35rem; border-radius: 3px; background: var(--linea); overflow: hidden; }
.mini-barra > span { display: block; height: 100%; background: var(--primario-2); border-radius: 3px; }
td.mejor .mini-barra > span { background: var(--primario); }
.campo-salario output { font-weight: 650; }
.campo-salario input[type=range] { width: 100%; }

/* Opinion sobre la ficha */
.opinion-botones { display: flex; gap: .6rem; margin: .5rem 0; }
.opinion-botones .guardar[aria-pressed=true] { background: var(--acento-fondo); border-color: var(--primario-2); color: var(--acento); }
.opinion textarea { width: 100%; box-sizing: border-box; font: inherit; padding: .6rem .75rem; border: 1px solid var(--linea); border-radius: .5rem;
  background: var(--superficie); color: var(--texto); resize: vertical; min-height: 5rem; }
.opinion .campo { margin-top: .5rem; display: grid; gap: .4rem; }
.opinion [hidden] { display: none; }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Pantallas grandes: se aprovecha el ancho */
@media (min-width: 90rem) { :root { --ancho: 90rem; } }
@media (min-width: 72rem) {
  .buscar-rejilla { grid-template-columns: 24rem 1fr; gap: 2rem; }
  .columna-resultado .lista:not(.lista-aparte), .columna-resultado .lista-aparte { grid-template-columns: repeat(auto-fill, minmax(25rem, 1fr)); gap: .9rem; align-items: start; }
  .columna-resultado .lista-aparte .tarjeta { grid-template-columns: 1fr; }
  /* ficha del estudio: secciones por pares, las tablas a todo el ancho */
  .ficha-rejilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; align-items: start; }
  .ficha-rejilla .seccion-ancha { grid-column: 1 / -1; }
  /* que se contrata: los grupos de cada nivel en columnas */
  .pagina-ocupaciones .nivel { display: grid; grid-template-columns: repeat(auto-fill, minmax(26rem, 1fr)); gap: 1rem 1.5rem; align-items: start; }
  .pagina-ocupaciones .nivel > h2 { grid-column: 1 / -1; }
}

/* Agrupar por ambito (03/12/2026): cabecera de grupo dentro de la lista de resultados */
.grupo-ambito { list-style: none; display: flex; align-items: baseline; justify-content: space-between; gap: .75rem;
  margin: 1.25rem 0 .25rem; padding: .35rem .25rem; border-bottom: 2px solid var(--primario-2); }
.grupo-ambito:first-child { margin-top: 0; }
.grupo-ambito h3 { margin: 0; font-size: 1.05rem; color: var(--acento); }
.grupo-ambito .grupo-n { color: var(--suave); font-size: .9rem; white-space: nowrap; }
