/* ============================================================
   meteoBezana — meteobezana.css v4.0 LIMPIO
   Inter font · Light mode por defecto · Dark con body.dark
   ============================================================ */

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

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* ---- VARIABLES LIGHT ---- */
:root {
  --bg:      hsl(216, 28%, 96%);
  --bg2:     hsl(216, 24%, 91%);
  --bg3:     hsl(216, 20%, 85%);
  --bg4:     hsl(216, 18%, 78%);
  --card:    hsl(0, 0%, 100%);
  --txt1:    hsl(218, 32%, 8%);
  --txt2:    hsl(218, 25%, 14%);
  --txt3:    hsl(218, 18%, 28%);
  --txt4:    hsl(218, 14%, 42%);
  --blue:    hsl(211, 100%, 42%);
  --blue2:   hsl(211, 92%, 82%);
  --blue3:   hsl(211, 100%, 95%);
  --teal:    hsl(158, 100%, 26%);
  --amber:   hsl(35, 100%, 40%);
  --red:     hsl(3, 90%, 44%);
  --purple:  hsl(258, 88%, 52%);
  --border:  hsl(216, 22%, 86%);
  --brd:     hsl(216, 22%, 86%);
  --rad:     14px;
  --shadow:  0 1px 6px hsl(216,30%,60%,0.10);
  --shadow2: 0 2px 12px hsl(216,30%,50%,0.13);
  --tc:      hsl(218, 10%, 54%);
  --gc:      hsl(216, 22%, 86%);
  --err:     hsl(3, 90%, 44%);
  --txt:     hsl(218, 32%, 8%);
}

/* ---- WIDE GAMUT P3 — pantallas modernas (iPhone, iPad, MacBook) ---- */

@media (max-width: 540px) {
body {
  font-size: 16px;
}
.container {
  padding: 0 12px;
}
}

@media (color-gamut: p3) {
:root {
  --blue:   oklch(55% 0.13 255);
  --teal:   oklch(58% 0.13 158);
  --amber:  oklch(68% 0.13 65);
  --red:    oklch(56% 0.15 25);
  --purple: oklch(58% 0.15 295);
}
}

/* ---- VARIABLES DARK ---- */
body.dark {
  --bg:      #0f1620;
  --bg2:     #1a2535;
  --bg3:     #223040;
  --bg4:     #2c3d52;
  --card:    hsl(216, 40%, 13%);
  --txt1:    hsl(210, 50%, 97%);
  --txt2:    hsl(210, 30%, 86%);
  --txt3:    hsl(210, 28%, 78%);
  --txt4:    hsl(210, 20%, 65%);
  --blue:    hsl(213, 100%, 70%);
  --blue2:   hsl(213, 52%, 24%);
  --blue3:   hsl(213, 60%, 11%);
  --teal:    hsl(136, 60%, 56%);
  --amber:   hsl(43, 85%, 62%);
  --red:     hsl(0, 90%, 67%);
  --purple:  hsl(270, 80%, 76%);
  --border:  hsl(216, 30%, 28%);
  --brd:     hsl(216, 30%, 28%);
  --shadow:  0 2px 12px hsl(216,40%,4%,0.6), 0 1px 3px hsl(216,40%,4%,0.4);
  --shadow2: 0 4px 24px hsl(216,40%,4%,0.7);
  --tc:      hsl(210, 22%, 68%);
  --gc:      hsl(216, 30%, 24%);
  --txt:     hsl(210, 50%, 97%);
}

/* ---- BASE ---- */
body {
  background: var(--bg);
  color: var(--txt1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 1;
}

/* ---- FONDO DINÁMICO SEGÚN HORA ---- */
/* Hero — gamas monocromáticas por período del día */
body.time-dawn {
  --sky-from: #2d1b4e;
  --sky-mid: #7c3aed;
  --sky-to: #c4b5fd;
}/* Violeta suave → lavanda */
body.time-morning {
  --sky-from: #0c4a6e;
  --sky-mid: #0284c7;
  --sky-to: #7dd3fc;
}/* Azul profundo → cielo claro */
body.time-day {
  --sky-from: #0369a1;
  --sky-mid: #0ea5e9;
  --sky-to: #bae6fd;
}/* Azul medio → azul claro */
body.time-golden {
  --sky-from: #78350f;
  --sky-mid: #d97706;
  --sky-to: #fcd34d;
}/* Ámbar oscuro → dorado */
body.time-dusk {
  --sky-from: #1e1b4b;
  --sky-mid: #4338ca;
  --sky-to: #818cf8;
}/* Índigo oscuro → lavanda */
body.time-night {
  --sky-from: #020617;
  --sky-mid: #0f172a;
  --sky-to: #1e293b;
}/* Azul noche profunda */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg,
    var(--sky-from, #0369a1) 0%,
    var(--sky-mid,  #38bdf8) 50%,
    var(--sky-to,   #7dd3fc) 100%);
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
  transition: background 2s ease, opacity 2s ease;
}
body.dark::before {
  opacity: 0.28;
}
body.time-night::before {
  opacity: 0.22;
}
body.time-dusk::before {
  opacity: 0.22;
}
body.time-golden::before {
  opacity: 0.20;
}

/* ============================================================
   TOPBAR — única definición limpia
   ============================================================ */
.topbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 16px 20px;
  border-radius: var(--rad);
  transition: opacity 0.2s ease, transform 0.2s ease;
  gap: 0;
  /* Efecto glassmorphism */
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}
body.dark .topbar {
  background: rgba(15,22,32,0.75);
  border: 1px solid rgba(255,255,255,0.08);
}

.topbar .logo {
  flex-shrink: 0;
  background: rgba(255,255,255,0.70);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07), inset 0 1px 0 rgba(255,255,255,0.78);
}
body.dark .topbar .logo {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 2px 12px rgba(0,0,0,0.30), inset 0 1px 0 rgba(255,255,255,0.06);
}

.topbar .logo img {
  height: 110px;
  width: auto;
  display: block;
}

body.dark .topbar .logo img {
  filter: brightness(0) invert(1);
}

.topbar-right-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-left: 16px;
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar .nav {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
  flex-wrap: nowrap;
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.30);
  border-radius: 12px;
  padding: 3px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.4);
}
body.dark .topbar .nav {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.10);
  box-shadow: 0 2px 12px rgba(0,0,0,0.30), inset 0 1px 0 rgba(255,255,255,0.08);
}

/* ---- NAV LINKS ---- */
.nav a {
  padding: 5px 11px;
  border-radius: 9px;
  color: var(--txt2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  user-select: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
  border: none;
  background: transparent;
}
@media (min-width: 901px) and (max-width: 1100px) {
  .nav a { font-size: 11px; padding: 5px 8px; }
}
.nav a:hover:not(.act) {
  background: rgba(255,255,255,0.35);
  color: var(--txt1);
}
body.dark .nav a:hover:not(.act) {
  background: rgba(255,255,255,0.10);
  color: var(--txt1);
}
.nav a.act {
  background: var(--card);
  color: var(--blue);
  font-weight: 700;
  box-shadow: 0 1px 6px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.80);
}
body.dark .nav a.act {
  background: rgba(255,255,255,0.12);
  color: var(--blue);
  box-shadow: 0 1px 6px rgba(0,0,0,0.30), inset 0 1px 0 rgba(255,255,255,0.08);
}

/* ---- GLASS UTILITY ---- */
.glass {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
/* ---- ACT/OSCURO ---- */
.upd {
  font-size: 12px;
  color: var(--txt3);
  background: var(--bg2);
  padding: 5px 12px;
  border-radius: 8px;
  white-space: nowrap;
  border: 1px solid var(--border);
}
.upd span {
  color: var(--teal);
  font-weight: 500;
}

.theme-btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--txt2);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.theme-btn:hover {
  background: var(--bg3);
}

/* ============================================================
   PÍLDORA FLOTANTE — aparece al hacer cualquier scroll
   ============================================================ */
.float-nav {
  position: fixed;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 6px 5px 14px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: top 0.3s cubic-bezier(0.4,0,0.2,1);
  white-space: nowrap;
}
body.dark .float-nav {
  background: rgba(15,22,32,0.94);
  border-color: rgba(255,255,255,0.08);
}
.float-nav.visible {
  top: 10px;
}
.float-nav-logo {
  font-size: 13px;
  font-weight: 800;
  color: var(--blue);
  margin-right: 6px;
  letter-spacing: -0.02em;
}
.float-nav .nav a {
  font-size: 13px;
  padding: 5px 10px;
}

