/* ==========================================================================
   Portal de proyectos e inversiones · Ajuntament de Silla
   Visor de geoportal: el mapa ocupa la pantalla y encima flotan una fila de herramientas y
   paneles blancos. Tokens, tipografías y base en /comun/css/base.css.
   ========================================================================== */

:root {
  --alto-barra: 56px;
  --borde-mapa: 16px;
  --hueco: 8px;
  --boton-mapa: 48px;
  --ancho-panel: 380px;
  --arriba-paneles: calc(var(--borde-mapa) + var(--boton-mapa) + var(--hueco));
  --color-tipo: #6f6765;
}

/* ---------- botones ---------- */

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px;
  border: 1px solid var(--brand); border-radius: 10px;
  background: var(--brand); color: #fff; box-shadow: var(--shadow-sm);
  font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background var(--t), border-color var(--t), box-shadow var(--t), color var(--t);
}
.boton:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.boton--secundario { background: var(--panel); border-color: var(--line); color: var(--ink-2); border-radius: 9px; font-weight: 500; box-shadow: none; }
.boton--secundario:hover { background: var(--panel-2); border-color: var(--line); color: var(--ink); }
.boton--texto { min-height: 32px; padding: 0 8px; background: transparent; border-color: transparent; box-shadow: none; color: var(--brand); font-weight: 500; }
.boton--texto:hover { background: var(--brand-soft); border-color: transparent; color: var(--brand-2); }
.boton-suave {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  font-size: 12px; font-weight: 500; color: var(--ink-2); text-decoration: none; cursor: pointer;
  transition: background var(--t), color var(--t);
}
.boton-suave .icono { width: 14px; height: 14px; }
.boton-suave:hover { background: var(--line); color: var(--ink); }
.boton-icono {
  display: inline-grid; place-items: center; width: 28px; height: 28px; margin: -4px -6px -4px auto; padding: 0;
  background: transparent; border: 0; border-radius: 6px; color: var(--ink-4); cursor: pointer;
  transition: background var(--t), color var(--t);
}
.boton-icono:hover { background: var(--panel-2); color: var(--ink-2); }

/* Botón de herramienta del mapa */
.boton-mapa {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: var(--boton-mapa); height: var(--boton-mapa); padding: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-sm);
  color: var(--ink-2); cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t), box-shadow var(--t);
}
.boton-mapa .icono { width: 20px; height: 20px; }
.boton-mapa:hover { background: var(--panel-2); }
.boton-mapa.es-activo, .boton-mapa[aria-expanded="true"] { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.boton-mapa.es-activo:hover, .boton-mapa[aria-expanded="true"]:hover { background: var(--brand-2); }
.boton-mapa__texto { display: none; }
.boton-mapa__insignia {
  position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--brand); color: #fff; box-shadow: 0 0 0 2px var(--panel);
  font: 500 12px/20px var(--mono); text-align: center;
}
.boton-mapa[aria-expanded="true"] .boton-mapa__insignia { background: #fff; color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }

/* Pestañas segmentadas */
.seg { display: flex; gap: 2px; padding: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; }
.seg button {
  flex: 1; min-height: 30px; padding: 0 12px; border: 1px solid transparent; border-radius: 6px; background: transparent;
  font-size: 12px; font-weight: 500; color: var(--ink-3); cursor: pointer; transition: background var(--t), color var(--t);
}
.seg button:hover { color: var(--ink); }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--panel); border-color: var(--line); color: var(--brand); box-shadow: var(--shadow-sm); font-weight: 600; }

/* ---------- campos ---------- */

