/*
  Estilos del sitio. De arriba hacia abajo:
  paleta (variables en :root), cartel de datos de prueba, bloque de marca y veredicto
  (.hero: la luz de fondo toma el color del nivel, --tono, y al pie corre la línea de ola
  que dibuja veredicto.js), mapa propio (tierra, costa de arena, escolleras y rutas son
  trazos SVG que arma mapa.js con js/costa.js; los colores del mapa son las variables --m-*
  y cambian con la luz de la hora: .luz-noche, .luz-alba, .luz-ocaso), lo que flota sobre
  el mapa (solo las localidades arriba, el zoom y la leyenda abajo), marcadores (puntos
  chicos del color del nivel; insignia grande con la ola de la marca en las que están
  mejor), barra de día y hora al pie del mapa (.dock: los días, la pausa del movimiento, la
  hora sobre la tira que muestra cómo viene el día y, en celular, el botón que lleva a la
  lista), panel (resumen del mar, lista con una barra por playa, ficha de la playa con su
  bloque "Cómo es", y pie). Las páginas de la encuesta (carteles y puente) usan css/extras.css.
  En escritorio (más de 860 px) el mapa ocupa todo el alto a la izquierda y la marca, el
  veredicto y el panel forman una columna a la derecha. En celular va todo apilado: el
  bloque de arriba, el mapa con su barra hasta el borde de la pantalla y el panel debajo.
  Accesibilidad: un solo borde de foco para todo (:focus-visible), .sr para lo que solo
  escucha el lector de pantalla, controles de 44 px o más hasta 860 px de ancho, y sin
  movimiento si el sistema pide reducirlo (prefers-reduced-motion). Los pares de color
  de texto y fondo los comprueba "Sitio Web/Pruebas/probar.js" (mínimo 4,5:1): si se
  cambia la paleta, correrlo.
  Estados de falla: .aviso (el pronóstico no se pudo traer o actualizar), .map-msg y
  .sin-mapa (el mapa todavía no cargó o no cargó: en celular su lugar se achica para que
  el ranking suba) y .nd (playa u hora sin dato: gris con borde punteado y una raya).
*/
:root {
  --ink: #0c1f2c;
  --ink-2: #12303f;
  --ink-3: #1b4152;
  --foam: #eaf4f4;
  --muted: #9cb4bd;
  --sand: #e9d8b4;
  --accent: #ff8a3d;

  --t-plancha: #7b8e9b; /* con --ink encima da 5,0:1 (el gris anterior, 4,2:1) */
  --t-flojo: #3f8fd0;
  --t-pasable: #22b3a6;
  --t-bueno: #46c768;
  --t-firme: #ff8a3d;

  /* El mapa propio, de día (ver .luz-* más abajo) */
  --m-mar: #0b3a5b;
  --m-mar-2: #0e4a70;
  --m-orilla: #49b6c9;
  --m-tierra: #0b1a23;
  --m-costa: #e9d8b4;
  --m-ruta: #1d3644;

  --radius: 14px;
  --titulo: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --sale: cubic-bezier(.2, .8, .2, 1); /* la curva de casi todo lo que se mueve: arranca rápido y frena suave */
  font-family: Inter, system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--foam); }
a { color: var(--sand); }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* Foco de teclado: el mismo borde en todos los controles */
:focus-visible { outline: 2px solid var(--foam); outline-offset: 2px; }
/* Solo para lector de pantalla: está en la página pero no se ve */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* "Saltar a la lista": aparece arriba a la izquierda cuando recibe el foco */
.skip { position: absolute; left: 8px; top: -60px; z-index: 2000; padding: 12px 16px; border-radius: 10px; background: var(--sand); color: var(--ink); font-weight: 600; }
.skip:focus { top: 8px; }

/* ---------- armado general ---------- */
/* Escritorio: mapa a toda la altura; a la derecha, marca y veredicto, aviso y panel.
   <main class="layout"> no arma caja propia (display: contents): el mapa y el panel se
   ubican directo en la grilla del body. */
body { display: grid; grid-template-columns: minmax(0, 1fr) 420px; grid-template-rows: auto auto auto minmax(0, 1fr); }
.demo-bar { grid-column: 1 / -1; grid-row: 1; }
.layout { display: contents; }
.map-wrap { grid-column: 1; grid-row: 2 / 5; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.hero { grid-column: 2; grid-row: 2; }
.aviso { grid-column: 2; grid-row: 3; }
/* position: relative: lo que solo oye el lector de pantalla (.sr, posición absoluta) queda adentro del
   panel y se desplaza con él; si no, estira la página por debajo del mapa */
.panel { position: relative; grid-column: 2; grid-row: 4; min-width: 0; min-height: 0; overflow-y: auto; padding: 4px 20px 28px; background: var(--ink); }
.hero, .aviso, .panel { border-left: 1px solid var(--ink-3); }

/* Cartel del modo de prueba (?demo=): que nadie confunda datos inventados con el pronóstico */
.demo-bar { padding: 5px 14px; background: var(--sand); color: var(--ink); font-size: 12px; line-height: 1.35; }
.demo-bar a { color: var(--ink); font-weight: 600; }

/* Cartel de falla: el pronóstico no se pudo traer, o se ve uno guardado sin actualizar */
.aviso { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 18px; background: var(--ink-3); border-bottom: 1px solid var(--sand); font-size: 13px; line-height: 1.4; }
.aviso[hidden] { display: none; }
.aviso p { margin: 0; flex: 1 1 240px; }
.aviso button { flex: none; min-height: 44px; padding: 6px 16px; border: 0; border-radius: 10px; background: var(--sand); color: var(--ink); font-weight: 600; }
.aviso button:disabled { opacity: .6; cursor: default; }

/* ---------- marca y veredicto ---------- */
/* Un solo bloque. --tono es el color del nivel del veredicto (lo pone veredicto.js): entra
   como una luz desde arriba a la derecha, así un día firme y uno planchado no se ven igual
   ni antes de leer. */
.hero {
  --tono: var(--t-plancha);
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--ink-2);
  transition: --tono .6s;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 150% at 105% -30%, var(--tono), transparent 58%),
    linear-gradient(180deg, var(--ink-2), var(--ink));
  opacity: .34;
}
.hero::after { /* el degradé de base queda entero; la luz del nivel va con opacidad en ::before */
  content: ""; position: absolute; inset: 0; z-index: -2; background: linear-gradient(180deg, var(--ink-2), var(--ink));
}
.top { display: flex; align-items: center; padding: 16px 22px 0; }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--titulo); font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.brand h1 { margin: 0; font: inherit; letter-spacing: inherit; }
.brand b { font-weight: 800; color: var(--accent); }
.brand svg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 3.2; stroke-linecap: round; }
.brand small { font-family: Inter, sans-serif; font-size: 12px; letter-spacing: 0; color: var(--muted); border-left: 1px solid var(--ink-3); padding-left: 10px; margin-left: 2px; }

