/* Tozal — estilos de cada pantalla. */

/* ---------- Mapa ---------- */

.mapa-lienzo { position: absolute; inset: 0; -webkit-touch-callout: none; user-select: none; }
.mapa-lienzo .maplibregl-canvas { outline: none; }

.mapa-controles {
  position: absolute; z-index: 5; right: 12px; top: calc(var(--arriba) + 72px);
  display: flex; flex-direction: column; gap: 8px;
}
.placa {
  display: grid; place-items: center; width: 48px; height: 48px;
  border: 1px solid rgba(0, 0, 0, .28); border-radius: 8px;
  background: var(--fondo); color: var(--tinta);
}
.placa[aria-pressed="true"] { background: var(--tinta); color: var(--sobre-tinta); border-color: var(--tinta); }
.placa[data-estado="buscando"][aria-pressed="true"] { background: var(--fondo); color: var(--azul); border-color: var(--azul); }
.placa[data-estado="ok"][aria-pressed="true"] { background: var(--azul); color: #FFFFFF; border-color: var(--azul); }

/* Buscador: sobre el mapa y en la pestaña Cimas */
.buscador-mapa { position: absolute; z-index: 7; top: calc(var(--arriba) + 12px); left: 12px; right: 88px; }
.buscador-mapa > label, .buscador-pestana {
  display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px;
  border: 1px solid rgba(0, 0, 0, .28); border-radius: 8px; background: var(--fondo); color: var(--gris);
}
.buscador-pestana { margin-bottom: 4px; border: 1.5px solid var(--raya); }
.buscador-mapa > label:focus-within, .buscador-pestana:focus-within { outline: 3px solid var(--azul); outline-offset: 1px; }
.campo-buscar { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; color: var(--tinta); font-size: 17px; }
.resultados {
  max-height: 55vh; overflow-y: auto; margin: 6px 0 0; padding: 0; list-style: none;
  border: 1px solid rgba(0, 0, 0, .28); border-radius: 8px; background: var(--fondo);
}
.resultados button { display: grid; gap: 1px; width: 100%; min-height: 52px; padding: 8px 12px; border: 0; background: none; color: var(--tinta); text-align: left; }
.resultados li + li { border-top: 1px solid var(--raya); }
.resultados .nada { padding: 14px 12px; }

/* ---------- Cimas ---------- */

.titulo-lista { margin: 20px 0 4px; font-size: 21px; }
.lista { margin: 0; padding: 0; list-style: none; }
.fila-cima {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 60px; padding: 10px 0; border-bottom: 1px solid var(--raya);
  color: var(--tinta); text-decoration: none;
}
.fila-nombre { display: grid; gap: 1px; min-width: 0; }
.fila-nombre b { font-size: 19px; font-weight: 600; }
.fila-datos { display: grid; flex: none; justify-items: end; text-align: right; }
.fuente-datos { margin-top: 16px; }

.sin-red {
  position: absolute; z-index: 5; top: calc(var(--arriba) + 68px); left: 12px; right: 88px;
  margin: 0; padding: 12px 14px; border-left: 4px solid var(--rojo); border-radius: 0 8px 8px 0;
  background: var(--fondo); font-size: 14px; font-weight: 600; line-height: 1.3;
}

.tira {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 0;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px;
  padding: 10px 16px; min-height: 44px;
  border-top: 1px solid var(--raya); background: var(--fondo);
  font-size: 17px; overflow-wrap: anywhere;
}
.tira b { font-size: 21px; }

/* Escala gráfica como la del mapa topográfico: bloques negros y blancos. */
.pestana-mapa .maplibregl-ctrl-bottom-left .maplibregl-ctrl-scale {
  position: relative; margin: 0 0 10px 12px; padding: 0 4px 9px;
  border: 0; background: none; color: #000000;
  font: 600 13px/1.2 var(--f); text-shadow: 0 0 2px #FFFFFF, 0 0 2px #FFFFFF, 0 0 3px #FFFFFF;
}
.pestana-mapa .maplibregl-ctrl-scale::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  border: 1.5px solid #000000; background: repeating-linear-gradient(90deg, #000000 0 25%, #FFFFFF 25% 50%);
}
.pestana-mapa .maplibregl-ctrl-attrib { font: 12px/1.4 var(--f); }
.pestana-mapa .maplibregl-ctrl-attrib.maplibregl-compact { margin: 0 10px 10px 0; }
.con-tira .maplibregl-ctrl-bottom-left, .con-tira .maplibregl-ctrl-bottom-right { bottom: 48px; }

