/* Brisa para WeeWX: estilos comunes a todas las páginas. */

/* Tipografías servidas desde la propia web (licencia SIL OFL 1.1, en font/). Subconjunto latino. */
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 200 700; font-stretch: 100%; font-display: swap;
  src: url("../font/BricolageGrotesque-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 400 600; font-stretch: 100%; font-display: swap;
  src: url("../font/InstrumentSans-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("../font/GeistMono-latin.woff2") format("woff2");
}

:root {
  --sky-top: #b9d4ea;
  --sky-mid: #dbe7f0;
  --sky-low: #f1ece5;
  --fg: #0f1f2d;
  --muted: #4f6577;
  --faint: #8597a6;
  --on-fg: #f5f8fb;
  --panel: rgba(255, 255, 255, .5);
  --panel-strong: rgba(255, 255, 255, .78);
  --line: rgba(15, 31, 45, .11);
  --cold: #2f7fd0;
  --warm: #e07322;
  --mild: #23978a;
  --rain: #2d7cbd;
  --moon: #fdf8ea;
  --sun: #f0a62a;
  --cloud: #ffffff;
  --cloud-edge: rgba(15, 31, 45, .22);
  --map: #dce5eb;
  --warn-yellow: #f2c400; --warn-orange: #f08a00; --warn-red: #e0312b; --on-warn: #241a00;
  --good: #2f9e5b;
  /* Paleta «Universal Blue» de RainViewer: 15, 25, 30, 35, 45 y 55 dBZ */
  --dbz-1: #88ddee; --dbz-2: #0077aa; --dbz-3: #005588; --dbz-4: #ffee00; --dbz-5: #ff4400; --dbz-6: #ffaaff;
  --uv-1: #3c9f55; --uv-2: #d9b21f; --uv-3: #e5821f; --uv-4: #d4433a; --uv-5: #8a4fc0;
  --gallo: url("../img/gallo.png");
  --logo-full: url("../img/logo.png");
  --accent: var(--mild);
  --font-display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Helvetica Neue", system-ui, sans-serif;
  --font-data: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sky-top: #050c17; --sky-mid: #0c1929; --sky-low: #182739;
    --fg: #e7edf3; --muted: #9cadbd; --faint: #6d8193; --on-fg: #0b1522;
    --panel: rgba(255, 255, 255, .055); --panel-strong: rgba(255, 255, 255, .1); --line: rgba(231, 237, 243, .12);
    --cold: #6aaef0; --warm: #f2a35c; --mild: #45bfae; --rain: #64a9e6; --moon: #efe6cc;
    --sun: #f5b94a; --cloud: #c7d2dc; --cloud-edge: rgba(0, 0, 0, 0); --map: #0e1b2a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sky-top: #050c17; --sky-mid: #0c1929; --sky-low: #182739;
  --fg: #e7edf3; --muted: #9cadbd; --faint: #6d8193; --on-fg: #0b1522;
  --panel: rgba(255, 255, 255, .055); --panel-strong: rgba(255, 255, 255, .1); --line: rgba(231, 237, 243, .12);
  --cold: #6aaef0; --warm: #f2a35c; --mild: #45bfae; --rain: #64a9e6; --moon: #efe6cc;
  --sun: #f5b94a; --cloud: #c7d2dc; --cloud-edge: rgba(0, 0, 0, 0); --map: #0e1b2a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.fine a, .legend a, .alerts-src a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 2px; }
.fine a:hover, .legend a:hover, .alerts-src a:hover { text-decoration-color: currentColor; }
body {
  background: var(--sky-low);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 85% -12%, color-mix(in oklch, var(--accent) 34%, transparent), transparent 62%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 48%, var(--sky-low) 100%);
  transition: background 1.2s;
}
h1, h2, h3, p, dl, dd { margin: 0; }
b { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-inline: clamp(16px, 4vw, 40px);
  padding-block: 22px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 30px;
}

/* Cabecera */
.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; }
.station-name { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em; }
.station-meta { color: var(--muted); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-data); font-size: 12px; color: var(--muted);
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--accent) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }

