@font-face {
  font-family: "Korolev";
  src: url("fonts/Korolev_Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  /* La fuente declara un ascendente de 750 y sus tildes de mayúscula llegan a 938:
     sin esto Chrome las recorta dentro de los campos de texto. No modifica el archivo. */
  ascent-override: 98%;
  descent-override: 25%;
  line-gap-override: 0%;
}
/* Medium para el texto corrido (Juan, 11/11/2026: «cuando hay mucho texto me cuesta leerlo»); títulos, nombres y botones siguen en Bold */
@font-face {
  font-family: "Korolev";
  src: url("fonts/Korolev_Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  /* La fuente declara un ascendente de 750 y sus tildes de mayúscula llegan a 938:
     sin esto Chrome las recorta dentro de los campos de texto. No modifica el archivo. */
  ascent-override: 98%;
  descent-override: 25%;
  line-gap-override: 0%;
}

:root {
  --primary: #4F80BF;
  --navy: #2C4766;
  --light: #E0EAF4;
  --white: #FFFFFF;
  --space: #0E1A2A;
  --logo: 200px;
  --top: 0px;
  --bottom: 0px;
  --radius: 14px;
  --shadow: 0 6px 22px rgba(20, 35, 55, .22);
  --ease: cubic-bezier(.2, .7, .2, 1);
  /* tema: hoja = tarjetas, menú y diálogos; tinta = texto; linea = bordes y fondos suaves; flota = paneles sobre el mapa */
  --hoja: #FFFFFF;
  --tinta: #2C4766;
  --linea: #E0EAF4;
  --flota: rgba(255, 255, 255, .96);
  --gris2: #6B7F99;
  --apagado: #C9D4E2;
  --icono: url(#grad);
}
/* Modo oscuro (menú TEMA): solo la interfaz; el mapa, las capas y los colores de los avisos no cambian */
:root[data-tema="oscuro"] {
  color-scheme: dark;
  --hoja: #111A26;
  --tinta: #CFDAE7;
  --linea: #22324A;
  --flota: rgba(17, 26, 38, .96);
  --gris2: #8FA3BC;
  --apagado: #3A4D66;
  --icono: #7FA6D6;
  --shadow: 0 6px 22px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; height: 100%; overflow: hidden;
  font-family: "Korolev", sans-serif; font-weight: 700;
  color: var(--tinta);
  background: radial-gradient(circle at 50% 46%, #2C4766 0%, #18283C 48%, var(--space) 100%);
  user-select: none; -webkit-user-select: none;
}

button, input { font: inherit; color: inherit; }

/* Fondo de estrellas y mapa */
#stars, #map { position: fixed; inset: 0; width: 100%; height: 100%; }
#map { background: transparent; }

/* Logo circular de la intro: centrado, mismo tamaño que en la capa nativa */
#introLogo {
  position: fixed; left: 50%; top: 50%;
  width: var(--logo); height: var(--logo);
  margin: calc(var(--logo) / -2) 0 0 calc(var(--logo) / -2);
  border-radius: 50%; overflow: hidden;
  z-index: 20; pointer-events: none; will-change: transform, opacity;
  /* crece con el globo mientras la cámara se acerca y se funde en él (seguirGlobo en app.js; Juan, 01/11/2026) */
}
#introLogo img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* cubierto de agua, igual que el logo de la pantalla de carga que tiene encima cuando acaba (el agua rebosa y la ola sale
   por arriba): quieto, sin ola, para fundirse con el globo (Juan, 01/11/2026) */
.intro-agua { position: absolute; inset: 0; background: rgba(79, 128, 191, .62); transition: opacity .9s ease; }
/* al empezar el vuelo el agua se va y el logo, con sus colores, es el que se funde con el globo (Juan, 01/11/2026) */
#introLogo.limpio .intro-agua { opacity: 0; }
#introLogo.gone { display: none; }

#blocker { position: fixed; inset: 0; z-index: 19; }
#blocker.gone { display: none; }

/* Interfaz: oculta hasta terminar la intro */
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; opacity: 0; transition: opacity .6s ease; }
#ui.visible { opacity: 1; }
#ui.visible > * { pointer-events: auto; }
#ui.visible > #scrim:not(.on), #ui.visible > #dialog:not(.on) { pointer-events: none; }

/* Iconografía: trazo lineal con degradado y punto */
svg { width: 24px; height: 24px; fill: none; stroke: var(--icono); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg .dot { fill: var(--primary); stroke: none; }
.light svg { stroke: var(--white); }

.icon-btn {
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent;
  display: grid; place-items: center; flex: none; padding: 0;
}
.icon-btn.small { width: 34px; height: 34px; }
.icon-btn.small svg { width: 18px; height: 18px; }

/* Barra superior */
#topbar {
  position: absolute; left: 12px; right: 12px; top: calc(var(--top) + 10px);
  display: flex; align-items: center; gap: 6px;
  background: var(--hoja); border-radius: 26px; padding: 4px 4px;
  box-shadow: var(--shadow);
}
#searchBox { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; padding-left: 4px; }
#searchBox > svg { width: 20px; height: 20px; flex: none; }
#search {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 14px; letter-spacing: .02em; color: var(--tinta);
  height: 40px; line-height: 40px; padding: 0;
}
#search::placeholder { color: #8FA3BC; }
#search::-webkit-search-cancel-button { display: none; }
#btnClear { visibility: hidden; }
#searchBox.has-text #btnClear { visibility: visible; }