/* ---------- Hoja inferior (sobre el mapa) ---------- */

.hoja {
  position: absolute; z-index: 6; left: 0; right: 0; bottom: 0;
  max-height: 75%; overflow-y: auto; overscroll-behavior: contain;
  padding: 4px 16px 20px;
  border-top: 1px solid var(--raya); border-radius: 14px 14px 0 0;
  background: var(--fondo);
}
.hoja-cabecera { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-right: -8px; }
.hoja-cabecera h2 { margin: 12px 0 4px; font-size: 24px; }
.hoja .gris { margin-bottom: 8px; }

.dato-grande { margin: 0 0 8px; font-size: 36px; font-weight: 700; line-height: 1.1; }
.datos { display: grid; grid-template-columns: fit-content(40%) minmax(0, 1fr); gap: 6px 14px; margin: 0 0 16px; }
.datos dt { color: var(--gris); font-size: 14px; line-height: 1.6; }
.datos dd { margin: 0; font-weight: 600; }
.pareja { display: flex; flex-wrap: wrap; gap: 0 14px; }

.cifras { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 16px; padding: 0; list-style: none; font-weight: 600; }
.cifras li { display: inline-flex; align-items: center; gap: 6px; }
.cifras .ic { width: 20px; height: 20px; }

.botones { display: flex; flex-wrap: wrap; gap: 8px; }
.botones .boton { flex: 1 1 auto; }

/* Elegir una opción de una lista, e interruptor de sí/no */
.elegir { display: grid; gap: 8px; margin: 8px 0 16px; }
.eleccion, .interruptor {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 64px; padding: 10px 14px; text-align: left;
  border: 1.5px solid var(--raya); border-radius: 8px; background: var(--fondo); color: var(--tinta);
}
.eleccion > span, .interruptor > span:first-child { display: grid; gap: 2px; }
.eleccion[aria-checked="true"] { border-color: var(--tinta); box-shadow: inset 0 0 0 1px var(--tinta); }
.interruptor-pista { position: relative; flex: none; width: 52px; height: 32px; border-radius: 16px; background: var(--raya); }
.interruptor-pista::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #FFFFFF; transition: transform .15s; }
.interruptor[aria-checked="true"] .interruptor-pista { background: var(--tinta); }
.interruptor[aria-checked="true"] .interruptor-pista::after { transform: translateX(20px); background: var(--sobre-tinta); }

/* ---------- Tiempo ---------- */

.lugar { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; }
.lugar h2 { margin: 0; }
.lugar .gris { margin: 2px 0 0; }
.avisos { margin: 16px 0 12px; padding-top: 14px; border-top: 3px solid var(--tinta); }
.avisos.serio { border-top-color: var(--rojo); }
.aviso-principal { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 8px; font-size: 24px; line-height: 1.2; font-weight: 700; }
.aviso-principal .ic { width: 30px; height: 30px; }
.serio .aviso-principal { color: var(--rojo); }
.aviso-principal.tranquilo { font-size: 21px; font-weight: 600; }
.avisos-resto { margin: 0 0 8px; padding: 0; list-style: none; font-weight: 600; }
.avisos-resto li { padding: 2px 0; }
.ahora { margin: 8px 0 0; }
.sol { display: flex; align-items: center; gap: 8px; color: var(--gris); }
.sol .ic { width: 20px; height: 20px; }
.sin-red-linea { padding: 10px 12px; border-left: 4px solid var(--rojo); background: var(--suelo); font-weight: 600; }

