/* ══════════════════════════════════════════════════════════════════════════
   FENÓMENOS DEL CARIBE — app.css
   Estilos de Fenómenos App: la puerta de acceso (acceso.html) y la app del
   tiempo (app.html). Solo depende de los tokens de style.css; no carga
   estudio.css, así que define sus propios campos, pestañas y toasts.
   ══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────  CAMPOS Y CONTROLES  ──────────────────────── */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1.6rem;
  min-width: 0;
}

.field__label {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.12rem;
  text-transform: uppercase;
  color: var(--text-5);
}

.field__input {
  width: 100%;
  padding: 1.2rem 1.6rem;
  font-family: inherit;
  font-size: 1.5rem;
  color: #fff;
  background-color: rgba(5, 7, 17, 0.75);
  border: 0.1rem solid var(--line-2);
  border-radius: var(--r-sm);
  transition: border-color 0.2s var(--ease);
}
.field__input::placeholder {
  color: var(--text-5);
}
.field__input:focus {
  outline: none;
  border-color: var(--text-4);
}

.field__select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.field__select-wrap select {
  appearance: none;
  cursor: pointer;
  padding-right: 4rem;
}
.field__select-wrap ion-icon {
  position: absolute;
  right: 1.4rem;
  font-size: 1.6rem;
  color: var(--text-5);
  pointer-events: none;
}

.seg {
  display: flex;
  gap: 0.3rem;
  padding: 0.4rem;
  border: 0.1rem solid var(--line-2);
  border-radius: var(--r-pill);
  background-color: rgba(5, 7, 17, 0.6);
}

.seg__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.8rem 1.6rem;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text-4);
  border-radius: var(--r-pill);
  white-space: nowrap;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.seg__btn:hover {
  color: #fff;
}
.seg__btn.is-active {
  color: var(--ink);
  background-color: #dfe3ee;
  font-weight: 600;
}
.seg__btn ion-icon {
  font-size: 1.6rem;
}

/* ══════════════════════════════════════════════════════════════════════════
   ACCESO — página de entrada
   ══════════════════════════════════════════════════════════════════════════ */

.auth-body {
  min-height: 100svh;
  background-color: var(--bg);
}

.auth {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100svh;
}

@media (min-width: 64em) {
  .auth {
    grid-template-columns: 1.15fr 1fr;
  }
}

/* Panel de marca (izquierda) */

.auth__brand {
  position: relative;
  display: none;
  overflow: hidden;
  background-color: var(--surface-2);
  background-image:
    linear-gradient(rgba(69, 81, 118, 0.14) 0.1rem, transparent 0.1rem),
    linear-gradient(90deg, rgba(69, 81, 118, 0.14) 0.1rem, transparent 0.1rem);
  background-size: 5.2rem 5.2rem;
  border-right: 0.1rem solid var(--line);
}

@media (min-width: 64em) {
  .auth__brand {
    display: block;
  }
}

.auth__brand-glow {
  position: absolute;
  top: -18rem;
  left: -12rem;
  width: 52rem;
  height: 52rem;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 176, 32, 0.14) 0%,
    rgba(23, 37, 84, 0.35) 45%,
    transparent 70%
  );
  filter: blur(2rem);
  pointer-events: none;
}

.auth__brand-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3.6rem;
  height: 100%;
  padding: clamp(3.2rem, 6vw, 8rem);
  max-width: 62rem;
}

.auth__logo-row {
  display: inline-flex;
  align-items: center;
  gap: 1.2rem;
  font-family: "Gugi", sans-serif;
  font-size: 1.8rem;
  color: #fff;
  text-decoration: none;
}
.auth__logo-row img {
  border-radius: 50%;
}

.auth__headline {
  font-size: clamp(3.4rem, 3.6vw, 5rem);
  line-height: 1.15;
}

.auth__features {
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
}

.auth__features li {
  display: flex;
  align-items: flex-start;
  gap: 1.6rem;
}

.auth__features ion-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 4.4rem;
  height: 4.4rem;
  padding: 1.1rem;
  font-size: 2.2rem;
  color: var(--alert);
  background-color: var(--ink);
  border: 0.1rem solid var(--line-2);
  border-radius: var(--r-sm);
  box-sizing: border-box;
}

.auth__features strong {
  display: block;
  font-size: 1.6rem;
  color: #fff;
  margin-bottom: 0.3rem;
}
.auth__features span {
  font-size: 1.4rem;
  color: var(--text-4);
}

.auth__fine {
  font-size: 1.3rem;
  color: var(--text-5);
}

/* Tarjeta de acceso (derecha) */

.auth__side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 4vw, 4.8rem) var(--gutter);
}

.auth__card {
  width: min(100%, 44rem);
  padding: clamp(2.4rem, 4vw, 3.6rem);
  background-color: var(--surface);
  border: 0.1rem solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: 0 2.4rem 8rem rgba(0, 4, 20, 0.55);
}

.auth__card-head {
  margin-bottom: 2.4rem;
}

.auth__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 1.3rem;
  margin-bottom: 1.6rem;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.14rem;
  text-transform: uppercase;
  color: var(--alert);
  background-color: var(--ink);
  border: 0.1rem solid rgba(255, 176, 32, 0.35);
  border-radius: var(--r-pill);
}
.auth__badge ion-icon {
  font-size: 1.5rem;
}

.auth__title {
  font-family: "Gugi", sans-serif;
  font-size: 2.4rem;
  font-weight: 400;
  color: #fff;
  margin-bottom: 0.6rem;
}

.auth__sub {
  font-size: 1.4rem;
  color: var(--text-4);
}

.auth__tabs {
  margin-bottom: 2.4rem;
}
.auth__tabs .seg__btn {
  flex: 1;
}

.auth__submit {
  width: 100%;
  justify-content: center;
  margin-top: 0.4rem;
}

.auth__error {
  min-height: 2rem;
  margin-top: 1.2rem;
  font-size: 1.35rem;
  font-weight: 500;
  color: #ff8a8e;
  text-align: center;
}
.auth__error:empty {
  margin-top: 0;
}

.auth__divider {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin: 1.6rem 0;
  font-size: 1.2rem;
  letter-spacing: 0.14rem;
  text-transform: uppercase;
  color: var(--text-5);
}
.auth__divider::before,
.auth__divider::after {
  content: "";
  flex: 1;
  height: 0.1rem;
  background-color: var(--line-2);
}

.auth__guest {
  width: 100%;
  justify-content: center;
}

.auth__guest-note {
  margin-top: 1.2rem;
  font-size: 1.25rem;
  color: var(--text-5);
  text-align: center;
}

.auth__back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 2.4rem;
  font-size: 1.35rem;
  color: var(--text-4);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.auth__back:hover {
  color: #fff;
}

/* ══════════════════════════════════════════════════════════════════════════
   APP — app.html
   ══════════════════════════════════════════════════════════════════════════ */

.app-body {
  background-color: var(--bg);
  overflow: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100svh;
}

/* ───────────────────────────  BARRA SUPERIOR  ────────────────────────── */

