/* Clima Colombia · estilo moderno (vidrio oscuro sobre mapa satelital) */
:root {
  --bg: #0b1020;
  --surface: rgba(13, 18, 36, 0.66);
  --surface-strong: rgba(13, 18, 36, 0.86);
  --card: rgba(255, 255, 255, 0.045);
  --card-hover: rgba(255, 255, 255, 0.08);
  --ink: #f1f5f9;
  --ink-soft: rgba(226, 232, 240, 0.72);
  --ink-faint: rgba(226, 232, 240, 0.45);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --sun: #fbbf24;
  --rain: #22d3ee;
  --grad: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  --radius-lg: 1.5rem;
  --radius: 1rem;
  --radius-sm: 0.7rem;
  --shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(0.75rem, 2vw, 1.25rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  color: var(--ink);
  font-family: var(--font-body);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  overflow: hidden;
}

::selection {
  background: rgba(56, 189, 248, 0.35);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Mapa ---------- */
.map {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--bg);
}

.map::after {
  /* viñeta suave para que el vidrio resalte sobre el satélite */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 400;
  background:
    linear-gradient(180deg, rgba(11, 16, 32, 0.55) 0%, transparent 18%, transparent 62%, rgba(11, 16, 32, 0.7) 100%);
}

.leaflet-container {
  font: inherit;
  background: var(--bg);
}

.leaflet-control-attribution {
  max-width: min(70vw, 28rem);
  background: var(--surface-strong) !important;
  color: var(--ink-faint) !important;
  font-size: 0.62rem !important;
  border-radius: 0.5rem 0 0 0;
  backdrop-filter: blur(10px);
}

.leaflet-control-attribution a {
  color: var(--accent) !important;
}

.leaflet-bar {
  border: 0 !important;
  box-shadow: var(--shadow) !important;
  border-radius: var(--radius-sm) !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  background: var(--surface-strong) !important;
  color: var(--ink) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  width: 2.25rem !important;
  height: 2.25rem !important;
  line-height: 2.25rem !important;
  backdrop-filter: blur(14px);
  transition: background 0.2s ease;
}

.leaflet-control-zoom a:hover {
  background: rgba(56, 189, 248, 0.2) !important;
}

/* ---------- Capa de interfaz ---------- */
.ui {
  position: relative;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
  height: 100dvh;
  padding: var(--gutter);
  padding-top: max(var(--gutter), env(safe-area-inset-top));
  padding-bottom: max(var(--gutter), env(safe-area-inset-bottom));
  pointer-events: none;
}

.ui > * {
  pointer-events: auto;
}

.glass {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: var(--shadow);
}

/* ---------- Barra superior ---------- */
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.6rem 0.7rem 0.6rem 1rem;
  border-radius: 999px;
  animation: rise 0.55s var(--ease) both;
  flex: 0 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-mark {
  /* la Tierra (NASA Blue Marble), igual que el ícono de la app */
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  flex: 0 0 auto;
  background: url("icons/globe-128.png") center / contain no-repeat;
  box-shadow: 0 0 18px -2px rgba(56, 189, 248, 0.55);
}

.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-tag {
  max-width: 17rem;
  margin: 0.05rem 0 0;
  font-size: 0.68rem;
  line-height: 1.3;
  color: var(--ink-faint);
}

.city-form {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 260px;
  max-width: 480px;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.city-form:focus-within {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(255, 255, 255, 0.09);
}

.city-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0.55rem 0.75rem;
  background: transparent;
  font: inherit;
  font-size: 0.92rem;
  color: var(--ink);
}

.city-form input:focus {
  outline: none;
}

.city-form input::placeholder {
  color: var(--ink-faint);
}

/* ---------- Selector de idioma ---------- */
.lang-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-picker::before {
  /* globo */
  content: "";
  position: absolute;
  left: 0.75rem;
  width: 1rem;
  height: 1rem;
  background: var(--ink-soft);
  pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20M12 2a15 15 0 0 1 0 20M12 2a15 15 0 0 0 0 20'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20M12 2a15 15 0 0 1 0 20M12 2a15 15 0 0 0 0 20'/%3E%3C/svg%3E") center / contain no-repeat;
}

.lang-picker select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.6rem 2rem 0.6rem 2.1rem;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 0.7rem center / 0.85rem no-repeat,
    rgba(255, 255, 255, 0.07);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color-scheme: dark;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.lang-picker select:hover {
  border-color: var(--line-strong);
}

.lang-picker select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lang-picker option {
  background: #111827;
  color: var(--ink);
}

/* ---------- Botones ---------- */
.city-form button,
.btn-primary,
.btn-ghost,
.btn-geo,
.btn-layers {
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 1.05rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.city-form button[type="submit"],
.btn-primary {
  background: var(--grad);
  color: #0b1020;
  box-shadow: 0 8px 22px -8px rgba(56, 189, 248, 0.8);
}

/* "Ver clima": 30 % más estrecho que el botón estándar (97,6 → 68,3 px con Inter). */
.city-form button[type="submit"] {
  padding: 0.6rem 0.44rem;
  font-size: 0.76rem;
  letter-spacing: -0.01em;
}

.btn-ghost,
.btn-geo,
.btn-layers {
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-geo {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  background: transparent;
  border-color: transparent;
}

.btn-geo:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-geo.locating,
#geo-hero-btn.locating {
  opacity: 0.6;
  pointer-events: none;
  animation: breathe 1.2s ease-in-out infinite;
}

.city-form button:hover,
.btn-primary:hover,
.btn-ghost:hover,
.btn-layers:hover {
  transform: translateY(-1px);
}

.btn-ghost:hover,
.btn-layers:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--line-strong);
}

.btn-layers::before {
  content: "";
  width: 1rem;
  height: 1rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 2 10 5-10 5L2 7z'/%3E%3Cpath d='m2 17 10 5 10-5'/%3E%3Cpath d='m2 12 10 5 10-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 2 10 5-10 5L2 7z'/%3E%3Cpath d='m2 17 10 5 10-5'/%3E%3Cpath d='m2 12 10 5 10-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.btn-layers[aria-expanded="true"] {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.55);
  color: #bae6fd;
}

/* ---------- Panel de capas ---------- */
.layers-panel {
  position: absolute;
  top: calc(var(--gutter) + 4.4rem);
  right: var(--gutter);
  z-index: 700;
  width: min(21rem, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100dvh - 6rem - var(--gutter));
  overflow: auto;
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.1rem 1.2rem;
  background: var(--surface-strong);
  animation: slide-in 0.4s var(--ease) both;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.layers-panel[hidden] {
  display: none !important;
}

.layers-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.6rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.layers-head h2,
.legend__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.layers-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
}

.layers-panel .layers-hide {
  position: static;
  flex: 0 0 auto;
}

.layers-panel .layers-hide:hover {
  transform: translateX(2px);
}

.date-field {
  display: grid;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: var(--ink-faint);
}

.layers-panel section {
  margin-top: 0.5rem;
}

.layers-head + section {
  margin-top: 1rem;
}

.layers-panel h3 {
  margin: 0 0 0.45rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

.layer-dropdown {
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--line);
  transition: border-color 0.2s ease;
}

.layer-dropdown[open] {
  border-color: rgba(56, 189, 248, 0.45);
}

.layer-dropdown summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius-sm);
  user-select: none;
}

.layer-dropdown summary::-webkit-details-marker {
  display: none;
}

.layer-dropdown summary:hover {
  background: var(--card-hover);
}

.layer-dropdown summary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  margin-left: 0.2rem;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: translateY(-25%) rotate(45deg);
  transition: transform 0.25s var(--ease);
}

.layer-dropdown[open] summary::after {
  transform: translateY(25%) rotate(-135deg);
}

.layer-dropdown__label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

.layer-dropdown__value {
  margin-left: auto;
  font-size: 0.86rem;
  font-weight: 600;
  color: #bae6fd;
}

.layer-dropdown .layer-controls {
  margin: 0 0.35rem 0.5rem;
}

.layer-subhead {
  margin: 0.55rem 0.35rem 0.1rem;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #7dd3fc;
}

.layer-subhead:first-child {
  margin-top: 0.1rem;
}

.layer-dropdown .layer-list {
  padding: 0 0.35rem 0.4rem;
  animation: fade 0.2s ease both;
}

.layer-list {
  display: grid;
  gap: 0.25rem;
}

.layer-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.layer-option:hover {
  background: var(--card-hover);
}

.layer-option:has(input:checked) {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.35);
}

.layer-option input {
  margin: 0.15rem 0 0;
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
}

.layer-option span {
  display: grid;
  gap: 0.12rem;
  font-size: 0.86rem;
  font-weight: 600;
}

.layer-option small {
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--ink-soft);
  line-height: 1.35;
}

.layer-controls {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.5rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--line);
}

.layer-controls label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink-faint);
}

.layer-controls select,
.layer-controls input[type="date"],
.layer-controls input[type="text"],
.date-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  padding: 0.45rem 0.6rem;
  background: rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  color-scheme: dark;
  transition: border-color 0.15s ease;
}

.layer-controls select:focus,
.layer-controls input:focus,
.date-field input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.6);
}

.layer-check {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-soft) !important;
}

.layer-check input {
  accent-color: var(--accent);
}

.layer-meta {
  margin: 0;
  font-size: 0.7rem;
  color: #7dd3fc;
  line-height: 1.4;
}

.layer-meta a {
  color: #7dd3fc;
  font-weight: 600;
}

.layer-note,
.layer-attrib {
  margin: 1rem 0 0;
  font-size: 0.68rem;
  color: var(--ink-faint);
  line-height: 1.5;
}

/* ---------- Widget del clima ---------- */
.weather-widget {
  position: relative;
  width: min(23rem, 100%);
  padding: 1.35rem 1.4rem 1.25rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: rise 0.6s var(--ease) 0.05s both;
  flex: 0 0 auto;
}

.weather-widget::before {
  /* halo de luz */
  content: "";
  position: absolute;
  top: -40%;
  right: -30%;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.35), transparent 65%);
  pointer-events: none;
}

.weather-widget[hidden] {
  display: none;
}

/* Cielo animado (weather-fx.js) detrás del contenido del panel de clima */
.wx-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, rgba(0, 0, 0, 0.35) 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 55%, rgba(0, 0, 0, 0.35) 100%);
}