#results {
  position: absolute; left: 12px; right: 12px; top: calc(var(--top) + 68px);
  margin: 0; padding: 6px 0; list-style: none; background: var(--hoja);
  border-radius: var(--radius); box-shadow: var(--shadow);
  max-height: 60%; overflow-y: auto; display: none; z-index: 3;
}
#results.on { display: block; }
#results li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
#results li + li { border-top: 1px solid var(--linea); }
#results li:active { background: var(--linea); }
#results img { width: 30px; height: 30px; flex: none; }
#results .r-main { font-size: 15px; color: var(--tinta); }
#results .r-sub { font-size: 12px; color: var(--primary); margin-top: 2px; }
#results .empty { color: #8FA3BC; justify-content: center; }

/* Sin conexión (10/11/2026): bajo la barra de arriba; los filtros bajan para dejarle sitio */
.sin-conexion {
  position: absolute; left: 50%; transform: translateX(-50%); top: calc(var(--top) + 64px); z-index: 3;
  display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; border-radius: 18px;
  background: #8A2F2F; color: #FFFFFF; box-shadow: var(--shadow); white-space: nowrap; max-width: calc(100% - 24px);
}
.sin-conexion[hidden] { display: none; }
.sin-conexion svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sin-conexion svg circle { fill: currentColor; stroke: none; }
.sin-conexion b { font-size: 13px; letter-spacing: .06em; }
#ui.sin-red #chips { top: calc(var(--top) + 104px); }
#ui.sin-red #results { top: calc(var(--top) + 104px); }

/* Selector de tipo de estación */
#chips {
  position: absolute; left: 0; right: 0; top: calc(var(--top) + 66px);
  display: flex; gap: 8px; padding: 2px 12px 8px; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; z-index: 2;
}
#chips::-webkit-scrollbar { display: none; }
/* degradado a la derecha mientras quedan filtros por ver deslizando (Juan, 08/11/2026: «MANANTIAL» se cortaba) */
#chips.mas { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); }
.chip {
  flex: none; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 6px;
  border: 0; border-radius: 18px; background: var(--hoja); color: var(--tinta);
  font-size: 13px; letter-spacing: .06em; box-shadow: 0 3px 10px rgba(20, 35, 55, .22); white-space: nowrap;
}
.chip.todas { padding: 0 16px; }
.chip img { width: 26px; height: 26px; }
.chip.on { background: var(--primary); color: var(--white); }
.chip:active { transform: scale(.96); }

/* Marca de agua: barra institucional, sin recomponer ni deformar */
#marca {
  position: absolute; left: 50%; bottom: calc(var(--bottom) + 12px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; opacity: .92;
  pointer-events: none !important; transition: opacity .3s;
}
/* el emblema oficial va solo; los logos del Guadiana y del centenario, aparte */
#marca img { display: block; height: 34px; border-radius: 3px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
#marca .marca-barra { height: auto; width: min(46vw, 196px); }
#marca .marca-logo { background: #FFFFFF; padding: 3px 4px; box-sizing: border-box; }
body.sheet-open #marca { opacity: 0 !important; }

/* Botones flotantes */
#fabs { position: absolute; right: 14px; bottom: calc(var(--bottom) + 58px); display: flex; flex-direction: column; gap: 12px; transition: transform .35s var(--ease); }
body.sheet-open #fabs { transform: translateY(40px); opacity: 0; pointer-events: none; }
.fab {
  width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--hoja);
  box-shadow: var(--shadow); display: grid; place-items: center;
}
.fab:active, .icon-btn:active { transform: scale(.94); }

/* Hojas inferiores (ficha y capas) */
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--hoja); border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 30px rgba(20, 35, 55, .25);
  padding-bottom: calc(var(--bottom) + 16px);
  transform: translateY(105%); transition: transform .38s var(--ease);
  max-height: calc(100% - var(--top) - 70px); overflow-y: auto; z-index: 4;
}
.sheet.on { transform: translateY(0); }

.card-head {
  display: flex; align-items: center; gap: 12px;
  background: var(--primary); color: var(--white);
  border-radius: 22px 22px 0 0; padding: 16px 10px 16px 16px;
}
#cardIcon { width: 44px; height: 44px; flex: none; background: var(--hoja); border-radius: 50%; padding: 2px; }
.card-titles { flex: 1; min-width: 0; }
.card-titles h2 { margin: 2px 0 0; font-size: 20px; line-height: 1.15; }
.label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.card-code {
  margin: 14px 16px 4px; display: inline-block; font-size: 13px; letter-spacing: .08em;
  color: var(--tinta); background: var(--linea); border-radius: 8px; padding: 5px 10px;
}
#cardFields, #consultaFields { margin: 6px 16px 0; display: grid; grid-template-columns: auto 1fr; column-gap: 16px; row-gap: 9px; font-size: 15px; }
#cardFields dt, #consultaFields dt { color: var(--primary); font-size: 12px; letter-spacing: .08em; padding-top: 2px; }
#cardFields dd, #consultaFields dd { margin: 0; color: var(--tinta); }
#cardFields dd.gmao a { display: block; color: var(--primary); text-decoration: underline; word-break: break-all; font-size: 14px; }
#cardFields dd.gmao a + a, #cardFields dd.gmao .sonda + a { margin-top: 4px; }
#cardFields dd.gmao .sonda { display: block; }
/* Apartados largos de la ficha (notas de capas propias, limpieza de cauces, trabajos de la semana, administrador): a todo
   el ancho, con el título encima; en dos columnas un botón sin título descolocaba la rejilla (Juan, 30/10/2026) */
