/* NiñoSim · Carta hidrográfica. Ver DESIGN.md */
:root {
  --paper: #edf2f4; --sheet: #f8fafb; --ink: #0b2a3c; --ink-2: #45606f; --rule: #c9d6dd;
  --sea: #0f5878; --sea-ink: #ffffff; --water: #1c8fb8;
  --c0: #efe3c2; --c1: #d9a13f; --c2: #9e3a2a;
  --r-high: #9e3a2a; --r-med: #d98e2b; --r-low: #8a9aa4;
  --dry: #b7b496;
  --contour: rgba(15, 88, 120, .13);
  --shadow: 0 1px 2px rgba(11, 42, 60, .06), 0 8px 24px -12px rgba(11, 42, 60, .22);
  --tile-filter: grayscale(1) contrast(.88) brightness(1.06);
  --wide: 115; --gutter: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0a1820; --sheet: #0f222d; --ink: #e3edf1; --ink-2: #97aebb; --rule: #22404f;
    --sea: #69c0da; --sea-ink: #062330; --water: #4fb3d9;
    --c0: #2a3b3a; --c1: #c9963d; --c2: #e0644a;
    --r-high: #f07455; --r-med: #e3a84a; --r-low: #5e7482;
    --dry: #4d5444;
    --contour: rgba(105, 192, 218, .1);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .7);
    --tile-filter: grayscale(1) invert(1) contrast(.85) brightness(.82) hue-rotate(180deg);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* que display:grid/flex no anule el atributo hidden */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem; line-height: 1.55; font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--sea); color: var(--sea-ink); }