.app__topbar {
  position: relative;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: 1rem clamp(1.4rem, 3vw, 2.8rem);
  background-color: rgba(0, 11, 51, 0.85);
  border-bottom: 0.1rem solid var(--line-2);
  backdrop-filter: blur(2rem);
  -webkit-backdrop-filter: blur(2rem);
}

.app__logo {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  flex-shrink: 0;
}
.app__logo img {
  border-radius: 50%;
}
.app__logo-title {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.app__logo-title strong {
  font-family: "Gugi", sans-serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: #fff;
  white-space: nowrap;
}
.app__logo-title span {
  font-size: 1.05rem;
  letter-spacing: 0.14rem;
  text-transform: uppercase;
  color: var(--alert);
}

@media (max-width: 40em) {
  .app__logo-title {
    display: none;
  }
}

/* Buscador de lugares */

.app__search {
  position: relative;
  flex: 1;
  max-width: 46rem;
  margin-inline: auto;
}

.app__search-box {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem 1.4rem;
  background-color: rgba(5, 7, 17, 0.7);
  border: 0.1rem solid var(--line-2);
  border-radius: var(--r-pill);
  transition: border-color 0.2s var(--ease);
}
.app__search-box:focus-within {
  border-color: var(--text-4);
}
.app__search-box ion-icon {
  font-size: 1.7rem;
  color: var(--text-5);
  flex-shrink: 0;
}
.app__search-box input {
  width: 100%;
  font: inherit;
  font-size: 1.4rem;
  color: #fff;
  background: none;
  border: 0;
  outline: none;
}
.app__search-box input::placeholder {
  color: var(--text-5);
}

.app__search-results {
  position: absolute;
  top: calc(100% + 0.8rem);
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  max-height: 32rem;
  overflow-y: auto;
  padding: 0.6rem;
  background-color: rgba(0, 11, 51, 0.97);
  border: 0.1rem solid var(--line-2);
  border-radius: var(--r-md);
  box-shadow: 0 1.6rem 5rem rgba(0, 4, 20, 0.65);
}
.app__search-results.is-open {
  display: flex;
}

.app__search-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  font-size: 1.4rem;
  color: var(--text-2);
  text-align: left;
  border-radius: var(--r-sm);
  transition: background-color 0.15s var(--ease);
}
.app__search-item:hover {
  background-color: var(--brand-500);
}
.app__search-item ion-icon {
  flex-shrink: 0;
  font-size: 1.6rem;
  color: var(--text-5);
}
.app__search-item small {
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--text-5);
  white-space: nowrap;
}

.app__search-empty {
  padding: 1.2rem;
  font-size: 1.35rem;
  color: var(--text-5);
  text-align: center;
}

/* Lado derecho del topbar */

.app__topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.app__iconbtn {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  font-size: 1.9rem;
  color: var(--text-3);
  background-color: rgba(5, 7, 17, 0.7);
  border: 0.1rem solid var(--line-2);
  border-radius: 50%;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.app__iconbtn:hover {
  color: #fff;
  border-color: var(--text-4);
}

.app__user {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 1.4rem 0.6rem 0.7rem;
  font-size: 1.3rem;
  color: var(--text-2);
  background-color: rgba(5, 7, 17, 0.7);
  border: 0.1rem solid var(--line-2);
  border-radius: var(--r-pill);
  max-width: 20rem;
}
.app__user-avatar {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  background-color: var(--alert);
  border-radius: 50%;
  flex-shrink: 0;
}
.app__user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 48em) {
  .app__user {
    display: none;
  }
}

/* ─────────────────────────────  CUERPO  ──────────────────────────────── */

/* En móvil el mapa ocupa una franja fija arriba y el panel se desplaza
   debajo; en pantallas anchas el panel pasa a columna lateral. */
.app__main {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 46vh minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}

@media (min-width: 64em) {
  .app__main {
    grid-template-columns: minmax(34rem, 40rem) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
}

@media (max-width: 63.99em) {
  .map-playbar {
    bottom: 1.4rem;
  }
}

/* Panel del pronóstico */

.app__panel {
  order: 2;
  overflow-y: auto;
  padding: 1.6rem var(--gutter) 3.2rem;
  background-color: var(--surface);
  border-top: 0.1rem solid var(--line);
}

@media (min-width: 64em) {
  .app__panel {
    order: 0;
    border-top: 0;
    border-right: 0.1rem solid var(--line);
    padding: 2rem 2.4rem 4rem;
  }
}

.panel-block {
  padding: 1.8rem;
  margin-bottom: 1.6rem;
  background-color: rgba(9, 15, 34, 0.9);
  border: 0.1rem solid var(--line-2);
  border-radius: var(--r-md);
}

.panel-block__title {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.4rem;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.14rem;
  text-transform: uppercase;
  color: var(--text-5);
}
.panel-block__title ion-icon {
  font-size: 1.5rem;
  color: var(--alert);
}

/* Condiciones actuales */

.now__place {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1.4rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.2rem;
}
.now__place ion-icon {
  color: var(--alert);
  flex-shrink: 0;
}

.now__updated {
  font-size: 1.2rem;
  color: var(--text-5);
  margin-bottom: 1.6rem;
}

.now__main {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  margin-bottom: 0.6rem;
}

.now__icon {
  display: grid;
  place-items: center;
  width: 6.4rem;
  height: 6.4rem;
  font-size: 3.4rem;
  color: var(--alert);
  background-color: var(--ink);
  border: 0.1rem solid var(--line-2);
  border-radius: var(--r-md);
  flex-shrink: 0;
}

.now__temp {
  font-family: "Gugi", sans-serif;
  font-size: 5.2rem;
  line-height: 1;
  color: #fff;
}

.now__desc {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 1.8rem;
}

.now__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.now__stat {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background-color: rgba(5, 7, 17, 0.6);
  border: 0.1rem solid var(--line);
  border-radius: var(--r-sm);
}
.now__stat ion-icon {
  font-size: 1.8rem;
  color: var(--text-5);
  flex-shrink: 0;
}
.now__stat div {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}
.now__stat strong {
  font-size: 1.4rem;
  color: #fff;
  white-space: nowrap;
}
.now__stat span {
  font-size: 1.1rem;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  color: var(--text-5);
  white-space: nowrap;
}

/* Riesgos y advertencias severas */

.risks__loading {
  font-size: 1.3rem;
  color: var(--text-5);
}

.risk {
  padding: 1rem 0;
  border-bottom: 0.1rem solid var(--line);
}
.risk:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.risk__head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.risk__head ion-icon {
  font-size: 1.7rem;
  color: var(--text-4);
  flex-shrink: 0;
}
.risk__name {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-2);
}
.risk__level {
  margin-left: auto;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
}
.risk__level--nd {
  color: var(--text-5);
}

.risk__bar {
  height: 0.5rem;
  margin: 0.8rem 0 0.6rem;
  border-radius: var(--r-pill);
  background-color: rgba(5, 7, 17, 0.8);
  border: 0.1rem solid var(--line);
  overflow: hidden;
}
.risk__bar span {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  transition: width 0.5s var(--ease);
}

.risk__why {
  font-size: 1.2rem;
  color: var(--text-4);
}