.tile, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 26px;
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  backdrop-filter: blur(20px) saturate(1.2);
  min-width: 0;
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.logo {
  flex: none; width: 46px; height: 50px; background: var(--fg);
  -webkit-mask: var(--gallo) center / contain no-repeat; mask: var(--gallo) center / contain no-repeat;
}
.footer-logo {
  display: block; width: 150px; aspect-ratio: 480 / 396; background: var(--muted);
  -webkit-mask: var(--logo-full) center / contain no-repeat; mask: var(--logo-full) center / contain no-repeat;
}
.nav { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; padding: 6px 14px; border-radius: 999px; white-space: nowrap; }
.nav a:hover { color: var(--fg); }
.nav a[aria-current="page"] { background: var(--fg); color: var(--on-fg); }
.nav a:focus-visible, .theme-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--fg); display: grid; place-items: center; cursor: pointer; padding: 0; }
.theme-btn svg { width: 15px; height: 15px; }
.tile-head h3, .label {
  font-family: var(--font-body); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
}

footer { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px 28px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--faint); }
footer .footer-logo { width: 120px; }
.footer-text { display: grid; gap: 4px; max-width: 62ch; }
.footer-text .own { font-size: 14px; color: var(--muted); }
@media (max-width: 540px) { footer { grid-template-columns: 1fr; } footer .footer-logo { width: 104px; } }

@media (max-width: 980px) { .nav { order: 3; width: 100%; } }

/* Cabecera de página */
.page-head { display: grid; gap: 12px; padding-top: 6px; }
.page-head h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.4rem, 7vw, 3.8rem); letter-spacing: -0.04em; line-height: 1; }
.page-head p { color: var(--muted); max-width: 62ch; text-wrap: pretty; }
.page-head p b { color: var(--fg); }
.page-head .lead { color: var(--fg); font-size: clamp(1.05rem, 2.2vw, 1.25rem); max-width: 52ch; }

/* Registros */
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.jump a { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); }
.jump a:hover { color: var(--fg); }
.jump a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.groups { display: grid; gap: 14px; }
.group { padding: 20px 22px 8px; scroll-margin-top: 16px; }
.group h2 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 500; letter-spacing: -0.015em; margin-bottom: 6px; }
.rec { width: 100%; border-collapse: collapse; }
.rec th, .rec td { text-align: left; padding: 12px 14px 12px 0; border-top: 1px solid var(--line); vertical-align: top; }
.rec thead th { border-top: 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding-bottom: 6px; }
.rec thead th:first-child { width: 38%; }
.rec tbody th { font-weight: 500; font-size: 14px; color: var(--muted); }
.rec td { width: 31%; }
.rec .v { display: block; font-family: var(--font-display); font-size: 1.2rem; font-weight: 450; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.rec .v small { font-family: var(--font-body); font-size: .8rem; color: var(--muted); letter-spacing: 0; margin-left: 2px; }
.rec .d, .rec .x { display: block; font-family: var(--font-data); font-size: 11.5px; color: var(--faint); }
.rec .x { color: var(--muted); }
.rec td.new .v { color: var(--accent); }
.badge { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 600; color: var(--accent); border: 1px solid color-mix(in oklch, var(--accent) 45%, transparent); border-radius: 999px; padding: 1px 8px; }
.rec td::before { content: attr(data-col); display: none; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); margin-bottom: 2px; }

.note { font-size: 12.5px; color: var(--faint); max-width: 70ch; }

@media (max-width: 600px) {
  .group { padding: 16px 16px 4px; }
  .rec thead { display: none; }
  .rec tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; border-top: 1px solid var(--line); padding-block: 12px; }
  .rec tbody tr:first-child { border-top: 0; }
  .rec th, .rec td { border: 0; padding: 0; width: auto; }
  .rec tbody th { grid-column: 1 / -1; margin-bottom: 6px; color: var(--fg); }
  .rec td::before { display: block; }
}

/* Informes */

