/*
 * Atalaya · tokens de diseño
 * Contrastes verificados (WCAG 2.2 AA) en docs/sistema-diseno.md.
 * Tipografía del sistema: cero descargas, legible en cualquier dispositivo y con mala cobertura.
 */
:root {
  color-scheme: light dark;

  /* Neutros */
  --c-bg: #f3f5f8;
  --c-surface: #ffffff;
  --c-surface-2: #e9edf2;
  --c-line: #cfd7e1;
  --c-text: #0d1b2a;          /* 16.9:1 sobre surface */
  --c-text-2: #3a4b5f;        /*  9.0:1 */
  --c-text-3: #556477;        /*  6.0:1 */
  --c-brand: #0d2b4e;         /* azul atalaya */
  --c-on-brand: #ffffff;
  --c-link: #0a4fbf;          /*  7.0:1 */
  --c-focus: #0a4fbf;

  /* Niveles (relleno de etiqueta + texto encima) */
  --sev-info-bg: #dfe6ee;     --sev-info-fg: #1f3550;   --sev-info-edge: #6b819a;
  --sev-yellow-bg: #ffd60a;   --sev-yellow-fg: #1a1400; --sev-yellow-edge: #e0b800;
  --sev-orange-bg: #ff8a1f;   --sev-orange-fg: #1f0e00; --sev-orange-edge: #f07400;
  --sev-red-bg: #c8102e;      --sev-red-fg: #ffffff;    --sev-red-edge: #c8102e;

  --c-emergency: #c8102e;
  --c-ok: #1e7a46;
  --c-warn-text: #8a4b00;

  /* Tipografía */
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-base: 1.0625rem;
  --t-lg: 1.25rem;
  --t-xl: 1.5625rem;
  --t-2xl: 1.953rem;
  --t-3xl: clamp(2rem, 1.4rem + 2.6vw, 3.05rem);
  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh-body: 1.55;

  /* Espaciado (base 4 px) */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;

  /* Forma */
  --r-1: 6px;
  --r-2: 10px;
  --r-3: 16px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgb(13 27 42 / 0.06), 0 1px 1px rgb(13 27 42 / 0.04);
  --shadow-2: 0 8px 24px -8px rgb(13 27 42 / 0.18);

  /* Movimiento */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur-1: 120ms;
  --dur-2: 220ms;

  /* Maquetación */
  --w-page: 72rem;
  --w-text: 40rem;
  --gutter: clamp(1rem, 0.6rem + 2vw, 2rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-bg: #0a1220;
    --c-surface: #111c2e;
    --c-surface-2: #1a2740;
    --c-line: #2a3a55;
    --c-text: #eef3f9;        /* 15.6:1 sobre surface */
    --c-text-2: #c3cfdd;      /* 10.6:1 */
    --c-text-3: #9fb0c4;      /*  7.4:1 */
    --c-brand: #0d2b4e;
    --c-link: #8cb8ff;        /*  8.3:1 */
    --c-focus: #8cb8ff;
    --sev-info-bg: #2a3a55;   --sev-info-fg: #e3ebf5;   --sev-info-edge: #7d93ad;
    --c-ok: #5cc98a;
    --c-warn-text: #ffb366;
    --shadow-1: none;
    --shadow-2: 0 8px 24px -8px rgb(0 0 0 / 0.6);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-1: 0ms;
    --dur-2: 0ms;
  }
}

/* Atalaya · estilos. Requiere tokens.css (se concatena antes). */

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: var(--s-6); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--t-base);
  line-height: var(--lh-body);
  color: var(--c-text);
  background: var(--c-bg);
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

h1, h2, h3 { line-height: var(--lh-tight); margin: 0 0 var(--s-3); letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: var(--t-3xl); font-weight: 750; }
h2 { font-size: var(--t-2xl); font-weight: 700; }
h3 { font-size: var(--t-lg); font-weight: 650; }
p { margin: 0 0 var(--s-3); text-wrap: pretty; }
ul, ol { margin: 0 0 var(--s-4); padding-inline-start: 1.25em; }
[role='list'] { list-style: none; padding: 0; margin: 0; }
a { color: var(--c-link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code { font-family: var(--font-mono); font-size: 0.9em; background: var(--c-surface-2); padding: 0.1em 0.35em; border-radius: var(--r-1); }
small { font-size: 0.75em; }
svg { flex-shrink: 0; }

:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; border-radius: 2px; }
main:focus { outline: none; }

.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; }
.wrap { width: 100%; max-width: var(--w-page); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--c-text-3); }
.ok { color: var(--c-ok); display: inline-flex; align-items: center; gap: var(--s-1); font-weight: 600; }
.warn { color: var(--c-warn-text); font-weight: 600; }