.weather-widget > :not(.wx-scene):not(.widget-hide) {
  position: relative;
  z-index: 1;
}

.weather-widget > .widget-hide {
  z-index: 2;
}

.weather-widget[data-wx]::before {
  opacity: 0;
}

/* ---------- Íconos animados del clima ---------- */
.wx-icon {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.wx-rays {
  animation: wx-spin 14s linear infinite;
}

.wx-sun circle {
  animation: wx-pulse 3.5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.wx-cloud {
  animation: wx-drift 6s ease-in-out infinite;
}

.wx-back {
  animation-duration: 8s;
  animation-direction: reverse;
}

.wx-moon {
  animation: wx-bob 6s ease-in-out infinite;
}

.wx-twinkle {
  animation: wx-twinkle 2.4s ease-in-out infinite;
}

.wx-drop {
  animation: wx-fall 0.9s linear infinite;
}

.wx-flake {
  animation: wx-snow 2.6s linear infinite;
}

.wx-fog {
  animation: wx-fog 4s ease-in-out infinite;
}

.wx-bolt {
  animation: wx-flash 2.8s steps(1) infinite;
}

.wx-d1 { animation-delay: -0.25s; }
.wx-d2 { animation-delay: -0.5s; }
.wx-d3 { animation-delay: -0.75s; }
.wx-flake.wx-d1 { animation-delay: -0.9s; }
.wx-flake.wx-d2 { animation-delay: -1.7s; }
.wx-fog.wx-d2 { animation-delay: -2s; }

@keyframes wx-spin {
  to { transform: rotate(360deg); }
}

@keyframes wx-pulse {
  50% { transform: scale(1.06); }
}

@keyframes wx-drift {
  50% { transform: translateX(3px); }
}

@keyframes wx-bob {
  50% { transform: translateY(-2px) rotate(-4deg); }
}

@keyframes wx-twinkle {
  50% { opacity: 0.15; }
}

@keyframes wx-fall {
  0% { transform: translate(0, -4px); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate(-2px, 9px); opacity: 0; }
}

@keyframes wx-snow {
  0% { transform: translate(0, -4px); opacity: 0; }
  20% { opacity: 1; }
  50% { transform: translate(2px, 3px); }
  100% { transform: translate(-1px, 9px); opacity: 0; }
}

@keyframes wx-fog {
  50% { transform: translateX(4px); opacity: 0.55; }
}

@keyframes wx-flash {
  0%, 60%, 74%, 100% { opacity: 0; }
  62%, 70% { opacity: 1; }
}

.widget-hide {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s var(--ease);
}

.widget-hide:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--ink);
  transform: translateX(-2px);
}

.widget-hide svg,
.widget-tab svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* pestaña que queda visible al ocultar el panel */
.widget-tab {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: min(18rem, 100%);
  padding: 0.5rem 0.75rem 0.5rem 0.6rem;
  border-radius: 999px;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  animation: slide-in 0.35s var(--ease) both;
  transition: transform 0.2s var(--ease), border-color 0.2s ease;
}

.widget-tab[hidden] {
  display: none;
}

.widget-tab:hover {
  transform: translateX(3px);
  border-color: rgba(56, 189, 248, 0.5);
}

.widget-tab__temp {
  display: grid;
  place-items: center;
  min-width: 2.6rem;
  height: 2.1rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--grad);
  color: #0b1020;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.widget-tab__place {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 600;
}

.widget-tab svg {
  flex: 0 0 auto;
  color: var(--ink-soft);
}

.eyebrow {
  margin: 0 0 0.3rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.66rem;
  font-weight: 600;
  color: #7dd3fc;
}

.eyebrow::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
  animation: breathe 2.4s ease-in-out infinite;
}