.campo { position: relative; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.campo > label, .etiqueta-campo { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.entrada, .panel input[type="search"], .panel-flotante input[type="text"], .panel-flotante input[type="search"], .geocoder input, select.selector-pastilla {
  width: 100%; padding: 9px 11px; font-size: 13px; line-height: 1.3; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  transition: border-color var(--t), box-shadow var(--t);
}
.panel input::placeholder, .geocoder input::placeholder { color: var(--placeholder); }
.panel input[type="search"]:focus-visible, .panel-flotante input:focus-visible, select.selector-pastilla:focus-visible {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
select.selector-pastilla {
  -webkit-appearance: none; appearance: none; width: auto; padding-right: 32px; cursor: pointer;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f6765' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center / 14px;
}
select.selector-pastilla:hover { border-color: var(--line-strong); }
.busqueda-proyectos .campo input { padding-left: 34px; }
.busqueda-proyectos .campo::before, .geocoder::before {
  content: ""; position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); pointer-events: none;
  background: var(--ink-4);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.geocoder::before { display: none; }

/* ---------- barra de aplicación ---------- */

.barra-app {
  position: relative; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: var(--alto-barra); padding: 0 16px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  box-shadow: inset 0 -2px 0 var(--brand);
}
.marca { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.marca:hover { color: var(--ink); }
.marca__escudo { width: auto; height: 36px; }
.marca__texto { display: flex; flex-direction: column; line-height: 1.15; padding-left: 10px; border-left: 1px solid var(--line); }
.marca__institucion { font-size: 14px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--ink); }
.marca__de { font-weight: 400; text-transform: none; }
.marca__portal { margin-top: 2px; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.barra-app__idiomas { display: flex; gap: 2px; padding: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; }
.idioma { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border: 1px solid transparent; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--ink-3); text-decoration: none; }
a.idioma:hover { color: var(--ink); }
.idioma--actual { background: var(--panel); border-color: var(--line); color: var(--brand); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---------- visor: mapa a pantalla completa ---------- */

.portal--app { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.app { position: relative; flex: 1; min-height: 0; }
.vista { position: absolute; inset: 0; }
.mapa-portal { position: absolute; inset: 0; background: #ebe8e6; }
.mapa-portal__lienzo { position: absolute; inset: 0; }

/* Fila de herramientas: no bloquea el arrastre del mapa entre botones */
.herramientas {
  position: absolute; z-index: 30; top: var(--borde-mapa); left: var(--borde-mapa);
  display: flex; align-items: flex-start; gap: var(--hueco); pointer-events: none;
}
.herramientas > * { pointer-events: auto; }
.conmutador { display: none; }

/* Buscador de direcciones */
.geocoder { position: relative; display: flex; align-items: stretch; height: var(--boton-mapa); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-sm); }
.geocoder input { width: 200px; height: 100%; padding: 0 12px; border: 0; border-radius: 8px 0 0 8px; background: transparent; font-size: 14px; transition: width .2s; }
.geocoder input:focus { width: 264px; }
.geocoder input:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--brand); }
.geocoder__boton { display: grid; place-items: center; width: 46px; padding: 0; border: 0; border-left: 1px solid var(--line); border-radius: 0 8px 8px 0; background: transparent; color: var(--ink-3); cursor: pointer; }
.geocoder__boton .icono { width: 18px; height: 18px; }
.geocoder__boton:hover { background: var(--panel-2); color: var(--ink); }
.sugerencias {
  position: absolute; top: calc(100% + 4px); left: -1px; width: max(100%, 320px); z-index: 40; list-style: none; margin: 0; padding: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md);
}
.sugerencias li + li { border-top: 1px solid var(--line); }
.sugerencia { width: 100%; min-height: 40px; padding: 10px 12px; text-align: left; background: none; border: 0; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; }
.sugerencia:hover, .sugerencia:focus-visible { background: var(--panel-2); }
.filtros__mensaje { position: absolute; top: calc(100% + 4px); left: 0; margin: 0; padding: 6px 10px; white-space: nowrap; font-size: 12px; color: var(--ink-2); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-sm); }
.filtros__mensaje:empty { display: none; }

/* ---------- paneles flotantes ---------- */

.panel-flotante, .panel {
  position: absolute; z-index: 25; top: var(--arriba-paneles); left: var(--borde-mapa);
  display: flex; flex-direction: column; max-height: calc(100% - var(--arriba-paneles) - var(--borde-mapa));
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md);
  animation: aparecer .2s ease-out;
}
@keyframes aparecer { from { opacity: 0; transform: translateY(-10px); } }
.panel-flotante__cabecera {
  display: flex; align-items: center; gap: 8px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line);
}
.panel-flotante__cabecera > .icono { color: var(--brand); }
.panel-flotante__cabecera h2 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.panel-flotante__cuerpo { padding: 12px; overflow-y: auto; }
.panel-flotante__pie { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }

.panel-capas { left: calc(var(--borde-mapa) + 2 * (var(--boton-mapa) + var(--hueco))); width: 260px; z-index: 35; }
.capas { margin: 0; border: 0; }
.grupo-capas { padding: 4px 12px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.fila-capa { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 8px 12px; border-radius: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; transition: background var(--t); }
.fila-capa:hover { background: var(--panel-2); }
.fila-capa input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }

/* Filtros: panel flotante sobre la lista, abierto con el botón «Filtros» */
.panel-filtros { width: 340px; z-index: 35; display: none; }
.filtros-abiertos .panel-filtros { display: flex; }
.filtros { display: flex; flex-direction: column; min-height: 0; }
.filtros__cuerpo { display: flex; flex-direction: column; gap: 6px; padding: 12px; overflow-y: auto; }
.filtros__fila { display: flex; flex-direction: column; gap: 6px; }
.filtros__fila--anio { margin-top: 6px; }