@media (max-width: 600px) {
.float-nav-logo {
  display: none;
}
.float-nav .nav a {
  font-size: 12px;
  padding: 4px 8px;
}
}

/* ============================================================
   PÁGINAS
   ============================================================ */
.sec-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--txt4);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  padding: 0 4px;
}
.page {
  display: none;
  flex-direction: column;
  gap: 14px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.page.act {
  display: flex;
}

/* ============================================================
   INDICADORES AMBIENTALES
   ============================================================ */
.env-indicators {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  margin: 0;
  align-items: center;
  align-self: flex-start;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.env-item {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 20px;
  padding: 4px 10px 4px 7px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.env-item:hover {
  background: rgba(255,255,255,0.70);
}
.env-ico {
  font-size: 14px;
  flex-shrink: 0;
  display:flex;
  align-items:center;
}
.env-ico .material-symbols-rounded {
  font-size: 15px;
  color: rgba(255,255,255,0.85);
}
.env-body {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.env-label {
  font-size: 10px;
  color: rgba(255,255,255,0.80);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 3px;
}
.env-q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.env-val {
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.env-lvl {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.85;
}

@media (max-width: 540px) {
.env-indicators {
  gap: 5px;
}
.env-item {
  padding: 3px 8px 3px 6px;
}
.env-val {
  font-size: 11px;
}
}

/* ============================================================
   HERO PREMIUM
   ============================================================ */
.hero-section {
  background: linear-gradient(135deg,
    var(--sky-from, #0369a1) 0%,
    var(--sky-mid,  #0284c7) 60%,
    var(--sky-to,   #0ea5e9) 100%);
  border-radius: var(--rad);
  padding: 16px 24px 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(3,105,161,0.25);
  color: #fff;
  animation: fadeInUp 0.5s ease both;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 260px;
  height: 260px;
  background: rgba(255,255,255,0.12);
  border-radius: 50%;
  pointer-events: none;
}
.hero-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.06);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: block;
}
.hero-temp-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.hero-location {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 2px;
}
.hero-temp-row {
  display: flex;
  align-items: flex-start;
  line-height: 1;
}
.hero-t-big {
  font-size: clamp(40px, 14vw, 76px);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.04em;
  line-height: 1;
}
.hero-t-sup {
  font-size: clamp(15px, 5vw, 28px);
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  margin-top: -6px;
  align-self: flex-end;
  padding-bottom: 6px;
}
.hero-desc {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-top: 1px;
  letter-spacing: -0.01em;
}
.hero-feels {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  margin-top: 2px;
  font-weight: 500;
}

.hero-metrics {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.18);
}
.hero-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero-metric-l {
  font-size: 13px;
  color: rgba(255,255,255,0.80);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.hero-metric-v {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.hero-metric-s {
  font-size: 13px;
  color: rgba(255,255,255,0.80);
}

.hero-icon-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.hero-icon-wrap img {
  width: 110px;
  height: 110px;
  filter: brightness(0) invert(1) drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}
.hero-time {
  font-size: 12px;
  color: rgba(255,255,255,0.80);
  text-align: center;
}

.hero-upd {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  font-size: 11px;
  color: rgba(255,255,255,0.80);
  display: flex;
  align-items: center;
  gap: 5px;
}
.hero-upd-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
0%,100% {
  opacity:1;
  transform:scale(1);
}
50% {
  opacity:.5;
  transform:scale(.8);
}
}
@media (max-width: 600px) {
.hero-upd {
  position: static;
  margin-bottom: 6px;
  font-size: 12px;
}
}

.hero-alert {
  display: none;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.4);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #fecaca;
  font-weight: 500;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}
.hero-alert.show {
  display: flex;
}
#hero-alert-msg {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

@media (max-width: 768px) {
.hero-section {
  padding: 28px 22px 22px;
}
.hero-t-big {
  font-size: 64px;
}
.hero-icon-wrap img {
  width: 80px;
  height: 80px;
}
#hero-weather-icon {
  height: 100px !important;
}
}
@media (max-width: 768px) {
.hero-inner {
  grid-template-columns: 1fr;
}
.hero-icon-wrap {
  display: flex;
}
.hero-icon-wrap img,
#hero-weather-icon {
  width: 64px !important;
  height: 64px !important;
}
.hero-t-big {
  font-size: 80px;
}
.hero-section {
  padding: 24px 18px 20px;
}
.topbar {
  padding: 10px 12px;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}
/* Tamaño táctil mínimo para botones y enlaces */
.nav a {
  font-size: 13px;
  padding: 7px 12px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.tb {
  font-size: 13px;
  padding: 8px 14px;
  min-height: 36px;
}
.pb {
  font-size: 12px;
  padding: 7px 12px;
  min-height: 36px;
}
.side-tab {
  font-size: 12px;
  padding: 7px 12px;
  min-height: 36px;
}
.radar-mode-btn {
  font-size: 12px !important;
  padding: 7px 6px !important;
  min-height: 36px;
}
.radar-mode-btn.act {
  background: var(--blue) !important;
  color: #fff !important;
  border-color: var(--blue) !important;
}
.cape-model-btn.act {
  background: #6ea8d8 !important;
  color: #fff !important;
  border-color: #6ea8d8 !important;
}
.topbar .logo {
  order: -1;
  align-self: center;
  width: auto;
}
.topbar .logo img {
  height: 55px;
  width: auto;
}
@media (max-width: 900px) and (orientation: landscape) {
  .shell {
    padding: 8px;
    max-width: 100%;
    width: 100%;
    margin: 0;
  }
  body {
    overflow-x: hidden;
  }
  .topbar {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    padding: 8px 16px;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
  }
  .topbar .logo {
    order: 0;
    width: auto;
    align-self: center;
  }
  .topbar .logo img {
    height: 44px;
  }
  .topbar-right-col {
    flex: 1;
    align-items: flex-end;
    margin-left: 0;
    width: auto;
  }
  .topbar .nav {
    width: 100%;
    justify-content: flex-end;
  }
}
.topbar-right-col {
  margin-left: 0;
  align-items: stretch;
  width: 100%;
}
.topbar .nav {
  justify-content: flex-start;
  width: 100%;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.topbar .nav::-webkit-scrollbar {
  display: none;
}
.nav a {
  padding: 5px 9px;
  font-size: 12px;
  flex-shrink: 0;
}
.topbar-actions {
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
  gap: 6px;
}
.theme-btn {
  font-size: 12px;
  padding: 5px 10px;
  white-space: nowrap;
}
.upd {
  display: none;
}
}

/* ============================================================
   PREVISIÓN 7 DÍAS
   ============================================================ */
.forecast-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.forecast-loading {
  color: var(--txt3);
  font-size: 14px;
  padding: 1.5rem 0;
}

.fd {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--rad);
  padding: 8px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  box-shadow: var(--shadow);
  transition: background 0.2s, border-color 0.2s, backdrop-filter 0.2s;
  min-width: 90px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.fd:hover {
  background: rgba(255,255,255,0.88);
  border-color: rgba(255,255,255,0.80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
body.dark .fd:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.fd.today {
  border-color: var(--blue);
  border-width: 2px;
}
.fd-day {
  font-size: 14px;
  color: var(--txt3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.fd-ico {
  width: 56px;
  height: 56px;
}
.fd-ico img {
  width: 56px;
  height: 56px;
}
body:not(.dark) .fd-ico img {
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.18)) saturate(1.2);
}
.fd-hi {
  font-size: 17px;
  font-weight: 700;
  color: var(--txt1);
}
.fd-lo {
  font-size: 15px;
  color: var(--txt3);
}
.fd-mm {
  font-size: 13px;
  color: var(--blue);
  font-weight: 500;
}
.fd-wind {
  font-size: 13px;
  color: var(--txt4);
}
.fd-wind-dir {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  background: var(--bg3);
  color: var(--blue);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 3px;
  vertical-align: middle;
}
.fd-desc {
  font-size: 13px;
  color: var(--txt4);
  line-height: 1.3;
}

@media (max-width: 768px) {
.forecast-grid {
  grid-template-columns: repeat(4, 1fr);
}
}
@media (max-width: 540px) {
.forecast-grid {
  grid-template-columns: repeat(7, minmax(90px, 1fr));
}
}

/* ============================================================
   MAPA RADAR
   ============================================================ */
.map-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--rad);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 6px;
}
.map-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--txt1);
}
.map-sub {
  font-size: 12px;
  color: var(--txt3);
}

body.dark .leaflet-popup-content-wrapper {
  background: var(--card);
  color: var(--txt1);
  border: 1px solid var(--border);
}
body.dark .leaflet-popup-tip {
  background: var(--card);
}

/* ============================================================
   TABLA HORARIA — ACORDEÓN
   ============================================================ */
.accordion-card {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--rad);
  overflow: hidden;
  box-shadow: none;
}
.accordion-hdr {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: none;
  border: none;
  color: var(--txt1);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  font-family: inherit;
}
.accordion-hdr:hover {
  background: var(--bg2);
}
.accordion-ico {
  font-size: 10px;
  color: var(--txt4);
  min-width: 12px;
}
.accordion-label {
  flex: 1;
}
.accordion-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--txt3);
  text-align: right;
}
.accordion-body {
  border-top: 1px solid var(--border);
}

.table-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.table-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.tctrl {
  display: flex;
  gap: 5px;
}
.tb {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--txt3);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.tb.act {
  background: var(--blue3);
  color: var(--blue);
  border-color: var(--blue2);
}
.tb:hover:not(.act) {
  background: var(--bg3);
  color: var(--txt2);
}

.table-scroll {
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--blue2) var(--bg2);
}
.table-scroll.has-limit {
  max-height: var(--table-max-h, 264px);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 540px;
}
thead tr {
  background: var(--bg2);
}
th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--txt4);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th:not(:first-child) {
  text-align: right;
}
td {
  padding: 9px 14px;
  font-size: 14px;
  color: var(--txt2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td:not(:first-child) {
  text-align: right;
}
tr:last-child td {
  border-bottom: none;
}
tr:hover td {
  background: var(--bg2);
}
tr.now-row td {
  background: rgba(29,111,216,0.06);
  color: var(--txt1);
}
tr.now-row td:first-child {
  color: var(--blue);
  font-weight: 600;
}

.vhi {
  color: #dc2626 !important;
  font-weight: 600;
}
.vlo {
  color: #2563eb !important;
  font-weight: 600;
}
.vgust {
  color: var(--amber) !important;
  font-weight: 600;
}
.vrain {
  color: var(--blue) !important;
  font-weight: 600;
}
.dir-badge {
  font-size: 11px;
  color: var(--txt4);
  margin-left: 4px;
}
.now-badge {
  font-size: 11px;
  color: var(--teal);
  margin-left: 5px;
  font-weight: 600;
}

.sum-item {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg2);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}
.sum-item.hi {
  color: #dc2626;
}
.sum-item.lo {
  color: #2563eb;
}
.sum-item.blue {
  color: var(--blue);
}
.sum-item.amber {
  color: var(--amber);
}
.sum-item.muted {
  color: var(--txt3);
  font-weight: 400;
}

@media (max-width: 540px) {
.table-date-row {
  margin-left: 0;
  width: 100%;
}
.table-controls {
  flex-direction: column;
  align-items: flex-start;
}
}

/* ============================================================
   GRÁFICAS
   ============================================================ */
.charts-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--rad);
  padding: 20px;
  box-shadow: var(--shadow);
}
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.chart-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--txt1);
}
.chart-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.chart-wrap {
  position: relative;
  height: 220px;
}
#page-graficos .chart-wrap {
  height: 260px;
}
.chart-card .chart-wrap canvas {
  cursor: crosshair;
}