.picker { padding: 14px 18px; display: grid; }
.yr-row { display: grid; grid-template-columns: 4.2rem repeat(12, minmax(0, 1fr)); gap: 4px; align-items: center; padding-block: 5px; border-top: 1px solid var(--line); }
.yr-row:first-child { border-top: 0; }
.picker a, .picker span.off {
  display: block; text-align: center; text-decoration: none; font-size: 13px; font-weight: 500;
  padding: 5px 0; border-radius: 999px; color: var(--muted);
}
.picker a.year { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--fg); text-align: left; padding-left: 8px; }
.picker a:hover { color: var(--fg); background: var(--panel-strong); }
.picker a[aria-current="true"] { background: var(--fg); color: var(--on-fg); }
.picker a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.picker span.off { color: var(--faint); opacity: .5; }

.report { padding: 22px 22px 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.report-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; }
.report-head h2 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 500; letter-spacing: -0.02em; }
.report-head p { font-family: var(--font-data); font-size: 12px; color: var(--faint); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 18px; }
.stats > div { padding-block: 10px; border-top: 1px solid var(--line); }
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd { font-family: var(--font-display); font-size: 1.5rem; font-weight: 400; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stats dd small { font-family: var(--font-body); font-size: .8rem; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.stats .when { display: block; font-family: var(--font-data); font-size: 11.5px; color: var(--faint); }

.table-wrap { overflow-x: auto; margin-inline: -22px; padding-inline: 22px; }
.noaa { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 760px; }
.noaa th, .noaa td { padding: 9px 10px; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; font-size: 14px; }
.noaa thead th { border-top: 0; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); vertical-align: bottom; white-space: normal; line-height: 1.3; }
.noaa th:first-child, .noaa td:first-child { text-align: left; padding-left: 0; }
.noaa tbody th { font-weight: 500; }
.noaa tbody th small { color: var(--faint); font-weight: 400; margin-left: 4px; }
.noaa tbody th a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
.noaa tbody th a:hover { text-decoration-color: var(--fg); }
.noaa .t { display: block; font-family: var(--font-data); font-size: 11px; color: var(--faint); }
.noaa .hi { color: var(--warm); }
.noaa .lo { color: var(--cold); }
.noaa .wet { color: var(--rain); font-weight: 600; }
.noaa .zero { color: var(--faint); }
.noaa td.bar { width: 22%; min-width: 140px; vertical-align: middle; }
.band { position: relative; height: 6px; border-radius: 999px; background: var(--line); }
.band i { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, var(--cold), var(--mild), var(--warm)); }
.noaa tfoot td, .noaa tfoot th { border-top: 2px solid var(--line); font-weight: 600; }

.empty { padding: 26px 0 18px; color: var(--muted); max-width: 60ch; }
.empty code { font-family: var(--font-data); font-size: 13px; color: var(--fg); }

details.raw { border-top: 1px solid var(--line); padding-top: 12px; }
details.raw summary { cursor: pointer; font-size: 14px; font-weight: 500; color: var(--muted); }
details.raw summary:hover { color: var(--fg); }
details.raw pre { margin: 12px 0 0; padding: 16px; border-radius: 14px; background: var(--panel-strong); border: 1px solid var(--line); overflow-x: auto; font-family: var(--font-data); font-size: 12px; line-height: 1.45; color: var(--fg); }

@media (max-width: 640px) {
  .yr-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .picker a.year { grid-column: 1 / -1; padding-left: 4px; }
  .report { padding: 18px 16px 12px; }
  .table-wrap { margin-inline: -16px; padding-inline: 16px; }
}

/* Sobre */

.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.card { padding: 20px 22px; display: grid; gap: 12px; align-content: start; }
.card h2 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 500; letter-spacing: -0.015em; }
.card > p { color: var(--muted); text-wrap: pretty; }

.sheet { display: grid; }
.sheet > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-block: 10px; border-top: 1px solid var(--line); }
.sheet dt { color: var(--muted); font-size: 14px; }
.sheet dd { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.sheet dd a { color: var(--fg); text-decoration-color: var(--line); text-underline-offset: 3px; }
.sheet dd a:hover { text-decoration-color: var(--fg); }

.sensors { list-style: none; margin: 0; padding: 0; display: grid; }
.sensors li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: center; padding-block: 9px; border-top: 1px solid var(--line); }
.sensors svg { width: 26px; height: 26px; color: var(--accent); }
.sensors b { display: block; font-weight: 500; }
.sensors span { font-size: 13px; color: var(--muted); }
.derived { font-size: 13px; color: var(--muted); padding-top: 4px; }