:focus-visible { outline: 3px solid var(--sea); outline-offset: 3px; border-radius: 6px; }
a { color: var(--sea); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
h2, h3, .big, h1 { text-wrap: balance; }
* { scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }

/* Masthead */
.masthead {
  position: relative; isolation: isolate; overflow: hidden; color: var(--ink);
  padding: 28px var(--gutter) 20px; max-width: 1200px; margin: 0 auto;
}
.contours { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--contour); z-index: -1; }
.brand { display: flex; align-items: center; gap: 10px; }
.mark { width: 34px; height: 34px; flex: none; }
.mark rect { fill: var(--ink); }
.mark path { fill: none; stroke-width: 2.6; stroke-linecap: round; }
.mark .w1 { stroke: #69c0da; } .mark .w2 { stroke: #d9a13f; }
@media (prefers-color-scheme: dark) { .mark rect { fill: #163746; } }
h1 {
  font-size: 1.75rem; font-weight: 800; font-stretch: 120%; font-variation-settings: "wdth" 120;
  letter-spacing: -.02em; line-height: 1;
}
h1 span { color: var(--sea); }
.tagline { margin-top: 10px; color: var(--ink-2); font-size: 1.02rem; max-width: 34ch; }

/* Sheet layout */
.sheet {
  max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter) 48px;
  display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr);
}

/* en móvil el panel se disuelve para que el control quede pegado durante todo el scroll */
.overview, .panel { display: contents; }

/* Intensity gauge */
.control {
  position: sticky; top: 0; z-index: 1000;
  margin: 0 calc(var(--gutter) * -1); padding: 10px var(--gutter) 12px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.control.stuck { border-bottom-color: var(--rule); }
.control-label { font-size: .8rem; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.gauge {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; padding: 3px;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow);
}
.gauge button {
  position: relative; display: grid; gap: 1px; justify-items: center; align-content: center;
  min-height: 56px; padding: 8px 2px 12px; border-radius: 11px; color: var(--ink);
  transition: background-color .2s cubic-bezier(.2, .8, .2, 1), color .2s;
}
.gauge button span { font-weight: 700; font-size: .92rem; line-height: 1.15; }
.gauge button small { font-size: .74rem; color: var(--ink-2); font-weight: 500; }
.gauge button::after {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: 6px; height: 3px; border-radius: 2px;
  background: var(--k); opacity: .9;
}
.gauge button[data-i="0"] { --k: var(--c0); }
.gauge button[data-i="1"] { --k: color-mix(in srgb, var(--c0), var(--c1)); }
.gauge button[data-i="2"] { --k: var(--c1); }
.gauge button[data-i="3"] { --k: var(--c2); }
.gauge button:hover:not(.on) { background: color-mix(in srgb, var(--rule) 45%, transparent); }
.gauge button.on { background: var(--ink); color: var(--paper); }
.gauge button.on small { color: color-mix(in srgb, var(--paper) 78%, var(--ink)); }
.rain { margin-top: 8px; font-size: .88rem; color: var(--ink-2); font-style: italic; text-align: center; }

/* Hoy: estado del mar */
.now {
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow);
  padding: 14px 16px 12px; display: grid; gap: 4px;
}
.now-kicker { display: flex; align-items: center; gap: 7px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c1); }
.dot.hot { background: var(--c2); box-shadow: 0 0 0 0 color-mix(in srgb, var(--c2) 50%, transparent); animation: pulse 2s ease-out infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 8px transparent; } }
.now-title { font-size: 1.2rem; font-weight: 800; font-stretch: 112%; font-variation-settings: "wdth" 112; letter-spacing: -.015em; line-height: 1.15; }
.now-text { font-size: .92rem; color: var(--ink-2); }
.now-note { font-size: .78rem; color: var(--ink-2); font-style: italic; margin-top: -2px; }
.now-text b { color: var(--ink); }
.spark { width: 100%; height: 44px; margin-top: 6px; display: block; }
.spark polyline { fill: none; stroke: var(--c2); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark .th line { stroke: var(--rule); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.now-more { margin-top: 6px; font-size: .82rem; color: var(--ink-2); }
.now-more summary { cursor: pointer; font-weight: 600; color: var(--sea); list-style: none; min-height: 32px; display: flex; align-items: center; }
.now-more summary::-webkit-details-marker { display: none; }
.now-more summary::after { content: "›"; margin-left: 6px; transition: transform .2s; }
.now-more[open] summary::after { transform: rotate(90deg); }
.now-more p + p { margin-top: 6px; }

/* "hoy" en el medidor */
.gauge button.today::before {
  content: "hoy"; position: absolute; top: -9px; left: 50%; transform: translateX(-50%); z-index: 1; padding: 1px 6px; border-radius: 5px;
  font-size: .6rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; line-height: 1.5;
  background: var(--c2); color: #fff; box-shadow: 0 0 0 2px var(--sheet);
}

/* Cuándo: temporada o mes */
.months {
  display: grid; grid-template-columns: auto repeat(7, minmax(0, 1fr)); gap: 2px; margin-top: 8px; padding: 3px;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px;
}
.months button {
  min-height: 36px; padding: 0 6px; border-radius: 9px; font-size: .8rem; font-weight: 600; white-space: nowrap;
  color: var(--ink-2); transition: background-color .2s, color .2s;
}
.months button:first-child { padding: 0 10px; }
.months button:hover:not(.on) { background: color-mix(in srgb, var(--rule) 45%, transparent); color: var(--ink); }
.months button.on { background: var(--ink); color: var(--paper); }

/* Answer */
.answer { padding: 8px 0 0; }
.big {
  font-size: clamp(3rem, 14vw, 4.75rem); font-weight: 850; line-height: .95;
  font-stretch: 118%; font-variation-settings: "wdth" 118; letter-spacing: -.035em;
}
.where { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 700; font-size: 1.05rem; }
.where::before {
  content: ""; width: 14px; height: 14px; flex: none; border-radius: 4px;
  background: var(--sw, var(--c1)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 25%, transparent);
}
.sentence { margin-top: 6px; color: var(--ink-2); max-width: 46ch; font-size: 1rem; }

.facts { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--rule); }
.facts h3 { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
.facts ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: .9rem; }
.facts .src { font-size: .78rem; white-space: nowrap; }
.facts .src::before { content: "— "; color: var(--ink-2); }

/* Legend */
.legend { margin-top: 18px; }
.chart .legend { max-width: 460px; margin-inline: auto; }
.legend-bar { position: relative; height: 10px; border-radius: 3px; overflow: hidden; border: 1px solid var(--rule); }
.legend-bar i {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--c0), var(--c1) 50%, var(--c2));
}
.legend-labels { display: flex; justify-content: space-between; margin-top: 6px; font-size: .8rem; color: var(--ink-2); }
.legend-dry { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .8rem; color: var(--ink-2); }
.legend-dry i { width: 22px; height: 10px; border-radius: 3px; background: var(--dry); border: 1px solid var(--rule); flex: none; }
.note { margin-top: 14px; font-size: .8rem; color: var(--ink-2); font-style: italic; max-width: 44ch; }

