/* ===== VARIABLES DE COLOR =====
   Definimos los colores una vez. En modo oscuro solo cambiamos estas variables
   y TODA la web se adapta sola. */
:root {
  --azul-mar: #0b6e99;
  --turquesa: #2ab7ca;
  --sol: #f4a261;
  --texto: #1d3557;
  --fondo-panel: rgba(255, 255, 255, .96);
  --borde: #e5e5e5;
  --suave: #555;
  --caja: #eef7fa;
  --alto-cabecera: 64px;
}
/* html[data-tema="oscuro"]: JavaScript pone este atributo al activar el modo oscuro */
html[data-tema="oscuro"] {
  --azul-mar: #5cc8e6;
  --texto: #e6edf3;
  --fondo-panel: rgba(22, 27, 34, .96);
  --borde: #30363d;
  --suave: #9aa4ae;
  --caja: #1f2a36;
}
* { box-sizing: border-box; } /* el tamaño incluye bordes y relleno */

/* El body ocupa TODA la ventana y no hace scroll: el mapa es la protagonista.
   100dvh = altura real visible en móviles (descontando barras del navegador) */
html, body { margin: 0; height: 100%; }
body {
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;   /* cabecera arriba, mapa debajo */
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--texto);
  overflow: hidden;
}

/* ===== CABECERA COMPACTA ===== */
header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: .5rem; padding: .4rem .8rem;
  color: white;
  background: linear-gradient(135deg, #0b6e99, #2ab7ca);
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
  z-index: 1000; /* por encima del mapa */
}
html[data-tema="oscuro"] header { background: linear-gradient(135deg, #0d1b2a, #1b3a4b); }
.marca { display: flex; align-items: center; gap: .6rem; }
.logo { width: 44px; height: 44px; border-radius: 50%; background: white; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
header h1 { margin: 0; font-size: 1.35rem; }

/* Botones con forma de píldora */
.modos { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.modos button, .modos select {
  border: 2px solid white; background: rgba(255,255,255,.15); color: white;
  padding: .3rem .8rem; border-radius: 999px; font-size: .9rem; cursor: pointer;
}
.modos select option { color: #1d3557; }
.modos button.activo { background: white; color: #0b6e99; }
.icono-btn { padding: .3rem .55rem !important; font-size: 1rem !important; }

/* ===== MAPA A PANTALLA COMPLETA ===== */
/* main se estira (flex: 1) para ocupar todo lo que deja la cabecera */
main { position: relative; flex: 1; min-height: 0; }
#mapa { position: absolute; inset: 0; } /* inset: 0 = pegado a los 4 bordes */

/* ===== PANEL FLOTANTE (cajón lateral) ===== */
.panel {
  position: absolute; top: 12px; left: 12px; bottom: 12px;
  width: 360px; max-width: calc(100% - 24px);
  background: var(--fondo-panel); color: var(--texto);
  border-radius: 16px; box-shadow: 0 6px 24px rgba(0,0,0,.3);
  z-index: 900; display: flex; flex-direction: column;
  transition: transform .3s ease; /* animación al abrir/cerrar */
}
/* Cerrado: lo sacamos de la pantalla hacia la izquierda, dejando ver el asa */
.panel.cerrado { transform: translateX(calc(-100% - 12px)); }
.asa {
  position: absolute; top: 10px; right: -118px; width: 110px;
  border: none; border-radius: 0 10px 10px 0; padding: .45rem .6rem;
  background: var(--fondo-panel); color: var(--texto); font-weight: bold; cursor: pointer;
  box-shadow: 4px 2px 10px rgba(0,0,0,.2);
}
#panel-contenido { overflow-y: auto; padding: 1rem; }
.panel h2 { margin: 0 0 .2rem; color: var(--azul-mar); font-size: 1.25rem; }
.panel .ahora { display: flex; align-items: center; gap: .8rem; margin: .4rem 0 .6rem; }
.panel .ahora .icono { font-size: 2.6rem; }
.panel .ahora .temp { font-size: 2rem; font-weight: bold; color: var(--azul-mar); }
.panel h3 { margin: 1rem 0 .3rem; font-size: 1rem; }

/* Filas de los 7 días */
.dia { display: flex; align-items: center; justify-content: space-between; padding: .4rem .2rem; border-bottom: 1px solid var(--borde); gap: .4rem; }
.dia .nombre { width: 58px; font-weight: bold; text-transform: capitalize; }
.dia .icono { font-size: 1.4rem; }
.max { color: #e63946; font-weight: bold; }
.min { color: var(--azul-mar); }
.dia small { color: var(--suave); font-size: .78rem; text-align: right; }
.dia-sol { font-size: .72rem; color: var(--suave); padding: 0 .3rem .4rem; border-bottom: 1px solid var(--borde); }

/* Caja base / cima */
.puerto { display: flex; justify-content: space-between; align-items: center; gap: .4rem;
  background: var(--caja); border-radius: 12px; padding: .6rem; text-align: center; font-size: .85rem; }
.puerto .t { font-size: 1.4rem; font-weight: bold; color: var(--azul-mar); }
.puerto .desnivel { color: var(--suave); }
.sol { font-size: .9rem; }

/* Semáforo "apto para rodar" */
.apto { padding: .6rem; border-radius: 12px; font-weight: bold; margin: .5rem 0; }
.apto.bueno { background: #d8f3dc; color: #1b4332; }
.apto.precaucion { background: #fff3bf; color: #7a5c00; }
.apto.malo { background: #ffd6d6; color: #8a1c1c; }
.apto ul { margin: .3rem 0 0; padding-left: 1.2rem; font-weight: normal; font-size: .85rem; }

/* Tabla de horas */
.horas { width: 100%; border-collapse: collapse; font-size: .78rem; }
.horas th, .horas td { padding: 3px 2px; text-align: center; border-bottom: 1px solid var(--borde); }
.flecha { display: inline-block; }

/* ===== MARCADORES ===== */
.insignia {
  background: white; color: #1d3557; border: 3px solid; border-radius: 12px;
  padding: 1px 6px; font-weight: bold; font-size: 13px; white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0,0,0,.3); text-align: center;
}
/* Puntos de interés: chapa redonda de color (cada capa el suyo) + borde blanco */
.poi { font-size: 14px; width: 26px; height: 26px; line-height: 22px; text-align: center;
  border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.5); }
.cluster-poi { width: 32px; height: 32px; line-height: 28px; border-radius: 50%; text-align: center;
  color: #fff; font-weight: bold; font-size: 13px; border: 2px solid #fff; box-shadow: 0 0 0 4px rgba(0,0,0,.18); }

/* ===== LEYENDA (abajo, centrada sobre el mapa) ===== */
.leyenda {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  z-index: 800; display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center;
  background: var(--fondo-panel); color: var(--texto); padding: .35rem .8rem; border-radius: 999px;
  font-size: .78rem; box-shadow: 0 2px 10px rgba(0,0,0,.2); max-width: 70%;
}
.leyenda span { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }

/* Créditos: una línea pequeña al final */
footer { font-size: .7rem; text-align: center; padding: .2rem; background: var(--fondo-panel); color: var(--suave); }
footer a { color: var(--azul-mar); }

/* Modo oscuro para los controles y popups de Leaflet */
html[data-tema="oscuro"] .leaflet-bar a,
html[data-tema="oscuro"] .leaflet-control-layers,
html[data-tema="oscuro"] .leaflet-popup-content-wrapper,
html[data-tema="oscuro"] .leaflet-popup-tip { background: #161b22; color: #e6edf3; }
html[data-tema="oscuro"] .leaflet-popup-content a { color: #5cc8e6; }

/* ===== MÓVIL: el panel se convierte en "hoja inferior" (bottom sheet) ===== */
@media (max-width: 700px) {
  header h1 { font-size: 1rem; }
  .logo { width: 34px; height: 34px; }
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-width: none;
    height: 55%; border-radius: 16px 16px 0 0; }
  .panel.cerrado { transform: translateY(calc(100% - 40px)); } /* solo asoma el asa */
  .asa { position: static; width: 100%; border-radius: 16px 16px 0 0; box-shadow: none; }
  .leyenda { display: none; }
}

/* Mapa oscuro: invertimos los colores de las teselas y giramos el tono 180°
   para que el mar siga siendo azul. Solo afecta al fondo, no a marcadores. */
html[data-tema="oscuro"] .leaflet-container { background: #1a1d21; }

/* Icono doble (☕🚴) más ancho y dorado para las paradas míticas */
.poi-ancho { width: 40px; border-radius: 13px; }
.poi-ancho small { font-size: 10px; }
/* Lugares recomendados: borde dorado grueso */
.poi-estrella { border: 2px solid #f4a261; box-shadow: 0 0 0 2px rgba(244,162,97,.4); }

/* Modo oscuro: más contraste en clústeres de las subidas, insignias y controles */
html[data-tema="oscuro"] .leaflet-control-layers-expanded { color: #e6edf3; }
html[data-tema="oscuro"] .leaflet-control-attribution { background: rgba(22,27,34,.85); color: #9aa4ae; }
html[data-tema="oscuro"] .leaflet-control-attribution a { color: #5cc8e6; }
html[data-tema="oscuro"] .marker-cluster div { color: #111; }
html[data-tema="oscuro"] .poi, html[data-tema="oscuro"] .cluster-poi { border-color: #e6edf3; }
html[data-tema="oscuro"] .leaflet-popup-content { color: #e6edf3; }

/* ===== AVISOS OFICIALES (banda flotante arriba del mapa) ===== */
.avisos { position: absolute; top: 10px; right: 64px; z-index: 850;
  max-width: min(55%, 640px); padding: .35rem .8rem; border-radius: 12px; font-size: .8rem;
  background: var(--fondo-panel); color: var(--texto); box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.avisos a { color: inherit; font-weight: bold; }
.avisos.ninguno { border: 2px solid #2d6a4f; border-radius: 999px; }
.avisos.sin-datos { border: 2px dashed #999; border-radius: 999px; }
.avisos.nivel-amarillo { background: #fff3bf; color: #3d3000; border: 2px solid #f2c200; }
.avisos.nivel-naranja  { background: #ffe0c2; color: #4a2300; border: 2px solid #f77f00; }
.avisos.nivel-rojo     { background: #ffd6d6; color: #5c0000; border: 2px solid #d00000; }
.aviso-item { display: inline-block; margin: 0 .3rem; }
.aviso-item i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 3px; vertical-align: middle; }

/* ===== PESTAÑAS DE DÍAS (panel) ===== */
.pestanas { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.pestanas button { flex: 0 0 auto; font-size: .72rem; line-height: 1.3; padding: 4px 6px; border-radius: 8px;
  border: 1px solid var(--suave); background: var(--fondo-panel); color: var(--texto); cursor: pointer; }
.pestanas button.activo { background: var(--azul-mar); color: #fff; border-color: var(--azul-mar); }
.pestanas button.lejano { opacity: .7; border-style: dashed; }
.nota-fiable { font-size: .75rem; color: var(--suave); font-style: italic; }
@media (max-width: 700px) { .avisos { top: 6px; right: 56px; max-width: 75%; font-size: .72rem; } }

/* ===== MI UBICACIÓN ===== */
.yo { width: 18px; height: 18px; border-radius: 50%; background: #1e88e5; border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(30,136,229,.35); }
.aviso-fuera { background: #fff3bf; color: #3d3000; padding: .4rem .6rem; border-radius: 8px; font-size: .85rem; }
.cercanos { padding-left: 1.1rem; font-size: .85rem; }
.cercanos a { color: var(--azul-mar); }

/* ===== Perfil de subidas, ventana para rodar y ruta recomendada ===== */
.datos-subida { display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem; background: var(--caja);
  border-radius: 12px; padding: .5rem; font-size: .85rem; text-align: center; }
.datos-subida small { color: var(--suave); }
.perfil { width: 100%; height: auto; margin-top: .4rem; }
.perfil .linea { fill: none; stroke: var(--texto); stroke-width: 1.2; }
.perfil text { font-size: 9px; fill: var(--suave); text-anchor: middle; }
.perfil text.izq { text-anchor: start; }
.perfil text.pct { fill: var(--texto); font-weight: bold; }
.leyenda-pend { display: flex; gap: .5rem; flex-wrap: wrap; font-size: .72rem; color: var(--suave); }
.leyenda-pend i, .leyenda i.raya { display: inline-block; width: 14px; height: 8px; border-radius: 2px; margin-right: 3px; vertical-align: middle; }
.ventana { background: var(--caja); border-radius: 12px; padding: .5rem .6rem; margin: .5rem 0; font-size: .9rem; }
.ventana .motivos { font-size: .8rem; color: var(--suave); margin: .2rem 0 .35rem; }
.barra-horas { display: flex; gap: 2px; }
.barra-horas .celda { flex: 1; height: 22px; border-radius: 3px; opacity: .55; position: relative; }
.barra-horas .celda.dentro { opacity: 1; outline: 2px solid var(--texto); outline-offset: -2px; }
.barra-horas .celda span { position: absolute; bottom: -15px; left: 0; right: 0; text-align: center; font-size: .62rem; color: var(--suave); }
.barra-horas + .nota-fiable { margin-top: 18px; }
.sugerencia { border: 1px solid var(--borde); border-radius: 12px; padding: .2rem .6rem .4rem; margin: .5rem 0; font-size: .88rem; }
.sugerencia h3 { margin-top: .4rem; }
.sugerencia h4 { margin: .4rem 0 .1rem; font-size: .88rem; }
.sugerencia ul { margin: .2rem 0; padding-left: 1.1rem; }
.sugerencia a, .ventana a, .nota-fiable a { color: var(--azul-mar); }

/* Insignias del tiempo: versión compacta (móvil) y puntito para las que no caben */
.insignia.compacta { font-size: 11px; padding: 0 3px; border-width: 2px; border-radius: 10px; }
.puntito { width: 8px; height: 8px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.5); cursor: pointer; }
html[data-tema="oscuro"] .puntito { border-color: #161b22; }

/* Banda de avisos: una línea plegable; desplegada tiene su propio scroll y nunca crece sin límite */
.avisos { max-height: 45vh; overflow: hidden; display: flex; flex-direction: column; }
.avisos-resumen { all: unset; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.avisos-resumen:focus-visible { outline: 2px solid currentColor; }
.avisos-lista { overflow-y: auto; margin-top: .3rem; font-size: .78rem; }
.avisos-lista .aviso-item { display: block; margin: .2rem 0; }
.avisos-lista small { opacity: .85; }
@media (max-width: 700px) { .avisos { max-width: calc(100% - 70px); left: auto; max-height: 35vh; } }

/* ===== QUÉ PONERTE ===== */
.ropa { margin: .5rem 0; padding: .45rem .6rem; border-radius: 10px; border: 1px solid var(--borde, #ccd);
  background: rgba(11, 110, 153, .06); font-size: .85rem; }
.ropa .prendas { display: flex; flex-wrap: wrap; gap: 4px; margin: .3rem 0; }
.ropa .prendas span { padding: 2px 7px; border-radius: 999px; background: var(--fondo-panel); border: 1px solid var(--borde, #ccd); font-size: .78rem; }
html[data-tema="oscuro"] .ropa { background: rgba(92, 200, 230, .08); }

/* ===== SEGMENTOS DE STRAVA ===== */
.strava { margin: .5rem 0; font-size: .82rem; display: flex; flex-direction: column; gap: 2px; }
.strava a { color: #fc4c02; font-weight: bold; }
html[data-tema="oscuro"] .strava a { color: #ff7a3d; }
.strava small { color: var(--suave); margin: -2px 0 3px; }

/* ===== CIMA vs PIE ===== */
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: .2rem 0 .4rem; }
.chip { padding: 2px 8px; border-radius: 999px; font-size: .78rem; background: rgba(11,110,153,.1); }
.chip.frio { background: rgba(30, 136, 229, .18); font-weight: bold; }
.chip.mas { background: rgba(247, 127, 0, .18); font-weight: bold; }
.cima-pie td small { display: block; font-size: .68rem; color: var(--suave); }
.cima-pie td.frio { color: #1e88e5; font-weight: bold; }
.cima-pie b.mas { color: #e76f00; }
html[data-tema="oscuro"] .cima-pie td.frio { color: #64b5f6; }
html[data-tema="oscuro"] .cima-pie b.mas { color: #ffa94d; }
.cima-pie th small { font-weight: normal; }
/* Móvil: el mapa en su propio contexto de apilado → sus botones (+/−, capas) no se montan sobre el panel abierto */
@media (max-width: 700px) { #mapa { isolation: isolate; } }

/* =====================================================================
   NUEVO DISEÑO VISUAL (inspirado en Windy / Ventusky / myWindsock)
   Tarjetas con sombras suaves, tipografía Inter, mapa de colores, viento
   animado y barra de tiempo. Todo se adapta al modo oscuro con variables.
   ===================================================================== */
:root {
  --radio: 16px;
  --sombra: 0 4px 18px rgba(16, 32, 64, .10), 0 1px 3px rgba(16, 32, 64, .08);
  --sombra-fuerte: 0 10px 34px rgba(16, 32, 64, .22);
  --vidrio: rgba(255, 255, 255, .86);
  --hero: linear-gradient(145deg, #e8f6fb 0%, #ffffff 60%, #fff6ea 100%);
  --noche: #c9d3df; --dia: #ffe3a3;
  --acento: #0b84b5;
}
html[data-tema="oscuro"] {
  --sombra: 0 4px 18px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .4);
  --sombra-fuerte: 0 10px 34px rgba(0, 0, 0, .6);
  --vidrio: rgba(18, 23, 31, .84);
  --hero: linear-gradient(145deg, #13283a 0%, #161b22 60%, #2a2116 100%);
  --noche: #26313f; --dia: #6b5524;
  --acento: #5cc8e6;
}
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-feature-settings: "tnum" 1; }
button, select, input { font-family: inherit; }

/* ---- Cabecera ---- */
header { background: linear-gradient(120deg, #062c43 0%, #0b6e99 55%, #1fb5c9 100%); padding: .45rem .9rem; }
html[data-tema="oscuro"] header { background: linear-gradient(120deg, #05080d 0%, #0d1b2a 55%, #13384a 100%); border-bottom: 1px solid #22303e; }
.logo { width: 40px; height: 40px; box-shadow: 0 0 0 2px rgba(255,255,255,.6), 0 3px 10px rgba(0,0,0,.3); }
header h1 { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
header h1 span { font-weight: 500; opacity: .85; }
.modos button, .modos select { border: 1px solid rgba(255,255,255,.55); background: rgba(255,255,255,.12); font-weight: 500;
  transition: background .2s, color .2s, transform .15s; }
.modos button:hover, .modos select:hover { background: rgba(255,255,255,.25); }
.modos button:active { transform: scale(.96); }
.segmentado { display: inline-flex; background: rgba(0,0,0,.18); border-radius: 999px; padding: 3px; gap: 2px; }
.segmentado button { border: none !important; background: transparent; display: inline-flex; align-items: center; gap: .3rem; padding: .28rem .75rem; }
.segmentado button img { width: 20px; height: 20px; margin: -3px -2px -3px -4px; }
.segmentado button.activo { background: #fff; color: #0b4f6c; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
html[data-tema="oscuro"] .segmentado button.activo { background: #e6edf3; color: #0d1b2a; }
.mini-semaforo { display: inline-flex; gap: 2px; }
.mini-semaforo i { width: 6px; height: 6px; border-radius: 50%; background: #e03131; }
.mini-semaforo i:nth-child(2) { background: #f5c400; } .mini-semaforo i:nth-child(3) { background: #2fbf4a; }

/* ---- Insignias del mapa: píldora con icono + valor, coloreada según el valor ---- */
.insignia { display: inline-flex; align-items: center; justify-content: center; gap: 1px; height: 100%;
  border: 2px solid rgba(255,255,255,.95); border-radius: 999px; padding: 0 8px 0 2px; font-size: 13px; font-weight: 700;
  box-shadow: 0 3px 10px rgba(0,0,0,.28); cursor: pointer; transition: transform .15s; letter-spacing: -.01em; }
.insignia:hover { transform: scale(1.12); }
.insignia .ico { width: 24px; height: 24px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.insignia.compacta { font-size: 11px; padding: 0 6px 0 1px; border-width: 1.5px; }
.insignia.compacta .ico { width: 19px; height: 19px; }
.insignia.mini { display: inline-flex; height: 22px; margin-top: 3px; padding-right: 6px; }
.insignia.mini .ico { width: 18px; height: 18px; }
html[data-tema="oscuro"] .insignia { border-color: rgba(10,14,20,.85); box-shadow: 0 3px 12px rgba(0,0,0,.6); }
.leaflet-tooltip { font-family: inherit; border-radius: 10px; box-shadow: var(--sombra); }
html[data-tema="oscuro"] .leaflet-tooltip { background: #161b22; color: #e6edf3; border-color: #30363d; }
html[data-tema="oscuro"] .leaflet-tooltip-top:before { border-top-color: #161b22; }

/* ---- Capas nuevas ---- */
.campo-colores.fundido { animation: fundir .35s ease; }
@keyframes fundir { from { opacity: .15; } }
.viento-canvas { position: absolute; pointer-events: none; }
.flecha-ruta { background: none; border: none; }
.flecha-ruta svg { display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.leaflet-rutasViento-pane svg, .leaflet-rutas-pane svg, .leaflet-subidas-pane svg { pointer-events: none; }

/* ---- Panel: vidrio, tarjetas con sombra suave ---- */
.panel { background: var(--vidrio); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-radius: 20px; box-shadow: var(--sombra-fuerte); border: 1px solid rgba(255,255,255,.35); }
html[data-tema="oscuro"] .panel { border-color: #2a3542; }
.asa { background: var(--vidrio); backdrop-filter: blur(10px); font-weight: 600; }
#panel-contenido { padding: .9rem 1rem 1.2rem; scrollbar-width: thin; }
.panel h3 { font-size: .95rem; font-weight: 700; letter-spacing: -.01em; }
.mi { width: 22px; height: 22px; vertical-align: middle; margin: -4px 0; }
.mi.grande { width: 34px; height: 34px; margin: -2px 0; }

.hero { background: var(--hero); border-radius: 20px; padding: .9rem 1rem .8rem; box-shadow: var(--sombra); border: 1px solid var(--borde); }
.hero-cab h2 { margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; color: var(--texto); }
.hero-cab p { margin: .1rem 0 0; font-size: .8rem; color: var(--suave); }
.hero-main { display: flex; align-items: center; gap: .4rem; margin: .2rem 0 .1rem; }
.hero-icono { width: 112px; height: 112px; margin: -14px -8px -14px -16px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.12)); }
.hero-temp { font-size: 3.6rem; font-weight: 800; line-height: 1; letter-spacing: -.05em; color: var(--texto); }
.hero-txt { font-size: .88rem; color: var(--suave); margin-top: .15rem; }
.hero-metricas { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0 .55rem; }
.hero-metricas span { display: inline-flex; align-items: center; gap: .15rem; font-size: .8rem; font-weight: 600;
  background: rgba(255,255,255,.55); border: 1px solid var(--borde); padding: 2px 9px 2px 4px; border-radius: 999px; }
html[data-tema="oscuro"] .hero-metricas span { background: rgba(255,255,255,.05); }
.hero-metricas .mi { width: 24px; height: 24px; }

/* Semáforo grande "Apto para rodar" */
.semaforo { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: 14px; font-size: .95rem; }
.semaforo b { display: block; font-size: 1rem; }
.semaforo small { display: block; font-size: .78rem; opacity: .85; font-weight: 500; }
.semaforo .luces { display: flex; flex-direction: column; gap: 3px; background: #1b1f24; padding: 4px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.semaforo .luces i { width: 12px; height: 12px; border-radius: 50%; background: #3a3f46; }
.semaforo.malo .luces i:nth-child(1) { background: #ff4d4d; box-shadow: 0 0 10px #ff4d4d; }
.semaforo.precaucion .luces i:nth-child(2) { background: #ffd43b; box-shadow: 0 0 10px #ffd43b; }
.semaforo.bueno .luces i:nth-child(3) { background: #40e070; box-shadow: 0 0 10px #40e070; }
.semaforo.bueno { background: linear-gradient(90deg, #d3f9d8, #ebfbee); color: #1b4332; }
.semaforo.precaucion { background: linear-gradient(90deg, #fff3bf, #fff9db); color: #5c4400; }
.semaforo.malo { background: linear-gradient(90deg, #ffd6d6, #fff0f0); color: #7a1414; }
html[data-tema="oscuro"] .semaforo.bueno { background: linear-gradient(90deg, #12381f, #15261b); color: #b2f2bb; }
html[data-tema="oscuro"] .semaforo.precaucion { background: linear-gradient(90deg, #3d3208, #241f0d); color: #ffe066; }
html[data-tema="oscuro"] .semaforo.malo { background: linear-gradient(90deg, #4a1515, #2a1313); color: #ffa8a8; }

/* Tarjetas: misma forma en todos los bloques */
.puerto, .datos-subida, .ventana, .ropa, .sugerencia, .apto { border-radius: 14px; box-shadow: var(--sombra); border: 1px solid var(--borde); }
.puerto, .datos-subida { margin-top: .6rem; }
html[data-tema="oscuro"] .apto.bueno { background: #12381f; color: #b2f2bb; }
html[data-tema="oscuro"] .apto.precaucion { background: #3d3208; color: #ffe066; }
html[data-tema="oscuro"] .apto.malo { background: #4a1515; color: #ffa8a8; }
.pestanas button { border-radius: 12px; border: 1px solid var(--borde); padding: 5px 7px; transition: transform .15s, background .2s; line-height: 1.25; }
.pestanas button:hover { transform: translateY(-2px); }
.pestanas button.activo { box-shadow: 0 4px 12px rgba(11,110,153,.35); }
.punto { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; }
.punto.bueno { background: #2fbf4a; } .punto.precaucion { background: #f5c400; } .punto.malo { background: #e03131; }
.horas .mi { width: 20px; height: 20px; }
.aparece { animation: aparecer .3s ease; }
@keyframes aparecer { from { opacity: 0; transform: translateY(6px); } }

/* ---- Barra de tiempo ---- */
.barra-tiempo { position: absolute; z-index: 860; bottom: 14px; left: 384px; right: 64px; max-width: 820px; margin: 0 auto;
  background: var(--vidrio); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: var(--texto);
  border-radius: 18px; box-shadow: var(--sombra-fuerte); padding: .45rem .7rem .35rem; border: 1px solid rgba(255,255,255,.35);
  transition: left .3s ease; }
html[data-tema="oscuro"] .barra-tiempo { border-color: #2a3542; }
.panel.cerrado ~ .barra-tiempo, .panel.cerrado ~ .leyenda { left: 64px; }
.bt-dias { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.bt-dias::-webkit-scrollbar { display: none; }
.bt-dias button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--borde); background: transparent;
  color: var(--texto); border-radius: 999px; padding: 1px 9px 1px 3px; font-size: .76rem; font-weight: 600; cursor: pointer; text-transform: capitalize; transition: background .2s; }
.bt-dias button.activo { background: var(--acento); border-color: var(--acento); color: #fff; }
html[data-tema="oscuro"] .bt-dias button.activo { color: #0d1117; }
.bt-dias button.lejano { opacity: .65; border-style: dashed; }
.bt-dias .mi { width: 22px; height: 22px; margin: 0; }
.bt-fila { display: flex; align-items: center; gap: .6rem; }
.bt-play { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer; background: var(--acento); position: relative;
  box-shadow: 0 3px 10px rgba(11,110,153,.4); transition: transform .15s; }
.bt-play:active { transform: scale(.92); }
.bt-play::before { content: ""; position: absolute; left: 15px; top: 12px; border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent #fff; }
.bt-play.on::before { left: 13px; top: 12px; width: 4px; height: 16px; border: none; background: #fff; box-shadow: 9px 0 0 #fff; }
html[data-tema="oscuro"] .bt-play::before { border-left-color: #0d1117; }
html[data-tema="oscuro"] .bt-play.on::before { background: #0d1117; box-shadow: 9px 0 0 #0d1117; }
.bt-pista { flex: 1; position: relative; padding-top: 2px; }
.bt-pista input { width: 100%; margin: 0; -webkit-appearance: none; appearance: none; background: transparent; height: 26px; cursor: pointer; }
.bt-pista input::-webkit-slider-runnable-track { height: 10px; border-radius: 999px; background: var(--pista, var(--dia)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.bt-pista input::-moz-range-track { height: 10px; border-radius: 999px; background: var(--pista, var(--dia)); }
.bt-pista input::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -6px; border-radius: 50%;
  background: #fff; border: 4px solid var(--acento); box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.bt-pista input::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 4px solid var(--acento); }
.bt-ahora { position: absolute; top: 3px; width: 3px; height: 22px; margin-left: -1.5px; background: #e03131; border-radius: 2px; pointer-events: none; opacity: .8; }
.bt-marcas { display: flex; justify-content: space-between; font-size: .64rem; color: var(--suave); margin-top: -3px; padding: 0 4px; }
.bt-etiqueta { flex: 0 0 auto; min-width: 62px; text-align: center; line-height: 1.1; }
.bt-etiqueta b { display: block; font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.bt-etiqueta small { font-size: .72rem; color: var(--suave); text-transform: capitalize; }
.barra-tiempo.cargando .bt-fila { opacity: .4; pointer-events: none; }

/* ---- Leyenda: barra de degradado encima de la barra de tiempo ---- */
.leyenda { bottom: 112px; left: 384px; right: 64px; margin: 0 auto; width: fit-content; transform: none; max-width: 820px;
  background: var(--vidrio); backdrop-filter: blur(12px); border-radius: 14px; align-items: center; padding: .35rem .8rem; box-shadow: var(--sombra); transition: left .3s ease; }
.leyenda .degradado { min-width: 210px; font-size: .74rem; }
.leyenda .degradado small { color: var(--suave); }
.leyenda .barra { height: 8px; border-radius: 999px; margin: 3px 0 1px; }
.leyenda .marcas { display: flex; justify-content: space-between; font-size: .66rem; color: var(--suave); }
.viento-rutas { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; font-size: .74rem; padding-left: .6rem; border-left: 1px solid var(--borde); }
.flecha-ley svg { width: 13px; height: 13px; vertical-align: middle; }

/* ---- Carga: aviso flotante y esqueletos ---- */
.cargando-chip { position: absolute; z-index: 870; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: .5rem;
  background: var(--vidrio); backdrop-filter: blur(10px); color: var(--texto); padding: .4rem .9rem; border-radius: 999px; font-size: .82rem; font-weight: 600; box-shadow: var(--sombra); }
.cargando-chip[hidden] { display: none; }
.girando { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--borde); border-top-color: var(--acento); animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.sk { display: block; border-radius: 12px; margin: .55rem 0;
  background: linear-gradient(90deg, rgba(127,140,160,.14) 25%, rgba(127,140,160,.28) 45%, rgba(127,140,160,.14) 65%); background-size: 300% 100%; animation: brillo 1.3s ease-in-out infinite; }
@keyframes brillo { from { background-position: 100% 0; } to { background-position: 0 0; } }
.sk-titulo { height: 26px; width: 60%; } .sk-hero { height: 170px; border-radius: 20px; } .sk-linea { height: 14px; } .sk-linea.corta { width: 70%; }
.sk-pestanas { height: 72px; } .sk-bloque { height: 120px; } .sk-fichas { height: 22px; width: 100%; margin: 0; border-radius: 999px; }

/* ---- Leaflet en el nuevo estilo ---- */
.leaflet-bar, .leaflet-control-layers { border: none !important; border-radius: 12px !important; box-shadow: var(--sombra) !important; overflow: hidden; }
.leaflet-control-layers-expanded { font-family: inherit; font-size: .82rem; max-height: 60vh; overflow-y: auto; }
.leaflet-bottom.leaflet-right { margin-bottom: 0; }

/* ---- Móvil ---- */
@media (max-width: 700px) {
  header { padding: .35rem .5rem; gap: .3rem; flex-wrap: nowrap; flex-direction: column; align-items: stretch; }
  .marca { gap: .45rem; }
  header h1 { font-size: 1rem; }
  .logo { width: 30px; height: 30px; }
  .modos { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 1px; }
  .modos::-webkit-scrollbar { display: none; }
  .modos > * { flex: 0 0 auto; }
  .modos button, .modos select { font-size: .8rem; }
  .segmentado button { padding: .25rem .6rem; }
  .barra-tiempo, .panel.cerrado ~ .barra-tiempo { left: 6px; right: 6px; bottom: 46px; padding: .35rem .5rem .25rem; border-radius: 16px; }
  .bt-play { width: 36px; height: 36px; }
  .bt-play::before { left: 13px; top: 10px; }
  .bt-play.on::before { left: 11px; top: 10px; }
  .leyenda, .panel.cerrado ~ .leyenda { display: flex; left: 6px; right: auto; bottom: 150px; margin: 0; padding: .25rem .6rem; max-width: calc(100% - 60px); }
  .leyenda .extra { display: none; }
  .leyenda .degradado { min-width: 150px; }
  .viento-rutas { font-size: .68rem; gap: .3rem; }
  .leaflet-bottom { bottom: 140px; }
  .hero-icono { width: 96px; height: 96px; }
  .hero-temp { font-size: 3rem; }
}

/* Accesibilidad: si el sistema pide menos movimiento, sin animaciones ni transiciones */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* Ajustes tras las pruebas */
main { overflow: hidden; }   /* la hoja inferior plegada ya no se monta sobre los créditos */
.viento-rutas span { white-space: nowrap; }
.bt-dias .mi, .pestanas .mi, .hero-metricas .mi, .horas .mi, .sol .mi { filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.leyenda .viento-rutas span, .leyenda .marcas span { display: inline; width: auto; height: auto; border-radius: 0; margin: 0; }
.leyenda .viento-rutas span { display: inline-flex; align-items: center; }

/* ===== CABECERA SIN DESBORDES (360–1920 px) =====
   Red de seguridad: la página nunca debe tener scroll horizontal. */
html, body { max-width: 100%; overflow-x: hidden; }
header { flex-wrap: nowrap; min-width: 0; }
.marca { flex: 0 0 auto; min-width: 0; }
.modos { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; justify-content: flex-end; }
.modos > * { flex: 0 0 auto; }
/* Los desplegables encogen (con "…") en vez de empujar los botones fuera de la pantalla */
.modos select { flex: 0 1 auto; min-width: 70px; max-width: 210px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.segmentado .etq { transition: opacity .2s; }

/* Pantallas medianas: el título se acorta y los modos no activos muestran solo el icono */
@media (max-width: 1100px) {
  header h1 span { display: none; }           /* "Mallorca" a secas */
  .modos select { max-width: 150px; }
  .segmentado button:not(.activo) .etq { display: none; }
  .segmentado button:not(.activo) { padding-left: .55rem; padding-right: .55rem; }
}
@media (max-width: 800px) and (min-width: 701px) {
  .marca h1 { display: none; }                /* solo el logo */
}

/* Móvil: 2 filas → [marca · botones de icono arriba a la derecha] / [modos · día · ruta] */
@media (max-width: 700px) {
  header { position: relative; flex-direction: column; align-items: stretch; }
  header h1 span { display: inline; }
  .marca { padding-right: 118px; overflow: hidden; }   /* hueco para los 3 botones de icono */
  .marca h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .modos { overflow: visible; justify-content: flex-start; gap: .3rem; }
  .modos .icono-btn { position: absolute; top: .4rem; width: 34px; height: 30px; padding: 0 !important; }
  #tema { right: 84px; } #ubicacion { right: 46px; } #pantalla { right: 8px; }
  .modos select { flex: 1 1 0; min-width: 0; max-width: none; padding-left: .55rem; padding-right: .3rem; }
  .segmentado { flex: 0 0 auto; }
  .segmentado button:not(.activo) .etq { display: none; }
  .segmentado button:not(.activo) { padding-left: .5rem; padding-right: .5rem; }
}
/* Botones de icono siempre del mismo tamaño (el glifo ⛶ es más alto que 🌙) */
.modos .icono-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 34px; padding: 0 !important; line-height: 1; }
/* Tabletas: el aviso no debe tapar el asa "Previsión" (panel abierto a la izquierda) */
@media (min-width: 701px) and (max-width: 1000px) {
  .avisos { max-width: calc(100% - 560px); min-width: 200px; font-size: .74rem; }
}
/* Móvil estrecho: los modos solo con icono para dejar sitio a los desplegables */
@media (max-width: 420px) {
  .segmentado button .etq { display: none; }
  .segmentado button { padding-left: .55rem !important; padding-right: .55rem !important; }
}
@media (max-width: 380px) { header h1 { font-size: .9rem; } }

/* ===== IDIOMA (ES/EN) en la cabecera: desplegable compacto ===== */
.modos select.idioma { flex: 0 0 auto; min-width: 0; width: auto; max-width: 64px; padding-left: .5rem; padding-right: .25rem; font-weight: 700; letter-spacing: .02em; }
@media (max-width: 700px) {
  .modos select.idioma { flex: 0 0 auto; max-width: 58px; }   /* en la 2.ª fila, sin quitar sitio a la marca */
}

/* ===== 📸 IMAGEN DEL DÍA ===== */
.bt-imagen { display: inline-flex; align-items: center; gap: .4rem; border: none; cursor: pointer; font: inherit; font-weight: 600; font-size: .85rem;
  background: var(--vidrio); color: var(--texto); padding: .45rem .75rem; border-radius: 12px; box-shadow: var(--sombra);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.bt-imagen:hover { background: var(--fondo-panel); }
.bt-imagen > span:first-child { font-size: 1.1rem; line-height: 1; }
@media (max-width: 1000px) { .bt-imagen .etq { display: none; } .bt-imagen { width: 44px; height: 44px; justify-content: center; padding: 0; } }

.imagen-modal { position: fixed; inset: 0; z-index: 3000; background: rgba(8, 15, 28, .62); display: flex; align-items: center; justify-content: center; padding: 12px; }
.imagen-modal[hidden] { display: none; }
.imagen-caja { background: var(--fondo-panel); color: var(--texto); border-radius: 20px; box-shadow: var(--sombra-fuerte);
  width: min(560px, 100%); max-height: calc(100dvh - 24px); overflow: auto; padding: 14px 16px 10px; display: flex; flex-direction: column; gap: 10px; }
.imagen-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.imagen-cab h2 { margin: 0; font-size: 1.1rem; }
.imagen-cerrar { border: none; background: var(--caja); color: var(--texto); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1rem; }
.imagen-opciones { display: flex; flex-wrap: wrap; gap: 8px; }
.imagen-opciones .segmentado { background: var(--caja); }
.imagen-opciones .segmentado button { color: var(--texto); font: inherit; font-size: .85rem; cursor: pointer; border-radius: 999px; }
.imagen-opciones .segmentado button.activo { background: var(--acento); color: #fff; }
.imagen-vista { position: relative; display: flex; align-items: center; justify-content: center; background: var(--caja); border-radius: 14px; min-height: 200px; }
.imagen-vista img { display: block; max-width: 100%; max-height: min(56dvh, 620px); border-radius: 10px; box-shadow: var(--sombra); }
.imagen-generando { padding: 2rem; color: var(--suave); }
.imagen-botones { display: flex; gap: 8px; }
.imagen-botones button { flex: 1 1 0; border: none; border-radius: 12px; padding: .7rem .8rem; font: inherit; font-weight: 700; cursor: pointer; background: var(--acento); color: #fff; }
.imagen-botones .imagen-compartir { background: #2fbf4a; }
.imagen-botones button[hidden] { display: none; }

/* Modo solo-imagen (?imagen=post): la imagen tapa toda la página (el mapa sigue debajo, sin romperse) */
.imagen-solo { position: fixed; inset: 0; z-index: 5000; background: #0a1424; display: flex; align-items: center; justify-content: center; }
.imagen-solo canvas { max-width: 100vw; max-height: 100vh; width: auto; height: auto; }
html[data-tema="oscuro"] .imagen-botones .imagen-descargar,
html[data-tema="oscuro"] .imagen-opciones .segmentado button.activo { color: #06283d; }

/* ===== Mejores condiciones: barra de horas con color continuo (rojo → verde) ===== */
.barra-horas .celda { opacity: .8; }
.barra-horas .celda.dentro { opacity: 1; outline: 3px solid var(--texto); outline-offset: -1px; z-index: 1; }
.ventana .secundaria { color: var(--suave); font-size: .82rem; white-space: nowrap; }
.barra-sol { display: flex; justify-content: space-between; font-size: .72rem; color: var(--suave); margin-bottom: 2px; }

/* Cifras de viento junto al veredicto ("💨 18–36 km/h NE") */
.viento-apto { display: block; font-size: .78rem; font-weight: 600; opacity: .9; }
.apto .viento-apto { display: inline; }

/* ===== Qué ponerte: chips de colores con emoji grande ===== */
.ropa .prendas { gap: 6px; }
.ropa .prendas .chip-ropa { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px 4px 6px; border-radius: 999px;
  font-size: .85rem; font-weight: 600; border: 0; color: #14213d; background: #dbeafe; max-width: 100%; }
.chip-ropa i { font-style: normal; font-size: 1.35rem; line-height: 1; }
.chip-ropa small { font-weight: 500; opacity: .75; margin-left: 2px; }
.chip-ropa.base { background: #d3f4dc; } .chip-ropa.capa { background: #d9f0f7; } .chip-ropa.abrigo { background: #e6defc; }
.chip-ropa.lluvia { background: #d6e2ff; } .chip-ropa.sol { background: #ffe5c7; } .chip-ropa.agua { background: #cdf3f4; }
.chip-ropa.luces { background: #fff2b8; }
html[data-tema="oscuro"] .ropa .prendas .chip-ropa { color: #f1f5f9; background: #1e3a5f; }
html[data-tema="oscuro"] .chip-ropa.base { background: #1d4a2c !important; } html[data-tema="oscuro"] .chip-ropa.capa { background: #164555 !important; }
html[data-tema="oscuro"] .chip-ropa.abrigo { background: #3b2d6b !important; } html[data-tema="oscuro"] .chip-ropa.lluvia { background: #263c78 !important; }
html[data-tema="oscuro"] .chip-ropa.sol { background: #6b3d12 !important; } html[data-tema="oscuro"] .chip-ropa.agua { background: #11545a !important; }
html[data-tema="oscuro"] .chip-ropa.luces { background: #5e4d0c !important; }

/* ===== REDES SOCIALES: Instagram y club de Strava =====
   Cabecera (>700 px): dos iconos redondos con los colores de cada marca, junto al logo.
   Panel: pie fijo con los dos botones con texto. Móvil: solo iconos, en la barra del asa. */
.social { display: flex; align-items: center; gap: .4rem; }
.social-btn { display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; color: #fff; font-weight: 700;
  border-radius: 999px; line-height: 1.1; transition: transform .15s, box-shadow .2s, filter .2s; -webkit-tap-highlight-color: transparent; }
.social-btn:hover { transform: translateY(-1px); filter: brightness(1.06) saturate(1.08); }
.social-btn:active { transform: scale(.96); }
.social-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.social-ico { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ico-social { width: 18px; height: 18px; display: block; }
/* Colores de marca */
/* Instagram: degradado oficial (radial desde abajo a la izquierda: amarillo → naranja → rosa → morado/azul) */
.social-btn.social-ig { background-color: #d62976;
  background-image: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.social-btn.social-ig .ico-social { filter: drop-shadow(0 1px 1px rgba(0,0,0,.18)); }
.social-btn.social-st { background: #FC4C02; }

/* Cabecera: iconos redondos (el texto queda en title/aria-label) */
.social-cabecera { flex: 0 0 auto; margin-right: auto; margin-left: .35rem; padding-left: .75rem; border-left: 1px solid rgba(255,255,255,.3); }
.social-cabecera .social-btn { width: 34px; height: 34px; justify-content: center; padding: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,.75), 0 3px 10px rgba(0,0,0,.28); }
.social-cabecera .social-btn:hover { box-shadow: 0 0 0 2px #fff, 0 5px 14px rgba(0,0,0,.35); }
.social-cabecera .social-txt { display: none; }
.social-cabecera .social-st .ico-social { width: 17px; height: 17px; }
html[data-tema="oscuro"] .social-cabecera { border-left-color: rgba(255,255,255,.15); }
html[data-tema="oscuro"] .social-cabecera .social-btn { box-shadow: 0 0 0 2px rgba(255,255,255,.22), 0 3px 10px rgba(0,0,0,.5); }

/* Panel: pie con los dos botones con texto (no se desplaza con el contenido) */
.social-panel { flex: 0 0 auto; margin-top: auto; gap: .45rem; padding: .55rem .75rem .65rem; border-top: 1px solid var(--borde);
  border-radius: 0 0 20px 20px; }
.social-panel .social-btn { flex: 1 1 0; min-width: 0; justify-content: flex-start; padding: .4rem .75rem .4rem .45rem; font-size: .78rem;
  letter-spacing: -.01em; border-radius: 14px; box-shadow: 0 3px 10px rgba(0,0,0,.18); min-height: 44px; }
.social-panel .social-ico { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.2); }
.social-panel .social-txt { white-space: normal; text-align: left; text-shadow: 0 1px 2px rgba(0,0,0,.18); }
.social-panel .ico-social { width: 17px; height: 17px; }
html[data-tema="oscuro"] .social-panel .social-btn { box-shadow: 0 3px 12px rgba(0,0,0,.5); }

/* Tabletas: la cabecera va justa, iconos un poco más pequeños */
@media (min-width: 701px) and (max-width: 1100px) {
  .social-cabecera { margin-left: .1rem; padding-left: .5rem; gap: .3rem; }
  .social-cabecera .social-btn { width: 30px; height: 30px; }
  .social-cabecera .ico-social { width: 16px; height: 16px; }
}

/* Móvil: fuera de la cabecera; iconos solos en la barra "☰ Previsión", siempre visible */
@media (max-width: 700px) {
  .social-cabecera { display: none; }
  .social-panel { position: absolute; top: 0; right: 10px; height: 36px; padding: 0; border: 0; border-radius: 0; gap: .45rem; z-index: 2; }
  .social-panel .social-btn { flex: 0 0 auto; width: 30px; height: 30px; min-height: 0; padding: 0; justify-content: center; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
  .social-panel .social-ico { width: auto; height: auto; background: none; }
  .social-panel .social-txt { display: none; }
  .social-panel .ico-social { width: 16px; height: 16px; }
}

/* Otras islas (islas.js): ventanita con la tabla de horas */
.popup-islas .leaflet-popup-content { margin: 10px 12px; font-size: 13px; }
.popup-isla table.horas { margin-top: 6px; font-size: 12px; }
.popup-isla .nota-isla { display: block; margin-top: 6px; opacity: .7; }

/* Mar con color (filtros SVG de index.html): solo el mapa base; nombres, colores y viento van en otros panes */
.leaflet-tile-pane { filter: url(#mar-claro); }
html[data-tema="oscuro"] .leaflet-tile-pane { filter: url(#mar-oscuro); }

/* 📷 Webcams públicas (webcams.js): chapa oscura con cámara + ventanita con enlaces */
.poi-webcam { background: #264653; font-size: 13px; }
html[data-tema="oscuro"] .poi-webcam { background: #2a9d8f; border-color: #e6edf3; }
.popup-webcams .leaflet-popup-content { margin: 10px 12px; font-size: 13px; line-height: 1.35; }
.popup-webcam ul { list-style: none; margin: 6px 0 4px; padding: 0; }
.popup-webcam li { padding: 4px 0; border-top: 1px solid var(--borde); }
.popup-webcam li:first-child { border-top: 0; }
.popup-webcam .webcam-link { font-weight: 700; }
.popup-webcam .nota-webcam { display: block; margin-top: 4px; opacity: .7; }