#cardFields dt.bloque, #cardFields dt.propia-t, #cardFields dd.bloque, #cardFields dd.propia { grid-column: 1 / -1; }
#cardFields dt.bloque, #cardFields dt.propia-t { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--linea); }
#cardFields dd.bloque, #cardFields dd.propia { margin-top: -4px; }
#cardFields dd.propia + dd.propia { margin-top: 2px; }
.card-actions { display: flex; gap: 10px; margin: 18px 16px 0; }
.btn {
  flex: 1; height: 46px; border-radius: 23px; border: 2px solid var(--primary);
  background: var(--hoja); color: var(--primary); font-size: 14px; letter-spacing: .08em;
}
.btn.primary { background: var(--primary); color: var(--white); }
.btn:active { filter: brightness(.94); }

.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 6px 18px; }
/* la cabecera (con el botón de cerrar) se queda arriba aunque se baje por la lista */
#layers .sheet-head, #consulta .sheet-head { position: sticky; top: 0; z-index: 2; background: var(--hoja); border-radius: 22px 22px 0 0; }
.sheet-head h2 { margin: 0; font-size: 18px; letter-spacing: .12em; color: var(--tinta); }

.segmented { display: flex; margin: 6px 16px 10px; background: var(--linea); border-radius: 22px; padding: 4px; }
.segmented button { flex: 1; border: 0; background: transparent; height: 38px; border-radius: 19px; font-size: 13px; letter-spacing: .08em; color: var(--tinta); }
.segmented button.on { background: var(--primary); color: var(--white); }

#layerList, #infoList { list-style: none; margin: 0; padding: 0 8px; }
#layerList li, #infoList li, #propiasList li, #avisosList li { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; }
#layerList li:active, #infoList li:active, #propiasList li:active, #avisosList li:active { background: var(--linea); }
#layerList img, #infoList img, #propiasList img, #avisosList img { width: 34px; height: 34px; flex: none; transition: filter .2s, opacity .2s; }
#layerList .l-name, #infoList .l-name, #propiasList .l-name, #avisosList .l-name { flex: 1; font-size: 15px; color: var(--tinta); }
#layerList .l-count, #infoList .l-count, #propiasList .l-count, #avisosList .l-count { font-size: 12px; color: var(--primary); min-width: 28px; text-align: right; }
#layerList li.off img, #infoList li.off img { filter: grayscale(1); opacity: .45; }
#layerList li.off .l-name, #infoList li.off .l-name, #propiasList li.off .l-name, #avisosList li.off .l-name { color: #8FA3BC; }
.swatch { width: 34px; height: 34px; flex: none; border-radius: 8px; background: rgba(79, 128, 191, .3); border: 2px solid var(--tinta); }
.toggle { width: 44px; height: 26px; border-radius: 13px; background: var(--primary); position: relative; flex: none; transition: background .2s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 21px; width: 20px; height: 20px; border-radius: 50%; background: var(--hoja); transition: left .2s var(--ease); }
li.off .toggle { background: var(--apagado); }
li.off .toggle::after { left: 3px; }

/* Perfil «usuario»: sin nada de las estaciones (ni búsqueda, ni filtros, ni su apartado en capas) */
body.sin-estaciones #searchBox > svg { display: none; }
body.sin-estaciones #search { pointer-events: none; padding-left: 14px; }
body.sin-estaciones #chips, body.sin-estaciones #results, body.sin-estaciones .sub-fila.est,
body.sin-estaciones .opacidad.est, body.sin-estaciones #layerList li:not([data-capa="DEMARCACION"]) { display: none !important; }

/* Estaciones: ocultar todas y opacidad */
.sub-fila { display: flex; align-items: center; justify-content: space-between; margin: 4px 16px 0 0; }
.sub-fila .sheet-sub { margin-top: 10px; }
.btn-mini { border: 2px solid var(--primary); background: var(--hoja); color: var(--primary); height: 32px; padding: 0 14px; border-radius: 16px; font-size: 12px; letter-spacing: .08em; }
.btn-mini.off { background: var(--primary); color: var(--white); }
.opacidad.est { width: auto; margin: 6px 26px 4px 18px; }
#layerList.fijas li:not([data-capa="DEMARCACION"]), #chips.fijas, #btnTodasEst:disabled { pointer-events: none; opacity: .55; }
.nota-est { margin: 2px 18px 6px; font-size: 12px; line-height: 1.35; color: var(--tinta); }