.pbg {
  display: flex;
  gap: 4px;
}
.pb {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--txt3);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.pb.act {
  background: var(--blue3);
  color: var(--blue);
  border-color: var(--blue2);
}
.pb:hover:not(.act) {
  background: var(--bg3);
}

.dl-btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--txt3);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.dl-btn:hover {
  background: var(--bg3);
  color: var(--txt2);
}

.period-selector {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.g-subtitle {
  font-size: 13px;
  color: var(--txt3);
  margin-top: -4px;
}

@media (max-width: 540px) {
.chart-card {
  padding: 14px;
}
.chart-header {
  flex-direction: column;
  align-items: flex-start;
}
.chart-wrap {
  height: 160px;
}
}

/* ============================================================
   RÉCORDS
   ============================================================ */
.rec-tabs {
  display: flex;
  gap: 6px;
}
.rec-tab {
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  color: var(--txt2);
  background: var(--card);
  transition: background 0.15s;
  font-family: inherit;
}
.rec-tab.act {
  background: var(--blue3);
  color: var(--blue);
  border-color: var(--blue2);
}
.rec-tab:hover:not(.act) {
  background: var(--bg2);
}

.rec-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
@media (max-width: 1100px) {
  .rec-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .rec-grid { grid-template-columns: repeat(2, 1fr); }
}
.rec-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
}
.rec-card:nth-child(1) {
  border-top: 3px solid #dc2626;
}
.rec-card:nth-child(2) {
  border-top: 3px solid var(--teal);
}
.rec-card:nth-child(3) {
  border-top: 3px solid var(--amber);
}
.rec-card:nth-child(4) {
  border-top: 3px solid var(--purple);
}
.rec-card:nth-child(5) {
  border-top: 3px solid var(--blue);
}
.rec-card-head {
  padding: 12px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.rec-card-head h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--txt4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rec-card-head h3 .material-symbols-rounded {
  font-size: 15px;
}
.rec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.rec-row:last-child {
  border-bottom: none;
}
.rec-label {
  font-size: 13px;
  color: var(--txt2);
}
.rec-date {
  font-size: 11px;
  color: var(--txt4);
  margin-top: 1px;
}
.rec-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--txt1);
  white-space: nowrap;
}
.rec-val.hi {
  color: #dc2626;
}
.rec-val.lo {
  color: #2563eb;
}
.rec-val.blue {
  color: var(--blue);
}
.rec-rel {
  font-size: 10px;
  color: var(--txt4);
  font-weight: 400;
  font-style: italic;
}
.rec-new-badge {
  font-size: 10px;
  background: hsl(28,100%,94%);
  color: hsl(28,100%,40%);
  border-radius: 6px;
  padding: 1px 5px;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 4px;
}
body.dark .rec-new-badge {
  background: hsl(28,80%,20%);
  color: hsl(28,100%,70%);
}
.rec-val.amber {
  color: var(--amber);
}
.rec-val.purple {
  color: var(--purple);
}
@media (max-width: 540px) {.rec-grid {
  grid-template-columns: 1fr;
} }

/* ============================================================
   INFORMES NOAA
   ============================================================ */
.rep-grid { }
.rep-selector {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--rad);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rep-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.rep-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--txt4);
  min-width: 32px;
}
.rep-select {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--txt1);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  min-width: 140px;
}
.rep-year { display: none; }
.rep-annual {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--blue3);
  border: 1px solid var(--blue2);
  transition: background 0.15s;
  white-space: nowrap;
}
.rep-annual:hover { background: var(--blue2); }
.rep-months {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rep-month {
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--bg2);
  color: var(--txt3);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.rep-month:hover {
  background: var(--blue3);
  color: var(--blue);
}

/* ============================================================
   SOBRE
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.about-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--rad);
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.about-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--txt1);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.about-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.about-row:last-child {
  border-bottom: none;
}
.about-label {
  font-size: 13px;
  color: var(--txt3);
}
.about-val {
  font-size: 13px;
  color: var(--txt1);
  font-weight: 600;
  text-align: right;
}
.networks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 6px;
}
.net-item {
  background: var(--bg2);
  border-radius: 10px;
  padding: 12px 16px;
}
.net-label {
  font-size: 11px;
  color: var(--txt4);
  margin-bottom: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.net-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
}

@media (max-width: 768px) {.about-grid {
  grid-template-columns: 1fr;
} }

/* ============================================================
   ALMANAQUE
   ============================================================ */
/* ============================================================
   ALMANAQUE GALÁCTICO
   ============================================================ */


.alm-twilight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}
.alm-tw-item {
  background: rgba(0,0,0,0.04);
  border-radius: 10px;
  padding: 8px 12px;
}
body.dark .alm-tw-item {
  background: rgba(255,255,255,0.05);
}
.alm-tw-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--txt4);
  margin-bottom: 4px;
}
.alm-tw-times {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt1);
}

.alm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.alm-overlay.open {
  display: flex;
}