.risk-clear {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1.2rem;
  margin-bottom: 1.2rem;
  font-size: 1.25rem;
  color: #8ee6a8;
  background-color: rgba(55, 214, 122, 0.08);
  border: 0.1rem solid rgba(55, 214, 122, 0.25);
  border-radius: var(--r-sm);
}
.risk-clear ion-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.alertbox {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1rem;
  border-radius: var(--r-sm);
  line-height: 1.5;
}
.alertbox ion-icon {
  flex-shrink: 0;
  font-size: 2rem;
  margin-top: 0.2rem;
}
.alertbox strong {
  display: block;
  font-size: 1.3rem;
  letter-spacing: 0.04rem;
  margin-bottom: 0.3rem;
}
.alertbox span {
  font-size: 1.25rem;
}

.alertbox--high {
  color: #ffd9a1;
  background-color: rgba(255, 176, 32, 0.1);
  border: 0.1rem solid rgba(255, 176, 32, 0.45);
}
.alertbox--high ion-icon,
.alertbox--high strong {
  color: var(--alert);
}

.alertbox--extreme {
  color: #ffc9cb;
  background-color: rgba(229, 72, 77, 0.12);
  border: 0.1rem solid rgba(229, 72, 77, 0.55);
  animation: alertPulse 2.2s var(--ease) infinite;
}
.alertbox--extreme ion-icon,
.alertbox--extreme strong {
  color: #ff8a8e;
}

@keyframes alertPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(229, 72, 77, 0);
  }
  50% {
    box-shadow: 0 0 1.8rem 0 rgba(229, 72, 77, 0.25);
  }
}

@media (prefers-reduced-motion: reduce) {
  .alertbox--extreme {
    animation: none;
  }
}

/* Pronóstico por horas */

.hours {
  display: flex;
  gap: 0.8rem;
  overflow-x: auto;
  padding-bottom: 0.6rem;
  scrollbar-width: thin;
}

.hour {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 6.4rem;
  padding: 1rem 0.6rem;
  background-color: rgba(5, 7, 17, 0.6);
  border: 0.1rem solid var(--line);
  border-radius: var(--r-sm);
  flex-shrink: 0;
}
.hour--now {
  border-color: rgba(255, 176, 32, 0.5);
}
.hour__time {
  font-size: 1.15rem;
  color: var(--text-5);
}
.hour ion-icon {
  font-size: 2rem;
  color: var(--text-2);
}
.hour__temp {
  font-size: 1.4rem;
  font-weight: 600;
  color: #fff;
}
.hour__rain {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 1.1rem;
  color: #8ec7ff;
}
.hour__rain ion-icon {
  font-size: 1.1rem;
  color: #8ec7ff;
}

/* Pronóstico diario */

.days {
  display: flex;
  flex-direction: column;
}

.day {
  display: grid;
  grid-template-columns: 8.6rem 2.4rem 1fr auto;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 0.4rem;
  border-bottom: 0.1rem solid var(--line);
}
.day:last-child {
  border-bottom: 0;
}

.day__name {
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text-2);
  text-transform: capitalize;
  white-space: nowrap;
}
.day ion-icon {
  font-size: 2rem;
  color: var(--text-2);
}

.day__rain {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.2rem;
  color: #8ec7ff;
}
.day__rain ion-icon {
  font-size: 1.2rem;
  color: #8ec7ff;
}

.day__temps {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  white-space: nowrap;
}
.day__max {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
}
.day__min {
  font-size: 1.3rem;
  color: var(--text-5);
}

/* Nota de fuente de datos */

.panel-note {
  font-size: 1.15rem;
  color: var(--text-5);
  text-align: center;
}
.panel-note a {
  color: var(--text-4);
}

/* ─────── Procedencia del dato (modelo · pasada · edad) + insignias ────── */

.prov {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 0.2rem 0 0.6rem;
  font-size: 1.1rem;
  color: var(--text-5);
}
.prov-badge,
.conf-badge {
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.prov-badge {
  color: #ffb020;
  background: rgba(255, 176, 32, 0.14);
  border: 0.1rem solid rgba(255, 176, 32, 0.4);
}
.conf-badge {
  color: #7aa2ff;
  background: rgba(122, 162, 255, 0.12);
  border: 0.1rem solid rgba(122, 162, 255, 0.35);
}
.conf-badge[data-level="alta"] {
  color: #37d67a;
  background: rgba(55, 214, 122, 0.12);
  border-color: rgba(55, 214, 122, 0.4);
}
.conf-badge[data-level="baja"] {
  color: #ff7a45;
  background: rgba(255, 122, 69, 0.12);
  border-color: rgba(255, 122, 69, 0.4);
}

/* ───────── Probabilidades del EPS: abanico, chips y conteos ──────────── */

.eps-head {
  font-size: 1.2rem;
  color: var(--text-4);
  margin: 0 0 0.8rem;
}
.eps-fanvars {
  margin: 0 0 0.8rem;
}
.eps-fanvars .seg__btn {
  flex: 1;
  justify-content: center;
}
.eps-fan {
  display: block;
  width: 100%;
  height: 18rem;
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(20, 29, 58, 0.5), rgba(9, 14, 32, 0.8));
  border: 0.1rem solid var(--line-2);
}
.eps-legendrow {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin: 0.6rem 0 1rem;
  font-size: 1.05rem;
  color: var(--text-5);
}
.eps-legendrow span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.eps-sw {
  width: 1.4rem;
  height: 0.9rem;
  border-radius: 0.25rem;
  display: inline-block;
}
.eps-sw--b1 { background: rgba(122, 162, 255, 0.2); }
.eps-sw--b2 { background: rgba(122, 162, 255, 0.38); }
.eps-sw--med { background: rgba(255, 224, 138, 0.95); height: 0.25rem; }
.eps-sw--spag { background: rgba(150, 180, 255, 0.35); height: 0.15rem; }

.eps-row {
  margin: 0 0 1rem;
}
.eps-row__label {
  display: block;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-4);
  margin-bottom: 0.45rem;
}
.eps-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.eps-chip {
  min-width: 6.4rem;
  padding: 0.5rem 0.7rem;
  border-radius: 0.9rem;
  background: linear-gradient(180deg, rgba(20, 29, 58, 0.6), rgba(9, 14, 32, 0.9));
  border: 0.1rem solid var(--line-2);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.eps-chip strong {
  font-size: 1.35rem;
  color: var(--text-2);
}
.eps-chip span {
  font-size: 1rem;
  color: var(--text-5);
  white-space: nowrap;
}
.eps-chip small {
  font-size: 0.95rem;
  color: var(--text-6, var(--text-5));
  opacity: 0.8;
}
.eps-note {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text-5);
  margin: 0.4rem 0 0;
}