.desplegable > summary {
  display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 12px;
  list-style: none; cursor: pointer; user-select: none;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--ink-2); transition: background var(--t);
}
.desplegable > summary::-webkit-details-marker { display: none; }
.desplegable > summary:hover { background: var(--panel-3); }
.desplegable > summary::after {
  content: ""; width: 14px; height: 14px; margin-left: auto; flex: none; background: var(--brand); transform: rotate(-90deg); transition: transform var(--t);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / contain no-repeat;
}
.desplegable[open] > summary::after { transform: rotate(0); }
.desplegable:has(input:checked) > summary, .desplegable--activo > summary { background: var(--brand-soft); border-color: var(--brand-ring); color: var(--brand-2); }
.desplegable__contador { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.desplegable > :not(summary) { padding: 4px 0 6px 8px; }
.casillas { display: flex; flex-direction: column; margin: 0; padding: 0; border: 0; }
.casilla { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 10px; border-radius: 8px; transition: background var(--t); }
.casillas .casilla:hover { background: var(--panel-2); }
.casilla input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--brand); }
.casilla label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.casilla--zona { margin-top: 4px; padding: 0 4px; }
.casilla--zona label { font-size: 12.5px; }
.muestra { display: inline-block; width: 12px; height: 12px; border-radius: 2px; background: var(--color-tipo); border: 1px solid rgba(0, 0, 0, .12); }
.importe-filtro { display: flex; flex-direction: column; gap: 10px; padding: 6px 10px 4px; }
.importe-filtro select { width: 100%; }
.importe-filtro input[type="range"] { width: 100%; margin: 0; accent-color: var(--brand); }
.importe-filtro output { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--ink); text-transform: none; }
.campo--pastilla select { width: 100%; }