.alm-modal {
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(245,247,250,0.97);
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: 0 32px 80px rgba(0,0,0,0.22);
}
body.dark .alm-modal {
  background: rgba(20,25,36,0.97);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 32px 80px rgba(0,0,0,0.55);
}

.alm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px 14px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.8);
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
body.dark .alm-header {
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.alm-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--txt1);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alm-date {
  font-size: 12px;
  color: var(--txt3);
  margin-top: 2px;
  text-transform: capitalize;
}
.alm-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(0,0,0,0.07);
  border: 1px solid rgba(0,0,0,0.1);
  color: var(--txt2);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  font-family: inherit;
}
body.dark .alm-close {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.1);
}
.alm-close:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.alm-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.alm-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.alm-two-col .alm-section {
  border-right: 1px solid rgba(0,0,0,0.06);
}
body.dark .alm-two-col .alm-section {
  border-right-color: rgba(255,255,255,0.05);
}
.alm-two-col .alm-section:last-child {
  border-right: none;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
body.dark .alm-two-col .alm-section:last-child {
  border-bottom-color: rgba(255,255,255,0.05);
}

.alm-section {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
body.dark .alm-section {
  border-bottom-color: rgba(255,255,255,0.05);
}
.alm-section:last-child {
  border-bottom: none;
}

.alm-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 700;
  color: var(--txt4);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

.alm-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 10px;
  overflow: hidden;
}
body.dark .alm-rows {
  border-color: rgba(255,255,255,0.06);
}
.alm-rows-sm .alm-row {
  padding: 5px 10px;
}
.alm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: rgba(255,255,255,0.7);
  border-bottom: 1px solid rgba(0,0,0,0.04);
  gap: 8px;
}
body.dark .alm-row {
  background: rgba(255,255,255,0.04);
  border-bottom-color: rgba(255,255,255,0.04);
}
.alm-row:last-child {
  border-bottom: none;
}
.alm-row-label {
  font-size: 11px;
  color: var(--txt3);
  font-weight: 500;
  white-space: nowrap;
}
.alm-row-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--txt1);
  text-align: right;
}
.alm-row-val.purple {
  color: var(--purple);
}

.alm-item-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--txt1);
  text-align: right;
}
.alm-item-val.amber {
  color: var(--amber);
}
.alm-item-val.purple {
  color: var(--purple);
}
.alm-item-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}


.alm-sun-timeline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.alm-tl-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--txt3);
  white-space: nowrap;
  min-width: 36px;
}
.alm-tl-label:last-child {
  text-align: right;
}
.alm-tl-track {
  flex: 1;
  height: 7px;
  background: rgba(0,0,0,0.08);
  border-radius: 8px;
  position: relative;
  overflow: visible;
}
body.dark .alm-tl-track {
  background: rgba(255,255,255,0.1);
}
.alm-tl-fill {
  height: 7px;
  background: linear-gradient(90deg, #f59e0b, #f97316);
  border-radius: 8px;
  width: 0%;
  transition: width 0.8s ease;
  box-shadow: 0 0 8px rgba(249,115,22,0.35);
}
.alm-tl-now {
  position: absolute;
  top: -5px;
  width: 17px;
  height: 17px;
  background: #f97316;
  border: 3px solid #fff;
  border-radius: 50%;
  transform: translateX(-50%);
  transition: left 0.8s ease;
  display: none;
  box-shadow: 0 2px 8px rgba(249,115,22,0.5);
}
body.dark .alm-tl-now {
  border-color: rgba(20,25,36,0.97);
}

.alm-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}
.alm-pills-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.alm-pill {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: rgba(0,0,0,0.04);
  border-radius: 8px;
  padding: 5px 8px;
  flex: 1;
  min-width: 0;
}
body.dark .alm-pill {
  background: rgba(255,255,255,0.05);
}
.alm-pill-label {
  font-size: 10px;
  color: var(--txt4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.alm-pill-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--txt1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.alm-pill-val.purple {
  color: var(--purple);
}

.alm-moon-visual {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0,0,0,0.03);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
body.dark .alm-moon-visual {
  background: rgba(255,255,255,0.04);
}
#alm-moon-canvas {
  flex-shrink: 0;
}
.alm-moon-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.alm-moon-phase-big {
  font-size: 14px;
  font-weight: 800;
  color: var(--purple);
}
.alm-moon-pct-big {
  font-size: 12px;
  color: var(--txt3);
}

@media (max-width: 600px) {
.alm-overlay {
  padding: 6px;
  align-items: flex-end;
  padding-bottom: 0;
}
.alm-modal {
  border-radius: 18px 18px 0 0;
  max-height: 97dvh;
  height: 97dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.alm-body {
  -webkit-overflow-scrolling: touch;
  overflow-y: scroll;
}
.alm-header {
  padding: 12px 14px 10px;
}
.alm-title {
  font-size: 15px;
}
.alm-two-col {
  grid-template-columns: 1fr;
}
.alm-two-col .alm-section {
  border-right: none;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
body.dark .alm-two-col .alm-section {
  border-bottom-color: rgba(255,255,255,0.05);
}
.alm-section {
  padding: 12px 14px;
}
.alm-section-title {
  margin-bottom: 10px;
}
.alm-close {
  width: 36px;
  height: 36px;
  font-size: 15px;
}
.alm-pills-2 {
  grid-template-columns: 1fr 1fr;
}
}

@media (max-width: 380px) {
.alm-pills-2 {
  grid-template-columns: 1fr;
}
}

.hero-alm-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  padding: 0 0 0 4px;
  vertical-align: middle;
  line-height: 1;
  transition: color 0.15s;
}
.hero-alm-btn:hover {
  color: #fff;
}
.hero-alm-btn .material-symbols-rounded {
  font-size: 14px;
}

/* Fecha en tarjeta previsión */
.fd-date {
  font-size: 13px;
  color: var(--txt4);
}
.fd.today .fd-date {
  color: var(--blue);
}

/* Récords — extras */
.rec-val.teal {
  color: var(--teal);
}
.rec-period-label {
  font-size: 13px;
  color: var(--txt3);
  padding: 2px 4px;
  font-style: italic;
}

/* Selector de unidades */
.units-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0;
}
.units-label {
  font-size: 12px;
  color: var(--txt3);
  font-weight: 500;
}

/* Comparativa años */
.cmp-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0;
}
.cmp-select {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--txt1);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

/* Social share buttons */
.mb-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--txt2);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.mb-social-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.mb-social-btn:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  transform: translateY(-2px);
}

/* Responsive — correcciones globales */
@media (max-width: 768px) {
.topbar {
  padding: 12px 16px;
}
.topbar .logo img {
  height: 90px;
}
}
@media (max-width: 540px) {
.topbar .logo img {
  height: 70px;
}
.topbar-actions .upd {
  display: none;
}
.nav a {
  padding: 5px 8px;
  font-size: 13px;
}
.hero-t-big {
  font-size: 60px;
}
#hero-weather-icon {
  height: 72px !important;
}
.hero-metrics {
  gap: 12px;
}
.chart-wrap {
  height: 160px;
}
#page-graficos .chart-wrap {
  height: 180px;
}
.rec-grid {
  grid-template-columns: 1fr;
}
.rec-tabs {
  flex-wrap: wrap;
  gap: 4px;
}
.float-nav {
  padding: 6px 10px 6px 14px;
  width: auto;
  max-width: calc(100vw - 24px);
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column;
  align-items: stretch;
  box-sizing: border-box;
  border-radius: 30px;
}
.float-nav-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.float-nav-logo {
  font-size: 13px;
}
.float-nav .nav {
  display: none;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  justify-content: center;
}
.float-nav .nav.open {
  display: flex;
  width: calc(100vw - 48px);
}
.float-nav .nav a {
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 20px;
  text-align: center;
  flex-shrink: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--txt2);
  transition: background 0.15s, color 0.15s;
}
.float-nav .nav a:hover {
  background: var(--bg3);
  color: var(--txt1);
}
.float-nav .nav a.act {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.float-nav-hamburger {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  padding: 0 9px;
  transition: background 0.2s;
}
.float-nav-hamburger:hover {
  background: rgba(255,255,255,0.65);
}
.ham-line {
  display: block;
  height: 2px;
  background: var(--blue);
  border-radius: 2px;
  width: 20px;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  transform-origin: right center;
}
.ham-line-short {
  width: 13px;
}
.float-nav-hamburger.open .ham-line:nth-child(1) {
  transform: rotate(-45deg) translate(1px, 0);
  width: 20px;
}
.float-nav-hamburger.open .ham-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.float-nav-hamburger.open .ham-line-short {
  transform: rotate(45deg) translate(1px, 0);
  width: 20px;
}
.rep-grid {
  grid-template-columns: repeat(2, 1fr);
}
}