.weather-widget h1 {
  position: relative;
  margin: 0;
  padding-right: 2.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero-lead {
  position: relative;
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.hero-temp-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-top: 0.6rem;
}

/* Ícono animado del tiempo que predomina hoy */
.hero-wx {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  margin: 0;
  text-align: center;
}

.hero-wx__icon {
  width: 5.2rem;
  height: 5.2rem;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}

.hero-wx figcaption {
  display: grid;
  font-size: 0.72rem;
  line-height: 1.2;
}

.hero-wx figcaption span {
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.hero-wx figcaption strong {
  max-width: 9rem;
  font-weight: 600;
  color: var(--ink);
}

.hero-temp {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.6rem, 10vw, 4.8rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.05em;
  background: linear-gradient(180deg, #fff 30%, #bae6fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-temp .unit {
  font-size: 0.38em;
  margin-left: 0.06em;
  vertical-align: top;
  letter-spacing: 0;
}

.hero-feels {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.widget-metrics {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.3rem;
  margin-top: 0.85rem;
}

.wm {
  display: grid;
  gap: 0.05rem;
  padding: 0.3rem 0.35rem;
  border-radius: 0.55rem;
  background: rgba(13, 18, 36, 0.35);
  border: 1px solid var(--line);
  text-align: center;
  min-width: 0;
}

.wm > span {
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wm strong {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

.wm strong small {
  font-size: 0.62em;
  font-weight: 500;
  color: var(--ink-soft);
}

.wm-wind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}

.wind-arrow {
  flex: 0 0 auto;
  width: 0.8rem;
  height: 0.8rem;
  fill: var(--accent);
  transition: transform 0.6s var(--ease);
}

.widget-uv {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.55rem 0 0;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.14), rgba(251, 191, 36, 0.03));
  border: 1px solid rgba(251, 191, 36, 0.25);
  font-size: 0.78rem;
}

.widget-uv span {
  color: #fde68a;
  font-weight: 500;
}

.widget-uv strong {
  font-family: var(--font-display);
  color: var(--sun);
}

.hero-actions {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1rem;
}

.widget-status {
  position: relative;
  margin: 0.6rem 0 0;
  min-height: 1em;
  font-size: 0.72rem;
  color: var(--ink-faint);
}

.widget-status:empty {
  display: none;
}

/* ---------- Panel inferior ---------- */
.bottom-dock[hidden] {
  display: none;
}

.bottom-dock .dock-hide {
  top: 0.6rem;
  right: 0.75rem;
}

.dock-hide:hover {
  transform: translateY(2px);
}

.dock-tab-show {
  margin-top: auto;
}

.dock-tab-show:hover {
  transform: translateY(-3px);
}

.bottom-dock {
  position: relative;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  max-height: min(44dvh, 26rem);
  border-radius: var(--radius-lg);
  padding: 0.6rem 0.9rem 0.9rem;
  animation: rise 0.65s var(--ease) 0.1s both;
  flex: 0 1 auto;
  min-height: 0;
}

.dock-tabs {
  display: inline-flex;
  align-self: flex-start;
  gap: 0.2rem;
  padding: 0.25rem;
  margin-bottom: 0.75rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
}

.dock-tab {
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.dock-tab:hover {
  color: var(--ink);
}

.dock-tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 4px 12px rgba(0, 0, 0, 0.25);
}

.dock-pane {
  overflow: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  animation: fade 0.3s ease both;
}

.dock-pane[hidden] {
  display: none;
}

.dock-foot {
  margin: 0.85rem 0 0;
  font-size: 0.66rem;
  color: var(--ink-faint);
}

/* 7 días */
.forecast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 0.5rem;
}

.day-card {
  display: grid;
  justify-items: center;
  text-align: center;
  padding: 0.85rem 0.6rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  transition: transform 0.2s var(--ease), background 0.2s ease, border-color 0.2s ease;
}

.day-card:hover {
  transform: translateY(-2px);
  background: var(--card-hover);
  border-color: var(--line-strong);
}

.day-card.today {
  background: linear-gradient(165deg, rgba(56, 189, 248, 0.28), rgba(129, 140, 248, 0.14));
  border-color: rgba(56, 189, 248, 0.45);
}

.day-name {
  margin: 0;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-transform: capitalize;
}

.day-card.today .day-name {
  color: #e0f2fe;
}

.day-icon {
  font-size: 1.8rem;
  margin: 0.45rem 0;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.day-cond {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.2;
}

.day-card.sunny:not(.today) {
  border-color: rgba(251, 191, 36, 0.35);
  background: linear-gradient(165deg, rgba(251, 191, 36, 0.12), rgba(255, 255, 255, 0.03));
}

.day-sun {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fde68a;
}

.day-temps {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.day-avg,
.day-rain {
  margin: 0.2rem 0 0;
  font-size: 0.7rem;
  color: var(--ink-faint);
}

.day-rain {
  color: #67e8f9;
}

/* Por horas */
.hourly-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(76px, 1fr);
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.hour-cell {
  scroll-snap-align: start;
  padding: 0.75rem 0.4rem;
  text-align: center;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
}

.hour-cell.peak-uv {
  border-color: rgba(251, 191, 36, 0.6);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.16), rgba(251, 191, 36, 0.02));
}

.hour-cell .h-time {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-faint);
}

.hour-cell .h-temp {
  margin: 0.35rem 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

.hour-cell .h-meta {
  margin: 0.12rem 0 0;
  font-size: 0.66rem;
  color: var(--ink-soft);
}

/* Detalle */
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.shot {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
}

.shot-wide {
  grid-column: 1 / -1;
}

.shot figcaption {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.8rem 0.9rem 0.4rem;
}

.shot figcaption strong {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
}

.shot figcaption span {
  font-size: 0.7rem;
  color: var(--ink-faint);
}

.rain-viz,
.tide-box {
  flex: 1;
  padding: 0.3rem 0.7rem 0.8rem;
}

.rain-viz canvas,
.tide-box canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
}

.tide-note {
  margin: 0.45rem 0 0;
  font-size: 0.7rem;
  color: var(--ink-faint);
}

.climate-shot {
  display: grid;
  place-items: center;
  align-content: center;
  padding: 1rem;
  text-align: center;
  flex: 1;
  background:
    radial-gradient(circle at 75% 15%, rgba(251, 191, 36, 0.28), transparent 45%),
    linear-gradient(165deg, rgba(56, 189, 248, 0.22), rgba(129, 140, 248, 0.1));
}

.climate-art {
  width: min(45%, 96px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0%, #fde68a 40%, var(--sun) 75%);
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.55);
  margin-bottom: 0.7rem;
  animation: float 5s ease-in-out infinite;
}

.climate-art.has-icon,
.climate-art.has-icon.wet {
  width: min(55%, 120px);
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.climate-art.wet {
  background: radial-gradient(circle at 35% 30%, #f1f5f9 0%, #94a3b8 55%, #475569 100%);
  box-shadow: 0 0 40px rgba(148, 163, 184, 0.45);
}

.climate-shot p {
  margin: 0;
  max-width: 28ch;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.data-item {
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--line);
}

.data-item .label {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.data-item .value {
  margin: 0.3rem 0 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.data-item .hint {
  margin: 0.15rem 0 0;
  font-size: 0.68rem;
  color: var(--ink-soft);
}

/* ---------- Leyendas ---------- */
.legend-panel {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.legend-panel[hidden] {
  display: none !important;
}

.legend__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.legend__count {
  font-size: 0.68rem;
  font-weight: 600;
  color: #7dd3fc;
}

.legend__block {
  margin-bottom: 0.6rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--line);
}

.legend__block h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 0.5rem;
  margin: 0 0 0.35rem;
  font-size: 0.84rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}

.legend__active {
  margin: 0 0 0.45rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: #7dd3fc;
}

.legend__text,
.legend__source,
.legend__empty {
  margin: 0.25rem 0 0;
  font-size: 0.7rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.legend__source {
  margin-top: 0.5rem;
  color: var(--ink-faint);
}

.legend__gradient {
  height: 0.5rem;
  border-radius: 999px;
  margin: 0.45rem 0 0.3rem;
}

.legend__scale {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.66rem;
  color: var(--ink-faint);
}

.legend__scale span:last-child {
  text-align: right;
}

/* Unidad del dataset junto al título */
.legend__unit {
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.12);
  color: #7dd3fc;
  font-size: 0.66rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Marcas con valores reales bajo la barra de color */
.legend__ticks {
  position: relative;
  height: 1.05rem;
  margin: -0.1rem 0 0.15rem;
  border-top: 0;
}

.legend__ticks span {
  position: absolute;
  top: 0.2rem;
  transform: translateX(-50%);
  font-size: 0.64rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}

.legend__ticks span::before {
  content: "";
  position: absolute;
  top: -0.32rem;
  left: 50%;
  width: 1px;
  height: 0.25rem;
  background: var(--ink-faint);
}

.legend__ticks span.is-start {
  transform: none;
}

.legend__ticks span.is-start::before {
  left: 0;
}

.legend__ticks span.is-end {
  transform: translateX(-100%);
}

.legend__ticks span.is-end::before {
  left: auto;
  right: 0;
}

/* Qué mide, resolución y frecuencia */
.legend__meta {
  display: grid;
  gap: 0.2rem;
  margin: 0.5rem 0 0;
  font-size: 0.68rem;
}

.legend__meta div {
  display: grid;
  grid-template-columns: 5.6rem minmax(0, 1fr);
  gap: 0.4rem;
}

.legend__meta dt {
  color: var(--ink-faint);
}

.legend__meta dd {
  margin: 0;
  color: var(--ink-soft);
}

/* Valor de la capa en el centro del mapa */
.legend__probe {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.4rem;
  margin: 0.5rem 0 0;
  padding: 0.4rem 0.55rem;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.7rem;
  color: var(--ink-soft);
}

.legend__probe strong {
  font-size: 0.82rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.legend__probe-k::before {
  content: "⌖ ";
  color: #7dd3fc;
}

.legend__probe small {
  color: var(--ink-faint);
}

/* Cruz en el centro del mapa: el punto que consulta la leyenda */
.map-probing #map::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 450;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  pointer-events: none;
  background:
    linear-gradient(#fff, #fff) center / 2px 100% no-repeat,
    linear-gradient(#fff, #fff) center / 100% 2px no-repeat;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.9));
  opacity: 0.85;
}

/* Valor de las capas en la cruz, justo debajo de ella */
.probe-chip {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 450;
  transform: translate(-50%, 18px);
  display: grid;
  gap: 0.15rem;
  max-width: min(18rem, 80vw);
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: rgba(11, 16, 32, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
  font-size: 0.74rem;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.7);
}

.probe-chip[hidden],
body:not(.map-probing) .probe-chip {
  display: none;
}

.probe-chip__k {
  color: var(--ink-soft);
}

.probe-chip strong {
  color: #bae6fd;
}

.legend__classes {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.legend__classes li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
}

.legend__swatch {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 0.25rem;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ---------- Geoprocesamiento ---------- */
.btn-geo-tools::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M4 6l6-2 6 3 4-1v14l-4 1-6-3-6 2z'/%3E%3Cpath d='M10 4v14M16 7v14'/%3E%3C/svg%3E") !important;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M4 6l6-2 6 3 4-1v14l-4 1-6-3-6 2z'/%3E%3Cpath d='M10 4v14M16 7v14'/%3E%3C/svg%3E") !important;
}

.geo-panel {
  width: min(23rem, calc(100vw - 2 * var(--gutter)));
}

.geo-panel section {
  margin-top: 1rem;
}

.geo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.geo-grid--2 { grid-template-columns: repeat(2, 1fr); }
.geo-grid--3 { grid-template-columns: repeat(3, 1fr); }
.geo-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.geo-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 2.6rem;
  padding: 0.45rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s var(--ease);
}

.geo-btn > span[aria-hidden] {
  font-size: 1.05rem;
  line-height: 1;
}

.geo-btn--soft,
.geo-btn--accent,
.geo-btn--danger {
  flex-direction: row;
  gap: 0.35rem;
}

.geo-btn:hover {
  background: var(--card-hover);
  border-color: var(--line-strong);
}

.geo-btn:active {
  transform: scale(0.97);
}

.geo-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.7);
  color: #e0f2fe;
}

.geo-btn--accent {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(129, 140, 248, 0.16));
  border-color: rgba(56, 189, 248, 0.4);
}

.geo-btn--danger {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

.geo-btn--danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

.geo-drop {
  position: relative;
  display: grid;
  gap: 0.3rem;
  justify-items: center;
  margin-top: 0.35rem;
  padding: 1rem 0.8rem;
  border: 1.5px dashed rgba(56, 189, 248, 0.45);
  border-radius: var(--radius);
  background: rgba(56, 189, 248, 0.05);
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.geo-drop:hover,
.geo-dragging .geo-drop {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.85);
}

.geo-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.geo-drop strong {
  font-size: 0.85rem;
  color: #bae6fd;
}

.geo-drop small {
  font-size: 0.68rem;
  color: var(--ink-faint);
  line-height: 1.4;
}

.geo-dragging .map {
  outline: 3px dashed rgba(56, 189, 248, 0.8);
  outline-offset: -12px;
}

.geo-count {
  margin-left: 0.3rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: #7dd3fc;
}

.geo-list {
  display: grid;
  gap: 0.3rem;
  max-height: 14rem;
  overflow: auto;
  scrollbar-width: thin;
}

.geo-empty {
  margin: 0;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--card);
  font-size: 0.75rem;
  color: var(--ink-faint);
  text-align: center;
}

.geo-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.35rem 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-left: 3px solid #38bdf8;
  border-radius: var(--radius-sm);
  background: var(--card);
}

.geo-item.result {
  border-left-color: var(--sun);
}

.geo-item.selected {
  border-color: rgba(244, 114, 182, 0.6);
  background: rgba(244, 114, 182, 0.08);
}

.geo-item__check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  cursor: pointer;
}

.geo-item__check input {
  accent-color: #f472b6;
}

.geo-item__check span {
  display: grid;
  min-width: 0;
}

.geo-item__check strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
}

.geo-item__check small {
  font-size: 0.66rem;
  color: var(--ink-faint);
}

.geo-icon {
  width: 1.8rem;
  height: 1.8rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.9rem;
  cursor: pointer;
}

.geo-icon:hover {
  background: var(--card-hover);
  color: var(--ink);
}

.geo-hint {
  margin-top: 0.4rem;
}

.geo-param {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  align-items: end;
  margin-top: 0.35rem;
}

.geo-param label {
  display: grid;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--ink-faint);
}

.geo-param input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  padding: 0.5rem 0.6rem;
  background: rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  color-scheme: dark;
}

.geo-status {
  margin: 0.9rem 0 0;
  min-height: 1em;
  font-size: 0.74rem;
  color: #7dd3fc;
}

.geo-status:empty {
  display: none;
}

.geo-status[data-kind="error"] {
  color: #fca5a5;
}

.geo-status[data-kind="ok"] {
  color: #86efac;
}

.geo-result {
  margin-top: 0.7rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.geo-result h4 {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fde68a;
}

.geo-table-wrap {
  overflow-x: auto;
}

.geo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.geo-table th,
.geo-table td {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.geo-table th {
  font-weight: 600;
  color: var(--ink-faint);
}

.geo-table tr:last-child td {
  border-bottom: 0;
}

.geo-profile {
  width: 100%;
  height: 60px;
  margin-bottom: 0.4rem;
}

.geo-profile polygon {
  fill: rgba(251, 191, 36, 0.18);
}

.geo-profile polyline {
  fill: none;
  stroke: var(--sun);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.geo-props th,
.geo-props td {
  padding: 0.15rem 0.4rem 0.15rem 0;
  font-size: 0.72rem;
  text-align: left;
  vertical-align: top;
}

.geo-props th {
  color: var(--ink-faint);
  font-weight: 600;
}

/* Barra y textos de Leaflet-Geoman en tema oscuro */
.leaflet-pm-toolbar .button-container a {
  background-color: var(--surface-strong);
}

.leaflet-tooltip.leaflet-pm-tooltip,
.leaflet-pm-tooltip {
  background: rgba(13, 18, 36, 0.9) !important;
  border-color: var(--line-strong) !important;
  color: var(--ink) !important;
}

.marker-icon,
.marker-icon-middle {
  background-color: #f8fafc !important;
  border-color: #38bdf8 !important;
}

/* Elegir ubicación tocando el mapa */
.map.picking-location,
.map.picking-location .leaflet-interactive {
  cursor: crosshair !important;
}

.map.picking-location::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 450;
  pointer-events: none;
  box-shadow: inset 0 0 0 3px rgba(56, 189, 248, 0.85);
  animation: breathe 1.6s ease-in-out infinite;
}

/* ---------- Marcadores de capas ---------- */
.wind-arrow {
  background: none;
  border: 0;
}

.wind-arrow svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: rgba(11, 16, 32, 0.85);
  stroke-width: 1.5;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
  -webkit-animation: wind-breathe 2.4s ease-in-out infinite;
  animation: wind-breathe 2.4s ease-in-out infinite;
}

@-webkit-keyframes wind-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@keyframes wind-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.leaflet-tooltip.nino-label,
.leaflet-tooltip.cyclone-label {
  background: rgba(13, 18, 36, 0.8);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.7rem;
  box-shadow: none;
}

.leaflet-tooltip.nino-label::before,
.leaflet-tooltip.cyclone-label::before {
  display: none;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--surface-strong);
  color: var(--ink);
  backdrop-filter: blur(14px);
}