.tabla-desliza { overflow-x: auto; } /* con letra muy grande, la tabla se desliza de lado en vez de salirse */
.horas { width: 100%; margin: 8px 0 0; border-collapse: collapse; }
.horas caption { caption-side: bottom; padding-top: 8px; text-align: left; }
.horas thead th {
  padding: 8px 4px; border-bottom: 1px solid var(--raya); background: var(--fondo);
  color: var(--gris); font-size: 14px; font-weight: 600; text-align: left;
}
.horas tbody th, .horas td { padding: 7px 4px; border-bottom: 1px solid var(--raya); text-align: left; vertical-align: middle; white-space: nowrap; }
.horas tbody th[scope="row"] { width: 3.4em; font-weight: 600; }
.horas tr.dia th { padding: 20px 4px 8px; border-bottom: 2px solid var(--tinta); white-space: normal; }
.horas tr.dia span:first-child { margin-right: 10px; font-size: 21px; font-weight: 700; }
.horas tr.dia .gris { font-size: 14px; font-weight: 600; }
.horas tr.noche { background: var(--suelo); }
.horas .cielo .ic { display: block; }
.viento .ic, .agua .ic { width: 16px; height: 16px; vertical-align: -2px; }
.rachas { color: var(--gris); font-size: 14px; }
.viento.fuerte, .viento.fuerte .rachas { color: var(--rojo); font-weight: 700; }
.pie-tiempo { margin-top: 20px; }
.pie-tiempo a { color: var(--tinta); font-weight: 600; }

/* ---------- Rutas: lista ---------- */

.zona { margin: 28px 0 0; font-size: 21px; }
.fila-ruta { display: grid; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--raya); color: var(--tinta); text-decoration: none; }
.fila-ruta-cabeza { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 12px; }
.fila-ruta-cabeza b { font-size: 19px; font-weight: 600; line-height: 1.25; }
.horario { flex: none; font-weight: 700; }
.fila-ruta .cifras { margin: 0; color: var(--gris); }
.fila-ruta .cifras .ic { width: 16px; height: 16px; }
.nivel { display: inline-flex; align-items: center; gap: 6px; }
.nivel-barras { display: inline-flex; gap: 2px; }
.nivel-barras i { width: 7px; height: 12px; border: 1.5px solid currentColor; }
.nivel-barras i.lleno { background: currentColor; }

/* ---------- Ficha de una ruta ---------- */

.ficha-cabeza h1 { margin: 0 0 6px; font-size: 32px; }
.ficha-cabeza .gris { margin: 0 0 8px; }
.ficha-cabeza .nivel { font-weight: 700; }

/* El poste: palas blancas con punta de flecha, como las de los senderos de Aragón.
   Es un objeto, así que se ve igual en claro y en oscuro. Las franjas de la punta solo
   salen si una fuente confirma que ese tramo es de un sendero señalizado. */
