/* Red de Napas — estilos del sitio público
   Dirección: brutalista y mínimo. Hormigón, negro y un solo azul (el del logo).
   Sin sombras, sin bordes redondeados, sin degradados. La estructura es de bordes gruesos.
   Las clases y la estructura HTML se mantienen: solo cambia el diseño. */

:root {
  color-scheme: light;
  --paper: #b8dcf6;          /* celeste */
  --paper-2: #9ecbed;
  --surface: #f6f6f3;
  --surface-2: #d9ecfa;
  --ink: #000000;
  --ink-2: #333333;
  --line: #000000;
  --line-soft: #8f908c;
  --water: #0b4fd8;
  --water-deep: #0838a0;
  --water-mid: #0b4fd8;
  --water-pale: rgba(11, 79, 216, .1);
  --link: #0b4fd8;
  --amber: #0b4fd8;
  --ground: #9ecbed;
  --btn: #000000;
  --btn-ink: #ffffff;
  --btn-hover: #0b4fd8;
  --glass: #b8dcf6;
  --seg-on: #000000;
  --map-bg: #9ecbed;
  --tile-filter: grayscale(1) contrast(.9) brightness(1.05);
  --casing: #ffffff;
  --soil-a: #d9ecfa; --soil-b: #d9ecfa; --soil-hatch: #8f908c;
  --off-a: #d9ecfa; --off-b: #9ecbed;

  --lv0: #1f9d63; --lv0-tint: #d3efe0; --lv0-text: #0b4a2c;
  --lv1: #d99a00; --lv1-tint: #f8e7b4; --lv1-text: #4d3500;
  --lv2: #e8710a; --lv2-tint: #fbd9b8; --lv2-text: #5c2a00;
  --lv3: #d92d43; --lv3-tint: #f6c7ce; --lv3-text: #6b0f1d;
  --lvx: #7c8aa5; --lvx-tint: #dcdde0; --lvx-text: #333333;

  --radius: 0;
  --radius-lg: 0;
  --maxw: 200rem;
  --pad: clamp(1.1rem, 3.2vw, 4.5rem);
  --rule: 3px;
  --shadow: none;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, "Liberation Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--paper); }
body { margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.65; color: var(--ink); background: var(--paper); overflow-x: hidden; }
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: .2em; }
a:hover { color: var(--water-deep); }
:focus-visible { outline: 3px solid var(--water-mid); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--btn); color: #fff; }
.muted { color: var(--ink-2); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: 1.1rem; }
@media (min-width: 48rem) { .wrap { padding-inline: clamp(2rem, 4vw, 5rem); } }
.skip { position: absolute; left: -999px; top: 0; background: var(--btn); color: #fff; padding: .6rem 1rem; z-index: 100; font-weight: 700; }
.skip:focus { left: 0; }

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.015em; color: var(--ink); }
h1 { font-size: clamp(2.1rem, 1.2rem + 4vw, 3.6rem); font-weight: 700; letter-spacing: -.03em; }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.3vw, 2rem); font-weight: 700; }
h3 { font-size: 1.12rem; font-weight: 700; }
p { margin: 0 0 1em; }
.prose { max-width: 68ch; }
.prose ul, .prose ol { padding-left: 1.25em; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.prose h3, .prose h4 { margin-top: 1.2em; }
.prose blockquote { margin: 1em 0; padding: .4em 1.1em; border-left: 3px solid var(--water-mid); background: var(--water-pale); border-radius: 0 var(--radius) var(--radius) 0; }
.prose strong { color: var(--ink); }

/* Detalle de marca: filete azul corto bajo los títulos */
.page-head h1::after, .eyebrow-line { content: ""; display: block; width: 3.5rem; height: 4px; background: var(--water); border-radius: 3px; margin-top: 1rem; transform-origin: left; }
.eyebrow { display: block; font-size: .85rem; font-weight: 500; color: var(--water); margin-bottom: .8rem; }

/* ---------- Emergencias ---------- */
.emerg { background: var(--paper-2); color: var(--ink); font-size: .88rem; border-bottom: 1px solid var(--line-soft); }
.emerg-in { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; align-items: center; padding-block: .45rem; }
.emerg-label { color: var(--ink-2); }
.emerg ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .1rem 1.2rem; }
.emerg a { color: var(--ink); text-decoration: none; padding: .15rem 0; display: inline-block; }
.emerg a:hover, .emerg a:focus-visible { color: var(--water); }
.emerg strong { font-size: 1.05em; margin-right: .2em; color: var(--water); }