/* ============================================================
   HERO + WEBCAM/WINDY — grid 60/40
   ============================================================ */
.hero-webcam-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}
.hero-webcam-grid .side-panel-card {
  display: flex;
  flex-direction: column;
}
/* Sat container ocupa todo el espacio disponible */
#sat-container {
  flex: 1;
  min-height: 220px;
  position: relative;
  background: #000;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
#sat-container:active {
  cursor: grabbing;
}
/* Webcam ocupa todo el espacio disponible */
#side-webcam {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.hero-webcam-grid .hero-section {
  height: 100%;
  min-height: 320px;
  animation: none;
}
.side-panel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--rad);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.side-panel-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.side-panel-tabs {
  display: flex;
  gap: 6px;
  justify-content: center;
  width: 100%;
}
.side-tab {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--txt3);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.side-tab.act {
  background: var(--blue3);
  color: var(--blue);
  border-color: var(--blue2);
}
.side-tab:hover:not(.act) {
  background: var(--bg4);
}
.side-panel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.side-webcam-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  position: absolute;
  inset: 0;
}
#side-windy iframe {
  width: 100%;
  height: 100%;
  min-height: 360px;
  border: none;
  display: block;
}
#side-radar {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
#radar-map {
  flex: 1;
  min-height: 0;
  height: 100%;
}
.hero-webcam-grid .side-panel-card {
  height: 100%;
}
.radar-mode-btn.act {
  background: var(--blue) !important;
  color: #fff !important;
  border-color: var(--blue) !important;
}
.radar-mode-btn {
  transition: background 0.15s, color 0.15s;
}
#sat-container {
  flex: 1;
  min-height: 0;
}

@media (max-width: 768px) {
.hero-webcam-grid {
  grid-template-columns: 1fr;
}
.side-panel-card {
  min-height: 300px;
}
.hero-webcam-grid .hero-section {
  min-height: auto;
}
}

/* Webcam offline ocupa todo el panel sin espacio blanco */
.webcam-offline {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 2rem;
  background: var(--bg2);
  text-align: center;
}
.webcam-offline-ico {
  font-size: 48px;
  opacity: 0.4;
}
.webcam-offline-txt {
  font-size: 16px;
  font-weight: 600;
  color: var(--txt3);
}
.webcam-offline-sub {
  font-size: 13px;
  color: var(--txt4);
}

/* ============================================================
   PÁGINA SOBRE — layout limpio
   ============================================================ */

/* Fila superior: info + mapa */
.sobre-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
}
.sobre-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sobre-map {
  padding: 0 !important;
  overflow: hidden;
  min-height: 240px;
}

/* Fila inferior: hardware + imagen + redes */
.sobre-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  align-items: stretch;
}
.sobre-img-card {
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sobre-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 200px;
}
.sobre-img-placeholder {
  flex-direction: column;
  gap: 8px;
  color: var(--txt4);
  font-size: 13px;
  min-height: 200px;
}
.sobre-img-placeholder .material-symbols-rounded {
  font-size: 40px;
  opacity: 0.3;
}

/* Stats en la card de info */
.about-hero-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--blue);
}
.about-hero-loc {
  font-size: 14px;
  color: var(--txt2);
}
.about-hero-coords {
  font-size: 12px;
  color: var(--txt3);
  font-family: monospace;
}
.about-hero-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.about-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.about-stat-v {
  font-size: 20px;
  font-weight: 700;
  color: var(--txt1);
}
.about-stat-l {
  font-size: 10px;
  color: var(--txt4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@media (max-width: 768px) {
.sobre-top {
  grid-template-columns: 1fr;
}
.sobre-bottom {
  grid-template-columns: 1fr;
}
}

/* Redes de observación — about-net-btn */
.about-networks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.about-net-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--txt1);
  transition: background 0.15s, box-shadow 0.15s;
}
.about-net-btn:hover {
  background: var(--bg3);
  box-shadow: var(--shadow);
}
.about-net-icon {
  font-size: 20px;
  flex-shrink: 0;
  color: var(--txt3);
}
.about-net-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt1);
}
.about-net-id {
  font-size: 12px;
  color: var(--blue);
  font-family: monospace;
}
.about-net-arrow {
  margin-left: auto;
  color: var(--txt4);
}

/* Sobre — layout: ver definicion anterior */

/* ============================================================
   PÁGINA ENLACES
   ============================================================ */
.enlaces-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.enlace-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.enlace-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.14);
}
.enlace-preview {
  display: none;
}
.enlace-iframe {
  width: 1280px;
  height: 800px;
  transform: scale(0.39);
  transform-origin: top left;
  border: none;
  pointer-events: none;
}
@media (max-width: 768px) {
.enlace-preview {
  display: none;
}
.enlace-card {
  min-height: auto;
}
}
.enlace-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.45) 100%);
}
.enlace-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--card);
  border-top: 1px solid var(--border);
}
body.dark .enlace-info {
  background: var(--card);
}
.enlace-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--blue3);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
}
.enlace-icon .material-symbols-rounded {
  font-size: 20px;
}
.enlace-text {
  flex: 1;
  min-width: 0;
}
.enlace-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--txt1);
  margin-bottom: 2px;
}
.enlace-desc {
  font-size: 12px;
  color: var(--txt3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.enlace-arrow {
  color: var(--txt4);
  flex-shrink: 0;
  font-size: 18px;
  transition: color 0.15s, transform 0.15s;
}
.enlace-card:hover .enlace-arrow {
  color: var(--blue);
  transform: translate(2px, -2px);
}

@media (max-width: 768px) {
.enlaces-grid {
  grid-template-columns: 1fr;
}
.enlace-iframe {
  width: 768px;
  margin-left: -384px;
  transform: scale(0.40);
}
}

/* ============================================================
   VISOR METEOROLÓGICO
   ============================================================ */
.visor-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.visor-ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.visor-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--txt4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.visor-btns {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.visor-input {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--txt1);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
@media (max-width: 768px) {
#visor-map {
  height: 360px !important;
}
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  margin-top: 32px;
  padding: 24px 16px 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-share {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.footer-share-label {
  font-size: 12px;
  color: var(--txt3);
}
.footer-text {
  font-size: 12px;
  color: var(--txt3);
  text-align: center;
  line-height: 1.6;
}

/* ============================================================
   PÁGINA ESTADÍSTICAS
   ============================================================ */
#page-estadisticas.act {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#page-estadisticas #est-output {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.est-controls {
  padding: 18px 20px;
}
.est-ctrl-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.est-ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.est-ctrl-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--txt4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 5px;
}
.est-ctrl-label .material-symbols-rounded {
  font-size: 14px;
}
.est-period-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.est-month-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.est-mpill {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--txt3);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.est-mpill.act {
  background: var(--blue3);
  color: var(--blue);
  border-color: var(--blue2);
}
.est-tab {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--txt2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.est-tab.act {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.est-run-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
  margin-left: auto;
}
.est-run-btn:hover {
  opacity: 0.85;
}
.est-run-btn .material-symbols-rounded {
  font-size: 18px;
}

/* KPIs */
.est-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.est-kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.est-kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--txt4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.est-kpi-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--txt1);
  letter-spacing: -0.02em;
}
.est-kpi-sub {
  font-size: 11px;
  color: var(--txt4);
  margin-top: 4px;
}

/* Gráficos */
.est-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.est-chart-card {
  padding: 16px 18px;
}
.est-chart-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--txt1);
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.est-chart-title .material-symbols-rounded {
  font-size: 17px;
  color: var(--blue);
}

@media (max-width: 900px) {.est-kpis {
  grid-template-columns: repeat(3, 1fr);
} }

/* Heatmap mensual */
#est-heatmap {
  overflow-x: auto;
  margin-top: 10px;
}
.est-heatmap-grid {
  display: grid;
  gap: 3px;
}
.est-hm-cell {
  width: 100%;
  aspect-ratio: 1.2;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  cursor: default;
  transition: opacity 0.1s;
}
.est-hm-cell:hover {
  opacity: 0.75;
}
.est-hm-label {
  font-size: 11px;
  color: var(--txt4);
  text-align: center;
}