/* Capas de información */
.sheet-sub { margin: 16px 18px 4px; font-size: 12px; letter-spacing: .12em; color: var(--primary); font-weight: normal; }
#infoList .l-name small, #propiasList .l-name small, #avisosList .l-name small { display: block; font-size: 11px; letter-spacing: .04em; color: #8FA3BC; margin-top: 2px; }
#infoList .swatch, #propiasList .swatch, #avisosList .swatch { opacity: .85; }
#infoList li.off .swatch, #propiasList li.off .swatch, #avisosList li.off .swatch { filter: grayscale(1); opacity: .35; }
#infoList li.info-extra, #propiasList li.info-extra, #avisosList li.info-extra { display: none; flex-wrap: wrap; gap: 8px; padding: 0 10px 10px 56px; }
#infoList li.info-extra.on, #propiasList li.info-extra.on, #avisosList li.info-extra.on { display: flex; }
#infoList li.info-extra:active, #propiasList li.info-extra:active, #avisosList li.info-extra:active { background: none; }
.segmented.mini { margin: 0; width: 100%; padding: 3px; }
/* cuatro fondos (11/11/2026): letra algo menor para que quepan en el móvil */
.segmented.cuatro button { font-size: 11px; letter-spacing: .02em; padding: 0 2px; }
.vuelo-fila { display: none; margin: -2px 16px 10px; }
.vuelo-fila.on { display: block; }
.vuelo-fila label { display: flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .08em; color: var(--tinta); }
.vuelo-fila select { flex: 1; min-width: 0; height: 36px; border-radius: 10px; border: 1px solid var(--linea); background: var(--hoja); color: var(--tinta); font: inherit; font-size: 14px; letter-spacing: 0; padding: 0 8px; }
.vuelo-fila p { margin: 6px 0 0; font-size: 12px; color: var(--gris2); }
.segmented.mini button { height: 30px; font-size: 11px; }
.opacidad { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 11px; letter-spacing: .08em; color: var(--primary); }
.opacidad input { flex: 1; accent-color: var(--primary); }
.sheet-nota { display: none; margin: 6px 18px 4px; font-size: 13px; color: var(--tinta); opacity: .8; }
.sheet-nota.on { display: block; }
#consultaFields { margin-top: 8px; margin-bottom: 6px; }
.radar-ctl { display: flex; align-items: center; gap: 10px; width: 100%; }
.radar-play { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 0; background: var(--primary); position: relative; }
.radar-play::before { content: ""; position: absolute; left: 13px; top: 10px; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent var(--white); }
.radar-play.on::before { left: 11px; top: 11px; width: 4px; height: 12px; border: 0; border-left: 4px solid var(--white); border-right: 4px solid var(--white); }
.radar-hora { font-size: 13px; color: var(--tinta); }
/* Animación del radar: en el mapa, no en el panel de capas */
#radarFlota { position: absolute; left: 14px; right: 90px; bottom: calc(var(--bottom) + 92px); z-index: 3; max-width: 320px;
  display: none; align-items: center; gap: 10px; padding: 8px 14px 8px 8px;
  background: var(--flota); border-radius: 30px; box-shadow: 0 4px 16px rgba(20, 35, 55, .3); }