/* Estado: forma + texto (nunca solo color) */
.estado { display: inline-flex; align-items: center; gap: 6px; }
.estado::before, .muestra-estado { content: ""; display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; border: 1.5px solid currentColor; }
.estado--previsto::before, .estado--licitacion::before, .muestra-estado.estado--previsto, .muestra-estado.estado--licitacion { background: transparent; border-style: dashed; width: 9px; height: 9px; }
.estado--finalizado::before, .muestra-estado.estado--finalizado { width: 6px; height: 6px; box-shadow: 0 0 0 1.5px var(--panel), 0 0 0 3px currentColor; margin: 0 1.5px; }
.muestra-estado { color: var(--ink-3); }
.muestra-estado::before { content: none; }
.distintivo { display: inline-flex; align-items: center; height: 22px; margin: 0; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--panel-2); color: var(--ink-3); white-space: nowrap; }
.distintivo--activo { background: var(--warn-soft); color: var(--warn); }
.distintivo--finalizado { background: var(--ok-soft); color: var(--ok); }
.distintivo--finalizado .estado::before { box-shadow: 0 0 0 1.5px #e6f1ec, 0 0 0 3px currentColor; }

/* ---------- panel de proyectos ---------- */

.panel { width: var(--ancho-panel); bottom: var(--borde-mapa); max-height: none; z-index: 20; }
.panel-oculto .panel { display: none; }
.panel__cabecera { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.antetitulo { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.antetitulo::before { content: ""; width: 3px; height: 11px; border-radius: 2px; background: var(--brand); }
.panel h1 { margin: 0; font-size: 17px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.presentacion-plegable > summary {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; min-height: 26px; cursor: pointer; list-style: none;
  font-size: 12px; font-weight: 500; color: var(--ink-3);
}
.presentacion-plegable > summary::-webkit-details-marker { display: none; }
.presentacion-plegable > summary .icono { width: 14px; height: 14px; color: var(--brand); }
.presentacion-plegable > summary:hover { color: var(--brand-2); }
.presentacion p { margin: 4px 0 2px; font-size: 13px; color: var(--ink-2); }
.panel__cuerpo { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 16px 14px; }
.busqueda-proyectos { margin-bottom: 10px; }

.resumen__cifras { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 6px; margin: 0; }
.kpi { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; }
.kpi__valor { font-family: var(--mono); font-size: 24px; line-height: 1; font-weight: 600; letter-spacing: -.03em; color: var(--ink); font-feature-settings: "tnum"; white-space: nowrap; }
.kpi__etiqueta { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi--destacado { background: var(--brand-soft); border-color: var(--brand-ring); }
.kpi--destacado .kpi__valor, .kpi--destacado .kpi__etiqueta { color: var(--brand-2); }
.resumen__cifras--texto { display: block; font-size: 13px; color: var(--ink-3); }
.resumen__cifras--texto:empty { display: none; }

.pestanas { margin-top: 12px; }
.lista { padding-top: 10px; }
.lista__barra { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 0 8px; }
.lista__barra:empty { display: none; }
.lista__orden { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.lista__barra select.selector-pastilla { padding-top: 6px; padding-bottom: 6px; font-size: 12px; border-color: var(--line-strong); }

.panel__pie { display: flex; flex-direction: column; gap: 8px; padding: 10px 16px 12px; border-top: 1px solid var(--line); }
.resumen__descargas { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.resumen__etiqueta { margin-right: auto; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.panel__creditos { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; margin: 0; font-size: 11px; color: var(--ink-3); }
.panel__creditos a { color: var(--ink-3); }
.panel__creditos a:hover { color: var(--brand); }

/* Tarjetas de proyecto */
.resultados { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tarjeta {
  position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm);
  cursor: pointer; transition: background var(--t), box-shadow var(--t), border-color var(--t);
  animation: entrada 240ms ease-out both; animation-delay: calc(var(--orden, 12) * 24ms);
}
/* Solo desplazamiento: sin opacidad, el texto conserva su contraste en todo momento */
@keyframes entrada { from { transform: translateY(6px); } }
.tarjeta::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--color-tipo); }
.tarjeta:hover { background: var(--panel-2); box-shadow: var(--shadow-md); }
.tarjeta--resaltada { border-color: var(--brand-ring); box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow-md); }
.tarjeta__contenido { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 14px 16px 10px 18px; }
.tarjeta__imagen, .tarjeta__marcador { width: 48px; height: 48px; border-radius: 8px; }
.tarjeta__imagen { object-fit: cover; background: var(--panel-2); }
.tarjeta__marcador { display: grid; place-items: center; background: var(--panel-2); background: color-mix(in srgb, var(--color-tipo) 11%, #fff); border: 1px solid color-mix(in srgb, var(--color-tipo) 20%, transparent); }
.tarjeta__simbolo { width: 26px; height: 26px; }
.tarjeta__texto { min-width: 0; display: flex; flex-direction: column; }
.tarjeta__tipo { display: flex; align-items: center; gap: 6px; margin: 0 0 3px; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.tarjeta__titulo { margin: 0 0 8px; font-size: 15px; line-height: 1.25; font-weight: 600; letter-spacing: -.005em; }
.tarjeta__enlace { color: var(--ink); text-decoration: none; }
.tarjeta__enlace:hover { color: var(--brand); text-decoration: underline; }
.tarjeta__cifras { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; }
.tarjeta__cifras p { margin: 0; }
.tarjeta__importe { font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--ink); font-feature-settings: "tnum"; }
.tarjeta__texto .avance { margin: 8px 0 0; }
.tarjeta__pie { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.tarjeta__fecha { margin: 0; font-size: 12px; color: var(--ink-3); }
.tarjeta__situar {
  display: inline-flex; align-items: center; gap: 5px; min-height: 30px; margin-right: -8px; padding: 0 8px;
  background: none; border: 0; border-radius: 8px; font-size: 12px; font-weight: 500; color: var(--brand); cursor: pointer;
  transition: background var(--t);
}
.tarjeta__situar::before {
  content: ""; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6.5-5.6-6.5-11a6.5 6.5 0 0 1 13 0c0 5.4-6.5 11-6.5 11z'/%3E%3Ccircle cx='12' cy='10' r='2.3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6.5-5.6-6.5-11a6.5 6.5 0 0 1 13 0c0 5.4-6.5 11-6.5 11z'/%3E%3Ccircle cx='12' cy='10' r='2.3'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tarjeta__situar:hover { background: var(--brand-soft); }
[aria-busy="true"] .resultados { opacity: .55; transition: opacity var(--t); }

.avance { margin: 4px 0; }
.avance__texto { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.avance__barra { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.avance__barra::-webkit-progress-bar { background: var(--panel-3); border-radius: 999px; }
.avance__barra::-webkit-progress-value { background: var(--brand); border-radius: 999px; }
.avance__barra::-moz-progress-bar { background: var(--brand); border-radius: 999px; }
.avance--compacto { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: center; }

/* Estados de la lista: carga, vacío y error */
.estado-lista { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 24px 16px 20px; text-align: center; background: var(--panel); border: 1px dashed var(--line-strong); border-radius: 12px; }
.estado-lista__icono { width: 56px; height: 56px; margin-bottom: 4px; }
.estado-lista__titulo { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.estado-lista__texto { margin: 0 0 10px; max-width: 32ch; font-size: 12.5px; color: var(--ink-3); }
.estado-lista--error { border: 1px solid rgba(209, 52, 74, .3); background: var(--danger-soft); }
.esqueleto-tarjeta, .kpi--esqueleto { position: relative; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); }
.esqueleto-tarjeta { height: 104px; border-radius: 12px; }
.kpi--esqueleto { min-height: 58px; }
.esqueleto-tarjeta::after, .kpi--esqueleto::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .8), transparent);
  animation: brillo 1.3s ease-in-out infinite;
}
@keyframes brillo { to { transform: translateX(100%); } }
.resultados:not(:empty) + .esqueleto-lista { display: none; }

/* Gráfico de inversión */
.graficos { padding-top: 12px; }
.graficos__rejilla { display: grid; gap: 16px; }
.grafico { margin: 0; }
.grafico__titulo { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.grafico__titulo::before { content: ""; width: 3px; height: 11px; border-radius: 2px; background: var(--brand); }
.barras { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, max-content) minmax(3rem, 1fr) max-content; gap: 8px 10px; align-items: center; }
.barra { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; }
.barra__etiqueta { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.barra__pista { height: 8px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.barra__relleno { display: block; height: 100%; border-radius: 999px; }
.barra__valor { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; font-feature-settings: "tnum"; }
.barra__porcentaje { display: none; }
.grafico__tabla { margin-top: 6px; font-size: 12.5px; }
.grafico__tabla summary { display: inline-flex; align-items: center; min-height: 30px; cursor: pointer; font-weight: 500; color: var(--brand); }
.grafico__tabla table { width: 100%; border-collapse: collapse; }
.grafico__tabla th, .grafico__tabla td { padding: 6px; border-bottom: 1px solid var(--line); text-align: left; }
.grafico__tabla thead th { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.numero { text-align: right !important; }

/* ---------- controles del mapa, leyenda y ventana emergente ---------- */

.maplibregl-map { font-family: var(--font); }
.maplibregl-ctrl-top-right { top: calc(var(--borde-mapa) - 10px); right: calc(var(--borde-mapa) - 10px); }
.maplibregl-ctrl-group { border-radius: 8px !important; border: 1px solid var(--line); box-shadow: var(--shadow-sm) !important; overflow: hidden; }
.maplibregl-ctrl-group button { width: 36px; height: 36px; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line); }
.maplibregl-ctrl-attrib, .maplibregl-ctrl-scale { font: 11px var(--font); color: var(--ink-3); }
.portal--app .maplibregl-ctrl-bottom-left { left: calc(var(--borde-mapa) + var(--ancho-panel) + 6px); }
.panel-oculto .maplibregl-ctrl-bottom-left { left: 6px; }

.leyenda { position: absolute; z-index: 5; top: 146px; right: var(--borde-mapa); }
.leyenda > summary {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; list-style: none; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-sm);
  font-size: 13px; font-weight: 500; color: var(--ink-2);
}
.leyenda > summary::-webkit-details-marker { display: none; }
.leyenda > summary:hover { background: var(--panel-2); }
.leyenda[open] > summary { background: var(--brand-soft); border-color: var(--brand-ring); color: var(--brand-2); }
.leyenda__contenido {
  position: absolute; top: 48px; right: 0; width: 248px; max-height: calc(100vh - 290px); overflow-y: auto; padding: 8px 12px 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md);
}
.leyenda__lista { list-style: none; margin: 0; padding: 4px 0; }
.leyenda__lista + .leyenda__lista { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.leyenda__lista li { display: flex; align-items: center; gap: 8px; min-height: 26px; font-size: 12px; color: var(--ink-2); }
.leyenda__lista img { width: 18px; height: 18px; }

.maplibregl-popup-content { padding: 12px 14px !important; border: 1px solid var(--line); border-radius: 12px !important; box-shadow: var(--shadow-md) !important; font-size: 13px; color: var(--ink-2); }
.maplibregl-popup-tip { display: none; }
.maplibregl-popup-close-button { top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 6px; font-size: 18px; color: var(--ink-4); }
.maplibregl-popup-close-button:hover { background: var(--panel-2); color: var(--ink-2); }
.popup { min-width: 210px; }
.popup__antetitulo { margin: 0 24px 2px 0 !important; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.popup__titulo { margin: 0 24px 8px 0 !important; font-size: 15px; font-weight: 600; line-height: 1.25; }
.popup__titulo a { color: var(--ink); text-decoration: none; }
.popup__titulo a:hover { color: var(--brand); }
.popup__filas { margin: 0 0 10px; }
.popup__fila { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.popup__fila dt { color: var(--ink-3); }
.popup__fila dd { margin: 0; font-weight: 600; color: var(--ink); text-align: right; }
.popup__fila .mono { font-size: 12px; }
.popup p { margin: 0; }
.popup__enlace { font-size: 12.5px; font-weight: 600; }

/* Ubicación buscada */
.chincheta { width: 34px; height: 44px; filter: drop-shadow(0 4px 6px rgba(30, 10, 10, .35)); }

.aviso-mapa { position: absolute; z-index: 30; top: var(--borde-mapa); left: 50%; transform: translateX(-50%); margin: 0; padding: 8px 12px; font-size: 12.5px; color: var(--warn); background: #fff; border: 1px solid rgba(178, 106, 0, .3); border-radius: 8px; box-shadow: var(--shadow-md); }
.aviso-mapa:empty { display: none; }
.sin-mapa .mapa-portal { display: none; }
.hoja { display: none; }

/* ---------- móvil y tableta estrecha ---------- */

@media (max-width: 900px) {
  :root { --alto-barra: 56px; }
  .portal--app { height: auto; overflow: visible; display: block; }
  .barra-app { position: sticky; top: 0; }
  .marca__escudo { height: 32px; }
  .marca__institucion { font-size: 12.5px; }
  .marca__portal { font-size: 9.5px; letter-spacing: .08em; }
  .idioma--actual { display: none; }
  .barra-app__idiomas { padding: 0; background: none; border: 0; }
  a.idioma { min-height: 44px; font-size: 13px; }

  .app, .vista { position: static; }
  .herramientas {
    position: sticky; top: var(--alto-barra); z-index: 30; left: auto;
    flex-wrap: wrap; padding: 8px 12px; background: rgba(244, 242, 241, .96); border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  .conmutador { display: flex; flex: 1; }
  .conmutador button { min-height: 44px; font-size: 14px; }
  .boton-mapa--escritorio { display: none; }
  #boton-filtros { width: auto; height: 50px; padding: 0 16px; }
  #boton-filtros .boton-mapa__texto { display: inline; font-size: 14px; font-weight: 500; }
  .geocoder { flex-basis: 100%; height: 46px; }
  .geocoder input, .geocoder input:focus { width: 100%; flex: 1; font-size: 16px; }

  .panel {
    position: static; width: auto; max-height: none; background: transparent; border: 0; border-radius: 0; box-shadow: none; animation: none;
  }
  .panel__cabecera { padding: 16px 16px 8px; border: 0; }
  .panel h1 { font-size: 22px; }
  .presentacion-plegable > summary { min-height: 44px; font-size: 13px; }
  .panel__cuerpo { overflow: visible; padding: 4px 16px 16px; }
  .panel input[type="search"] { font-size: 16px; min-height: 46px; }
  .seg button { min-height: 44px; font-size: 13px; }
  .lista__barra select.selector-pastilla { min-height: 44px; font-size: 14px; }
  .tarjeta__situar { min-height: 44px; }
  .panel__pie { padding: 12px 16px 24px; }
  .boton-suave { min-height: 44px; padding: 0 14px; font-size: 13px; }
  .panel__creditos { font-size: 12px; }
  .panel__creditos a { display: inline-flex; align-items: center; min-height: 44px; }

  /* Filtros a pantalla completa */
  .panel-filtros, .filtros-abiertos .panel-filtros { position: fixed; inset: 0; z-index: 60; width: auto; max-height: none; border: 0; border-radius: 0; animation: none; }
  .panel-filtros { display: none; }
  .filtros-abiertos .panel-filtros { display: flex; }
  .panel-flotante__cabecera { padding: 14px 16px; }
  .panel-flotante__cabecera h2 { font-size: 17px; }
  .boton-icono { width: 44px; height: 44px; margin: -8px -10px -8px auto; }
  .filtros { flex: 1; }
  .filtros__cuerpo { flex: 1; padding: 12px 16px; }
  .desplegable > summary { min-height: 48px; font-size: 14px; }
  .casilla { min-height: 44px; }
  .casilla label { font-size: 14px; }
  .panel-flotante select.selector-pastilla { min-height: 48px; font-size: 14px; }
  .panel-flotante__pie { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 20px rgba(35, 20, 20, .06); }
  .panel-flotante__pie .boton { min-height: 46px; flex: 1; font-size: 14px; }
  .panel-flotante__pie .boton--texto { flex: none; }

  .panel-capas { display: none; }

  .mapa-portal { position: relative; inset: auto; display: none; }
  [data-vista="mapa"] .mapa-portal { display: block; height: calc(100dvh - var(--alto-barra) - 130px); min-height: 380px; }
  [data-vista="mapa"] .panel__cabecera, [data-vista="mapa"] .busqueda-proyectos, [data-vista="mapa"] .resumen,
  [data-vista="mapa"] .graficos, [data-vista="mapa"] .lista, [data-vista="mapa"] .panel__pie,
  [data-vista="mapa"] .pestanas { display: none !important; }
  .portal--app .maplibregl-ctrl-bottom-left { left: 0; }
  .leyenda { top: auto; bottom: 30px; right: 8px; }
  .leyenda > summary { height: 44px; }
  .leyenda__contenido { top: auto; bottom: 52px; max-height: 50vh; width: 220px; }
  .aviso-mapa { position: static; transform: none; margin: 8px 16px; }

  .hoja {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    padding: 18px 60px calc(18px + env(safe-area-inset-bottom)) 18px;
    background: var(--panel); border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; box-shadow: var(--shadow-modal);
  }
  .hoja::before { content: ""; position: absolute; top: 7px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: var(--line-strong); }
  .hoja[hidden] { display: none !important; }
  .hoja__titulo { margin: 0 0 4px; font-size: 16px; font-weight: 600; color: var(--ink); }
  .hoja__meta { margin: 0 0 12px; font-size: 13px; color: var(--ink-3); }
  .hoja__cerrar { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 9px; background: var(--panel-2); color: var(--ink-2); cursor: pointer; }
  .hoja__cerrar .icono { width: 18px; height: 18px; }
  .hoja .boton { min-height: 44px; }
}

/* ==========================================================================
   Ficha de proyecto y páginas de texto
   ========================================================================== */

.portal--ficha main, .portal--texto main { max-width: 1120px; margin: 0 auto; padding: 16px clamp(16px, 3vw, 28px) 40px; }
.migas { margin: 0 0 8px; }
.migas a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-size: 13px; font-weight: 500; color: var(--ink-3); text-decoration: none; }
.migas a::before { content: ""; width: 6px; height: 6px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.migas a:hover { color: var(--brand); }
.aviso-previsualizacion, .aviso-borrador { margin: 0 0 12px; padding: 10px 12px; font-size: 13px; font-weight: 500; color: var(--warn); background: var(--warn-soft); border: 1px solid rgba(178, 106, 0, .3); border-radius: 8px; }

/* Bloques en su orden (sección 5). En escritorio, los bloques cortos contiguos van en parejas
   sin alterar el orden de lectura: izquierda → derecha, arriba → abajo. */
.ficha { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.ficha > * { min-width: 0; }
@media (min-width: 980px) {
  .ficha { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ficha > * { grid-column: 1 / -1; }
  .ficha > .ficha__descripcion:has(+ .ficha__datos), .ficha > .ficha__descripcion + .ficha__datos,
  .ficha > .ficha__financiacion:has(+ .ficha__calendario), .ficha > .ficha__financiacion + .ficha__calendario,
  .ficha > .ficha__documentos:has(+ .ficha__pie), .ficha > .ficha__documentos + .ficha__pie { grid-column: auto; }
  .ficha > .ficha__documentos + .ficha__pie { flex-direction: column; align-items: flex-start; justify-content: center; }
  .ficha > .ficha__documentos + .ficha__pie .ficha__actualizado { margin-left: 0 !important; }
}

/* Cabecera: degradado granate con brillo decorativo */
.ficha__cabecera {
  position: relative; overflow: hidden; padding: 18px 20px 20px; color: #fff; border-radius: 12px; box-shadow: var(--shadow-md);
  background:
    radial-gradient(420px 200px at 100% 0%, rgba(255, 255, 255, .10), transparent 60%),
    linear-gradient(180deg, #900000 0%, #6a0000 100%);
}
.ficha__cabecera:has(.ficha__portada) { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0 24px; align-items: center; }
.ficha__portada { grid-column: 2; grid-row: 1 / span 6; width: 100%; height: 100%; min-height: 240px; max-height: 320px; object-fit: cover; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .18); }
.ficha__portada--mapa { margin: 0; background: #ebe8e6; overflow: hidden; }
.ficha__cabecera > :not(.ficha__portada) { grid-column: 1; }
.ficha__etiquetas { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.ficha__etiquetas .tipo, .ficha__etiquetas .estado {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; color: #fff;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .18); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.ficha__etiquetas .estado--finalizado::before { box-shadow: 0 0 0 1.5px #7d0000, 0 0 0 3px #fff; }
.tipo__simbolo { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--color-tipo); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .85); }
.ficha__titulo { margin: 0 0 6px; font-size: clamp(22px, 1.1rem + 1.2vw, 30px); line-height: 1.15; font-weight: 700; letter-spacing: -.015em; color: #fff; }
.ficha__importe { margin: 0 0 14px; font-family: var(--mono); font-size: clamp(22px, 1.1rem + .8vw, 28px); font-weight: 600; letter-spacing: -.02em; color: #fff; font-feature-settings: "tnum"; }
.ficha__cabecera > :last-child { margin-bottom: 0; }
.ficha__claves { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.clave { flex: 1 1 9rem; padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); }
.clave dt { font-size: 9.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: rgba(255, 255, 255, .8); }
.clave dd { margin: 3px 0 0; font-size: 13px; font-weight: 600; color: #fff; font-feature-settings: "tnum"; }
.clave--avance dd { display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: 15px; }
.clave--avance .avance__barra, .clave--avance .avance__barra::-webkit-progress-bar { background: rgba(255, 255, 255, .22); height: 6px; }
.clave--avance .avance__barra::-webkit-progress-value { background: #fff; }
.clave--avance .avance__barra::-moz-progress-bar { background: #fff; }

.ficha__bloque { padding: 16px 18px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
.ficha__bloque h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-3); }
.ficha__bloque h2::before { content: ""; width: 3px; height: 11px; border-radius: 2px; background: var(--brand); }
.ficha__bloque p { max-width: 72ch; margin: 0 0 8px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0 20px; margin: 0; }
.dato { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dato dt { font-size: 12.5px; color: var(--ink-3); }
.dato dd { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--ink); text-align: right; }
.dato--importe dd { white-space: nowrap; }
.dato--importe dd { font-family: var(--mono); font-size: 12.5px; font-feature-settings: "tnum"; }
.tabla-financiacion { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tabla-financiacion th, .tabla-financiacion td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.tabla-financiacion thead th, .grafico__tabla thead th { font-family: var(--font); }
.tabla-financiacion thead th { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.tabla-financiacion tbody th { font-weight: 500; color: var(--ink); }
.tabla-financiacion tbody tr:last-child > * { border-bottom: 0; }
.tabla-financiacion .numero { white-space: nowrap; font-weight: 600; color: var(--ink); }
.tabla-financiacion.sin-importe th:nth-child(2), .tabla-financiacion.sin-importe td:nth-child(2),
.tabla-financiacion.sin-porcentaje th:nth-child(3), .tabla-financiacion.sin-porcentaje td:nth-child(3) { display: none; }
.barra-financiacion { display: block; width: 100%; height: 10px; margin: 0 0 8px; border-radius: 999px; overflow: hidden; }
.muestra-fuente { display: none; width: 10px; height: 10px; margin-right: 8px; border-radius: 3px; vertical-align: -1px; }
.barra-financiacion + .tabla-financiacion .muestra-fuente { display: inline-block; }
.muestra-fuente--0 { background: #b3261e; } .muestra-fuente--1 { background: #c98a2e; } .muestra-fuente--2 { background: #3b6fb6; }
.muestra-fuente--3 { background: #4e9a4b; } .muestra-fuente--4 { background: #8a5fb0; } .muestra-fuente--otras { background: #6f6765; }

.linea-tiempo { position: relative; margin: 0 0 12px; }
.linea-tiempo__fila { display: grid; grid-template-columns: 5rem minmax(0, 1fr); align-items: center; gap: 8px; min-height: 22px; }
.linea-tiempo__etiqueta { font-size: 12px; color: var(--ink-3); }
.linea-tiempo__pista { width: 100%; height: 10px; border-radius: 999px; background: var(--panel-3); }
.linea-tiempo__tramo--previsto { fill: var(--brand-soft); stroke: var(--brand); stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.linea-tiempo__tramo--real { fill: var(--brand); }
.linea-tiempo__tramo--en-curso { opacity: .7; }
.linea-tiempo__hoy { position: absolute; left: calc(5rem + 8px); top: 0; width: calc(100% - 5rem - 8px); height: calc(100% - 20px); pointer-events: none; }
.linea-tiempo__hoy line { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; }
.linea-tiempo__escala { display: flex; justify-content: space-between; margin: 4px 0 0 calc(5rem + 8px); font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.linea-tiempo__clave-hoy { font-family: var(--font); }
.linea-tiempo__clave-hoy::before { content: ""; display: inline-block; height: 10px; margin-right: 4px; border-left: 1.5px dashed var(--ink); vertical-align: -1px; }

.ficha__mapa { height: clamp(280px, 40vw, 420px); margin-bottom: 10px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.ficha__elementos { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); }
.galeria { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 10px; }
.galeria__foto { margin: 0; }
.galeria__enlace { display: block; overflow: hidden; border-radius: 8px; border: 1px solid var(--line); }
.galeria__enlace img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .4s ease-out; }
.galeria__enlace:hover img { transform: scale(1.03); }
.galeria figcaption { margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.documentos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.documento { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 8px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); text-decoration: none; transition: background var(--t); }
.documento:hover { background: var(--panel-3); color: var(--ink); }
.documento__titulo { font-size: 13px; font-weight: 500; }
.documento__meta { flex: none; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--brand-soft); border: 1px solid var(--brand-ring); font: 600 10.5px/18px var(--mono); color: var(--brand-2); }
.ficha__pie { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
.ficha__pie p { margin: 0; }
.ficha__actualizado { margin-left: auto !important; font-size: 12px; color: var(--ink-3); }
.ficha__actualizado time { font-family: var(--mono); }
.enlace-externo { display: inline-flex; align-items: center; min-height: 36px; font-size: 13px; font-weight: 600; }
.enlace-externo::after { content: " ↗"; }

.visor { max-width: min(96vw, 1300px); width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #161314; color: #fff; box-shadow: var(--shadow-modal); }
.visor::backdrop { background: rgba(20, 12, 12, .8); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.visor__imagen { display: block; margin: 0 auto; max-height: 78vh; width: auto; border-radius: 8px; }
.visor__pie { margin: 10px 0; text-align: center; font-size: 13px; }
.visor__controles { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }

.portal--texto main { max-width: 760px; }
.texto-legal { font-size: 14px; }
.texto-legal h1 { margin: 16px 0 12px; font-size: 22px; line-height: 1.15; letter-spacing: -.02em; }
.texto-legal h2 { margin-top: 24px; font-size: 15px; }
.texto-legal p { line-height: 1.65; }
.pie { padding: 20px 16px 28px; text-align: center; font-size: 12px; color: var(--ink-3); }

@media (max-width: 760px) {
  .ficha__cabecera:has(.ficha__portada) { grid-template-columns: 1fr; }
  .ficha__portada { grid-column: 1; grid-row: auto; order: -1; min-height: 0; max-height: 220px; aspect-ratio: 3 / 2; margin-bottom: 14px; }
  .ficha__portada--mapa { height: 220px; }
  .ficha__actualizado { margin-left: 0 !important; }
  .migas a, .enlace-externo { min-height: 44px; }
}