/* Chart frame (neatline doble + ticks) */
.chart { margin: 0; }
.frame {
  position: relative; background: var(--sheet); border: 1px solid var(--ink); border-radius: 4px;
  padding: 3px; box-shadow: var(--shadow);
}
.frame::before {
  content: ""; position: absolute; inset: 3px; border: 1px solid var(--rule); border-radius: 2px; pointer-events: none; z-index: 1;
}
.tick { position: absolute; width: 10px; height: 10px; pointer-events: none; z-index: 2; }
.tick::before, .tick::after { content: ""; position: absolute; background: var(--ink); }
.tick::before { width: 10px; height: 1px; top: 4.5px; } .tick::after { width: 1px; height: 10px; left: 4.5px; }
.tl { top: -5px; left: -5px; } .tr { top: -5px; right: -5px; } .bl { bottom: -5px; left: -5px; } .br { bottom: -5px; right: -5px; }
#map { width: 100%; height: auto; max-height: 72vh; display: block; padding: 14px; }
#map path { stroke: var(--sheet); cursor: pointer; transition: fill .25s cubic-bezier(.2, .8, .2, 1); }
#map path:hover { filter: brightness(1.06) saturate(1.1); }
#map path:focus { outline: none; }
#map path:focus-visible, #map path.sel { stroke: var(--ink); }
.north { position: absolute; top: 16px; right: 16px; width: 22px; height: 33px; z-index: 2; }
.north path { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.2; stroke-linejoin: round; }
.north .half { fill: var(--ink); }
.north text { font: 700 9px "Archivo", sans-serif; fill: var(--ink); }
figcaption { margin-top: 10px; font-size: .85rem; color: var(--ink-2); font-style: italic; text-align: center; }
.rainfx { pointer-events: none; }
.rainfx line { stroke: var(--water); opacity: .55; stroke-linecap: round; animation: drop 1s linear infinite; }
@keyframes drop { from { transform: translateY(-6px); opacity: 0; } 20% { opacity: .7; } to { transform: translateY(6px); opacity: 0; } }

/* City */
.city { display: grid; gap: 18px; padding-top: 28px; border-top: 1px solid var(--rule); }
.city-head h2 {
  font-size: clamp(1.5rem, 6vw, 2.1rem); font-weight: 800; line-height: 1.05;
  font-stretch: 112%; font-variation-settings: "wdth" 112; letter-spacing: -.025em;
}
.city-head p { margin-top: 8px; color: var(--ink-2); max-width: 56ch; }
.city-tools { display: grid; gap: 12px; }
.search {
  display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 14px;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow);
  transition: border-color .2s;
}
.search:focus-within { border-color: var(--sea); }
.search svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; }
.search input {
  flex: 1; min-width: 0; height: 46px; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 1rem; color: var(--ink); caret-color: var(--sea);
}
.search input::placeholder { color: var(--ink-2); opacity: 1; }
.search button {
  height: 46px; padding: 0 18px; border-radius: 11px; background: var(--sea); color: var(--sea-ink); font-weight: 700;
  transition: filter .2s;
}
.search button:hover { filter: brightness(1.1); }
.search button:disabled { opacity: .6; cursor: progress; }
.chips {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter);
  margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter) 6px; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: none; scroll-snap-align: start; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--sheet); font-size: .9rem; font-weight: 600; white-space: nowrap;
  transition: border-color .2s, background-color .2s, color .2s;
}
.chips button:hover { border-color: var(--ink-2); }
.chips button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.city-body { display: grid; gap: 18px; }
.frame-city { padding: 3px; align-self: start; }
#cityMap { height: 62vh; min-height: 340px; max-height: 620px; border-radius: 2px; z-index: 0; background: var(--sheet); }
.leaflet-tile-pane { filter: var(--tile-filter); }
.leaflet-container { font: inherit; }
.leaflet-bar { border: 1px solid var(--rule) !important; box-shadow: var(--shadow) !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-bar a { width: 40px !important; height: 40px !important; line-height: 40px !important; background: var(--sheet) !important; color: var(--ink) !important; border-color: var(--rule) !important; }
.leaflet-bar a:hover { background: var(--paper) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--sheet); color: var(--ink); box-shadow: var(--shadow); }
.leaflet-popup-content-wrapper { border-radius: 10px; border: 1px solid var(--rule); }
.leaflet-popup-content { margin: 12px 14px; font-size: .9rem; line-height: 1.4; }
.leaflet-container a.leaflet-popup-close-button { color: var(--ink-2); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--sheet) 85%, transparent) !important; color: var(--ink-2) !important; }
.leaflet-control-attribution a { color: var(--sea) !important; }