/* ciclones tropicales (ENS) */
.tc-sys {
  padding: 0.7rem 0.8rem;
  margin: 0.5rem 0;
  border-radius: 0.9rem;
  background: linear-gradient(180deg, rgba(20, 29, 58, 0.6), rgba(9, 14, 32, 0.9));
  border: 0.1rem solid var(--line-2);
  cursor: pointer;
}
.tc-sys:hover {
  border-color: var(--text-5);
}
.tc-sys__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.3rem 0.8rem;
  font-size: 1.1rem;
  color: var(--text-2);
}
.tc-sys__top span {
  color: var(--text-5);
  font-size: 1rem;
}
.tc-sys__mid {
  margin-top: 0.25rem;
  font-size: 1.05rem;
  color: var(--text-4, var(--text-5));
}
.tc-sys__mid em {
  color: var(--text-5);
  font-style: normal;
  opacity: 0.85;
}
.tc-esc {
  display: block;
  margin-top: 0.2rem;
  font-size: 1rem;
  color: var(--text-5);
}
.tc-sys a {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 1.02rem;
  color: #7fb8ff;
  text-decoration: none;
}
.tc-sys a:hover {
  text-decoration: underline;
}
/* ciudades top del panel de país (botones con forma de chip) */
.country-city {
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s var(--ease);
}
.country-city:hover {
  border-color: var(--text-5);
}

.tc-warn {
  margin: 0.6rem 0 0;
  padding: 0.55rem 0.8rem;
  border-radius: 0.8rem;
  border: 0.1rem solid rgba(255, 176, 32, 0.45);
  background: rgba(255, 176, 32, 0.08);
  color: var(--text-4, var(--text-2));
  font-size: 1.02rem;
  line-height: 1.45;
}

/* ──────────────────────────────  MAPA  ───────────────────────────────── */

.app__maparea {
  position: relative;
  min-height: 0;
  background-color: var(--surface-2);
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-color: var(--surface-2);
}

/* Controles superpuestos */

.map-controls {
  position: absolute;
  top: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  max-width: calc(100% - 2.8rem);
}

.map-layers {
  display: flex;
  gap: 0.3rem;
  padding: 0.4rem;
  background-color: rgba(0, 11, 51, 0.88);
  border: 0.1rem solid var(--line-2);
  border-radius: var(--r-pill);
  backdrop-filter: blur(1.2rem);
  -webkit-backdrop-filter: blur(1.2rem);
}

.map-layers .seg__btn {
  padding: 0.7rem 1.3rem;
  font-size: 1.3rem;
}

/* En pantallas estrechas caben las 4 capas sin iconos */
@media (max-width: 36em) {
  .map-layers .seg__btn ion-icon {
    display: none;
  }
  .map-layers .seg__btn {
    padding: 0.7rem 1.1rem;
  }
}

/* botón globo/plano (proyección) */
.map-globe {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  flex-shrink: 0;
  font-size: 1.9rem;
  color: var(--text-5);
  background-color: rgba(0, 11, 51, 0.88);
  border: 0.1rem solid var(--line-2);
  border-radius: 50%;
  backdrop-filter: blur(1.2rem);
  -webkit-backdrop-filter: blur(1.2rem);
  transition: color 0.15s var(--ease), transform 0.15s var(--ease);
}
.map-globe:hover {
  transform: scale(1.06);
}
.map-globe.is-active {
  color: #7fb8ff;
  border-color: #7fb8ff;
}

/* slider de fotogramas observados (capa Nubes) */
.obs-slider {
  width: 16rem;
  max-width: 34vw;
  accent-color: var(--alert);
}

.map-playbar {
  position: absolute;
  bottom: 2.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: none;
  align-items: center;
  gap: 1.2rem;
  padding: 0.8rem 1.6rem 0.8rem 0.8rem;
  background-color: rgba(0, 11, 51, 0.88);
  border: 0.1rem solid var(--line-2);
  border-radius: var(--r-pill);
  backdrop-filter: blur(1.2rem);
  -webkit-backdrop-filter: blur(1.2rem);
  max-width: calc(100% - 2.8rem);
}
.map-playbar.is-visible {
  display: flex;
}

.map-play {
  display: grid;
  place-items: center;
  width: 3.6rem;
  height: 3.6rem;
  font-size: 1.8rem;
  color: var(--ink);
  background-color: var(--alert);
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.15s var(--ease);
}
.map-play:hover {
  transform: scale(1.06);
}

.map-frame-label {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  white-space: nowrap;
}
.map-frame-label strong {
  font-size: 1.35rem;
  color: #fff;
}
.map-frame-label span {
  font-size: 1.1rem;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  color: var(--text-5);
}

/* ────────────────  MODELO EUROPEO (ECMWF · IFS)  ─────────────────────── */

.euro-panel {
  position: absolute;
  top: 6.8rem;
  right: 1.4rem;
  z-index: 600;
  width: min(30rem, calc(100% - 2.8rem));
  background-color: rgba(0, 11, 51, 0.92);
  border: 0.1rem solid var(--line-2);
  border-radius: var(--r-md);
  backdrop-filter: blur(1.4rem);
  -webkit-backdrop-filter: blur(1.4rem);
  box-shadow: 0 1.4rem 4.4rem rgba(0, 4, 20, 0.55);
}

.euro-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1.2rem 1.4rem;
  text-align: left;
}
.euro-panel__head > span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.euro-panel__head strong {
  font-size: 1.3rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.euro-panel__sub {
  font-size: 1.05rem;
  letter-spacing: 0.06rem;
  text-transform: uppercase;
  color: var(--text-5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.euro-panel__head ion-icon {
  flex-shrink: 0;
  font-size: 1.6rem;
  color: var(--text-4);
  transition: transform 0.25s var(--ease);
}
.euro-panel.is-min .euro-panel__head ion-icon {
  transform: rotate(180deg);
}

.euro-panel__body {
  padding: 0 1.4rem 1.4rem;
}
.euro-panel.is-min .euro-panel__body {
  display: none;
}

.seg--tight {
  width: 100%;
  margin-bottom: 0.8rem;
}
.seg--tight .seg__btn {
  flex: 1;
  padding: 0.55rem 0.6rem;
  font-size: 1.25rem;
}

.euro-title {
  margin: 0.6rem 0 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-2);
}

/* conmutador de isobaras (MSLP del HRES) */
.euro-iso {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.6rem 0 0.2rem;
  font-size: 1.15rem;
  color: var(--text-5);
  cursor: pointer;
}
.euro-iso input {
  accent-color: var(--alert);
}

.euro-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}
.euro-time__btn {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  font-size: 1.5rem;
  color: var(--text-3);
  border: 0.1rem solid var(--line-2);
  border-radius: 50%;
  flex-shrink: 0;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.euro-time__btn:hover {
  color: #fff;
  border-color: var(--text-4);
}
.euro-time__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.3;
  min-width: 0;
  text-align: center;
}
.euro-time__label strong {
  font-size: 1.35rem;
  color: #fff;
  white-space: nowrap;
}
.euro-time__label span {
  font-size: 1.05rem;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  color: var(--text-5);
}

.euro-slider {
  width: 100%;
  margin: 0 0 1.2rem;
  accent-color: var(--alert);
  cursor: pointer;
}

.euro-legend__bar {
  height: 1rem;
  border-radius: var(--r-pill);
  border: 0.1rem solid var(--line-2);
}
.euro-legend__ticks {
  position: relative;
  height: 1.6rem;
  margin-top: 0.3rem;
}
.euro-legend__ticks span {
  position: absolute;
  transform: translateX(-50%);
  font-size: 1.05rem;
  color: var(--text-4);
  white-space: nowrap;
}

.euro-note {
  margin-top: 0.8rem;
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--text-5);
}