/* Lo primero que se lee: cómo está, dónde y por qué. Es un botón que abre esa playa. */
.verdict-bar { display: flex; align-items: flex-start; }
.verdict {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; text-align: left;
  padding: 18px 8px 16px 22px; border: 0; background: transparent; color: var(--foam);
}
.verdict:disabled { cursor: default; color: var(--muted); }
/* Renglón 1: nivel y momento. Renglón 2: dónde (lo que se lee de lejos). Renglón 3: por qué. */
.verdict .v-when { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.verdict .v-when b { color: var(--foam); font-weight: 600; letter-spacing: .01em; }
.verdict .v-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.verdict .v-main { display: block; font-family: var(--titulo); font-weight: 800; font-size: 34px; line-height: 1.04; letter-spacing: -0.022em; text-wrap: balance; }
.verdict .v-why { display: block; margin-top: 2px; font-size: 13px; color: var(--sand); font-variant-numeric: tabular-nums; }
.verdict .v-why em { font-style: normal; color: var(--muted); }
/* Solo si los modelos de viento no coinciden a esa hora (veredicto.js) */
.verdict .v-duda { display: block; margin-top: 3px; font-size: 12px; font-weight: 600; color: var(--foam); }
.verdict .v-duda::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; border: 1.5px solid var(--sand); vertical-align: 1px; }
.verdict:not(:disabled):hover .v-main { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-color: var(--tono); }
/* Cuando el veredicto cambia (otro día, otra localidad), entra de abajo; veredicto.js solo
   lo reescribe si cambió, así mover la hora no lo hace parpadear, y le pone .cambia desde
   el segundo: el primero aparece de una, antes que cualquier animación */
.verdict.cambia > span { animation: entra .42s var(--sale) both; }
.verdict.cambia > span:nth-child(2) { animation-delay: .04s; }
.verdict.cambia > span:nth-child(3) { animation-delay: .09s; }
/* Arranca a media opacidad, no en cero: si el navegador no llega a animar (pestaña en
   segundo plano), lo que entra se lee igual */
@keyframes entra { from { opacity: .5; transform: translateY(7px); } }
/* Compartir el veredicto: enlace a WhatsApp (o el menú de compartir del celular) */
.share-v {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: 12px 12px 0 0;
  border-radius: 50%; color: var(--sand); text-decoration: none; transition: background .2s;
}
.share-v[hidden] { display: none; }
.share-v:hover { background: var(--ink-3); }
.share-v svg, .detail .share svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.verdict:focus-visible { outline-offset: -3px; }

/* La línea de ola del pie. veredicto.js dibuja el trazo con la altura y el largo que salen
   del veredicto y deja en --ola-largo cuánto mide una onda y en --ola-seg cuánto tarda en
   pasar; acá solo se la hace correr. Planchado: una raya quieta. */
.ola { display: block; width: 100%; height: 26px; overflow: hidden; }
.ola path { animation: corre var(--ola-seg, 6s) linear infinite; }
.ola.quieta path { animation: none; }
.ola-linea { fill: none; stroke: var(--tono); stroke-width: 2; stroke-linecap: round; transition: stroke .6s; }
.ola-agua { fill: var(--bajo-ola, var(--ink)); stroke: none; }
@keyframes corre { to { transform: translateX(calc(-1 * var(--ola-largo, 96px))); } }