.gazetteer { display: grid; gap: 14px; align-content: start; }
.legend2 { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .82rem; color: var(--ink-2); }
.legend2 span { display: inline-flex; align-items: center; gap: 7px; }
.legend2 span::before { content: ""; width: 18px; height: 5px; border-radius: 3px; background: var(--k); }
.legend2 .wtr { font-style: italic; }
.status { font-size: .88rem; color: var(--ink-2); }
.status.busy::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; vertical-align: -1px;
  border: 2px solid var(--rule); border-top-color: var(--sea); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gazetteer h3 {
  font-size: .82rem; font-weight: 700; color: var(--ink-2); padding-bottom: 8px; border-bottom: 1px solid var(--ink);
}
.toproads { list-style: none; margin: -6px 0 0; padding: 0; counter-reset: rd; }
.toproads li { counter-increment: rd; border-bottom: 1px solid var(--rule); }
.toproads li.empty { counter-increment: none; padding: 12px 0; color: var(--ink-2); font-size: .9rem; font-style: italic; }
.toproads button {
  display: grid; grid-template-columns: 2ch 1fr auto; align-items: baseline; gap: 10px; width: 100%;
  min-height: 48px; padding: 10px 4px; text-align: left; border-radius: 6px; transition: background-color .15s;
}
.toproads button::before { content: counter(rd); color: var(--ink-2); font-size: .82rem; font-weight: 600; }
.toproads button:hover { background: color-mix(in srgb, var(--rule) 40%, transparent); }
.toproads b { font-weight: 650; line-height: 1.3; }
.toproads b i { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--r-med); vertical-align: 1px; }
.toproads b i.hi { background: var(--r-high); }
.toproads small { color: var(--ink-2); font-size: .82rem; white-space: nowrap; }

/* Colophon */
.colophon {
  max-width: 1200px; margin: 0 auto; padding: 22px var(--gutter) 40px; display: grid; gap: 4px;
  border-top: 1px solid var(--rule); font-size: .85rem; color: var(--ink-2);
}
.colophon p:first-child { color: var(--ink); font-weight: 600; }
.colophon .small { font-size: .78rem; margin-top: 6px; }