.leaflet-popup-content {
  font-size: 0.8rem;
  line-height: 1.45;
}

/* ---------- Animaciones ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Escritorio: panel inferior junto al widget ---------- */
@media (min-width: 1100px) {
  .bottom-dock {
    width: min(46rem, calc(100vw - 23rem - 3 * var(--gutter)));
    align-self: flex-start;
  }
}

/* ---------- Tablet y móvil ---------- */
@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .ui {
    height: auto;
    min-height: 100dvh;
  }

  .top {
    border-radius: var(--radius-lg);
  }

  .layers-panel {
    position: relative;
    top: auto;
    right: auto;
    width: auto;
    max-height: none;
    animation-name: rise;
  }

  .weather-widget {
    width: 100%;
  }

  /* deja ver el mapa entre el widget y los pronósticos */
  .dock-tab-show {
    margin-top: 32dvh;
  }

  .bottom-dock {
    margin-top: 32dvh;
    max-height: none;
  }

  .dock-pane {
    overflow: visible;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .shot-wide {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .top {
    padding: 0.75rem;
  }

  .brand-tag {
    display: none;
  }

  .city-form {
    max-width: none;
    flex: 1 1 100%;
  }


  .btn-layers {
    padding: 0.55rem 0.85rem;
  }

  .dock-tabs {
    align-self: stretch;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .forecast-grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  }

  .widget-metrics {
    gap: 0.3rem;
  }
}

/* ---------- Imágenes satelitales (NASA/Sentinel) ---------- */
.layer-controls [hidden],
.sat-panel [hidden] {
  display: none !important;
}

.sat-panel {
  padding: 0 0.35rem 0.5rem;
}

.sat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.35rem 0 0.4rem;
}

.sat-tab {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sat-tab:hover {
  background: var(--card-hover);
  color: var(--ink);
}

.sat-tab.active {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.5);
  color: #e0f2fe;
}

.sat-filters {
  grid-template-columns: 1fr 1fr;
  margin: 0 0 0.4rem;
}

.sat-filters label:last-child {
  grid-column: 1 / -1;
}

