/* mercado.css — E7 (maqueta aprobada el 27-oct-2026; mercado-2 del 3-nov): ficha de mercado × territorio sobre la lámina del
 * sistema (sistema.css, clases e1-*) y los componentes de gráficos de «Cómo se contrata» (gr-*). Solo tokens de la casa: el modo
 * oscuro sale de tokens.css. EST-DENS: la serif, solo en el H1; cifras en Inter tabular (--fuente-cifra). Gráficos de ficha bajos
 * (≤ 200 px a 1.440; 170 a 390) con «Ampliar» (RUMBO D5.2). */
.m7-cabeza { padding-bottom: var(--sp-2); }
.m7-h1 { margin-top: var(--sp-1); max-width: 30ch; min-height: calc(2 * var(--e1-lh-40)); text-wrap: balance; }
.m7-elige { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-2) var(--sp-4); margin: var(--sp-3) 0 var(--sp-2); }
.m7-campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.m7-campo select, .m7-campo input { min-height: 40px; max-width: 100%; font: inherit; font-size: var(--e1-14); color: var(--color-texto); background: var(--color-superficie);
  border: 1px solid var(--color-borde-control); border-radius: var(--radio-m); padding: 0 10px; box-sizing: border-box; }
.m7-campo-div select { width: 34rem; }
.m7-insuf { margin: var(--sp-2) 0; padding: var(--sp-2) var(--sp-3); max-width: 92ch; font-size: var(--e1-14); line-height: var(--e1-lh-14); color: var(--color-texto);
  border-left: 3px solid var(--color-borde-fuerte); background: var(--color-fondo-hundido); }
.m7-cifras { margin-top: var(--sp-2); }
.m7-cabeza .m7-cifras { --e1-n: 8; }           /* ocho cifras con su base en una fila a 1.440 (EST-1: ≥ 8 visibles sin scroll) */
.m7-cifras .e1-c-base { min-height: 3.75rem; }
.m7-herramientas { margin: var(--sp-2) 0 0; }
.m7-herramientas .m7-elige { margin-top: 0; }
.m7-cifras .e1-c-valor a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.12em; }
.m7-cobertura { margin: var(--sp-2) 0 0; max-width: 110ch; min-height: 2.6em; }
.m7-cargando .m7-cifras .e1-c-valor, .m7-cargando .m7-lienzo { opacity: 0.45; transition: opacity 200ms ease; }
.m7-quees { margin-top: var(--sp-2); }
.m7-quees > p { margin: 0 0 var(--sp-3); }
.m7-cuerpo { min-width: 0; }
.m7-sec { margin-top: var(--sp-8); }
.m7-sec:first-child { margin-top: var(--sp-6); }
.m7 .e1-bloque-t { max-width: none; }
/* mandos: botoneras, años con «▶ Años», búsqueda del órgano y la provincia */
.m7-mandos { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); align-items: flex-end; margin: var(--sp-1) 0 var(--sp-1); }
.m7-mandos .gr-mando[hidden] { display: none; }
.m7-anios-fila { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.m7-buscar input { width: 24rem; }
.m7 .gr-lectura.m7-lectura { display: block; max-width: 96ch; margin: var(--sp-1) 0; font-size: var(--e1-14); line-height: var(--e1-lh-14); color: var(--color-texto); min-height: 2.5rem; }
.m7 .gr-lectura.m7-lectura strong { font-weight: 600; font-variant-numeric: tabular-nums; }
/* lienzos bajos: el sitio reservado (sin estilos en línea), 200 px (170 en el móvil); al ampliar, el SVG manda */
.m7-lienzo { min-height: 200px; }
@media (max-width: 640px) { .m7-lienzo { min-height: 170px; } .m7-campo-div select, .m7-buscar input { width: 100%; } .m7-campo, .m7-buscar { flex: 1 1 100%; } }
.m7-lienzo svg { display: block; width: 100%; }
.m7-lienzo .m7-zona:focus-visible { outline: 2px solid var(--color-acento); outline-offset: -2px; }
.m7-lienzo .m7-zona { cursor: pointer; }
.m7-figura { margin: 0; }
.m7-leyenda { margin-top: var(--sp-1); }
.m7-leyenda:empty { display: none; }
.m7-leyenda li i { width: 12px; height: 12px; border-radius: 3px; }
.m7-leyenda .m7-ley-tinta i { width: 9px; height: 9px; border-radius: 50%; background: var(--color-texto); }
.m7-leyenda .m7-ley-gris i { width: 9px; height: 9px; border-radius: 50%; background: var(--gr-punto); opacity: 0.7; }
.m7-leyenda .m7-ley-aro i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--color-texto); background: transparent; }
.m7-leyenda .m7-ley-acento i { width: 11px; height: 11px; border-radius: 50%; background: var(--color-acento); }
.m7-leyenda .m7-ley-marca i, .m7-leyenda .m7-ley-linea i { height: 2px; width: 18px; border-radius: 1px; }
.m7-leyenda .m7-ley-punto i { width: 10px; height: 10px; border-radius: 50%; }
.m7-leyenda .m7-ley-raya i { border: 1px solid var(--color-acento); background: repeating-linear-gradient(45deg, var(--color-acento) 0 2px, transparent 2px 5px); }
/* bajar a los contratos y llevarse el gráfico */
.m7-bajar { margin: var(--sp-1) 0 0; font-size: var(--e1-13); line-height: var(--e1-lh-13); }
.m7-bajar a { display: inline-flex; align-items: center; min-height: 40px; font-weight: 600; color: var(--color-acento); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
.m7-bajar .e1-nota { color: var(--e1-gris-3); }
.m7-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: var(--sp-1) 0 var(--sp-2); }
.m7-acciones button { min-height: 40px; padding: 0 12px; font: inherit; font-size: var(--e1-13); color: var(--color-texto); background: var(--color-superficie);
  border: 1px solid var(--color-borde-control); border-radius: 999px; cursor: pointer; }