.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; counter-reset: step; }
.flow li { position: relative; padding: 16px 18px; display: grid; gap: 6px; align-content: start; }
.flow li::before {
  counter-increment: step; content: counter(step);
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600; font-size: 14px; background: var(--fg); color: var(--on-fg);
}
.flow li:not(:last-child)::after { content: "→"; position: absolute; right: -13px; top: 18px; color: var(--faint); font-size: 16px; }
.flow b { font-family: var(--font-display); font-size: 1.1rem; font-weight: 500; }
.flow p { font-size: 13.5px; color: var(--muted); text-wrap: pretty; }

.sources { display: grid; }
.sources > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding-block: 10px; border-top: 1px solid var(--line); }
.sources dt { font-weight: 500; }
.sources dd { color: var(--muted); font-size: 14px; text-align: right; }

.disclaimer { font-size: 13.5px; color: var(--muted); max-width: 70ch; text-wrap: pretty; }

@media (max-width: 980px) {
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow li:nth-child(2)::after { display: none; }
}
@media (max-width: 680px) {
  .cols { grid-template-columns: 1fr; }
  .card { padding: 18px 16px; }
  .flow { grid-template-columns: 1fr; }
  .flow li::after { display: none; }
  .sources > div { grid-template-columns: 1fr; }
  .sources dd { text-align: left; }
}