.skip { position: absolute; inset-inline-start: var(--s-3); top: -100px; z-index: 100; background: var(--c-surface); color: var(--c-text); padding: var(--s-3) var(--s-4); border-radius: var(--r-1); font-weight: 600; }
.skip:focus { top: var(--s-3); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-5);
  border-radius: var(--r-2); border: 2px solid transparent;
  font: inherit; font-weight: 650; text-decoration: none; cursor: pointer;
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn--primary { background: var(--c-brand); color: var(--c-on-brand); border-color: var(--c-brand); }
.btn--primary:hover { background: #163d68; }
.btn--ghost { border-color: currentColor; color: inherit; }
.btn--ghost:hover { background: rgb(255 255 255 / 0.08); }
.btn--link { background: none; border: 0; padding: 0; min-height: 44px; color: var(--c-link); text-decoration: underline; text-underline-offset: 0.18em; }
.btn--lg { min-height: 52px; font-size: var(--t-lg); padding-inline: var(--s-6); }
@media (prefers-color-scheme: dark) {
  .btn--primary { background: #ffd60a; color: #1a1400; border-color: #ffd60a; }
  .btn--primary:hover { background: #ffe14d; }
}

/* ---------- Franja 112 ---------- */
.sos { background: var(--c-emergency); color: #fff; font-size: var(--t-sm); }
.sos__inner { display: flex; align-items: center; gap: var(--s-2); min-height: 40px; }
.sos p { margin: 0; }
.sos a { color: #fff; font-weight: 800; font-size: 1.1em; letter-spacing: 0.02em; }
@media (max-width: 30rem) { .sos__more { display: none; } }

/* ---------- Cabecera ---------- */
.site-header { background: var(--c-brand); color: #fff; }
.site-header__inner { display: flex; align-items: center; gap: var(--s-5); min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: var(--s-2); color: inherit; text-decoration: none; margin: 0; }
.brand__name { font-weight: 800; font-size: var(--t-lg); letter-spacing: 0.01em; }
.brand__tag { font-size: var(--t-xs); opacity: 0.85; border-inline-start: 1px solid rgb(255 255 255 / 0.35); padding-inline-start: var(--s-2); margin-inline-start: var(--s-1); }
.brand__mark { color: #ffd60a; }
.nav { margin-inline-start: auto; }
.nav ul { display: flex; gap: var(--s-1); }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-3); color: #fff; text-decoration: none; border-radius: var(--r-1); font-weight: 550; }
.nav a:hover { background: rgb(255 255 255 / 0.1); }
.nav a[aria-current='page'] { background: rgb(255 255 255 / 0.16); box-shadow: inset 0 -3px 0 #ffd60a; }
.header-cta { color: #fff; min-height: 40px; padding-inline: var(--s-4); }
.header-cta[aria-current='page'] { background: #fff; color: var(--c-brand); }
.site-header :focus-visible { outline-color: #ffd60a; }

@media (max-width: 62rem) {
  .brand__tag { display: none; }
  .site-header__inner { padding-block: var(--s-2); gap: var(--s-2) var(--s-4); }
  .nav { order: 3; width: 100%; margin: 0 calc(var(--gutter) * -1); width: calc(100% + var(--gutter) * 2); overflow-x: auto; scrollbar-width: none; }
  .nav ul { padding-inline: var(--gutter); }
  .nav a { white-space: nowrap; }
  .header-end { margin-inline-start: auto; }
}

.crumbs { padding-block: var(--s-3); font-size: var(--t-sm); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.crumbs li + li::before { content: '/'; margin-inline-end: var(--s-2); color: var(--c-text-3); }

/* ---------- Sala de situación (portada) ---------- */
.situation {
  --grid: rgb(140 184 255 / 0.07);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    radial-gradient(ellipse 80% 70% at 75% 30%, #13355e 0%, #0b1a2e 60%, #08111f 100%);
  color: #eef3f9;
  padding-block: var(--s-7) var(--s-8);
  border-bottom: 1px solid #1d3354;
}
.situation__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--s-7); align-items: start; }
@media (max-width: 58rem) { .situation__grid { grid-template-columns: 1fr; gap: var(--s-6); } }
.eyebrow { font-family: var(--font-mono); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.14em; color: #ffd60a; margin-bottom: var(--s-4); }
.situation h1 { font-size: clamp(2.3rem, 1.5rem + 3.4vw, 3.9rem); letter-spacing: -0.03em; max-width: 13ch; }
.situation .lede { color: #c3cfdd; font-size: var(--t-lg); max-width: 34ch; }
.situation a { color: #8cb8ff; }

.ask { margin-top: var(--s-6); background: rgb(255 255 255 / 0.04); border: 1px solid rgb(140 184 255 / 0.2); border-radius: var(--r-3); padding: var(--s-5); backdrop-filter: blur(4px); }
.ask label { display: block; font-weight: 650; margin-bottom: var(--s-2); }
.ask__row { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.ask select { flex: 1 1 14rem; }
.ask .btn--primary { background: #ffd60a; color: #1a1400; border-color: #ffd60a; }
.ask .btn--primary:hover { background: #ffe14d; }
.ask .btn--link { color: #8cb8ff; margin-top: var(--s-2); }
.ask .hint { font-size: var(--t-sm); color: #9fb0c4; margin: var(--s-1) 0 0; }
.situation :focus-visible { outline-color: #ffd60a; }

select, input[type='text'], input[type='email'] {
  min-height: 48px; padding: 0 var(--s-4); font: inherit;
  color: var(--c-text); background: var(--c-surface);
  border: 2px solid var(--c-line); border-radius: var(--r-2);
}
.situation select { color: #0d1b2a; background: #fff; border-color: #fff; }

/* Panel de estado */
.situation__board { background: rgb(8 17 31 / 0.65); border: 1px solid #1f3a60; border-radius: var(--r-3); padding: var(--s-5); box-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.7); }
.status { display: grid; gap: var(--s-2); padding-bottom: var(--s-5); margin-bottom: var(--s-5); border-bottom: 1px solid #1f3a60; }
.status__live { font-family: var(--font-mono); font-size: var(--t-xs); color: #9fb0c4; display: flex; align-items: center; gap: var(--s-2); margin: 0; text-transform: uppercase; letter-spacing: 0.08em; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: #5cc98a; box-shadow: 0 0 0 0 rgb(92 201 138 / 0.6); }
@media (prefers-reduced-motion: no-preference) { .pulse { animation: pulse 2s infinite; } }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgb(92 201 138 / 0); } 100% { box-shadow: 0 0 0 0 rgb(92 201 138 / 0); } }
.status__headline { font-size: var(--t-xl); font-weight: 750; margin: 0; letter-spacing: -0.01em; }
.status--red .status__headline { color: #ff6b81; }
.status--orange .status__headline { color: #ffa94d; }
.status--yellow .status__headline { color: #ffd60a; }
.status--none .status__headline { color: #5cc98a; }
.status__meaning { color: #c3cfdd; margin: 0; }
.status__counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); margin: var(--s-3) 0 0; }
.count { border-radius: var(--r-2); padding: var(--s-2) var(--s-3); background: #0f2038; }
.count dt::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 6px; background: currentColor; vertical-align: 1px; }
.count dt { font-size: var(--t-xs); color: #9fb0c4; text-transform: uppercase; letter-spacing: 0.08em; }
.count dd { margin: 0; font-family: var(--font-mono); font-size: var(--t-2xl); font-weight: 700; line-height: 1.1; }
.count--red dt::before { background: var(--sev-red-bg); }
.count--orange dt::before { background: var(--sev-orange-bg); }
.count--yellow dt::before { background: var(--sev-yellow-bg); }

/* Cartograma de provincias */
.cartogram { margin: 0; }
.cartogram__grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-template-rows: repeat(10, auto);
  gap: 4px;
}
.tile a {
  display: grid; place-items: center; aspect-ratio: 1;
  min-height: 28px; border-radius: 6px;
  font-family: var(--font-mono); font-size: clamp(0.62rem, 0.5rem + 0.45vw, 0.82rem); font-weight: 700;
  text-decoration: none; color: #9fb0c4; background: #12233c; border: 1px solid #1f3a60;
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.tile a:hover { transform: scale(1.12); position: relative; z-index: 1; }
.tile a:focus-visible { outline: 3px solid #fff; outline-offset: 1px; position: relative; z-index: 2; }
.tile--yellow a { background: var(--sev-yellow-bg); color: var(--sev-yellow-fg); border-color: var(--sev-yellow-bg); box-shadow: 0 0 14px -2px rgb(255 214 10 / 0.55); }
.tile--orange a { background: var(--sev-orange-bg); color: var(--sev-orange-fg); border-color: var(--sev-orange-bg); box-shadow: 0 0 16px -2px rgb(255 138 31 / 0.65); }
.tile--red a { background: var(--sev-red-bg); color: #fff; border-color: #ff6b81; box-shadow: 0 0 20px 0 rgb(200 16 46 / 0.75); }
.tile.is-selected a { outline: 3px solid #fff; outline-offset: 1px; }
@media (prefers-reduced-motion: no-preference) {
  .tile--red a { animation: glow 2.4s ease-in-out infinite; }
}
@keyframes glow { 50% { box-shadow: 0 0 6px 0 rgb(200 16 46 / 0.4); } }
.c0 { grid-column: 1; } .c1 { grid-column: 2; } .c2 { grid-column: 3; } .c3 { grid-column: 4; } .c4 { grid-column: 5; }
.c5 { grid-column: 6; } .c6 { grid-column: 7; } .c7 { grid-column: 8; } .c8 { grid-column: 9; } .c9 { grid-column: 10; }
.r0 { grid-row: 1; } .r1 { grid-row: 2; } .r2 { grid-row: 3; } .r3 { grid-row: 4; } .r4 { grid-row: 5; }
.r5 { grid-row: 6; } .r6 { grid-row: 7; } .r7 { grid-row: 8; } .r8 { grid-row: 9; } .r9 { grid-row: 10; }
.cartogram__legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); margin-top: var(--s-4); font-size: var(--t-xs); color: #c3cfdd; }
.cartogram__legend span { display: inline-flex; align-items: center; gap: var(--s-1); }
.cartogram__legend .muted { color: #9fb0c4; flex-basis: 100%; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw--red { background: var(--sev-red-bg); } .sw--orange { background: var(--sev-orange-bg); } .sw--yellow { background: var(--sev-yellow-bg); }
.sw--none { background: #12233c; border: 1px solid #3a5a85; }

/* ---------- Secciones ---------- */
.section { padding-block: var(--s-7) 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-4); }
.section__head h2 { margin: 0; }
.section__intro { color: var(--c-text-2); max-width: var(--w-text); }
.more { display: inline-flex; align-items: center; gap: var(--s-1); font-weight: 650; min-height: 44px; }
.page-head { padding-block: var(--s-6) var(--s-2); }
.page-head .lede, .lede { font-size: var(--t-lg); color: var(--c-text-2); max-width: 46ch; }
.note { font-size: var(--t-sm); color: var(--c-text-3); max-width: var(--w-text); margin-top: var(--s-4); }

/* ---------- Etiquetas de nivel ---------- */
.badge { display: inline-flex; align-items: center; gap: 0.4em; font-weight: 700; border-radius: var(--r-pill); white-space: nowrap; line-height: 1; }
.badge--md { font-size: var(--t-sm); padding: 0.45em 0.8em; }
.badge--sm { font-size: var(--t-xs); padding: 0.4em 0.65em; }
.badge__dot { width: 0.55em; height: 0.55em; border-radius: 50%; background: currentColor; }
.badge--info { background: var(--sev-info-bg); color: var(--sev-info-fg); }
.badge--yellow { background: var(--sev-yellow-bg); color: var(--sev-yellow-fg); }
.badge--orange { background: var(--sev-orange-bg); color: var(--sev-orange-fg); }
.badge--red { background: var(--sev-red-bg); color: var(--sev-red-fg); }
.tag { font-size: var(--t-xs); font-weight: 700; padding: 0.3em 0.55em; border-radius: var(--r-1); border: 1px solid; }
.tag--warn { color: var(--c-warn-text); border-color: currentColor; }

/* ---------- Tarjetas de aviso ---------- */
.alert-list { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.alert {
  display: grid; grid-template-columns: auto 1fr; gap: var(--s-3);
  height: 100%; padding: var(--s-4);
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--r-2); box-shadow: var(--shadow-1);
  position: relative;
  transition: box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.alert:hover { box-shadow: var(--shadow-2); }
.alert:focus-within { box-shadow: var(--shadow-2); }
.alert--yellow .alert__icon { background: var(--sev-yellow-bg); color: var(--sev-yellow-fg); }
.alert--orange .alert__icon { background: var(--sev-orange-bg); color: var(--sev-orange-fg); }
.alert--red .alert__icon { background: var(--sev-red-bg); color: #fff; }
.alert--red { border-color: var(--sev-red-edge); background: linear-gradient(90deg, rgb(200 16 46 / 0.07), transparent 40%), var(--c-surface); }
.alert__icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-2); background: var(--c-surface-2); color: var(--c-text-2); }
.alert__body { min-width: 0; }
.alert__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); font-size: var(--t-xs); color: var(--c-text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--s-2); }
.alert__title { font-size: var(--t-lg); margin-bottom: var(--s-1); }
.alert__link { color: var(--c-text); text-decoration: none; }
.alert__link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.alert__link:hover { text-decoration: underline; }
.alert__link:focus-visible { outline: none; }
.alert__link:focus-visible::after { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.alert__area { display: flex; gap: var(--s-1); color: var(--c-text-2); font-weight: 550; margin-bottom: var(--s-2); }
.alert__area .icon { margin-top: 0.2em; color: var(--c-text-3); }
.alert__summary { color: var(--c-text-2); font-size: var(--t-sm); }
.alert__action { font-size: var(--t-sm); background: var(--c-surface-2); border-radius: var(--r-1); padding: var(--s-2) var(--s-3); }
.alert__foot { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); font-size: var(--t-xs); color: var(--c-text-3); margin: 0; }

.empty { display: flex; gap: var(--s-4); align-items: center; padding: var(--s-5); border: 1px dashed var(--c-line); border-radius: var(--r-2); background: var(--c-surface); color: var(--c-text-2); }
.empty .icon { color: var(--c-ok); }
.empty__title { font-weight: 700; color: var(--c-text); margin-bottom: var(--s-1); }
.empty p:last-child { margin: 0; }

.notice { border-radius: var(--r-2); padding: var(--s-4) var(--s-5); margin-bottom: var(--s-4); border: 1px solid; }
.notice p:last-child { margin: 0; }
.notice--error { border-color: var(--c-emergency); background: rgb(200 16 46 / 0.06); }
.notice--model { border-color: var(--c-warn-text); background: rgb(255 138 31 / 0.08); }

.live.is-updated { animation: flash 1.2s var(--ease); }
@keyframes flash { from { background: rgb(255 214 10 / 0.18); } to { background: transparent; } }

/* ---------- Riesgos ---------- */
.hazards { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.hazard {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: 'icon title go' 'icon state go' 'icon world go';
  column-gap: var(--s-3); row-gap: var(--s-1); align-items: center;
  padding: var(--s-4); height: 100%;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-2);
  color: var(--c-text); text-decoration: none; box-shadow: var(--shadow-1);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.hazard:hover { border-color: var(--c-link); box-shadow: var(--shadow-2); }
.hazard__icon { grid-area: icon; width: 52px; height: 52px; border-radius: var(--r-2); display: grid; place-items: center; background: var(--c-surface-2); align-self: start; }
.hazard--yellow .hazard__icon { background: var(--sev-yellow-bg); color: var(--sev-yellow-fg); }
.hazard--orange .hazard__icon { background: var(--sev-orange-bg); color: var(--sev-orange-fg); }
.hazard--red .hazard__icon { background: var(--sev-red-bg); color: #fff; }
.hazard__title { grid-area: title; font-weight: 700; font-size: var(--t-lg); line-height: var(--lh-snug); }
.hazard__state { grid-area: state; font-size: var(--t-sm); color: var(--c-text-2); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.hazard__world { grid-area: world; font-size: var(--t-xs); color: var(--c-text-3); }
.hazard__go { grid-area: go; color: var(--c-text-3); transition: transform var(--dur-1) var(--ease); }
.hazard:hover .hazard__go { transform: translateX(3px); color: var(--c-link); }

/* ---------- Prepárate ---------- */
.prepare { margin-top: var(--s-8); background: var(--c-brand); color: #fff; padding-block: var(--s-7); }
.prepare__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); flex-wrap: wrap; }
.prepare h2 { max-width: 22ch; }
.prepare p { color: #c3cfdd; max-width: 50ch; margin: 0; }
.prepare .btn--primary { background: #ffd60a; color: #1a1400; border-color: #ffd60a; }
.prepare :focus-visible { outline-color: #ffd60a; }

/* ---------- Avisos: filtros ---------- */
.layout-side { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: var(--s-6); align-items: start; padding-top: var(--s-4); }
@media (max-width: 52rem) { .layout-side { grid-template-columns: 1fr; } }
.filters { display: grid; gap: var(--s-4); padding: var(--s-5); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-2); position: sticky; top: calc(var(--topbar-h, 0px) + var(--s-4)); }
@media (max-width: 52rem) { .filters { position: static; } }
.field { display: grid; gap: var(--s-1); border: 0; padding: 0; margin: 0; }
.field label, .field legend { font-weight: 650; font-size: var(--t-sm); }
.field select { width: 100%; }
.radio { display: flex; align-items: center; gap: var(--s-2); min-height: 36px; font-weight: 450 !important; font-size: var(--t-base) !important; cursor: pointer; }
.radio input { width: 20px; height: 20px; accent-color: var(--c-brand); }
.layout-side .alert-list { grid-template-columns: 1fr; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--c-line); border-radius: var(--r-2); background: var(--c-surface); }
table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
th, td { text-align: left; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--c-line); vertical-align: middle; }
thead th { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-text-3); background: var(--c-surface-2); white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
.num { text-align: right; font-family: var(--font-mono); white-space: nowrap; }
.num .muted { display: block; font-family: var(--font-sans); font-size: var(--t-xs); }
.rivers th[scope='row'] { font-weight: 400; }
.rivers th[scope='row'] .muted { display: block; font-size: var(--t-xs); }
.river { display: block; font-weight: 700; font-size: var(--t-base); }
.river__saih { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; font-size: var(--t-xs); font-weight: 600; color: var(--c-link); }
.river__saih .icon { flex: none; }
.zone-rivers .river__saih { display: flex; width: max-content; }
.spark { display: block; overflow: visible; }
.spark__past, .spark__fcst { fill: none; stroke: var(--c-link); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark__fcst { stroke-dasharray: 4 3; stroke: var(--sev-orange-edge); }
.spark__base { stroke: var(--c-text-3); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0.7; }
.spark__today { stroke: var(--c-line); stroke-width: 1; }

/* ---------- Mapa ---------- */
.map { height: clamp(320px, 55vh, 520px); border-radius: var(--r-2); border: 1px solid var(--c-line); background: var(--c-surface-2); overflow: hidden; display: grid; place-items: center; position: relative; }
.map__fallback, .map__empty { color: var(--c-text-3); padding: var(--s-4); text-align: center; }
.map__empty { position: absolute; z-index: 500; bottom: var(--s-3); left: 50%; transform: translateX(-50%); background: var(--c-surface); border-radius: var(--r-1); margin: 0; }
.leaflet-container { width: 100%; height: 100%; font: inherit; }

/* ---------- Guías ---------- */
.steps { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); margin-bottom: var(--s-4); }
.step { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-2); padding: var(--s-4) var(--s-5); }
.step h3 { font-size: var(--t-sm); text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-text-3); }
.step ul { margin: 0; padding-inline-start: 1.1em; }
.step li { margin-bottom: var(--s-2); }
.step li:last-child { margin-bottom: 0; }
.guide { padding-top: var(--s-6); }
.guide h2 { display: flex; align-items: center; gap: var(--s-3); }
.guide__icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: var(--r-2); background: var(--c-surface-2); }
.prose { max-width: 50rem; }
.prose--wide { max-width: var(--w-page); }
.prose section { margin-bottom: var(--s-6); }
.prose ul li { margin-bottom: var(--s-2); }
/* Bajo la zona superior fija (franja del 112 y cabecera): si no, la tapa al hacer scroll. */
.toc { position: sticky; top: calc(var(--topbar-h, 0px) + var(--s-4)); max-height: calc(100vh - var(--topbar-h, 0px) - 2 * var(--s-4)); overflow-y: auto; overscroll-behavior: contain; font-size: var(--t-sm); }
@media (max-width: 52rem) { .toc { position: static; } }
.toc__title { font-weight: 700; text-transform: uppercase; font-size: var(--t-xs); letter-spacing: 0.08em; color: var(--c-text-3); }
.toc a { display: block; padding: var(--s-1) 0; }
.levels { display: grid; gap: var(--s-2); }
.level { display: grid; grid-template-columns: 9rem 1fr; gap: var(--s-4); align-items: center; padding: var(--s-3) var(--s-4); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-2); }
.level p { margin: 0; }
@media (max-width: 30rem) { .level { grid-template-columns: 1fr; gap: var(--s-2); } }
.checklist { display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.checklist li { display: flex; gap: var(--s-2); align-items: flex-start; }
.checklist .icon { color: var(--c-ok); margin-top: 0.15em; }
.links { display: grid; gap: var(--s-1) var(--s-5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.links a { display: inline-flex; align-items: center; gap: var(--s-1); min-height: 40px; }

/* ---------- Pie ---------- */
.site-footer { margin-top: var(--s-8); background: var(--c-surface); border-top: 1px solid var(--c-line); padding-block: var(--s-7); font-size: var(--t-sm); }
.prepare + .site-footer, main:has(> .prepare:last-child) + .site-footer { margin-top: 0; }
.site-footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: var(--s-6); }
@media (max-width: 52rem) { .site-footer__grid { grid-template-columns: 1fr; } }
.site-footer ul li a { display: inline-block; padding-block: var(--s-1); }
.site-footer__credit { margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--c-line); font-size: var(--t-xs, 0.8125rem); }
.brand--footer { color: var(--c-text); }
.brand--footer .brand__mark { color: var(--c-brand); }
@media (prefers-color-scheme: dark) { .brand--footer .brand__mark { color: #ffd60a; } }
.big-112 { font-family: var(--font-mono); font-size: 2.6rem; font-weight: 800; color: var(--c-emergency); text-decoration: none; line-height: 1; }
@media (prefers-color-scheme: dark) { .big-112 { color: #ff6b81; } }

/* ---------- Portada de cristal ---------- */
/* Solo escritorio con ratón: en móvil la portada empieza directamente en la sala de situación. */
.glass-hero { display: none; }
@media (min-width: 900px) and (pointer: fine) {
  .has-glass .site-header { display: none; }
  .glass-hero {
    display: block; position: relative; isolation: isolate; overflow: hidden;
    height: calc(100svh - 40px); min-height: 600px; max-height: 1300px;
    background: #050507; color: #fff;
  }
}
.gh-static { position: absolute; inset: 0; padding: 8.5vh 5.5vw; }
.gh-block { height: 100%; display: flex; flex-direction: column; gap: 14px; }
.gh-nav, .gh-panel {
  border-radius: 18px;
  background:
    linear-gradient(115deg, rgb(120 255 190 / 0.05), transparent 30%, rgb(170 140 255 / 0.06) 70%, transparent),
    linear-gradient(160deg, #24242a, #141418 55%, #1b1b21);
  border: 1px solid rgb(255 255 255 / 0.13);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.2), 0 40px 90px -30px rgb(0 0 0 / 0.9);
}
.gh-nav { flex: 0 0 10.8%; display: flex; align-items: center; gap: var(--s-5); padding: 0 2vw; min-height: 64px; }
.gh-nav nav { margin-inline: auto; }
.gh-nav ul { display: flex; gap: 2vw; }
.gh-nav a { color: rgb(255 255 255 / 0.66); text-decoration: none; font-weight: 500; }
.gh-nav a:hover, .gh-nav .gh-brand, .gh-nav .gh-right { color: #fff; }
.gh-brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 650; font-size: 1.15rem; }
.gh-mark { width: 24px; height: 24px; border-radius: 5px; background: #ffd60a; }
.gh-panel { flex: 1; position: relative; padding: 13.5vh 4vw 0; }
.gh-eyebrow { font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgb(255 255 255 / 0.56); font-weight: 500; }
.gh-title {
  font-size: clamp(3.5rem, 6.9vw, 9.5rem); font-weight: 500; letter-spacing: -0.045em; line-height: 0.97; margin: 4vh 0 5vh;
  background: linear-gradient(#dcdce0, #bdbdc3); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.gh-sub { color: rgb(255 255 255 / 0.6); font-size: 1.1rem; max-width: none; }
.gh-actions { display: flex; align-items: center; gap: 28px; margin-top: 4vh; }
.gh-btn { display: inline-flex; align-items: center; min-height: 46px; padding: 0 24px; border-radius: 6px; background: #ececf0; color: #121216; font-weight: 600; text-decoration: none; transition: background var(--dur-1) var(--ease); }
.gh-btn:hover { background: #ffd60a; }
.gh-more { color: rgb(255 255 255 / 0.9); text-decoration: none; font-weight: 500; }
.gh-more:hover { text-decoration: underline; }
.gh-foot { position: absolute; left: 4vw; right: 4vw; bottom: 22px; display: flex; justify-content: space-between; font-size: 0.8rem; color: rgb(255 255 255 / 0.56); margin: 0; }
.gh-foot span { display: inline-flex; align-items: center; gap: 8px; }
.gh-dot { width: 8px; height: 8px; border-radius: 50%; background: #5cc98a; }
.gh-dot--yellow { background: #ffd60a; } .gh-dot--orange { background: #ff8a1f; } .gh-dot--red { background: #ff4d64; }
.glass-hero :focus-visible { outline: 3px solid #ffd60a; outline-offset: 3px; }

/* Escena 3D */
.glass-hero.is-3d .gh-static { display: none; }
.gh-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.gh-layer { position: absolute; left: 0; top: 0; z-index: 2; transform-origin: 0 0; font-family: InterGlass, var(--font-sans); transition: opacity 200ms linear; }
.gh-layer.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.gh-t { position: absolute; margin: 0; padding: 0; border: 0; background: none; color: transparent; white-space: nowrap; text-decoration: none; font: inherit; cursor: text; }
.gh-layer .gh-t { font-family: InterGlass, var(--font-sans); }
.gh-w5 { font-weight: 500; } .gh-w6 { font-weight: 600; }
a.gh-t, button.gh-t { cursor: pointer; }
.gh-t::selection { background: rgb(70 130 255 / 0.45); color: transparent; }
.gh-pill { border-radius: 6px; }

/* Vista "cinco claves" */
.gh-defs { position: absolute; inset: 0; z-index: 3; opacity: 0; transition: opacity 400ms linear; font-family: InterGlass, var(--font-sans); }
.gh-defs.is-in { opacity: 1; }
.gh-defs:not(.is-in) { transition-duration: 250ms; }
.gh-defs__col { position: absolute; left: 32.4%; width: 33.9%; top: calc(35.9% - max(1.36vw, 24px)); }
.gh-defs__title { font-size: max(1.36vw, 24px); font-weight: 650; letter-spacing: -0.022em; color: #fff; margin-bottom: max(1.05vw, 16px); }
.gh-defs p { font-size: max(0.73vw, 15px); line-height: 1.72; color: rgb(255 255 255 / 0.62); margin: 0 0 max(1.05vw, 14px); }
.gh-defs strong { color: #fff; font-weight: 600; }
.gh-defs a { color: #b9abff; }
.gh-back {
  position: absolute; left: 21.9%; top: 23.8%; transform: translate(-50%, -50%);
  background: none; border: 0; padding: 12px 16px; cursor: pointer;
  font: 500 max(0.66vw, 14px) / 1 InterGlass, var(--font-sans); color: #fff; transition: color var(--dur-1) var(--ease);
}
.gh-back:hover, .gh-back:focus-visible { color: #b9abff; }

/* ==========================================================
 * Monitor de avisos (portada). Fuente: docs/diseno/monitor.css
 * ========================================================== */
.monitor { position: fixed; inset: 0; overflow: hidden; background: var(--c-bg); color: var(--c-text); font-family: var(--font-sans); }
.monitor__map { position: absolute; inset: 0; }

.monitor__panel {
  position: absolute; top: var(--s-4); inset-inline-start: var(--s-4); bottom: var(--s-4); width: 400px; z-index: 500;
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: var(--s-5) var(--s-4) var(--s-3); overflow-y: auto; overscroll-behavior: contain;
  background: color-mix(in srgb, var(--c-surface) 95%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--c-line); border-radius: var(--r-3); box-shadow: var(--shadow-2);
}
.monitor__panel > * { flex-shrink: 0; }
.monitor__handle { display: none; }

@media (max-width: 760px) {
  .monitor__panel {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 34vh;
    border-radius: var(--r-3) var(--r-3) 0 0;
    padding: var(--s-1) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom));
    transition: max-height var(--dur-2) var(--ease);
  }
  .monitor__panel[data-open] { max-height: 82vh; }
  .monitor__handle { display: grid; place-items: center; background: none; border: 0; padding: var(--s-2) 0 var(--s-1); cursor: pointer; }
  .monitor__handle span { width: 42px; height: 5px; border-radius: 3px; background: var(--c-line); }
}

/* Cabecera */
.mon-brand { display: flex; align-items: center; gap: var(--s-2); }
.mon-brand h1 { margin: 0; font-size: var(--t-lg); font-weight: 700; letter-spacing: -0.01em; }
.mon-tagline { margin: var(--s-1) 0 0; font-size: var(--t-xs); color: var(--c-text-3); }
.mon-live { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; font: var(--t-xs) var(--font-mono); color: var(--c-text-3); }
.mon-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--c-text-3); }
.mon-live[data-state="live"] i { background: var(--c-ok); animation: mon-pulse 2s infinite; }
.mon-live[data-state="offline"] i { background: var(--c-emergency); }
@keyframes mon-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-ok) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }
@media (prefers-reduced-motion: reduce) { .mon-live i { animation: none !important; } }

/* Recuento */
.mon-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; }
.mon-count { padding: var(--s-2) var(--s-2) 6px; border-radius: var(--r-2); background: var(--c-surface-2); border-top: 3px solid var(--edge); }
.mon-count b { display: block; font: 500 var(--t-xl)/1.1 var(--font-mono); font-variant-numeric: tabular-nums; }
.mon-count span { font-size: var(--t-xs); color: var(--c-text-3); }

/* Color por nivel: --edge (borde) y --tint (fondo suave) */
.lvl-red { --edge: var(--sev-red-edge); --tint: var(--sev-red-bg); }
.lvl-orange { --edge: var(--sev-orange-edge); --tint: var(--sev-orange-bg); }
.lvl-yellow { --edge: var(--sev-yellow-edge); --tint: var(--sev-yellow-bg); }
.lvl-info { --edge: var(--sev-info-edge); --tint: var(--sev-info-edge); }

/* Acción principal */
.mon-locate {
  display: flex; align-items: center; justify-content: center; gap: var(--s-2); width: 100%;
  min-height: 44px; padding: var(--s-3) var(--s-4); border: 0; border-radius: var(--r-2); cursor: pointer;
  font: 600 var(--t-sm) var(--font-sans); background: var(--c-brand); color: var(--c-on-brand);
}
@media (prefers-color-scheme: dark) { .mon-locate { background: var(--c-link); color: #0a1220; } }
.mon-locate:hover { filter: brightness(1.08); }
.mon-locate:focus-visible, .mon-chip:focus-visible, .mon-row:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }

/* Filtros */
.mon-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mon-chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 5px 10px;
  border: 1px solid var(--c-line); border-radius: var(--r-pill); background: transparent;
  font: var(--t-xs) var(--font-sans); color: var(--c-text-2); cursor: pointer;
}
.mon-chip[aria-pressed="true"] { background: var(--c-text); color: var(--c-surface); border-color: var(--c-text); }
.mon-chip svg { width: 15px; height: 15px; }
.mon-seg { display: grid; grid-template-columns: repeat(4, 1fr); padding: 3px; border-radius: var(--r-2); background: var(--c-surface-2); }
.mon-seg button { border: 0; background: transparent; padding: 6px 4px; border-radius: 8px; font: var(--t-xs) var(--font-sans); color: var(--c-text-3); cursor: pointer; min-height: 32px; }
.mon-seg button[aria-checked="true"] { background: var(--c-surface); color: var(--c-text); font-weight: 600; box-shadow: var(--shadow-1); }

/* Lista */
.mon-list-head { display: flex; justify-content: space-between; font-size: var(--t-xs); font-weight: 600; }
.mon-list-head time { font-family: var(--font-mono); color: var(--c-text-3); font-weight: 400; }
.mon-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.mon-row {
  display: flex; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; cursor: pointer;
  border: 0; border-inline-start: 3px solid var(--edge); border-radius: 8px; background: transparent; color: inherit; font: inherit;
}
.mon-row:hover { background: var(--c-surface-2); }
.mon-ico { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--edge); background: color-mix(in srgb, var(--tint) 14%, transparent); }
.mon-ico svg { width: 18px; height: 18px; }
.mon-row__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mon-row__title { font-weight: 500; font-size: var(--t-sm); line-height: var(--lh-snug); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mon-row__meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: var(--t-xs); color: var(--c-text-3); }
.mon-row__meta .num { font-family: var(--font-mono); }
.mon-level { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-text); }
.mon-level::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-inline-end: 5px; background: var(--tint); vertical-align: 0; }
.mon-stale { color: var(--c-warn-text); }

/* Tarjeta de punto */
.mon-point { border: 1px solid var(--c-line); border-top: 3px solid var(--edge, var(--c-ok)); border-radius: var(--r-2); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.mon-point p { margin: 0; }
.mon-point__ind { border-top: 1px dashed var(--c-line); padding-top: var(--s-2); font-size: var(--t-xs); }

/* Detalle */
.mon-detail { display: flex; flex-direction: column; gap: var(--s-3); }
.mon-back { background: none; border: 0; padding: 0; color: var(--c-link); cursor: pointer; text-align: left; font: var(--t-xs) var(--font-sans); }
.mon-detail h2 { margin: 4px 0 2px; font-size: var(--t-lg); line-height: var(--lh-snug); }
.mon-todo { border-inline-start: 3px solid var(--edge); background: color-mix(in srgb, var(--tint) 14%, transparent); padding: 10px 12px; border-radius: 8px; }
.mon-facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2) var(--s-3); }
.mon-facts dt { font-size: var(--t-xs); color: var(--c-text-3); }
.mon-facts dd { margin: 0; font: var(--t-sm) var(--font-mono); }
.mon-official { display: block; text-align: center; padding: 10px 12px; border: 1px solid var(--c-line); border-radius: var(--r-2); font-weight: 600; text-decoration: none; color: var(--c-link); }

/* Pie */
.mon-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--c-line); font-size: var(--t-xs); color: var(--c-text-3); }
.mon-foot strong { color: var(--c-text); }
.mon-foot nav { display: flex; gap: var(--s-4); margin-top: var(--s-2); }

/* Marcadores Leaflet (L.circleMarker usa SVG: se colorean con className) */
.mk { stroke: rgb(10 18 32 / 0.85); stroke-width: 1.2; fill-opacity: 1; }
.mk--red { fill: var(--sev-red-bg); } .mk--orange { fill: var(--sev-orange-bg); } .mk--yellow { fill: var(--sev-yellow-bg); } .mk--info { fill: var(--sev-info-edge); }
.mk--selected { stroke: #fff; stroke-width: 3; }
.mk-halo { stroke: none; fill-opacity: 0.18; filter: blur(3px); }

/* --- Integración en apps/web --- */
body:has(.monitor) { overflow: hidden; }
.is-bare .monitor { position: fixed; inset: var(--topbar-h, 104px) 0 0 0; }
@media (max-width: 760px) { .is-bare .monitor { top: var(--topbar-h, 148px); } }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.mon-brand .ico { color: var(--c-text); }
.mon-brand h1 { font-size: var(--t-lg); }
.monitor__panel header p { margin-bottom: 0; }
.monitor__panel p { max-width: none; }
.mon-live[data-live-state="live"] i { background: var(--c-ok); animation: mon-pulse 2s infinite; }
.mon-live[data-live-state="connecting"] i { background: var(--sev-yellow-edge); }
.mon-live[data-live-state="offline"] i { background: var(--c-emergency); }
@media (prefers-reduced-motion: reduce) { .mon-live[data-live-state] i { animation: none; } }
.lvl-none { --edge: var(--c-ok); --tint: var(--c-ok); }

a.mon-chip, .mon-seg a, a.mon-row { text-decoration: none; }
.mon-seg a { display: grid; place-items: center; border: 0; background: transparent; padding: 6px 4px; border-radius: 8px; font-size: var(--t-xs); color: var(--c-text-3); min-height: 32px; text-align: center; }
.mon-seg a[aria-checked="true"] { background: var(--c-surface); color: var(--c-text); font-weight: 600; box-shadow: var(--shadow-1); }
.mon-seg a:focus-visible, .mon-back:focus-visible, .mon-official:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
a.mon-row { color: inherit; }
.mon-row[aria-current="true"] { background: var(--c-surface-2); }
.mon-row__title { color: var(--c-text); }
.mon-list-head .num { font-family: var(--font-mono); color: var(--c-text-3); font-weight: 400; }
.mon-empty { font-size: var(--t-sm); color: var(--c-text-3); margin: 0; padding: var(--s-2) 0; }
.mon-error { font-size: var(--t-sm); color: var(--c-emergency); font-weight: 600; margin: 0; }
.mon-point--error { --edge: var(--c-emergency); }
.mon-point .mon-list { margin-top: var(--s-1); }
.mon-detail p { margin: 0; }
.mon-detail__head { display: flex; gap: var(--s-3); }
.mon-ico--lg { width: 44px; height: 44px; }
.mon-todo p { margin: 4px 0 0; }
.mon-foot p { margin: 0; }
.mon-foot nav { flex-wrap: wrap; gap: var(--s-1) var(--s-4); }
.mon-foot a { color: var(--c-link); }
.mon-locate[aria-busy="true"] { opacity: 0.75; cursor: progress; }
.mon-detail:focus { outline: none; }

/* Mapa */
.monitor__map .leaflet-container, .monitor__map.leaflet-container { width: 100%; height: 100%; background: var(--c-surface-2); font: inherit; }
.monitor .leaflet-left .leaflet-control-zoom { display: none; }
.mk-me { fill: var(--c-link); stroke: #fff; stroke-width: 3; }
.mk-me-ring { fill: var(--c-link); fill-opacity: 0.15; stroke: var(--c-link); stroke-width: 1; stroke-opacity: 0.5; }
.leaflet-popup-content { font: var(--t-sm) / 1.4 var(--font-sans); }
@media (max-width: 760px) {
  .monitor .leaflet-top .leaflet-control-attribution { margin: 8px 0 0 8px; padding: 2px 6px; max-width: calc(100vw - 190px); border-radius: 6px; background: rgb(3 6 13 / 0.45); color: rgb(255 255 255 / 0.75); font-size: 0.625rem; line-height: 1.4; }
  .monitor .leaflet-top .leaflet-control-attribution a { color: rgb(255 255 255 / 0.9); }
  .monitor .leaflet-top .leaflet-control-attribution svg { display: none !important; }
  [dir="rtl"] .monitor .leaflet-top .leaflet-control-attribution { margin: 8px 8px 0 0; }
  .monitor .leaflet-bottom.leaflet-right { bottom: 34vh; }
  .monitor__panel[data-open] ~ .leaflet-bottom { bottom: 82vh; }
}
.is-tileless { background-color: var(--c-surface-2); background-image: linear-gradient(var(--c-line) 1px, transparent 1px), linear-gradient(90deg, var(--c-line) 1px, transparent 1px); background-size: 48px 48px; }
.is-bare main { display: block; }

/* Mapa base propio (Natural Earth): mar = superficie 2, tierra = superficie, fronteras = línea */
.leaflet-container { background: var(--c-map-sea, var(--c-surface-2)); }
.land { fill: var(--c-surface); fill-opacity: 1; stroke: var(--c-line); stroke-width: 0.8; }
@media (prefers-color-scheme: dark) { .osm-tiles { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9); } }
.mon-tagline { text-wrap: wrap; }
.mon-detail { font-size: var(--t-sm); }
.mon-detail h2 { font-size: var(--t-lg); }
.mon-official { font-size: var(--t-sm); }
.leaflet-tooltip { font: 500 var(--t-xs) / 1.3 var(--font-sans); max-width: 260px; white-space: normal; }
.monitor .leaflet-bar { border: 1px solid var(--c-line); box-shadow: var(--shadow-1); border-radius: var(--r-2); overflow: hidden; }
.monitor .leaflet-bar a { background: var(--c-surface); color: var(--c-text); border-bottom-color: var(--c-line); width: 36px; height: 36px; line-height: 36px; }
.monitor .leaflet-bar a:hover { background: var(--c-surface-2); }
.monitor .leaflet-control-attribution { background: color-mix(in srgb, var(--c-surface) 85%, transparent); color: var(--c-text-3); font-size: 0.6875rem; }
.monitor .leaflet-control-attribution a { color: var(--c-link); }

/* ==========================================================
 * Landing (portada). Fuente: docs/diseno/landing.html
 * El hero es siempre azul atalaya; el resto sigue el tema.
 * ========================================================== */
.ld { background: var(--c-bg); color: var(--c-text); }
.ld h2 { font-size: clamp(1.875rem, 1rem + 2.4vw, 2.5rem); line-height: 1.15; letter-spacing: -0.015em; margin: 8px 0 0; }
.ld h3 { margin: 0; }
.ld p { max-width: none; }
.ld-eyebrow { margin: 0; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-text-3); }
.ld-intro { margin: 14px 0 0; max-width: 44rem; color: var(--c-text-2); }
.ld .ld-intro { max-width: 44rem; }
.ld-mono { font: 0.75rem var(--font-mono); }
.ld a:focus-visible, .ld button:focus-visible, .ld select:focus-visible, .ld pre:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }

/* Hero */
.ld-hero { position: relative; overflow: hidden; background: #0d2b4e; color: #eef3f9; }
.ld-hero a:focus-visible, .ld-hero button:focus-visible, .ld-hero select:focus-visible { outline-color: #8cb8ff; }
.ld-facets { position: absolute; inset: 0; pointer-events: none; }
.ld-facets i { position: absolute; background: rgb(255 255 255 / 0.05); }
.ld-facets i:nth-child(1) { right: -6%; top: -20%; width: 62%; height: 140%; clip-path: polygon(38% 0, 100% 0, 100% 100%, 0 72%); }
.ld-facets i:nth-child(2) { right: 8%; top: 10%; width: 40%; height: 90%; background: rgb(140 184 255 / 0.05); clip-path: polygon(50% 0, 100% 38%, 72% 100%, 0 64%); }
.ld-facets i:nth-child(3) { right: 26%; top: 46%; width: 22%; height: 60%; clip-path: polygon(0 20%, 100% 0, 60% 100%); }
.ld-facets::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: rgb(195 207 221 / 0.25); }

.ld-nav { position: relative; max-width: 1200px; margin: 0 auto; padding: 20px 24px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.ld-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.3125rem; letter-spacing: -0.01em; }
.ld-brand .ld-flame { fill: #ff8a1f; stroke: none; }
.ld-nav__links { display: flex; gap: 22px; flex-wrap: wrap; margin-inline-start: auto; align-items: center; font-size: 0.9375rem; }
.ld-nav__links a { color: #c3cfdd; text-decoration: none; }
.ld-nav__links a:hover { color: #fff; text-decoration: underline; }
.ld-nav__links a.ld-nav__cta { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; background: #fff; color: #0d2b4e; font-weight: 600; text-decoration: none; }

.ld-hero__grid { position: relative; max-width: 1200px; margin: 0 auto; padding: 56px 24px 88px; display: flex; flex-wrap: wrap; gap: 56px; align-items: center; }
.ld-hero__copy { flex: 1 1 520px; min-width: 0; }
.ld-chip { margin: 0 0 18px; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid rgb(195 207 221 / 0.35); border-radius: 999px; font-size: 0.8125rem; color: #c3cfdd; }
.ld-chip span { width: 8px; height: 8px; border-radius: 50%; background: #5cc98a; }
.ld-hero h1 { margin: 0; font-size: clamp(2.5rem, 5.4vw, 4.25rem); line-height: 1.04; letter-spacing: -0.025em; font-weight: 750; color: #fff; max-width: none; text-wrap: initial; }
.ld .ld-lede { margin: 22px 0 0; max-width: 34rem; font-size: 1.1875rem; color: #c3cfdd; }
.ld-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ld-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 24px; border-radius: 12px; background: #fff; color: #0d2b4e; font-weight: 650; font-size: 1.0625rem; text-decoration: none; }
.ld-btn:hover { background: #e6eef8; color: #0d2b4e; }
.ld-prov { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 6px 6px 18px; border-radius: 12px; border: 1px solid rgb(195 207 221 / 0.45); color: #eef3f9; font-size: 0.9375rem; flex-wrap: wrap; }
.ld-prov label { margin: 0; font-weight: 400; color: inherit; font-size: inherit; }
.ld-prov select { min-height: 40px; max-width: 13rem; border-radius: 8px; border: 0; padding: 0 10px; font: inherit; color: #0d1b2a; background: #eef3f9; }
.ld-prov button { min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid rgb(195 207 221 / 0.45); background: transparent; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.ld-prov button:hover { background: rgb(255 255 255 / 0.08); }
.ld-note { margin: 18px 0 0; font-size: 0.8125rem; color: #9fb0c4; }
.ld-note a { color: #fff; }

/* Tarjeta de estado */
.ld-status { flex: 1 1 380px; min-width: 0; max-width: 460px; background: rgb(17 28 46 / 0.72); border: 1px solid rgb(195 207 221 / 0.22); border-radius: 18px; padding: 22px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.ld-status__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ld .ld-status h2 { margin: 0; font-size: 1rem; color: #fff; letter-spacing: 0; }
.ld-status__head .ld-mono { color: #9fb0c4; }
.ld-counts { margin: 16px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ld-count { border-radius: 10px; padding: 10px; background: rgb(255 255 255 / 0.06); box-shadow: inset 0 3px 0 var(--edge); }
.ld-count b { display: block; font: 500 1.625rem/1.1 var(--font-mono); color: #fff; font-variant-numeric: tabular-nums; }
.ld-count span { font-size: 0.8125rem; color: #c3cfdd; }
.ld-top { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ld-top a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: rgb(255 255 255 / 0.05); color: #eef3f9; text-decoration: none; font-size: 0.875rem; }
.ld-top a:hover { background: rgb(255 255 255 / 0.1); }
.ld-top__t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-pill { flex: none; padding: 2px 8px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; }
.ld .sev-red { background: #c8102e; color: #fff; }
.ld .sev-orange { background: #ff8a1f; color: #1f0e00; }
.ld .sev-yellow { background: #ffd60a; color: #1a1400; }
.ld-calm { margin: 16px 0 0; color: #c3cfdd; font-size: 0.875rem; }
.ld-status__more { margin-top: 14px; display: inline-block; color: #8cb8ff; font-size: 0.875rem; font-weight: 600; }
.ld-status__more:hover { color: #fff; }

/* Secciones */
.ld-sec { max-width: 1200px; margin: 0 auto; padding: 72px 24px 24px; }
.ld-sec:first-child { padding-top: 88px; }
.ld-risks { margin-top: 36px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.ld-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 16px; padding: 20px; }
.ld-card .ico { color: var(--c-text); }
.ld-card h3 { margin: 12px 0 4px; font-size: 1.125rem; }
.ld-card p { margin: 0; font-size: 0.9375rem; color: var(--c-text-2); }
.ld-card .ld-src { margin-top: 10px; font-size: 0.8125rem; color: var(--c-text-3); }

.ld-levels { margin-top: 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ld-level { border-radius: 16px; padding: 22px; }
.ld-level h3 { font-size: 1.375rem; color: inherit; }
.ld-level p { margin: 8px 0 0; font-size: 1rem; }
.ld-level--esalert { background: var(--c-surface); border: 1px solid var(--c-line); color: var(--c-text); }
.ld-level--esalert p { color: var(--c-text-2); }

.ld-how { display: flex; flex-wrap: wrap; gap: 48px; padding-bottom: 72px; }
.ld-how > div { flex: 1 1 360px; min-width: 0; }
.ld-steps { flex: 1 1 520px; min-width: 0; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ld-steps li { display: flex; gap: 18px; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 16px; padding: 20px; }
.ld-steps li > span { flex: none; width: 40px; height: 40px; border-radius: 50%; background: #0d2b4e; color: #fff; display: grid; place-items: center; font: 600 1.0625rem var(--font-mono); }
.ld-steps h3 { font-size: 1.125rem; }
.ld-steps p { margin: 4px 0 0; color: var(--c-text-2); font-size: 0.9375rem; }

.ld-band { background: var(--c-surface); border-block: 1px solid var(--c-line); }
.ld-band__inner { max-width: 1200px; margin: 0 auto; padding: 72px 24px; display: flex; flex-wrap: wrap; gap: 32px; align-items: stretch; }
.ld-band__inner > div { flex: 1 1 460px; min-width: 0; }
.ld-guides { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }
.ld-guides a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--c-line); color: var(--c-text); text-decoration: none; font-size: 0.9375rem; }
.ld-guides a:hover { background: var(--c-surface-2); }
.ld-install { flex: 1 1 360px; min-width: 0; border-radius: 18px; padding: 26px; background: #0d2b4e; color: #eef3f9; display: flex; flex-direction: column; gap: 12px; }
.ld-install svg { color: #8cb8ff; }
.ld-install h3 { font-size: 1.375rem; color: #fff; }
.ld-install p { margin: 0; color: #c3cfdd; font-size: 0.9375rem; }
.ld-install a { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 10px; background: #fff; color: #0d2b4e; font-weight: 600; text-decoration: none; }
.ld-install a:focus-visible { outline-color: #8cb8ff; }

.ld-api { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; padding-bottom: 72px; }
.ld-api > div { flex: 1 1 380px; min-width: 0; }
.ld-links { margin-top: 22px; display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.9375rem; }
.ld-links a, .ld-sources a { color: var(--c-link); }
.ld-code { flex: 1 1 520px; min-width: 0; margin: 0; overflow-x: auto; border-radius: 16px; padding: 22px; background: #0a1220; color: #c3cfdd; font: 0.875rem/1.7 var(--font-mono); white-space: pre; }
.ld-code span { color: #9fb0c4; }

.ld-sources { display: flex; flex-wrap: wrap; gap: 14px 36px; align-items: baseline; border-top: 1px solid var(--c-line); padding: 32px 24px 72px; }
.ld .ld-sources h2 { margin: 0; font-size: 0.9375rem; color: var(--c-text-3); font-weight: 600; letter-spacing: 0; }
.ld-sources span { font-weight: 600; color: var(--c-text-2); }
.ld-sources a { margin-inline-start: auto; font-size: 0.9375rem; }

.ld-foot { background: #0a1220; color: #c3cfdd; }
.ld-foot__inner { max-width: 1200px; margin: 0 auto; padding: 48px 24px; display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; }
.ld-foot__inner > div { flex: 1 1 420px; min-width: 0; }
.ld-foot__inner p { margin: 8px 0 0; font-size: 0.9375rem; max-width: 38rem; }
.ld-foot__inner .ld-foot__lead { margin: 0; font-size: 1rem; color: #fff; }
.ld-foot a { color: #c3cfdd; }
.ld-foot a strong { color: #fff; }
.ld-foot nav { display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: 0.9375rem; align-content: flex-start; }
.ld-foot a:focus-visible { outline-color: #8cb8ff; }
.ld-foot .ld-foot__small { max-width: 1200px; margin: 0 auto; padding: 0 24px 32px; font-size: 0.8125rem; color: #9fb0c4; }

.mon-home { display: inline-flex; color: var(--c-text); border-radius: 6px; }
.mon-home:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }

@media (max-width: 600px) {
  .ld-hero__grid { padding: 32px 20px 56px; gap: 36px; }
  .ld-nav { padding: 16px 20px; gap: 12px; }
  .ld-nav__links { gap: 14px; margin-inline-start: 0; width: 100%; }
  .ld-nav__links a.ld-nav__cta { margin-inline-start: auto; }
  .ld-btn, .ld-prov { width: 100%; justify-content: center; }
  .ld-prov select { flex: 1; max-width: none; }
  .ld-sec, .ld-band__inner, .ld-sources { padding-inline: 20px; }
  .ld-sources a { margin-inline-start: 0; }
}

/* Zona superior fija: franja del 112, cabecera y migas de pan siempre visibles al desplazarse. */
.topbar { position: sticky; top: 0; z-index: 1000; }
.topbar .crumbs { background: color-mix(in srgb, var(--c-bg) 94%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--c-line); max-width: none; padding-inline: max(var(--gutter), calc((100% - var(--w-page)) / 2 + var(--gutter))); }
html { scroll-padding-top: calc(var(--topbar-h, 0px) + var(--s-4)); }
.ld-bar { background: #0d2b4e; color: #eef3f9; border-bottom: 1px solid rgb(195 207 221 / 0.18); }
.ld-bar .ld-nav { padding-block: 12px; }
.ld-bar a:focus-visible { outline: 3px solid #8cb8ff; outline-offset: 2px; }
.ld-hero__grid { padding-top: 40px; }
@media (max-width: 600px) {
  .ld-bar .ld-nav { padding-block: 10px; }
  .topbar .sos__more { display: none; }
}

/* Destello del aviso seleccionado (llegada desde la portada o clic en la lista) */
.mk-flash { fill: none; stroke-width: 3; stroke-opacity: 0.9; transform-box: fill-box; transform-origin: center; pointer-events: none; }
.mk-flash.mk--red { stroke: var(--sev-red-edge); }
.mk-flash.mk--orange { stroke: var(--sev-orange-edge); }
.mk-flash.mk--yellow { stroke: var(--sev-yellow-edge); }
.mk-flash.mk--info { stroke: var(--sev-info-edge); }
@media (prefers-reduced-motion: no-preference) {
  .mk-flash { animation: mk-flash 2s cubic-bezier(0.2, 0.6, 0.3, 1) infinite; }
  .mk-flash--late { animation-delay: 1s; }
  .mk--selected { animation: mk-blink 1s steps(2, jump-none) 4; }
}
@media (prefers-reduced-motion: reduce) {
  .mk-flash--late { display: none; }
}
@keyframes mk-flash { 0% { transform: scale(1); stroke-opacity: 0.95; } 100% { transform: scale(3.2); stroke-opacity: 0; } }
@keyframes mk-blink { 0% { fill-opacity: 1; } 50% { fill-opacity: 0.25; } 100% { fill-opacity: 1; } }

/* Aviso oficial íntegro (/aviso) */
.official { max-width: 820px; padding-block: var(--s-5) var(--s-7); display: flex; flex-direction: column; gap: var(--s-5); }
.official h2 { font-size: var(--t-lg); margin: 0 0 var(--s-2); }
.official__head { display: flex; gap: var(--s-4); align-items: flex-start; }
.official__expired { margin: 0 0 var(--s-4); padding: var(--s-3) var(--s-4); border-radius: var(--r-md, 12px); border: 1px solid var(--c-border); background: var(--c-surface-2, var(--c-surface)); color: var(--c-text); }
.official__expired[hidden] { display: none; }
.official--expired .official__head .badge { filter: grayscale(1); opacity: .7; }
.official__head .mon-ico--lg { width: 52px; height: 52px; border-radius: 12px; }
.official__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin: 0 0 var(--s-2); font-size: var(--t-sm); color: var(--c-text-2); }
.official h1 { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem); margin: 0 0 var(--s-2); }
.official__sender { margin: 0; color: var(--c-text-2); font-size: var(--t-sm); }
.official__todo { border: 1px solid var(--c-line); border-top: 4px solid var(--edge); background: color-mix(in srgb, var(--tint) 12%, var(--c-surface)); border-radius: var(--r-2); padding: var(--s-4) var(--s-5); }
.official__todo p { margin: 0; font-size: var(--t-lg); max-width: 62ch; }
.official__todo .official__112 { margin-top: var(--s-3); font-size: var(--t-sm); display: flex; align-items: center; gap: var(--s-2); color: var(--c-text-2); }
.official__112 a { font-weight: 800; color: var(--c-emergency); }
.official__desc p { margin: 0; max-width: 68ch; white-space: pre-line; }
.official__facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s-3) var(--s-5); padding: var(--s-4); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-2); }
.official__facts dt { font-size: var(--t-xs); color: var(--c-text-3); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.official__facts dd { margin: 2px 0 0; font-size: var(--t-sm); }
.official__level { margin: 0; font-size: var(--t-sm); color: var(--c-text-2); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.official__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.official__actions .ico { fill: none; }
.official__source { border-top: 1px solid var(--c-line); padding-top: var(--s-4); font-size: var(--t-sm); color: var(--c-text-3); }
.official__source p { margin: 0 0 var(--s-2); max-width: 68ch; }
.official__links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.official__links a { color: var(--c-link); }
@media (max-width: 600px) { .official__head { flex-direction: column; gap: var(--s-3); } }
.mon-ico--lg svg { width: 26px; height: 26px; }
.official__head .mon-ico--lg svg { width: 30px; height: 30px; }

/* Panel del aviso oficial junto a la barra lateral del mapa */
.official--page { margin-inline: auto; }
.mon-sheet {
  position: absolute; z-index: 510; top: var(--s-4); bottom: var(--s-4); inset-inline-start: calc(400px + var(--s-4) * 2);
  width: min(560px, calc(100% - 400px - var(--s-4) * 3));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-3); box-shadow: var(--shadow-2);
}
.mon-sheet[hidden] { display: none; }
.mon-sheet:focus { outline: none; }
.mon-sheet:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.mon-sheet__bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) var(--s-3) var(--s-2) var(--s-4); border-bottom: 1px solid var(--c-line); }
.mon-sheet__label { font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-text-3); }
.mon-sheet__close { min-height: 36px; padding: 0 var(--s-3); border: 1px solid var(--c-line); border-radius: var(--r-2); background: transparent; color: var(--c-text); font: 600 var(--t-sm) var(--font-sans); cursor: pointer; }
.mon-sheet__close:hover { background: var(--c-surface-2); }
.mon-sheet__close:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.mon-sheet__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: var(--s-4) var(--s-5) var(--s-5); }
.official--sheet { max-width: none; padding: 0; gap: var(--s-4); }
.official--sheet h2#of-h-aviso { font-size: var(--t-xl); line-height: var(--lh-snug); margin: 0 0 var(--s-2); }
.official--sheet h3 { font-size: var(--t-md, 1.0625rem); margin: 0 0 var(--s-2); }
.official--sheet .official__todo p { font-size: var(--t-md, 1.0625rem); }
.official--sheet .official__facts { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.official--sheet .official__head .mon-ico--lg { width: 44px; height: 44px; }
.official--sheet .official__head .mon-ico--lg svg { width: 26px; height: 26px; }
@media (max-width: 760px) {
  .mon-sheet { inset: 0; width: auto; border-radius: 0; border: 0; z-index: 700; }
  .mon-sheet__body { padding: var(--s-4); }
}
@media (max-width: 760px) { .mon-sheet { z-index: 1100; } }

/* ==========================================================
 * Idiomas: selector en la cabecera y escritura de derecha a izquierda (árabe)
 * ========================================================== */
.header-end { display: flex; align-items: center; gap: var(--s-2); }
.lang { position: relative; }
.lang summary {
  list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; min-width: 44px; padding: 0 var(--s-3);
  border: 1px solid rgb(255 255 255 / 0.45); border-radius: var(--r-2); color: #fff; cursor: pointer; font: 650 var(--t-sm) var(--font-sans);
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover, .lang[open] summary { background: rgb(255 255 255 / 0.12); }
.lang__code { letter-spacing: 0.04em; }
.lang__list {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 1200; margin: 0; padding: 6px; min-width: 190px;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-2); box-shadow: var(--shadow-2);
}
.lang__list a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 6px; color: var(--c-text); text-decoration: none; }
.lang__list a:hover { background: var(--c-surface-2); }
.lang__list a[aria-current] { font-weight: 700; background: var(--c-surface-2); }
.lang__list a[aria-current]::after { content: '✓'; margin-inline-start: auto; color: var(--c-link); }
.lang__list a:focus-visible { outline: 3px solid var(--c-focus); outline-offset: -3px; }
.translation-note { font-size: var(--t-xs); margin-top: var(--s-2); }
.translation-note a { color: inherit; }
.notice .translation-note { margin: 0; font-size: var(--t-sm); color: var(--c-text-2); }
.ld-foot .translation-note { opacity: 0.8; }
.official__lang { margin: var(--s-2) 0 0; font-size: var(--t-sm); color: var(--c-text-2); border-inline-start: 3px solid var(--c-line); padding-inline-start: var(--s-2); }

/* Mapas y código siempre de izquierda a derecha */
.monitor__map, .map, .leaflet-container, .ld-code { direction: ltr; }
[dir='rtl'] .flip, [dir='rtl'] .more svg, [dir='rtl'] .hazard__go svg, [dir='rtl'] .icon--dir { display: inline-block; transform: scaleX(-1); }
[dir='rtl'] .leaflet-control-container { direction: ltr; }
/* Inter no tiene árabe: fuentes del sistema con buena cobertura y algo más de interlineado. */
:root[lang='ar'] { --font-sans: 'Segoe UI', Tahoma, 'Noto Sans Arabic', 'Geeza Pro', system-ui, sans-serif; }
:root[lang='ar'] body { line-height: 1.7; }

/* Cabecera en una línea con el selector de idioma: el lema sobra (también en idiomas con menús más largos). */
.site-header .brand__tag { display: none; }
@media (min-width: 62.01rem) { .site-header__inner { gap: var(--s-4); flex-wrap: nowrap; } .nav a { padding-inline: var(--s-2); } }

/* Capa de peligro de incendio (EFFIS) */
.monitor .fire-layer { background: var(--c-surface); color: var(--c-text); padding: 0.5rem 0.75rem; font-size: 0.8125rem; max-width: 15rem; }
.fire-layer__toggle { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; cursor: pointer; min-height: 28px; }
.fire-layer__toggle input { width: 1rem; height: 1rem; accent-color: var(--c-link); }
.fire-layer__more { margin-top: 0.5rem; display: grid; gap: 0.5rem; }
.fire-layer__more[hidden] { display: none; }
.fire-layer select { font: inherit; padding: 0.25rem 0.375rem; border: 1px solid var(--c-line); border-radius: var(--r-1, 4px); background: var(--c-surface); color: var(--c-text); }
.fire-layer__legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem 0.75rem; }
.fire-layer__legend li { display: flex; align-items: center; gap: 0.375rem; }
.fire-layer__legend i { width: 0.75rem; height: 0.75rem; border-radius: 2px; flex: none; }
.fire-layer__note { margin: 0; font-size: 0.6875rem; color: var(--c-text-3); line-height: 1.35; }
/* Colores de la leyenda de EFFIS */
.fwi-vl { background: #9ef5c8; } .fwi-l { background: #cfdc58; } .fwi-m { background: #e8b400; }
.fwi-h { background: #e07a00; } .fwi-vh { background: #b40f0f; } .fwi-e { background: #3c0614; }
@media (max-width: 760px) {
  .monitor .fire-layer { max-width: 11rem; padding: 0.375rem 0.5rem; font-size: 0.75rem; }
  .fire-layer__note { display: none; }
  .fire-layer__legend { gap: 0.125rem 0.5rem; }
}

/* ---------- Cuenta de la API ---------- */
.account { padding-bottom: var(--s-8, 4rem); }
.account section { margin-top: var(--s-6); }
.account-form { display: grid; gap: var(--s-3); max-width: 28rem; margin-block: var(--s-4); }
.account-form input[type='email'] { width: 100%; }
.notice--ok { border-color: #1f8a4c; background: rgb(31 138 76 / 0.08); }
.notice--warn { border-color: var(--c-warn-text); background: rgb(255 138 31 / 0.08); }
.key-box { display: grid; gap: var(--s-2); margin-block: var(--s-4); }
.key-box label { font-weight: 650; font-size: var(--t-sm); }
.key-box__row { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.key-box__row input { flex: 1 1 22rem; min-width: 0; font-family: var(--font-mono); font-size: var(--t-sm); }
.code { margin: var(--s-3) 0; overflow-x: auto; border-radius: var(--r-2); padding: var(--s-4); background: #0a1220; color: #c3cfdd; font: 0.8125rem/1.7 var(--font-mono); white-space: pre; }
.code code { background: none; padding: 0; color: inherit; }
.plan-badge { display: inline-block; font-weight: 700; font-size: var(--t-sm); padding: 0.2rem 0.65rem; border-radius: 999px; border: 1px solid var(--c-line); background: var(--c-surface-2); }
.plan-badge--cafe, .plan-badge--desayuno { border-color: #b7791f; background: rgb(183 121 31 / 0.12); }
.usage { display: block; margin-block: var(--s-2) var(--s-1); font-size: var(--t-sm); }
.account meter { width: 100%; max-width: 28rem; height: 0.9rem; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--s-4); margin-block: var(--s-4); }
.plan-card { display: grid; gap: var(--s-2); align-content: start; padding: var(--s-5); border: 1px solid var(--c-line); border-radius: var(--r-2); background: var(--c-surface); }
.plan-card p { margin: 0; }
.plan-card__name { font-weight: 700; font-size: var(--t-lg); }
.plan-card__price { font-size: 1.5rem; font-weight: 750; }
.account details { margin-top: var(--s-3); }
.account summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.account form + form, .account form + details { margin-top: var(--s-3); }
.account > p, .account section > p, .account .table-wrap { max-width: 50rem; }
.account .table-wrap + p { margin-top: var(--s-3); }

/* Pie siempre abajo: en páginas cortas (p. ej. /cuenta/entrar) el contenido ocupa el hueco que sobra. */
body:not(.is-bare) { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body:not(.is-bare) > main { flex: 1 0 auto; }

/* ---------- Portada con la Tierra en 3D (client/globe.js) ----------
 * Sin WebGL queda el mismo contenido sobre el fondo de «espacio». Con el globo: vista España
 * (horizonte bajo el texto) y vista Mundo (globo entero a un lado o debajo del texto). */
.sp { --sp-ink: #eef3fa; --sp-ink-2: #b4c2d6; --sp-ink-3: #8a9bb3; --sp-glass: rgb(8 14 26 / 0.62); --sp-line: rgb(180 200 230 / 0.2); --sp-atmos: #7cc4ff;
  isolation: isolate; display: flex; flex-direction: column; align-items: center;
  min-height: max(640px, calc(100svh - var(--topbar-h, 104px)));
  padding: clamp(20px, 4vh, 48px) max(16px, env(safe-area-inset-right, 0px)) clamp(250px, 32vh, 380px) max(16px, env(safe-area-inset-left, 0px));
  background: radial-gradient(120% 70% at 50% 110%, #0b2a52 0%, #03060d 60%); color: var(--sp-ink); }
.sp::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(to bottom, rgb(3 6 13 / 0.6), transparent 42%); }
.sp-globe { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: -2; }
.sp.is-pointing { cursor: pointer; }
.sp-copy { position: relative; flex: none; width: 100%; max-width: 56rem; text-align: center; transition: opacity 0.3s ease; }
.sp-copy h1 { text-shadow: 0 2px 40px rgb(0 0 0 / 0.55); }
.sp .ld-chip { margin-bottom: 14px; }
.sp .ld-lede { margin: 16px auto 0; max-width: 40rem; color: var(--sp-ink-2); }
.sp .ld-actions { justify-content: center; margin-top: 24px; }
.sp .ld-note { margin-top: 14px; }
.sp .ld-note { color: var(--sp-ink-3); }

/* Resumen de avisos, abajo y sobre la Tierra */
.sp-status { position: absolute; z-index: 1; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); }
.sp-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; padding: 10px 14px; border-radius: 14px; background: var(--sp-glass); border: 1px solid var(--sp-line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 0.875rem; color: var(--sp-ink-2); }
.sp-bar[data-scope="world"], .sp.is-world .sp-bar[data-scope="es"] { display: none; }
.sp.is-world .sp-bar[data-scope="world"] { display: flex; }
.ld .sp-bar h2 { margin: 0; font-size: 0.875rem; font-weight: 650; letter-spacing: 0; color: var(--sp-ink); }
.sp-chips { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.sp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: rgb(255 255 255 / 0.07); color: var(--sp-ink-2); }
.sp-chip b { color: var(--sp-ink); font-variant-numeric: tabular-nums; }
.sp-chip i { width: 9px; height: 9px; border-radius: 50%; }
.sp-chip.lvl-red i { background: #ff3b55; }
.sp-chip.lvl-orange i { background: #ff8a1f; }
.sp-chip.lvl-yellow i { background: #ffd60a; }
.ld .sp-calm { margin: 0; color: var(--sp-ink-2); }
.sp-when { color: var(--sp-ink-3); }
.sp-more { color: #9fd0ff; font-weight: 600; }
.sp-more:hover { color: #fff; }

/* España / Mundo: orbes a los lados (escritorio) o selector arriba (móvil y tableta) */
.sp-views[hidden] { display: none; }
.sp-view { position: absolute; z-index: 1; top: 50%; display: flex; align-items: center; gap: 14px; padding: 8px; background: none; border: 0; color: var(--sp-ink-2); font: 600 0.8125rem var(--font-sans); letter-spacing: 0.24em; text-transform: uppercase; cursor: pointer; }
.sp-view[data-view="es"] { inset-inline-start: max(12px, env(safe-area-inset-left, 0px)); }
.sp-view[data-view="world"] { inset-inline-end: max(12px, env(safe-area-inset-right, 0px)); flex-direction: row-reverse; }
.sp-view[aria-pressed="true"] { color: var(--sp-ink); }
.sp-orb { --shade: inset -12px -10px 20px rgb(0 0 0 / 0.7), inset 5px 4px 12px rgb(255 255 255 / 0.2); flex: none; width: 72px; height: 72px; border-radius: 50%; background: #0b2a52 url(/earth/day-2048.jpg) repeat-x; box-shadow: var(--shade), 0 0 18px rgb(124 196 255 / 0.25); transition: transform 0.5s ease, box-shadow 0.5s ease; }
.sp-orb--es { background-size: 520% auto; background-position: 48.7% 14%; }
.sp-orb--world { background-size: 220% auto; background-position: 0% 50%; }
.sp-view[aria-pressed="true"] .sp-orb { box-shadow: var(--shade), 0 0 0 2px var(--sp-atmos), 0 0 30px rgb(124 196 255 / 0.55); }
.sp-view:hover .sp-orb { transform: scale(1.08); }
.sp-view:focus-visible { outline: 3px solid #8cb8ff; outline-offset: 2px; border-radius: 999px; }
@media (prefers-reduced-motion: no-preference) { .sp-orb--world { animation: sp-orbspin 20s linear infinite; } }
@keyframes sp-orbspin { to { background-position: 183.333% 50%; } }

/* Vista Mundo en pantalla ancha: texto a un lado y globo al otro */
.sp.is-world[data-layout="split"] { align-items: flex-start; }
.sp.is-world[data-layout="split"] .sp-copy { max-width: 27rem; margin-inline-start: max(13rem, 15vw); text-align: start; }
.sp.is-world[data-layout="split"] h1 { font-size: clamp(2.25rem, 3.4vw, 3.25rem); }
.sp.is-world[data-layout="split"] .ld-lede { margin-inline: 0; }
.sp.is-world[data-layout="split"] .ld-actions { justify-content: flex-start; }

@media (max-width: 1100px) {
  .sp-views { position: relative; z-index: 1; display: flex; gap: 8px; margin-bottom: 20px; }
  .sp-view, .sp.is-world[data-layout] .sp-view { position: static; gap: 8px; padding: 4px 16px 4px 4px; border-radius: 999px; background: var(--sp-glass); border: 1px solid var(--sp-line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 0.75rem; letter-spacing: 0.14em; flex-direction: row; }
  [dir="rtl"] .sp-view { padding: 4px 4px 4px 16px; }
  .sp-orb { width: 40px; height: 40px; --shade: inset -5px -4px 9px rgb(0 0 0 / 0.5), inset 2px 2px 5px rgb(255 255 255 / 0.25); }
  .sp-view:hover .sp-orb { transform: none; }
  .sp.sp .sp-view.sp-view[aria-pressed="true"] { background: #e8f1ff; color: #0d2b4e; border-color: transparent; box-shadow: 0 6px 20px -8px rgb(124 196 255 / 0.7); }
  .sp.sp .sp-view.sp-view[aria-pressed="true"] .sp-orb { box-shadow: var(--shade); }
  .sp.is-world[data-layout="split"] .sp-copy { margin-inline-start: 0; }
  .sp.is-world[data-layout="split"] .sp-views { align-self: flex-start; }
}

/* Ficha de un aviso al pulsar un punto */
.sp.is-focus .sp-copy, .sp.is-focus .sp-status { opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0s 0.3s; }
.sp-event { position: absolute; z-index: 2; inset-inline-start: clamp(16px, 7vw, 7rem); top: 50%; transform: translateY(-50%); width: min(26rem, calc(100% - 32px)); padding: 20px 20px 16px; border-radius: 16px; background: rgb(8 14 26 / 0.84); border: 1px solid var(--sp-line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 24px 60px -24px rgb(0 0 0 / 0.9); color: var(--sp-ink); text-align: start; }
.sp-event[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .sp-event { animation: sp-evin 0.45s ease; } }
@keyframes sp-evin { from { opacity: 0; translate: 0 10px; } }
.sp[data-layout="stack"] .sp-event { inset-inline: 12px; bottom: max(12px, env(safe-area-inset-bottom, 0px)); top: auto; transform: none; width: auto; max-height: 56%; overflow: auto; }
.sp-ev-top { display: flex; align-items: center; gap: 8px; padding-inline-end: 40px; }
.sp-ev-lvl { padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; background: #ffd60a; color: #1a1400; }
.sp-ev-lvl[data-lvl="orange"] { background: #ff8a1f; color: #1f0e00; }
.sp-ev-lvl[data-lvl="red"] { background: #ff3b55; color: #fff; }
.sp-ev-lvl[data-lvl="info"] { background: #8fa3bd; color: #0d1b2a; }
.sp-ev-tag { font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sp-ink-3); border: 1px solid var(--sp-line); border-radius: 6px; padding: 1px 6px; }
.sp-ev-tag[hidden] { display: none; }
.ld .sp-ev-kind { margin: 14px 0 0; font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sp-ink-3); }
.ld .sp-event h2 { margin: 4px 0 12px; font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.6rem); line-height: 1.2; color: #fff; text-wrap: balance; outline: none; }
.sp-ev-data { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 0.875rem; }
.sp-ev-data dt { color: var(--sp-ink-3); }
.sp-ev-data dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.sp-ev-data a { color: #9fd0ff; }
.ld .sp-ev-todo { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: rgb(124 196 255 / 0.08); color: var(--sp-ink-2); font-size: 0.875rem; }
.sp-ev-todo b { color: #fff; }
.sp-ev-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.sp-ev-actions button, .sp-ev-x { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--sp-line); background: rgb(255 255 255 / 0.05); color: var(--sp-ink); font: 600 0.875rem var(--font-sans); cursor: pointer; }
.sp-ev-actions button:hover, .sp-ev-x:hover { background: rgb(255 255 255 / 0.12); }
.sp-ev-count { font-size: 0.8125rem; color: var(--sp-ink-3); font-variant-numeric: tabular-nums; }
.sp-ev-back { margin-inline-start: auto; }
.sp-ev-x { position: absolute; top: 12px; inset-inline-end: 12px; padding: 0; width: 40px; font-size: 1.2rem; }
.sp-ev-map { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 12px; min-height: 44px; border-radius: 12px; background: #e8f1ff; color: #0d2b4e; font-weight: 650; text-decoration: none; }
.sp-ev-map:hover { background: #fff; color: #0d2b4e; }
.sp-event a:focus-visible, .sp-event button:focus-visible { outline: 3px solid #8cb8ff; outline-offset: 2px; }
.sp [data-globe-list]:focus-within { position: absolute; z-index: 3; top: 12px; inset-inline-start: 12px; width: auto; height: auto; clip: auto; margin: 0; padding: 8px; border-radius: 10px; background: #03060d; list-style: none; }
.sp [data-globe-list] button { background: none; border: 0; color: var(--sp-ink); font: inherit; padding: 4px; }

@media (max-width: 600px) {
  .sp { padding-bottom: clamp(280px, 40vh, 380px); }
  .sp-bar { gap: 6px 10px; padding: 8px 10px; font-size: 0.8125rem; }
  .sp-when { display: none; }
  /* Con el globo, el texto se acorta para que la Tierra asome en la primera pantalla
     (la explicación completa sigue más abajo, en «Cómo funciona»). */
  .sp.is-3d .ld-lede { display: none; }
  .sp.is-3d .ld-chip { margin-bottom: 10px; }
  .sp.is-3d .ld-actions { margin-top: 18px; }
}

/* ---------- Mapa de satélite ----------
 * Foto de la NASA algo oscurecida para que los avisos destaquen; fronteras como líneas finas. */
.leaflet-container, .monitor__map .leaflet-container, .monitor__map.leaflet-container { background: #03060d; }
.sat-tiles { filter: brightness(0.8) saturate(0.9) contrast(1.06); }
.land { fill: none; stroke: rgb(255 255 255 / 0.28); stroke-width: 0.7; }

/* Vistas rápidas España / Mundo, bajo el zoom */
.monitor .mon-views { display: flex; flex-direction: column; }
.mon-view { min-width: 72px; height: 36px; padding: 0 10px; border: 0; border-bottom: 1px solid var(--c-line); background: var(--c-surface); color: var(--c-text); font: 600 var(--t-xs) var(--font-sans); cursor: pointer; }
.mon-view:last-child { border-bottom: 0; }
.mon-view:hover { background: var(--c-surface-2); }
.mon-view:focus-visible { outline: 3px solid var(--c-focus); outline-offset: -3px; }

/* Ocultar el panel para ver el mapa entero */
.mon-hide { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--c-line); background: var(--c-surface-2); color: var(--c-text); cursor: pointer; }
.mon-hide[hidden] { display: none; }
.mon-hide:hover { background: var(--c-surface); }
.mon-hide:focus-visible, .mon-show:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
[dir="rtl"] .mon-hide svg { transform: scaleX(-1); }
.monitor__panel { transition: transform var(--dur-2, 0.3s) var(--ease, ease), max-height var(--dur-2, 0.3s) var(--ease, ease); }
.monitor.is-collapsed .monitor__panel { transform: translateX(calc(-100% - 2 * var(--s-4))); visibility: hidden; transition: transform var(--dur-2, 0.3s) var(--ease, ease), visibility 0s var(--dur-2, 0.3s); }
[dir="rtl"] .monitor.is-collapsed .monitor__panel { transform: translateX(calc(100% + 2 * var(--s-4))); }
.mon-show { white-space: nowrap; position: absolute; z-index: 600; top: var(--s-4); inset-inline-start: var(--s-4); display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 12px; border-radius: 999px; border: 1px solid var(--c-line); background: color-mix(in srgb, var(--c-surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--c-text); font: 600 var(--t-sm) var(--font-sans); box-shadow: var(--shadow-2); cursor: pointer; }
.mon-show[hidden] { display: none; }
.mon-show b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--sev-red-bg, #c8102e); color: #fff; font-size: 0.75rem; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .monitor.is-collapsed .monitor__panel, [dir="rtl"] .monitor.is-collapsed .monitor__panel { transform: translateY(calc(100% + 16px)); }
  .monitor.is-collapsed .leaflet-bottom.leaflet-right { bottom: env(safe-area-inset-bottom, 0px); }
  .mon-show { top: auto; bottom: max(16px, env(safe-area-inset-bottom, 0px)); inset-inline-start: 50%; transform: translateX(-50%); }
  [dir="rtl"] .mon-show { transform: translateX(50%); }
  .mon-hide svg { transform: rotate(-90deg); }
  [dir="rtl"] .mon-hide svg { transform: rotate(-90deg); }
}
@media (prefers-reduced-motion: reduce) {
  .monitor__panel, .monitor.is-collapsed .monitor__panel { transition: none; }
}

/* Páginas de riesgo (Ríos, Meteo, Costas, Terremotos, Huracanes, Incendios): el título queda fijo bajo
 * la zona superior al desplazarse, y la descripción va justificada (con guiones para evitar huecos). */
.page-title { position: sticky; top: var(--topbar-h, 0px); z-index: 900; background: color-mix(in srgb, var(--c-bg) 94%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--c-line); }
.page-title .wrap { padding-block: var(--s-3); }
.page-title h1 { margin: 0; font-size: clamp(1.5rem, 1rem + 2.2vw, var(--t-3xl)); }
.page-head--intro { padding-top: var(--s-4); }
.page-head .lede--justify { max-width: none; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
html:has(.page-title) { scroll-padding-top: calc(var(--topbar-h, 0px) + 5rem); }

/* ---------- Mi zona (spec 001-pwa-meteo) ---------- */
.zone { max-width: 34rem; padding-block: var(--s-4) var(--s-7); display: flex; flex-direction: column; gap: var(--s-4); }
.zone-head h1 { display: flex; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-3); font-size: var(--t-2xl); }
.zone-pick { display: grid; gap: var(--s-2); }
.zone-pick label { font-weight: 600; font-size: var(--t-sm); }
.zone-pick__row { display: flex; gap: var(--s-2); }
.zone-pick__row select { flex: 1; min-width: 0; min-height: 48px; }
.zone-pick .btn--link { justify-self: start; display: inline-flex; align-items: center; gap: var(--s-2); }
.zone-pick .btn--link[hidden] { display: none; }
.zone-note, .zone-updated { margin: 0; font-size: var(--t-xs); color: var(--c-text-3); }
/* Municipio (R-010): buscador con propuestas y línea «Zona de aviso». */
.mun-pick { display: grid; gap: var(--s-2); }
.mun-pick[hidden] { display: none; }
.mun-pick label { font-weight: 600; font-size: var(--t-sm); }
.mun-pick__box { position: relative; }
.mun-pick input { width: 100%; min-height: 48px; padding: 0 var(--s-3); border: 1px solid var(--c-line); border-radius: var(--r-1); background: var(--c-surface); color: var(--c-text); font: inherit; }
.mun-pick__list { position: absolute; z-index: 20; inset-inline: 0; top: calc(100% + 4px); margin: 0; padding: var(--s-1) 0; list-style: none;
  max-height: 18rem; overflow-y: auto; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-1); box-shadow: 0 12px 28px rgb(0 0 0 / 0.18); }
.mun-pick__list[hidden] { display: none; }
.mun-pick__list li { padding: 0 var(--s-3); min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.mun-pick__list li:hover, .mun-pick__list li[aria-selected="true"] { background: var(--c-surface-2); }
.zone-area { margin: var(--s-1) 0 0; font-size: var(--t-sm); color: var(--c-text-2); }
.zone .live { display: flex; flex-direction: column; gap: var(--s-4); }

.zone-hero { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-5); border-radius: 24px; text-decoration: none; color: var(--c-text); background: var(--c-surface); border: 1px solid var(--c-line); }
.zone-hero--yellow { background: var(--sev-yellow-bg); color: var(--sev-yellow-fg); border-color: transparent; }
.zone-hero--orange { background: var(--sev-orange-bg); color: var(--sev-orange-fg); border-color: transparent; }
.zone-hero--red { background: var(--sev-red-bg); color: var(--sev-red-fg); border-color: transparent; }
.zone-hero--info { background: var(--sev-info-bg); color: var(--sev-info-fg); border-color: transparent; }
.zone-hero__kicker { font-size: var(--t-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.zone-hero__top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.zone-hero__level { font-size: clamp(2.4rem, 2rem + 2vw, 3rem); font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.zone-hero__icon { flex: none; }
.zone-hero__what { font-size: var(--t-lg); font-weight: 700; }
.zone-hero__when, .zone-hero__area { font-size: var(--t-sm); }
.zone-hero__more { margin-top: var(--s-2); display: inline-flex; align-items: center; gap: var(--s-1); font-weight: 600; text-decoration: underline; text-underline-offset: 0.18em; }
a.zone-hero:hover .zone-hero__more { text-decoration-thickness: 2px; }

.zone-card { padding: var(--s-4); border-radius: 20px; background: var(--c-surface); border: 1px solid var(--c-line); display: flex; flex-direction: column; gap: var(--s-3); }
.zone-card__title, .zone-window__title { margin: 0; font-size: var(--t-xs); font-weight: 700; color: var(--c-text-2); text-transform: uppercase; letter-spacing: 0.08em; }

.zone-hours { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; text-align: center; }
.zone-hours li { display: flex; flex-direction: column; gap: 6px; }
.zone-hours__time { font-size: 0.75rem; color: var(--c-text-2); font-variant-numeric: tabular-nums; }
.zone-hours__cell { height: 36px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 0.85rem; background: var(--c-surface-2); color: var(--c-text-3); }
.zone-hours__cell--yellow { background: var(--sev-yellow-bg); color: var(--sev-yellow-fg); }
.zone-hours__cell--orange { background: var(--sev-orange-bg); color: var(--sev-orange-fg); }
.zone-hours__cell--red { background: var(--sev-red-bg); color: var(--sev-red-fg); }
.zone-hours__cell--info { background: var(--sev-info-bg); color: var(--sev-info-fg); }
.zone-legend { margin: 0; display: flex; flex-wrap: wrap; gap: var(--s-3); font-size: var(--t-xs); color: var(--c-text-2); }

.zone-windows { display: flex; flex-direction: column; gap: var(--s-3); }
.zone-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--c-surface-2); }
.zone-tabs[hidden] { display: none; }
.zone-tabs button { min-height: 44px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--c-text-2); font: inherit; font-weight: 600; cursor: pointer; }
.zone-tabs button[aria-selected="true"] { background: var(--c-surface); color: var(--c-text); box-shadow: var(--shadow-1); }
.zone-window { display: flex; flex-direction: column; gap: var(--s-2); }
.zone-window[hidden] { display: none; }
.zone-list { margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.zone-row { display: flex; align-items: center; gap: var(--s-3); min-height: 44px; padding: var(--s-3) var(--s-4); border-radius: 18px; background: var(--c-surface); border: 1px solid var(--c-line); color: var(--c-text); text-decoration: none; }
.zone-row:hover { border-color: var(--c-text-3); }
.zone-row__icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--c-surface-2); }
.zone-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.zone-row__title { font-weight: 600; }
.zone-row__when { display: block; font-size: var(--t-xs); color: var(--c-text-2); }
.zone-empty { margin: 0; display: flex; align-items: center; gap: var(--s-2); padding: var(--s-4); border-radius: 18px; background: var(--c-surface); border: 1px solid var(--c-line); color: var(--c-ok); font-weight: 600; }

.zone-days { margin: 0; padding: 0; }
.zone-days li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); min-height: 48px; border-top: 1px solid var(--c-line); }
.zone-days li:first-child { border-top: 0; }
.zone-days__day { font-weight: 600; }
.zone-days__what { font-size: var(--t-sm); color: var(--c-text-2); }
.badge--none { background: var(--c-surface-2); color: var(--c-text-2); }

.zone-rivers { margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.zone-rivers li { display: flex; align-items: center; gap: var(--s-3); }
.zone-offline { margin: 0 0 var(--s-2); padding: var(--s-2) var(--s-3); border-radius: 12px; background: var(--c-text); color: var(--c-bg); font-weight: 600; font-size: var(--t-sm); }
.zone-offline[hidden] { display: none; }
.is-expired { opacity: .6; filter: grayscale(.7); }
.expired-tag { display: inline-block; margin-inline-start: var(--s-2); padding: .2em .6em; border-radius: var(--r-pill); background: var(--c-text); color: var(--c-bg); font-size: var(--t-xs); font-weight: 700; }
.zone-save { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin-top: var(--s-3); }
.zone-save[hidden], .zone-save__ask[hidden], .zone-places[hidden] { display: none; }
.zone-save__ask { margin: 0; font-weight: 600; }
.zone-places { margin-bottom: var(--s-4); padding: var(--s-4); border-radius: 20px; background: var(--c-surface); border: 1px solid var(--c-border); }
.zone-places h2 { margin: 0 0 var(--s-2); font-size: var(--t-md, 1rem); }
.zone-places__list { list-style: none; margin: 0; padding: 0; }
.zone-places__list li { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) 0; border-top: 1px solid var(--c-border); }
.zone-places__list li:first-child { border-top: 0; }
.zone-places__list a { flex: 1; font-weight: 600; }
.zone-places__none { font-size: var(--t-xs); color: var(--c-text-2); }
.zone-kit { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-4); border-radius: 20px; background: var(--c-surface); color: var(--c-text); border: 2px solid var(--sev-orange-edge); border-inline-start-width: 8px; }
.zone-kit--red { border-color: var(--sev-red-edge, #c1121f); }
.zone-kit > .icon { flex: none; margin-top: 2px; }
.zone-kit h2 { margin: 0 0 var(--s-1); font-size: var(--t-lg, 1.15rem); }
.zone-kit p { margin: 0; }
.zone-kit__links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); margin-top: var(--s-2) !important; font-weight: 600; }
.zone-guide { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4); border-radius: 20px; background: var(--c-surface-2); color: var(--c-text); text-decoration: none; }
.zone-guide > span { flex: 1; }
.zone-tabs button[aria-selected="true"] { background: var(--c-text); color: var(--c-bg); }
.zone-hero__next { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-1); font-weight: 600; color: var(--c-text); }

/* ==========================================================================
   App instalada (PWA): «Mi zona» de cristal sobre cielo de tormenta (/app).
   Solo la usa /app; todo va bajo .app o body.is-app. Un mundo oscuro deliberado.
   ========================================================================== */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/vendor/inter/inter-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/vendor/inter/inter-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/inter-tight-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/inter-tight-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

body.is-app { background: #04121b; color: #fff; color-scheme: dark; min-height: 100dvh; }
.app {
  --ink-2: rgb(255 255 255 / 0.9); --ink-3: rgb(255 255 255 / 0.74);
  --sev-none: #9fd8c6; --glow: rgb(170 210 190 / 0.2); --bolt: 0;
  --e-out: cubic-bezier(.16, 1, .3, 1); --e-soft: cubic-bezier(.22, .61, .36, 1); --e-pen: cubic-bezier(.37, .01, .2, 1);
  --display: 'Inter Tight', 'Inter', var(--font-sans);
  position: relative; min-height: 100dvh; color: #fff;
  font-family: 'Inter', var(--font-sans); font-feature-settings: 'kern' 1; -webkit-font-smoothing: antialiased;
}
/* El cielo responde al nivel del aviso principal: resplandor en el horizonte y rayo. */
.app:has(.app-hero[data-sev='yellow']) { --glow: rgb(255 214 120 / 0.3); --bolt: 0.5; }
.app:has(.app-hero[data-sev='orange']) { --glow: rgb(255 150 60 / 0.42); --bolt: 1; }
.app:has(.app-hero[data-sev='red']) { --glow: rgb(255 70 70 / 0.42); --bolt: 1; }
.app a { color: inherit; }
.app :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/*
 * Cielo por capas (layout.ts, appSky). El cliente pone --day, --dusk y --night (0 a 1) según la altura del sol y la
 * posición del sol y de la luna; el tiempo sale del aviso vigente (data-wx). Las capas cambian de opacidad con una
 * transición larga, así que el paso del día a la noche o de despejado a lluvia es un fundido.
 * Sin JavaScript (sin data-sky-on) se queda el cielo nublado de la foto.
 */
.app-sky {
  --day: 0.35; --dusk: 0; --night: 0.3; --sun-x: 70%; --sun-y: 30%; --sun-o: 0; --moon-x: 30%; --moon-y: 30%; --moon-o: 0;
  --clear: 1; --few: 0.55; --cloud: 0; --rain: 0; --snow: 0; --fog: 0; --haze: 0; --drift: 1;
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: #0d2a31;
}
.app-sky:not([data-sky-on]) { --cloud: 1; --few: 0; --clear: 0; }
.app-sky[data-sky-still] * { transition: none !important; }
.sky-l { position: absolute; inset: 0; transition: opacity 4s var(--e-soft, ease); }
.sky-day { background: linear-gradient(180deg, #1d5683 0%, #3f82b4 45%, #8bbbd8 72%); opacity: var(--day); }
.sky-dusk { background: linear-gradient(180deg, #23365f 0%, #8a5a78 40%, #e2865a 64%, #f3b36b 72%); opacity: calc(var(--dusk) * 0.9); }
.sky-night { background: linear-gradient(180deg, #030a17 0%, #0a1a33 50%, #17304a 72%); opacity: var(--night); }
.sky-stars {
  opacity: calc(var(--night) * var(--clear) * 0.9);
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff 60%, transparent), radial-gradient(1px 1px at 27% 8%, #fff 60%, transparent),
    radial-gradient(1.4px 1.4px at 41% 26%, #fff 60%, transparent), radial-gradient(1px 1px at 58% 12%, #dfe9ff 60%, transparent),
    radial-gradient(1.2px 1.2px at 73% 30%, #fff 60%, transparent), radial-gradient(1px 1px at 86% 9%, #fff 60%, transparent),
    radial-gradient(1px 1px at 93% 38%, #fff 60%, transparent), radial-gradient(1.3px 1.3px at 6% 44%, #fff 60%, transparent),
    radial-gradient(1px 1px at 34% 47%, #cfe0ff 60%, transparent), radial-gradient(1px 1px at 66% 52%, #fff 60%, transparent);
  background-size: 640px 520px;
}
/*
 * Sol: núcleo blanco que satura, corona, halo amplio y destellos finos (como lo ve una cámara). Cerca del horizonte
 * (--sun-warm) se vuelve anaranjado, crece el halo y se achata un poco por la refracción.
 */
/* Sol y luna van por encima de la sombra de legibilidad y se recortan en el horizonte (72 % de la pantalla). */
.sky-lights { position: absolute; inset: 0 0 28% 0; overflow: hidden; }
/* Tamaños pensados para el móvil: el disco del sol (~50 px) y la luna (~80 px) se ven bien, con la fase clara. */
.sky-sun { --sun-warm: 0; --sun-size: clamp(340px, 110vmin, 600px); position: absolute; left: var(--sun-x); top: calc(var(--sun-y) * 100 / 72);
  width: var(--sun-size); height: var(--sun-size); margin: calc(var(--sun-size) / -2) 0 0 calc(var(--sun-size) / -2);
  border-radius: 50%; pointer-events: none;
  background:
    radial-gradient(circle, #fff 0 8%, rgb(255 254 246 / 0.98) 9.4%, rgb(255 246 214 / 0.8) 11.2%, rgb(255 232 170 / 0.42) 15%,
      rgb(255 214 140 / 0.2) 21%, rgb(255 200 120 / 0.09) 31%, rgb(255 190 110 / 0.035) 46%, transparent 68%);
  transform: scaleY(calc(1 - 0.1 * var(--sun-warm)));
  opacity: calc(var(--sun-o) * (0.18 + 0.82 * var(--clear))); transition: opacity 4s, left 60s linear, top 60s linear, transform 60s linear; }
.sky-sun::before { content: ''; position: absolute; inset: -30%; border-radius: 50%; opacity: var(--sun-warm); transition: opacity 60s linear;
  background: radial-gradient(circle, rgb(255 236 200 / 0.95) 0 6%, rgb(255 170 90 / 0.65) 8.5%, rgb(255 130 60 / 0.3) 14%,
    rgb(240 100 50 / 0.14) 24%, rgb(220 90 60 / 0.05) 40%, transparent 62%); }
.sky-sun__rays { position: absolute; inset: 0; border-radius: 50%; opacity: calc(0.75 - 0.5 * var(--sun-warm));
  background: repeating-conic-gradient(from 3deg, rgb(255 252 235 / 0.16) 0 0.7deg, transparent 0.7deg 6deg),
    repeating-conic-gradient(from 0deg, rgb(255 248 225 / 0.1) 0 1.6deg, transparent 1.6deg 17deg);
  -webkit-mask: radial-gradient(circle, #000 7%, rgb(0 0 0 / 0.5) 17%, transparent 50%); mask: radial-gradient(circle, #000 7%, rgb(0 0 0 / 0.5) 17%, transparent 50%); }
/* Luna: foto real (LRO, NASA, dominio público) con su fase; el lado oscuro, con la tenue luz cenicienta. */
.sky-moon { position: absolute; left: var(--moon-x); top: calc(var(--moon-y) * 100 / 72); --moon-size: clamp(72px, 20vmin, 116px); width: var(--moon-size); height: var(--moon-size); margin: calc(var(--moon-size) / -2) 0 0 calc(var(--moon-size) / -2); overflow: visible;
  opacity: calc(var(--moon-o) * var(--clear)); transition: opacity 4s, left 60s linear, top 60s linear;
  /* Giro paraláctico (sky.ts, moonTilt); el halo solo rodea la parte iluminada (filtro SVG). */
  transform: rotate(var(--moon-rot, 0deg)); }
.sky-moon__ash { opacity: 0.1; }
.sky-moon__lit { filter: brightness(1.3) contrast(1.06); }
@media (prefers-reduced-motion: no-preference) {
  .sky-sun__rays { animation: sky-shimmer 160s linear infinite; }
}
@keyframes sky-shimmer { to { transform: rotate(360deg); } }
/* Nubes sueltas (cielo sin avisos) y cielo cubierto (la foto de siempre). */
.sky-few {
  opacity: calc(var(--few) * (0.35 + 0.65 * var(--day)));
  background:
    radial-gradient(26% 7% at 18% 22%, rgb(255 255 255 / 0.5), transparent 70%), radial-gradient(18% 5% at 30% 19%, rgb(255 255 255 / 0.35), transparent 70%),
    radial-gradient(30% 8% at 70% 34%, rgb(255 255 255 / 0.42), transparent 70%), radial-gradient(16% 5% at 84% 30%, rgb(255 255 255 / 0.3), transparent 70%),
    radial-gradient(22% 6% at 48% 52%, rgb(255 255 255 / 0.25), transparent 70%);
  background-size: 200% 100%;
}
.sky-clouds { opacity: var(--cloud); background: url(/app-cielo.jpg) center 25% / cover no-repeat; }
/* De noche, las nubes se oscurecen. */
.sky-clouds::after { content: ''; position: absolute; inset: 0; background: #020812; opacity: calc(var(--night) * 0.62); transition: opacity 4s; }
.sky-haze { opacity: calc(var(--haze) * (0.3 + 0.7 * var(--day))); background: linear-gradient(180deg, transparent 0%, rgb(255 196 120 / 0.2) 40%, rgb(255 180 100 / 0.55) 72%); }
.sky-fog { opacity: var(--fog); background: linear-gradient(180deg, rgb(200 212 220 / 0.25) 0%, rgb(205 216 224 / 0.8) 70%); }
/* Lluvia y nieve: mosaicos SVG en dos capas de distinto tamaño (cerca y lejos), para que no se note la repetición. */
.sky-rain { opacity: calc(var(--rain) * 0.85); overflow: hidden; }
.sky-rain::before, .sky-rain::after { content: ''; position: absolute; inset: -25%; transform: rotate(12deg); }
.sky-rain::before { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='230'%3E%3Cg stroke='%23d4e6ff' stroke-width='2' stroke-linecap='round'%3E%3Cline x1='6.0' y1='52.2' x2='6.0' y2='107.5' stroke-opacity='0.48'/%3E%3Cline x1='121.2' y1='63.2' x2='121.2' y2='105.3' stroke-opacity='0.67'/%3E%3Cline x1='125.3' y1='126.9' x2='125.3' y2='169.4' stroke-opacity='0.63'/%3E%3Cline x1='135.0' y1='75.0' x2='135.0' y2='107.2' stroke-opacity='0.65'/%3E%3Cline x1='116.3' y1='138.2' x2='116.3' y2='164.0' stroke-opacity='0.57'/%3E%3Cline x1='151.7' y1='24.9' x2='151.7' y2='76.4' stroke-opacity='0.59'/%3E%3Cline x1='151.9' y1='116.4' x2='151.9' y2='163.8' stroke-opacity='0.61'/%3E%3Cline x1='150.1' y1='66.2' x2='150.1' y2='121.1' stroke-opacity='0.53'/%3E%3Cline x1='138.3' y1='32.5' x2='138.3' y2='67.8' stroke-opacity='0.51'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 170px 230px; }
.sky-rain::after { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='130' height='190'%3E%3Cg stroke='%23d4e6ff' stroke-width='1.3' stroke-linecap='round'%3E%3Cline x1='56.6' y1='142.7' x2='56.6' y2='176.7' stroke-opacity='0.40'/%3E%3Cline x1='92.1' y1='11.5' x2='92.1' y2='65.3' stroke-opacity='0.34'/%3E%3Cline x1='72.2' y1='63.3' x2='72.2' y2='104.6' stroke-opacity='0.32'/%3E%3Cline x1='113.3' y1='61.1' x2='113.3' y2='87.0' stroke-opacity='0.35'/%3E%3Cline x1='84.4' y1='69.2' x2='84.4' y2='124.6' stroke-opacity='0.31'/%3E%3Cline x1='53.9' y1='58.1' x2='53.9' y2='91.7' stroke-opacity='0.37'/%3E%3Cline x1='45.2' y1='89.9' x2='45.2' y2='132.0' stroke-opacity='0.33'/%3E%3Cline x1='113.0' y1='126.9' x2='113.0' y2='166.5' stroke-opacity='0.42'/%3E%3Cline x1='80.9' y1='74.9' x2='80.9' y2='116.5' stroke-opacity='0.43'/%3E%3Cline x1='116.9' y1='106.3' x2='116.9' y2='143.8' stroke-opacity='0.33'/%3E%3Cline x1='75.2' y1='52.3' x2='75.2' y2='88.2' stroke-opacity='0.36'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 130px 190px; }
.sky-snow { opacity: var(--snow); overflow: hidden; }
.sky-snow::before, .sky-snow::after { content: ''; position: absolute; inset: -10% 0 0; }
.sky-snow::before { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='230' height='230'%3E%3Cg fill='%23fff'%3E%3Ccircle cx='198.6' cy='28.9' r='3.3' fill-opacity='0.94'/%3E%3Ccircle cx='94.2' cy='37.6' r='2.3' fill-opacity='0.68'/%3E%3Ccircle cx='53.2' cy='144.2' r='3.6' fill-opacity='0.70'/%3E%3Ccircle cx='135.7' cy='34.5' r='2.8' fill-opacity='0.97'/%3E%3Ccircle cx='201.4' cy='200.2' r='3.4' fill-opacity='0.97'/%3E%3Ccircle cx='65.3' cy='6.6' r='3.3' fill-opacity='0.74'/%3E%3Ccircle cx='3.7' cy='141.1' r='2.3' fill-opacity='0.73'/%3E%3Ccircle cx='112.6' cy='156.5' r='3.2' fill-opacity='0.73'/%3E%3Ccircle cx='56.4' cy='87.1' r='3.4' fill-opacity='0.96'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 230px 230px; }
.sky-snow::after { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170'%3E%3Cg fill='%23fff'%3E%3Ccircle cx='83.2' cy='2.8' r='1.3' fill-opacity='0.97'/%3E%3Ccircle cx='154.4' cy='6.3' r='1.8' fill-opacity='0.97'/%3E%3Ccircle cx='162.4' cy='95.8' r='1.4' fill-opacity='0.89'/%3E%3Ccircle cx='39.2' cy='37.0' r='1.5' fill-opacity='0.85'/%3E%3Ccircle cx='129.6' cy='118.2' r='1.3' fill-opacity='0.90'/%3E%3Ccircle cx='8.1' cy='20.9' r='1.7' fill-opacity='0.97'/%3E%3Ccircle cx='116.1' cy='150.0' r='1.3' fill-opacity='0.66'/%3E%3Ccircle cx='144.2' cy='165.7' r='2.1' fill-opacity='0.98'/%3E%3Ccircle cx='71.8' cy='43.7' r='2.0' fill-opacity='0.90'/%3E%3Ccircle cx='68.3' cy='41.5' r='2.1' fill-opacity='0.79'/%3E%3Ccircle cx='94.6' cy='60.7' r='2.1' fill-opacity='0.87'/%3E%3Ccircle cx='57.9' cy='122.0' r='1.9' fill-opacity='0.80'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 170px 170px; opacity: 0.8; }
.sky-ground { top: 72%; background: radial-gradient(140% 60% at 50% 0%, #2f4a2c 0%, #1f3320 40%, #101c12 100%);
  box-shadow: 0 -1px 0 rgb(255 255 255 / 0.06); }
.app-sky:not([data-sky-on]) .sky-ground { opacity: 0; }
.sky-ground::after { content: ''; position: absolute; inset: 0; background: rgb(2 8 16 / 0.6); opacity: var(--night); transition: opacity 4s; }
/* Legibilidad del texto blanco sobre cualquier cielo, y resplandor del nivel del aviso. */
.sky-shade { background:
    linear-gradient(105deg, rgb(4 16 24 / 0.58) 0%, rgb(4 16 24 / 0.3) 45%, rgb(4 16 24 / 0.08) 80%, transparent 100%),
    linear-gradient(0deg, rgb(4 16 24 / 0.5) 0%, transparent 35%),
    linear-gradient(180deg, rgb(4 16 24 / 0.3) 0%, transparent 30%),
    radial-gradient(60% 45% at 100% 74%, var(--glow), transparent 70%); }
[dir='rtl'] .sky-shade { background:
    linear-gradient(255deg, rgb(4 16 24 / 0.58) 0%, rgb(4 16 24 / 0.3) 45%, rgb(4 16 24 / 0.08) 80%, transparent 100%),
    linear-gradient(0deg, rgb(4 16 24 / 0.5) 0%, transparent 35%),
    linear-gradient(180deg, rgb(4 16 24 / 0.3) 0%, transparent 30%),
    radial-gradient(60% 45% at 0% 74%, var(--glow), transparent 70%); }
/* Tiempo del aviso vigente en la zona. */
.app:has(.app-hero[data-wx='rain'], .app-hero[data-wx='flood']) .app-sky[data-sky-on] { --clear: 0; --few: 0; --cloud: 0.9; --rain: 1; }
.app:has(.app-hero[data-wx='storm']) .app-sky[data-sky-on] { --clear: 0; --few: 0; --cloud: 1; --rain: 1; }
.app:has(.app-hero[data-wx='snow'], .app-hero[data-wx='avalanche']) .app-sky[data-sky-on] { --clear: 0; --few: 0; --cloud: 0.75; --snow: 1; }
.app:has(.app-hero[data-wx='wind'], .app-hero[data-wx='coastal']) .app-sky[data-sky-on] { --clear: 0.4; --few: 1; --cloud: 0.55; --drift: 4; }
.app:has(.app-hero[data-wx='fog']) .app-sky[data-sky-on] { --clear: 0.1; --few: 0; --cloud: 0.2; --fog: 1; }
.app:has(.app-hero[data-wx='heat'], .app-hero[data-wx='dust']) .app-sky[data-sky-on] { --clear: 1; --few: 0.2; --haze: 0.8; }
.app:has(.app-hero[data-wx='cold']) .app-sky[data-sky-on] { --clear: 1; --few: 0.3; }
.app:has(.app-hero[data-wx='storm']) .sky-clouds { filter: brightness(0.75); }
.app:not(:has(.app-hero[data-wx='storm'])) .app-sky[data-sky-on] .app-bolt { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .sky-few { animation: sky-drift calc(240s / var(--drift)) linear infinite; }
  .sky-rain::before { animation: sky-rain-near 0.55s linear infinite; }
  .sky-rain::after { animation: sky-rain-far 0.75s linear infinite; }
  .sky-snow::before { animation: sky-snow-near 11s linear infinite; }
  .sky-snow::after { animation: sky-snow-far 15s linear infinite; }
}
@keyframes sky-drift { to { background-position: -200% 0; } }
@keyframes sky-rain-near { to { background-position: 0 230px; } }
@keyframes sky-rain-far { to { background-position: 0 190px; } }
@keyframes sky-snow-near { to { background-position: 0 230px; } }
@keyframes sky-snow-far { to { background-position: 0 170px; } }
.app-bolt { position: absolute; inset-inline-end: 33%; top: 40%; width: clamp(96px, 26vmin, 170px); height: auto; opacity: var(--bolt); transition: opacity 0.8s;
  fill: none; stroke: #e6f6ff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgb(200 235 255 / 0.9)); }
.app-bolt__thin { stroke-width: 1.5; opacity: 0.8; }

/* Cristal: barra, tarjetas y botones */
.app-nav { background: linear-gradient(180deg, rgb(255 255 255 / 0.125) 0%, rgb(255 255 255 / 0.135) 13%, rgb(255 255 255 / 0.098) 34%, rgb(255 255 255 / 0.092) 100%);
  -webkit-backdrop-filter: blur(18px) saturate(115%); backdrop-filter: blur(18px) saturate(115%); }
.app-card, .app .zone-card, .app .zone-row, .app .zone-empty, .app .zone-guide, .app .zone-kit, .app-places .zone-places__list li {
  position: relative; overflow: hidden; color: #fff; border: 0;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.2) 0%, rgb(255 255 255 / 0.258) 24%, rgb(255 255 255 / 0.252) 78%, rgb(255 255 255 / 0.232) 100%);
  -webkit-backdrop-filter: blur(26px) saturate(118%); backdrop-filter: blur(26px) saturate(118%);
}
.app-tool, .app-chip, .app .zone-tabs, .app .lang summary, .app-updated {
  background: rgb(255 255 255 / 0.15); -webkit-backdrop-filter: blur(16px) saturate(115%); backdrop-filter: blur(16px) saturate(115%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .app-nav, .app-card, .app .zone-card, .app .zone-row, .app .zone-empty, .app .zone-guide, .app .zone-kit, .app-places .zone-places__list li { background: rgb(22 52 60 / 0.9); }
}

/* Barra lateral (escritorio) / dock (móvil) */
.app-nav { position: fixed; z-index: 3; inset-block: 14px; inset-inline-start: 16px; width: 72px; border-radius: 26px;
  display: flex; flex-direction: column; align-items: center; padding: 20px 0 24px; }
.app-logo { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: rgb(255 255 255 / 0.16); }
.app-nav ul { list-style: none; margin: 52px 0 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.app-nav ul a { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; text-decoration: none; opacity: 0.78; transition: opacity 0.2s, transform 0.2s; }
.app-nav ul a:hover { opacity: 1; transform: translateY(-1px); }
.app-nav ul a[aria-current='page'] { opacity: 1; }
.app-nav ul a[aria-current='page']::before { content: ''; position: absolute; inset-inline-start: -14px; top: 50%; width: 5px; height: 29px; margin-top: -14.5px;
  border-radius: 3px; background: #fff; box-shadow: 0 0 10px rgb(255 255 255 / 0.55); }
.app-nav ul a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.app-sos { margin-top: auto; display: grid; justify-items: center; gap: 5px; text-decoration: none; font: 700 13px/1 'Inter', var(--font-sans); letter-spacing: 0.02em; }
.app-sos .icon { width: 44px; height: 44px; padding: 12px; border-radius: 50%; background: rgb(224 33 63 / 0.88); }

/* Rejilla */
.app { overflow-x: clip; }
.app-main { position: relative; z-index: 1; max-width: 1480px; padding: 0 clamp(20px, 3vw, 40px) 48px; padding-inline-start: calc(16px + 72px + clamp(24px, 3vw, 40px));
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 340px); column-gap: clamp(28px, 4vw, 64px); align-items: start;
  grid-template-areas: 'head head' 'status sum' 'hero sum' 'kit sum' 'day places' 'more places'; }
.app-live { display: contents; }
.app-head { grid-area: head; }
.app-status { grid-area: status; }
.app-hero { grid-area: hero; }
.app .zone-kit { grid-area: kit; }
.app-sum { grid-area: sum; }
.app-day { grid-area: day; }
.app-places { grid-area: places; }
.app-detail { grid-area: more; }

/* Cabecera */
.app-head { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; min-height: 52px;
  padding-block: max(16px, env(safe-area-inset-top)) 12px; }
/* Franja de cristal a todo el ancho detrás de la cabecera, para leerla sobre lo que pasa por debajo. */
.app-head::before { content: ''; position: absolute; z-index: -1; inset: 0 -100vw; background: rgb(4 18 27 / 0.5);
  -webkit-backdrop-filter: blur(18px) saturate(120%); backdrop-filter: blur(18px) saturate(120%); border-bottom: 1px solid rgb(255 255 255 / 0.08); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .app-head::before { background: rgb(4 18 27 / 0.92); } }
.app-hello { margin: 0; font-size: 16px; color: var(--ink-2); }
.app-who h1 { margin: 10px 0 0; display: flex; align-items: center; gap: 6px; font: 700 clamp(19px, 1.5vw, 22px)/1.1 'Inter', var(--font-sans); letter-spacing: -0.015em; }
.app-tools { margin: 0; display: flex; align-items: center; gap: 12px; }
.app-tool { width: 52px; height: 52px; border-radius: 50%; border: 0; color: #fff; display: grid; place-items: center; cursor: pointer; list-style: none; transition: background 0.2s; }
.app-tool[hidden], .app-save[hidden] { display: none; }
.app-tool::-webkit-details-marker { display: none; }
.app-tool:hover, .app-pick[open] > .app-tool { background: rgb(255 255 255 / 0.26); }
.app-tool:disabled { opacity: 0.75; cursor: progress; }
@media (prefers-reduced-motion: no-preference) { .app-tool[aria-busy='true'] .icon { animation: app-spin 1.2s linear infinite; } }
@keyframes app-spin { to { transform: rotate(360deg); } }
.app .lang summary { height: 52px; min-width: 52px; justify-content: center; padding: 0 14px; border: 0; border-radius: 999px; }
.app .lang summary:hover, .app .lang[open] summary { background: rgb(255 255 255 / 0.26); }
/* El panel se coloca respecto a la cabecera fija (no a la lupa, que en el móvil está en mitad de la fila). */
.app-pick { position: static; }
.app-pick__panel { position: absolute; z-index: 5; inset-inline-end: 0; top: calc(100% - 2px); width: min(360px, 100%); display: grid; gap: 10px; padding: 16px;
  border-radius: 20px; background: rgb(8 28 36 / 0.86); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); box-shadow: 0 18px 40px rgb(0 0 0 / 0.35); }
.app-pick__panel label { font-weight: 600; font-size: 14px; }
.app-pick__row { display: flex; gap: 8px; }
.app-pick__row select { flex: 1; min-width: 0; min-height: 48px; padding: 0 12px; border-radius: 12px; border: 1px solid rgb(255 255 255 / 0.3); background: rgb(255 255 255 / 0.1); color: #fff; font: inherit; }
.app-pick__panel .mun-pick label { font-size: 14px; }
.app-pick__panel .mun-pick input { border-radius: 12px; border: 1px solid rgb(255 255 255 / 0.3); background: rgb(255 255 255 / 0.1); color: #fff; }
.app-pick__panel .mun-pick input::placeholder { color: rgb(255 255 255 / 0.6); }
.app-pick__panel .mun-pick__list { background: rgb(8 28 36 / 0.97); border-color: rgb(255 255 255 / 0.2); color: #fff; }
.app-pick__panel .mun-pick__list li:hover, .app-pick__panel .mun-pick__list li[aria-selected="true"] { background: rgb(255 255 255 / 0.14); }
.app-pick__panel .zone-note { color: rgb(255 255 255 / 0.75); }
.app-zone { margin: 2px 0 0; font-size: 14px; color: var(--ink-3); }
.app-btn { min-height: 48px; padding: 0 18px; border: 0; border-radius: 12px; background: #fff; color: #04121b; font: 600 15px 'Inter', var(--font-sans); cursor: pointer; }
.app-notes { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; }
.app-notes:not(:has(:not(:empty):not([hidden]))) { display: none; }
.app-note { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-3); }
.app-head .app-note { color: #fff; font-weight: 500; }
.app-note:empty { display: none; }
.app-suggest { margin: 0; font-weight: 600; }
.app-suggest[hidden] { display: none; }

/* Estado de los datos */
.app-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 22px 0 16px; }
.app-updated { margin: 0; display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; font-size: 13.5px; color: var(--ink-2); }
.app-updated::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #7ee2b8; box-shadow: 0 0 8px #7ee2b8; }
.app .zone-offline { margin: 0; padding: 7px 13px; border-radius: 999px; background: #fff; color: #04121b; font-size: 13.5px; }

/* Marca de nivel: el nivel nunca va solo con color */
.app-mark { display: inline-grid; place-items: center; flex: none; min-width: 26px; height: 20px; padding: 0 5px; border-radius: 6px;
  font: 700 12px/1 'Inter', var(--font-sans); letter-spacing: -0.02em; background: var(--sev-none); color: #062018; }
.app-mark--info { background: var(--sev-info-bg); color: var(--sev-info-fg); }
.app-mark--yellow { background: var(--sev-yellow-bg); color: var(--sev-yellow-fg); }
.app-mark--orange { background: var(--sev-orange-bg); color: var(--sev-orange-fg); }
.app-mark--red { background: var(--sev-red-bg); color: var(--sev-red-fg); }

/* Titular */
.app-chip { position: relative; overflow: hidden; margin: 0; display: inline-flex; align-items: center; gap: 9px; min-height: 36px; padding: 6px 15px 6px 9px;
  border-radius: 18px; font: 600 15px/1.25 'Inter', var(--font-sans); }
.app-h1 { margin: 20px 0 0; font: 500 clamp(40px, 4.6vw, 64px)/1.17 var(--display); letter-spacing: 0.003em; text-wrap: balance; overflow-wrap: anywhere; }
.app-ln { display: block; overflow: hidden; padding-bottom: 0.06em; }
.app-ln > span { display: block; }
.app-blurb { margin: 18px 0 0; max-width: 34em; font: 500 clamp(15px, 1.15vw, 16.5px)/1.6 'Inter', var(--font-sans); color: rgb(255 255 255 / 0.95); text-wrap: pretty; }
.app-more { margin-top: 16px; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding-bottom: 5px; border-bottom: 1px solid rgb(255 255 255 / 0.45);
  font: 600 15px 'Inter', var(--font-sans); text-decoration: none; }
.app-more:hover { border-color: #fff; }

/* Kit de emergencia */
.app .zone-kit { margin-top: 22px; border-radius: 20px; border-inline-start: 6px solid var(--sev-orange-bg); }
.app .zone-kit--red { border-inline-start-color: var(--sev-red-bg); }
.app .zone-kit a { color: #fff; }

/* Resumen (columna derecha) */
.app-card { border-radius: 26px; }
.app-sum { align-self: stretch; display: flex; flex-direction: column; padding: 24px 24px 20px; margin-top: 4px; --sev: var(--sev-none); }
.app-sum[data-sev='yellow'] { --sev: var(--sev-yellow-bg); }
.app-sum[data-sev='orange'] { --sev: var(--sev-orange-bg); }
.app-sum[data-sev='red'] { --sev: var(--sev-red-bg); }
.app-sum[data-sev='info'] { --sev: var(--sev-info-bg); }
.app-sum__place { margin: 0; display: flex; align-items: center; gap: 10px; font: 600 18px/1.2 'Inter', var(--font-sans); }
.app-sum__k { margin: 22px 0 0; font-size: 14px; color: var(--ink-2); }
.app-sum__lvl { margin: 6px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font: 500 clamp(42px, 4.2vw, 58px)/1.05 var(--display); letter-spacing: -0.035em; overflow-wrap: anywhere; }
.app-sum__lvl::after { content: ''; flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--sev); box-shadow: 0 0 0 4px rgb(255 255 255 / 0.18), 0 0 18px var(--sev); }
.app-sum__what { margin: 10px 0 28px; display: flex; align-items: flex-start; gap: 8px; font: 500 15px/1.4 'Inter', var(--font-sans); color: var(--ink-2); }
.app-sum__what .icon { flex: none; margin-top: 1px; }
.app-sum__days { margin: auto 0 0; padding: 18px 0 0; list-style: none; border-top: 1px solid rgb(255 255 255 / 0.2); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.app-sum__days li { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; font: 600 14.5px/1.15 'Inter', var(--font-sans); }
.app-sum__day { font: 500 12.5px/1 'Inter', var(--font-sans); color: var(--ink-3); }

/* Próximas 24 horas */
.app-label { margin: 0 0 14px; font: 600 13px/1 'Inter', var(--font-sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.app-day { margin-top: 44px; }
.app-day__plot { position: relative; }
.app-hours { position: relative; z-index: 1; height: 230px; margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.app-hours li { display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center; }
.app-hours__t { font: 400 clamp(17px, 1.75vw, 26px)/1 'Inter', var(--font-sans); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.app-hours .is-now .app-hours__t { font-weight: 600; }
.app-chart { position: absolute; inset-inline: 0; top: 44px; width: 100%; height: calc(100% - 82px); overflow: visible; }
[dir='rtl'] .app-chart { transform: scaleX(-1); }
.app-chart__grid line { stroke: rgb(255 255 255 / 0.14); stroke-width: 1; stroke-dasharray: 3 6; vector-effect: non-scaling-stroke; }
.app-chart__fill { fill: url(#app-wf); }
.app-chart__line { fill: none; stroke: url(#app-wg); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.app-chart__line--1 { stroke-width: 7; opacity: 0.17; }
.app-chart__line--2 { stroke-width: 4.6; opacity: 0.26; }
.app-legend { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--ink-2); }
.app-legend > span { display: inline-flex; align-items: center; gap: 6px; }

/* Lugares (los pinta el cliente) */
.app-places { margin-top: 16px; }
.app-places[hidden] { display: none; }
.app-places .app-label { margin-top: 8px; }
.app-places .zone-places__list { margin: 0 0 10px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.app-places .zone-places__list li { display: flex; align-items: center; gap: 10px; min-height: 84px; padding: 14px 16px 14px 22px; border-radius: 24px; border-top: 0; }
.app-places .zone-places__list a { flex: 1; min-width: 0; font: 700 19px/1.15 'Inter', var(--font-sans); letter-spacing: -0.015em; text-decoration: none; }
.app-places .zone-places__list a::after { content: ''; position: absolute; inset: 0; } /* toda la tarjeta abre el lugar */
.app-places .zone-places__list .btn--link { position: relative; z-index: 1; min-height: 44px; color: var(--ink-2); font-size: 13px; }
.app-places .zone-places__none { font-size: 13px; color: var(--ink-2); }

/* Detalle: Ahora / Hoy / Mañana, ríos y guía */
.app-detail { margin-top: 44px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; align-items: start; }
.app-detail > .zone-windows, .app-detail > .app-note { grid-column: 1 / -1; }
.app .zone-tabs { border-radius: 999px; }
.app .zone-tabs button { color: #fff; opacity: 0.85; }
.app .zone-tabs button[aria-selected='true'] { background: #fff; color: #04121b; opacity: 1; box-shadow: none; }
.app .zone-window__title, .app .zone-card__title { color: var(--ink-3); }
.app .zone-row:hover { background: linear-gradient(180deg, rgb(255 255 255 / 0.26), rgb(255 255 255 / 0.3)); }
.app .zone-row__icon { background: rgb(255 255 255 / 0.14); }
.app .zone-row__when, .app .zone-days__what { color: var(--ink-2); }
.app .zone-empty { color: #d6f7e8; }
.app .zone-card { border-radius: 24px; }
.app .zone-card a, .app .river__saih { color: #fff; }
.app .badge--none { background: rgb(255 255 255 / 0.16); color: #fff; }

/* Brillo especular al final de la entrada */
.app-card::after, .app-chip::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 38%; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, transparent 0%, rgb(255 255 255 / 0.17) 50%, transparent 100%); transform: translate3d(-150%, 0, 0) skewX(-18deg); }

/* Coreografía de entrada: solo al abrir (el refresco en directo añade .no-entry) */
@media (prefers-reduced-motion: no-preference) {
  html:not(.no-entry) .app-nav { animation: app-slide 0.92s var(--e-out) 0.05s both; }
  html:not(.no-entry) .app-who > * { animation: app-rise 0.75s var(--e-out) 0.14s both; }
  html:not(.no-entry) .app-who h1 { animation-delay: 0.22s; }
  /* El desplegable de la lupa no se anima: un transform activo haría que su panel se colocase respecto a él. */
  html:not(.no-entry) .app-tools > :not(.app-pick), html:not(.no-entry) .app-pick > summary { animation: app-pop 0.58s var(--e-out) 0.3s both; }
  html:not(.no-entry) .app-pick > summary { animation-delay: 0.365s; }
  html:not(.no-entry) .app-tools > :nth-child(2) { animation-delay: 0.365s; }
  html:not(.no-entry) .app-tools > :nth-child(3) { animation-delay: 0.43s; }
  html:not(.no-entry) .app-tools > :nth-child(4) { animation-delay: 0.495s; }
  html:not(.no-entry) .app-chip { animation: app-wipe 0.8s var(--e-out) 0.44s both; }
  html:not(.no-entry) .app-ln > span { animation: app-line 1.05s var(--e-out) 0.56s both; }
  html:not(.no-entry) .app-ln + .app-ln > span { animation-delay: 0.67s; }
  html:not(.no-entry) .app-blurb { animation: app-down 0.9s var(--e-soft) 0.9s both; }
  html:not(.no-entry) .app-more, html:not(.no-entry) .app-status { animation: app-rise 0.7s var(--e-out) 1.05s both; }
  html:not(.no-entry) .app-sum { animation: app-side 0.95s var(--e-out) 0.8s both; }
  html:not(.no-entry) .app-places { animation: app-side 0.95s var(--e-out) 0.95s both; }
  html:not(.no-entry) .app-hours li { animation: app-rise 0.6s var(--e-out) 1.26s both; }
  html:not(.no-entry) .app-hours li:nth-child(2) { animation-delay: 1.33s; } html:not(.no-entry) .app-hours li:nth-child(3) { animation-delay: 1.4s; }
  html:not(.no-entry) .app-hours li:nth-child(4) { animation-delay: 1.47s; } html:not(.no-entry) .app-hours li:nth-child(5) { animation-delay: 1.54s; }
  html:not(.no-entry) .app-hours li:nth-child(6) { animation-delay: 1.61s; } html:not(.no-entry) .app-hours li:nth-child(7) { animation-delay: 1.68s; }
  html:not(.no-entry) .app-hours li:nth-child(8) { animation-delay: 1.75s; }
  html:not(.no-entry) .app-chart__line { animation: app-draw 1.6s var(--e-pen) 1.5s both; }
  html:not(.no-entry) .app-chart__fill { animation: app-fill 1.42s var(--e-pen) 1.72s both; }
  html:not(.no-entry) .app-detail { animation: app-rise 0.8s var(--e-out) 1.3s both; }
  html:not(.no-entry) .app-card::after, html:not(.no-entry) .app-chip::after { animation: app-sheen 1.15s var(--e-soft) 2.55s 1 both; }
}
@keyframes app-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes app-slide { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
@keyframes app-side { from { opacity: 0; transform: translateX(30px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes app-pop { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: none; } }
@keyframes app-line { from { transform: translateY(115%); } to { transform: none; } }
@keyframes app-down { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
@keyframes app-wipe { from { clip-path: inset(0 100% 0 0 round 18px); } to { clip-path: inset(0 0 0 0 round 18px); } }
@keyframes app-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes app-fill { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@keyframes app-sheen { 0% { opacity: 1; transform: translate3d(-150%, 0, 0) skewX(-18deg); } 99% { opacity: 1; } 100% { opacity: 0; transform: translate3d(260%, 0, 0) skewX(-18deg); } }

/* Móvil y tableta: una columna y dock abajo */
@media (max-width: 999px) {
  .app-main { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'head' 'status' 'hero' 'kit' 'sum' 'day' 'places' 'more';
    padding: 0 max(18px, env(safe-area-inset-right)) calc(104px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
  .app-head { padding-block: max(12px, env(safe-area-inset-top)) 10px; flex-wrap: nowrap; }
  .app-head .app-notes { order: 3; }
  .app-pick__panel { inset-inline: 0; width: auto; }
  .app-head { flex-wrap: wrap; }
  .app-who { flex: 1 1 auto; min-width: 0; }
  .app-who h1 { margin-top: 4px; font-size: 18px; }
  .app-who h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .app-who h1 .icon { vertical-align: -4px; margin-inline-end: 4px; }
  .app-bolt { display: none; }
  .app-tool, .app .lang summary { width: 46px; height: 46px; min-width: 46px; }
  .app .lang summary { width: auto; padding: 0 12px; }
  .app-tools { gap: 8px; }
  .app-hello { font-size: 15px; }
  .app-status { margin: 18px 0 12px; }
  .app-h1 { font-size: clamp(34px, 10vw, 46px); }
  .app-sum { margin-top: 24px; }
  .app-day { margin-top: 32px; padding: 20px 14px 16px; border-radius: 24px; background: rgb(4 16 24 / 0.34); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
  .app-day .app-label { padding-inline-start: 4px; }
  .app-hours { height: 176px; }
  .app-hours__t { font-size: 12px; letter-spacing: -0.02em; }
  .app-chart { top: 30px; height: calc(100% - 62px); }
  .app-legend { padding-inline-start: 4px; }
  .app-detail { margin-top: 28px; }
  .app-nav { inset: auto 0 0 0; width: auto; height: auto; flex-direction: row; justify-content: space-around; align-items: center; border-radius: 24px 24px 0 0;
    padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .app-logo { display: none; }
  .app-nav ul { margin: 0; flex-direction: row; flex: 1; justify-content: space-around; gap: 0; }
  .app-nav ul a { width: auto; min-width: 60px; height: auto; min-height: 52px; gap: 4px; padding: 4px 6px; font: 500 11.5px/1.1 'Inter', var(--font-sans); }
  .app-nav ul a[aria-current='page'] { font-weight: 700; }
  .app-nav ul a[aria-current='page']::before { inset-inline-start: 50%; top: -8px; width: 26px; height: 4px; margin: 0 0 0 -13px; }
  .app-nav ul a span { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .app-sos { margin: 0; min-width: 52px; font-size: 11.5px; gap: 4px; }
  .app-sos .icon { width: 34px; height: 34px; padding: 8px; }
  html:not(.no-entry) .app-nav { animation-name: app-rise; }
  html:not(.no-entry) .app-sum, html:not(.no-entry) .app-places { animation-name: app-rise; }
}
@media (max-width: 380px) {
  .app-nav ul a { min-width: 52px; font-size: 10.5px; }
}

/* ---------- Dock de la app instalada en las páginas de la web (solo en display-mode: standalone) ---------- */
.pwa-dock { display: none; }
@media (display-mode: standalone) {
  :root { --pwa-dock-h: calc(68px + env(safe-area-inset-bottom)); }
  .pwa-dock {
    position: fixed; inset: auto 0 0 0; z-index: 1300; display: flex; align-items: center; justify-content: space-around;
    padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    border-radius: 22px 22px 0 0; color: #fff; background: rgb(8 26 34 / 0.9);
    -webkit-backdrop-filter: blur(18px) saturate(115%); backdrop-filter: blur(18px) saturate(115%); box-shadow: 0 -8px 24px rgb(0 0 0 / 0.18);
  }
  .pwa-dock ul { display: flex; flex: 1; justify-content: space-around; margin: 0; padding: 0; list-style: none; }
  .pwa-dock a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 60px; min-height: 52px; padding: 4px 6px;
    color: #fff; opacity: 0.78; text-decoration: none; font: 500 11.5px/1.1 var(--font-sans); }
  .pwa-dock a[aria-current='page'] { opacity: 1; font-weight: 700; }
  .pwa-dock a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 10px; }
  .pwa-dock__sos { opacity: 1 !important; font-weight: 700 !important; }
  .pwa-dock__sos .icon { width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: rgb(224 33 63 / 0.9); }
  body:not(.is-app) { padding-bottom: var(--pwa-dock-h); }
  /* El mapa ocupa la pantalla: que termine encima del dock. Y la franja del 112 sobra (el dock ya lo lleva). */
  .is-bare .monitor { bottom: var(--pwa-dock-h); }
  .topbar .sos { display: none; }
}
@media (display-mode: standalone) and (max-width: 380px) { .pwa-dock a { min-width: 52px; font-size: 10.5px; } }

/* ---------- App instalada: enlace que sale al navegador («Qué hacer») ---------- */
.app-nav ul a, .pwa-dock a { position: relative; }
.app-ext { position: absolute; top: 4px; inset-inline-end: 4px; opacity: 0.85; }
.app-nav ul a span.app-ext, .app-nav .app-ext { width: 12px; height: 12px; }

/* ---------- Mapa de la app (/app/mapa): el monitor con el cristal de «Mi zona» ---------- */
.app-map {
  --c-bg: #04121b; --c-surface: rgb(255 255 255 / 0.14); --c-surface-2: rgb(255 255 255 / 0.1); --c-line: rgb(255 255 255 / 0.22);
  --c-text: #fff; --c-text-2: rgb(255 255 255 / 0.9); --c-text-3: rgb(255 255 255 / 0.8); --c-link: #a9d4ff; --c-focus: #fff; --c-ok: #7ee2b8;
  color: #fff; font-family: 'Inter', var(--font-sans);
}
.app-map .leaflet-container { background: #04121b; }
.app-map .leaflet-tile-pane { filter: saturate(0.8) brightness(0.8) contrast(1.05); }
.app-map .monitor__panel, .app-map .mon-sheet, .app-map .mon-show {
  border: 0; color: #fff; box-shadow: 0 18px 48px rgb(0 0 0 / 0.32);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.16), rgb(255 255 255 / 0.1)), rgb(6 22 30 / 0.62);
  -webkit-backdrop-filter: blur(26px) saturate(118%); backdrop-filter: blur(26px) saturate(118%);
}
.app-map .monitor__panel { top: 14px; bottom: 14px; inset-inline-start: calc(16px + 72px + 16px); border-radius: 26px; }
.app-map .mon-sheet { inset-inline-start: calc(16px + 72px + 16px + 400px + 16px); border-radius: 26px; }
.app-map .mon-show { inset-inline-start: calc(16px + 72px + 16px); }
.app-map__who { min-width: 0; }
.app-map__who .app-hello { margin: 0; font-size: 15px; color: rgb(255 255 255 / 0.86); }
.app-map__who h1 { margin: 4px 0 0; font: 600 22px/1.1 'Inter Tight', 'Inter', var(--font-sans); letter-spacing: -0.015em; }
.app-map .mon-locate { background: #fff; color: #04121b; border-radius: 14px; min-height: 48px; }
.app-map .mon-chip { background: rgb(255 255 255 / 0.12); border-color: rgb(255 255 255 / 0.22); color: #fff; }
.app-map .mon-chip[aria-pressed='true'] { background: #fff; color: #04121b; border-color: #fff; }
.app-map .mon-seg { background: rgb(255 255 255 / 0.12); }
.app-map .mon-seg a[aria-checked='true'] { background: #fff; color: #04121b; }
.app-map .mon-row:hover, .app-map .mon-row[aria-current='true'] { background: rgb(255 255 255 / 0.12); }
.app-map .mon-level { color: #fff; }
.app-map .leaflet-bar a, .app-map .mon-view { background: rgb(6 22 30 / 0.78); color: #fff; border-color: rgb(255 255 255 / 0.2); }
.app-map .leaflet-control-attribution { background: rgb(4 18 27 / 0.6); color: rgb(255 255 255 / 0.8); }
.app-map .leaflet-control-attribution a { color: #fff; }
@media (max-width: 999px) {
  .app-map { bottom: calc(68px + env(safe-area-inset-bottom)); }
}
@media (max-width: 760px) {
  .app-map .monitor__panel { inset-inline: 8px; bottom: 8px; top: auto; border-radius: 26px; padding-bottom: 12px; }
  .app-map .mon-sheet { inset: 0; border-radius: 0; }
  .app-map .mon-show { inset-inline-start: 50%; }
}

/* ---------- Ríos de la app (/app/rios) ---------- */
.rv-main { grid-template-columns: minmax(0, 760px); grid-template-areas: none; display: block; }
.app-seg { display: flex; padding: 4px; border-radius: 999px; background: rgb(255 255 255 / 0.15); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.app-seg a { min-height: 40px; padding: 0 16px; display: grid; place-items: center; border-radius: 999px; font: 500 14px 'Inter', var(--font-sans); text-decoration: none; }
.app-seg a[aria-current='page'] { background: #fff; color: #04121b; font-weight: 600; }
.rv-far { margin: 0 0 12px; color: #fff; }
.rv-hero { margin-top: 8px; }
.rv-trend.is-sharp .icon { color: #ffb066; }
.rv-trend.is-rising .icon { color: var(--sev-yellow-bg); }
.rv-card { margin-top: 22px; padding: 20px 20px 18px; border-radius: 26px; display: flex; flex-direction: column; gap: 14px; }
.rv-chart { margin: 0; }
.rv-chart__top { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--ink-2); }
.rv-chart__top b { color: #fff; }
.rv-chart__svg { display: block; width: 100%; height: 170px; margin-top: 10px; overflow: visible; }
[dir='rtl'] .rv-chart__svg, [dir='rtl'] .rv-mini { transform: scaleX(-1); }
.rv-base { stroke: rgb(255 255 255 / 0.5); stroke-width: 1.5; stroke-dasharray: 2 5; vector-effect: non-scaling-stroke; }
.rv-now { stroke: rgb(255 255 255 / 0.35); stroke-width: 1; vector-effect: non-scaling-stroke; }
.rv-fill { fill: rgb(255 255 255 / 0.14); }
.rv-past, .rv-fcst { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.rv-past { stroke: #fff; }
.rv-fcst { stroke: #fff; stroke-dasharray: 7 6; }
.is-rising .rv-fcst { stroke: var(--sev-yellow-bg); }
.is-sharp .rv-fcst { stroke: #ffb066; }
.rv-peak { fill: #ffb066; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.is-rising .rv-peak { fill: var(--sev-yellow-bg); }
.rv-days { position: relative; height: 18px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--ink-3); }
.rv-days li { position: absolute; inset-inline-start: var(--x); transform: translateX(-50%); white-space: nowrap; }
[dir='rtl'] .rv-days li { transform: translateX(50%); }
.rv-days li:first-child { transform: none; }
.rv-days li.is-now { color: #fff; font-weight: 600; }
.rv-legend { margin: 6px 0 0; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.rv-legend__base { width: 22px; border-top: 2px dotted rgb(255 255 255 / 0.7); }
.rv-facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 14px; border-top: 1px solid rgb(255 255 255 / 0.2); }
.rv-facts dt { font-size: 13px; color: var(--ink-3); }
.rv-facts dd { margin: 4px 0 0; font: 500 26px/1.1 var(--display); letter-spacing: -0.02em; }
.rv-facts small { font: 500 13px 'Inter', var(--font-sans); color: var(--ink-2); }
.rv-model { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.app .rv-card .river__saih { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; color: #fff; }
.rv-more { margin-top: 28px; }
.rv-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.rv-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; }
.rv-row__text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.rv-row__text b { font-weight: 600; font-size: 15.5px; }
.rv-row__trend { font-size: 13px; color: var(--ink-2); }
.rv-row__trend.is-sharp { color: #ffc999; }
.rv-row__trend.is-rising { color: #ffe680; }
.app .rv-row .river__saih { justify-self: start; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; font-size: 13px; color: #fff; }
.rv-mini { flex: none; overflow: visible; }
.rv-mini .rv-past, .rv-mini .rv-fcst { stroke-width: 2; }
.rv-empty { margin-top: 20px; padding: 20px; border-radius: 22px; }

/*
 * El tiempo de «Mi zona» (spec 001, R-011): «Ahora», próximas horas, 7 días y viento y más. Usa currentColor para
 * servir igual en la web (fondo claro) y en la app instalada (cristal oscuro).
 */
.wx { position: relative; margin-block: var(--s-4, 16px); }
.zone-wx { padding: var(--s-4, 16px); border-radius: 20px; background: var(--c-surface); border: 1px solid var(--c-border); }
.app-wx { padding: 22px 22px 18px; margin-top: 4px; }
.wx-title { margin: 0 0 12px; font-size: var(--t-md, 1rem); font-weight: 650; }
.wx-h { margin: 18px 0 8px; font-size: 0.8rem; font-weight: 650; letter-spacing: 0.02em; opacity: 0.8; }
.wx-muted { opacity: 0.72; font-size: 0.875rem; }
.wx p { margin: 0; }
.wx-ico { width: 1.75rem; height: 1.75rem; flex: none; }
.wx-now { display: flex; align-items: center; gap: 14px; }
.wx-now .wx-ico { width: 3.6rem; height: 3.6rem; }
.wx-now__temp { font-size: 3rem; font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; }
.wx-now__sky { font-weight: 650; font-size: 1.1rem; }
.wx-hours { display: flex; gap: 6px; overflow-x: auto; list-style: none; margin: 0; padding: 2px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.wx-hours:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 10px; }
.wx-hours li { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 3.4rem; padding: 8px 4px; border-radius: 14px; scroll-snap-align: start;
  background: color-mix(in srgb, currentColor 7%, transparent); }
.wx-hours__t { font-size: 0.8rem; opacity: 0.8; }
.wx-hours__temp { font-weight: 650; font-variant-numeric: tabular-nums; }
.wx-pop { font-size: 0.75rem; color: inherit; opacity: 0.85; min-height: 1em; font-variant-numeric: tabular-nums; }
.wx-days { list-style: none; margin: 0; padding: 0; }
.wx-days li { display: grid; grid-template-columns: 5.5rem 1.75rem 1fr auto auto; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent); }
.wx-days li:first-child { border-top: 0; }
.wx-days__d { font-weight: 600; }
.wx-days__sky { font-size: 0.9rem; opacity: 0.85; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-days__t { font-variant-numeric: tabular-nums; text-align: end; white-space: nowrap; }
.wx-more { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 8px; }
.wx-more li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, currentColor 7%, transparent); }
.wx-k { font-size: 0.8rem; opacity: 0.8; }
.wx-v { display: flex; align-items: center; gap: 6px; font-weight: 650; }
.wx-arrow { width: 1.1rem; height: 1.1rem; flex: none; }
.wx-src { margin-top: 14px !important; }
@media (max-width: 420px) {
  .wx-days li { grid-template-columns: 4.6rem 1.6rem 1fr auto; }
  .wx-days__sky { display: none; }
}

/*
 * Sin aviso vigente (data-wx="none"), el cielo de la app sigue el tiempo previsto para ahora (R-011 CA-6), que el
 * cliente deja en data-wx-now. Con aviso manda el aviso (reglas de arriba).
 */
.app:has(.app-hero[data-wx='none']) .app-sky[data-sky-on][data-wx-now='clear'] { --clear: 1; --few: 0; --cloud: 0; }
.app:has(.app-hero[data-wx='none']) .app-sky[data-sky-on][data-wx-now='few'] { --clear: 1; --few: 0.8; --cloud: 0; }
.app:has(.app-hero[data-wx='none']) .app-sky[data-sky-on][data-wx-now='cloudy'] { --clear: 0.55; --few: 1; --cloud: 0.35; }
.app:has(.app-hero[data-wx='none']) .app-sky[data-sky-on][data-wx-now='overcast'] { --clear: 0; --few: 0; --cloud: 1; }
.app:has(.app-hero[data-wx='none']) .app-sky[data-sky-on][data-wx-now='haze'] { --clear: 1; --few: 0.2; --haze: 0.8; }
.app:has(.app-hero[data-wx='none']) .app-sky[data-sky-on][data-wx-now='fog'] { --clear: 0.1; --few: 0; --cloud: 0.2; --fog: 1; }
.app:has(.app-hero[data-wx='none']) .app-sky[data-sky-on][data-wx-now='showers'] { --clear: 0.2; --few: 0.6; --cloud: 0.7; --rain: 0.6; }
.app:has(.app-hero[data-wx='none']) .app-sky[data-sky-on]:is([data-wx-now='rain'], [data-wx-now='sleet']) { --clear: 0; --few: 0; --cloud: 0.9; --rain: 1; }
.app:has(.app-hero[data-wx='none']) .app-sky[data-sky-on][data-wx-now='snow'] { --clear: 0; --few: 0; --cloud: 0.75; --snow: 1; }
.app:has(.app-hero[data-wx='none']) .app-sky[data-sky-on][data-wx-now='storm'] { --clear: 0; --few: 0; --cloud: 1; --rain: 1; }
.app:has(.app-hero[data-wx='none']) .app-sky[data-sky-on][data-wx-now='storm'] .sky-clouds { filter: brightness(0.75); }
/* Fondo animado apagado (R-012 CA-5): el cielo se queda quieto. */
.app-sky[data-sky-off] *, .app-sky[data-sky-off] *::before, .app-sky[data-sky-off] *::after { animation: none !important; transition: none !important; }

/* Personalizar «Mi zona» (R-012): bloques ocultos y panel. */
[data-hide-guide] .zone-guide, [data-hide-kit] .zone-kit { display: none !important; }
.prefs-bar { margin: var(--s-3, 12px) 0 0; }
.app .prefs-bar .prefs-open { color: #fff; }
.settings { padding: 4px; max-width: 40rem; }
.settings:not(.settings--app) { border-radius: 20px; background: var(--c-surface); border: 1px solid var(--c-border); }
.settings--app { max-width: none; }
.prefs-form { padding: 20px; display: grid; gap: 14px; }
.settings h2 { margin: 0; font-size: 1.15rem; }
.settings fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.settings legend { font-weight: 650; margin-bottom: 6px; padding: 0; }
.prefs-blocks { list-style: none; margin: 0; padding: 0; width: 100%; }
.prefs-blocks li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0;
  border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent); }
.prefs-blocks li:first-child { border-top: 0; }
.prefs-opt { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.prefs-move { display: flex; gap: 4px; }
.prefs-move button { min-width: 44px; min-height: 44px; border-radius: 12px; border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  background: transparent; color: inherit; font-size: 1.1rem; cursor: pointer; }
.prefs-move button:disabled { opacity: 0.35; cursor: default; }
.prefs-note { font-size: 0.85rem; opacity: 0.75; margin: 0; }
.prefs-actions { display: flex; justify-content: space-between; gap: 12px; }
.app .settings .btn { color: #fff; border-color: rgb(255 255 255 / 0.35); }
.settings-wrap { margin-bottom: var(--s-6, 32px); }