.poste { position: relative; margin: 28px 0 20px; padding-left: 16px; }
.poste::before { content: ""; position: absolute; top: -14px; bottom: 30px; left: 0; width: 9px; border-radius: 2px 2px 0 0; background: #74797B; }
.palas { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pala { min-width: 0; padding: 2px; background: #000000; clip-path: polygon(0 0, calc(100% - 27px) 0, 100% 50%, calc(100% - 27px) 100%, 0 100%); }
.pala-cara {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 12px;
  min-height: 58px; padding: 8px 54px 8px 14px; background: #FFFFFF; color: #000000;
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 50%, calc(100% - 26px) 100%, 0 100%);
}
.pala-texto { display: grid; min-width: 0; }
.pala-texto b { font-size: 17px; line-height: 1.2; }
.pala-alt { color: #4B5254; font-size: 13px; font-weight: 600; }
.pala-tiempo { flex: none; font-size: 19px; font-weight: 700; }
.pala-punta { position: absolute; top: 0; right: 0; bottom: 0; width: 44px; }
.pala-punta.gr, .pala-punta.pr, .pala-punta.sl { border-left: 2px solid #000000; }
.pala-punta.gr { background: linear-gradient(#FFFFFF 50%, #D3202B 50%); }
.pala-punta.pr { background: linear-gradient(#FFFFFF 50%, #F2C500 50%); }
.pala-punta.sl { background: linear-gradient(#FFFFFF 50%, #2E9E44 50%); }
.poste-pie { margin: 10px 0 0; }

.recorte { position: relative; display: block; overflow: hidden; margin: 8px 0 4px; border: 1px solid var(--raya); border-radius: 8px; background: #E9EBE8; }
.recorte img { position: absolute; max-width: none; }
.recorte svg { position: absolute; inset: 0; }
.recorte-borde { fill: none; stroke: #FFFFFF; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.recorte-ruta { fill: none; stroke: #C4007A; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.recorte-salida { fill: #FFFFFF; stroke: #C4007A; stroke-width: 3; }
.recorte-objetivo { fill: #C4007A; stroke: #FFFFFF; stroke-width: 2; stroke-linejoin: round; }
.recorte-cursor { fill: #0A62C9; stroke: #FFFFFF; stroke-width: 3; }
.recorte-credito { position: absolute; right: 6px; bottom: 4px; padding: 0 4px; background: rgba(255, 255, 255, .85); color: #000000; font-size: 11px; }

.perfil-caja { margin: 14px 0 8px; }
.perfil-lectura { min-height: 2.8em; margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.perfil { display: block; width: 100%; height: auto; touch-action: pan-y; cursor: crosshair; }
.perfil text { fill: var(--gris); font: 600 11px var(--f); }
.perfil-guia { stroke: var(--raya); stroke-width: 1; }
.perfil-area { fill: var(--suelo); }
.perfil-linea { fill: none; stroke: var(--magenta); stroke-width: 2.5; stroke-linejoin: round; }
.perfil-cursor { stroke: var(--tinta); stroke-width: 1.5; }

.ficha-datos { display: grid; grid-template-columns: fit-content(45%) minmax(0, 1fr); margin: 20px 0; border-top: 2px solid var(--tinta); }
.ficha-datos dt, .ficha-datos dd { overflow-wrap: anywhere; }
.ficha-datos dt, .ficha-datos dd { padding: 9px 0; border-bottom: 1px solid var(--raya); }
.ficha-datos dt { padding-right: 16px; color: var(--gris); }
.ficha-datos dd { margin: 0; font-weight: 600; }

.mide-valores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 8px; padding: 0; list-style: none; }
.mide-valores li { display: grid; justify-items: center; gap: 2px; padding: 10px 2px; border: 2px solid var(--tinta); border-radius: 6px; text-align: center; }
.mide-valores b { font-size: 32px; line-height: 1; }
.mide-valores span { font-size: 11px; font-weight: 600; overflow-wrap: anywhere; }

.peligros { padding-left: 12px; border-left: 4px solid var(--rojo); }
.fuentes { padding-left: 20px; }
.fuentes li { margin: 6px 0; }
.fuentes a { font-weight: 600; }

.acciones {
  position: sticky; bottom: 0; z-index: 3;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px;
  margin: 24px -16px 0; padding: 10px 16px calc(10px + var(--abajo));
  border-top: 1px solid var(--raya); background: var(--fondo);
}
.accion {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 52px; padding: 0 6px;
  border: 2px solid var(--tinta); border-radius: 8px; color: var(--tinta); font-size: 15px; font-weight: 600; text-decoration: none;
}
.accion.principal { background: var(--tinta); color: var(--sobre-tinta); }
.accion .ic { width: 20px; height: 20px; }

/* ---------- Más ---------- */

.lista-mas { margin-top: 8px; }
.fila-mas { display: grid; gap: 2px; min-height: 64px; padding: 12px 0; border-bottom: 1px solid var(--raya); color: var(--tinta); text-decoration: none; }
.fila-mas b { font-size: 19px; font-weight: 600; }
.salida-activa { margin: 8px 0 12px; padding: 14px 16px; border-left: 4px solid var(--magenta); background: var(--suelo); }
.salida-activa p { margin: 0 0 12px; }

.formulario { padding-bottom: 16px; }
.campo { display: grid; gap: 4px; margin: 0 0 14px; }
.campo-etiqueta { font-weight: 600; }
.campo input, .campo select {
  width: 100%; min-height: 48px; padding: 0 12px;
  border: 1.5px solid var(--raya); border-radius: 8px; background: var(--fondo); font-size: 17px;
}
.campo input:focus, .campo select:focus { border-color: var(--tinta); outline: none; }
.dia-hora { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5em, 1fr)); gap: 8px; }
.mensaje { margin: 0 0 16px; padding: 14px 16px; border-radius: 8px; background: var(--suelo); font: 15px/1.5 var(--f); white-space: pre-wrap; overflow-wrap: anywhere; }
.aviso-honesto { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; color: var(--gris); font-size: 15px; }
.aviso-honesto .ic { width: 20px; height: 20px; margin-top: 1px; }

/* Dedicatoria: solo letra y aire */
.capa-cabecera.vacia { min-height: calc(var(--arriba) + 12px); }
.dedicatoria { max-width: 30em; padding: 9vh 0 24px; }
.dedicatoria-para { margin-bottom: 24px; font-size: 44px; font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; }
.dedicatoria p:not(.dedicatoria-para):not(.gris) { font-size: 21px; line-height: 1.45; }
.dedicatoria-firma { margin-top: 28px; font-weight: 700; }
.instalar { margin: 8px 0 24px; padding: 16px; border: 1.5px solid var(--raya); border-radius: 8px; }
.instalar h2 { margin-top: 0; font-size: 21px; }
.instalar ol { padding-left: 22px; }
.empezar { width: 100%; min-height: 56px; font-size: 19px; }
.version { margin-top: 32px; }

/* ---------- SOS: rojo entero, igual en claro y en oscuro ---------- */

.capa-sos { background: #C8101A; color: #FFFFFF; }
.capa-sos .capa-cabecera { background: #C8101A; }
.capa-sos .boton-icono { color: #FFFFFF; }
.capa-sos .boton-icono:active { background: rgba(255, 255, 255, .15); }
.capa-sos a { color: #FFFFFF; }
.capa-sos :focus-visible { outline-color: #FFFFFF; }
.llamar {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 76px; margin: 8px 0 12px; border-radius: 10px;
  background: #FFFFFF; color: #A0000C !important; font-size: 26px; font-weight: 700; text-decoration: none;
}
.llamar .ic { width: 30px; height: 30px; }
.sos-nota { font-size: 15px; line-height: 1.4; }
.sos-posicion h2 { margin: 24px 0 8px; font-size: 21px; }
.sos-estado { font-weight: 600; }
.utm-grande { display: grid; grid-template-columns: max-content 1fr; align-items: baseline; gap: 0 14px; margin: 0 0 8px; }
.utm-grande dt { font-size: 17px; font-weight: 600; opacity: .85; }
.utm-grande dd { margin: 0; font-size: 44px; font-weight: 700; line-height: 1.12; }
.sos-detalle { margin: 0 0 4px; font-size: 15px; }
.sos-detalle .pareja { display: inline-flex; }
.sos-botones { display: grid; gap: 10px; margin: 24px 0; }
.sos-boton { min-height: 56px; border-color: #FFFFFF; background: transparent; color: #FFFFFF; font-size: 19px; }
.sos-guia { border-top: 1px solid rgba(255, 255, 255, .45); }
.sos-guia:last-of-type { border-bottom: 1px solid rgba(255, 255, 255, .45); }
.sos-guia summary { display: flex; align-items: center; min-height: 56px; font-size: 19px; font-weight: 700; cursor: pointer; list-style: none; }
.sos-guia summary::-webkit-details-marker { display: none; }
.sos-guia summary::after { content: ""; width: 10px; height: 10px; margin: 0 6px 4px auto; border-right: 2.5px solid; border-bottom: 2.5px solid; transform: rotate(45deg); }
.sos-guia[open] summary::after { margin-bottom: -4px; transform: rotate(-135deg); }
.sos-guia ol, .sos-guia ul { margin: 0 0 16px; padding-left: 22px; }
.sos-guia li { margin: 6px 0; }
.sos-guia p { margin-bottom: 12px; }
.sos-fuentes { margin-top: 20px; opacity: .9; }

.senal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-content: center; justify-items: center; gap: 24px; padding: 24px;
  background: #000000; color: #FFFFFF; text-align: center;
}
.senal.encendida { background: #FFFFFF; color: #000000; }
.senal-texto { margin: 0; font-size: 44px; font-weight: 700; }
.senal-ayuda { max-width: 22em; font-size: 17px; }
.senal-parar { min-width: 220px; min-height: 72px; border: 3px solid currentColor; border-radius: 12px; background: transparent; color: inherit; font-size: 24px; font-weight: 700; }

/* ---------- Avisos breves ---------- */

.nota {
  position: fixed; z-index: 60; left: 16px; right: 16px; bottom: calc(var(--barra) + var(--abajo) + 16px);
  max-width: 32em; margin: 0 auto; padding: 14px 16px; border-radius: 8px;
  background: var(--tinta); color: var(--sobre-tinta); font-weight: 600;
}