/* Interruptor "viento en movimiento" */

.euro-switch {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.2rem;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  user-select: none;
}
.euro-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.euro-switch__track {
  position: relative;
  flex-shrink: 0;
  width: 3.4rem;
  height: 1.9rem;
  border-radius: var(--r-pill);
  background-color: rgba(5, 7, 17, 0.8);
  border: 0.1rem solid var(--line-2);
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.euro-switch__track::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.2rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background-color: var(--text-4);
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease);
}
.euro-switch input:checked + .euro-switch__track {
  background-color: rgba(255, 176, 32, 0.25);
  border-color: rgba(255, 176, 32, 0.55);
}
.euro-switch input:checked + .euro-switch__track::after {
  transform: translateX(1.5rem);
  background-color: var(--alert);
}
.euro-switch input:focus-visible + .euro-switch__track {
  outline: 0.2rem solid var(--alert);
  outline-offset: 0.2rem;
}

/* Lienzo de partículas de viento: por encima del mapa, sin capturar toques */

.wind-canvas {
  position: absolute;
  inset: 0;
  z-index: 450;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

/* Chip de carga del modelo */

.map-loading {
  position: absolute;
  bottom: 2.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 550;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1.6rem;
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-2);
  background-color: rgba(0, 11, 51, 0.92);
  border: 0.1rem solid var(--line-2);
  border-radius: var(--r-pill);
  backdrop-filter: blur(1.2rem);
  -webkit-backdrop-filter: blur(1.2rem);
}
.map-loading__dot {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 0.2rem solid rgba(255, 176, 32, 0.35);
  border-top-color: var(--alert);
  animation: euroSpin 0.8s linear infinite;
}
@keyframes euroSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 63.99em) {
  .euro-panel {
    top: 6.4rem;
    left: 1.4rem;
    right: 1.4rem;
    width: auto;
  }
  /* el panel expandido no debe salirse de la franja del mapa (46vh) */
  .euro-panel__body {
    max-height: calc(46vh - 14rem);
    overflow-y: auto;
  }
  /* los botones de zoom bajan para que el panel del modelo no los tape */
  .maplibregl-ctrl-top-left {
    top: auto;
    bottom: 3.2rem;
  }
  .map-loading {
    bottom: 1.2rem;
  }
}

/* Marca de agua / crédito */

.map-credit {
  position: absolute;
  right: 0.8rem;
  bottom: 0.6rem;
  z-index: 500;
  font-size: 1rem;
  color: var(--text-5);
  background-color: rgba(0, 6, 15, 0.55);
  padding: 0.2rem 0.7rem;
  border-radius: var(--r-sm);
  pointer-events: none;
}

/* Mapa no disponible (sin conexión a los CDN) */

.map-fallback {
  position: absolute;
  inset: 0;
  z-index: 400;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 2.4rem;
  text-align: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(23, 37, 84, 0.5), transparent 60%),
    var(--surface-2);
}
.map-fallback.is-visible {
  display: flex;
}
.map-fallback ion-icon {
  font-size: 4.2rem;
  color: var(--text-5);
}
.map-fallback strong {
  font-size: 1.7rem;
  color: #fff;
}
.map-fallback p {
  max-width: 38rem;
  font-size: 1.4rem;
  color: var(--text-4);
}

/* Ajustes de MapLibre GL al tema */

.maplibregl-map {
  font-family: "Inter", system-ui, sans-serif;
}
.maplibregl-canvas {
  outline: none;
}
.maplibregl-ctrl-group {
  background-color: rgba(0, 11, 51, 0.92) !important;
  border: 0.1rem solid var(--line-2);
  border-radius: var(--r-sm) !important;
  box-shadow: none !important;
}
.maplibregl-ctrl-group button {
  background-color: transparent !important;
}
.maplibregl-ctrl-group button + button {
  border-top: 0.1rem solid var(--line) !important;
}
.maplibregl-ctrl-group button .maplibregl-ctrl-icon {
  filter: invert(0.85);
}
.maplibregl-ctrl-scale {
  color: var(--text-3) !important;
  background-color: rgba(0, 6, 15, 0.55) !important;
  border-color: var(--line-2) !important;
  font-size: 1rem !important;
}
.maplibregl-popup-content {
  color: var(--text-2);
  background-color: rgba(0, 11, 51, 0.97) !important;
  border: 0.1rem solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: 1.3rem;
  line-height: 1.5;
  padding: 1rem 1.4rem;
  box-shadow: 0 1rem 3rem rgba(0, 4, 20, 0.5);
}
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
  border-top-color: rgba(0, 11, 51, 0.97) !important;
}
.maplibregl-popup-anchor-top .maplibregl-popup-tip {
  border-bottom-color: rgba(0, 11, 51, 0.97) !important;
}

/* ────────────────  MODELO EUROPEO (ECMWF · IFS)  ─────────────────────── */

.euro-panel {
  position: absolute;
  top: 6.8rem;
  right: 1.4rem;
  z-index: 600;
  width: min(30rem, calc(100% - 2.8rem));
  background-color: rgba(0, 11, 51, 0.92);
  border: 0.1rem solid var(--line-2);
  border-radius: var(--r-md);
  backdrop-filter: blur(1.4rem);
  -webkit-backdrop-filter: blur(1.4rem);
  box-shadow: 0 1.4rem 4.4rem rgba(0, 4, 20, 0.55);
}

.euro-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1.2rem 1.4rem;
  text-align: left;
}
.euro-panel__head > span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.euro-panel__head strong {
  font-size: 1.3rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.euro-panel__sub {
  font-size: 1.05rem;
  letter-spacing: 0.06rem;
  text-transform: uppercase;
  color: var(--text-5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.euro-panel__head ion-icon {
  flex-shrink: 0;
  font-size: 1.6rem;
  color: var(--text-4);
  transition: transform 0.25s var(--ease);
}
.euro-panel.is-min .euro-panel__head ion-icon {
  transform: rotate(180deg);
}

.euro-panel__body {
  padding: 0 1.4rem 1.4rem;
}
.euro-panel.is-min .euro-panel__body {
  display: none;
}

.seg--tight {
  width: 100%;
  margin-bottom: 0.8rem;
}
.seg--tight .seg__btn {
  flex: 1;
  padding: 0.55rem 0.6rem;
  font-size: 1.25rem;
}

.euro-title {
  margin: 0.6rem 0 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-2);
}

.euro-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}
.euro-time__btn {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  font-size: 1.5rem;
  color: var(--text-3);
  border: 0.1rem solid var(--line-2);
  border-radius: 50%;
  flex-shrink: 0;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.euro-time__btn:hover {
  color: #fff;
  border-color: var(--text-4);
}
.euro-time__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.3;
  min-width: 0;
  text-align: center;
}
.euro-time__label strong {
  font-size: 1.35rem;
  color: #fff;
  white-space: nowrap;
}
.euro-time__label span {
  font-size: 1.05rem;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  color: var(--text-5);
}

.euro-slider {
  width: 100%;
  margin: 0 0 1.2rem;
  accent-color: var(--alert);
  cursor: pointer;
}

.euro-legend__bar {
  height: 1rem;
  border-radius: var(--r-pill);
  border: 0.1rem solid var(--line-2);
}
.euro-legend__ticks {
  position: relative;
  height: 1.6rem;
  margin-top: 0.3rem;
}
.euro-legend__ticks span {
  position: absolute;
  transform: translateX(-50%);
  font-size: 1.05rem;
  color: var(--text-4);
  white-space: nowrap;
}

.euro-note {
  margin-top: 0.8rem;
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--text-5);
}