/* ---------- el mapa ---------- */
.map-area { position: relative; flex: 1; min-height: 0; overflow: hidden; }
#map {
  position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(140% 120% at 85% 60%, var(--m-mar-2), var(--m-mar) 62%);
  background-color: var(--m-mar);
  transition: --m-mar .7s, --m-mar-2 .7s;
}
#map:focus-visible { outline-offset: -2px; }
/* Las variables de color se animan solo si el navegador sabe que son colores */
@property --tono { syntax: "<color>"; inherits: true; initial-value: #7b8e9b; }
@property --m-mar { syntax: "<color>"; inherits: true; initial-value: #0b3a5b; }
@property --m-mar-2 { syntax: "<color>"; inherits: true; initial-value: #0e4a70; }
/* Tierra, costa, escolleras y rutas (trazos SVG de Leaflet; los colores de acá le ganan a
   los atributos que pone Leaflet) */
.m-tierra { fill: var(--m-tierra); stroke: none; transition: fill .7s; }
/* Fuera de la costa que el sitio tiene guardada: un fondo liso con borde punteado, ni tierra ni mar */
.m-fuera { fill: #071019; stroke: rgba(233, 216, 180, .22); stroke-width: 1px; stroke-dasharray: 2 6; }
.m-orilla { fill: none; stroke: var(--m-orilla); stroke-linejoin: round; stroke-linecap: round; transition: stroke .7s, stroke-opacity .7s; }
.m-orilla.o1 { stroke-width: 72px; stroke-opacity: .05; }
.m-orilla.o2 { stroke-width: 44px; stroke-opacity: .06; }
.m-orilla.o3 { stroke-width: 22px; stroke-opacity: .09; }
.m-orilla.o4 { stroke-width: 8px; stroke-opacity: .16; }
.m-costa { fill: none; stroke: var(--m-costa); stroke-width: 1.6px; stroke-linejoin: round; stroke-linecap: round; transition: stroke .7s; }
.m-obra { fill: none; stroke: var(--m-costa); stroke-width: 1.8px; stroke-linejoin: round; stroke-linecap: round; transition: stroke .7s; }
.m-ruta { fill: none; stroke: var(--m-ruta); stroke-width: 1.2px; stroke-linejoin: round; transition: stroke .7s; }
.far .m-obra { stroke-width: 1.3px; }
.compact .m-ruta { stroke-width: 1px; }
/* La luz de la hora elegida (mapa.js pone la clase con el sol del pronóstico) */
#map.luz-noche { --m-mar: #061d31; --m-mar-2: #082740; --m-orilla: #2b6f8a; --m-tierra: #060f15; --m-costa: #8f8873; --m-ruta: #12222c; }
#map.luz-alba { --m-mar: #0b3156; --m-mar-2: #1c4a7c; --m-orilla: #f4c39c; --m-tierra: #0b1720; }
#map.luz-ocaso { --m-mar: #0c2f4d; --m-mar-2: #123a5c; --m-orilla: #8a86b8; --m-tierra: #0e1620; --m-costa: #d9b9a6; }
/* En esta costa el sol sale del mar: al alba entra una luz cálida desde el este. Al
   atardecer se va por la tierra. Va por encima del mapa y no recibe toques. */
#map::after {
  content: ""; position: absolute; inset: 0; z-index: 450; pointer-events: none; opacity: 0; transition: opacity .9s;
  background: linear-gradient(96deg, transparent 72%, rgba(255, 150, 100, .10) 86%, rgba(255, 190, 130, .26));
}
#map.luz-alba::after { opacity: 1; }
#map.luz-ocaso::after { opacity: 1; background: linear-gradient(276deg, transparent 70%, rgba(255, 110, 90, .08) 86%, rgba(255, 150, 110, .22)); }

/* Un velo arriba y otro abajo: lo que flota sobre el mapa se lee sin tapar lo que pasa por detrás */
.map-area::before, .map-area::after { content: ""; position: absolute; left: 0; right: 0; z-index: 400; pointer-events: none; }
.map-area::before { top: 0; height: 92px; background: linear-gradient(180deg, rgba(8, 22, 32, .9) 0, rgba(8, 22, 32, .78) 52px, rgba(8, 22, 32, 0)); }
.map-area::after { bottom: 0; height: 70px; background: linear-gradient(0deg, rgba(8, 22, 32, .5), rgba(8, 22, 32, 0)); }
.sin-mapa .map-area::before, .sin-mapa .map-area::after { display: none; }

/* Mientras el mapa no está: "Cargando el mapa…" o por qué no cargó */
.map-msg { position: absolute; inset: 0; z-index: 1; margin: 0; padding: 20px; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; }
.map-msg[hidden] { display: none; }
.sin-mapa #map, .sin-mapa .map-avisos, .sin-mapa .legend, .sin-mapa .tiers, .sin-mapa .pausa { display: none; }
/* Playa u hora sin dato: gris, con borde punteado y una raya en vez del número */
.pill.nd, .spot.nd, .lvl.nd, .dot.nd { background: var(--ink-3); color: var(--foam); border: 1px dashed var(--muted); box-shadow: none; }

/* El mar en movimiento (mar.js): debajo de los puntos; de noche se apaga un poco */
canvas.mar { position: absolute; left: 0; top: 0; pointer-events: none; transition: opacity .5s; }
canvas.mar.noche { opacity: .55; }
.leaflet-container { font-family: Inter, sans-serif; background: transparent; }
.leaflet-control-attribution { background: rgba(12, 31, 44, .7) !important; color: var(--muted) !important; font-size: 10px !important; border-radius: 6px 0 0 0; }
.leaflet-control-attribution a { color: var(--sand) !important; }
/* El zoom queda (hace falta para quien no puede pellizcar), pero callado */
.leaflet-bar { border: 0 !important; border-radius: 12px !important; overflow: hidden; box-shadow: none !important; }
.leaflet-bar a { background: rgba(12, 31, 44, .5) !important; color: var(--foam) !important; border-color: rgba(233, 216, 180, .14) !important; font-weight: 400 !important; }
.leaflet-bar a:hover { background: rgba(12, 31, 44, .86) !important; }
.leaflet-top.leaflet-right { top: 58px; }

/* Lo que flota sobre el mapa comparte piel: tinta casi opaca, borde fino, sombra corta */
.places button span, .home, .volver, .legend {
  background: rgba(12, 31, 44, .86); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(233, 216, 180, .16); color: var(--foam);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}

/* Localidades: una fila sobre el mapa que se desliza de costado. Mueven el mapa y filtran la
   lista. El borde por donde queda algo escondido se esfuma (panel.js pone .mas-izq y .mas-der). */
.places {
  --izq: #000; --der: #000;
  position: absolute; left: 0; right: 0; top: 0; z-index: 500; display: flex; gap: 6px; padding: 6px 12px;
  overflow-x: auto; scrollbar-width: none; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, var(--izq), #000 52px, #000 calc(100% - 64px), var(--der));
  mask-image: linear-gradient(90deg, var(--izq), #000 52px, #000 calc(100% - 64px), var(--der));
}
.places.mas-izq { --izq: transparent; }
.places.mas-der { --der: transparent; }
.places::-webkit-scrollbar { display: none; }
/* El botón mide 44 px de alto para el dedo; lo que se ve es la pastilla de adentro */
.places button { flex: none; pointer-events: auto; display: flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--foam); font-size: 12.5px; font-weight: 600; }
.places button span { display: block; padding: 7px 12px; border-radius: 999px; white-space: nowrap; pointer-events: none; box-shadow: none; transition: background .25s, color .25s, border-color .25s; }
.places button:hover span { border-color: rgba(233, 216, 180, .5); }
.places button[aria-pressed="true"] span { background: var(--sand); border-color: var(--sand); color: var(--ink); }
.places button:focus-visible { outline: none; }
.places button:focus-visible span { outline: 2px solid var(--foam); outline-offset: 2px; }

/* Volver a Mar del Plata (solo si quedó lejos) y, abajo a la derecha, la leyenda: un botón
   con la escala de colores y el nombre de las dos puntas */
.map-avisos { position: absolute; z-index: 500; left: 12px; top: 56px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; pointer-events: none; }
.home, .volver { pointer-events: auto; padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; animation: entra .3s var(--sale) both; }
.home[hidden], .volver[hidden] { display: none; }
.home { border-color: rgba(233, 216, 180, .5); }
/* "El mapa muestra las 14 · volver a las 8": lo de después del punto es lo que se toca */
.volver { font-weight: 500; color: var(--muted); border-color: rgba(233, 216, 180, .5); }
.volver b { font-weight: 600; color: var(--sand); }
.legend { position: absolute; right: 12px; bottom: 20px; z-index: 500; display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .01em; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }
.legend span:first-child { margin-right: 4px; color: var(--muted); }
.legend span:last-child { margin-left: 4px; }
.legend[aria-expanded="true"] { border-color: var(--sand); }
/* Significado de los niveles y de lo que se mueve: se abre arriba de la leyenda */
.tiers {
  /* z-index: por encima de los controles de Leaflet (1000), que si no lo tapan en mapas angostos */
  position: absolute; right: 12px; bottom: 62px; z-index: 1001; width: min(330px, calc(100% - 24px));
  padding: 14px 16px; border-radius: var(--radius); border: 1px solid rgba(233, 216, 180, .4);
  background: var(--ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .55); font-size: 13px;
  /* En mapas bajos no se sale por arriba: se desplaza adentro */
  max-height: calc(100% - 74px); overflow-y: auto;
  animation: entra .28s var(--sale) both;
}
.tiers h2 { margin: 0 0 8px; font-family: var(--titulo); font-size: 16px; }
.tiers ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tiers li { display: grid; grid-template-columns: 14px 74px 1fr; align-items: center; gap: 6px; }
.tiers li i { width: 12px; height: 12px; border-radius: 50%; }
.tiers h2 + ul + h2 { margin-top: 12px; }
/* Muestras de lo que se mueve en el mapa: estela de viento, frente de swell y espuma */
.tiers .keys i { width: 14px; height: 0; border-radius: 0; border-top: 2px solid var(--sand); }
.tiers .keys .k-viento { border-image: linear-gradient(90deg, transparent, var(--sand)) 1; }
.tiers .keys .k-swell { border-top: 3px solid #a9d8e6; opacity: .75; }
.tiers .keys .k-ola { border-top: 4px solid #fff; border-radius: 2px; }
.tiers .keys .k-marea { border-top: 2px solid var(--m-orilla); }
.tiers li em { font-style: normal; }
.tiers p { margin: 10px 0 0; color: var(--muted); font-size: 12px; }

/* ---------- marcadores ---------- */
/* El ícono de Leaflet queda en la ubicación real; solo el punto recibe los toques,
   así un punto desplazado no tapa al vecino que está en ese lugar. */
.leaflet-marker-icon.spot-icon { pointer-events: none; }
/* El foco se dibuja alrededor del punto, que puede estar corrido de la ubicación real */
.leaflet-marker-icon.spot-icon:focus-visible { outline: none; }
.spot-icon:focus-visible .spot { outline: 3px solid var(--foam); outline-offset: 3px; }
.spot-icon .spot { pointer-events: auto; cursor: pointer; }
/* Línea guía y punto en la ubicación real de un marcador desplazado */
.spot-icon .lead { position: absolute; left: 50%; top: 50%; height: 1px; background: var(--foam); opacity: .35; }
.spot-icon .real { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: var(--foam); opacity: .6; }
/* Un punto por playa, del color de su nivel (--c, lo pone mapa.js). No lleva número: el
   mapa compara. --lado es lo que mide el punto común a ese zoom y --d lo que mide este:
   el margen lo deja centrado en su lugar aunque sea más grande. */
#map { --lado: 14px; }
#map.compact { --lado: 11px; }
#map.tiny { --lado: 8px; }
.spot {
  --d: var(--lado);
  position: relative; width: var(--d); height: var(--d); margin: calc((var(--lado) - var(--d)) / 2);
  border-radius: 50%; background: var(--c); border: 2px solid var(--m-tierra);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
  transition: background-color .45s, width .35s var(--sale), height .35s var(--sale), margin .35s var(--sale), box-shadow .35s;
}
.compact .spot { border-width: 1.5px; }
.tiny .spot { border-width: 1px; }
/* Las que están mejor a esta hora (hasta tres): insignia grande con la ola de la marca y
   un pulso que sale del borde */
.spot.mejor { --d: 30px; border: 0; box-shadow: 0 0 0 2.5px var(--m-tierra), 0 0 0 4.5px var(--c), 0 4px 14px rgba(0, 0, 0, .5); }
.compact .spot.mejor { --d: 24px; }
.tiny .spot.mejor { --d: 18px; }
.spot .ola-marca { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: var(--ink); stroke-width: 3.4; stroke-linecap: round; display: none; }
.spot.mejor .ola-marca, .spot.par.dicha .ola-marca { display: block; }
.spot.mejor::after, .spot.par::after {
  content: ""; position: absolute; inset: -4.5px; border-radius: 50%; border: 2px solid var(--c); opacity: 0; pointer-events: none;
  animation: pulso 2.6s var(--sale) infinite;
}
@keyframes pulso { 0% { transform: scale(1); opacity: .75; } 70%, 100% { transform: scale(1.75); opacity: 0; } }
/* Más de tres igual de bien: todas con aro; las dos que el titular nombra, además, con la ola */
.spot.par { --d: 18px; border: 0; box-shadow: 0 0 0 2px var(--m-tierra), 0 0 0 3.5px var(--c), 0 2px 8px rgba(0, 0, 0, .5); }
.spot.par.dicha { --d: 26px; }
.compact .spot.par { --d: 14px; }
.compact .spot.par.dicha { --d: 22px; }
.tiny .spot.par { --d: 10px; }
.tiny .spot.par.dicha { --d: 16px; }
.spot.par::after { inset: -3.5px; animation-duration: 3.2s; }
.spot.sel { box-shadow: 0 0 0 2.5px var(--foam), 0 4px 14px rgba(0, 0, 0, .5); }
.spot.sel:not(.mejor):not(.par) { --d: 20px; border: 0; }
.spot-label {
  position: absolute; left: calc(100% + 6px); top: 50%; transform: translateY(-50%); white-space: nowrap;
  font-family: Inter, sans-serif; font-size: 11.5px; font-weight: 600; color: var(--foam);
  text-shadow: 0 1px 2px #04121b, 0 0 5px #04121b, 0 0 1px #04121b; pointer-events: none;
}
.spot-label.left { left: auto; right: calc(100% + 6px); }
/* Dos destacadas pegadas: el nombre de la segunda va un renglón más abajo o más arriba */
.spot-label.baja { top: calc(50% + 25px); }
.spot-label.sube { top: calc(50% - 25px); }
/* El nombre de las que están mejor va en una etiqueta de arena: se lee de lejos */
.spot.mejor .spot-label, .spot.par.dicha .spot-label, .spot.sel .spot-label {
  left: calc(100% + 9px); padding: 3px 9px 4px; border-radius: 999px;
  font-family: var(--titulo); font-size: 13.5px; font-weight: 800; letter-spacing: -0.01em;
  background: var(--sand); color: var(--ink); text-shadow: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}
.spot.mejor .spot-label.left, .spot.par.dicha .spot-label.left, .spot.sel .spot-label.left { left: auto; right: calc(100% + 9px); }
.spot.sel:not(.mejor):not(.dicha) .spot-label { background: var(--ink); color: var(--foam); border: 1px solid var(--foam); font-family: Inter, sans-serif; font-size: 12.5px; font-weight: 600; }
/* Spots fuera de la localidad elegida: apagados (el color del nivel se mezcla con el
   fondo; opacidad si el navegador no sabe mezclar colores) */
.spot.dim { opacity: .35; }
@supports (background: color-mix(in srgb, red 50%, blue)) {
  .spot.dim { opacity: 1; background: color-mix(in srgb, var(--c) 42%, var(--m-mar)); box-shadow: none; }
}
/* Referencias para ubicarse (texto hacia tierra, a la izquierda del punto) */
.ref {
  position: absolute; right: -3px; top: -7px; white-space: nowrap; display: flex; align-items: center; gap: 6px;
  flex-direction: row-reverse; font-size: 11px; font-weight: 500; color: #b4c7cf; letter-spacing: .03em;
  text-shadow: 0 0 4px var(--m-tierra), 0 0 2px var(--m-tierra); pointer-events: none;
}
.ref i { width: 5px; height: 5px; border-radius: 50%; border: 1px solid var(--sand); opacity: .8; flex: none; }
.far .ref { font-size: 10.5px; }
/* Las que de lejos se pisarían con las vecinas aparecen al acercarse (REFERENCES.desde, en beaches.js) */
.compact .ref.d12, .tiny .ref.d105 { display: none; }

/* ---------- hitos de la costa (hitos.js) ----------
   Un dibujo chico de trazo arena, sin fondo, para que no compita con los puntos de las
   playas; lo que en la realidad es rojo u óxido va en naranja y lo negro, en azul profundo.
   El nombre va al lado con el estilo de las referencias. */
.hito-icon { overflow: visible !important; }
.hito-icon[hidden], .hito [hidden], .hito-globo[hidden] { display: none !important; }
.hito-icon:focus-visible { outline: none; }
.hito-icon:focus-visible .hito > svg { outline: 2px solid var(--foam); outline-offset: 3px; border-radius: 6px; }
.hito { position: absolute; left: 0; top: 0; width: 0; height: 0; cursor: pointer; }
.hito::after { content: ""; position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; } /* para el dedo */
.hito > svg { position: absolute; left: -13px; top: -13px; width: 26px; height: 26px; overflow: visible; filter: drop-shadow(0 0 2px var(--m-tierra)) drop-shadow(0 1px 3px rgba(0, 0, 0, .55)); transition: transform .18s var(--sale); }
.far .hito > svg { left: -11px; top: -11px; width: 22px; height: 22px; }
.hito:hover > svg { transform: scale(1.15); }
.hito.abierto > svg { filter: drop-shadow(0 0 3px var(--sand)); }
.hito .hl { fill: none; stroke: var(--sand); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.hito .hl.ht { stroke-width: .8; }
.hito .hl.hg { stroke-width: 2; }
.hito .hf { fill: var(--sand); }
.hito .ho { fill: var(--ink); stroke: var(--sand); stroke-width: 1.1; stroke-linejoin: round; }
.hito .hk { fill: var(--ink); }
/* (más apagado que el naranja de "Firme": en el mapa ese color es de las playas) */
.hito .ha { fill: var(--accent); fill: color-mix(in srgb, var(--accent) 58%, var(--ink)); }
.hito .hs { stroke: var(--sand); stroke-width: 1; stroke-linejoin: round; }
.hito .hd { fill: none; stroke: var(--sand); stroke-width: 1; stroke-linecap: round; stroke-dasharray: 1.4 2.2; opacity: .55; }
/* El barco de Constitución: lo que se ve según la marea de la hora (hitos.js pone m-baja, m-media o m-alta) */
.hito .e-baja, .hito .e-media, .hito .e-alta { display: none; }
.hito.m-baja .e-baja, .hito.m-media .e-media, .hito.m-alta .e-alta { display: inline; }
.hito-n {
  display: none; position: absolute; left: 15px; top: -7px; white-space: nowrap; font-size: 11px; font-weight: 500; line-height: 14px;
  color: var(--sand); letter-spacing: .03em; text-shadow: 0 0 4px var(--m-tierra), 0 0 2px var(--m-tierra);
}
.hito.con-n .hito-n { display: block; }
.hito.izq .hito-n { left: auto; right: 15px; }
/* Corrido para no pisar una playa: una línea fina lo une a su lugar de verdad */
.hito-guia { position: absolute; left: 0; top: 0; height: 1px; background: var(--sand); opacity: .45; transform-origin: 0 50%; }
/* El globo: nombre, una línea y la fuente */
.hito-globo {
  position: absolute; z-index: 1000; width: min(250px, calc(100% - 16px)); padding: 10px 30px 10px 12px;
  background: var(--ink); color: var(--foam); border: 1px solid rgba(233, 216, 180, .45); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  font-size: 12.5px; line-height: 1.4;
}
.hito-globo b { display: block; font-family: var(--titulo); font-size: 14.5px; font-weight: 600; color: var(--sand); margin-bottom: 2px; }
.hito-globo p { margin: 0 0 4px; }
.hito-globo p.ahora { color: var(--sand); }
.hito-globo small { display: block; font-size: 11px; color: var(--muted); }
.leaflet-container .hito-globo a { color: var(--sand); } /* (Leaflet les pone su azul a los enlaces del mapa) */
.hito-x { position: absolute; right: 2px; top: 2px; width: 30px; height: 30px; border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; border-radius: 8px; }
.hito-x::after { content: ""; position: absolute; inset: -7px; } /* para el dedo: 44 px */
.hito-x:hover { color: var(--foam); }

/* ---------- barra de día y hora (al pie del mapa) ---------- */
.dock { flex: none; padding: 10px 14px 10px; background: var(--ink); border-top: 1px solid var(--ink-3); }
.dock-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
/* Los días: un control partido en tres */
.days { flex: 1; display: flex; gap: 0; padding: 3px; border-radius: 12px; background: var(--ink-2); max-width: 320px; }
.days button {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  padding: 7px 4px; border-radius: 9px; font-size: 13px; font-weight: 600; text-transform: capitalize;
  transition: background .25s, color .25s;
}
.days button.on { background: var(--ink-3); color: var(--foam); box-shadow: inset 0 0 0 1px rgba(233, 216, 180, .35); }
/* Pausar el movimiento del mapa */
.pausa { flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin-left: auto; padding: 0; border-radius: 50%; background: transparent; border: 1px solid var(--ink-3); color: var(--muted); transition: color .2s, border-color .2s; }
.pausa:hover { color: var(--foam); }
.pausa[hidden] { display: none; }
.pausa svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pausa .i-seguir { display: none; fill: currentColor; stroke-width: 1.5; }
.pausa.on { border-color: var(--sand); color: var(--sand); }
.pausa.on .i-pausa { display: none; }
.pausa.on .i-seguir { display: block; }
/* La hora que se está viendo, en grande */
.map-when { position: relative; min-width: 52px; text-align: right; font-family: var(--titulo); font-weight: 800; font-size: 24px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* "de noche" va chico, debajo de la hora: no le saca lugar a los días */
.map-when small { position: absolute; right: 0; top: 100%; margin-top: 1px; font-family: Inter, sans-serif; font-size: 10px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.map-when:empty { display: none; }
/* Solo en celular: lleva a la lista o, con una playa elegida, a su ficha; a su lado, el aviso del próximo swell */
.mapbar, .sw-chip { display: none; }
/* La marea del día, sobre las mismas columnas de la tira: el agua sube y baja, y cada
   pleamar y bajamar lleva su hora (panel.js) */
.marea-fila { position: relative; height: 20px; margin-bottom: 3px; font-size: 10px; font-variant-numeric: tabular-nums; }
.marea-fila[hidden] { display: none; }
.marea-fila svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.marea-fila .agua { fill: var(--m-orilla); opacity: .16; }
.marea-fila .linea { fill: none; stroke: var(--m-orilla); stroke-width: 1.2; opacity: .7; vector-effect: non-scaling-stroke; }
.marea-fila span { position: absolute; transform: translateX(-50%); white-space: nowrap; padding: 0 3px; border-radius: 4px; background: var(--ink); color: var(--muted); line-height: 12px; }
.marea-fila .pleamar { top: 0; color: var(--foam); }
.marea-fila .bajamar { bottom: 0; }
/* La hora: el control de siempre (un range), transparente, sobre la tira del día. El
   pulgar es un marco del ancho de una columna: muestra qué hora de la tira está elegida. */
.hour { position: relative; height: 54px; container-type: inline-size; }
.tira { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(17, 1fr); align-items: end; pointer-events: none; }
.tira span { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; padding: 0 2px; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tira i { display: block; width: 58%; max-width: 16px; min-height: 3px; border-radius: 4px 4px 1px 1px; background: var(--c, var(--ink-3)); transition: height .45s var(--sale), background-color .45s; }
.tira b { height: 14px; line-height: 14px; font-weight: 500; }
.tira .on b { color: var(--foam); font-weight: 600; }
/* Horas de noche: rayadas y apagadas; no cuentan para la mejor hora */
.tira .noche i { opacity: .7; background: transparent; box-shadow: inset 0 0 0 1.5px var(--c, var(--ink-3)); }
/* La hora del veredicto: un punto de arena arriba de su barra */
.tira .mejor::before { content: ""; flex: none; width: 5px; height: 5px; margin-bottom: 3px; border-radius: 50%; background: var(--sand); }
.tira .nd i { background: none; border-top: 1px dashed var(--muted); min-height: 0; height: 0 !important; }
.hour input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0;
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; accent-color: var(--accent);
}
.hour input::-webkit-slider-runnable-track { height: 100%; background: transparent; }
.hour input::-moz-range-track { height: 100%; background: transparent; }
.hour input::-webkit-slider-thumb {
  /* 20 px si el navegador no conoce las unidades de contenedor (cqw) */
  -webkit-appearance: none; appearance: none; width: 20px; width: calc(100cqw / 17); height: 54px; border-radius: 10px;
  background: rgba(233, 216, 180, .12); border: 1.5px solid var(--sand); box-shadow: none;
}
.hour input::-moz-range-thumb {
  width: 20px; width: calc(100cqw / 17); height: 51px; border-radius: 10px;
  background: rgba(233, 216, 180, .12); border: 1.5px solid var(--sand); box-shadow: none;
}
.hour input:focus-visible { outline-offset: 3px; border-radius: 9px; }

/* ---------- panel: el mar de esa hora ---------- */
.sea { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 14px 0 6px; border-radius: var(--radius); background: var(--ink-2); }
.sea div { padding: 11px 12px 12px; }
.sea div + div { border-left: 1px solid var(--ink); }
.sea small { display: block; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; }
.sea small + strong + small { text-transform: none; letter-spacing: 0; font-size: 12px; }
.sea .aire { grid-column: 1 / -1; margin: 0; padding: 7px 12px 8px; border-top: 1px solid var(--ink); color: var(--muted); font-size: 12px; }
.sea div:nth-child(3) strong { font-size: 17px; margin: 5px 0 2px; } /* "Subiendo" entra en un tercio de celular */
.sea strong { font-family: var(--titulo); font-weight: 800; font-size: 20px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 6px; margin: 3px 0 1px; }

.arrow { display: inline-block; width: 14px; height: 14px; transition: transform .5s var(--sale); }
.arrow svg { width: 100%; height: 100%; fill: var(--sand); }

.status { color: var(--muted); font-size: 14px; padding: 8px 0; }
.status.err { color: #ffb4a0; }
.status button { margin-left: 6px; background: var(--sand); color: var(--ink); border: 0; padding: 4px 10px; border-radius: 8px; font-weight: 600; }

/* ---------- lista de playas ---------- */
/* ---------- panel: el próximo swell grande ---------- */
.swell { margin: 12px 0 0; padding: 12px 14px 6px; border-radius: var(--radius); background: var(--ink-2); }
.swell[hidden] { display: none; }
.swell h2 { margin: 0 0 4px; font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.swell p { margin: 0; }
.sw-main { font-family: var(--titulo); font-size: 20px; letter-spacing: -0.01em; color: var(--sand); }
.sw-main b { font-weight: 800; color: var(--foam); }
.sw-sub { margin-top: 2px; font-size: 13px; color: var(--foam); font-variant-numeric: tabular-nums; }
.sw-conf { font-size: 12.5px; line-height: 1.45; color: var(--sand); }
.sw-pie { margin-top: 4px; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.sw-pie summary { display: flex; align-items: center; min-height: 32px; cursor: pointer; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; list-style: none; }
.sw-pie summary::-webkit-details-marker { display: none; }
.sw-pie p { padding-bottom: 4px; }
/* Una barra por día (alto = metros); la raya es el alto de "grande" */
.sw-tira { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; height: 62px; margin: 10px 0 8px; padding-bottom: 14px; }
.sw-tira::before { content: ""; position: absolute; left: 0; right: 0; bottom: calc(14px + (100% - 14px) * var(--raya)); border-top: 1px dashed var(--muted); opacity: .6; }
.sw-tira span { position: relative; display: flex; align-items: flex-end; height: 100%; }
.sw-tira i { display: block; width: 100%; border-radius: 3px 3px 1px 1px; background: var(--ink-3); }
.sw-tira .ya i { opacity: .55; }
.sw-tira .uno i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); }
.sw-tira .dos i { background: var(--accent); }
.sw-tira b { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); font-size: 10px; font-weight: 500; line-height: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sw-tira .este b { color: var(--foam); font-weight: 600; }
.sw-tira .techo i { background: var(--muted); }

.list-title { font-family: var(--titulo); font-size: 19px; letter-spacing: -0.01em; margin: 22px 0 10px; }
.ranking { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.ranking li + li { border-top: 1px solid var(--ink-2); }
.ranking .empty { padding: 10px 12px; color: var(--muted); font-size: 13px; line-height: 1.45; }
/* Cada renglón es un botón: abre (o cierra) la ficha de esa playa */
.ranking button {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 10px;
  width: 100%; min-height: 52px; text-align: left; color: var(--foam);
  padding: 11px 10px; border-radius: 10px; background: transparent;
  border: 1px solid transparent; transition: background .2s, border-color .2s;
}
.ranking button:hover { background: var(--ink-2); }
.ranking button[aria-pressed="true"] { border-color: var(--sand); background: var(--ink-2); }
.ranking .name { font-weight: 600; font-size: 14px; }
/* Las que están mejor: nombre grande */
.ranking .mejor .name { font-size: 17px; font-family: var(--titulo); font-weight: 800; letter-spacing: -0.01em; }
.ranking .meta { grid-column: 1 / -1; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
/* El nivel va escrito en claro, con un punto del color: no depende solo del color */
.ranking .tier { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.ranking .tier i { width: 9px; height: 9px; border-radius: 50%; }
/* La barra compara: el largo es el puntaje y el color, el nivel. El número no se muestra. */
.ranking .bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--ink-3); overflow: hidden; }
.ranking .bar i { display: block; height: 100%; border-radius: 3px; transition: width .5s var(--sale), background-color .45s; }
.ranking .bar.nd { background: none; border-top: 1px dashed var(--muted); height: 0; }

.pill {
  display: grid; place-items: center; width: 42px; height: 34px; border-radius: 10px;
  font-family: var(--titulo); font-weight: 800; font-size: 17px; color: var(--ink);
}

/* Nivel de la playa en la ficha: una etiqueta del color del nivel */
.lvl { flex: none; padding: 6px 10px; border-radius: 10px; font-family: var(--titulo); font-weight: 800; font-size: 15px; color: var(--ink); }
.dot { flex: none; width: 12px; height: 12px; border-radius: 50%; }

/* ---------- ficha de la playa ---------- */
.detail { background: var(--ink-2); border-radius: var(--radius); padding: 16px; margin-top: 10px; border: 1px solid var(--ink-3); animation: entra .35s var(--sale) both; }
.detail header { display: flex; align-items: center; gap: 12px; }
.detail h2 { margin: 0; font-family: var(--titulo); font-size: 22px; letter-spacing: -0.015em; }
.detail .meta { color: var(--muted); font-size: 12px; }
.detail .close { flex: none; margin-left: auto; width: 44px; height: 44px; border-radius: 50%; background: transparent; border: 0; color: var(--muted); font-size: 24px; line-height: 1; }
.detail .close:hover { background: var(--ink-3); color: var(--foam); }
.detail .note { color: var(--muted); font-size: 13px; margin: 10px 0; }
/* Aviso de datos estimados por la orientación de la costa (playas sin guía propia) */
.detail .nodata { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--ink-3); font-size: 13px; line-height: 1.45; }
.detail .facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; font-size: 13px; }
.detail .facts span { color: var(--muted); }
/* La marea ocupa el renglón entero: cómo viene y las pleamares y bajamares del día */
.detail .facts .wide { grid-column: 1 / -1; }
.detail .mareas { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 3px; font-size: 12px; font-variant-numeric: tabular-nums; }
.detail .mareas span { color: var(--foam); white-space: nowrap; }
.detail .mareas i { font-style: normal; font-size: 9px; color: var(--m-orilla); margin-right: 2px; }
.detail .mareas small { color: var(--muted); }
.detail .note.opin { margin: 10px 0 0; font-size: 12.5px; }
.detail .note.opin b { color: var(--foam); font-weight: 600; }
/* "Cómo es": el carácter de la playa, dato por dato y cada uno con su fuente (detalle.js).
   Lo que cuida al que entra ("Ojo con") va primero y con el color de la arena. */
.como { margin-top: 14px; padding-top: 2px; border-top: 1px solid var(--ink-3); }
.como .note { margin: 0 0 10px; color: var(--foam); font-size: 13.5px; line-height: 1.45; }
.como dl { margin: 0; display: grid; gap: 8px; font-size: 13px; line-height: 1.4; }
.como dl > div { display: grid; grid-template-columns: 74px 1fr; gap: 10px; }
.como dt { color: var(--muted); font-size: 12px; padding-top: 1px; }
.como dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.como .ojo dt { color: var(--sand); font-weight: 600; }
.como .ojo dd { color: var(--sand); }
.detail .f { font-size: 11px; color: var(--muted); white-space: nowrap; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
.detail .f.loc { text-decoration: none; white-space: normal; }
.detail a.f:hover { color: var(--foam); }
.como .falta { margin: 10px 0 0; font-size: 12px; color: var(--muted); font-style: italic; border-left: 2px solid var(--muted); padding-left: 8px; }
.como .aporta-p { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.detail .aporta { color: var(--sand); font-weight: 600; text-underline-offset: 3px; }
.detail .aporta:hover { color: var(--foam); }
/* Si la marea de la hora es la de esa playa (solo donde la hora de la marea está ajustada) */
.detail .su-marea { margin-top: 3px; font-size: 12.5px; font-weight: 600; color: var(--foam); }
.detail .su-marea.no { color: var(--sand); }
.detail .su-marea::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--t-bueno); vertical-align: 1px; }
.detail .su-marea.no::before { background: transparent; border: 1.5px solid var(--sand); }
.detail .strip-title { font-size: 12px; color: var(--muted); margin: 14px 0 6px; display: flex; justify-content: space-between; gap: 10px; }
/* Tira hora por hora: cada columna es un botón con puntaje, barra del color del nivel y hora */
.strip { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 1px; }
.strip button {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0;
  border: 0; padding: 4px 0; border-radius: 6px; background: transparent; color: var(--muted);
  font-size: 9.5px; font-variant-numeric: tabular-nums; letter-spacing: -0.03em;
}
.strip .col { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 48px; padding: 0 1px; }
.strip .col b { font-weight: 500; }
.strip .col i { display: block; width: 100%; border-radius: 3px 3px 1px 1px; opacity: .8; }
.strip .hh { font-size: 10.5px; }
/* La pleamar o la bajamar que cae en esa hora */
.strip .mk { position: absolute; top: 1px; left: 0; right: 0; text-align: center; font-size: 8px; line-height: 1; color: var(--m-orilla); pointer-events: none; }
.strip button:hover { background: var(--ink-3); }
.strip button[aria-pressed="true"] { background: var(--ink-3); color: var(--foam); font-weight: 600; box-shadow: inset 0 0 0 1px var(--sand); }
.strip button[aria-pressed="true"] .col i { opacity: 1; }
.strip button:focus-visible { outline-offset: -2px; }
/* Horas de noche: se ven, pero rayadas y apagadas; no cuentan para la mejor hora */
.strip .night .col i, .night-key i {
  background-image: repeating-linear-gradient(135deg, transparent 0 3px, var(--ink-2) 3px 6px);
}
.strip .night .col i { opacity: .45; }
.detail .night-key { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.night-key i { flex: none; width: 12px; height: 12px; border-radius: 2px; background-color: var(--muted); opacity: .7; }
/* En celular (o con dedo) las columnas se agrandan y la tira se desplaza de costado */
@media (max-width: 860px), (pointer: coarse) {
  .strip { grid-auto-columns: minmax(44px, 1fr); gap: 2px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .strip button { font-size: 11px; letter-spacing: 0; padding: 6px 0; }
  .strip .hh { font-size: 12px; }
}

.detail h3 { margin: 14px 0 8px; font-family: var(--titulo); font-size: 15px; }
.detail h3 small { font-family: Inter, sans-serif; font-weight: 500; font-size: 12px; color: var(--muted); }
.detail .facts small, .detail em { color: var(--muted); }

/* Qué le gusta a la playa: rosa chica + referencias. Bandas = lo ideal; flechas = lo de esa hora */
.likes { display: flex; align-items: center; gap: 14px; }
.likes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 13px; }
.likes li { display: flex; align-items: center; gap: 8px; }
.likes .k { flex: none; width: 16px; height: 5px; border-radius: 3px; }
.likes .k.like-swell { background: var(--sand); }
.likes .k.like-wind { background: var(--foam); }
.likes .k.now-swell { height: 2px; background: var(--sand); }
.likes .k.now-wind { height: 2px; background: var(--foam); }
.rose { flex: none; width: 104px; height: 104px; }
.rose circle { fill: none; stroke: var(--ink-3); stroke-width: 1.5; }
.rose path.like-swell, .rose path.like-wind { fill: none; stroke-width: 6; stroke-linecap: round; }
.rose path.like-swell { stroke: var(--sand); }
.rose path.like-wind { stroke: var(--foam); }
.rose g line { stroke-width: 2; stroke-linecap: round; }
.rose .now-swell line { stroke: var(--sand); }
.rose .now-swell path { fill: var(--sand); }
.rose .now-wind line { stroke: var(--foam); }
.rose .now-wind path { fill: var(--foam); }
.rose text { fill: var(--muted); font-size: 9px; font-weight: 600; paint-order: stroke; stroke: var(--ink-2); stroke-width: 4px; }

/* Cómo sale este número: un renglón por factor, con su valor a la derecha */
.calc { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.calc li { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--ink-3); }
.calc li > span { font-family: var(--titulo); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.calc small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.calc .sum { color: var(--sand); }
.calc .total { border-top: 2px solid var(--sand); font-variant-numeric: tabular-nums; }
.calc .total > span { font-size: 20px; }
.detail .links { margin-top: 12px; font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.detail .share {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px 0 10px;
  border-radius: 999px; background: var(--sand); color: var(--ink); font-weight: 600; text-decoration: none;
}
.detail .to-map { display: none; background: transparent; border: 0; padding: 0; color: var(--sand); text-decoration: underline; font-size: 13px; }

/* ¿Fuiste? ¿Cómo estaba?: tres opciones que se guardan en el navegador */
.went { margin-top: 14px; padding-top: 2px; border-top: 1px solid var(--ink-3); font-size: 13px; }
.went-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.went-opts button {
  min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--ink-3);
  background: transparent; color: var(--foam); font-size: 13px; font-weight: 500;
}
.went-opts button[aria-pressed="true"] { background: var(--sand); border-color: var(--sand); color: var(--ink); font-weight: 600; }
.went-opts button:disabled { color: var(--muted); cursor: default; border-style: dashed; }
.went p { margin: 8px 0 0; }
.went-note { color: var(--muted); font-size: 12px; }
.went ul { margin: 4px 0 0; padding-left: 18px; }
.went-forget { margin-top: 6px; padding: 6px 0; background: transparent; border: 0; color: var(--sand); text-decoration: underline; font-size: 12px; }

/* Plegables de la ficha: qué le gusta a la playa y cómo sale el número */
.fold { margin-top: 12px; border-top: 1px solid var(--ink-3); }
.fold + .fold { margin-top: 0; }
.fold summary {
  display: flex; align-items: center; justify-content: space-between; min-height: 46px; cursor: pointer;
  list-style: none; font-family: var(--titulo); font-weight: 800; font-size: 15px;
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: "+"; color: var(--sand); font-size: 22px; font-weight: 500; }
.fold[open] summary::after { content: "–"; }
.fold[open] { padding-bottom: 10px; }
.detail .fold + .note { border-top: 1px solid var(--ink-3); border-left: 0; padding: 10px 0 0; margin: 0; }

.sources { margin-top: 26px; font-size: 12px; color: var(--muted); line-height: 1.5; border-top: 1px solid var(--ink-3); padding-top: 12px; }
.sources p { margin: 0 0 8px; }
.sources summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--sand); font-weight: 600; }

/* ---------- celular ---------- */
@media (max-width: 860px) {
  /* Todo apilado: arriba la marca y el veredicto; después el mapa con su barra de día y
     hora, hasta el borde de abajo de la pantalla; el panel sigue al deslizar. */
  body { display: block; }
  .layout { display: block; }
  .hero, .aviso, .panel { border-left: 0; }
  .hero { --bajo-ola: var(--m-mar); } /* el agua de la línea de ola es el mar del mapa, que empieza ahí */
  .top { padding: 9px 14px 0; }
  .brand { font-size: 19px; gap: 7px; }
  .brand svg { width: 22px; height: 22px; }
  .brand small { display: none; }
  .verdict { padding: 8px 4px 6px 14px; gap: 3px; }
  .verdict .v-main { font-size: 27px; line-height: 1.06; }
  .verdict .v-why { font-size: 12px; margin-top: 1px; } /* el rango de varias playas ("1.0–1.1 m · 8 s · offshore 21–26 km/h") entra en un renglón */
  /* Compartir sube a la altura de la marca: el titular usa todo el ancho */
  .share-v { position: absolute; right: 4px; top: 0; margin: 0; }
  .verdict .v-when { padding-right: 40px; }
  .ola { height: 20px; }
  /* --arriba es dónde empieza el mapa (lo mide app.js; 170 px si todavía no midió): el
     mapa y su barra toman justo lo que queda de la pantalla. Un veredicto más alto achica
     el mapa en vez de empujar la barra fuera de la pantalla. */
  .map-wrap { height: 72vh; height: calc(100svh - var(--arriba, 170px)); min-height: 430px; }
  /* Sin mapa no tiene sentido guardarle la pantalla: queda el aviso y el ranking sube */
  .map-wrap.sin-mapa { height: auto; min-height: 0; }
  .sin-mapa .map-area { flex: none; }
  .sin-mapa .map-msg { position: static; padding: 12px 14px; justify-content: flex-start; text-align: left; border-bottom: 1px solid var(--ink-3); }
  .aviso { padding: 8px 12px; }
  .panel { overflow: visible; padding: 2px 14px 28px; }
  /* Para el dedo: todo lo que se toca mide 44 px o más */
  .pausa { width: 44px; height: 44px; }
  .legend { height: 44px; bottom: 16px; }
  .days button, .home, .volver, .status button,
  .went-opts button, .went-forget, .detail .share, .detail .links a, .detail .to-map { min-height: 44px; }
  .leaflet-bar a { width: 44px !important; height: 44px !important; line-height: 44px !important; }
  /* "Ver playas": el último renglón de la barra, de lado a lado; es la manija de lo que sigue abajo */
  .mapbar {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; margin-top: 6px; padding: 0 8px;
    border: 0; border-top: 1px solid var(--ink-2); background: transparent; color: var(--foam); font-size: 13px; font-weight: 600;
    overflow: hidden; white-space: nowrap;
  }
  .mapbar > span:first-of-type { overflow: hidden; text-overflow: ellipsis; }
  /* El pie de la barra: el aviso del swell a la izquierda y "Ver playas" con el resto del ancho */
  .dock-pie { display: flex; align-items: stretch; margin-top: 6px; border-top: 1px solid var(--ink-2); }
  .dock-pie .mapbar { flex: 1; width: auto; min-width: 0; margin-top: 0; border-top: 0; }
  .sw-chip { display: flex; align-items: center; gap: 5px; flex: none; max-width: 62%; min-height: 44px; padding: 0 12px 0 2px; border: 0; border-right: 1px solid var(--ink-2); background: transparent; color: var(--sand); font-size: 12px; white-space: nowrap; overflow: hidden; }
  .sw-chip[hidden] { display: none; }
  .sw-pie summary { min-height: 44px; }
  .sw-chip b { color: var(--foam); font-weight: 600; }
  .mapbar .go { color: var(--sand); white-space: nowrap; }
  .dock { padding: 8px 12px env(safe-area-inset-bottom, 0px); }
  .tiers { max-height: calc(100% - 78px); bottom: 68px; }
  .detail .links a, .detail .to-map { display: inline-flex; align-items: center; }
}
/* Pantallas bajas (celular chico o apaisado): la explicación de los niveles se aprieta */
@media (max-width: 860px) and (max-height: 700px) {
  .tiers { padding: 8px 12px; }
  .tiers ul { gap: 3px; }
  .tiers p { margin-top: 6px; }
  .verdict .v-main { font-size: 24px; }
}

/* Sin movimiento si el sistema lo pide (mapa.js además le saca las animaciones al mapa y
   mar.js deja un cuadro quieto) */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- regiones y provincia (ronda 13) ---------- */
/* El selector de región, al lado de la marca: un select del sistema con piel de pastilla.
   En el celular abre la lista de siempre del teléfono. */
.region { margin-left: auto; display: flex; min-width: 0; padding-left: 12px; }
.region select {
  appearance: none; -webkit-appearance: none; max-width: 100%; min-height: 36px; padding: 6px 30px 6px 13px;
  border-radius: 999px; border: 1px solid rgba(233, 216, 180, .3); color: var(--foam);
  background: rgba(12, 31, 44, .5) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23e9d8b4' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 10px 6px;
  font: 600 12.5px Inter, sans-serif; text-overflow: ellipsis; cursor: pointer;
}
.region select:hover { border-color: rgba(233, 216, 180, .55); }
.region select option { color: #0c1f2c; background: #fff; }

/* Las pastillas de las regiones sobre el mapa. El marcador de Leaflet no mide nada: la
   pastilla se cuelga de él, hacia tierra (.o) o debajo, sobre el mar (.s). */
.reg-icon { overflow: visible !important; }
.reg-icon:focus-visible { outline: none; }
.reg-icon:focus-visible .reg { outline: 3px solid var(--foam); outline-offset: 2px; }
.reg {
  position: absolute; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px 6px 9px; border-radius: 999px;
  white-space: nowrap; cursor: pointer; background: rgba(12, 31, 44, .93); border: 1px solid rgba(233, 216, 180, .32);
  color: var(--foam); font: 600 12.5px Inter, sans-serif; box-shadow: 0 2px 10px rgba(0, 0, 0, .4);
}
.reg::after { content: ""; position: absolute; inset: -8px -4px; } /* para el dedo: 44 px de alto */
.reg:hover { border-color: var(--sand); }
.reg i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.reg.nd i { background: none; border: 1.5px dashed var(--muted); }
.reg span { font-weight: 500; color: var(--sand); }
.reg.o { right: 10px; top: 0; transform: translateY(-50%); }
.reg.se { left: -14px; top: 12px; }
.reg.ne { left: -14px; bottom: 12px; }
.reg.activa { border-color: var(--sand); }
/* Mirando la provincia, las playas son puntos sin marca ni nombre, y las referencias no van */
#map.prov { --lado: 6px; }
.prov .spot, .prov .spot.mejor, .prov .spot.par, .prov .spot.par.dicha, .prov .spot.sel:not(.mejor):not(.par) { --d: 6px; border: 0; box-shadow: none; }
.prov .spot::after, .prov .spot .ola-marca, .prov .ref, .prov .lead, .prov .real { display: none !important; }
.prov .spot.dim { opacity: 1; }

/* El bloque de la provincia en el panel: una fila por región, de norte a sur */
.provincia { margin: 12px 0 0; padding: 12px 14px 8px; border-radius: var(--radius); background: var(--ink-2); }
.provincia[hidden], .ver-prov[hidden] { display: none; }
.provincia h2 { margin: 0 0 4px; font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.provincia p { margin: 0; }
.pr-main { font-family: var(--titulo); font-size: 17px; letter-spacing: -0.01em; color: var(--foam); padding-bottom: 6px; }
.pr-main b { color: var(--sand); font-weight: 800; }
.provincia ol { list-style: none; margin: 0; padding: 0; }
.provincia li { border-top: 1px solid var(--ink-3); }
.provincia button { width: 100%; min-height: 50px; display: flex; align-items: center; gap: 10px; padding: 6px 2px; border: 0; background: none; color: var(--foam); text-align: left; font: inherit; cursor: pointer; }
.provincia button:hover .pr-nombre b { color: var(--sand); }
.pr-nombre { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pr-nombre b { font-size: 14px; font-weight: 600; }
.pr-nombre small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* La región que se está mirando: su punto lleva un aro (el lector de pantalla oye aria-current) */
.provincia button[aria-current] .dot { box-shadow: 0 0 0 2px var(--ink-2), 0 0 0 3.5px var(--sand); }
.pr-nivel { flex: none; font-size: 13px; color: var(--muted); }
.pr-nivel.mejor { color: var(--sand); font-weight: 600; }
.pr-pie { padding-top: 6px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--ink-3); }
.ver-prov { margin-top: 14px; width: 100%; min-height: 44px; border-radius: 999px; border: 1px solid rgba(233, 216, 180, .3); background: none; color: var(--sand); font: 600 13px Inter, sans-serif; cursor: pointer; }
.ver-prov:hover { border-color: var(--sand); }

@media (max-width: 860px) {
  /* A la derecha queda el botón de compartir (44 px): el selector no llega hasta ahí */
  .top { padding-right: 52px; }
  .region select { min-height: 44px; }
}