.sat-cloud {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sat-cloud input {
  flex: 1;
  accent-color: var(--accent);
}

.sat-cloud output {
  min-width: 2.6rem;
  text-align: right;
  font-size: 0.78rem;
  color: var(--ink);
}

.sat-rgb {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

/* ---------- Plan Lite / Pro ---------- */
.btn-plan {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.75rem 0.4rem 0.45rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-plan:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-plan[data-plan="pro"] {
  padding-right: 0.45rem;
}

.plan-chip {
  display: inline-block;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.14);
  color: var(--ink);
}

.plan-chip--pro {
  background: linear-gradient(135deg, #fde68a, #fbbf24);
  color: #3b2300;
}

.plan-cta {
  color: #fde68a;
}

/* En Lite, los desplegables de capas muestran el candado PRO */
.plan-lite .layer-dropdown[data-count] > summary .layer-dropdown__label::after {
  content: "PRO";
  margin-left: 0.45rem;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  vertical-align: 0.1em;
  background: linear-gradient(135deg, #fde68a, #fbbf24);
  color: #3b2300;
}

.plan-lite .layer-dropdown[data-count] .layer-option {
  opacity: 0.62;
}

.pro-dialog {
  width: min(30rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: 0;
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: #0f172a;
}

.pro-dialog::backdrop {
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(4px);
}

.pro-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem 0.4rem;
}

.pro-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.pro-close {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.pro-body {
  display: grid;
  gap: 0.85rem;
  padding: 0.4rem 1.2rem 1.2rem;
}

.pro-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  font-size: 0.84rem;
}

.pro-features li {
  display: grid;
  grid-template-columns: 1.2rem 1fr auto;
  gap: 0.4rem;
  align-items: start;
}

.pro-features span {
  color: #fbbf24;
}

.pro-features em {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-faint);
}

.pro-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.pro-tabs button {
  border: 0;
  border-radius: 999px;
  padding: 0.45rem;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.pro-tabs button.active {
  background: rgba(56, 189, 248, 0.18);
  color: var(--ink);
}

.pro-form {
  display: grid;
  gap: 0.7rem;
}

.pro-form label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.74rem;
  color: var(--ink-faint);
}

.pro-form input {
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.6rem 0.7rem;
  background: rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
}

.pro-form input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.6);
}

.pro-price {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.45rem;
}

.pro-price strong {
  font-family: var(--font-display);
  font-size: 1.6rem;
}

.pro-price span {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.pro-price small {
  flex-basis: 100%;
  color: var(--ink-faint);
  font-size: 0.74rem;
}

.pro-pay {
  display: grid;
  gap: 0.5rem;
}

.pay-btn {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.1rem 0.6rem;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pay-btn:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.45);
}

.pay-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.pay-btn span {
  grid-column: 1;
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.pay-btn small {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fde68a;
}

.pro-status {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.pro-note {
  margin: 0;
  font-size: 0.76rem;
  color: var(--ink-faint);
}

.pro-error {
  margin: 0;
  padding: 0.5rem 0.7rem;
  border-radius: 0.6rem;
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
  font-size: 0.8rem;
}

.pro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.linkish {
  border: 0;
  padding: 0;
  background: none;
  color: #7dd3fc;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.pro-toast {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  z-index: 1300;
  transform: translateX(-50%);
  max-width: calc(100vw - 2rem);
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  animation: rise 0.4s var(--ease) both;
}

/* ---------- Instalar app (PWA) ---------- */
.install {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 1200;
  transform: translateX(-50%);
  width: min(26rem, calc(100vw - 2rem));
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  color: var(--ink);
  animation: rise 0.45s var(--ease) both;
}

.install__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: start;
}

.install__head img {
  border-radius: 0.8rem;
}

.install__head strong {
  font-family: var(--font-display);
  font-size: 1rem;
}

.install__head p {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.install__close {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.install__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.install__tabs button {
  border: 0;
  border-radius: 999px;
  padding: 0.4rem;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.install__tabs button.active {
  background: rgba(56, 189, 248, 0.18);
  color: var(--ink);
}

.install__steps {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.3rem;
  font-size: 0.82rem;
}

.install__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

@media (max-width: 560px) {
  .plan-cta {
    display: none;
  }

  .sat-filters {
    grid-template-columns: 1fr;
  }
}

/* ---------- Contacto por WhatsApp ---------- */
.wa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 0.45rem;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border-radius: 999px;
  background: #25d366;
  color: #062e16;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 22px -10px rgba(37, 211, 102, 0.9);
  transition: transform 0.2s var(--ease), background 0.2s ease;
}

.wa-btn:hover {
  background: #2ee072;
  transform: translateY(-1px);
}

.wa-btn svg {
  width: 1.35rem;
  height: 1.35rem;
}

.wa-btn__label {
  display: none;
}

/* El texto solo cabe en pantallas anchas; si no, queda el icono redondo. */
@media (min-width: 1600px) {
  .wa-btn {
    width: auto;
    padding: 0 0.85rem 0 0.6rem;
  }

  .wa-btn__label {
    display: inline;
  }
}

.admin-title {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
}

.admin-users {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  max-height: 16rem;
  overflow: auto;
}

.admin-users li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.1rem 0.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
}

.admin-users li > span:first-child {
  overflow-wrap: anywhere;
}

.admin-users small {
  color: var(--ink-faint);
}

.admin-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.8rem;
}

/* ---------- Análisis de terreno ---------- */
.terrain-run {
  width: 100%;
  margin-top: 0.45rem;
  padding: 0.7rem;
  font-size: 0.82rem;
}

.terrain-run.is-busy {
  opacity: 0.65;
  cursor: progress;
}

.terrain-results:empty {
  display: none;
}

.terrain-results {
  margin-top: 0.7rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

.terrain-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

.terrain-card {
  display: grid;
  gap: 0.1rem;
  padding: 0.5rem 0.55rem;
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  min-width: 0;
}

.terrain-card span {
  font-size: 0.66rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.terrain-card strong {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.terrain-card small {
  font-size: 0.66rem;
  color: var(--ink-soft);
}

.terrain-sub {
  margin: 0.9rem 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #bae6fd;
}

.terrain-risk {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 0.6rem;
}

.terrain-risk__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.76rem;
}

.terrain-risk__head em {
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  color: #0b1020;
  background: var(--risk, var(--ink-faint));
}

.terrain-risk small {
  font-size: 0.66rem;
  color: var(--ink-faint);
}

.terrain-bar {
  display: flex;
  height: 0.5rem;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.terrain-bar span {
  display: block;
  height: 100%;
}

.terrain-legend-classes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
  font-size: 0.66rem;
  color: var(--ink-soft);
}

.terrain-legend-classes i,
.terrain-classes i {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 0.2rem;
  margin-right: 0.3rem;
  vertical-align: -0.08rem;
}

.terrain-classes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
  font-size: 0.72rem;
}

.terrain-classes li {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.terrain-classes li span {
  flex: 1;
  min-width: 0;
}

.terrain-layers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}

.terrain-layer {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.45rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.72rem;
  cursor: pointer;
}

.terrain-layer.is-off {
  opacity: 0.45;
  cursor: not-allowed;
}

.terrain-opacity {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.5rem 0;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.terrain-opacity input {
  flex: 1;
  accent-color: var(--accent);
}

.terrain-results .geo-grid {
  margin-top: 0.3rem;
}

.terrain-overlay {
  image-rendering: pixelated;
}

/* ---------- Alertas ---------- */
.btn-alerts {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  cursor: pointer;
}

.btn-alerts:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-alerts svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-alerts.has-alerts {
  color: #fdba74;
  border-color: rgba(249, 115, 22, 0.55);
}

.btn-alerts.is-red {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.6);
}

.btn-alerts[data-count]:not([data-count=""])::after {
  content: attr(data-count);
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.05rem;
  text-align: center;
}

.alert-banners {
  position: fixed;
  top: max(0.75rem, env(safe-area-inset-top));
  left: 0;
  right: 0;
  z-index: 1300;
  display: grid;
  gap: 0.5rem;
  width: min(26rem, calc(100vw - 1.5rem));
  margin-inline: auto;
  pointer-events: none;
}

.alert-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: start;
  padding: 0.75rem 0.8rem;
  border-radius: var(--radius);
  background: var(--surface-strong);
  border-left: 4px solid #f97316;
  pointer-events: auto;
  animation: rise 0.35s var(--ease) both;
}

.alert-banner--red {
  border-left-color: #ef4444;
}

.alert-banner__icon {
  font-size: 1.4rem;
  line-height: 1;
}

.alert-banner strong {
  font-size: 0.85rem;
}

.alert-banner p {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.alert-banner button {
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.alert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.alert-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.7rem;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.35);
}

.alert-item--red {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.45);
}

.alert-item span {
  font-size: 1.3rem;
}

.alert-item strong {
  font-size: 0.84rem;
}

.alert-item p {
  margin: 0.15rem 0 0;
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.alert-empty {
  padding: 0.7rem;
  border-radius: 0.7rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  font-size: 0.8rem;
  color: #bbf7d0;
}

.alert-opts {
  display: grid;
  gap: 0.35rem;
}

.alert-opt {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.55rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
  cursor: pointer;
}

.alert-opt input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
}

.alert-opt small {
  grid-column: 2;
  color: var(--ink-faint);
  font-size: 0.72rem;
}

.alert-opt--notify {
  margin-top: 0.4rem;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.alert-num input {
  width: 4rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font: inherit;
  font-size: 0.75rem;
  color-scheme: dark;
}

/* ---------- Aviso de instalación: centrado sin transform (la animación lo usa) ---------- */
.install {
  left: 0;
  right: 0;
  margin-inline: auto;
  transform: none;
}

/* ---------- Adaptación por dispositivo (clases de device.js) ---------- */

/* Pantallas táctiles: objetivos de al menos 44 px y sin efectos que dependan del puntero. */
.is-touch .geo-btn,
.is-touch .sat-tab,
.is-touch .dock-tab,
.is-touch .terrain-layer,
.is-touch .layer-option {
  min-height: 2.75rem;
}

.is-touch .leaflet-control-zoom {
  display: none; /* se usa el gesto de pellizcar */
}

/* iPhone / iPad: Safari amplía la página al enfocar campos de menos de 16 px. */
.device-ios input,
.device-ios select,
.device-ios textarea {
  font-size: max(16px, 1em) !important;
}

.device-ios .ui {
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* Teléfono: cabecera compacta de dos filas (marca + iconos, luego la búsqueda). */
.form-phone .top {
  display: grid;
  grid-template-columns: 1fr repeat(6, auto);
  gap: 0.45rem;
  padding: 0.6rem;
  border-radius: var(--radius-lg);
}

.form-phone .brand {
  min-width: 0;
}

.form-phone .brand-mark {
  width: 1.9rem;
  height: 1.9rem;
}

.form-phone .brand-name {
  font-size: 1rem;
}

.form-phone .brand-tag {
  display: none;
}

.form-phone .city-form {
  grid-column: 1 / -1;
  grid-row: 2;
  max-width: none;
}

.form-phone .btn-layers,
.form-phone .btn-plan,
.form-phone .btn-alerts,
.form-phone .wa-btn {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  justify-content: center;
}

.form-phone .btn-layers > span,
.form-phone .plan-cta {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.form-phone .btn-plan .plan-chip {
  padding: 0.15rem 0.3rem;
  font-size: 0.55rem;
  letter-spacing: 0.02em;
}

/* Idioma: solo el globo; las opciones siguen legibles al abrir la lista. */
.form-phone .lang-picker select {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  color: transparent;
  background: rgba(255, 255, 255, 0.07);
}

.form-phone .lang-picker::before {
  left: 0.7rem;
}

.form-phone .lang-picker option {
  color: var(--ink);
}

/* Paneles y ventanas como hoja inferior en el teléfono. */
.form-phone .pro-dialog {
  width: 100vw;
  max-width: 100vw;
  max-height: 88dvh;
  margin: auto 0 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding-bottom: env(safe-area-inset-bottom);
}

.form-phone .terrain-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Tablet: el mapa queda visible; widget y paneles flotan como en escritorio. */
.form-tablet .weather-widget {
  width: min(26rem, 100%);
}

.form-tablet.orient-portrait .layers-panel {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 8.5rem);
  right: var(--gutter);
  width: min(24rem, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100dvh - 10rem);
  animation-name: slide-in;
}

.form-tablet .layers-panel {
  width: min(24rem, calc(100vw - 2 * var(--gutter)));
}

.form-tablet .terrain-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ---------- Pago manual (transferencia, cripto, PayPal.me) ---------- */
.pay-fields {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.pay-fields li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.1rem 0.6rem;
  align-items: center;
  padding: 0.5rem 0.65rem;
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
}

.pay-fields span {
  grid-column: 1 / -1;
  font-size: 0.7rem;
  color: var(--ink-faint);
}

.pay-fields strong {
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.pay-fields .pay-ref {
  border: 1px dashed rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.08);
}

.pay-link {
  display: block;
  text-align: center;
  text-decoration: none;
}

/* ---------- Ingreso, registro y cuenta ---------- */
.auth-box {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-auth,
.btn-account {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.4rem;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.btn-auth:hover,
.btn-account:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-auth svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.btn-auth--primary {
  border-color: transparent;
  background: var(--grad);
  color: #0b1020;
}

.btn-auth--primary:hover {
  background: var(--grad);
  filter: brightness(1.08);
}

.btn-account {
  padding-left: 0.25rem;
}

.btn-account__email {
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  background: var(--grad);
  color: #0b1020;
  font-weight: 700;
  font-size: 0.85rem;
}

.avatar--lg {
  width: 2.8rem;
  height: 2.8rem;
  font-size: 1.15rem;
  flex: 0 0 auto;
}

.acc-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.05);
}

.acc-card strong {
  display: block;
  overflow-wrap: anywhere;
}

.acc-card small {
  color: var(--ink-faint);
  font-size: 0.74rem;
}

.pro-status small {
  color: var(--ink-faint);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem !important;
}

/* Panel de administración */
.adm-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.adm-card {
  display: grid;
  gap: 0.1rem;
  padding: 0.55rem 0.6rem;
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.adm-card strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.adm-card span {
  font-size: 0.68rem;
  color: var(--ink-faint);
}

.adm-card.is-pro strong {
  color: #fde68a;
}

.adm-card.is-warn {
  border-color: rgba(249, 115, 22, 0.5);
}

.adm-card.is-warn strong {
  color: #fdba74;
}

.adm-search {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  color-scheme: dark;
}

.adm-meta {
  grid-column: 1 / -1;
  font-size: 0.68rem !important;
}

.adm-log .ev-login_fallido span,
.adm-log .ev-login_bloqueado span {
  color: #fca5a5;
}

.adm-log .ev-pago_aprobado span,
.adm-log .ev-pro_otorgado span {
  color: #86efac;
}

.adm-log .ev-pago_reportado span {
  color: #fdba74;
}

.pro-dialog .admin-users {
  max-height: 22rem;
}

/* Teléfono: solo iconos en la cabecera */
.form-phone .btn-auth--primary {
  display: none;
}

.form-phone .btn-auth,
.form-phone .btn-account {
  width: 2.4rem;
  padding: 0;
  justify-content: center;
}

.form-phone .btn-auth span,
.form-phone .btn-account__email {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.form-phone .top {
  grid-template-columns: 1fr repeat(7, auto);
}

.form-phone .adm-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pro-tabs.adm-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Teléfono: en la cabecera solo el logo; el nombre no cabe junto a los iconos */
.form-phone .brand > div {
  display: none;
}

.form-phone .brand-mark {
  display: block;
}

/* ---------- Luna ---------- */
.dock-tabs .dock-tab[data-tab="luna"]::before {
  content: "🌙 ";
}

.moon-hero {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 1.1rem;
  align-items: start;
}

.moon-figure {
  margin: 0;
  display: grid;
  gap: 0.5rem;
  justify-items: center;
}

.moon-disc {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 40px rgba(226, 232, 240, 0.12);
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.6s var(--ease);
}

.moon-disc img,
.moon-fallback,
.moon-fallback svg {
  display: block;
  width: 100%;
  height: 100%;
}

.moon-figure figcaption {
  display: grid;
  gap: 0.35rem;
  text-align: center;
}

.moon-figure small {
  color: var(--ink-faint);
  font-size: 0.68rem;
}

.moon-orient {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
}

.moon-orient button,
.nav-modes button,
.nav-act {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.moon-orient button.active,
.nav-modes button.active,
.nav-act.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.6);
  color: #e0f2fe;
}

.moon-now h3 {
  margin: 0.1rem 0 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.moon-big {
  margin: 0.1rem 0 0.6rem;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
}

.moon-big span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.moon-facts,
.nav-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.4rem;
}

.moon-fact,
.nav-card {
  display: grid;
  gap: 0.1rem;
  padding: 0.5rem 0.6rem;
  border-radius: 0.65rem;
  background: var(--card);
  border: 1px solid var(--line);
  min-width: 0;
}

.moon-fact span,
.nav-card span {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}

.moon-fact strong,
.nav-card strong {
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.moon-fact small,
.nav-card small {
  font-size: 0.66rem;
  color: var(--ink-soft);
}

.moon-tide {
  margin: 0.6rem 0 0.3rem;
  font-size: 0.8rem;
  color: #a5f3fc;
}

.moon-next {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.35rem;
}

.moon-next li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 0.45rem;
  align-items: center;
  font-size: 0.72rem;
}

.moon-next li svg {
  grid-row: span 2;
}

.moon-next strong {
  font-size: 0.74rem;
}

.moon-cal {
  margin-top: 1rem;
}

.moon-cal__title {
  margin: 0 0 0.4rem;
  font-weight: 600;
  text-transform: capitalize;
}

.moon-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
  max-width: 34rem;
}

.moon-cal__grid i {
  font-style: normal;
  text-align: center;
  font-size: 0.66rem;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.moon-day {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  padding: 0.25rem 0;
  border-radius: 0.5rem;
  font-size: 0.66rem;
  color: var(--ink-soft);
}

.moon-day b {
  font-weight: 600;
}

.moon-day.is-event {
  background: rgba(129, 140, 248, 0.16);
}

.moon-day.is-today {
  outline: 1.5px solid var(--accent);
  color: var(--ink);
}

.moon-section {
  margin: 1.2rem 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.moon-tag {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: 0.08rem;
}

.moon-tag--sci {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.moon-tag--trad {
  background: rgba(250, 204, 21, 0.16);
  color: #fde68a;
}

.moon-tag--belief {
  background: rgba(244, 114, 182, 0.16);
  color: #f9a8d4;
}

.moon-tag--limited {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}

.moon-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.moon-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
}

.moon-card.is-current {
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3) inset;
}

.moon-card img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #000;
  object-fit: cover;
}

.moon-card h4 {
  margin: 0;
  font-size: 0.95rem;
}

.moon-card h4 em {
  font-style: normal;
  font-size: 0.62rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--accent);
  color: #0b1020;
  vertical-align: 0.15rem;
}

.moon-card__range {
  margin: 0.1rem 0 0.4rem;
  font-size: 0.68rem;
  color: var(--ink-faint);
}

.moon-card dl {
  margin: 0;
  display: grid;
  gap: 0.4rem;
}

.moon-row dt {
  font-size: 0.72rem;
  font-weight: 600;
}

.moon-row dd {
  margin: 0.1rem 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.moon-note {
  margin: 0.8rem 0 0;
  padding: 0.6rem 0.75rem;
  border-radius: 0.6rem;
  background: rgba(244, 114, 182, 0.08);
  border: 1px solid rgba(244, 114, 182, 0.25);
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

@media (max-width: 640px) {
  .moon-hero {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .moon-figure {
    width: min(240px, 70vw);
  }

  .moon-card {
    grid-template-columns: 64px 1fr;
  }

  .moon-card img {
    width: 64px;
    height: 64px;
  }
}

.form-phone .dock-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ---------- Navegación ---------- */
.btn-nav::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m16.2 7.8-2.1 6.3-6.3 2.1 2.1-6.3z'/%3E%3C/svg%3E") center / contain no-repeat !important;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m16.2 7.8-2.1 6.3-6.3 2.1 2.1-6.3z'/%3E%3C/svg%3E") center / contain no-repeat !important;
}

.nav-panel {
  width: min(25rem, calc(100vw - 2 * var(--gutter)));
}

.nav-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
  margin: 0.8rem 0 0.5rem;
}

.nav-modes button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.45rem 0.3rem;
  font-size: 0.76rem;
}

.nav-point {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.8rem;
  font-size: 0.78rem;
}

.nav-point small {
  color: var(--ink-faint);
}

.nav-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.6rem 0;
}

.nav-act {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
}

.nav-verdict {
  display: grid;
  gap: 0.15rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.8rem;
  border: 1px solid var(--line);
  border-left-width: 5px;
}

.nav-verdict strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.nav-verdict span {
  font-size: 0.74rem;
  color: var(--ink-soft);
}

.nav-verdict small {
  font-size: 0.72rem;
}

.nav-verdict--ok {
  border-left-color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.nav-verdict--warn {
  border-left-color: #facc15;
  background: rgba(250, 204, 21, 0.1);
}

.nav-verdict--bad {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.nav-strip {
  display: flex;
  gap: 0.2rem;
  overflow-x: auto;
  padding: 0.3rem 0 0.4rem;
  scrollbar-width: thin;
}

.nav-strip__day {
  flex: 0 0 auto;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-style: normal;
  font-size: 0.6rem;
  color: var(--ink-faint);
  text-transform: capitalize;
}

.nav-hour {
  flex: 0 0 2.4rem;
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  padding: 0.3rem 0;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  font: inherit;
  font-size: 0.62rem;
  color: #0b1020;
  cursor: pointer;
}

.nav-hour b {
  font-size: 0.72rem;
}

.nav-hour--ok {
  background: #4ade80;
}

.nav-hour--warn {
  background: #facc15;
}

.nav-hour--bad {
  background: #f87171;
}

.nav-hour.is-night {
  filter: brightness(0.72);
}

.nav-hour.is-sel {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.nav-arrow {
  fill: currentColor;
  vertical-align: -0.15em;
}

.nav-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.7rem;
  align-items: center;
  margin-bottom: 0.6rem;
  font-size: 0.66rem;
}

.nav-legend span::before {
  content: "";
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  margin-right: 0.25rem;
  border-radius: 0.2rem;
  vertical-align: -0.05rem;
}

.nav-legend .ok::before {
  background: #4ade80;
}

.nav-legend .warn::before {
  background: #facc15;
}

.nav-legend .bad::before {
  background: #f87171;
}

.nav-legend small {
  color: var(--ink-faint);
}

.nav-sub {
  margin: 0.9rem 0 0.4rem;
  font-size: 0.78rem;
  color: #bae6fd;
}

.nav-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.nav-table th,
.nav-table td {
  padding: 0.3rem 0.35rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.nav-table th {
  color: var(--ink-faint);
  font-weight: 600;
}

.nav-metar,
.nav-tides {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.nav-metar li {
  padding: 0.45rem 0.55rem;
  border-radius: 0.55rem;
  background: var(--card);
  font-size: 0.72rem;
}

.nav-metar small {
  color: var(--ink-faint);
}

.nav-metar code {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.66rem;
  color: #a5f3fc;
  white-space: pre-wrap;
  word-break: break-word;
}

.nav-cat {
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 700;
  color: #0b1020;
  background: var(--ink-faint);
}

.nav-cat--vfr {
  background: #4ade80;
}

.nav-cat--mvfr {
  background: #60a5fa;
}

.nav-cat--ifr {
  background: #f87171;
}

.nav-cat--lifr {
  background: #e879f9;
}

.nav-tides li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.6rem;
  padding: 0.4rem 0.55rem;
  border-radius: 0.55rem;
  background: var(--card);
  font-size: 0.74rem;
}

.nav-tide--high span {
  color: #67e8f9;
}

.nav-tide--low span {
  color: #fdba74;
}

.nav-flow {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 64px;
  padding: 0.3rem;
  border-radius: 0.55rem;
  background: var(--card);
}

.nav-flow__bar {
  flex: 1;
  height: var(--h);
  border-radius: 2px 2px 0 0;
  opacity: 0.6;
}

.nav-flow__bar.is-fc {
  opacity: 0.95;
}

.nav-flow__bar.is-today {
  outline: 2px solid #fff;
}

.nav-flow__bar--ok {
  background: #38bdf8;
}

.nav-flow__bar--warn {
  background: #facc15;
}

.nav-flow__bar--bad {
  background: #ef4444;
}

.nav-safety {
  margin: 0.8rem 0 0;
  padding: 0.55rem 0.7rem;
  border-radius: 0.6rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-size: 0.72rem;
  line-height: 1.45;
}

.nav-empty {
  padding: 0.8rem;
  border-radius: 0.6rem;
  background: var(--card);
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.nav-disclaimer {
  margin: 0.8rem 0 0;
  font-size: 0.64rem;
  color: var(--ink-faint);
}

.nav-picking .leaflet-container {
  cursor: crosshair !important;
}

.form-tablet.orient-portrait .nav-panel {
  position: fixed;
}

/* Navegación, Análisis y Capas van juntos (al pasar a la segunda fila quedan a la derecha) */
#nav-btn {
  margin-left: auto;
}

.form-phone #nav-btn {
  margin-left: 0;
}

/* Paneles flotantes (Capas, Análisis, Navegación) siempre debajo de la cabecera real */
@media (min-width: 901px) {
  .layers-panel {
    top: calc(var(--gutter) + var(--top-h, 4.4rem) + 0.6rem);
    max-height: calc(100dvh - var(--top-h, 4.4rem) - 3 * var(--gutter) - 0.6rem);
  }
}

.form-tablet.orient-portrait .layers-panel {
  top: calc(var(--gutter) + var(--top-h, 8rem) + 0.6rem);
  max-height: calc(100dvh - var(--top-h, 8rem) - 3 * var(--gutter));
}

.moon-now {
  width: 100%;
  min-width: 0;
}

@media (max-width: 640px) {
  .moon-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Apple Pay: botón negro según la guía de Apple */
.pay-btn--apple {
  background: #000;
  border-color: #000;
  color: #fff;
}
.pay-btn--apple strong {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.pay-btn--apple span {
  color: rgba(255, 255, 255, 0.72);
}
.pay-btn--apple:hover {
  background: #1c1c1e;
  border-color: #3a3a3c;
}

/* Selector de plan Pro (anual en promoción / mensual) */
.plan-pick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
.plan-opt {
  position: relative;
  display: grid;
  gap: 0.15rem;
  align-content: start;
  text-align: left;
  padding: 0.85rem 0.85rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.plan-opt:hover { border-color: rgba(56, 189, 248, 0.45); }
.plan-opt.is-on {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  box-shadow: inset 0 0 0 1px #38bdf8;
}
.plan-opt strong { font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.plan-opt b { font-family: var(--font-display); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.plan-opt small { font-size: 0.72rem; color: var(--ink-faint); line-height: 1.35; }
.plan-badge {
  justify-self: start;
  margin-bottom: 0.2rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #f59e0b;
  color: #1a1203;
  font-style: normal;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.plan-pick--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.plan-pick--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.plan-opt--best:not(.is-on) { border-color: rgba(245, 158, 11, 0.55); }
.plan-opt .plan-was { font-size: 0.75rem; color: var(--ink-faint); text-decoration: line-through; }

.pro-eureka { font-size: 0.82rem; color: var(--ink-soft); line-height: 1.5; text-align: center; padding: 0.6rem 0.5rem; margin: 0; }
.pro-eureka b { color: var(--accent); }
.pro-eureka em { font-style: normal; color: var(--ink); }.plan-disc {
  justify-self: start;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
  color: #34d399;
}
.promo-auto { border-color: rgba(245, 158, 11, 0.5); background: rgba(245, 158, 11, 0.1); }
.promo-auto small { color: var(--ink-faint); font-size: 0.72rem; }
.camp-plans { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0; padding: 0.4rem 0 0; border: 0; font-size: 0.8rem; }
.camp-plans legend { padding: 0; font-size: 0.74rem; color: var(--ink-faint); }
.camp-plans label { display: inline-flex; align-items: center; gap: 0.3rem; }
@media (max-width: 560px) {
  .plan-pick--2, .plan-pick--3 { grid-template-columns: 1fr; }
}
@media (max-width: 360px) {
  .plan-pick { grid-template-columns: 1fr; }
}

/* Código promocional: campo en el pago y generador del administrador */
.promo-form {
  display: flex;
  gap: 0.5rem;
}
.promo-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.55rem 0.7rem;
  background: rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.promo-form input::placeholder {
  text-transform: none;
  letter-spacing: 0;
}
.promo-form input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.6);
}
.promo-on {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(52, 211, 153, 0.45);
  border-radius: 0.6rem;
  background: rgba(52, 211, 153, 0.1);
  font-size: 0.82rem;
}
.pro-price .promo-was {
  text-decoration: line-through;
}
.promo-gen {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: end;
}
.promo-gen__note,
.promo-gen .btn-primary {
  grid-column: 1 / -1;
}
.promo-new {
  display: grid;
  gap: 0.2rem;
  justify-items: start;
  margin: 0;
  padding: 0.75rem;
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 0.6rem;
  background: rgba(56, 189, 248, 0.1);
}
.promo-new span,
.promo-new small {
  font-size: 0.74rem;
  color: var(--ink-faint);
}
.promo-new strong.mono {
  font-size: 1.15rem !important;
  letter-spacing: 0.06em;
  user-select: all;
}
.admin-users .promo-used {
  opacity: 0.6;
}
@media (max-width: 560px) {
  .promo-gen {
    grid-template-columns: 1fr;
  }
}

/* Paneles al 70 % en pantallas grandes (clima, pronóstico, Capas, Análisis, Navegación).
   zoom también escala las distancias del propio panel: se dividen para que sigan bajo la cabecera. */
@media (min-width: 901px) {
  :root {
    --panel-zoom: 0.7;
  }
  .weather-widget,
  .bottom-dock,
  .layers-panel {
    zoom: var(--panel-zoom);
  }
  /* Pronóstico 30 % más grande que los demás paneles. */
  .bottom-dock {
    zoom: calc(var(--panel-zoom) * 1.3);
    /* Ancho: todo el espacio libre hasta el panel de Capas (21rem al 70 %). zoom escala también vw y rem,
       así que se divide por el zoom del pronóstico para que la medida final sea en píxeles de pantalla. */
    width: min(72rem, calc((100vw - 3 * var(--gutter) - 21rem * var(--panel-zoom) - 1rem) / (var(--panel-zoom) * 1.3)));
    max-width: none;
  }
  /* Los 7 días en una sola fila: así se ven completos sin desplazarse. */
  .bottom-dock .forecast-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.45rem;
  }
  .bottom-dock .day-card {
    padding: 0.75rem 0.45rem;
  }
}

/* Pantallas de escritorio angostas o bajas: tarjetas más compactas para que la fila quepa entera */
@media (min-width: 901px) and (max-width: 1180px), (min-width: 901px) and (max-height: 800px) {
  .bottom-dock .dock-tabs {
    margin-bottom: 0.5rem;
  }
  .bottom-dock .day-card {
    padding: 0.5rem 0.35rem;
  }
  .bottom-dock .day-icon {
    font-size: 1.45rem;
    margin: 0.25rem 0;
  }
  .bottom-dock .day-cond {
    margin-bottom: 0.2rem;
  }
  .bottom-dock .day-sun,
  .bottom-dock .day-avg,
  .bottom-dock .day-rain {
    margin-top: 0.12rem;
  }
  /* Las leyendas se leen al 85 % aunque el panel esté al 70 %: tienen números y unidades pequeños. */
  .legend-panel {
    zoom: calc(0.85 / var(--panel-zoom));
  }
  .layers-panel {
    top: calc((var(--gutter) + var(--top-h, 4.4rem) + 0.6rem) / var(--panel-zoom));
    right: calc(var(--gutter) / var(--panel-zoom));
    max-height: calc((100dvh - var(--top-h, 4.4rem) - 3 * var(--gutter) - 0.6rem) / var(--panel-zoom));
  }
  .form-tablet.orient-portrait .layers-panel {
    top: calc((var(--gutter) + var(--top-h, 8rem) + 0.6rem) / var(--panel-zoom));
    max-height: calc((100dvh - var(--top-h, 8rem) - 3 * var(--gutter)) / var(--panel-zoom));
  }
}

/* ---------- Clima Watch y Pronóstico en ruta (route.js) ---------- */
.btn-watch {
  text-decoration: none;
}

/* Ícono de Clima Watch: retícula roja que gira y punto central que late, como su pantalla de arranque */
.btn-watch::before {
  display: none;
}

.watch-reticle {
  position: relative;
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  border: 1.5px solid rgba(239, 68, 68, 0.85);
  background:
    linear-gradient(rgba(239, 68, 68, 0.7), rgba(239, 68, 68, 0.7)) center / 1px 100% no-repeat,
    linear-gradient(rgba(239, 68, 68, 0.7), rgba(239, 68, 68, 0.7)) center / 100% 1px no-repeat;
  animation: watch-spin 6s linear infinite;
}

.watch-reticle::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  animation: watch-ping 1.8s ease-out infinite;
}

/* Al pasar o presionar, gira más rápido */
.btn-watch:hover .watch-reticle,
.btn-watch:active .watch-reticle,
.btn-watch:focus-visible .watch-reticle {
  animation-duration: 1.2s;
}

@keyframes watch-spin {
  to { transform: rotate(360deg); }
}

@keyframes watch-ping {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  80%, 100% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .watch-reticle,
  .watch-reticle::after {
    animation: none;
  }
}

.btn-route::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='6' cy='19' r='3'/%3E%3Cpath d='M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15'/%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3C/svg%3E") center / contain no-repeat !important;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='6' cy='19' r='3'/%3E%3Cpath d='M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15'/%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3C/svg%3E") center / contain no-repeat !important;
}

.route-panel {
  width: min(27rem, calc(100vw - 2 * var(--gutter)));
}

.route-pending {
  display: block;
  margin-top: 0.3rem;
  color: var(--ink-faint);
  animation: breathe 1.4s ease-in-out infinite;
}

.route-modes {
  grid-template-columns: repeat(4, 1fr);
}

.route-modes button {
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.7rem;
}

.route-modes button span {
  font-size: 1.15rem;
}

.route-form {
  display: grid;
  gap: 0.45rem;
}

.route-field {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.3rem;
}

.route-field input,
.route-depart input {
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.7rem;
  border-radius: 0.65rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  color-scheme: dark;
}

.route-field input:focus,
.route-depart input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.6);
}

.route-dot {
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  color: #0b1020;
  border: 2px solid #0b1020;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.route-dot--a {
  background: #22c55e;
}

.route-dot--b {
  background: #ef4444;
  color: #fff;
}

.route-mini {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 0.6rem;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.85rem;
}

.route-mini:hover,
.route-mini.active {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.2);
}