.m7-acciones button:hover { border-color: var(--color-acento); }
.m7-acciones button[aria-pressed="true"] { background: var(--color-fondo-hundido); }
.m7-acciones button:disabled { opacity: 0.6; cursor: progress; }
.m7-aviso { font-size: var(--e1-13); color: var(--e1-gris-3); }
.m7-fijo { margin-top: var(--sp-1); }
.m7-fijo p { margin: 0 0 var(--sp-2); font-size: var(--e1-13); line-height: var(--e1-lh-13); }
.m7-tabla { margin-top: var(--sp-2); overflow-x: auto; }
.m7-tabla-t { font-variant-numeric: tabular-nums; }
.m7-tabla-t tr.sel td, .m7-tabla-t tr.sel th { background: var(--color-fondo-hundido); }
.m7-tabla-t td a { color: var(--color-acento); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; text-decoration-color: var(--color-acento-borde); }
/* tira de la oferta única por comunidad */
.m7-tira { white-space: nowrap; }
.m7-tira svg { vertical-align: middle; overflow: visible; }
.m7-tira .ref { stroke: var(--color-texto); stroke-width: 1; }
.m7-tira .ic { stroke: var(--gr-punto); stroke-width: 2; stroke-linecap: round; }
.m7-tira .p { fill: var(--gr-punto); stroke: var(--color-fondo); stroke-width: 1.5; }
.m7-tira .p.sel { fill: var(--color-acento); }
.m7-tira-v { display: inline-block; min-width: 3.6em; margin-left: var(--sp-2); text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .m7-tira svg { width: 120px; } }
.m7-metodo .e1-pleg > :not(summary) { max-width: 92ch; font-size: var(--e1-14); line-height: var(--e1-lh-14); }
.m7-chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--e1-13); color: var(--color-texto-2); white-space: nowrap; }
.m7-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--color-texto-2); }
.m7-chip.pasa::before { background: var(--color-acento); }
/* /mercados: una fila por división con la N de España y la tira de comunidades con ficha */
.m7-portal { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 0 var(--sp-6); margin-top: var(--sp-4); }
.m7-portal a { display: flex; justify-content: space-between; gap: var(--sp-3); align-items: baseline; min-height: 40px; padding: 6px 0; border-bottom: 1px solid var(--color-borde); color: var(--color-texto); text-decoration: none; }
.m7-portal a:hover b { text-decoration: underline; }
.m7-portal a b { font-weight: 600; color: var(--color-acento); }
.m7-portal a span { color: var(--color-texto-3); font-size: var(--e1-13); white-space: nowrap; font-variant-numeric: tabular-nums; }
.m7-portal a.insuf b { color: var(--color-texto-2); font-weight: 400; }
.m7-portal-cpv2003 { margin-top: var(--sp-6); }
.m7 .m7-terr-t .m7-solo-movil { display: none; }
@media (max-width: 720px) {
  .m7 .m7-terr-t .m7-solo-movil { display: block; font-size: var(--e1-13); line-height: var(--e1-lh-13); color: var(--e1-gris-3); font-weight: 400; }
  .m7-terr-t td.m7-no-movil { display: none; }
  .m7-terr-t tr { padding: 6px 0; }
}
@media (max-width: 640px) {
  .m7 .e1-bloque-n { display: none; }
  .m7-cabeza .m7-cifras { margin-top: var(--sp-3); }
  .m7-cifras .e1-c-base { min-height: 0; }      /* en el móvil, la base no reserva tres líneas: la cabecera cabe entera */
  .m7-cobertura { min-height: 0; }
  .m7 .e1-sec-cab a { display: inline-flex; align-items: center; min-height: 40px; }
  .m7-h1 { min-height: calc(2 * var(--e1-lh-32)); }
  .m7 .gr-seg button { min-height: 40px; }
  .cu-sup .migas a, .cu .migas a { display: inline-flex; align-items: center; min-height: 40px; min-width: 40px; justify-content: center; }
  .m7 .e1-linea a, .m7 .e1-linea-gris a { display: inline-flex; align-items: center; min-height: 40px; }
}
/* lo oculto, oculto aunque su clase le dé display (especificidad 0,3,0, sin forzar nada) */
.m7 [hidden][hidden] { display: none; }
.m7 .gr-lienzo svg text { font-size: 13px; }
.m7 .gr-plegables { grid-template-columns: minmax(0, 1fr); }
@media (prefers-reduced-motion: reduce) { .m7-cargando .m7-cifras .e1-c-valor, .m7-cargando .m7-lienzo { transition: none; } }