@media (max-width: 768px) {
.est-charts-row {
  grid-template-columns: 1fr;
}
.est-kpis {
  grid-template-columns: 1fr 1fr;
}
}

/* Interpretación estadística */
.est-interp {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.est-interp-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.est-interp-btn .material-symbols-rounded {
  font-size: 16px;
}
.est-interp-body {
  display: none;
  margin-top: 10px;
  font-size: 13px;
  color: var(--txt2);
  line-height: 1.7;
}
.est-interp-body.open {
  display: block;
}
.est-interp-body p {
  margin: 0 0 8px;
}
.est-interp-body p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   GLASSMORPHISM — todas las cards
   ============================================================ */
.chart-card,
.rec-card,
.accordion-card,
.forecast-grid .fd,
.rep-card,
.map-card,
.side-panel-card,
.alm-modal,
.cmp-stat-card,
.about-card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Light mode */
body:not(.dark) .chart-card,
body:not(.dark) .rec-card,
body:not(.dark) .accordion-card,
body:not(.dark) .forecast-grid .fd,
body:not(.dark) .rep-card,
body:not(.dark) .about-card,
body:not(.dark) .side-panel-card,
body:not(.dark) .cmp-stat-card {
  background: rgba(255,255,255,0.75);
  border-color: rgba(200,210,230,0.7);
}

/* Dark mode */
body.dark .chart-card,
body.dark .rec-card,
body.dark .accordion-card,
body.dark .forecast-grid .fd,
body.dark .rep-card,
body.dark .about-card,
body.dark .side-panel-card,
body.dark .cmp-stat-card {
  background: rgba(22,27,34,0.78);
  border-color: rgba(255,255,255,0.07);
}
.table-scroll::-webkit-scrollbar {
  width: 6px;
}
.table-scroll::-webkit-scrollbar-track {
  background: var(--bg2);
  border-radius: 3px;
}
.table-scroll::-webkit-scrollbar-thumb {
  background: var(--blue2);
  border-radius: 3px;
}
.table-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--blue);
}
.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg2);
}

/* ============================================================
   SOBRE — secciones informativas masonry
   ============================================================ */
.sobre-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}
.sobre-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sobre-section-card {
  margin: 0;
}
@media (max-width: 768px) {.sobre-sections {
  grid-template-columns: 1fr;
} }
.sobre-h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--txt1);
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.sobre-h3 .material-symbols-rounded {
  font-size: 18px;
  color: var(--blue);
}
.sobre-p {
  font-size: 13px;
  color: var(--txt2);
  line-height: 1.7;
  margin: 0 0 10px;
}
.sobre-p:last-child {
  margin-bottom: 0;
}
.sobre-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.sobre-info-item {
  background: var(--bg2);
  border-radius: 8px;
  padding: 9px 12px;
}
.sobre-info-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--txt4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}
.sobre-info-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt1);
}
.sobre-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.sobre-tl-item {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.sobre-tl-item:last-child {
  border-bottom: none;
}
.sobre-tl-year {
  font-size: 12px;
  font-weight: 800;
  color: var(--blue);
  min-width: 52px;
  padding-top: 1px;
}
.sobre-tl-text {
  font-size: 13px;
  color: var(--txt2);
  line-height: 1.6;
}
.sobre-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sobre-feature {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--txt2);
  line-height: 1.6;
}
.sobre-feature .material-symbols-rounded {
  font-size: 20px;
  color: var(--blue);
  flex-shrink: 0;
  margin-top: 1px;
}
.sobre-feature strong {
  color: var(--txt1);
}
.sobre-clima-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.sobre-clima-item {
  background: var(--bg2);
  border-radius: 8px;
  padding: 10px 12px;
}
.sobre-clima-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--txt4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}
.sobre-clima-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--txt1);
}
.sobre-clima-sub {
  font-size: 11px;
  color: var(--txt3);
  margin-top: 2px;
}
.sobre-legal {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.sobre-legal .material-symbols-rounded {
  font-size: 18px;
  color: var(--txt4);
  flex-shrink: 0;
  margin-top: 2px;
}
.sobre-contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
@media (max-width: 768px) {
.sobre-sections {
  columns: 1;
}
.sobre-info-grid, .sobre-clima-grid {
  grid-template-columns: 1fr 1fr;
}
}

/* ============================================================
   PÁGINA MAR
   ============================================================ */
#page-mar.act {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Hero */
.mar-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(135deg, #0a2a4a 0%, #1a4a7a 50%, #0d3d6b 100%);
  border-radius: 16px;
  padding: 24px;
  color: #fff;
  box-shadow: 0 8px 32px rgba(10,42,74,0.3);
}
.mar-hero-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}
.mar-hero-title .material-symbols-rounded {
  font-size: 32px;
  color: #60d4f7;
  margin-top: 2px;
}
.mar-estado {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.mar-subtitulo {
  font-size: 12px;
  color: rgba(255,255,255,0.80);
  margin-top: 3px;
}
.mar-hero-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mar-stat {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 12px 16px;
  text-align: center;
  flex: 1;
  min-width: 80px;
}
.mar-stat-ico {
  font-size: 20px;
  color: #60d4f7;
  margin-bottom: 4px;
}
.mar-stat-val {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}
.mar-stat-lbl {
  font-size: 10px;
  color: rgba(255,255,255,0.80);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* Índices actividad compactos */
.mar-indices-compact {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.mar-indice-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 8px 14px;
  flex: 1 1 0;
  min-width: 0;
  box-sizing: border-box;
  transition: background 0.2s;
}
.mar-indice-badge .material-symbols-rounded {
  font-size: 20px;
  color: rgba(255,255,255,0.7);
  flex-shrink:0;
}
.mar-indice-badge-label {
  font-size: 10px;
  color: rgba(255,255,255,0.80);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mar-indice-badge-val {
  font-size: 13px;
  font-weight: 700;
}
.mar-indice-badge.excelente {
  background: rgba(45,212,160,0.25);
  border-color: rgba(45,212,160,0.4);
}
.mar-indice-badge.excelente .mar-indice-badge-val {
  color: #2dd4a0;
}
.mar-indice-badge.bueno {
  background: rgba(74,158,255,0.25);
  border-color: rgba(74,158,255,0.4);
}
.mar-indice-badge.bueno .mar-indice-badge-val {
  color: #60d4f7;
}
.mar-indice-badge.regular {
  background: rgba(255,184,48,0.25);
  border-color: rgba(255,184,48,0.4);
}
.mar-indice-badge.regular .mar-indice-badge-val {
  color: #ffb830;
}
.mar-indice-badge.malo {
  background: rgba(248,81,73,0.25);
  border-color: rgba(248,81,73,0.4);
}
.mar-indice-badge.malo .mar-indice-badge-val {
  color: #f85149;
}

@media (max-width: 540px) {
.mar-indices-compact {
  gap: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.mar-indice-badge {
  padding: 6px 10px;
  min-width: 0;
  flex: none;
}
}

/* Índices actividad */
.mar-hero-right {
  display: flex;
  align-items: center;
}
.mar-indices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}
.mar-indice {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  transition: background 0.2s;
}
.mar-indice .material-symbols-rounded {
  font-size: 24px;
  color: rgba(255,255,255,0.7);
}
.mar-indice-label {
  font-size: 11px;
  color: rgba(255,255,255,0.80);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}
.mar-indice-val {
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
}
.mar-indice.excelente {
  background: rgba(45,212,160,0.25);
  border-color: rgba(45,212,160,0.4);
}
.mar-indice.excelente .mar-indice-val {
  color: #2dd4a0;
}
.mar-indice.bueno {
  background: rgba(74,158,255,0.25);
  border-color: rgba(74,158,255,0.4);
}
.mar-indice.bueno .mar-indice-val {
  color: #60d4f7;
}
.mar-indice.regular {
  background: rgba(255,184,48,0.25);
  border-color: rgba(255,184,48,0.4);
}
.mar-indice.regular .mar-indice-val {
  color: #ffb830;
}
.mar-indice.malo {
  background: rgba(248,81,73,0.25);
  border-color: rgba(248,81,73,0.4);
}
.mar-indice.malo .mar-indice-val {
  color: #f85149;
}

/* Cards detalle */
.mar-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mar-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--txt1);
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.mar-card-title .material-symbols-rounded {
  font-size: 18px;
  color: var(--blue);
}
.mar-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mar-detail-item {
  background: var(--bg2);
  border-radius: 10px;
  padding: 10px 12px;
}
.mar-detail-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--txt4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.mar-detail-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--txt1);
}
.mar-boya-note {
  font-size: 11px;
  color: var(--txt4);
  margin-top: 10px;
  text-align: center;
}