/* Interruptor "viento en movimiento" */

.euro-switch {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.2rem;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  user-select: none;
}
.euro-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.euro-switch__track {
  position: relative;
  flex-shrink: 0;
  width: 3.4rem;
  height: 1.9rem;
  border-radius: var(--r-pill);
  background-color: rgba(5, 7, 17, 0.8);
  border: 0.1rem solid var(--line-2);
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.euro-switch__track::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.2rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background-color: var(--text-4);
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease);
}
.euro-switch input:checked + .euro-switch__track {
  background-color: rgba(255, 176, 32, 0.25);
  border-color: rgba(255, 176, 32, 0.55);
}
.euro-switch input:checked + .euro-switch__track::after {
  transform: translateX(1.5rem);
  background-color: var(--alert);
}
.euro-switch input:focus-visible + .euro-switch__track {
  outline: 0.2rem solid var(--alert);
  outline-offset: 0.2rem;
}

/* Lienzo de partículas de viento: por encima del mapa, sin capturar toques */

.wind-canvas {
  position: absolute;
  inset: 0;
  z-index: 450;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

/* Chip de carga del modelo */

.map-loading {
  position: absolute;
  bottom: 2.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 550;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1.6rem;
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-2);
  background-color: rgba(0, 11, 51, 0.92);
  border: 0.1rem solid var(--line-2);
  border-radius: var(--r-pill);
  backdrop-filter: blur(1.2rem);
  -webkit-backdrop-filter: blur(1.2rem);
}
.map-loading__dot {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 0.2rem solid rgba(255, 176, 32, 0.35);
  border-top-color: var(--alert);
  animation: euroSpin 0.8s linear infinite;
}
@keyframes euroSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 63.99em) {
  .euro-panel {
    top: 6.4rem;
    left: 1.4rem;
    right: 1.4rem;
    width: auto;
  }
  /* el panel expandido no debe salirse de la franja del mapa (46vh) */
  .euro-panel__body {
    max-height: calc(46vh - 14rem);
    overflow-y: auto;
  }
  /* los botones de zoom bajan para que el panel del modelo no los tape */
  .maplibregl-ctrl-top-left {
    top: auto;
    bottom: 3.2rem;
  }
  .map-loading {
    bottom: 1.2rem;
  }
}

/* Marca de agua / crédito */

.map-credit {
  position: absolute;
  right: 0.8rem;
  bottom: 0.6rem;
  z-index: 500;
  font-size: 1rem;
  color: var(--text-5);
  background-color: rgba(0, 6, 15, 0.55);
  padding: 0.2rem 0.7rem;
  border-radius: var(--r-sm);
  pointer-events: none;
}

/* Mapa no disponible (sin conexión a los CDN) */

.map-fallback {
  position: absolute;
  inset: 0;
  z-index: 400;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 2.4rem;
  text-align: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(23, 37, 84, 0.5), transparent 60%),
    var(--surface-2);
}
.map-fallback.is-visible {
  display: flex;
}
.map-fallback ion-icon {
  font-size: 4.2rem;
  color: var(--text-5);
}
.map-fallback strong {
  font-size: 1.7rem;
  color: #fff;
}
.map-fallback p {
  max-width: 38rem;
  font-size: 1.4rem;
  color: var(--text-4);
}

/* ─────────────────────────  MODAL DE AJUSTES  ────────────────────────── */

.amodal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  background-color: rgba(0, 4, 16, 0.72);
  backdrop-filter: blur(0.6rem);
  -webkit-backdrop-filter: blur(0.6rem);
}
.amodal.is-open {
  display: flex;
}

.amodal__card {
  width: min(100%, 46rem);
  max-height: min(88svh, 72rem);
  overflow-y: auto;
  padding: 2.4rem;
  background-color: var(--surface);
  border: 0.1rem solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: 0 2.4rem 8rem rgba(0, 4, 20, 0.65);
  animation: amodalIn 0.25s var(--ease);
}

@keyframes amodalIn {
  from {
    opacity: 0;
    transform: translateY(1.6rem);
  }
}

.amodal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.6rem;
  margin-bottom: 2rem;
}
.amodal__head h2 {
  font-family: "Gugi", sans-serif;
  font-size: 2rem;
  font-weight: 400;
  color: #fff;
}
.amodal__head p {
  font-size: 1.3rem;
  color: var(--text-4);
  margin-top: 0.4rem;
}

.amodal__close {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  font-size: 1.8rem;
  color: var(--text-4);
  border: 0.1rem solid var(--line-2);
  border-radius: 50%;
  flex-shrink: 0;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.amodal__close:hover {
  color: #fff;
  border-color: var(--text-4);
}

.amodal .seg {
  width: 100%;
}
.amodal .seg__btn {
  flex: 1;
}

.amodal__save {
  width: 100%;
  justify-content: center;
  margin-top: 0.8rem;
}

.amodal__guest-note {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin-top: 1.4rem;
  font-size: 1.25rem;
  color: var(--text-5);
}
.amodal__guest-note ion-icon {
  flex-shrink: 0;
  font-size: 1.5rem;
  margin-top: 0.2rem;
}

/* ─────────────────────────────  TOASTS  ──────────────────────────────── */

.toasts {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  width: min(100% - 3.2rem, 44rem);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 2rem;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text);
  border: 0.1rem solid var(--line-2);
  border-radius: var(--r-pill);
  background-color: rgba(0, 11, 51, 0.95);
  box-shadow: 0 1.2rem 4rem rgba(0, 4, 20, 0.6);
  animation: toastIn 0.3s var(--ease);
}
.toast ion-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}
.toast--ok ion-icon {
  color: #8ee6a8;
}
.toast--error {
  border-color: rgba(229, 72, 77, 0.6);
}
.toast--error ion-icon {
  color: #ff8a8e;
}
.toast.is-leaving {
  animation: toastOut 0.3s var(--ease) forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(1.2rem);
  }
}
@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(1.2rem);
  }
}

/* ─────────────────────────  PANTALLA DE CARGA  ───────────────────────── */

.app-boot {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.8rem;
  background-color: var(--bg);
  transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
}
.app-boot.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.app-boot img {
  width: 7.2rem;
  border-radius: 50%;
  animation: bootPulse 1.6s var(--ease) infinite;
}
.app-boot span {
  font-size: 1.35rem;
  letter-spacing: 0.2rem;
  text-transform: uppercase;
  color: var(--text-5);
}

@keyframes bootPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.07);
    opacity: 0.75;
  }
}

/* Esqueleto de carga en el panel */

.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(
    100deg,
    rgba(69, 81, 118, 0.14) 40%,
    rgba(139, 146, 170, 0.22) 50%,
    rgba(69, 81, 118, 0.14) 60%
  );
  background-size: 200% 100%;
  animation: skeletonWave 1.4s linear infinite;
}