.route-suggest {
  position: absolute;
  z-index: 5;
  top: calc(100% + 0.2rem);
  left: 1.7rem;
  right: 0;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  border-radius: 0.7rem;
  border: 1px solid var(--line-strong);
  background: #111831;
  box-shadow: var(--shadow);
}

.route-suggest button {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 0;
  border-radius: 0.5rem;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.76rem;
  text-align: left;
  cursor: pointer;
}

.route-suggest button:hover {
  background: rgba(56, 189, 248, 0.15);
}

.route-depart {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.74rem;
  color: var(--ink-soft);
}

.route-depart small {
  color: var(--ink-faint);
  font-size: 0.66rem;
}

.route-go {
  margin-top: 0.2rem;
}

#route-out {
  margin-top: 0.8rem;
}

.route-error {
  color: #fca5a5;
}

.route-sum {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0.5rem;
}

.route-verdict {
  margin-bottom: 0.2rem;
}

.route-hazards {
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.2rem;
  font-size: 0.72rem;
}

.route-hazards i,
.route-lvl {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  vertical-align: 0.05em;
}

.route-best {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  height: 6rem;
}

.route-best__bar {
  display: grid;
  grid-template-rows: 1fr auto auto;
  align-items: end;
  justify-items: center;
  padding: 0.25rem 0.1rem;
  border-radius: 0.55rem;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  font: inherit;
  cursor: pointer;
}