#radarFlota.on { display: flex; }
body.sheet-open #radarFlota { display: none; }
.radar-flota-txt { display: flex; flex-direction: column; min-width: 92px; }
.radar-flota-txt b { font-size: 10.5px; letter-spacing: .08em; color: var(--primary); font-weight: 600; }
.radar-flota-txt span { font-size: 15px; color: var(--tinta); }
.radar-barra { flex: 1; height: 4px; background: var(--linea); border-radius: 2px; overflow: hidden; }
.radar-barra i { display: block; height: 100%; width: 0; background: var(--primary); }
/* en la parte de previsión (modelo de AEMET) el rótulo y la barra cambian de color para no confundirla con el radar */
#radarFlota.prevision .radar-flota-txt b { color: #8E44AD; }
#radarFlota.prevision .radar-barra i { background: #8E44AD; }
.avisos-resumen { width: 100%; font-size: 13px; color: var(--tinta); line-height: 1.35; }
#infoList #avisosN, #avisosList #avisosN { color: #E8590C; font-weight: bold; }
#btnLayers { position: relative; }
/* número de avisos activos con un triángulo de aviso delante, para que se entienda qué cuenta (08/11/2026) */
#btnLayers[data-avisos]:not([data-avisos=""])::after {
  content: attr(data-avisos); position: absolute; top: 0; right: -4px; height: 18px; padding: 0 5px 0 17px;
  border-radius: 9px; color: var(--white); font-size: 11px; line-height: 18px; text-align: center;
  background: #E8590C url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3L1.5 21h21z' fill='%23fff'/%3E%3Cpath d='M12 9.5v5.5M12 17.2v1.3' stroke='%23E8590C' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 4px 50% / 11px 11px;
}
/* Leyenda (botón en CAPAS) */
.leyenda h4 { margin: 14px 0 6px; font-size: 12px; letter-spacing: .1em; color: var(--primary); }
.leyenda h4:first-child { margin-top: 0; }
.leyenda ul { list-style: none; margin: 0; padding: 0; }
.leyenda li { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 13px; color: var(--tinta); line-height: 1.3; }
.leyenda .punto { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.leyenda img { flex: none; width: 24px; height: 24px; }
.leyenda .zona { flex: none; width: 34px; height: 18px; border-radius: 3px; border: 2px solid; }
.leyenda .sep { flex: none; width: 24px; }
#consultaTitulo { font-size: 16px; letter-spacing: .06em; line-height: 1.25; padding-right: 8px; }
#consultaFields dd.espera { color: #8FA3BC; }
#consultaFields a.enlace { color: var(--primary); text-decoration: underline; word-break: break-all; }

/* Planificación semanal */
#infoList li.oculta, #propiasList li.oculta, #avisosList li.oculta { display: none !important; }
#planMapaDias button { font-size: 10px; padding: 0 2px; }
.plan-mapa-txt { width: 100%; font-size: 13px; color: var(--tinta); line-height: 1.35; }
#plan .sheet-head h2 small { display: block; font-size: 12px; letter-spacing: .06em; color: var(--primary); margin-top: 2px; }
.plan-dias { margin: 6px 16px 8px; width: auto; }
.plan-dias button { line-height: 1.1; }
.plan-dias button small { display: block; font-size: 10px; opacity: .75; }
.plan-filtros { display: flex; gap: 8px; margin: 0 16px 6px; }
.plan-filtros select { flex: 1; min-width: 0; height: 38px; border-radius: 12px; border: 2px solid var(--linea); background: var(--hoja); color: var(--tinta); font: inherit; font-size: 13px; padding: 0 8px; }
#planLista { list-style: none; margin: 0; padding: 0 12px 8px; }
#planLista li { padding: 10px 6px; border-bottom: 1px solid var(--linea); }
#planLista li.vacio { color: #8FA3BC; text-align: center; border: 0; padding: 24px 0; }
#planLista .p-cab { display: flex; gap: 8px; align-items: center; }
#planLista .p-tipo { font-size: 11px; letter-spacing: .04em; color: var(--white); background: var(--primary); border-radius: 6px; padding: 2px 6px; }
#planLista .p-tipo.incidencia { background: #E03131; }
#planLista .p-est { font-size: 14px; color: var(--tinta); flex: 1; min-width: 0; }
#planLista .p-est.ir { text-decoration: underline; cursor: pointer; }
#planLista .p-asunto { font-size: 13px; color: var(--tinta); margin-top: 4px; }
#planLista .p-pie { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--gris2); margin-top: 3px; }
#planLista .p-pie a { color: var(--primary); }
#cardFields dd.plan div + div { margin-top: 6px; }
#cardFields dd.plan a { color: var(--primary); }

/* Menú lateral */
#appVersion { font-size: 12px; color: #8FA3BC; margin-top: 4px; letter-spacing: .04em; }
.version-nueva { border: 0; background: #E8590C; color: var(--white); font: inherit; font-size: 11px; letter-spacing: .06em; border-radius: 10px; padding: 2px 8px; margin-left: 6px; cursor: pointer; }
.novedades { margin: 4px 0 10px; padding-left: 20px; }
.novedades li { margin: 3px 0; }
/* Más información (menú): manual de uso, capas y fuentes y créditos */
.mas-info li { cursor: pointer; }
.mi-flecha { width: 9px; height: 9px; margin-right: 8px; flex: none; border-right: 2.5px solid var(--primary); border-bottom: 2.5px solid var(--primary); transform: rotate(-45deg); }

/* Manual de uso (dentro de Más información): apartados desplegables con sus capturas */
#manualCuerpo .man-fecha { color: var(--primary); font-size: 12px; letter-spacing: .06em; }
#manualCuerpo p { margin: 8px 0; }
#manualCuerpo ul, #manualCuerpo ol { margin: 8px 0; padding-left: 20px; }
#manualCuerpo li { margin: 4px 0; }
#manualCuerpo a { color: var(--primary); }
#manualCuerpo details { border-bottom: 1px solid var(--linea); }
#manualCuerpo summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 14px 2px; font-size: 14px; letter-spacing: .1em; cursor: pointer; }
#manualCuerpo summary::-webkit-details-marker { display: none; }
#manualCuerpo summary::after { content: ""; width: 8px; height: 8px; margin-right: 6px; border-right: 2px solid var(--primary); border-bottom: 2px solid var(--primary); transform: rotate(45deg); transition: transform .2s; }
#manualCuerpo details[open] summary::after { transform: rotate(-135deg); }
#manualCuerpo details > div { padding-bottom: 12px; }
#manualCuerpo figure { margin: 12px 0; text-align: center; }
#manualCuerpo figure img { width: 100%; height: auto; border-radius: 8px; }
#manualCuerpo figcaption { font-size: 12px; color: var(--gris2); margin-top: 4px; }
.man-fila { padding: 8px 0; border-top: 1px solid var(--linea); }
.man-fila b { display: block; }
.man-pdf { margin-top: 16px; width: 100%; }
#drawer {
  position: absolute; top: 0; bottom: 0; left: 0; width: min(82vw, 320px);
  background: var(--hoja); box-shadow: 8px 0 30px rgba(20, 35, 55, .3);
  transform: translateX(-105%); transition: transform .38s var(--ease); z-index: 6;
  display: flex; flex-direction: column; padding-bottom: calc(var(--bottom) + 14px);
  overflow-y: auto;
}
#drawer.on { transform: translateX(0); }
.drawer-top { padding: calc(var(--top) + 18px) 22px 14px; background: linear-gradient(180deg, var(--linea), var(--hoja)); }
/* Menú compacto (Juan, 25/10/2026): al abrirlo se ve entero, banner incluido */
.drawer-cab { margin-bottom: 14px; }
.drawer-logo { width: 120px; display: block; margin-bottom: 20px; }
.drawer-logo-btn { border: 0; background: none; padding: 0; cursor: pointer; display: block; }
.drawer-top .label { color: var(--primary); opacity: 1; }
#userEmail { font-size: 14px; margin-top: 2px; word-break: break-all; }
.badge { display: none; margin-top: 10px; font-size: 11px; letter-spacing: .1em; color: var(--navy); background: #F7D118; border-radius: 6px; padding: 4px 8px; width: max-content; }
.badge.on { display: block; }
#drawer nav { padding: 2px 0; }
.drawer-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 12px 22px; font-size: 14px; letter-spacing: .06em; color: var(--tinta); }
.drawer-item:active { background: var(--linea); }
.drawer-item.admin { display: none; color: var(--primary); }
.drawer-item.admin.on { display: block; }
.drawer-barra { width: calc(100% - 28px); margin: 0 14px; display: block; }
.drawer-barra-btn { border: 0; background: none; padding: 0; margin-top: auto; flex: none; }
.drawer-nombre { font-size: 12.5px; line-height: 1.35; color: var(--tinta); max-width: 250px; }
.drawer-enlaces { padding: 2px 22px 8px; border-top: 1px solid var(--linea); }
.drawer-enlaces .label { color: var(--primary); margin: 8px 0 2px; }
#enlaces { list-style: none; margin: 0; padding: 0; }
#enlaces a, .enlaces-mas { display: flex; align-items: center; gap: 12px; padding: 4px 0; color: var(--tinta); text-decoration: none; }
#enlaces .ic { width: 34px; height: 34px; flex: none; border: 1.6px solid var(--primary); border-radius: 50%; display: grid; place-items: center; }
#enlaces .ic svg { width: 21px; height: 21px; fill: none; stroke: var(--primary); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#enlaces .ic img { height: 24px; display: block; }
#enlaces .t { font-size: 14px; line-height: 1.2; }
#enlaces small { display: block; font-size: 11.5px; color: var(--primary); margin-top: 2px; }

/* Orden de apilado: chips 2 < resultados 3 < hojas 4 < velo 5 < menú 6 < diálogo 7 */
#scrim { position: absolute; inset: 0; background: rgba(14, 26, 42, .45); opacity: 0; transition: opacity .3s; z-index: 5; }
#scrim.on { opacity: 1; }

#dialog { position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; background: rgba(14, 26, 42, .5); opacity: 0; transition: opacity .25s; padding: 24px; }
#dialog.on { opacity: 1; }
/* título con la X fijo arriba y botones fijos abajo: solo se desplaza el texto (Juan, 11/11/2026: «hay que desplazarse hasta el final para encontrar cerrar») */
.dialog-box { background: var(--hoja); border-radius: 18px; padding: 22px 20px 16px; width: 100%; max-width: 380px; max-height: 85%; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden; }
.dialog-head { display: flex; align-items: flex-start; gap: 6px; margin: 0 0 12px; flex: none; }
.dialog-head h2 { flex: 1; min-width: 0; }
#dialogClose { margin: -7px -8px 0 0; }
#dialogBody { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.dialog-actions { flex: none; }
.dialog-box h2 { margin: 0; font-size: 18px; letter-spacing: .1em; color: var(--tinta); }
.dialog-box h2 .notif-ajustes { float: right; margin: -8px -8px 0 8px; }
#dialogBody { font-size: 14px; line-height: 1.45; color: var(--tinta); }
#dialogBody p { margin: 0 0 10px; }
#dialogBody .src { color: var(--primary); font-size: 12px; letter-spacing: .08em; margin-top: 12px; }
#dialogBody .creditos p { margin: 0 0 4px; }
#dialogBody .fuente b { color: var(--primary); font-weight: normal; }
.notif-lista { list-style: none; margin: 4px 0 12px; padding: 0; }
.ultimas-nota { font-size: 12.5px; color: var(--primary); }
.ultimas { list-style: none; margin: 0 0 6px; padding: 0; }
.ultimas li { padding: 9px 2px; border-bottom: 1px solid var(--linea); cursor: pointer; }
.ultimas .u-hora { font-size: 11.5px; letter-spacing: .06em; color: var(--primary); }
.ultimas .u-tit { font-size: 14px; color: var(--tinta); line-height: 1.3; margin-top: 1px; }
.ultimas .u-txt { font-size: 12.5px; color: var(--tinta); opacity: .8; white-space: pre-line; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ultimas li.abierta .u-txt { display: block; -webkit-line-clamp: unset; }
.notif-lista li { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--linea); }
.notif-lista li .l-name { flex: 1; font-size: 14px; color: var(--tinta); }
.notif-lista li.off .l-name { color: #8FA3BC; }
.notif-permiso { color: #B5530B; }
#notifPermiso { width: 100%; margin-bottom: 12px; }
.notif-estado { font-size: 12px; color: var(--gris2); line-height: 1.45; }
#notifProbar { width: 100%; margin-top: 4px; }
#dialogBody .creditos .nombre { font-size: 17px; margin-bottom: 8px; }
#dialogBody .creditos a { color: var(--primary); text-decoration: none; }
#dialogBody .creditos .ddstacks { display: block; border: 0; background: none; padding: 14px 0 2px; cursor: pointer; }
#dialogBody .creditos .ddstacks img { height: 34px; width: auto; }
.dialog-actions { display: flex; gap: 10px; margin-top: 16px; }

/* Controles de MapLibre */
.maplibregl-ctrl-bottom-left { bottom: calc(var(--bottom) + 4px); }
.maplibregl-ctrl-attrib { font-family: "Korolev", sans-serif; font-size: 10px; }
.maplibregl-ctrl-attrib.maplibregl-compact { background: rgba(255, 255, 255, .85); }
.maplibregl-ctrl-scale { border-color: var(--navy); color: var(--navy); font-family: "Korolev", sans-serif; background: rgba(255, 255, 255, .8); }

/* Capas propias */
#propiasList, #avisosList { list-style: none; margin: 0; padding: 0; }
dd.propia .nota { white-space: pre-wrap; }
dd.propia .nota.vacia { color: #8FA3BC; }
dd.propia small { display: block; font-size: 11px; color: #8FA3BC; margin-top: 2px; }
.propia-acc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.campo { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; color: var(--tinta); border: 1.5px solid var(--linea); border-radius: 10px; padding: 9px 10px; margin: 4px 0 10px; background: var(--hoja); }
textarea.campo { resize: vertical; }
/* contraseña para borrar la cuenta (0.5.0) */
.clave-borrar { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; color: var(--tinta); border: 1.5px solid var(--linea); border-radius: 10px; padding: 9px 10px; margin: 4px 0 6px; background: var(--hoja); }
.clave-error { color: #D64545; font-size: 13px; }
.gp-lista, .gp-est { list-style: none; margin: 0; padding: 0; }
.gp-lista li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linea); }
.gp-txt { flex: 1; }
.gp-txt small { display: block; font-size: 12px; color: #8FA3BC; }
.gp-menu { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 6px; }
.gp-colores { display: flex; gap: 10px; margin: 4px 0 12px; }
.gp-colores input { display: none; }
.gp-colores span { display: block; width: 30px; height: 30px; border-radius: 50%; border: 3px solid transparent; box-sizing: border-box; }
.gp-colores input:checked + span { border-color: var(--tinta); }
.gp-est li { padding: 9px 0; border-bottom: 1px solid var(--linea); cursor: pointer; }
.gp-est small { display: block; font-size: 12px; color: var(--gris2); white-space: pre-wrap; }
.propias-elegir label { display: block; padding: 8px 0; }
/* Limpieza de cauces */
.lc-estado { display: inline-block; color: #fff; font-size: 11px; letter-spacing: .06em; padding: 2px 8px; border-radius: 10px; margin-right: 4px; }
dd.limpieza .lc + .lc { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--linea); }
dd.limpieza .lc > div + div { margin-top: 3px; }
.lc-hist small { display: block; font-size: 11px; color: #8FA3BC; }
dd.limpieza a { color: var(--primary); }
.lc-hist { margin-top: 6px; font-size: 13px; }
.lc-hist summary { color: var(--primary); cursor: pointer; }
.lc-hist div { margin-top: 4px; white-space: pre-wrap; }
.lc-grupo { margin: 14px 0 2px; font-size: 13px; letter-spacing: .06em; }
.lc-fechas { display: flex; gap: 10px; }
.lc-fechas > div { flex: 1; min-width: 0; }
#limpiezaTxt .btn-mini { margin-left: 6px; height: 26px; padding: 0 10px; }

/* Buscar coordenadas o catastro */
#buscar details.bus { border: 1.5px solid var(--linea); border-radius: 14px; padding: 4px 14px 12px; margin-bottom: 12px; }
#buscar summary { font-size: 14px; letter-spacing: .08em; color: var(--tinta); padding: 10px 0; cursor: pointer; }
#buscar .src { display: block; margin-top: 4px; }
#buscar .bus-fila { display: flex; gap: 10px; }
#buscar .bus-fila label { flex: 1; min-width: 0; }
#buscar .segmented { margin: 4px 0 10px; }
#buscar .btn { width: 100%; margin-top: 4px; }
#buscar .sheet-nota:empty { display: none; }

.gp-filtros { display: flex; gap: 8px; }
.gp-filtros input { flex: 1.4; min-width: 0; }
.gp-filtros select { flex: 1; min-width: 0; }
.gp-elegir { list-style: none; margin: 8px 0 6px; padding: 0; max-height: 38vh; overflow-y: auto; border: 1.5px solid var(--linea); border-radius: 10px; }
.gp-elegir li { border-bottom: 1px solid var(--linea); }
.gp-elegir li.vacio { padding: 10px; color: #8FA3BC; }
.gp-elegir label { display: flex; align-items: center; gap: 8px; padding: 7px 8px; font-size: 13px; line-height: 1.25; }
.gp-elegir input { flex: none; width: 18px; height: 18px; }
.gp-elegir img { width: 22px; height: 22px; flex: none; }
.gp-pegar summary { font-size: 13px; color: var(--primary); padding: 6px 0; cursor: pointer; }

/* Enlaces del menú: a la vista las dos webs; el resto al pulsar «Más enlaces» */
.enlaces-mas { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
#enlaces li.mas { display: none; }
#enlaces.abierto li.mas { display: block; }
.enlaces-mas .ic svg { transition: transform .25s; }
#enlaces.abierto .enlaces-mas .ic svg { transform: rotate(180deg); }
/* desplegados, «Menos enlaces» se marca en otro tono para encontrarlo enseguida y volver a plegarlos */
#enlaces.abierto .enlaces-mas { background: var(--linea); border-radius: 22px; margin: 2px -10px; padding: 4px 10px; width: calc(100% + 20px); }
#enlaces.abierto .enlaces-mas .ic { background: var(--primary); }
#enlaces.abierto .enlaces-mas .ic svg { stroke: var(--white); }

/* Grupos de capas (Dominio Público Hidráulico): la fila se despliega y las subcapas van sangradas */
#infoList li.grupo-info { cursor: pointer; }
.grupo-flecha { width: 44px; height: 26px; flex: none; position: relative; }
.grupo-flecha::after { content: ""; position: absolute; left: 16px; top: 6px; width: 9px; height: 9px; border-right: 2.5px solid var(--primary); border-bottom: 2.5px solid var(--primary); transform: rotate(45deg); transition: transform .25s; }
li.grupo-info.abierto .grupo-flecha::after { transform: rotate(-135deg); top: 10px; }
#infoList li[data-en] { margin-left: 22px; }
#infoList li[data-en].info-extra { padding-left: 56px; }
#infoList li.cerrado { display: none !important; }

/* Leyenda de la capa de sequía */
.sq-ley { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 6px; vertical-align: -1px; }

/* Subcapas de los avisos: un interruptor por tipo */
.avisos-tipos { list-style: none; margin: 4px 0 0; padding: 0; width: 100%; }
#avisosList .avisos-tipos li.av-tipo { padding: 6px 0 6px 0; }
#avisosList .avisos-tipos .l-name { font-size: 14px; }
#avisosList .avisos-tipos .l-count { color: #E8590C; font-weight: bold; }
#avisosList .avisos-tipos .toggle { transform: scale(.85); }

/* Compartir y medir */
.btn-redondo { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 2px solid var(--primary); background: var(--hoja); display: grid; place-items: center; }
.btn-redondo svg { width: 22px; height: 22px; fill: none; stroke: var(--primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#consulta .card-actions { margin: 10px 0 0; }
#btnMedir svg { width: 24px; height: 24px; fill: none; stroke: var(--tinta); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
#btnMedir.on { background: var(--primary); }
#btnMedir.on svg { stroke: var(--white); }
#btnNorte svg { width: 30px; height: 30px; stroke: none; }
#btnNorte .norte { fill: #D64541; }
#btnNorte .sur { fill: #A9B7C6; }
#btnNorte.on { background: var(--primary); }
#btnNorte.on .sur { fill: var(--white); }
#medir { position: absolute; left: 14px; right: 90px; bottom: calc(var(--bottom) + 92px); z-index: 3; max-width: 340px;
  display: none; flex-direction: column; gap: 8px; padding: 10px 12px; background: var(--flota); border-radius: 18px; box-shadow: 0 4px 16px rgba(20, 35, 55, .3); }
#medir.on { display: flex; }
body.sheet-open #medir { display: none; }
#situar { position: absolute; left: 14px; right: 90px; bottom: calc(var(--bottom) + 92px); z-index: 3; max-width: 340px;
  display: none; flex-direction: column; gap: 8px; padding: 10px 12px; background: var(--flota); border-radius: 18px; box-shadow: 0 4px 16px rgba(20, 35, 55, .3); }
#situar.on { display: flex; }
.ee-nota { margin: -4px 0 8px; font-size: 12.5px; color: var(--tinta); opacity: .8; line-height: 1.3; }
.ee-nota:empty { display: none; }
.ee-error { margin: 4px 0 0; font-size: 13.5px; color: #C0392B; }
.ee-error:empty { display: none; }
.ee-coords { display: flex; gap: 8px; }
.ee-coords .campo { flex: 1; min-width: 0; }
.ee-lista button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; border: 0; background: transparent; text-align: left; font: inherit; font-size: 13px; line-height: 1.25; color: var(--tinta); }
.ee-lista button:active { background: var(--linea); }
.ee-lista img { width: 22px; height: 22px; flex: none; }
.medir-res { font-size: 15px; color: var(--tinta); line-height: 1.3; }
.medir-acc { display: flex; gap: 6px; flex-wrap: wrap; }
.medir-acc .btn-mini { padding: 0 10px; }
#eeCodigo { text-transform: uppercase; }
/* Lista de lluvia y avenidas del SIRA (31/10/2026) */
.sira-lista .sira-valor { float: right; margin-left: 8px; font-size: 14px; }

/* Tema: selector del menú y lo que cambia en oscuro */
.solo-oscuro { display: none !important; }
:root[data-tema="oscuro"] .solo-oscuro { display: block !important; }
:root[data-tema="oscuro"] .solo-claro { display: none !important; }
.tema-label { margin-top: 12px; }
.tema { display: flex; margin-top: 6px; padding: 3px; border-radius: 18px; background: var(--hoja); border: 1px solid var(--linea); }
.tema button { flex: 1; border: 0; background: transparent; border-radius: 15px; padding: 7px 2px; font-size: 10px; letter-spacing: .06em; color: var(--tinta); cursor: pointer; }
.tema button.on { background: var(--primary); color: var(--white); }
:root[data-tema="oscuro"] .drawer-barra { opacity: .85; }

/* Texto corrido en Medium (11/11/2026): manual, ventanas, fichas, descripciones de capas y resúmenes.
   Lo que va en <b>/<strong> dentro sigue en Bold. */
#dialogBody, #cardFields dd, #consultaFields dd, .l-name small, .gp-txt small, .nota-est, .radar-hora,
.plan-mapa-txt, .avisos-resumen, .nota, #results .r-sub, .sheet-nota, .vuelo-fila p, .leyenda li, #planLista .p-asunto,
#planLista .p-pie, .drawer-nombre, #manualCuerpo figcaption, .notif-estado, dd.propia small, .clave-error, .gp-est small,
.lc-hist, .ee-nota, #appVersion, .medir-res, .ultimas .u-txt, .ultimas-nota { font-weight: 500; }
#dialogBody b, #dialogBody strong, #dialogBody h3, #dialogBody h4, #dialogBody summary, #dialogBody button, #dialogBody dt,
#dialogBody .man-fecha, #dialogBody .src, #dialogBody .label, #dialogBody .creditos .nombre,
.lc-hist b, .leyenda li b, .notif-estado b, .medir-res b, .plan-mapa-txt b, .plan-mapa-txt button, #cardFields dd b, #consultaFields dd b { font-weight: 700; }