/* Zonas propensas a acumular agua */
.zonas { display: grid; gap: 18px; padding-top: 28px; border-top: 1px solid var(--rule); }
.gauge-rain button { min-height: 48px; }
.control-label small { font-weight: 500; }
.disclaimer {
  padding: 12px 14px; border: 1px solid var(--ink); border-left-width: 4px; border-radius: 6px;
  background: var(--sheet); font-size: .9rem; line-height: 1.45; max-width: 80ch;
}
.zonas-body { display: grid; gap: 18px; }
.zonas-controls { display: grid; gap: 18px; align-content: start; }
.zonas-results { align-content: start; }
.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 1100; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 4px;
  list-style: none; max-height: 320px; overflow-y: auto;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow);
}
.combo-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  min-height: 44px; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-weight: 600;
}
.combo-list li small { color: var(--ink-2); font-weight: 500; font-size: .8rem; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: color-mix(in srgb, var(--rule) 55%, transparent); }
.combo-list li.none { cursor: default; font-weight: 500; color: var(--ink-2); font-style: italic; }
.combo-list li.none:hover { background: none; }
.forecast { margin-top: 10px; font-size: .88rem; color: var(--ink); }
.forecast small { display: block; color: var(--ink-2); font-style: italic; }
.map-msg {
  position: absolute; z-index: 500; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 80%;
  padding: 12px 16px; border-radius: 10px; background: var(--sheet); border: 1px solid var(--rule);
  box-shadow: var(--shadow); font-weight: 600; text-align: center;
}
#floodMap[aria-busy="true"] { opacity: .7; transition: opacity .2s; }
.km { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.km div { padding: 8px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--sheet); }
.km dt { font-size: .75rem; color: var(--ink-2); font-weight: 600; }
.km dd { margin: 2px 0 0; font-weight: 750; font-size: 1.05rem; }
.km dd small { display: block; font-weight: 500; font-size: .75rem; color: var(--ink-2); }
.pop { margin: 8px 0 6px; border-collapse: collapse; font-size: .82rem; }
.pop td { padding: 2px 10px 2px 0; border-top: 1px solid var(--rule); }
.gauge-rain button[data-r="0"] { --k: color-mix(in srgb, var(--water) 30%, var(--sheet)); }
.gauge-rain button[data-r="1"] { --k: color-mix(in srgb, var(--water) 60%, var(--sheet)); }
.gauge-rain button[data-r="2"] { --k: var(--water); }
.gauge-rain button[data-r="3"] { --k: var(--sea); }
#floodMap { height: 62vh; min-height: 340px; max-height: 620px; border-radius: 2px; z-index: 0; background: var(--sheet); }
.sheet-zonas { margin-top: 28px; }
.official { margin: 0; padding: 14px 0 0; border: 0; border-top: 1px solid var(--rule); display: grid; gap: 8px; }
.official legend { padding: 0; float: left; width: 100%; margin-bottom: 4px; }
.official label { display: flex; gap: 10px; align-items: center; min-height: 32px; font-size: .92rem; cursor: pointer; }
.official input { width: 18px; height: 18px; accent-color: var(--sea); }
.cen-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--ink-2); }
.cen-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cen-legend img { width: 16px; height: 12px; border-radius: 2px; }
.report { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--rule); display: grid; gap: 10px; }
.report h3 { border: 0; padding: 0; font-size: .95rem; color: var(--ink); }
.btn {
  min-height: 44px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--rule); background: var(--sheet);
  font-weight: 650; color: var(--ink); justify-self: start; transition: border-color .2s, filter .2s;
}
.btn:hover { border-color: var(--ink-2); }
.btn-primary { background: var(--sea); color: var(--sea-ink); border-color: var(--sea); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { border-color: transparent; background: none; }
.rep-form { display: grid; gap: 10px; }
.rep-form label { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.rep-form input, .rep-form textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--sheet); border: 1px solid var(--rule);
  border-radius: 10px; padding: 10px 12px; width: 100%;
}
.rep-form input:focus, .rep-form textarea:focus { outline: 2px solid var(--sea); outline-offset: 1px; }
.rep-where { font-size: .9rem; font-weight: 600; }
.rep-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#floodMap.picking { cursor: crosshair; }
.colophon .aviso { color: var(--ink); font-weight: 500; }

/* Desktop */
@media (min-width: 960px) {
  :root { --gutter: 32px; }
  .masthead { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-top: 36px; padding-bottom: 28px; }
  .tagline { margin: 0; text-align: right; }
  h1 { font-size: 2.1rem; }
  .sheet { row-gap: 56px; }
  /* el panel queda fijo solo mientras se ve el mapa del Perú, no encima de la sección ciudad */
  .overview { display: grid; grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); column-gap: 56px; }
  .panel { display: block; }
  /* el mapa acompaña al panel mientras se lee (el panel es más largo que el mapa) */
  .chart { position: sticky; top: 24px; align-self: start; }
  .control { position: static; margin: 0; padding: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; }
  .rain { text-align: left; }
  .now { margin-bottom: 22px; }

  .answer { padding-top: 32px; }
  .big { font-size: 4.4rem; }
  /* mapa + leyenda caben en la pantalla para que el bloque pueda quedar fijo */
  #map { height: calc(100vh - 290px); max-height: 760px; min-height: 380px; width: 100%; padding: 20px; }
  .chart .legend { margin-top: 12px; }
  .chart .note { margin-top: 8px; }
  .city { padding-top: 48px; gap: 22px; }
  .city-tools { grid-template-columns: minmax(280px, 420px) 1fr; align-items: center; gap: 16px; }
  .chips { margin: 0; padding: 2px 0 4px; flex-wrap: wrap; overflow: visible; }
  .city-body { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 32px; }
  #cityMap { height: 560px; max-height: none; }
  #floodMap { max-height: none; }
  .zonas { padding-top: 48px; gap: 22px; }
  /* espejo de "Mira tu ciudad": aquí los controles y resultados van a la izquierda y el mapa a la derecha */
  .zonas-body {
    grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); grid-template-rows: auto 1fr;
    grid-template-areas: "controls map" "results map"; column-gap: 40px; row-gap: 26px;
  }
  .zonas-controls { grid-area: controls; }
  .zonas-results { grid-area: results; padding-top: 22px; border-top: 1px solid var(--rule); }
  .zonas-map { grid-area: map; position: sticky; top: 24px; align-self: start; }
  #floodMap { height: min(720px, calc(100vh - 56px)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .rainfx line { animation: none; }
}