.route-best__bar i {
  width: 60%;
  border-radius: 0.25rem 0.25rem 0 0;
  align-self: end;
}

.route-best__bar b {
  font-size: 0.66rem;
  color: var(--ink);
}

.route-best__bar small {
  font-size: 0.6rem;
}

.route-best__bar.is-best {
  border-color: rgba(34, 197, 94, 0.7);
  background: rgba(34, 197, 94, 0.14);
}

.route-chart {
  display: block;
  width: 100%;
  border-radius: 0.6rem;
  background: rgba(0, 0, 0, 0.2);
}

.route-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  margin: 0.3rem 0 0;
  font-size: 0.66rem;
  color: var(--ink-soft);
}

.route-legend .sw {
  display: inline-block;
  width: 0.9rem;
  height: 0.55rem;
  border-radius: 0.15rem;
  margin-right: -0.2rem;
}

.sw-band { background: rgba(251, 146, 60, 0.4); }
.sw-line { background: #fb923c; height: 0.2rem !important; }
.sw-elev { background: rgba(148, 163, 184, 0.35); }
.sw-rain { background: rgba(56, 189, 248, 0.55); }
.sw-rain1 { background: #2563eb; }
.sw-gust { background: repeating-linear-gradient(90deg, #e2e8f0 0 3px, transparent 3px 5px); height: 0.2rem !important; }

.route-table-wrap {
  overflow-x: auto;
}

.route-table td {
  vertical-align: middle;
  white-space: nowrap;
}

.route-table td small {
  display: block;
  font-size: 0.6rem;
  color: var(--ink-faint);
}

.route-table tbody tr {
  cursor: pointer;
}

.route-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.08);
}

.route-table tr.lvl-1 {
  background: rgba(250, 204, 21, 0.06);
}

.route-table tr.lvl-2 {
  background: rgba(239, 68, 68, 0.1);
}

.route-ic {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  vertical-align: middle;
}

.route-table td:nth-child(3) small {
  display: inline;
  margin-left: 0.2rem;
  white-space: normal;
}

.route-tips {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.25rem;
  font-size: 0.74rem;
  color: var(--ink-soft);
}

.route-pin {
  background: none;
  border: 0;
}

.route-tip {
  font-size: 0.74rem;
  line-height: 1.35;
}

/* Vista 3D a pantalla completa */
.route3d {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: #0b1020;
}

.route3d[hidden] {
  display: none;
}

/* Más específico que .maplibregl-map (position: relative), que se carga después y dejaba el mapa con 0 px de alto. */
.route3d .route3d__map {
  position: absolute;
  inset: 0;
}
.route3d__bar .nav-act[hidden] { display: none; }

.route3d__bar {
  position: absolute;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.8rem;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.route3d__info {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.route-tip3d .maplibregl-popup-content {
  background: #111831;
  color: var(--ink);
  font: 0.74rem/1.35 var(--font-body);
  border-radius: 0.6rem;
}

@media (max-width: 600px) {
  .route3d__bar {
    border-radius: var(--radius);
  }
}

/* Panel compacto de navegación en la vista 3D: indicación, datos y clima */
.r3n {
  position: absolute;
  top: max(0.8rem, env(safe-area-inset-top));
  left: 0.8rem;
  width: min(300px, calc(100vw - 32px));
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.9rem;
  font-size: 0.74rem;
  line-height: 1.3;
}
.r3n[hidden] { display: none; }
.r3n small { color: var(--ink-faint); }
.r3n__step { display: grid; gap: 0.1rem; }
.r3n__step b { font-size: 0.92rem; line-height: 1.2; }
.r3n__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem 0.5rem;
  padding: 0.4rem 0;
  border-block: 1px solid var(--line);
}
.r3n__stats div { display: grid; min-width: 0; }
.r3n__stats small { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.04em; }
.r3n__stats b { font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r3n__wx, .r3n__next { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 0.15rem 0.45rem; }
.r3n__next { grid-template-columns: auto 1fr; padding: 0.35rem 0.5rem; border-radius: 0.6rem; border-left: 3px solid #22c55e; background: rgba(255, 255, 255, 0.04); }
.r3n__next--warn { border-left-color: #facc15; }
.r3n__next--bad { border-left-color: #ef4444; }
.r3n__wx > b { font-size: 1.2rem; font-family: var(--font-display); }
.r3n__ic { font-size: 1.25rem; line-height: 1; }
.r3n__ic svg { width: 1.6rem; height: 1.6rem; }
.r3n__alert { margin: 0; padding: 0.35rem 0.5rem; border-radius: 0.5rem; background: rgba(239, 68, 68, 0.18); border: 1px solid rgba(239, 68, 68, 0.5); }
.r3n__alert--info { background: rgba(56, 189, 248, 0.14); border-color: rgba(56, 189, 248, 0.45); }
.r3n__hint { margin: 0; color: var(--ink-faint); font-size: 0.7rem; }
.nav-act--gps[aria-pressed="true"] { border-color: #38bdf8; background: rgba(56, 189, 248, 0.2); }
#route3d-labels[aria-pressed="false"] { opacity: 0.6; }
@media (max-width: 600px) {
  .r3n { left: 16px; right: 16px; width: auto; top: max(0.6rem, env(safe-area-inset-top)); }
  .r3n__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Posición GPS en la vista 3D: punto con halo pulsante y cono de rumbo */
.gps-dot { position: relative; width: 22px; height: 22px; }
.gps-dot__core {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #38bdf8;
  border: 3px solid #fff;
  box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.6);
  animation: gps-pulse 2s ease-out infinite;
}
.gps-dot__cone {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 0;
  height: 0;
  margin-left: -14px;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-bottom: 30px solid rgba(56, 189, 248, 0.45);
  display: none;
}
.gps-dot.has-heading .gps-dot__cone { display: block; }
@keyframes gps-pulse {
  70% { box-shadow: 0 0 0 16px rgba(56, 189, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .gps-dot__core { animation: none; }
}

/* ---------- Barra superior compacta (escritorio y tableta) ----------
   Una sola fila en pantallas anchas: marca · búsqueda · herramientas · cuenta.
   Por debajo de 1600 px las herramientas pasan a una segunda fila tipo pestañas.
   El teléfono conserva su propia cabecera (.form-phone). */
html:not(.form-phone) .top {
  gap: 0.4rem;
  padding: 0.4rem 0.45rem 0.4rem 0.6rem;
  border-radius: 1.6rem;
}

html:not(.form-phone) .top::after {
  /* salto de fila entre la barra principal y las herramientas */
  content: "";
  order: 20;
  flex-basis: 100%;
  height: 0;
}

html:not(.form-phone) .brand {
  order: 0;
  gap: 0.5rem;
  margin-right: 0.35rem;
}

html:not(.form-phone) .brand-mark {
  width: 1.85rem;
  height: 1.85rem;
  box-shadow: 0 0 14px -3px rgba(56, 189, 248, 0.6);
}

html:not(.form-phone) .brand-name {
  font-size: 1rem;
}

html:not(.form-phone) .brand-tag {
  display: none;
}

html:not(.form-phone) .city-form {
  order: 1;
  flex: 1 1 160px;
  min-width: 0;
  max-width: 360px;
  height: 2.25rem;
  padding: 0.15rem;
}

html:not(.form-phone) .city-form input {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}

html:not(.form-phone) .city-form .btn-geo {
  width: 1.9rem;
  height: 1.9rem;
}

html:not(.form-phone) .city-form button[type="submit"] {
  height: 1.9rem;
  padding: 0 0.7rem;
  font-size: 0.76rem;
  box-shadow: none;
}

/* Cuenta y ajustes, a la derecha de la primera fila */
html:not(.form-phone) .lang-picker { order: 3; margin-left: auto; }
html:not(.form-phone) .btn-plan { order: 4; }
html:not(.form-phone) .btn-alerts { order: 5; }
html:not(.form-phone) .wa-btn { order: 6; }
html:not(.form-phone) .auth-box { order: 7; gap: 0.3rem; }

/* Idioma: solo el globo, como en el teléfono; la lista muestra los nombres al abrirla */
html:not(.form-phone) .lang-picker select {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  color: transparent;
  background: rgba(255, 255, 255, 0.07);
}

html:not(.form-phone) .lang-picker option {
  color: var(--ink);
}

html:not(.form-phone) .lang-picker::before {
  left: 0.63rem;
}

html:not(.form-phone) .btn-plan {
  height: 2.25rem;
  padding: 0 0.65rem 0 0.35rem;
  font-size: 0.78rem;
}

html:not(.form-phone) .btn-alerts,
html:not(.form-phone) .wa-btn {
  width: 2.25rem;
  height: 2.25rem;
}

html:not(.form-phone) .wa-btn {
  padding: 0;
  box-shadow: none;
}

/* WhatsApp como icono redondo; el texto queda en el título y la etiqueta accesible */
html:not(.form-phone) .wa-btn__label {
  display: none;
}

html:not(.form-phone) .btn-auth,
html:not(.form-phone) .btn-account {
  height: 2.25rem;
  padding: 0 0.75rem;
  font-size: 0.78rem;
}

html:not(.form-phone) .btn-account {
  padding-left: 0.25rem;
}

/* Herramientas: pestañas ligeras, sin caja, en la segunda fila */
html:not(.form-phone) .top > .btn-layers {
  order: 30;
  margin-left: 0;
  height: 2rem;
  padding: 0 0.75rem;
  gap: 0.4rem;
  border-color: transparent;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

html:not(.form-phone) .top > .btn-layers::before {
  width: 0.95rem;
  height: 0.95rem;
}

html:not(.form-phone) .top > .btn-layers:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

html:not(.form-phone) .top > .btn-layers[aria-expanded="true"] {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.45);
  color: #bae6fd;
}

html:not(.form-phone) .top > #nav-btn {
  margin-left: 0;
}

/* Capas, la herramienta principal, queda al final y destacada */
html:not(.form-phone) .top > #layers-btn {
  margin-left: auto;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line);
}

/* Pantallas anchas: todo en una fila */
@media (min-width: 1600px) {
  html:not(.form-phone) .top {
    border-radius: 999px;
  }

  html:not(.form-phone) .city-form {
    min-width: 200px;
  }

  html:not(.form-phone) .top::after {
    display: none;
  }

  html:not(.form-phone) .top > .btn-layers {
    order: 2;
    height: 2.25rem;
    padding: 0 0.6rem;
  }

  html:not(.form-phone) .top > #watch-btn {
    margin-left: auto;
  }

  html:not(.form-phone) .top > #layers-btn {
    margin-left: 0;
  }

  html:not(.form-phone) .lang-picker {
    margin-left: 0.35rem;
    padding-left: 0.6rem;
    border-left: 1px solid var(--line);
  }
}

/* Tableta angosta: la búsqueda ocupa su propia fila */
@media (max-width: 820px) {
  html:not(.form-phone) .city-form {
    order: 10;
    flex-basis: 100%;
    max-width: none;
  }
}

/* Teléfono: Navegación, Análisis y Capas junto a la búsqueda (dos filas en vez de tres) */
.form-phone .city-form {
  grid-column: 1 / -4;
  min-width: 0;
}

.form-phone .top {
  gap: 0.4rem 0.3rem;
}

.form-phone .top > .btn-layers,
.form-phone .btn-plan,
.form-phone .btn-alerts,
.form-phone .wa-btn,
.form-phone .btn-auth,
.form-phone .btn-account,
.form-phone .lang-picker select {
  width: 2.2rem;
  height: 2.2rem;
}

.form-phone .lang-picker::before {
  left: 0.6rem;
}

.form-phone .city-form .btn-geo {
  width: 1.8rem;
  height: 1.8rem;
}

.form-phone .city-form input {
  padding: 0.45rem 0.25rem 0.45rem 0.7rem;
}

.form-phone .city-form button[type="submit"] {
  padding: 0.5rem 0.55rem;
  font-size: 0.7rem;
}

/* Teléfonos angostos: «Ver clima» como lupa para dejar sitio al nombre de la ciudad */
@media (max-width: 400px) {
  .form-phone .city-form button[type="submit"] {
    width: 1.9rem;
    height: 1.9rem;
    padding: 0;
    font-size: 0;
  }

  .form-phone .city-form button[type="submit"]::before {
    content: "";
    width: 0.95rem;
    height: 0.95rem;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  }
}