/* ---------- Cabecera ---------- */
.site-head { background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; z-index: 50; transition: box-shadow .3s; }
.site-head.scrolled { box-shadow: 0 8px 24px -16px rgba(23, 35, 59, .25); }
.head-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .7rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-logo, .brand-mark { width: 44px; height: 44px; object-fit: contain; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.08rem; letter-spacing: .01em; }
.brand-text span { font-size: .78rem; color: var(--ink-2); }
.nav-toggle { display: none; background: transparent; border: 1.5px solid var(--line); color: var(--ink); border-radius: 999px; padding: .45rem 1.1rem; font: inherit; font-weight: 500; cursor: pointer; }
.nav-toggle:hover { border-color: var(--water-mid); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .15rem; flex-wrap: wrap; }
.nav a { position: relative; display: block; padding: .45rem .6rem; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: .88rem; white-space: nowrap; border-radius: 999px; transition: color .2s, background .2s; }
.nav a:hover { color: var(--water); background: var(--water-pale); }
.nav a[aria-current="page"] { color: var(--water); background: var(--surface-2); }
@media (max-width: 70rem) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; width: 100%; }
  .nav.open { display: block; animation: drop .25s var(--ease); }
  .nav ul { flex-direction: column; border-top: 1px solid var(--line); padding-top: .5rem; gap: .1rem; }
  .nav a { padding: .75rem 1rem; border-radius: var(--radius); }
}
@keyframes drop { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Botón de modo claro / oscuro ---------- */
.theme-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.theme-toggle { order: 3; display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0; background: transparent; border: 1px solid var(--line); color: var(--ink); border-radius: 50%; font: inherit; cursor: pointer; flex: none; transition: background .2s, border-color .2s, color .2s; }
.theme-toggle:hover { background: var(--water-pale); border-color: var(--water-mid); color: var(--water); }
.theme-toggle .ic-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ic-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .ic-moon { display: none; }
.brand { order: 1; } .nav { order: 2; }
@media (max-width: 70rem) {
  .theme-toggle { order: 2; margin-left: auto; }
  .nav-toggle { order: 3; }
  .nav { order: 4; }
}


/* ---------- Avisos ---------- */
.notice { padding: .7rem 0; font-weight: 500; border-bottom: 1px solid var(--line-soft); }
.notice a { color: inherit; font-weight: 700; }
.notice-info { background: var(--surface-2); color: var(--water-deep); }
.notice-warning { background: var(--lv1-tint); color: var(--lv1-text); }
.notice-danger { background: var(--lv3); color: #fff; }
.notice-danger a { color: #fff; }

.main { padding-block: 2.5rem 4rem; min-height: 60vh; }
.page-head { margin-bottom: 2rem; }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 62ch; margin-bottom: 0; }
.lede strong { color: var(--ink); }
.section { margin-top: 4rem; }
.section > h2 { margin-bottom: .4rem; }
.section-note { color: var(--ink-2); max-width: 70ch; margin-bottom: 1.2rem; }

/* ---------- Portada: héroe ---------- */
.hero { display: grid; gap: 2rem 3rem; align-items: center; margin-bottom: 2rem; }
@media (min-width: 62rem) { .hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.hero .page-head { margin: 0; }
.ill { width: 100%; height: auto; display: block; border-radius: var(--radius-lg); background: var(--ill-bg); border: 1px solid var(--line); box-shadow: var(--shadow); }
.ill text { font-family: var(--font); }
.ill .ill-water { animation: ill-rise 14s ease-in-out infinite; }
.ill .ill-wave { animation: ill-slide 10s linear infinite; }
.ill .ill-wave2 { animation: ill-slide 16s linear infinite reverse; opacity: .45; }
.ill .drop { stroke-dasharray: 10 80; animation: ill-rain 1.8s linear infinite; }
.ill .drop:nth-child(2) { animation-delay: -.4s; } .ill .drop:nth-child(3) { animation-delay: -1s; } .ill .drop:nth-child(4) { animation-delay: -.2s; } .ill .drop:nth-child(5) { animation-delay: -.7s; } .ill .drop:nth-child(6) { animation-delay: -1.3s; }
@keyframes ill-rise { 0%, 8% { transform: translateY(40px); } 55%, 70% { transform: translateY(-24px); } 100% { transform: translateY(40px); } }
@keyframes ill-slide { from { transform: translateX(0); } to { transform: translateX(-240px); } }
@keyframes ill-rain { from { stroke-dashoffset: 90; } to { stroke-dashoffset: 0; } }

/* ---------- Olas decorativas (pie) ---------- */
.waves { position: relative; height: 56px; overflow: hidden; line-height: 0; pointer-events: none; }
.waves svg { position: absolute; left: 0; bottom: 0; width: 200%; height: 100%; max-width: none; }
.waves .w-back { animation: wave-x 40s linear infinite reverse; opacity: .35; }
.waves .w-front { animation: wave-x 28s linear infinite; }
.waves .w-fill { fill: var(--surface-2); }
.waves .w-line { fill: none; stroke: var(--water-mid); stroke-width: 2; vector-effect: non-scaling-stroke; opacity: .7; }
@keyframes wave-x { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Estado (píldoras) ---------- */
.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .1rem .7rem .1rem .55rem; border-radius: 999px; font-weight: 600; font-size: .83rem; border: 1px solid var(--c); background: var(--bg); color: var(--tx); white-space: nowrap; line-height: 1.5; }
.pill .g { color: var(--c); font-size: .8em; line-height: 1; }
.lv0 { --c: var(--lv0); --bg: var(--lv0-tint); --tx: var(--lv0-text); }
.lv1 { --c: var(--lv1); --bg: var(--lv1-tint); --tx: var(--lv1-text); }
.lv2 { --c: var(--lv2); --bg: var(--lv2-tint); --tx: var(--lv2-text); }
.lv3 { --c: var(--lv3); --bg: var(--lv3-tint); --tx: var(--lv3-text); }
.lvx { --c: var(--lvx); --bg: var(--lvx-tint); --tx: var(--lvx-text); }

/* ---------- Resumen / filtros ---------- */
.status-line { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; align-items: center; color: var(--ink-2); margin-top: 1.5rem; font-size: .92rem; }
.status-line strong { color: var(--ink); }
.live-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--lv0); margin-right: .45rem; }
.live-dot.stale { background: var(--lv2); }
@media (prefers-reduced-motion: no-preference) { .live-dot.pulse { animation: pulse 2.4s ease-out infinite; } }
@keyframes pulse { from { box-shadow: 0 0 0 0 rgba(31,157,99,.5); } to { box-shadow: 0 0 0 10px rgba(31,157,99,0); } }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .8rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.tile { width: 100%; text-align: left; font: inherit; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem .8rem; color: var(--ink); display: block; position: relative; overflow: hidden; box-shadow: var(--shadow); transition: border-color .2s, background .2s; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.tile:hover { border-color: var(--c); }
.tile[aria-pressed="true"] { background: var(--bg); border-color: var(--c); }
.tile b { display: block; font-size: 2.4rem; line-height: 1.05; font-weight: 700; letter-spacing: -.03em; }
.tile span { font-size: .82rem; color: var(--ink-2); font-weight: 500; }

/* ---------- Corte del terreno ---------- */
.profile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.4rem 1.2rem 1.2rem; margin-top: 2rem; box-shadow: var(--shadow); }
.profile-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; align-items: baseline; margin-bottom: 1.1rem; }
.profile-head h2 { margin: 0; font-size: 1.3rem; }
.profile-head p { margin: 0; color: var(--ink-2); font-size: .93rem; max-width: 48ch; }
.profile-body { display: flex; gap: .5rem; }
.axis { position: relative; width: 2.6rem; flex: none; margin-top: 2.35rem; font-size: .78rem; color: var(--ink-2); }
.axis span { position: absolute; right: .35rem; transform: translateY(-50%); }
.axis span::after { content: ""; position: absolute; right: -.35rem; top: 50%; width: .3rem; border-top: 1px solid var(--ink-2); }
.cores { display: flex; gap: 6px; overflow-x: auto; padding-bottom: .4rem; flex: 1; align-items: flex-start; scroll-snap-type: x proximity; }
.core { flex: 1 0 4.3rem; min-width: 4.3rem; max-width: 9rem; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; scroll-snap-align: start; transition: opacity .3s; }
.core:hover { color: var(--ink); }
.core:hover .core-col { outline: 2px solid var(--water-mid); }
.core-head { height: 2.1rem; margin-bottom: .25rem; display: flex; align-items: flex-end; justify-content: center; }
.core-head .pill { font-size: .72rem; padding: .05rem .45rem .05rem .35rem; }
.core-col { position: relative; height: var(--chart-h, 250px); background: linear-gradient(180deg, #5aa6e8 0%, #2f86d6 45%, #0a64b2 100%); border-radius: 0 0 8px 8px; overflow: hidden; border-top: 3px solid #b9cde6; }
.core-soil { position: absolute; inset: 0 0 auto 0; background:
    radial-gradient(circle at 18% 30%, var(--soil-dot) 0 2px, transparent 3px) 0 0 / 22px 26px,
    radial-gradient(circle at 70% 65%, var(--soil-dot) 0 2.5px, transparent 3.5px) 0 0 / 30px 34px,
    linear-gradient(180deg, var(--soil-a) 0%, var(--soil-b) 100%); border-bottom: 3px solid #fff; }
.core-water-line { position: absolute; left: 0; right: 0; height: 0; border-top: 3px solid #fff; }
.core-val { position: absolute; left: 50%; transform: translate(-50%, -50%); background: var(--surface); color: var(--ink); font-weight: 700; font-size: .86rem; padding: .05rem .45rem; border-radius: 6px; border: 2px solid var(--c, var(--water)); white-space: nowrap; z-index: 2; box-shadow: 0 2px 6px rgba(23,35,59,.15); }
.core-tick { position: absolute; left: 0; width: 10px; height: 4px; background: var(--c); border-radius: 0 2px 2px 0; box-shadow: 0 0 0 1px rgba(255,255,255,.9); z-index: 1; }
.core.off .core-col { background: repeating-linear-gradient(135deg, var(--off-a) 0 8px, var(--off-b) 8px 16px); border-top-color: #c5cddb; }
.core.off .core-val { border-color: var(--lvx); color: var(--lvx-text); }
.core-name { font-size: .8rem; line-height: 1.25; margin-top: .5rem; color: var(--ink); text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.profile-legend { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; font-size: .82rem; color: var(--ink-2); margin: .9rem 0 0; padding-left: 3.1rem; }
.profile-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.sw { width: .9rem; height: .9rem; border-radius: 3px; display: inline-block; flex: none; }
.sw-soil { background: linear-gradient(180deg, var(--soil-a), var(--soil-b)); border: 1px solid #c5cddb; }
.sw-water { background: linear-gradient(180deg, #5aa6e8, #0a64b2); }
.sw-tick { width: .9rem; height: 4px; background: var(--lv2); }
.core.dim { opacity: .3; }
.cores.play .core-soil { animation: soil-in 1.1s var(--ease) both; }
.cores.play .core-water-line, .cores.play .core-val { animation: line-in 1.1s var(--ease) both; }
@keyframes soil-in { from { height: 0; } }
@keyframes line-in { from { top: 0; } }

/* ---------- Tabla + mapa ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; margin-top: 3rem; align-items: start; }
.split > * { min-width: 0; }
@media (min-width: 75rem) { .split { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } .split .mapbox { position: sticky; top: 5.5rem; } }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl caption { text-align: left; padding: 1.1rem 1.2rem .5rem; font-weight: 700; font-size: 1.2rem; color: var(--ink); }
.tbl th { text-align: left; font-weight: 500; font-size: .8rem; color: var(--ink-2); padding: .7rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--paper-2); }
.tbl th button { all: unset; cursor: pointer; font-weight: 500; color: inherit; }
.tbl th button:hover { color: var(--water); }
.tbl th button:focus-visible { outline: 3px solid var(--water-mid); }
.tbl td { padding: .7rem .75rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--paper-2); }
.tbl .r { text-align: right; }
.tbl td.depth { font-weight: 700; font-size: 1.12rem; color: var(--ink); }
.tbl .sub { display: block; font-size: .82rem; color: var(--ink-2); font-weight: 400; }
.tbl a.st-link { font-weight: 700; text-decoration: none; color: var(--ink); }
.tbl a.st-link:hover { color: var(--water); text-decoration: underline; }
.delta.up { color: var(--lv3-text); font-weight: 600; white-space: nowrap; }
.delta.down { color: var(--lv0-text); font-weight: 600; white-space: nowrap; }
@media (max-width: 40rem) { .hide-sm { display: none; } .tbl td, .tbl th { padding-inline: .6rem; } }
.empty { padding: 2rem 1rem; text-align: center; color: var(--ink-2); }

/* ---------- Mapas ---------- */
.mapbox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.mapbox h2 { font-size: 1.2rem; padding: 1.1rem 1.2rem .6rem; margin: 0; }
.map { height: 26rem; background: var(--map-bg); }
.map-lg { height: min(72vh, 42rem); min-height: 22rem; border-radius: var(--radius-lg); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow); }
.leaflet-container { font-family: var(--font); background: var(--map-bg); z-index: 0; }
/* Mapa base apagado: sin color de más, así las calles marcadas son lo único que resalta */
.leaflet-tile-pane { filter: var(--tile-filter); }
.street-casing { stroke: var(--casing); }
.leaflet-control-attribution { background: var(--glass) !important; color: var(--ink-2) !important; }
.leaflet-control-attribution a { color: var(--water) !important; }
.leaflet-bar { border: 1px solid var(--line) !important; box-shadow: var(--shadow) !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-bar a { background: var(--surface) !important; color: var(--ink) !important; border-bottom-color: var(--line) !important; }
.leaflet-bar a:hover { background: var(--surface-2) !important; color: var(--water) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); box-shadow: 0 10px 30px rgba(23,35,59,.18); }
.leaflet-popup-content-wrapper { border-radius: var(--radius); }
.leaflet-container a.leaflet-popup-close-button { color: var(--ink-2); }
.leaflet-tooltip { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(23,35,59,.15); font-weight: 500; }
.leaflet-tooltip-top:before { border-top-color: var(--line); }
.mk { display: grid; place-items: center; min-width: 2.5rem; height: 2rem; padding: 0 .3rem; border-radius: 1rem; background: var(--c); color: #fff; font-weight: 700; font-size: .86rem; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(23,35,59,.35); white-space: nowrap; }
.map-pop h3 { margin: 0 0 .25rem; font-size: 1rem; }
.map-pop p { margin: .2rem 0; }
.map-pop .btn { margin-top: .4rem; }

/* ---------- Pronóstico ---------- */
.matrix-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.matrix { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: .93rem; min-width: 34rem; }
.matrix th, .matrix td { padding: .55rem .55rem; text-align: center; border-radius: 6px; }
.matrix thead th { font-size: .78rem; color: var(--ink-2); vertical-align: bottom; font-weight: 500; }
.matrix thead th small { display: block; font-weight: 400; }
.matrix th[scope="row"] { text-align: left; font-weight: 700; min-width: 9rem; }
.matrix th[scope="row"] a { color: var(--ink); text-decoration: none; }
.matrix th[scope="row"] a:hover { color: var(--water); text-decoration: underline; }
.matrix .cell { font-weight: 700; background: var(--bg); color: var(--tx); position: relative; }
.matrix .cell[data-worst="1"] { box-shadow: inset 0 -4px 0 var(--lv1); }
.matrix .cell[data-worst="2"] { box-shadow: inset 0 -4px 0 var(--lv2); }
.matrix .cell[data-worst="3"] { box-shadow: inset 0 -4px 0 var(--lv3); }
.matrix .now { outline: 2px solid var(--water); outline-offset: -2px; }
.matrix tr.rain-row th, .matrix tr.rain-row td { background: var(--water-pale); color: var(--water-deep); font-weight: 500; }
.matrix .rain-bar { display: block; height: .4rem; background: var(--water-mid); border-radius: 3px; margin: .25rem auto 0; max-width: 100%; }
.matrix .rain-bar.past { background: #aab8d0; }
#fc-summary { color: var(--ink); }
.fc-note { font-size: .9rem; color: var(--ink-2); max-width: 75ch; margin-top: .9rem; }
.scroll-hint { display: none; }

/* ---------- Eventos ---------- */
.events { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.events li { display: flex; flex-wrap: wrap; gap: .3rem .9rem; align-items: center; padding: .8rem 1.2rem; border-bottom: 1px solid var(--line-soft); transition: background .15s; }
.events li:hover { background: var(--paper-2); }
.events li:last-child { border-bottom: 0; }
.events .when { color: var(--ink-2); font-size: .88rem; min-width: 8.5rem; }
.events .arrow { color: var(--ink-2); }

/* ---------- Botones y controles ---------- */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .65rem 1.4rem; border-radius: 999px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; border: 1.5px solid var(--btn); background: var(--btn); color: #fff; line-height: 1.2; transition: background .2s, border-color .2s; }
.btn:hover { background: var(--water-mid); border-color: var(--water-mid); color: #fff; }
.btn-ghost { background: transparent; color: var(--water); border-color: var(--line); }
.btn-ghost:hover { background: var(--water-pale); border-color: var(--water); color: var(--water); }
.btn-sm { padding: .4rem .95rem; font-size: .9rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--paper-2); padding: 3px; gap: 2px; }
.seg button { font: inherit; font-weight: 500; font-size: .92rem; border: 0; background: transparent; color: var(--ink-2); padding: .4rem 1rem; cursor: pointer; border-radius: 999px; transition: background .2s, color .2s; }
.seg button:hover { color: var(--water); }
.seg button[aria-pressed="true"] { background: var(--seg-on); color: var(--water); box-shadow: 0 1px 4px rgba(23,35,59,.14); }
.seg button:focus-visible { outline-offset: -3px; }
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; margin-bottom: 1.1rem; }

/* ---------- Estación ---------- */
.back { display: inline-block; margin-bottom: 1rem; font-weight: 500; text-decoration: none; }
.back:hover { text-decoration: underline; }
.st-head { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; align-items: center; margin-bottom: .25rem; }
.st-head h1 { margin: 0; font-size: clamp(2rem, 1.2rem + 3vw, 3rem); }
.st-grid { display: grid; gap: 1.5rem; margin-top: 2rem; }
@media (min-width: 62rem) { .st-grid { grid-template-columns: 19.5rem minmax(0, 1fr); } }
.reading { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.4rem; box-shadow: var(--shadow); }
.reading .big { font-size: 4.2rem; font-weight: 700; line-height: 1; letter-spacing: -.04em; color: var(--ink); }
.reading .unit { font-size: 1.2rem; font-weight: 500; margin-left: .3rem; color: var(--ink-2); letter-spacing: 0; }
.reading .cap { margin: .5rem 0 .9rem; color: var(--ink-2); }
.gauge { display: flex; gap: .7rem; margin-top: 1.2rem; }
.gauge-bar { position: relative; width: 3.2rem; height: 15rem; border-radius: 0 0 10px 10px; overflow: hidden; border-top: 3px solid #b9cde6; flex: none; }
.gauge-band { position: absolute; left: 0; right: 0; }
.gauge-mark { position: absolute; left: -2px; right: -2px; height: 0; border-top: 3px solid var(--ink); z-index: 2; }
.gauge-mark::after { content: ""; position: absolute; left: 100%; top: -8px; border: 7px solid transparent; border-right-color: var(--ink); transform: translateX(-2px) rotate(180deg); }
.gauge-labels { position: relative; flex: 1; font-size: .85rem; color: var(--ink-2); }
.gauge-labels div { position: absolute; transform: translateY(-50%); line-height: 1.2; }
.gauge-labels .now-lab { left: auto; right: 0; text-align: right; white-space: nowrap; background: var(--surface); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 999px; padding: 0 .45rem; z-index: 3; }
.params { margin: 1.2rem 0 0; display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; font-size: .93rem; }
.params dt { color: var(--ink-2); }
.params dd { margin: 0; font-weight: 700; text-align: right; }
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.2rem; min-width: 0; box-shadow: var(--shadow); }
.chart-box { position: relative; height: 22rem; }
.chart-card .toolbar { margin-bottom: .5rem; }
.chart-note { font-size: .86rem; color: var(--ink-2); margin: .7rem 0 0; }
.fc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .7rem; list-style: none; padding: 0; margin: 0; }
.fc-card { background: var(--bg); color: var(--tx); border: 1px solid var(--c); border-radius: var(--radius); padding: .75rem .9rem; }
.fc-card b { font-size: 1.8rem; display: block; line-height: 1.1; }
.fc-card small { display: block; }
.fc-card .rg { font-size: .83rem; }

/* ---------- Histórico ---------- */
.picker { display: flex; flex-wrap: wrap; gap: .45rem .55rem; margin: 0 0 1.2rem; padding: 0; border: 0; }
.picker legend { font-weight: 700; margin-bottom: .5rem; padding: 0; color: var(--ink); }
.chip { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: .3rem .9rem .3rem .65rem; cursor: pointer; font-size: .92rem; transition: border-color .2s, background .2s; }
.chip:hover { border-color: var(--water-mid); }
.chip:has(input:checked) { border-color: var(--water); background: var(--water-pale); }
.chip:has(input:focus-visible) { outline: 3px solid var(--water-mid); }
.chip i { width: .8rem; height: .8rem; border-radius: 50%; background: var(--sc, var(--water-mid)); flex: none; }
.chip input { accent-color: var(--water); }

/* ---------- Guía / teléfonos ---------- */
.jump { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.phase { margin-top: 4rem; scroll-margin-top: 6rem; }
.phase > h2 { padding-bottom: .6rem; border-bottom: 2px solid var(--water); display: flex; align-items: baseline; gap: .6rem; }
.phase.durante > h2 { border-color: var(--lv3); }
.phase.despues > h2 { border-color: var(--lv0); }
.guide-grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); margin-top: 1.5rem; }
.g-item { break-inside: avoid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.2rem 1.3rem; box-shadow: var(--shadow); }
.g-item h3 { display: flex; gap: .6rem; align-items: baseline; }
.g-item .ic { font-size: 1.3rem; line-height: 1; }
.g-item .prose { font-size: .98rem; color: var(--ink); }
.phones { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); margin-top: 1.1rem; }
.phone { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; color: var(--ink); box-shadow: var(--shadow); transition: border-color .2s, background .2s; }
a.phone:hover { border-color: var(--water); background: var(--paper-2); color: var(--ink); }
.phone.hl { border-color: var(--lv3); border-left-width: 5px; }
.phone .nm { font-weight: 700; display: block; color: var(--ink); }
.phone .no { font-size: 1.8rem; font-weight: 700; line-height: 1.15; color: var(--water); display: block; letter-spacing: -.02em; }
.phone .ds { font-size: .88rem; color: var(--ink-2); display: block; margin-top: .2rem; }
.cat-title { margin: 2.2rem 0 0; font-size: 1.1rem; }

/* ---------- Kit ---------- */
.kit-progress { position: sticky; top: 4.3rem; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: .9rem 0; z-index: 10; border-bottom: 1px solid var(--line-soft); margin-bottom: .5rem; }
.bar { height: .6rem; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: .5rem; }
.bar > i { display: block; height: 100%; background: var(--water); width: 0; border-radius: 999px; transition: width .5s var(--ease); }
.kit-cats { display: grid; gap: 2.2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); margin-top: 1.5rem; }
.kit-cat { break-inside: avoid; }
.kit-cat h2 { font-size: 1.3rem; margin-bottom: .15rem; }
.kit-cat > p { margin-bottom: .7rem; color: var(--ink-2); font-size: .93rem; }
.kit-list { list-style: none; margin: 0; padding: 0; }
.kit-list li { border-bottom: 1px solid var(--line-soft); }
.kit-list label { display: flex; gap: .8rem; padding: .7rem .3rem; cursor: pointer; align-items: flex-start; transition: background .15s; border-radius: 8px; }
.kit-list label:hover { background: var(--paper-2); }
.kit-list input { width: 1.3rem; height: 1.3rem; margin: .12rem 0 0; flex: none; accent-color: var(--water); }
.kit-list .t { font-weight: 500; }
.kit-list .d { display: block; font-size: .88rem; color: var(--ink-2); font-weight: 400; }
.kit-list input:checked + span .t { text-decoration: line-through; color: var(--ink-2); }
.tag { display: inline-block; margin-left: .4rem; padding: 0 .5rem; font-size: .72rem; font-weight: 700; border-radius: 999px; background: var(--lv2-tint); color: var(--lv2-text); border: 1px solid var(--lv2); vertical-align: .08em; }

/* ---------- Calles anegables ---------- */
.zones-layout { display: grid; gap: 1.5rem; margin-top: 1.5rem; }
@media (min-width: 62rem) { .zones-layout { grid-template-columns: minmax(0, 1fr) 21rem; align-items: start; } }

/* Panel de capas: tarjetas con interruptor, al estilo de un mapa de app */
.zone-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.zone-list li { border: 0; }
.zone-list button { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 1fr auto; gap: .15rem .8rem; align-items: center; width: 100%; padding: .95rem 1.05rem; cursor: pointer; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--c, var(--water)); border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color .2s, background .2s, opacity .2s; }
.zone-list button:hover { background: var(--paper-2); }
.zone-list button:focus-visible { outline: 3px solid var(--water-mid); outline-offset: 2px; }
.zone-list .nm { font-weight: 700; display: block; color: var(--ink); grid-column: 1; }
.zone-list .ds { font-size: .86rem; color: var(--ink-2); display: block; grid-column: 1; }
.zone-list .nm .ln { display: none; }
.zone-list button::before { content: ""; grid-column: 2; grid-row: 1 / span 2; width: 2.5rem; height: 1.45rem; border-radius: 999px; background: #cbd5e5; transition: background .2s; }
.zone-list button::after { content: ""; position: absolute; }
.zone-list button { position: relative; }
.zone-list button .nm::after { content: ""; position: absolute; right: calc(1.05rem + 1.2rem); top: 50%; width: 1.05rem; height: 1.05rem; margin-top: -.525rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(23,35,59,.3); transition: right .2s var(--ease); }
.zone-list button[aria-pressed="true"]::before { background: var(--c, var(--water)); }
.zone-list button[aria-pressed="true"] .nm::after { right: calc(1.05rem + .2rem); }
.zone-list button[aria-pressed="false"] .nm::after { right: calc(1.05rem + 1.2rem); }
.zone-list button:disabled { cursor: not-allowed; opacity: .55; }
.zone-list button[aria-pressed="false"] { border-left-color: #cbd5e5; }
.zone-list button[aria-pressed="false"] .nm { color: var(--ink-2); }

.sev { display: inline-block; font-size: .75rem; font-weight: 700; padding: 0 .6rem; border-radius: 999px; margin-right: .4rem; border: 1px solid; }
.sev.evitar { background: var(--lv3-tint); color: var(--lv3-text); border-color: var(--lv3); }
.sev.precaucion { background: var(--lv1-tint); color: var(--lv1-text); border-color: var(--lv1); }
.sev.activa { background: var(--lv3); color: #fff; border-color: var(--lv3); }
.map-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.3rem; font-size: .88rem; color: var(--ink-2); margin-top: .9rem; }
.map-legend span { display: inline-flex; align-items: center; gap: .45rem; }
.ln { width: 1.8rem; height: 0; border-top: 5px solid var(--c); display: inline-block; border-radius: 3px; }
.ln.dash { border-top-style: dashed; }
.badge-ex { background: var(--lv1-tint); border: 1px solid var(--lv1); color: var(--lv1-text); border-radius: 999px; padding: 0 .5rem; font-size: .75rem; font-weight: 700; }
.map-status { margin: .8rem 0 0; color: var(--ink-2); font-size: .93rem; }
.map-status.err { color: var(--lv3-text); font-weight: 600; }

/* Tarjeta flotante sobre el mapa (resumen + leyenda) */
.map-stage { position: relative; isolation: isolate; }
.map-card { position: absolute; z-index: 500; left: 1rem; bottom: 1.6rem; max-width: min(19rem, calc(100% - 2rem)); background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; box-shadow: 0 10px 30px -10px rgba(23,35,59,.3); font-size: .86rem; color: var(--ink-2); }
.map-card strong { display: block; color: var(--ink); font-size: .95rem; margin-bottom: .35rem; }
.map-card .map-legend { margin: 0; flex-direction: column; gap: .3rem; }
@media (max-width: 47.99rem) { .map-card { display: none; } }

/* ---------- Pie ---------- */
.site-foot { display: flow-root; position: relative; background: var(--surface-2); color: var(--ink-2); padding: 0 0 2.2rem; font-size: .92rem; margin-top: 2rem; border-top: 1px solid var(--line-soft); }
.site-foot .waves { height: 56px; margin-top: -56px; }
.site-foot a { color: var(--water); }
.foot-in { display: grid; gap: 1rem 2.5rem; padding-top: 1.5rem; }
@media (min-width: 52rem) { .foot-in { grid-template-columns: 1.4fr 1fr; } }
.foot-note { margin: 0 0 .5rem; color: var(--ink-2); }
.site-foot p { margin: 0 0 .4rem; }
.site-foot strong { color: var(--ink); }

/* ---------- Entrada suave (solo opacidad, una vez) ---------- */
.js-fx .reveal { opacity: 0; transition: opacity .6s ease; transition-delay: var(--d, 0s); }
.js-fx .reveal.in { opacity: 1; }
.js-fx .hero-in { animation: hero-in .7s ease both; animation-delay: var(--d, 0s); }
.js-fx .page-head h1::after { animation: line-grow .7s var(--ease) .3s both; }
@keyframes hero-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes line-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }


/* ---------- Modo oscuro: negro y blanco, estructura invertida ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0a1633;
  --paper-2: #122349;
  --surface: #0a1633;
  --surface-2: #122349;
  --ink: #ffffff;
  --ink-2: #cfcfcf;
  --line: #ffffff;
  --line-soft: #6b6b6b;
  --water: #6aa2ff;
  --water-deep: #9bc0ff;
  --water-mid: #6aa2ff;
  --water-pale: rgba(106, 162, 255, .16);
  --link: #8db6ff;
  --btn: #ffffff;
  --btn-ink: #000000;
  --btn-hover: #6aa2ff;
  --glass: #0a1633;
  --seg-on: #ffffff;
  --map-bg: #0e1d40;
  --tile-filter: invert(1) grayscale(1) brightness(.75) contrast(.95);
  --casing: #000000;
  --soil-a: #122349; --soil-b: #122349; --soil-hatch: #5a5a5a;
  --off-a: #122349; --off-b: #0a1633;
  --lv0: #3fd99a; --lv0-tint: #0d3a28; --lv0-text: #b5f5da;
  --lv1: #f5c242; --lv1-tint: #3f3006; --lv1-text: #ffe39a;
  --lv2: #ff9a4d; --lv2-tint: #442105; --lv2-text: #ffd0a8;
  --lv3: #ff6b7f; --lv3-tint: #4a111b; --lv3-text: #ffc0c9;
  --lvx: #9a9a9a; --lvx-tint: #1f1f1f; --lvx-text: #dcdcdc;
}

/* =====================================================================
   CAPA BRUTALISTA
   Una sola cosa memorable: el corte del terreno y los números grandes.
   El resto es callado: bordes gruesos, sin radio, sin sombra, sin degradado.
   ===================================================================== */

html { background: var(--paper); }
body { font-size: 1.0625rem; line-height: 1.55; font-variant-numeric: tabular-nums; }
a { text-decoration-thickness: 2px; text-underline-offset: .22em; }
:focus-visible { outline: 4px solid var(--water); outline-offset: 3px; border-radius: 0; }
::selection { background: var(--ink); color: var(--paper); }
.wrap { max-width: var(--maxw); padding-inline: var(--pad); }
@media (min-width: 48rem) { .wrap { padding-inline: var(--pad); } }
.skip { background: var(--ink); color: var(--paper); }

/* Tipografía */
h1, h2, h3, h4 { letter-spacing: -.03em; line-height: 1; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 1rem + 6vw, 8.5rem); font-weight: 800; letter-spacing: -.05em; line-height: .92; }
h2 { font-size: clamp(1.7rem, 1rem + 1.8vw, 3rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 800; letter-spacing: -.015em; line-height: 1.15; }
.lede { font-size: clamp(1.1rem, 1rem + .4vw, 1.4rem); color: var(--ink); max-width: 46ch; line-height: 1.4; }
.section-note { color: var(--ink); max-width: 62ch; }
.prose { max-width: 66ch; }
.prose blockquote { border-left: 8px solid var(--ink); background: var(--surface); border-radius: 0; }
.page-head h1::after, .eyebrow-line { display: none; }
.eyebrow { font-size: .95rem; font-weight: 700; color: var(--ink-2); margin-bottom: 1.4rem; letter-spacing: 0; }

/* Emergencias: la franja más oscura de la página */
.emerg { background: var(--ink); color: var(--paper); border-bottom: 0; font-size: .92rem; }
.emerg-label { color: var(--paper); opacity: .8; }
.emerg a, .emerg strong { color: var(--paper); }
.emerg a { text-decoration: none; }
.emerg a:hover, .emerg a:focus-visible { color: var(--paper); text-decoration: underline; text-decoration-thickness: 2px; }
.emerg strong { font-weight: 800; }

/* Cabecera */
.site-head { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 4px solid var(--ink); }
.site-head.scrolled { box-shadow: none; }
.head-in { padding-block: .6rem; gap: .6rem 1.5rem; }
.brand-logo, .brand-mark { width: 46px; height: 46px; }
:root[data-theme="dark"] .brand-logo { background: #fff; border-radius: 0; padding: 3px; }
.brand-text strong { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; }
.brand-text span { color: var(--ink-2); font-size: .82rem; }
.nav ul { gap: 0; }
.nav a { border-radius: 0; padding: .6rem .9rem; font-weight: 700; font-size: .95rem; color: var(--ink); }
.nav a:hover { background: transparent; color: var(--ink); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: .3em; }
.nav a[aria-current="page"] { background: var(--ink); color: var(--paper); text-decoration: none; }
.theme-toggle { border-radius: 0; border: var(--rule) solid var(--ink); width: 2.6rem; height: 2.6rem; }
.theme-toggle:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.nav-toggle { border-radius: 0; border: var(--rule) solid var(--ink); font-weight: 700; padding: .45rem 1.1rem; }
.nav-toggle:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
@media (max-width: 70rem) {
  .nav ul { border-top: var(--rule) solid var(--ink); }
  .nav a { border-radius: 0; border-bottom: 2px solid var(--line-soft); }
}

/* Avisos */
.notice { border-bottom: 4px solid var(--ink); font-weight: 600; }
.notice-info { background: var(--surface); color: var(--ink); }
.notice-warning { background: var(--lv1); color: #000; }
.notice-danger { background: var(--lv3); color: #fff; }
.notice-danger a { color: #fff; }
:root[data-theme="dark"] .notice-info { background: var(--paper); color: #fff; }
:root[data-theme="dark"] .notice-warning { background: var(--lv1); color: #000; }
:root[data-theme="dark"] .notice-danger { background: var(--lv3); color: #000; }
:root[data-theme="dark"] .notice-danger a { color: #000; }

/* Ritmo de página */
.main { padding-block: 3rem 6rem; }
.page-head { margin-bottom: 3rem; }
.section { margin-top: 6rem; }
.section > h2 { border-top: 4px solid var(--ink); padding-top: 1rem; margin-bottom: .8rem; }

/* Portada: titular enorme a la izquierda, texto a la derecha, estado debajo con regla gruesa */
.hero { display: block; margin-bottom: 2.5rem; }
.hero .page-head { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.6rem 4rem; }
.hero .eyebrow, .hero .status-line { grid-column: 1 / -1; }
.hero h1 { font-size: clamp(2.8rem, .8rem + 8.4vw, 11rem); margin: 0; }
.hero .lede { align-self: end; }
.hero .status-line { border-top: 4px solid var(--ink); padding-top: 1rem; margin-top: .6rem; }
@media (min-width: 62rem) {
  .hero .page-head { grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); }
}
.status-line { color: var(--ink); font-size: 1rem; gap: .4rem 2rem; margin-top: 1.5rem; }
.live-dot { border-radius: 0; width: .8rem; height: .8rem; background: var(--lv0); outline: 2px solid var(--ink); }
.live-dot.stale { background: var(--lv2); }

/* Estado (píldoras y bloques) */
.pill { border-radius: 0; border: 2px solid var(--ink); background: var(--bg); color: var(--tx); font-weight: 700; padding: .1rem .6rem .1rem .5rem; }
.tiles { gap: 0; margin-top: 2.2rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); padding: 0 var(--rule) var(--rule) 0; }
.tiles > li { margin: 0 calc(-1 * var(--rule)) calc(-1 * var(--rule)) 0; display: flex; }
.tile { border: var(--rule) solid var(--ink); border-radius: 0; box-shadow: none; padding: 1rem 1.2rem 1.1rem; background: var(--bg, var(--surface)); color: var(--tx, var(--ink)); transition: none; }
.tile::before { width: auto; height: 12px; right: 0; bottom: auto; background: var(--c); }
.tile:hover { border-color: var(--ink); text-decoration: underline; text-decoration-thickness: 3px; }
.tile b { font-size: clamp(3rem, 2rem + 3vw, 6rem); font-weight: 800; letter-spacing: -.05em; margin-top: .5rem; }
.tile span { font-size: .95rem; font-weight: 700; color: var(--tx, var(--ink)); }
.tile[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); text-decoration: none; }
.tile[aria-pressed="true"] span { color: var(--paper); }

/* Corte del terreno: el elemento memorable */
.profile { background: var(--surface); border: var(--rule) solid var(--ink); border-radius: 0; box-shadow: none; padding: 1.6rem clamp(1rem, 2vw, 2rem) 1.4rem; margin-top: 3rem; }
.profile-head h2 { font-size: clamp(1.6rem, 1rem + 1.6vw, 2.6rem); }
.profile-head p { color: var(--ink); max-width: 52ch; }
.axis { color: var(--ink); font-weight: 600; }
.axis span::after { border-top: 2px solid var(--ink); }
.core { max-width: 12rem; }
.core:hover .core-col { outline: 4px solid var(--ink); outline-offset: 0; }
.core-col { background: var(--water); border: var(--rule) solid var(--ink); border-radius: 0; }
.core-soil { background: repeating-linear-gradient(135deg, var(--soil-hatch) 0 2px, transparent 2px 10px), var(--soil-a); border-bottom: 5px solid var(--ink); }
.core-water-line { border-top: 5px solid var(--ink); }
.core-val { background: var(--ink); color: var(--paper); border: 0; border-radius: 0; font-weight: 800; font-size: .95rem; padding: .1rem .5rem; box-shadow: none; }
.core-tick { height: 6px; width: 14px; border-radius: 0; box-shadow: 0 0 0 2px var(--ink); }
.core.off .core-col { background: repeating-linear-gradient(135deg, var(--off-a) 0 8px, var(--off-b) 8px 16px); border-top-color: var(--ink); }
.core.off .core-val { background: var(--surface); color: var(--ink); border: 2px solid var(--ink); }
.core-head .pill { font-size: .72rem; }
.core-name { color: var(--ink); font-weight: 600; }
.profile-legend { color: var(--ink); }
.sw { border-radius: 0; border: 2px solid var(--ink); }
.sw-soil { background: repeating-linear-gradient(135deg, var(--soil-hatch) 0 2px, transparent 2px 5px), var(--soil-a); }
.sw-water { background: var(--water); }
.sw-tick { height: 6px; border: 0; background: var(--lv2); outline: 2px solid var(--ink); }

/* Tabla y mapa */
.split { gap: 2rem; margin-top: 4rem; }
.table-wrap, .mapbox, .matrix-wrap { background: var(--surface); border: var(--rule) solid var(--ink); border-radius: 0; box-shadow: none; }
.tbl caption { font-weight: 800; font-size: clamp(1.4rem, 1rem + 1vw, 2rem); letter-spacing: -.03em; padding: 1.2rem 1.2rem .8rem; }
.tbl th { background: var(--ink); color: var(--paper); font-weight: 700; font-size: .88rem; border-bottom: 0; padding: .75rem .85rem; }
.tbl th button { color: var(--paper); font-weight: 700; }
.tbl th button:hover { color: var(--paper); text-decoration: underline; text-decoration-thickness: 2px; }
.tbl th button:focus-visible { outline: 3px solid var(--paper); outline-offset: 2px; }
.tbl td { padding: .8rem .85rem; border-bottom: 2px solid var(--line-soft); }
.tbl tbody tr { transition: none; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl td.depth { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; }
.tbl .sub { color: var(--ink-2); }
.tbl a.st-link { font-weight: 800; }
.tbl a.st-link:hover { color: var(--water); }
.delta.up { color: var(--lv3-text); font-weight: 800; }
.delta.down { color: var(--lv0-text); font-weight: 800; }
.empty { color: var(--ink); }
.mapbox h2 { font-size: clamp(1.4rem, 1rem + 1vw, 2rem); border-bottom: var(--rule) solid var(--ink); padding: 1.1rem 1.2rem .8rem; }
.map-lg { border: var(--rule) solid var(--ink); border-radius: 0; box-shadow: none; }

/* Leaflet */
.leaflet-bar { border: 3px solid var(--ink) !important; border-radius: 0 !important; box-shadow: none !important; }
.leaflet-bar a { background: var(--surface) !important; color: var(--ink) !important; border-bottom: 2px solid var(--ink) !important; border-radius: 0 !important; }
.leaflet-bar a:hover { background: var(--ink) !important; color: var(--paper) !important; }
.leaflet-control-attribution { background: var(--paper) !important; color: var(--ink) !important; }
.leaflet-control-attribution a { color: var(--ink) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); box-shadow: none; border: 3px solid var(--ink); border-radius: 0; }
.leaflet-popup-tip { border-top: 0; border-left: 0; }
.leaflet-tooltip { background: var(--ink); color: var(--paper); border: 0; border-radius: 0; box-shadow: none; font-weight: 700; }
.leaflet-tooltip-top:before { border-top-color: var(--ink); }
.mk { border-radius: 0; background: var(--c); color: #000; border: 3px solid var(--ink); box-shadow: none; font-weight: 800; }
:root[data-theme="dark"] .leaflet-bar a:hover { background: var(--ink) !important; }

/* Pronóstico */
.matrix { border-spacing: 4px; }
.matrix th, .matrix td { border-radius: 0; }
.matrix thead th { color: var(--ink); font-weight: 700; }
.matrix .cell[data-worst="1"] { box-shadow: inset 0 -6px 0 var(--lv1); }
.matrix .cell[data-worst="2"] { box-shadow: inset 0 -6px 0 var(--lv2); }
.matrix .cell[data-worst="3"] { box-shadow: inset 0 -6px 0 var(--lv3); }
.matrix .now { outline: 4px solid var(--ink); outline-offset: -4px; }
.matrix tr.rain-row th, .matrix tr.rain-row td { background: var(--water-pale); color: var(--ink); font-weight: 700; }
.matrix .rain-bar { background: var(--water); border-radius: 0; height: .5rem; }
:root[data-theme="dark"] .matrix .rain-bar.past { background: #6b6b6b; }
.matrix .rain-bar.past { background: #8f908c; }
.matrix th[scope="row"] a:hover { color: var(--water); }
.fc-note { color: var(--ink); }
.scroll-hint { color: var(--ink); }

/* Eventos: filas separadas por regla, sin caja */
.events { background: transparent; border: 0; border-top: 4px solid var(--ink); border-radius: 0; box-shadow: none; }
.events li { border-bottom: 2px solid var(--line-soft); padding: .9rem .2rem; transition: none; }
.events li:hover { background: var(--surface-2); }
.events li:last-child { border-bottom: 2px solid var(--ink); }
.events .when { color: var(--ink); font-weight: 600; }
.events .arrow { color: var(--ink); }

/* Botones y controles */
.btn { border-radius: 0; border: var(--rule) solid var(--ink); background: var(--btn); color: var(--btn-ink); font-weight: 800; padding: .7rem 1.4rem; transition: none; }
.btn:hover { background: var(--btn-hover); border-color: var(--ink); color: #000; }
:root:not([data-theme="dark"]) .btn:hover { color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
:root:not([data-theme="dark"]) .btn-ghost:hover { color: var(--paper); }
.btn-sm { padding: .4rem .95rem; }
.seg { border: var(--rule) solid var(--ink); border-radius: 0; background: var(--surface); padding: 0; gap: 0; }
.seg button { border-radius: 0; color: var(--ink); font-weight: 700; padding: .5rem 1.1rem; border-right: 2px solid var(--ink); transition: none; }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; text-decoration: none; }
.chip { border-radius: 0; border: 2px solid var(--ink); background: var(--surface); transition: none; font-weight: 600; }
.chip:hover { background: var(--surface-2); border-color: var(--ink); }
.chip:has(input:checked) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip:has(input:focus-visible) { outline: 4px solid var(--water); }
.chip i { border-radius: 0; width: .9rem; height: .9rem; outline: 2px solid var(--paper); }
.chip input { accent-color: var(--water); }
.picker legend { font-weight: 800; }

/* Estación */
.back { font-weight: 700; color: var(--ink); }
.st-head h1 { font-size: clamp(2.4rem, 1rem + 5vw, 6rem); }
.reading, .chart-card { background: var(--surface); border: var(--rule) solid var(--ink); border-radius: 0; box-shadow: none; }
.reading .big { font-size: clamp(4.5rem, 3rem + 4vw, 8rem); font-weight: 800; letter-spacing: -.06em; }
.reading .unit { color: var(--ink); font-weight: 700; }
.reading .cap { color: var(--ink); }
.gauge-bar { border: var(--rule) solid var(--ink); border-radius: 0; }
.gauge-mark { border-top: 5px solid var(--ink); }
.gauge-mark::after { display: none; }
.gauge-labels { color: var(--ink); }
.gauge-labels .now-lab { border: 2px solid var(--ink); border-radius: 0; background: var(--ink); color: var(--paper); font-weight: 700; }
.params dt { color: var(--ink); }
.params dd { font-weight: 800; }
.chart-note { color: var(--ink); }
.fc-card { border: 2px solid var(--ink); border-radius: 0; background: var(--bg); color: var(--tx); border-top: 8px solid var(--c); }

/* Guía y teléfonos: las fases se marcan con una barra de color arriba */
.phase { margin-top: 6rem; }
.phase > h2 { border-bottom: 0; border-top: 12px solid var(--water); padding-top: 1rem; }
.phase.durante > h2 { border-top-color: var(--lv3); }
.phase.despues > h2 { border-top-color: var(--lv0); }
.guide-grid { gap: 2.5rem 2rem; margin-top: 2rem; }
.g-item { background: transparent; border: 0; border-top: 4px solid var(--ink); border-radius: 0; box-shadow: none; padding: 1rem 0 0; }
.g-item .prose { color: var(--ink); }
.phones { gap: 1rem; margin-top: 1.4rem; }
.phone { background: var(--surface); border: var(--rule) solid var(--ink); border-radius: 0; box-shadow: none; transition: none; padding: 1rem 1.2rem; }
a.phone:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
a.phone:hover .nm, a.phone:hover .no, a.phone:hover .ds { color: var(--paper); }
.phone.hl { border-left-width: 14px; border-left-color: var(--lv3); }
.phone .no { color: var(--ink); font-weight: 800; font-size: 2.2rem; letter-spacing: -.04em; }
.phone .ds { color: var(--ink-2); }
.cat-title { font-size: 1.3rem; border-top: 4px solid var(--ink); padding-top: .8rem; }
.jump { gap: .6rem; }

/* Kit */
.kit-progress { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: var(--rule) solid var(--ink); top: 4.6rem; }
.bar { height: 1.2rem; border: var(--rule) solid var(--ink); border-radius: 0; background: var(--surface); }
.bar > i { background: var(--ink); border-radius: 0; }
.kit-cat h2 { font-size: 1.6rem; border-top: 4px solid var(--ink); padding-top: .8rem; }
.kit-cat > p { color: var(--ink); }
.kit-list li { border-bottom: 2px solid var(--line-soft); }
.kit-list label { border-radius: 0; transition: none; }
.kit-list label:hover { background: var(--surface-2); }
.kit-list input { accent-color: var(--ink); width: 1.4rem; height: 1.4rem; }
.kit-list .t { font-weight: 700; }
.kit-list .d { color: var(--ink-2); }
.tag { border-radius: 0; border: 2px solid var(--ink); background: var(--lv1); color: #000; font-weight: 800; }

/* Calles anegables: capas con interruptor rectangular */
.zone-list { gap: .8rem; }
.zone-list button { background: var(--surface); border: var(--rule) solid var(--ink); border-left: 14px solid var(--c, var(--water)); border-radius: 0; box-shadow: none; transition: none; }
.zone-list button:hover { background: var(--surface-2); }
.zone-list button:focus-visible { outline: 4px solid var(--water); }
.zone-list .nm { font-weight: 800; }
.zone-list .ds { color: var(--ink-2); }
.zone-list button::before { border-radius: 0; background: var(--surface-2); border: 3px solid var(--ink); width: 2.7rem; height: 1.5rem; }
.zone-list button .nm::after { border-radius: 0; width: 1rem; height: 1rem; margin-top: -.5rem; background: var(--ink); box-shadow: none; right: calc(1.05rem + 1.4rem); }
.zone-list button[aria-pressed="true"]::before { background: var(--c, var(--water)); }
.zone-list button[aria-pressed="true"] .nm::after { right: calc(1.05rem + .3rem); }
.zone-list button[aria-pressed="false"] .nm::after { right: calc(1.05rem + 1.4rem); }
.zone-list button[aria-pressed="false"] { border-left-color: var(--line-soft); }
.zone-list button[aria-pressed="false"] .nm { color: var(--ink-2); }
:root[data-theme="dark"] .zone-list button[aria-pressed="false"]::before { background: var(--surface-2); }
:root[data-theme="dark"] .zone-list button[aria-pressed="false"] { border-left-color: var(--line-soft); }
.sev { border-radius: 0; border: 2px solid var(--ink); font-weight: 800; }
.sev.activa { background: var(--lv3); color: #fff; }
:root[data-theme="dark"] .sev.activa { color: #000; }
.map-legend { color: var(--ink); }
.ln { border-top-width: 6px; border-radius: 0; }
.badge-ex { border-radius: 0; border: 2px solid var(--ink); background: var(--lv1); color: #000; font-weight: 800; }
.map-status { color: var(--ink); }
.map-status.err { color: var(--lv3-text); font-weight: 800; }
.map-card { background: var(--paper); border: var(--rule) solid var(--ink); border-radius: 0; box-shadow: none; color: var(--ink); }

/* Pie: invierte la página */
.site-foot { background: var(--ink); color: var(--paper); border-top: 0; margin-top: 4rem; padding: 3rem 0 3rem; font-size: 1rem; }
.site-foot .waves, .waves { display: none; }
.site-foot a, .site-foot strong, .foot-note { color: var(--paper); }
.site-foot a { text-decoration-thickness: 2px; }
.site-foot a:hover { color: var(--paper); text-decoration-thickness: 4px; }
.foot-in { padding-top: 0; }
:root[data-theme="dark"] .site-foot { background: var(--ink); }

/* Movimiento: solo la entrada del titular y el llenado del corte. Nada por scroll. */
.js-fx .reveal { opacity: 1; transition: none; }

/* Impresión */
@media print {
  .g-item, .phone { border: 2px solid #000; background: #fff; }
  .g-item { border-width: 2px 0 0; }
}

/* ---------- Celulares ---------- */
@media (max-width: 47.99rem) {
  html { scroll-padding-top: 4.5rem; }
  h1 { font-size: clamp(1.9rem, 1.4rem + 3.4vw, 2.5rem); }
  .main { padding-block: 1.6rem 2.6rem; }
  .section { margin-top: 2.6rem; }
  .page-head { margin-bottom: 1.4rem; }
  .lede { font-size: 1.03rem; }
  .emerg { font-size: .82rem; }
  .emerg-in { padding-block: .4rem; gap: .2rem .9rem; }
  .emerg ul { gap: .1rem .9rem; }
  .notice { padding: .6rem 0; font-size: .88rem; }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); gap: .6rem; }
  .tile { padding: .55rem .7rem .6rem; }
  .tile b { font-size: 1.9rem; }
  .tile span { font-size: .74rem; }
  .profile { padding: 1.1rem .85rem 1rem; }
  .profile-legend { padding-left: 0; }
  .axis { width: 2.1rem; font-size: .72rem; }
  .core { flex: 0 0 3.9rem; min-width: 3.9rem; }
  .core-name { font-size: .74rem; }
  .table-wrap-cards { overflow: visible; }
  .tbl-cards caption { display: block; width: 100%; padding: .9rem 1rem .3rem; font-size: 1.12rem; }
  .tbl-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl-cards, .tbl-cards tbody, .tbl-cards tr, .tbl-cards td { display: block; width: 100%; }
  .tbl-cards tr { position: relative; padding: .85rem 1rem .9rem; }
  .tbl-cards tr + tr { border-top: 1px solid var(--line-soft); }
  .tbl-cards td { padding: .18rem 0; border: 0; }
  .tbl-cards td.nowrap .sub { display: inline; margin-left: .45rem; }
  .tbl-cards td::before { content: attr(data-label); display: inline-block; min-width: 6.6rem; margin-right: .5rem; font-size: .72rem; color: var(--ink-2); font-weight: 500; vertical-align: .1em; }
  .tbl-cards td:first-child { padding-bottom: .4rem; padding-right: 5rem; }
  .tbl-cards td:first-child::before { display: none; }
  .tbl-cards td.depth { position: absolute; top: .85rem; right: 1rem; text-align: right; font-size: 1.05rem; }
  .tbl-cards td.depth::before { display: none; }
  .matrix { min-width: 27rem; font-size: .86rem; }
  .matrix th, .matrix td { padding: .45rem .35rem; }
  .matrix thead th { font-size: .72rem; }
  .matrix th[scope="row"] { min-width: 7.5rem; }
  .scroll-hint { display: block; margin: .55rem 0 0; font-size: .82rem; color: var(--ink-2); }
  .picker { gap: .4rem; }
  .picker .chip { flex: 1 1 8.5rem; padding: .4rem .6rem; font-size: .85rem; }
  .events li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem .6rem; padding: .8rem 1rem; }
  .events .when { grid-column: 1 / -1; min-width: 0; }
  .events .ev-st { grid-column: 1; grid-row: 2; }
  .events .ev-num { grid-column: 2; grid-row: 2; text-align: right; }
  .events .ev-flow { grid-column: 1 / -1; grid-row: 3; display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .5rem; }
  .map { height: 20rem; }
  .map-lg { height: min(60vh, 28rem); min-height: 18rem; }
  .reading .big { font-size: 3.4rem; }
  .gauge { gap: .5rem; }
  .chart-box { height: 17rem; }
}

/* ---------- Impresión ---------- */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  h1, h2, h3, h4, .phone .nm, .zone-list .nm, .prose strong { color: #000; }
  .emerg, .site-head, .notice, .site-foot, .nav-toggle, .jump, .no-print, .kit-progress, .toolbar, .waves, .hero .ill { display: none !important; }
  .main { padding: 0; }
  a { color: inherit; text-decoration: none; }
  .phase, .kit-cat, .g-item { break-inside: avoid; }
  .g-item, .phone { border: 1px solid #999; background: #fff; box-shadow: none; }
  .g-item .prose, .phone .ds, .muted, .kit-list .d { color: #333; }
  .phone .no { color: #000; }
  .js-fx .reveal { opacity: 1 !important; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
  .js-fx .reveal { opacity: 1; }
}