/* Cielo */
.night { padding: 22px 22px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.night-chart svg { display: block; width: 100%; overflow: visible; }
.night-chart text { font-family: var(--font-data); font-size: 10.5px; fill: var(--faint); }
.night-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--muted); }
.night-legend .sw { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.night-legend .sw.line { height: 3px; border-radius: 2px; }
.planets { list-style: none; margin: 0; padding: 0; display: grid; }
.planets li { display: grid; grid-template-columns: 7rem minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; padding-block: 11px; border-top: 1px solid var(--line); }
.planets li:first-child { border-top: 0; }
.planets .p-name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 500; }
.planets .p-when { font-size: 14px; }
.planets .p-meta { font-family: var(--font-data); font-size: 11.5px; color: var(--faint); text-align: right; }
.planets li.off .p-name, .planets li.off .p-when { color: var(--faint); }
.moon-big { display: flex; align-items: center; gap: 18px; }
.moon-big svg { flex: none; }
.moon-big .moon-name { font-family: var(--font-display); font-size: 1.4rem; font-weight: 450; }
.moon-big p { color: var(--muted); font-size: 14px; }
.sheet dd small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.calendar { list-style: none; margin: 0; padding: 0; display: grid; }
.calendar li { display: grid; grid-template-columns: 4.6rem 1.4rem minmax(0, 12rem) minmax(0, 1fr); gap: 4px 12px; align-items: baseline; padding-block: 8px; border-top: 1px solid var(--line); font-size: 14px; }
.calendar li.cal-month { display: block; border-top: 0; padding-top: 14px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.calendar li.cal-month:first-child { padding-top: 0; }
.calendar .cal-date { font-family: var(--font-data); font-size: 12px; color: var(--muted); }
.calendar .cal-icon { color: var(--accent); text-align: center; }
.calendar .cal-name { font-weight: 500; }
.calendar .cal-det { color: var(--muted); font-size: 13px; }
.calendar li.cal-lluvia .cal-icon { color: var(--sun); }
@media (max-width: 640px) {
  .night { padding: 18px 16px 12px; }
  .planets li { grid-template-columns: 1fr; }
  .planets .p-meta { text-align: left; }
  .calendar li { grid-template-columns: 4.6rem 1.4rem minmax(0, 1fr); }
  .calendar .cal-det { grid-column: 3; }
}

/* Cúpula celeste */
.dome-panel { padding: 22px 22px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.dome { width: 100%; max-width: 560px; margin-inline: auto; }
.dome svg { display: block; width: 100%; height: auto; }
.dome text { font-family: var(--font-body); }
.dome-readout { font-size: 14px; text-align: center; max-width: 60ch; margin-inline: auto; text-wrap: pretty; }
.dome-readout b { font-weight: 600; }
@media (max-width: 640px) { .dome-panel { padding: 18px 12px 12px; } }

/* ================= Portada ================= */
/* Ahora */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 28px 48px;
  align-items: end;
  padding-block: 8px 4px;
}
.hero-curve { position: absolute; left: 0; right: 0; top: 18%; bottom: 22%; width: 100%; height: 60%; z-index: 0; pointer-events: none; overflow: visible; }
.hero-main, .hero-stats { position: relative; z-index: 1; min-width: 0; }
.when { color: var(--muted); font-size: 14px; }
.when b { color: var(--fg); font-weight: 500; }
.temp {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96;
  font-weight: 250;
  font-size: clamp(6.4rem, 25vw, 12rem);
  line-height: .86;
  letter-spacing: -0.055em;
  display: flex;
  align-items: flex-start;
  margin-block: 6px 14px;
  font-variant-numeric: tabular-nums;
}
.temp .deg { color: var(--accent); font-weight: 300; font-size: .52em; line-height: 1; margin-left: .04em; letter-spacing: 0; }
.summary { font-size: clamp(1rem, 2.2vw, 1.2rem); max-width: 36ch; text-wrap: pretty; }
.summary .hl { color: var(--accent); font-weight: 600; }
.range { margin-top: 22px; max-width: 460px; display: grid; gap: 8px; }
.range-labels { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.range-labels b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.range-track { position: relative; height: 6px; border-radius: 999px; background: var(--line); }
.range-fill { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.range-dot {
  position: absolute; top: 50%; width: 14px; height: 14px; margin-left: -7px; margin-top: -7px; border-radius: 50%;
  background: var(--fg); box-shadow: 0 0 0 3px var(--sky-mid);
  transition: left 1.1s cubic-bezier(.2, .8, .2, 1);
}
.range-note { font-size: 12px; color: var(--faint); }
.hero-stats { display: grid; }
.hero-stats > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-block: 12px; border-top: 1px solid var(--line); }
.hero-stats > div:last-child { border-bottom: 1px solid var(--line); }
.hero-stats dt { color: var(--muted); font-size: 14px; }
.hero-stats dd { font-family: var(--font-display); font-size: 1.55rem; font-weight: 400; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hero-stats dd.aqi { font-size: 1.2rem; white-space: nowrap; }
.aqi-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.hero-stats dd small { font-family: var(--font-body); font-size: .8rem; color: var(--muted); margin-left: 2px; letter-spacing: 0; }

/* Instrumentos */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile { padding: 18px 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.tile-sun, .tile-rose { grid-column: span 2; }
.rose-body { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 20px; }
.rose { width: 100%; max-width: 200px; aspect-ratio: 1; display: block; }
.rose-legend { display: grid; gap: 3px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rose-legend span { display: flex; align-items: center; gap: 8px; }
.rose-legend i { width: 10px; height: 10px; border-radius: 3px; }
.tile-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tile-note { font-size: 13px; color: var(--accent); font-weight: 500; text-align: right; }
.big { font-family: var(--font-display); font-size: 2.6rem; font-weight: 350; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.big small { font-family: var(--font-body); font-size: .95rem; color: var(--muted); letter-spacing: 0; margin-left: 4px; font-weight: 400; }
.facts { margin-top: auto; display: grid; }
.facts > div { display: flex; justify-content: space-between; gap: 12px; padding-block: 7px; border-top: 1px solid var(--line); font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.compass { width: 100%; max-width: 176px; aspect-ratio: 1; margin-inline: auto; display: block; }
.needle { transform-origin: 80px 80px; transition: transform 1.4s cubic-bezier(.2, .8, .2, 1); }
.rain-body { display: flex; gap: 16px; align-items: center; }
.water { transform-box: fill-box; transform-origin: bottom; transition: transform 1.3s cubic-bezier(.2, .8, .2, 1); }
.rain-now { font-size: 13px; color: var(--muted); margin-top: 6px; }
.normal { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.normal-bar { height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.normal-bar span { display: block; height: 100%; background: var(--rain); border-radius: 99px; }
.trend { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--accent); }
.spark { width: 100%; height: auto; display: block; }
.uv-scale { display: flex; gap: 3px; height: 8px; position: relative; margin-top: 4px; }
.uv-scale span { border-radius: 99px; opacity: .85; }
.uv-mark { position: absolute; top: -5px; width: 4px; height: 18px; margin-left: -2px; border-radius: 3px; background: var(--fg); box-shadow: 0 0 0 2px var(--sky-mid); }
.uv-ticks { display: flex; justify-content: space-between; font-family: var(--font-data); font-size: 10px; color: var(--faint); }
.sun-body { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: center; }
.sun-arc { width: 100%; height: auto; display: block; }
.sun-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.sun-meta b { color: var(--fg); font-variant-numeric: tabular-nums; }
.moon { display: flex; align-items: center; gap: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.moon svg { flex: none; width: 64px; height: 64px; }
.moon-name { font-family: var(--font-display); font-size: 1.25rem; font-weight: 450; letter-spacing: -0.01em; }
.moon p { font-size: 13px; color: var(--muted); }
.sun-meta .gain { margin-left: 6px; font-family: var(--font-data); font-size: 11.5px; color: var(--muted); }
.sun-civil { font-size: 12.5px; color: var(--faint); margin-top: 6px; }
.moon-phases { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }
.moon-phases span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tile-sun .more { align-self: flex-start; font-size: 13px; }

/* Gráfica */
.chart-panel { padding: 22px 22px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px 20px; }
.chart-head > * { min-width: 0; }
.readout { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 6px; min-height: 2.4rem; }
.ro-v { font-family: var(--font-display); font-size: 2.1rem; font-weight: 350; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ro-u { color: var(--muted); font-size: .95rem; margin-left: -6px; }
.ro-t { font-family: var(--font-data); font-size: 12px; color: var(--muted); }
.ro-s { font-size: 13px; color: var(--muted); }
.controls { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; }
.seg {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px;
  background: var(--panel-strong); border: 1px solid var(--line);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap;
  border: 0; background: transparent; color: var(--muted);
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
  transition: background .2s, color .2s;
}
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--on-fg); }
button:focus-visible, .chart:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chart { position: relative; touch-action: pan-y; border-radius: 12px; cursor: crosshair; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font-family: var(--font-data); font-size: 10.5px; fill: var(--faint); }
.chart-stats { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 18px; }
.chart-stats b { color: var(--fg); font-variant-numeric: tabular-nums; }
.legend-dash { display: inline-block; width: 18px; border-top: 2px dashed var(--muted); vertical-align: middle; margin-right: 6px; }

/* Récords de la portada */
.records-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; }
.records-head h2, .chart-title h2 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 500; letter-spacing: -0.015em; text-wrap: balance; }
.records-head p { font-size: 13px; color: var(--muted); }
.records-head p b { color: var(--accent); font-weight: 600; }
.more { color: var(--fg); font-size: 14px; font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--line); white-space: nowrap; }
.more:hover { border-color: var(--fg); }
.more:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.rec-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.rec-card { padding: 16px 18px; display: grid; gap: 4px; align-content: start; }
.rec-card .big { font-size: 2.1rem; margin-top: 6px; }
.rec-card .d { font-family: var(--font-data); font-size: 11.5px; color: var(--faint); }
.rec-card .yr { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rec-card .yr b { color: var(--fg); font-weight: 500; }
.rec-card.new .big { color: var(--accent); }
.rec-card .badge { justify-self: start; font-size: 11px; font-weight: 600; color: var(--accent); border: 1px solid color-mix(in oklch, var(--accent) 45%, transparent); border-radius: 999px; padding: 1px 8px; }

@media (max-width: 980px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-sun, .tile-rose { grid-column: 1 / -1; }
  .rec-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-curve { top: 8%; height: 40%; }
}
@media (max-width: 540px) {
  .tiles { grid-template-columns: 1fr; }
  .chart-panel { padding: 18px 16px 14px; }
}
@media (max-width: 380px) {
  .rec-cards { grid-template-columns: 1fr; }
}

/* Tarjetas de temporada (calor, invierno, polen) */
.tile-season { grid-column: span 2; }
.tile-season.solo { grid-column: 1 / -1; }
.season-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.season-stats .big { font-size: 2.2rem; }
.season-stats .lbl { font-size: 13px; color: var(--fg); margin-top: 6px; }
.season-stats .cmp { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.season-stats .cmp b { color: var(--fg); font-weight: 500; }
.pollen { display: grid; gap: 12px; }
.pollen-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.pollen-row:first-child { padding-top: 0; border-top: 0; }
.pollen-name { font-weight: 500; }
.pollen-level { font-size: 13px; font-weight: 600; color: var(--lvl); }
.pollen-days { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pollen-days span { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.pollen-days i { height: 6px; border-radius: 99px; background: var(--lvl); }
@media (max-width: 980px) { .tile-season { grid-column: 1 / -1; } }
@media (max-width: 540px) { .season-stats { grid-template-columns: 1fr 1fr; } }

/* Lluvia del año hidrológico frente a años anteriores */
.tile-hidro { grid-column: 1 / -1; }
.hidro-sum { font-size: 14.5px; line-height: 1.5; margin: 0 0 10px; max-width: 70ch; }
.hidro-chart svg { display: block; width: 100%; overflow: visible; touch-action: pan-y; }
.hidro-chart text { font-family: var(--font-data); font-size: 10.5px; fill: var(--faint); }
.hidro-read { min-height: 1.5em; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; margin: 6px 0 0; }
.hidro-read b { color: var(--fg); font-weight: 500; }

/* ================= Portada: fuentes externas ================= */
/* Terremotos */
.tile-quake { grid-column: 1 / -1; }
.quake-body { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px 32px; align-items: center; }
.quake-map { width: 100%; max-width: 210px; aspect-ratio: 1; display: block; margin-inline: auto; }
.quakes { list-style: none; margin: 0; padding: 0; display: grid; }
.quakes li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding-block: 9px; border-top: 1px solid var(--line); }
.quakes li:first-child { border-top: 0; }
.mag {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 500; font-variant-numeric: tabular-nums;
  background: color-mix(in oklab, var(--accent) var(--m), var(--panel-strong)); color: var(--fg);
}
.q-where { font-weight: 500; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.q-meta { display: block; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.q-ago { font-family: var(--font-data); font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.felt { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); }
@media (max-width: 760px) { .quake-body { grid-template-columns: 1fr; } }

/* Previsión */
.section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 16px; }
.section-head h2 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 500; letter-spacing: -0.015em; text-wrap: balance; }
.fine { font-size: 12.5px; color: var(--faint); }
.forecast { padding: 22px; display: grid; gap: 18px; }
.fc-summary { font-size: 15px; max-width: 64ch; text-wrap: pretty; }
.hours {
  display: flex; gap: 2px; overflow-x: auto; padding-bottom: 6px;
  scroll-snap-type: x proximity; scrollbar-width: thin;
}
.hour {
  flex: 0 0 62px; display: grid; justify-items: center; align-content: start; gap: 6px;
  padding: 10px 4px 8px; border-radius: 16px; scroll-snap-align: start; font-variant-numeric: tabular-nums;
}
.hour.now { background: var(--panel-strong); }
.hour .h { font-family: var(--font-data); font-size: 12px; color: var(--muted); white-space: nowrap; }
.hour.now .h, .hour .h.dname { color: var(--fg); font-weight: 500; }
.hour .t { font-family: var(--font-display); font-size: 1.2rem; font-weight: 450; }
.hour.event .t { font-size: .92rem; font-family: var(--font-data); font-weight: 500; padding-top: 4px; }
.hour .p { font-size: 11.5px; color: var(--rain); font-weight: 600; min-height: 1.1em; }
.hour svg { width: 32px; height: 32px; }
.days { display: grid; }
.day {
  display: grid; grid-template-columns: 6.2rem 34px 3.6rem 2.8rem minmax(0, 1fr) 2.8rem;
  align-items: center; gap: 14px; padding-block: 8px; border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.day .n { font-weight: 500; }
.day svg { width: 32px; height: 32px; }
.day .pop { display: grid; line-height: 1.2; }
.day .pop b { color: var(--rain); font-size: 13px; }
.day .pop span { color: var(--muted); font-size: 11.5px; }
.day .lo { color: var(--muted); text-align: right; font-family: var(--font-display); font-size: 1.1rem; }
.day .hi { font-family: var(--font-display); font-size: 1.1rem; font-weight: 500; }
.day-bar { position: relative; height: 5px; border-radius: 99px; background: var(--line); }
.day-bar .f { position: absolute; top: 0; bottom: 0; border-radius: 99px; }
.day-bar .now { position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--fg); box-shadow: 0 0 0 2px var(--sky-mid); }
.fc-summary .src { display: block; margin-top: 4px; font-family: var(--font-data); font-size: 11.5px; color: var(--faint); }
.fc-summary .stale { margin-top: 6px; }
#fcStamp .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.linklike { font: inherit; color: var(--fg); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.stale {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body); font-size: 12px; font-weight: 600;
  color: var(--on-warn); background: var(--warn-yellow); padding: 2px 9px; border-radius: 99px;
}

/* Avisos */
.alerts { display: grid; gap: 8px; margin-top: -8px; }
.alert {
  display: flex; gap: 14px; align-items: center; padding: 12px 18px; border-radius: 20px;
  background: color-mix(in oklab, var(--lvl) 16%, var(--panel-strong));
  border: 1px solid color-mix(in oklab, var(--lvl) 50%, transparent);
}
.alert svg { flex: none; width: 26px; height: 26px; }
.alert-body { min-width: 0; }
.alert-title { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.alert-meta { font-size: 13px; color: var(--muted); }
.lvl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 2px 8px; border-radius: 99px; background: var(--lvl); color: var(--on-warn); }
.alerts-src { font-family: var(--font-data); font-size: 11.5px; color: var(--faint); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }

/* Radar */
.radar { padding: 22px; display: grid; gap: 14px; }
.radar-frame { position: relative; aspect-ratio: 16 / 9; max-width: 100%; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--map); }
.radar-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.radar-time {
  position: absolute; left: 12px; top: 12px; font-family: var(--font-data); font-size: 12px;
  padding: 5px 10px; border-radius: 999px; background: var(--panel-strong); color: var(--fg);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--line);
}
.radar-time.future { background: var(--accent); color: var(--on-fg); border-color: transparent; }
.radar-controls { display: flex; align-items: center; gap: 14px; }
.play {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--fg); color: var(--on-fg);
}
.play svg { width: 16px; height: 16px; }
.scrub { position: relative; flex: 1; min-width: 0; padding-bottom: 18px; }
.scrub input { width: 100%; margin: 0; accent-color: var(--accent); }
.scrub .ticks span { position: absolute; bottom: 0; transform: translateX(-50%); font-family: var(--font-data); font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.scrub .ticks span:first-child { transform: none; }
.scrub .ticks span:last-child { transform: translateX(-100%); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 12px; color: var(--muted); }
.legend > div:first-child { flex: 0 1 280px; min-width: 0; }
.legend-labels { display: flex; justify-content: space-between; width: min(280px, 100%); font-size: 11px; }
.legend-scale { display: flex; gap: 2px; width: min(280px, 100%); }
.legend-scale span { flex: 1; height: 8px; border-radius: 2px; }
@media (max-width: 540px) {
  .forecast, .radar { padding: 18px 16px 14px; }
  .day { grid-template-columns: 3.4rem 28px 2.9rem 2.2rem minmax(0, 1fr) 2.2rem; gap: 8px; }
  .day svg { width: 28px; height: 28px; }
  .radar-frame { aspect-ratio: 1 / 1; }
}

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