/* Fuente */
.mar-source {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--txt3);
  padding: 8px 0;
}
.mar-source .material-symbols-rounded {
  font-size: 14px;
}

@media (max-width: 768px) {
.mar-hero {
  grid-template-columns: 1fr;
}
.mar-cards {
  grid-template-columns: 1fr;
}
.mar-indices {
  grid-template-columns: 1fr 1fr;
}
}

/* Mareas */
.mar-mareas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.mar-coef-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.mar-coef-btn:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.mar-coef-btn .material-symbols-rounded {
  font-size: 16px;
}

.mar-coef-info {
  margin: 12px 0;
}
.mar-coef-text p {
  font-size: 13px;
  color: var(--txt2);
  line-height: 1.6;
  margin: 0 0 12px;
}
.mar-coef-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.mar-coef-item {
  border-radius: 10px;
  padding: 10px 12px;
}
.mar-coef-muerta {
  background: rgba(74,158,255,0.1);
  border: 1px solid rgba(74,158,255,0.2);
}
.mar-coef-media {
  background: rgba(45,212,160,0.1);
  border: 1px solid rgba(45,212,160,0.2);
}
.mar-coef-viva {
  background: rgba(255,184,48,0.1);
  border: 1px solid rgba(255,184,48,0.2);
}
.mar-coef-equinoccial {
  background: rgba(248,81,73,0.1);
  border: 1px solid rgba(248,81,73,0.2);
}
.mar-coef-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--txt1);
}
.mar-coef-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--txt2);
  margin: 3px 0;
}
.mar-coef-desc {
  font-size: 11px;
  color: var(--txt3);
  line-height: 1.5;
}

.mar-mareas-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 10px;
}
.mar-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--txt2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.15s;
}
.mar-nav-btn:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.mar-nav-btn .material-symbols-rounded {
  font-size: 20px;
}
.mar-nav-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--txt1);
  min-width: 120px;
  text-align: center;
}

.mar-mareas-wrap {
  overflow-x: auto;
}
.mar-mareas-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.mar-mareas-table th {
  font-size: 10px;
  font-weight: 700;
  color: var(--txt4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 12px;
  text-align: center;
  border-bottom: 2px solid var(--border);
}
.mar-mareas-table th:first-child {
  text-align: left;
}
.mar-mareas-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--txt1);
  text-align: center;
}
.mar-mareas-table td:first-child {
  text-align: left;
}
.mar-mareas-table tr:last-child td {
  border-bottom: none;
}
.mar-mareas-table tr:hover td {
  background: var(--bg2);
}
.mar-mareas-table .pleamar td:nth-child(4) {
  color: #4a9eff;
  font-weight: 700;
}
.mar-mareas-table .bajamar td:nth-child(4) {
  color: #ff8c42;
  font-weight: 700;
}
.mar-coef-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.mar-coef-badge.muerta {
  background: rgba(74,158,255,0.15);
  color: #4a9eff;
}
.mar-coef-badge.media {
  background: rgba(45,212,160,0.15);
  color: #2dd4a0;
}
.mar-coef-badge.viva {
  background: rgba(255,184,48,0.15);
  color: #ffb830;
}
.mar-coef-badge.equinoccial {
  background: rgba(248,81,73,0.15);
  color: #f85149;
}
.mar-row-now td {
  background: rgba(74,158,255,0.08) !important;
  font-weight: 600;
}

.mar-help-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.8);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  vertical-align: middle;
  transition: background 0.15s;
  padding: 0;
  line-height: 1;
}
.mar-help-ico:hover {
  background: rgba(255,255,255,0.4);
}
.about-card .mar-help-ico {
  background: rgba(0,0,0,0.07);
  border-color: rgba(0,0,0,0.15);
  color: var(--txt3);
}
body.dark .about-card .mar-help-ico {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  color: var(--txt4);
}
.about-card .mar-help-ico:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

/* Glassmorphism — cards informes y calor */
#page-informes .about-card {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.80);
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}
body.dark #page-informes .about-card {
  background: rgba(20,25,36,0.82);
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

/* Glassmorphism — records */
#page-records .about-card {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.80);
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}
body.dark #page-records .about-card {
  background: rgba(20,25,36,0.82);
  border: 1px solid rgba(255,255,255,0.07);
}

/* Glassmorphism — enlaces widget */
#page-enlaces .about-card {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.80);
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}
body.dark #page-enlaces .about-card {
  background: rgba(20,25,36,0.82);
  border: 1px solid rgba(255,255,255,0.07);
}

/* Glassmorphism — mapa calor selector */
.calor-select {
  background: rgba(255,255,255,0.7) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
body.dark .calor-select {
  background: rgba(255,255,255,0.08) !important;
}

/* Widget instalación */
.widget-install-preview {
  width: 100%;
  height: 220px;
  border-radius: 16px;
  overflow: hidden;
  margin: 16px 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  background: linear-gradient(135deg, #0a1628 0%, #0f2044 100%);
}
.widget-preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
}
.widget-install-code {
  margin-top: 4px;
}
.widget-install-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.widget-install-snippet {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: var(--txt2);
  line-height: 1.6;
  word-break: break-all;
  margin-bottom: 10px;
}
.widget-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}
.widget-copy-btn:hover {
  opacity: 0.85;
}
.widget-copy-btn .material-symbols-rounded {
  font-size: 16px;
}

/* Mapa de calor */
.calor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.calor-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.calor-select {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--txt1);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.calor-tabs {
  display: flex;
  gap: 4px;
}
.calor-tab {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--txt2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.calor-tab.act {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.calor-aviso {
  font-size: 11px;
  font-weight: 600;
  color: var(--txt4);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}
.calor-legend {
  margin-bottom: 10px;
}
.calor-legend-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.calor-legend-label {
  font-size: 11px;
  color: var(--txt4);
  min-width: 36px;
}
.calor-legend-label:last-child {
  text-align: right;
}
.calor-legend-cell {
  width: 24px;
  height: 14px;
  border-radius: 3px;
  flex: 1;
}
.calor-legend-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.calor-legend-step .calor-legend-cell {
  width: 32px;
  flex: none;
}
.calor-legend-tick {
  font-size: 10px;
  color: var(--txt4);
  white-space: nowrap;
}

.calor-grid-wrap {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}
.calor-day-labels {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 2px;
}
.calor-day-label {
  font-size: 9px;
  color: var(--txt4);
  height: 13px;
  line-height: 13px;
  width: 14px;
  text-align: right;
}
.calor-grid {
  display: grid;
  grid-template-rows: repeat(7, 13px);
  grid-auto-flow: column;
  grid-auto-columns: 13px;
  gap: 2px;
}
.calor-cell {
  width: 13px;
  height: 13px;
  border-radius: 2px;
  cursor: default;
  transition: opacity 0.1s;
}
.calor-cell:hover {
  opacity: 0.7;
}
.calor-empty {
  background: transparent !important;
}

.calor-months {
  display: flex;
  gap: 2px;
  margin-top: 4px;
  padding-left: 18px;
  overflow-x: auto;
}
.calor-month-label {
  font-size: 9px;
  color: var(--txt4);
  width: 13px;
  white-space: nowrap;
  min-width: 13px;
}

PÁGINA COMPARADOR
   ============================================================ */
.cmp-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}
.cmp-controls-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cmp-ctrl-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cmp-ctrl-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.cmp-ctrl-label .material-symbols-rounded {
  font-size: 16px;
  color: var(--blue);
}
.cmp-ctrl-btns {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.cmp-sel-all {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--txt3);
  cursor: pointer;
  font-family: inherit;
}
.cmp-sel-all:hover {
  background: var(--bg3);
}
.cmp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.cmp-pill {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--txt3);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.cmp-pill.act {
  background: var(--blue3);
  color: var(--blue);
  border-color: var(--blue2);
}
.cmp-pill:hover:not(.act) {
  background: var(--bg3);
}
.cmp-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.cmp-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 768px) {.cmp-charts-row {
  grid-template-columns: 1fr;
} }
.cmp-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--txt3);
  font-size: 14px;
  padding: 2rem;
  justify-content: center;
}
.cmp-loading .material-symbols-rounded {
  animation: spin 1s linear infinite;
  font-size: 20px;
}
@keyframes spin {to {
  transform: rotate(360deg);
} }
.cmp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 3rem;
  color: var(--txt4);
  text-align: center;
}
.cmp-empty .material-symbols-rounded {
  font-size: 48px;
  opacity: 0.3;
}
.cmp-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.cmp-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--rad);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.cmp-stat-label {
  font-size: 11px;
  color: var(--txt4);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
}
.cmp-stat-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--txt1);
}
.cmp-stat-sub {
  font-size: 11px;
  color: var(--txt3);
  margin-top: 2px;
}
#page-comparador .chart-wrap {
  height: 280px;
  padding-left: 8px;
}
#page-comparador .cmp-stats-grid {
  margin-top: 14px;
}
#page-comparador #cmp-output {
  margin-top: 16px;
}