@keyframes skeletonWave {
  to {
    background-position: -200% 0;
  }
}

/* ═════════════ MÓVIL COMO APP NATIVA ═════════════
   Mapa a pantalla completa detrás de todo; el panel del pronóstico es una
   hoja inferior deslizante (asa + resumen siempre visibles, se arrastra o
   se toca para expandir). En escritorio nada de esto aplica. */

.sheet-head {
  display: none;
}

@media (max-width: 63.99em) {
  .app {
    height: 100dvh;
  }

  .app__main {
    position: relative;
    display: block;
    flex: 1;
    min-height: 0;
  }

  .app__maparea {
    position: absolute;
    inset: 0;
  }

  .app__panel {
    --sheet-peek: 10.8rem;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 640;
    height: min(80dvh, 68rem);
    padding: 0 var(--gutter) calc(3.2rem + env(safe-area-inset-bottom));
    overflow: hidden;
    background-color: rgba(4, 9, 24, 0.96);
    backdrop-filter: blur(1.6rem);
    -webkit-backdrop-filter: blur(1.6rem);
    border-top: 0.1rem solid var(--line-2);
    border-radius: 2rem 2rem 0 0;
    box-shadow: 0 -1.2rem 3.6rem rgba(0, 0, 0, 0.55);
    transform: translateY(calc(100% - var(--sheet-peek) - env(safe-area-inset-bottom)));
    transition: transform 0.38s cubic-bezier(0.22, 0.9, 0.28, 1);
    will-change: transform;
  }
  .app__panel.is-open {
    transform: translateY(0);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .app__panel.is-dragging {
    transition: none;
  }

  .sheet-head {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: calc(100% + 2 * var(--gutter));
    margin: 0 calc(-1 * var(--gutter)) 1.4rem;
    padding: 0.9rem var(--gutter) 1.1rem;
    background: linear-gradient(rgba(4, 9, 24, 0.99), rgba(4, 9, 24, 0.92));
    border: 0;
    color: inherit;
    text-align: left;
    cursor: grab;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
  }
  .sheet-head:active {
    cursor: grabbing;
  }
  .sheet-head__bar {
    width: 4.4rem;
    height: 0.45rem;
    margin: 0 auto 1.1rem;
    border-radius: 99rem;
    background-color: var(--line-2);
  }
  .sheet-head__row {
    display: flex;
    align-items: center;
    gap: 1.3rem;
  }
  .sheet-head__temp {
    font-size: 3.2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.05rem;
  }
  .sheet-head__meta {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    line-height: 1.3;
  }
  .sheet-head__meta strong {
    font-size: 1.45rem;
    color: #e7edf9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sheet-head__meta small {
    font-size: 1.15rem;
    color: var(--text-5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sheet-head__chev {
    flex-shrink: 0;
    font-size: 2rem;
    color: var(--text-5);
    transition: transform 0.3s;
  }
  .app__panel.is-open .sheet-head__chev {
    transform: rotate(180deg);
  }

  /* los flotantes del mapa suben por encima del asomo de la hoja */
  .map-playbar {
    bottom: calc(10.8rem + 1.4rem + env(safe-area-inset-bottom));
  }
  .maplibregl-ctrl-top-left {
    top: auto;
    bottom: calc(10.8rem + 1.4rem + env(safe-area-inset-bottom));
  }
  .map-credit {
    bottom: calc(10.8rem + 0.4rem + env(safe-area-inset-bottom));
  }
  .map-loading {
    bottom: calc(10.8rem + 1.4rem + env(safe-area-inset-bottom));
  }

  /* con el mapa a pantalla completa, el panel de modelos respira más */
  .euro-panel__body {
    max-height: calc(100dvh - 32rem);
    overflow-y: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app__panel,
  .sheet-head__chev {
    transition: none;
  }
}

/* ═════════════ CONFIGURACIÓN CON PESTAÑAS ═════════════ */

.amodal__tabs {
  display: flex;
  margin-bottom: 1.8rem;
}
.amodal__tabs .seg__btn {
  flex: 1;
  justify-content: center;
}
.amodal__tab {
  animation: tabIn 0.25s ease;
}
@keyframes tabIn {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.seg--wrap {
  flex-wrap: wrap;
}
.seg--wrap .seg__btn {
  flex: 1 1 40%;
  justify-content: center;
}
.amodal__hint {
  margin: 0.4rem 0 1.4rem;
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--text-5);
}
.amodal__switch {
  margin: 0.4rem 0 1.2rem;
}

/* ═════ Móvil: mapa limpio — capas y modelos viven en Configuración ═════ */

@media (max-width: 63.99em) {
  /* sin botones +/- (queda el gesto de pellizcar) */
  .maplibregl-ctrl-top-left {
    display: none;
  }

  /* sin barra flotante de capas */
  .map-controls {
    display: none;
  }

  /* el panel de modelos se reduce a una línea de tiempo compacta sobre la
     hoja: sin cabecera, sin selectores, sin interruptor (todo eso está en
     Configuración → Modelos) */
  .euro-panel {
    top: auto;
    bottom: calc(10.8rem + 6.4rem + env(safe-area-inset-bottom));
    left: 1.2rem;
    right: 1.2rem;
    width: auto;
    padding: 1rem 1.2rem 0.9rem;
  }
  .euro-panel__head,
  .euro-panel #euro-var,
  .euro-panel #euro-mode,
  .euro-panel .euro-switch,
  .euro-panel #euro-note {
    display: none;
  }
  .euro-panel__body,
  .euro-panel.is-min .euro-panel__body {
    display: block;
    max-height: none;
    overflow: visible;
    padding: 0;
  }
  .euro-panel .euro-title {
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ═════════ Configuración: tarjetas profesionales de capas y modelos ═════ */

.lgrid,
.mgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0.2rem 0 1.6rem;
}
.lgrid {
  grid-template-columns: 1fr;
}

.lcard,
.mcard,
.vcard {
  position: relative;
  padding: 1.2rem 1.3rem;
  text-align: left;
  color: inherit;
  background: linear-gradient(180deg, rgba(20, 29, 58, 0.65), rgba(9, 14, 32, 0.92));
  border: 0.1rem solid var(--line-2);
  border-radius: 1.2rem;
  cursor: pointer;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background-color 0.2s,
    transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.lcard:active,
.mcard:active,
.vcard:active {
  transform: scale(0.97);
}
.lcard.is-active,
.mcard.is-active,
.vcard.is-active {
  border-color: rgba(122, 162, 255, 0.9);
  box-shadow:
    0 0 0 0.1rem rgba(122, 162, 255, 0.55),
    0 0.6rem 2.2rem rgba(58, 110, 255, 0.22);
  background: linear-gradient(180deg, rgba(43, 62, 118, 0.55), rgba(16, 24, 52, 0.95));
}
.mcard.is-active::after,
.lcard.is-active::after {
  content: "";
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background-color: #7aa2ff;
  box-shadow: 0 0 0.8rem #7aa2ff;
}

.lcard {
  display: flex;
  align-items: center;
  gap: 1.3rem;
}
.lcard__icon {
  display: grid;
  place-items: center;
  width: 4.4rem;
  height: 4.4rem;
  flex-shrink: 0;
  font-size: 2.1rem;
  color: #9db7e8;
  background: rgba(122, 162, 255, 0.1);
  border: 0.1rem solid rgba(122, 162, 255, 0.25);
  border-radius: 1.1rem;
}
.lcard.is-active .lcard__icon {
  color: #fff;
  background: linear-gradient(160deg, #3a6eff, #7aa2ff);
  border-color: transparent;
}
.lcard__text strong,
.mcard strong {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1.5rem;
  color: #fff;
  letter-spacing: 0.02rem;
}
.lcard__text small,
.mcard small {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.12rem;
  line-height: 1.45;
  color: var(--text-5);
}
.mcard.is-active small,
.lcard.is-active .lcard__text small {
  color: #b9c6e4;
}

.mcard__badge {
  padding: 0.15rem 0.7rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08rem;
  color: #fff;
  background: linear-gradient(90deg, #7c5cff, #3aa0ff);
  border-radius: 99rem;
}

.vgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
  margin: 0.2rem 0 1.6rem;
}
@media (max-width: 26em) {
  .vgrid {
    grid-template-columns: 1fr 1fr;
  }
}
.vcard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1.15rem 0.6rem 1rem;
  text-align: center;
}
.vcard ion-icon {
  font-size: 2.1rem;
  color: #8fa5cf;
  transition: color 0.2s;
}
.vcard strong {
  font-size: 1.25rem;
  color: #eef2fb;
}
.vcard small {
  font-size: 1rem;
  color: var(--text-5);
}
.vcard.is-active ion-icon {
  color: #7aa2ff;
  filter: drop-shadow(0 0 0.6rem rgba(122, 162, 255, 0.8));
}

.mswitch {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.3rem 1.4rem;
  margin: 0.2rem 0 1.8rem;
  background: linear-gradient(180deg, rgba(20, 29, 58, 0.65), rgba(9, 14, 32, 0.92));
  border: 0.1rem solid var(--line-2);
  border-radius: 1.2rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mswitch__text {
  flex: 1;
  min-width: 0;
}
.mswitch__text strong {
  display: block;
  font-size: 1.4rem;
  color: #fff;
}
.mswitch__text small {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.1rem;
  color: var(--text-5);
}
.mswitch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.mswitch--minor {
  margin-top: 0.4rem;
  margin-bottom: 0.6rem;
}

/* el interruptor de las tarjetas usa la misma pista que el euro-switch */
.mswitch input:checked + .euro-switch__track {
  background-color: rgba(122, 162, 255, 0.25);
  border-color: rgba(122, 162, 255, 0.6);
}
.mswitch input:checked + .euro-switch__track::after {
  transform: translateX(1.5rem);
  background-color: #7aa2ff;
}
.mswitch input:focus-visible + .euro-switch__track {
  outline: 0.2rem solid #7aa2ff;
  outline-offset: 0.2rem;
}

/* ═════════════ PULIDO MÓVIL COMPLETO (sin tocar el mapa) ═════════════ */

@media (max-width: 63.99em) {
  /* barra superior: respeta el notch y respira como app */
  .app__topbar {
    padding-top: calc(1rem + env(safe-area-inset-top));
    gap: 1rem;
  }
  .app__iconbtn,
  .app__search-box {
    -webkit-tap-highlight-color: transparent;
  }

  /* el modal de configuración sube desde abajo como hoja nativa */
  .amodal {
    align-items: flex-end;
    padding: 0;
  }
  .amodal__card {
    width: 100%;
    max-height: 92dvh;
    padding: 2rem var(--gutter) calc(3rem + env(safe-area-inset-bottom));
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 2rem 2rem 0 0;
    animation: amodalUp 0.34s cubic-bezier(0.22, 0.9, 0.28, 1);
  }

  /* horas con imán al deslizar y sin barra de scroll */
  .hours {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.9rem;
  }
  .hours::-webkit-scrollbar {
    display: none;
  }
  .hour {
    scroll-snap-align: start;
    min-width: 7rem;
    padding: 1.2rem 0.8rem;
    border-radius: 1.1rem;
  }

  /* filas de días más táctiles */
  .day {
    padding: 1.3rem 0.4rem;
  }

  /* respuesta táctil en todos los controles */
  .seg__btn,
  .app__iconbtn,
  .map-play,
  .euro-time__btn,
  .amodal__close,
  .amodal__save {
    transition: transform 0.12s;
  }
  .seg__btn:active,
  .app__iconbtn:active,
  .map-play:active,
  .euro-time__btn:active,
  .amodal__close:active,
  .amodal__save:active {
    transform: scale(0.93);
  }

  /* los avisos flotan por encima de la hoja, no debajo */
  .toasts {
    bottom: calc(11.6rem + env(safe-area-inset-bottom));
  }
}

@keyframes amodalUp {
  from {
    transform: translateY(14%);
    opacity: 0.5;
  }
  to {
    transform: none;
    opacity: 1;
  }
}


/* ══════════════════════ FASE 4: pulido ══════════════════════ */

/* WCAG AA: el gris azulado #5d6687 daba 3.4:1 sobre los fondos oscuros
   (axe, 17 nodos); #7c86a8 da 5.3-5.5:1 conservando el tono */
.app-body {
  --text-5: #7c86a8;
}

/* insignia de datos viejos (modo offline del Service Worker) */
.now__updated.is-stale {
  color: #ffb020;
  font-weight: 600;
}

/* esqueleto shimmer: nunca un spinner sobre el vacío */
#now-grid:empty,
#hours:empty,
#days:empty,
#marine-grid:empty {
  min-height: 6rem;
  border-radius: 1rem;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.04) 40%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.04) 60%
  );
  background-size: 200% 100%;
  animation: fdc-shimmer 1.4s infinite linear;
}
@keyframes fdc-shimmer {
  to {
    background-position: -200% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  #now-grid:empty,
  #hours:empty,
  #days:empty,
  #marine-grid:empty {
    animation: none;
  }
  .wind-canvas {
    display: none; /* cinturón y tirantes: el JS ya no las dibuja */
  }
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* panel de depuración (?debug=1) */
.fdc-debug {
  position: fixed;
  right: 0.8rem;
  bottom: 0.8rem;
  z-index: 3000;
  max-width: 34rem;
  max-height: 40vh;
  overflow: auto;
  padding: 0.8rem 1rem;
  font-family: monospace;
  font-size: 1.05rem;
  line-height: 1.5;
  color: #cfd8ef;
  background: rgba(0, 11, 51, 0.94);
  border: 0.1rem solid var(--line-2);
  border-radius: 0.8rem;
}
.fdc-debug .ok b {
  color: #37d67a;
}
.fdc-debug .bad b {
  color: #e5484d;
}

/* RTL (árabe): el layout entero se voltea con dir=rtl; ajustes puntuales */
[dir="rtl"] .app__logo-title,
[dir="rtl"] .panel-block__title,
[dir="rtl"] .eps-note,
[dir="rtl"] .tc-warn {
  text-align: right;
}
[dir="rtl"] .now__stat div {
  text-align: right;
}