@media (max-width: 768px) {
.cmp-layout {
  grid-template-columns: 1fr;
}
.cmp-controls-card {
  position: static;
}
}

/* Acordeón info estadísticas comparador */
.cmp-info-accordion {
  border: 1px solid var(--border);
  border-radius: var(--rad);
  overflow: hidden;
}
.cmp-info-summary {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--txt2);
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  user-select: none;
  background: var(--bg2);
}
.cmp-info-summary:hover {
  background: var(--bg3);
}
.cmp-info-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cmp-info-item {
  border-left: 3px solid var(--blue2);
  padding-left: 12px;
}
.cmp-info-term {
  font-size: 13px;
  font-weight: 700;
  color: var(--txt1);
  margin-bottom: 3px;
}
.cmp-info-def {
  font-size: 12px;
  color: var(--txt3);
  line-height: 1.5;
}
.cmp-info-def em {
  color: var(--blue);
  font-style: normal;
  font-weight: 500;
}
.cmp-info-def strong {
  color: var(--txt1);
}

/* ============================================================
   SECCIÓN SATÉLITE — Layout 2 columnas
   ============================================================ */
.sat-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  align-items: start;
}

.sat-main {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sat-controls-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px 14px 0 0;
  padding: 14px 16px 10px;
}

.sat-ctrl-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.sat-img-container {
  position: relative;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  min-height: 400px;
  cursor: grab;
}

.sat-img-container img {
  width: 100%;
  height: auto;
  display: block;
}

.sat-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sat-sidebar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.sat-sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--txt1);
  margin-bottom: 12px;
}

@media (max-width: 900px) {
.sat-layout {
  grid-template-columns: 1fr;
}
.sat-sidebar {
  display: none;
}
.sat-main {
  display: flex;
  flex-direction: column;
}
.sat-img-container {
  order: 1;
  border-radius: 14px 14px 0 0;
  border-bottom: none;
}
.sat-float-bar {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.12);
  order: 2;
  border-radius: 0 0 14px 14px;
  border-top: none;
  flex-wrap: wrap;
}
}

/* Barra de controles debajo de la imagen */
.sat-float-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0 0 14px 14px;
  border-top: none;
  padding: 10px 14px;
  flex-wrap: wrap;
}

.sat-float-select {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--txt1);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 8px;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: background 0.15s;
}
.sat-float-select:hover {
  background: var(--bg3, var(--bg2));
}
.sat-float-select option {
  background: var(--card);
  color: var(--txt1);
}
.sat-float-select optgroup {
  background: var(--card);
  color: var(--txt3);
}

.sat-float-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}

.sat-float-info {
  font-size: 11px;
  color: var(--txt4);
  padding: 4px 2px 2px;
  width: 100%;
}

/* ── Legibilidad móvil — textos pequeños ── */
@media (max-width: 540px) {
.hero-metric-l {
  font-size: 13px !important;
}
.hero-metric-v {
  font-size: 17px !important;
}
.hero-metric-s {
  font-size: 13px !important;
}
.fd-day {
  font-size: 14px !important;
}
.fd-lo {
  font-size: 15px !important;
}
.fd-mm {
  font-size: 13px !important;
}
.fd-wind {
  font-size: 13px !important;
}
.fd-desc {
  font-size: 13px !important;
}
.fd-date {
  font-size: 13px !important;
}
.hero-alert {
  font-size: 13px !important;
}
.env-pill-label {
  font-size: 12px !important;
}
.env-pill-val {
  font-size: 14px !important;
}
}

/* ── Previsión 7 días simplificada en móvil ── */
@media (max-width: 540px) {
  .fd-wind { display: none; }
  .fd-desc { display: none; }
  .fd-date { display: none; }
  .fd { padding: 8px 4px; }
  .fd-hi { font-size: 15px; }
  .fd-lo { font-size: 13px; }
  .fd-mm { font-size: 12px; }
}

.est-run-btn-sec {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg2);
  color: var(--txt2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
  margin-left: auto;
}
.est-run-btn-sec:hover {
  background: var(--bg3);
  color: var(--txt1);
}

/* ── Records + Comparador una columna ── */
.rec-two-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rec-col-left, .rec-col-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Records + Comparador una columna ── */
.rec-two-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rec-col-left, .rec-col-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Botones modelo CAPE ── */
.cape-model-btn {
  flex: 1;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--txt3);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.cape-model-btn:hover:not(.act) {
  background: var(--bg2);
  color: var(--txt1);
}
.cape-model-btn.act {
  background: var(--blue3);
  color: var(--blue);
  border-color: var(--blue2);
}
#cape-btn-icon.act {
  background: var(--blue3);
  color: var(--blue);
  border-color: var(--blue2);
  box-shadow: 0 0 0 2px hsl(211,100%,42%,0.18);
}
#cape-btn-ecmwf.act {
  background: hsl(258,88%,96%);
  color: var(--purple);
  border-color: hsl(258,88%,78%);
  box-shadow: 0 0 0 2px hsl(258,88%,52%,0.18);
}
body.dark #cape-btn-icon.act {
  background: var(--blue3);
  color: var(--blue);
  border-color: var(--blue2);
  box-shadow: 0 0 0 2px hsl(213,100%,70%,0.22);
}
body.dark #cape-btn-ecmwf.act {
  background: hsl(258,60%,16%);
  color: var(--purple);
  border-color: hsl(258,60%,38%);
  box-shadow: 0 0 0 2px hsl(270,80%,76%,0.22);
}

/* ── Separación accordions gráficos ── */
.charts-stack-acc {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Botón Info satélite solo en móvil ── */
.sat-info-btn { display: none; }
@media (max-width: 768px) { .sat-info-btn { display: inline-flex; } }

/* ── Chart-card dentro de accordion transparente ── */
.accordion-body .chart-card {
  background: transparent;
  box-shadow: none;
  border: none;
}

/* ── Chart-card dentro de accordion sin fondo ni borde ── */
.accordion-body .chart-card,
body:not(.dark) .accordion-body .chart-card,
body.dark .accordion-body .chart-card {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 8px 4px;
}

/* ── Padding gráficas en accordion ── */
.charts-stack-acc .accordion-body .chart-card {
  margin: 8px;
}

/* ── Accordion estadísticas ── */
.est-accordion {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
  margin-bottom: 8px;
}
.est-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  font-size: 14px;
  color: var(--txt1);
  gap: 8px;
  transition: background 0.15s;
}
.est-accordion-header:hover {
  background: var(--bg2);
}
.est-accordion-header .est-chart-title {
  margin: 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.est-accordion-arrow {
  font-size: 20px;
  color: var(--txt3);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.est-accordion.open .est-accordion-arrow {
  transform: rotate(180deg);
}
.est-accordion-body {
  display: none;
  padding: 0 18px 18px;
  min-width: 0;
  overflow: hidden;
}
.est-accordion-body .est-charts-row {
  min-width: 0;
}
.est-accordion-body .est-charts-row .about-card {
  min-width: 0;
  overflow: hidden;
}
.est-accordion.open .est-accordion-body {
  display: block;
}

/* ── Accesibilidad: transparencia reducida ── */
@media (prefers-reduced-transparency: reduce) {
  .glass,
  .topbar,
  .topbar .nav,
  .float-nav,
  .env-item,
  .topbar .logo {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--card);
    border-color: var(--border);
  }
}

/* ── Botón volver arriba ── */
#back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--blue);
  box-shadow: 0 2px 12px hsl(216,30%,50%,0.18);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  transform: translateY(12px);
}
#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
#back-to-top:hover {
  background: var(--blue3);
  border-color: var(--blue2);
}
